119 return type1 >= type2;
138 area =
static_cast<int>(srcblob->
area());
159 base_char_top_ += v.
y();
160 base_char_bottom_ += v.
y();
169 BLOBNBOX_IT *start_it,
170 BLOBNBOX_IT *blob_it,
176 int* v_min,
int* v_max)
const;
200 double fractional_tolerance,
201 double constant_tolerance)
const;
215 base_char_top_ = box.
top();
216 base_char_bottom_ = box.bottom();
219 box = cblob_ptr->bounding_box();
220 base_char_top_ = box.top();
221 base_char_bottom_ = box.bottom();
240 return repeated_set_;
243 repeated_set_ = set_id;
249 return left_tab_type_;
252 left_tab_type_ = new_type;
255 return right_tab_type_;
258 right_tab_type_ = new_type;
264 region_type_ = new_type;
270 spt_type_ = new_type;
279 return vert_possible_;
282 vert_possible_ = value;
285 return horz_possible_;
288 horz_possible_ = value;
294 left_rule_ = new_left;
300 right_rule_ = new_right;
303 return left_crossing_rule_;
306 left_crossing_rule_ = new_left;
309 return right_crossing_rule_;
312 right_crossing_rule_ = new_right;
315 return horz_stroke_width_;
318 horz_stroke_width_ = width;
321 return vert_stroke_width_;
324 vert_stroke_width_ = width;
327 return area_stroke_width_;
336 return leader_on_left_;
339 leader_on_left_ = flag;
342 return leader_on_right_;
345 leader_on_right_ = flag;
348 return neighbours_[n];
351 return good_stroke_neighbours_[n];
355 good_stroke_neighbours_[n] = good;
358 return base_char_top_ != box.top() || base_char_bottom_ != box.bottom();
361 return base_char_top_;
364 return base_char_bottom_;
367 return line_crossings_;
370 line_crossings_ = value;
373 base_char_top_ = diacritic_box.
top();
374 base_char_bottom_ = diacritic_box.
bottom();
377 return base_char_blob_;
380 base_char_blob_ = blob;
384 return vert_possible_ && !horz_possible_;
387 return horz_possible_ && !vert_possible_;
411 #ifndef GRAPHICS_DISABLED
414 static void PlotBlobs(BLOBNBOX_LIST* list,
442 area_stroke_width_ = 0.0f;
443 horz_stroke_width_ = 0.0f;
444 vert_stroke_width_ = 0.0f;
460 left_crossing_rule_ = 0;
461 right_crossing_rule_ = 0;
462 if (area_stroke_width_ == 0.0
f && area > 0 &&
cblob() !=
NULL)
465 base_char_top_ = box.top();
466 base_char_bottom_ = box.bottom();
468 base_char_blob_ =
NULL;
469 horz_possible_ =
false;
470 vert_possible_ =
false;
471 leader_on_left_ =
false;
472 leader_on_right_ =
false;
478 neighbours_[n] =
NULL;
479 good_stroke_neighbours_[n] =
false;
497 inT16 left_crossing_rule_;
498 inT16 right_crossing_rule_;
499 inT16 base_char_top_;
500 inT16 base_char_bottom_;
503 float horz_stroke_width_;
504 float vert_stroke_width_;
505 float area_stroke_width_;
512 bool leader_on_left_;
513 bool leader_on_right_;
537 return (y_min + y_max) / 2.0f;
540 return initial_y_min;
588 para_error = new_error;
591 y_origin = (float) (new_c / sqrt (1 + gradient * gradient));
604 return num_repeated_sets_ != -1;
607 num_repeated_sets_ = -1;
610 return num_repeated_sets_;
613 num_repeated_sets_ = num_sets;
658 int num_repeated_sets_;
683 BLOBNBOX_LIST* blobnbox_list[] = {&blobs, &underlines, &noise_blobs,
684 &small_blobs, &large_blobs,
NULL};
685 for (BLOBNBOX_LIST** list = blobnbox_list; *list !=
NULL; ++list) {
686 BLOBNBOX_IT it(*list);
687 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
688 it.data()->rotate(rotation);
693 block->rotate(rotation);
695 STATS widths(0, block->bounding_box().width());
696 STATS heights(0, block->bounding_box().height());
697 BLOBNBOX_IT blob_it(&blobs);
698 for (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
699 widths.add(blob_it.data()->bounding_box().width(), 1);
700 heights.add(blob_it.data()->bounding_box().height(), 1);
702 block->set_median_size(static_cast<int>(widths.median() + 0.5),
703 static_cast<int>(heights.median() + 0.5));
707 TO_ROW_IT row_it = &row_list;
710 for (row_it.mark_cycle_pt (); !row_it.cycled_list ();
712 row = row_it.data ();
713 printf (
"Row range (%g,%g), para_c=%g, blobcount=" INT32FORMAT
723 void ReSetAndReFilterBlobs();
726 void DeleteUnownedNoise();
728 #ifndef GRAPHICS_DISABLED
764 TO_ROW_LIST row_list;
769 "Weighting for error in believability");
807 #ifndef GRAPHICS_DISABLED
812 #endif // GRAPHICS_DISABLED
BLOBNBOX_LIST noise_blobs
void plot_blob_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour)
inT32 enclosed_area() const
bool DeletableNoise() const
static BLOBNBOX * RealBlob(C_OUTLINE *outline)
float parallel_error() const
void reflect_box_in_y_axis()
void set_owner(tesseract::ColPartition *new_owner)
bool ConfirmNoTabViolation(const BLOBNBOX &other) const
void compute_bounding_box()
void set_repeated_set(int set_id)
float believability() const
void set_leader_on_right(bool flag)
void set_line(float new_m, float new_c, float new_error)
static bool IsLineType(BlobRegionType type)
EXTERN ScrollView * to_win
static void DeleteNoiseBlobs(BLOBNBOX_LIST *blobs)
static ScrollView::Color TextlineColor(BlobRegionType region_type, BlobTextFlowType flow_type)
double textord_error_weight
void set_reduced_box(TBOX new_box)
int NoisyNeighbours() const
bool UniquelyHorizontal() const
void set_leader_on_left(bool flag)
ICOORDELT_LIST char_cells
void set_limits(float new_min, float new_max)
int right_crossing_rule() const
void set_bounding_box(const TBOX &new_box)
const TBOX & bounding_box() const
BlobRegionType region_type() const
void set_right_rule(int new_right)
void NeighbourGaps(int gaps[BND_COUNT]) const
BlobSpecialTextType special_text_type() const
void set_diacritic_box(const TBOX &diacritic_box)
void set_right_crossing_rule(int new_right)
void set_vert_stroke_width(float width)
void set_special_text_type(BlobSpecialTextType new_type)
void compute_vertical_projection()
void set_neighbour(BlobNeighbourDir n, BLOBNBOX *neighbour, bool good)
void set_right_tab_type(TabType new_type)
static bool UnMergeableType(BlobRegionType type)
void set_horz_stroke_width(float width)
void add_blob(BLOBNBOX *blob, float top, float bottom, float row_size)
float vert_stroke_width() const
BLOBNBOX * base_char_blob() const
void clear_rep_chars_marked()
void MinMaxGapsClipped(int *h_min, int *h_max, int *v_min, int *v_max) const
static void PlotBlobs(BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour, ScrollView *win)
void find_cblob_vlimits(C_BLOB *blob, float leftx, float rightx, float &ymin, float &ymax)
int line_crossings() const
void set_parallel_line(float gradient, float new_c, float new_error)
inT16 y() const
access_function
void rotate_box(FCOORD rotation)
int base_char_bottom() const
#define double_VAR_H(name, val, comment)
float area_stroke_width() const
TabType left_tab_type() const
BLOBNBOX(C_BLOB *srcblob)
void set_left_crossing_rule(int new_left)
void set_num_repeated_sets(int num_sets)
tesseract::ColPartition * owner() const
ScrollView::Color BoxColor() const
void rotate(const FCOORD &rotation)
bool MatchingStrokeWidth(const BLOBNBOX &other, double fractional_tolerance, double constant_tolerance) const
float initial_min_y() const
int num_repeated_sets() const
bool joined_to_prev() const
C_BLOB * crotate_cblob(C_BLOB *blob, FCOORD rotation)
bool rep_chars_marked() const
void chop(BLOBNBOX_IT *start_it, BLOBNBOX_IT *blob_it, FCOORD rotation, float xheight)
static bool IsTextType(BlobRegionType type)
bool leader_on_left() const
void set_flow(BlobTextFlowType value)
void rotate(FCOORD rotation)
BLOBNBOX_LIST small_blobs
void find_cblob_hlimits(C_BLOB *blob, float bottomy, float topy, float &xmin, float &xymax)
void plot(ScrollView *window, ScrollView::Color blob_colour, ScrollView::Color child_colour)
void really_merge(BLOBNBOX *other)
void merge(BLOBNBOX *nextblob)
int base_char_top() const
int left_crossing_rule() const
PITCH_TYPE pitch_decision
bool leader_on_right() const
bool DefiniteIndividualFlow()
void set_base_char_blob(BLOBNBOX *blob)
void set_line_crossings(int value)
BlobNeighbourDir DirOtherWay(BlobNeighbourDir dir)
bool good_stroke_neighbour(BlobNeighbourDir n) const
bool DominatesInMerge(BlobTextFlowType type1, BlobTextFlowType type2)
PITCH_TYPE pitch_decision
static void PlotNoiseBlobs(BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour, ScrollView *win)
TBOX box_next(BLOBNBOX_IT *it)
void insert_blob(BLOBNBOX *blob)
float horz_stroke_width() const
void vertical_cblob_projection(C_BLOB *blob, STATS *stats)
TBOX box_next_pre_chopped(BLOBNBOX_IT *it)
BLOBNBOX_LIST large_blobs
TBOX BoundsWithinLimits(int left, int right)
static bool IsImageType(BlobRegionType type)
BlobTextFlowType flow() const
bool horz_possible() const
static const int kErrorWeight
void set_vert_possible(bool value)
BLOBNBOX * neighbour(BlobNeighbourDir n) const
void set_horz_possible(bool value)
#define ELIST2IZEH(CLASSNAME)
BLOBNBOX_LIST * blob_list()
bool UniquelyVertical() const
void set_left_rule(int new_left)
void translate_box(ICOORD v)
void set_region_type(BlobRegionType new_type)
void find_cblob_limits(C_BLOB *blob, float leftx, float rightx, FCOORD rotation, float &ymin, float &ymax)
TabType right_tab_type() const
const TBOX & reduced_box() const
#define ELISTIZEH(CLASSNAME)
void set_left_tab_type(TabType new_type)
void vertical_coutline_projection(C_OUTLINE *outline, STATS *stats)
bool vert_possible() const