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(
00090 TO_BLOCK *block,
00091 BOOL8 testing_on
00092 );
00093 void correlate_lines(
00094 TO_BLOCK *block
00095 );
00096 void correlate_neighbours(
00097 TO_BLOCK *block,
00098 TO_ROW **rows,
00099 int rowcount
00100 );
00101 int correlate_with_stats(
00102 TO_ROW **rows,
00103 int rowcount
00104 );
00105 void find_textlines(
00106 TO_BLOCK *block,
00107 TO_ROW *row,
00108 int degree,
00109 QSPLINE *spline
00110 );
00111 int get_blob_coords(
00112 TO_ROW *row,
00113 INT32 lineheight,
00114 BOX *blobcoords,
00115 BOOL8 &holed_line,
00116 int &outcount
00117 );
00118 void make_first_baseline (
00119 BOX blobcoords[],
00120 int blobcount,
00121 int xcoords[],
00122 int ycoords[],
00123 QSPLINE * spline,
00124 QSPLINE * baseline,
00125 float jumplimit
00126 );
00127 void make_holed_baseline (
00128 BOX blobcoords[],
00129 int blobcount,
00130 QSPLINE * spline,
00131 QSPLINE * baseline,
00132 float gradient
00133 );
00134 int partition_line (
00135 BOX blobcoords[],
00136 int blobcount,
00137 int *numparts,
00138 char partids[],
00139 int partsizes[],
00140 QSPLINE * spline,
00141 float jumplimit,
00142 float ydiffs[]
00143 );
00144 void merge_oldbl_parts (
00145 BOX blobcoords[],
00146 int blobcount,
00147 char partids[],
00148 int partsizes[],
00149 int biggestpart,
00150 float jumplimit
00151 );
00152 int get_ydiffs (
00153 BOX blobcoords[],
00154 int blobcount,
00155 QSPLINE * spline,
00156 float ydiffs[]
00157 );
00158 int choose_partition (
00159 register float diff,
00160 float partdiffs[],
00161 int lastpart,
00162 float jumplimit,
00163 int *partcount
00164 );
00165 int partition_coords (
00166 BOX blobcoords[],
00167 int blobcount,
00168 char partids[],
00169 int bestpart,
00170 int xcoords[],
00171 int ycoords[]
00172 );
00173 int segment_spline (
00174 BOX blobcoords[],
00175 int blobcount,
00176 int xcoords[],
00177 int ycoords[],
00178 int degree, int pointcount,
00179 int xstarts[]
00180 );
00181 BOOL8 split_stepped_spline (
00182 QSPLINE * baseline,
00183 float jumplimit,
00184 int xcoords[],
00185 int xstarts[],
00186 int &segments
00187 );
00188 void insert_spline_point (
00189 int xstarts[],
00190 int segment,
00191 int coord1,
00192 int coord2, int &segments
00193 );
00194 void find_lesser_parts (
00195 TO_ROW * row,
00196 BOX blobcoords[],
00197 int blobcount,
00198 char partids[],
00199 int partsizes[],
00200 int partcount,
00201 int bestpart
00202 );
00203
00204 void old_first_xheight (
00205 TO_ROW * row,
00206 BOX blobcoords[],
00207 int initialheight,
00208 int blobcount,
00209 QSPLINE * baseline,
00210 float jumplimit
00211 );
00212
00213 void make_first_xheight (
00214 TO_ROW * row,
00215 BOX blobcoords[],
00216 int lineheight,
00217 int init_lineheight,
00218 int blobcount,
00219 QSPLINE * baseline,
00220 float jumplimit
00221 );
00222
00223 int *make_height_array (
00224 BOX blobcoords[],
00225 int blobcount,
00226 QSPLINE * baseline
00227 );
00228
00229 void find_top_modes (
00230 STATS * stats,
00231 int statnum,
00232 int modelist[], int modenum
00233 );
00234
00235 void pick_x_height (
00236 TO_ROW * row,
00237
00238 int modelist[], STATS * heightstat,
00239 int mode_threshold);
00240 #endif