textord/pithsync.h

Go to the documentation of this file.
00001 
00020 #ifndef           PITHSYNC_H
00021 #define           PITHSYNC_H
00022 
00023 #include          "blobbox.h"
00024 #include          "varable.h"
00025 #include          "statistc.h"
00026 #include          "notdll.h"
00027 
00028 class FPSEGPT_LIST;
00029 
00057 class FPCUTPT
00058 {
00059   public:
00060     FPCUTPT() {  //empty
00061     }
00062     void setup (                 //start of cut
00063       FPCUTPT cutpts[],          //predecessors
00064       INT16 array_origin,        //start coord
00065       STATS * projection,        //occupation
00066       INT16 zero_count,          //official zero
00067       INT16 pitch,               //proposed pitch
00068       INT16 x,                   //position
00069       INT16 offset);             //dist to gap
00070 
00071     void assign (                //evaluate cut
00072       FPCUTPT cutpts[],          //predecessors
00073       INT16 array_origin,        //start coord
00074       INT16 x,                   //position
00075       BOOL8 faking,              //faking this one
00076       BOOL8 mid_cut,             //doing free cut
00077       INT16 offset,              //extra cost dist
00078       STATS * projection,        //occupation
00079       float projection_scale,    //scaling
00080       INT16 zero_count,          //official zero
00081       INT16 pitch,               //proposed pitch
00082       INT16 pitch_error);        //allowed tolerance
00083 
00084     void assign_cheap (          //evaluate cut
00085       FPCUTPT cutpts[],          //predecessors
00086       INT16 array_origin,        //start coord
00087       INT16 x,                   //position
00088       BOOL8 faking,              //faking this one
00089       BOOL8 mid_cut,             //doing free cut
00090       INT16 offset,              //extra cost dist
00091       STATS * projection,        //occupation
00092       float projection_scale,    //scaling
00093       INT16 zero_count,          //official zero
00094       INT16 pitch,               //proposed pitch
00095       INT16 pitch_error);        //allowed tolerance
00096 
00097     INT32 position() {  //acces func
00098       return xpos;
00099     }
00100     double cost_function() { 
00101       return cost;
00102     }
00103     double squares() { 
00104       return sq_sum;
00105     }
00106     double sum() { 
00107       return mean_sum;
00108     }
00109     FPCUTPT *previous() { 
00110       return pred;
00111     }
00112     INT16 cheap_cuts() const {  //no of mi cuts
00113       return mid_cuts;
00114     }
00115     INT16 index() const { 
00116       return region_index;
00117     }
00118 
00119     BOOL8 faked;                 //faked split point
00120     BOOL8 terminal;              //successful end
00121     INT16 fake_count;            //total fakes to here
00122 
00123   private:
00124     INT16 region_index;          //cut serial number
00125     INT16 mid_cuts;              //no of cheap cuts
00126     INT32 xpos;                  //location
00127     UINT32 back_balance;         //proj backwards
00128     UINT32 fwd_balance;          //proj forwards
00129     FPCUTPT *pred;               //optimal previous
00130     double mean_sum;             //mean so far
00131     double sq_sum;               //summed distsances
00132     double cost;                 //cost function
00133 };
00134 
00135 double check_pitch_sync2(                          //find segmentation
00136                          BLOBNBOX_IT *blob_it,     //blobs to do
00137                          INT16 blob_count,         //no of blobs
00138                          INT16 pitch,              //pitch estimate
00139                          INT16 pitch_error,        //tolerance
00140                          STATS *projection,        //vertical
00141                          INT16 projection_left,    //edges //scale factor
00142                          INT16 projection_right,
00143                          float projection_scale,
00144                          INT16 &occupation_count,  //no of occupied cells
00145                          FPSEGPT_LIST *seg_list,   //output list
00146                          INT16 start,              //start of good range
00147                          INT16 end                 //end of good range
00148                         );
00149 double check_pitch_sync3(                          //find segmentation
00150                          INT16 projection_left,    //edges //to be considered 0
00151                          INT16 projection_right,
00152                          INT16 zero_count,
00153                          INT16 pitch,              //pitch estimate
00154                          INT16 pitch_error,        //tolerance
00155                          STATS *projection,        //vertical
00156                          float projection_scale,   //scale factor
00157                          INT16 &occupation_count,  //no of occupied cells
00158                          FPSEGPT_LIST *seg_list,   //output list
00159                          INT16 start,              //start of good range
00160                          INT16 end                 //end of good range
00161                         );
00162 #endif

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