textord/pitsync1.h

Go to the documentation of this file.
00001 
00020 #ifndef           PITSYNC1_H
00021 #define           PITSYNC1_H
00022 
00023 #include          "elst.h"
00024 #include          "clst.h"
00025 #include          "blobbox.h"
00026 #include          "varable.h"
00027 #include          "statistc.h"
00028 #include          "pithsync.h"
00029 #include          "notdll.h"
00030 #include          "notdll.h"
00031 
00032 class FPSEGPT_LIST;
00033 
00040 class FPSEGPT:public ELIST_LINK
00041 {
00042   public:
00043     FPSEGPT() {  //empty
00044     }
00045     FPSEGPT(           //constructor
00046             INT16 x);  //position
00047     FPSEGPT(                           //constructor
00048             INT16 x,                   //position
00049             BOOL8 faking,              //faking this one
00050             INT16 offset,              //extra cost dist
00051             INT16 region_index,        //segment number
00052             INT16 pitch,               //proposed pitch
00053             INT16 pitch_error,         //allowed tolerance
00054             FPSEGPT_LIST *prev_list);  //previous segment
00055     FPSEGPT(FPCUTPT *cutpt);  //build from new type
00056 
00057     INT32 position() {  //acces func
00058       return xpos;
00059     }
00060     double cost_function() { 
00061       return cost;
00062     }
00063     double squares() { 
00064       return sq_sum;
00065     }
00066     double sum() { 
00067       return mean_sum;
00068     }
00069     FPSEGPT *previous() { 
00070       return pred;
00071     }
00072     INT16 cheap_cuts() const {  //no of cheap cuts
00073       return mid_cuts;
00074     }
00075 
00076                                  //faked split point
00077     NEWDELETE2 (FPSEGPT) BOOL8 faked;
00078     BOOL8 terminal;              //successful end
00079     INT16 fake_count;            //total fakes to here
00080 
00081   private:
00082     INT16 mid_cuts;              //no of cheap cuts
00083     INT32 xpos;                  //location
00084     FPSEGPT *pred;               //optimal previous
00085     double mean_sum;             //mean so far
00086     double sq_sum;               //summed distsances
00087     double cost;                 //cost function
00088 };
00089 
00090 ELISTIZEH (FPSEGPT) CLISTIZEH (FPSEGPT_LIST)
00091 
00114 extern BOOL_VAR_H (pitsync_projection_fix, FALSE,
00115 "Fix bug in projection profile");
00116 extern INT_VAR_H (pitsync_linear_version, 0, "Use new fast algorithm");
00117 extern double_VAR_H (pitsync_joined_edge, 0.75,
00118 "Dist inside big blob for chopping");
00119 extern double_VAR_H (pitsync_offset_freecut_fraction, 0.25,
00120 "Fraction of cut for free cuts");
00121 extern INT_VAR_H (pitsync_fake_depth, 1, "Max advance fake generation");
00124 double check_pitch_sync(                        //find segmentation
00125                         BLOBNBOX_IT *blob_it,   //blobs to do
00126                         INT16 blob_count,       //no of blobs
00127                         INT16 pitch,            //pitch estimate
00128                         INT16 pitch_error,      //tolerance
00129                         STATS *projection,      //vertical
00130                         FPSEGPT_LIST *seg_list  //output list
00131                        );
00132 void make_illegal_segment(                          //find segmentation
00133                           FPSEGPT_LIST *prev_list,  //previous segments
00134                           BOX blob_box,             //bounding box
00135                           BLOBNBOX_IT blob_it,      //iterator
00136                           INT16 region_index,       //number of segment
00137                           INT16 pitch,              //pitch estimate
00138                           INT16 pitch_error,        //tolerance
00139                           FPSEGPT_LIST *seg_list    //output list
00140                          );
00141 INT16 vertical_torow_projection(                   //project whole row
00142                                 TO_ROW *row,       //row to do
00143                                 STATS *projection  //output
00144                                );
00145 void vertical_blob_projection(              //project outlines
00146                               PBLOB *blob,  //blob to project
00147                               STATS *stats  //output
00148                              );
00149 void vertical_outline_projection(                   //project outlines
00150                                  OUTLINE *outline,  //outline to project
00151                                  STATS *stats       //output
00152                                 );
00153 void vertical_cblob_projection(               //project outlines
00154                                C_BLOB *blob,  //blob to project
00155                                STATS *stats   //output
00156                               );
00157 void vertical_coutline_projection(                     //project outlines
00158                                   C_OUTLINE *outline,  //outline to project
00159                                   STATS *stats         //output
00160                                  );
00161 #endif

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