63 edgept = edgept->
next;
68 edgept = edgept->
next;
77 edgept = edgept->
next;
82 edgept = edgept->
next;
90 int centered_maxwidth,
double center_knob,
91 double width_change_knob)
const {
96 if (xmin < min_left && xmax > max_right)
return kBadPriority;
100 int width1 = box1.
width();
101 int width2 = box2.
width();
102 int min_width =
MIN(width1, width2);
103 int overlap = -box1.
x_gap(box2);
104 if (overlap == min_width) {
107 if (2 * overlap > min_width) overlap += 2 * overlap - min_width;
108 if (overlap > 0) grade += overlap_knob * overlap;
111 if (width1 <= centered_maxwidth || width2 <= centered_maxwidth) {
115 float width_change_grade = 20 - (max_right - min_left -
MAX(width1, width2));
116 if (width_change_grade > 0.0f)
117 grade += width_change_grade * width_change_knob;
151 this_edgept->
pos.
x = x;
152 this_edgept->
pos.
y = y;
155 if (prev_ol != NULL && prev->
next == next) {
159 double cut_fraction = target_vec.
length() / segment_vec.
length();
165 ICOORD step_vec = step_end - step_start;
166 double target_length = step_vec.
length() * cut_fraction;
170 double best_dist = target_length;
171 for (
int s = prev->
start_step; s < end_step; ++s) {
172 total_step += prev_ol->
step(s % step_length);
173 double dist = fabs(target_length - total_step.
length());
174 if (dist < best_dist) {
181 this_edgept->
step_count = end_step - best_step;
182 this_edgept->
start_step = best_step % step_length;
191 this_edgept->
next = next;
192 this_edgept->
prev = prev;
193 prev->
next = this_edgept;
194 next->
prev = this_edgept;
232 #ifndef GRAPHICS_DISABLED 245 while (outlines->
next != NULL) outlines = outlines->
next;
251 outlines = outlines->
next;
void remove_edgept(EDGEPT *point)
void SplitOutline() const
void UnsplitOutlines() const
void Line(int x1, int y1, int x2, int y2)
ICOORD position_at_index(int index) const
ICOORD step(int index) const
bool IsLittleChunk(int min_points, int min_area) const
int SegmentArea(const EDGEPT *end) const
void SplitOutlineList(TESSLINE *outlines) const
TBOX bounding_box() const
float length() const
find length
float length() const
find length
EDGEPT * make_edgept(int x, int y, EDGEPT *next, EDGEPT *prev)
float FullPriority(int xmin, int xmax, double overlap_knob, int centered_maxwidth, double center_knob, double width_change_knob) const
void UnsplitOutlineList(TBLOB *blob) const
bool wordrec_display_splits
int x_gap(const TBOX &box) const
const int kCenterGradeCap
bool IsHealthy(const TBLOB &blob, int min_points, int min_area) const
bool SegmentCrossesOutline(const TPOINT &pt1, const TPOINT &pt2) const
bool EqualPos(const EDGEPT &other) const
void ComputeBoundingBox()
const double kBadPriority
void Mark(ScrollView *window) const
#define BOOL_VAR(name, val, comment)
bool ShortNonCircularSegment(int min_points, const EDGEPT *end) const