00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef OLDBASEL_H
00021 #define OLDBASEL_H
00022
00023 #include "varable.h"
00024 #include "blobbox.h"
00025 #include "notdll.h"
00026 #include "tesseractclass.h"
00027
00028 extern BOOL_VAR_H (textord_really_old_xheight, FALSE,
00029 "Use original wiseowl xheight");
00030 extern BOOL_VAR_H (textord_oldbl_debug, FALSE,
00031 "Debug old baseline generation");
00032 extern BOOL_VAR_H (textord_debug_baselines, FALSE,
00033 "Debug baseline generation");
00034 extern BOOL_VAR_H (textord_oldbl_paradef, TRUE, "Use para default mechanism");
00035 extern BOOL_VAR_H (textord_oldbl_split_splines, TRUE,
00036 "Split stepped splines");
00037 extern BOOL_VAR_H (textord_oldbl_merge_parts, TRUE,
00038 "Merge suspect partitions");
00039 extern BOOL_VAR_H (oldbl_xhfix, FALSE,
00040 "Fix bug in modes threshold for xheights");
00041 extern INT_VAR_H (oldbl_holed_losscount, 10,
00042 "Max lost before fallback line used");
00043 extern double_VAR_H (oldbl_dot_error_size, 1.26, "Max aspect ratio of a dot");
00044 extern double_VAR_H (textord_oldbl_jumplimit, 0.15,
00045 "X fraction for new partition");
00046 void make_old_baselines(
00047 TO_BLOCK *block,
00048 BOOL8 testing_on,
00049 float gradient,
00050 tesseract::Tesseract *tess
00051 );
00052 void correlate_lines(
00053 TO_BLOCK *block,
00054 float gradient,
00055 tesseract::Tesseract* tess
00056 );
00057 void correlate_neighbours(
00058 TO_BLOCK *block,
00059 TO_ROW **rows,
00060 int rowcount,
00061 tesseract::Tesseract* tess
00062 );
00063 int correlate_with_stats(
00064 TO_ROW **rows,
00065 int rowcount,
00066 TO_BLOCK *block
00067 );
00068 void find_textlines(
00069 TO_BLOCK *block,
00070 TO_ROW *row,
00071 int degree,
00072 QSPLINE *spline,
00073 tesseract::Tesseract *tess
00074 );
00075 int get_blob_coords(
00076 TO_ROW *row,
00077 inT32 lineheight,
00078 TBOX *blobcoords,
00079 BOOL8 &holed_line,
00080 int &outcount
00081 );
00082 void make_first_baseline (
00083 TBOX blobcoords[],
00084 int blobcount,
00085 int xcoords[],
00086 int ycoords[],
00087 QSPLINE * spline,
00088 QSPLINE * baseline,
00089 float jumplimit
00090 );
00091 void make_holed_baseline (
00092 TBOX blobcoords[],
00093 int blobcount,
00094 QSPLINE * spline,
00095 QSPLINE * baseline,
00096 float gradient
00097 );
00098 int partition_line (
00099 TBOX blobcoords[],
00100 int blobcount,
00101 int *numparts,
00102 char partids[],
00103 int partsizes[],
00104 QSPLINE * spline,
00105 float jumplimit,
00106 float ydiffs[]
00107 );
00108 void merge_oldbl_parts (
00109 TBOX blobcoords[],
00110 int blobcount,
00111 char partids[],
00112 int partsizes[],
00113 int biggestpart,
00114 float jumplimit
00115 );
00116 int get_ydiffs (
00117 TBOX blobcoords[],
00118 int blobcount,
00119 QSPLINE * spline,
00120 float ydiffs[]
00121 );
00122 int choose_partition (
00123 register float diff,
00124 float partdiffs[],
00125 int lastpart,
00126 float jumplimit,
00127 int *partcount
00128 );
00129 int partition_coords (
00130 TBOX blobcoords[],
00131 int blobcount,
00132 char partids[],
00133 int bestpart,
00134 int xcoords[],
00135 int ycoords[]
00136 );
00137 int segment_spline (
00138 TBOX blobcoords[],
00139 int blobcount,
00140 int xcoords[],
00141 int ycoords[],
00142 int degree, int pointcount,
00143 int xstarts[]
00144 );
00145 BOOL8 split_stepped_spline (
00146 QSPLINE * baseline,
00147 float jumplimit,
00148 int xcoords[],
00149 int xstarts[],
00150 int &segments
00151 );
00152 void insert_spline_point (
00153 int xstarts[],
00154 int segment,
00155 int coord1,
00156 int coord2, int &segments
00157 );
00158 void find_lesser_parts (
00159 TO_ROW * row,
00160 TBOX blobcoords[],
00161 int blobcount,
00162 char partids[],
00163 int partsizes[],
00164 int partcount,
00165 int bestpart
00166 );
00167
00168 void old_first_xheight (
00169 TO_ROW * row,
00170 TBOX blobcoords[],
00171 int initialheight,
00172 int blobcount,
00173 QSPLINE * baseline,
00174 float jumplimit
00175 );
00176
00177 void make_first_xheight (
00178 TO_ROW * row,
00179 TBOX blobcoords[],
00180 int lineheight,
00181 int init_lineheight,
00182 int blobcount,
00183 QSPLINE * baseline,
00184 float jumplimit
00185 );
00186
00187 int *make_height_array (
00188 TBOX blobcoords[],
00189 int blobcount,
00190 QSPLINE * baseline
00191 );
00192
00193 void find_top_modes (
00194 STATS * stats,
00195 int statnum,
00196 int modelist[], int modenum
00197 );
00198
00199 void pick_x_height(TO_ROW * row,
00200 int modelist[],
00201 int lefts[], int rights[],
00202 STATS * heightstat,
00203 int mode_threshold);
00204 #endif