58 edgept = edgept->
next;
63 edgept = edgept->
next;
72 edgept = edgept->
next;
77 edgept = edgept->
next;
85 int centered_maxwidth,
double center_knob,
86 double width_change_knob)
const {
91 if (xmin < min_left && xmax > max_right)
return kBadPriority;
95 int width1 = box1.
width();
96 int width2 = box2.
width();
97 int min_width =
MIN(width1, width2);
98 int overlap = -box1.
x_gap(box2);
99 if (overlap == min_width) {
102 if (2 * overlap > min_width) overlap += 2 * overlap - min_width;
103 if (overlap > 0) grade += overlap_knob * overlap;
106 if (width1 <= centered_maxwidth || width2 <= centered_maxwidth) {
110 float width_change_grade = 20 - (max_right - min_left -
MAX(width1, width2));
111 if (width_change_grade > 0.0f)
112 grade += width_change_grade * width_change_knob;
146 this_edgept->
pos.
x = x;
147 this_edgept->
pos.
y = y;
150 if (prev_ol !=
NULL && prev->
next == next) {
154 double cut_fraction = target_vec.
length() / segment_vec.
length();
160 ICOORD step_vec = step_end - step_start;
161 double target_length = step_vec.
length() * cut_fraction;
165 double best_dist = target_length;
166 for (
int s = prev->
start_step; s < end_step; ++s) {
167 total_step += prev_ol->
step(s % step_length);
168 double dist = fabs(target_length - total_step.
length());
169 if (dist < best_dist) {
176 this_edgept->
step_count = end_step - best_step;
177 this_edgept->
start_step = best_step % step_length;
186 this_edgept->
next = next;
187 this_edgept->
prev = prev;
188 prev->
next = this_edgept;
189 next->
prev = this_edgept;
229 #ifndef GRAPHICS_DISABLED
242 while (outlines->
next !=
NULL) outlines = outlines->
next;
248 outlines = outlines->
next;
bool ShortNonCircularSegment(int min_points, const EDGEPT *end) const
bool wordrec_display_splits
int SegmentArea(const EDGEPT *end) const
float FullPriority(int xmin, int xmax, double overlap_knob, int centered_maxwidth, double center_knob, double width_change_knob) const
bool SegmentCrossesOutline(const TPOINT &pt1, const TPOINT &pt2) const
const int kCenterGradeCap
void remove_edgept(EDGEPT *point)
void SplitOutlineList(TESSLINE *outlines) const
#define BOOL_VAR(name, val, comment)
void UnsplitOutlineList(TBLOB *blob) const
void ComputeBoundingBox()
float length() const
find length
bool IsLittleChunk(int min_points, int min_area) const
const double kBadPriority
void SplitOutline() const
void Mark(ScrollView *window) const
float length() const
find length
void UnsplitOutlines() const
EDGEPT * make_edgept(int x, int y, EDGEPT *next, EDGEPT *prev)
TBOX bounding_box() const
bool IsHealthy(const TBLOB &blob, int min_points, int min_area) const
bool EqualPos(const EDGEPT &other) const
int x_gap(const TBOX &box) const
ICOORD step(int index) const
ICOORD position_at_index(int index) const
void Line(int x1, int y1, int x2, int y2)