textord/oldbasel.h

Go to the documentation of this file.
00001 
00019 #ifndef           OLDBASEL_H
00020 #define           OLDBASEL_H
00021 
00022 #include          "varable.h"
00023 #include          "blobbox.h"
00024 #include          "notdll.h"
00025 
00069 extern BOOL_VAR_H (textord_really_old_xheight, FALSE,
00070 "Use original wiseowl xheight");
00071 extern BOOL_VAR_H (textord_oldbl_debug, FALSE,
00072 "Debug old baseline generation");
00073 extern BOOL_VAR_H (textord_debug_baselines, FALSE,
00074 "Debug baseline generation");
00075 extern BOOL_VAR_H (textord_oldbl_paradef, TRUE, "Use para default mechanism");
00076 extern BOOL_VAR_H (textord_oldbl_split_splines, TRUE,
00077 "Split stepped splines");
00078 extern BOOL_VAR_H (textord_oldbl_merge_parts, TRUE,
00079 "Merge suspect partitions");
00080 extern BOOL_VAR_H (oldbl_xhfix, FALSE,
00081 "Fix bug in modes threshold for xheights");
00082 extern INT_VAR_H (oldbl_holed_losscount, 10,
00083 "Max lost before fallback line used");
00084 extern double_VAR_H (oldbl_dot_error_size, 1.26, "Max aspect ratio of a dot");
00085 extern double_VAR_H (textord_oldbl_jumplimit, 0.15,
00086 "X fraction for new partition");
00089 void make_old_baselines(                  //make splines
00090                         TO_BLOCK *block,  //block to do
00091                         BOOL8 testing_on  //correct orientation
00092                        );
00093 void correlate_lines(                 //cleanup lines
00094                      TO_BLOCK *block  //block to do
00095                     );
00096 void correlate_neighbours(                  //fix bad rows
00097                           TO_BLOCK *block,  /*block rows are in */
00098                           TO_ROW **rows,    /*rows of block */
00099                           int rowcount      /*no of rows to do */
00100                          );
00101 int correlate_with_stats(                //fix xheights
00102                          TO_ROW **rows,  /*rows of block */
00103                          int rowcount    /*no of rows to do */
00104                         );
00105 void find_textlines(                  //get baseline
00106                     TO_BLOCK *block,  //block row is in
00107                     TO_ROW *row,      //row to do
00108                     int degree,       //required approximation
00109                     QSPLINE *spline   //starting spline
00110                    );
00111 int get_blob_coords(                    //get boxes
00112                     TO_ROW *row,        //row to use
00113                     INT32 lineheight,   //block level
00114                     BOX *blobcoords,    //ouput boxes
00115                     BOOL8 &holed_line,  //lost a lot of blobs
00116                     int &outcount       //no of real blobs
00117                    );
00118 void make_first_baseline (       //initial approximation
00119 BOX blobcoords[],                /*blob bounding boxes */
00120 int blobcount,                   /*no of blobcoords */
00121 int xcoords[],                   /*coords for spline */
00122 int ycoords[],                   /*approximator */
00123 QSPLINE * spline,                /*initial spline */
00124 QSPLINE * baseline,              /*output spline */
00125 float jumplimit                  /*guess half descenders */
00126 );
00127 void make_holed_baseline (       //initial approximation
00128 BOX blobcoords[],                /*blob bounding boxes */
00129 int blobcount,                   /*no of blobcoords */
00130 QSPLINE * spline,                /*initial spline */
00131 QSPLINE * baseline,              /*output spline */
00132 float gradient                   //of line
00133 );
00134 int partition_line (             //partition blobs
00135 BOX blobcoords[],                //bounding boxes
00136 int blobcount,                   /*no of blobs on row */
00137 int *numparts,                   /*number of partitions */
00138 char partids[],                  /*partition no of each blob */
00139 int partsizes[],                 /*no in each partition */
00140 QSPLINE * spline,                /*curve to fit to */
00141 float jumplimit,                 /*allowed delta change */
00142 float ydiffs[]                   /*diff from spline */
00143 );
00144 void merge_oldbl_parts (         //partition blobs
00145 BOX blobcoords[],                //bounding boxes
00146 int blobcount,                   /*no of blobs on row */
00147 char partids[],                  /*partition no of each blob */
00148 int partsizes[],                 /*no in each partition */
00149 int biggestpart,                 //major partition
00150 float jumplimit                  /*allowed delta change */
00151 );
00152 int get_ydiffs (                 //evaluate differences
00153 BOX blobcoords[],                //bounding boxes
00154 int blobcount,                   /*no of blobs */
00155 QSPLINE * spline,                /*approximating spline */
00156 float ydiffs[]                   /*output */
00157 );
00158 int choose_partition (           //select partition
00159 register float diff,             /*diff from spline */
00160 float partdiffs[],               /*diff on all parts */
00161 int lastpart,                    /*last assigned partition */
00162 float jumplimit,                 /*new part threshold */
00163 int *partcount                   /*no of partitions */
00164 );
00165 int partition_coords (           //find relevant coords
00166 BOX blobcoords[],                //bounding boxes
00167 int blobcount,                   /*no of blobs in row */
00168 char partids[],                  /*partition no of each blob */
00169 int bestpart,                    /*best new partition */
00170 int xcoords[],                   /*points to work on */
00171 int ycoords[]                    /*points to work on */
00172 );
00173 int segment_spline (             //make xstarts
00174 BOX blobcoords[],                //boundign boxes
00175 int blobcount,                   /*no of blobs in row */
00176 int xcoords[],                   /*points to work on */
00177 int ycoords[],                   /*points to work on */
00178 int degree, int pointcount,      /*no of points */
00179 int xstarts[]                    //result
00180 );
00181 BOOL8 split_stepped_spline (     //make xstarts
00182 QSPLINE * baseline,              //current shot
00183 float jumplimit,                 //max step fuction
00184 int xcoords[],                   /*points to work on */
00185 int xstarts[],                   //result
00186 int &segments                    //no of segments
00187 );
00188 void insert_spline_point (       //get descenders
00189 int xstarts[],                   //starts to shuffle
00190 int segment,                     //insertion pt
00191 int coord1,                      //coords to add
00192 int coord2, int &segments        //total segments
00193 );
00194 void find_lesser_parts (         //get descenders
00195 TO_ROW * row,                    //row to process
00196 BOX blobcoords[],                //bounding boxes
00197 int blobcount,                   /*no of blobs */
00198 char partids[],                  /*partition of each blob */
00199 int partsizes[],                 /*size of each part */
00200 int partcount,                   /*no of partitions */
00201 int bestpart                     /*biggest partition */
00202 );
00203 
00204 void old_first_xheight (         //the wiseowl way
00205 TO_ROW * row,                    /*current row */
00206 BOX blobcoords[],                /*blob bounding boxes */
00207 int initialheight,               //initial guess
00208 int blobcount,                   /*blobs in blobcoords */
00209 QSPLINE * baseline,              /*established */
00210 float jumplimit                  /*min ascender height */
00211 );
00212 
00213 void make_first_xheight (        //find xheight
00214 TO_ROW * row,                    /*current row */
00215 BOX blobcoords[],                /*blob bounding boxes */
00216 int lineheight,                  //initial guess
00217 int init_lineheight,             //block level guess
00218 int blobcount,                   /*blobs in blobcoords */
00219 QSPLINE * baseline,              /*established */
00220 float jumplimit                  /*min ascender height */
00221 );
00222 
00223 int *make_height_array (         //get array of heights
00224 BOX blobcoords[],                /*blob bounding boxes */
00225 int blobcount,                   /*blobs in blobcoords */
00226 QSPLINE * baseline               /*established */
00227 );
00228 
00229 void find_top_modes (            //get modes
00230 STATS * stats,                   //stats to hack
00231 int statnum,                     //no of piles
00232 int modelist[], int modenum      //no of modes to get
00233 );
00234 
00235 void pick_x_height (             //find xheight
00236 TO_ROW * row,                    //row to do
00237                                  //height stats
00238 int modelist[], STATS * heightstat,
00239 int mode_threshold);
00240 #endif

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