20 #ifndef TESSERACT_TEXTORD_BASELINEDETECT_H_ 21 #define TESSERACT_TEXTORD_BASELINEDETECT_H_ 76 double line_spacing,
double line_offset);
81 void SetupBlobDisplacements(
const FCOORD& direction);
93 void FitConstrainedIfBetter(
int debug,
const FCOORD& direction,
94 double cheat_allowance,
95 double target_offset);
98 double PerpDistanceFromBaseline(
const FCOORD& pt)
const;
100 void ComputeBoundingBox();
105 BLOBNBOX_LIST* blobs_;
116 double disp_quant_factor_;
119 double fit_halfrange_;
121 double max_baseline_error_;
123 double baseline_error_;
142 static double SpacingModelError(
double perp_disp,
double line_spacing,
149 bool FitBaselinesAndFindSkew(
bool use_box_bottoms);
153 void ParallelizeBaselines(
double default_block_skew);
156 void SetupBlockParameters()
const;
166 void PrepareForSplineFitting(
ICOORD page_tr,
bool remove_noise);
173 void FitBaselineSplines(
bool enable_splines,
bool show_final_rows,
178 void DrawFinalRows(
const ICOORD& page_tr);
181 void DrawPixSpline(Pix* pix_in);
190 bool ComputeLineSpacing();
199 void EstimateLineSpacing();
212 double m_in,
double* m_out,
double* c_out,
224 bool non_text_block_;
227 bool good_skew_angle_;
231 double line_spacing_;
245 TO_BLOCK_LIST* blocks);
252 void ComputeStraightBaselines(
bool use_box_bottoms);
259 void ComputeBaselineSplinesAndXheights(
const ICOORD& page_tr,
262 bool show_final_rows,
277 #endif // TESSERACT_TEXTORD_BASELINEDETECT_H_
double StraightYAtX(double x) const
BaselineRow(double line_size, TO_ROW *to_row)
void SetupOldLineParameters(TO_ROW *row) const
int direction(EDGEPT *point)
double AdjustBaselineToGrid(int debug, const FCOORD &direction, double line_spacing, double line_offset)
void AdjustBaselineToParallel(int debug, const FCOORD &direction)
double BaselineAngle() const
double skew_angle() const
bool FitBaseline(bool use_box_bottoms)
double PerpDisp(const FCOORD &direction) const
double SpaceBetween(const BaselineRow &other) const
const TBOX & bounding_box() const