20 #ifndef TESSERACT_CCSTRUCT_DETLINEFIT_H_
21 #define TESSERACT_CCSTRUCT_DETLINEFIT_H_
71 void Add(
const ICOORD& pt,
int halfwidth);
76 return Fit(0, 0, pt1, pt2);
90 double min_dist,
double max_dist,
91 bool debug,
ICOORD* line_pt);
100 double Fit(
float* m,
float* c);
113 PointWidth() : pt(
ICOORD(0, 0)), halfwidth(0) {}
114 PointWidth(
const ICOORD& pt0,
int halfwidth0)
115 : pt(pt0), halfwidth(halfwidth0) {}
123 using DistPointPair = KDPairInc<double, ICOORD>;
126 double EvaluateLineFit();
130 double ComputeUpperQuartileError();
133 int NumberOfMisfittedPoints(
double threshold)
const;
139 void ComputeDistances(
const ICOORD& start,
const ICOORD& end);
144 void ComputeConstrainedDistances(
const FCOORD& direction,
145 double min_dist,
double max_dist);
157 double square_length_;
162 #endif // TESSERACT_CCSTRUCT_DETLINEFIT_H_