#include "protos.h"
#include "cluster.h"
#include "ocrfeatures.h"
#include "callcpp.h"
#include "picofeat.h"
Go to the source code of this file.
Classes |
struct | FRECT |
Defines |
#define | WORST_MATCH_ALLOWED (0.9) |
#define | WORST_EVIDENCE (1.0) |
#define | MAX_LENGTH_MISMATCH (2.0 * GetPicoFeatureLength ()) |
#define | PROTO_SUFFIX ".mf.p" |
#define | CONFIG_SUFFIX ".cl" |
#define | NO_PROTO (-1) |
#define | XPOSITION 0 |
#define | YPOSITION 1 |
#define | MFLENGTH 2 |
#define | ORIENTATION 3 |
#define | CenterX(M) ( (M)[XPOSITION] ) |
#define | CenterY(M) ( (M)[YPOSITION] ) |
#define | LengthOf(M) ( (M)[MFLENGTH] ) |
#define | OrientationOf(M) ( (M)[ORIENTATION] ) |
Functions |
FLOAT32 | CompareProtos (PROTO p1, PROTO p2) |
void | ComputeMergedProto (PROTO p1, PROTO p2, FLOAT32 w1, FLOAT32 w2, PROTO MergedProto) |
int | FindClosestExistingProto (CLASS_TYPE Class, int NumMerged[], PROTOTYPE *Prototype) |
void | MakeNewFromOld (PROTO New, PROTOTYPE *Old) |
FLOAT32 | SubfeatureEvidence (FEATURE Feature, PROTO Proto) |
double | EvidenceOf (register double Similarity) |
BOOL8 | DummyFastMatch (FEATURE Feature, PROTO Proto) |
void | ComputePaddedBoundingBox (PROTO Proto, FLOAT32 TangentPad, FLOAT32 OrthogonalPad, FRECT *BoundingBox) |
BOOL8 | PointInside (FRECT *Rectangle, FLOAT32 X, FLOAT32 Y) |
Define Documentation
#define CenterX |
( |
|
M | ) |
( (M)[XPOSITION] ) |
---------------------------------------------------------------------------- Public Macros ----------------------------------------------------------------------------
#define CenterY |
( |
|
M | ) |
( (M)[YPOSITION] ) |
#define CONFIG_SUFFIX ".cl" |
#define LengthOf |
( |
|
M | ) |
( (M)[MFLENGTH] ) |
#define MAX_LENGTH_MISMATCH (2.0 * GetPicoFeatureLength ()) |
#define OrientationOf |
( |
|
M | ) |
( (M)[ORIENTATION] ) |
#define PROTO_SUFFIX ".mf.p" |
#define WORST_EVIDENCE (1.0) |
#define WORST_MATCH_ALLOWED (0.9) |
---------------------------------------------------------------------------- Include Files and Type Defines ----------------------------------------------------------------------------
Function Documentation
---------------------------------------------------------------------------- Public Function Prototypes ----------------------------------------------------------------------------
Compare protos p1 and p2 and return an estimate of the worst evidence rating that will result for any part of p1 that is compared to p2. In other words, if p1 were broken into pico-features and each pico-feature was matched to p2, what is the worst evidence rating that will be achieved for any pico-feature.
- Parameters:
-
p1,p2 | protos to be compared |
Globals: none
- Returns:
- Worst possible result when matching p1 to p2.
- Note:
- Exceptions: none
-
History: Mon Nov 26 08:27:53 1990, DSJ, Created.
This routine computes a proto which is the weighted average of protos p1 and p2. The new proto is returned in MergedProto.
- Parameters:
-
p1,p2 | protos to be merged |
w1,w2 | weight of each proto |
MergedProto | place to put resulting merged proto |
Globals: none
- Returns:
- none (results are returned in MergedProto)
- Note:
- Exceptions: none
-
History: Mon Nov 26 08:15:08 1990, DSJ, Created.
This routine computes a bounding box that encloses the specified proto along with some padding. The amount of padding is specified as separate distances in the tangential and orthogonal directions.
- Parameters:
-
| Proto | proto to compute bounding box for |
| TangentPad | amount of pad to add in direction of segment |
| OrthogonalPad | amount of pad to add orthogonal to segment |
[out] | BoundingBox | place to put results |
Globals: none
- Returns:
- none (results are returned in BoundingBox)
- Note:
- Exceptions: none
-
History: Wed Nov 14 14:55:30 1990, DSJ, Created.
This routine returns TRUE if Feature would be matched by a fast match table built from Proto.
- Parameters:
-
Feature | feature to be "fast matched" to proto |
Proto | proto being "fast matched" against |
Globals:
- training_tangent_bbox_pad bounding box pad tangent to proto
- training_orthogonal_bbox_pad bounding box pad orthogonal to proto
- Returns:
- TRUE if feature could match Proto.
- Note:
- Exceptions: none
-
History: Wed Nov 14 17:19:58 1990, DSJ, Created.
double EvidenceOf |
( |
register double |
Similarity | ) |
|
This routine searches thru all of the prototypes in Class and returns the id of the proto which would provide the best approximation of Prototype. If no close approximation can be found, NO_PROTO is returned.
- Parameters:
-
Class | class to search for matching old proto in |
NumMerged | # of protos merged into each proto of Class |
Prototype | new proto to find match for |
Globals: none
- Returns:
- Id of closest proto in Class or NO_PROTO.
- Note:
- Exceptions: none
-
History: Sat Nov 24 11:42:58 1990, DSJ, Created.
This fills in the fields of the New proto based on the fields of the Old proto.
- Parameters:
-
New | new proto to be filled in |
Old | old proto to be converted |
Globals: none
Exceptions: none History: Mon Nov 26 09:45:39 1990, DSJ, Created.
Return TRUE if point (X,Y) is inside of Rectangle.
Globals: none
- Returns:
- TRUE if point (X,Y) is inside of Rectangle.
- Note:
- Exceptions: none
-
History: Wed Nov 14 17:26:35 1990, DSJ, Created.