training/mergenf.h

Go to the documentation of this file.
00001 
00019 #ifndef MERGENFH
00020 #define MERGENFH
00021 /*----------------------------------------------------------------------------
00022                Include Files and Type Defines
00023 ----------------------------------------------------------------------------*/
00024 #include "protos.h"
00025 #include "cluster.h"
00026 #include "ocrfeatures.h"
00027 #include "training.h"
00028 
00029 #define WORST_MATCH_ALLOWED   (0.9)
00030 #define WORST_EVIDENCE (1.0)
00031 #define MAX_LENGTH_MISMATCH   (2.0 * GetPicoFeatureLength ())
00032 
00033 #define PROTO_SUFFIX    ".mf.p"
00034 #define CONFIG_SUFFIX      ".cl"
00035 #define NO_PROTO  (-1)
00036 #define XPOSITION       0
00037 #define YPOSITION       1
00038 #define MFLENGTH        2
00039 #define ORIENTATION        3
00040 
00045 typedef enum
00046 {
00047    PicoFeatY,
00048    PicoFeatDir,
00049    PicoFeatX
00050 } PICO_FEAT_PARAM_NAME;
00051 
00056 typedef struct
00057 {
00058   FLOAT32   MinX, MaxX, MinY, MaxY;
00059 } FRECT;
00060 
00061 /*----------------------------------------------------------------------------
00062                Public Macros
00063 ----------------------------------------------------------------------------*/
00064 #define CenterX(M)      ( (M)[XPOSITION] )
00065 #define CenterY(M)      ( (M)[YPOSITION] )
00066 #define LengthOf(M)     ( (M)[MFLENGTH] )
00067 #define OrientationOf(M)   ( (M)[ORIENTATION] )
00068 
00069 /*----------------------------------------------------------------------------
00070                Public Function Prototypes
00071 ----------------------------------------------------------------------------**/
00072 FLOAT32 CompareProtos (
00073      PROTO  p1,
00074     PROTO   p2);
00075 
00076 void ComputeMergedProto (
00077      PROTO  p1,
00078     PROTO   p2,
00079      FLOAT32   w1,
00080     FLOAT32 w2,
00081      PROTO  MergedProto);
00082 
00083 int FindClosestExistingProto (
00084      CLASS_TYPE   Class,
00085      int          NumMerged[],
00086      PROTOTYPE *Prototype);
00087 
00088 void MakeNewFromOld (
00089      PROTO  New,
00090      PROTOTYPE *Old);
00091 
00092 void InitSubfeatureVars ();
00093 
00094 FLOAT32 SubfeatureEvidence (
00095    FEATURE     Feature,
00096    PROTO       Proto);
00097 
00098 FLOAT32 EvidenceOf (
00099   register FLOAT32   Similarity);
00100 
00101 void InitFastTrainerVars ();
00102 
00103 BOOL8 DummyFastMatch (
00104      FEATURE   Feature,
00105      PROTO  Proto);
00106 
00107 void ComputePaddedBoundingBox (
00108      PROTO  Proto,
00109      FLOAT32   TangentPad,
00110     FLOAT32 OrthogonalPad,
00111      FRECT  *BoundingBox);
00112 
00113 BOOL8 PointInside (
00114      FRECT  *Rectangle,
00115      FLOAT32   X,
00116     FLOAT32 Y);
00117 
00118 extern FEATURE_DESC_STRUCT PicoFeatDesc;
00119 
00120 #endif

Generated on Wed Feb 28 19:49:12 2007 for Tesseract by  doxygen 1.5.1