119 return type1 >= type2;
138 area =
static_cast<int>(srcblob->
area());
141 if (owns_cblob_)
delete cblob_ptr;
162 base_char_top_ += v.
y();
163 base_char_bottom_ += v.
y();
172 BLOBNBOX_IT *start_it,
173 BLOBNBOX_IT *blob_it,
179 int* v_min,
int* v_max)
const;
203 double fractional_tolerance,
204 double constant_tolerance)
const;
222 base_char_top_ = box.
top();
223 base_char_bottom_ = box.bottom();
226 box = cblob_ptr->bounding_box();
227 base_char_top_ = box.top();
228 base_char_bottom_ = box.bottom();
229 baseline_y_ = box.bottom();
248 return repeated_set_;
251 repeated_set_ = set_id;
257 return left_tab_type_;
260 left_tab_type_ = new_type;
263 return right_tab_type_;
266 right_tab_type_ = new_type;
272 region_type_ = new_type;
278 spt_type_ = new_type;
287 return vert_possible_;
290 vert_possible_ = value;
293 return horz_possible_;
296 horz_possible_ = value;
302 left_rule_ = new_left;
308 right_rule_ = new_right;
311 return left_crossing_rule_;
314 left_crossing_rule_ = new_left;
317 return right_crossing_rule_;
320 right_crossing_rule_ = new_right;
323 return horz_stroke_width_;
326 horz_stroke_width_ = width;
329 return vert_stroke_width_;
332 vert_stroke_width_ = width;
335 return area_stroke_width_;
344 return leader_on_left_;
347 leader_on_left_ = flag;
350 return leader_on_right_;
353 leader_on_right_ = flag;
356 return neighbours_[n];
359 return good_stroke_neighbours_[n];
363 good_stroke_neighbours_[n] = good;
366 return base_char_top_ != box.top() || base_char_bottom_ != box.bottom();
369 return base_char_top_;
372 return base_char_bottom_;
378 return line_crossings_;
381 line_crossings_ = value;
384 base_char_top_ = diacritic_box.
top();
385 base_char_bottom_ = diacritic_box.
bottom();
388 return base_char_blob_;
391 base_char_blob_ = blob;
396 return vert_possible_ && !horz_possible_;
399 return horz_possible_ && !vert_possible_;
425 BLOBNBOX_LIST* blobs);
427 #ifndef GRAPHICS_DISABLED 430 static void PlotBlobs(BLOBNBOX_LIST* list,
459 area_stroke_width_ = 0.0f;
460 horz_stroke_width_ = 0.0f;
461 vert_stroke_width_ = 0.0f;
477 left_crossing_rule_ = 0;
478 right_crossing_rule_ = 0;
479 if (area_stroke_width_ == 0.0f && area > 0 &&
cblob() != NULL)
482 base_char_top_ = box.top();
483 base_char_bottom_ = box.bottom();
484 baseline_y_ = box.bottom();
486 base_char_blob_ = NULL;
487 horz_possible_ =
false;
488 vert_possible_ =
false;
489 leader_on_left_ =
false;
490 leader_on_right_ =
false;
496 neighbours_[n] = NULL;
497 good_stroke_neighbours_[n] =
false;
515 inT16 left_crossing_rule_;
516 inT16 right_crossing_rule_;
517 inT16 base_char_top_;
518 inT16 base_char_bottom_;
522 float horz_stroke_width_;
523 float vert_stroke_width_;
524 float area_stroke_width_;
531 bool leader_on_left_;
532 bool leader_on_right_;
561 return (y_min + y_max) / 2.0f;
564 return initial_y_min;
612 para_error = new_error;
615 y_origin = (float) (new_c / sqrt (1 + gradient * gradient));
628 return num_repeated_sets_ != -1;
631 num_repeated_sets_ = -1;
634 return num_repeated_sets_;
637 num_repeated_sets_ = num_sets;
682 int num_repeated_sets_;
707 BLOBNBOX_LIST* blobnbox_list[] = {&blobs, &underlines, &noise_blobs,
708 &small_blobs, &large_blobs, NULL};
709 for (BLOBNBOX_LIST** list = blobnbox_list; *list != NULL; ++list) {
710 BLOBNBOX_IT it(*list);
711 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
712 it.data()->rotate(rotation);
717 block->rotate(rotation);
719 STATS widths(0, block->bounding_box().width());
720 STATS heights(0, block->bounding_box().height());
721 BLOBNBOX_IT blob_it(&blobs);
722 for (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
723 widths.add(blob_it.data()->bounding_box().width(), 1);
724 heights.add(blob_it.data()->bounding_box().height(), 1);
726 block->set_median_size(static_cast<int>(widths.median() + 0.5),
727 static_cast<int>(heights.median() + 0.5));
731 TO_ROW_IT row_it = &row_list;
734 for (row_it.mark_cycle_pt(); !row_it.cycled_list();
747 void ReSetAndReFilterBlobs();
750 void DeleteUnownedNoise();
759 void ComputeEdgeOffsets(Pix* thresholds, Pix* grey);
761 #ifndef GRAPHICS_DISABLED 797 TO_ROW_LIST row_list;
802 "Weighting for error in believability");
840 #ifndef GRAPHICS_DISABLED 845 #endif // GRAPHICS_DISABLED bool leader_on_left() const
tesseract::ColPartition * owner() const
const TBOX & bounding_box() const
void rotate(FCOORD rotation)
void clear_rep_chars_marked()
static bool IsTextType(BlobRegionType type)
TBOX box_next_pre_chopped(BLOBNBOX_IT *it)
void set_reduced_box(TBOX new_box)
static bool IsLineType(BlobRegionType type)
float parallel_error() const
void set_limits(float new_min, float new_max)
static bool UnMergeableType(BlobRegionType type)
float area_stroke_width() const
void set_leader_on_left(bool flag)
bool UniquelyVertical() const
void set_neighbour(BlobNeighbourDir n, BLOBNBOX *neighbour, bool good)
int num_repeated_sets() const
float believability() const
#define ELISTIZEH(CLASSNAME)
void reflect_box_in_y_axis()
ScrollView::Color BoxColor() const
PITCH_TYPE pitch_decision
void set_line_crossings(int value)
void set_vert_stroke_width(float width)
void set_vert_possible(bool value)
bool DefiniteIndividualFlow()
bool DominatesInMerge(BlobTextFlowType type1, BlobTextFlowType type2)
TBOX bounding_box() const
void set_parallel_line(float gradient, float new_c, float new_error)
BlobTextFlowType flow() const
inT32 enclosed_area() const
void add_blob(BLOBNBOX *blob, float top, float bottom, float row_size)
void set_flow(BlobTextFlowType value)
void really_merge(BLOBNBOX *other)
static void PlotBlobs(BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour, ScrollView *win)
void set_diacritic_box(const TBOX &diacritic_box)
TabType right_tab_type() const
void set_horz_possible(bool value)
void rotate_box(FCOORD rotation)
BLOBNBOX_LIST * blob_list()
PITCH_TYPE pitch_decision
void set_owns_cblob(bool value)
static void PlotNoiseBlobs(BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour, ScrollView *win)
bool leader_on_right() const
int baseline_position() const
void set_right_rule(int new_right)
int line_crossings() const
int base_char_top() const
BLOBNBOX_LIST noise_blobs
void compute_vertical_projection()
bool joined_to_prev() const
TBOX box_next(BLOBNBOX_IT *it)
void set_left_rule(int new_left)
int NoisyNeighbours() const
void vertical_cblob_projection(C_BLOB *blob, STATS *stats)
BLOBNBOX * neighbour(BlobNeighbourDir n) const
void plot(ScrollView *window, ScrollView::Color blob_colour, ScrollView::Color child_colour)
BlobNeighbourDir DirOtherWay(BlobNeighbourDir dir)
bool vert_possible() const
void set_num_repeated_sets(int num_sets)
int right_crossing_rule() const
BLOBNBOX_LIST large_blobs
void set_horz_stroke_width(float width)
void find_cblob_vlimits(C_BLOB *blob, float leftx, float rightx, float &ymin, float &ymax)
void insert_blob(BLOBNBOX *blob)
double textord_error_weight
int base_char_bottom() const
void set_right_tab_type(TabType new_type)
void vertical_coutline_projection(C_OUTLINE *outline, STATS *stats)
bool rep_chars_marked() const
#define ELIST2IZEH(CLASSNAME)
void find_cblob_hlimits(C_BLOB *blob, float bottomy, float topy, float &xmin, float &xymax)
void set_bounding_box(const TBOX &new_box)
ICOORDELT_LIST char_cells
void rotate(const FCOORD &rotation)
static BLOBNBOX * RealBlob(C_OUTLINE *outline)
void translate_box(ICOORD v)
bool good_stroke_neighbour(BlobNeighbourDir n) const
bool UniquelyHorizontal() const
void EstimateBaselinePosition()
void set_left_tab_type(TabType new_type)
void plot_blob_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour)
bool MatchingStrokeWidth(const BLOBNBOX &other, double fractional_tolerance, double constant_tolerance) const
float horz_stroke_width() const
bool ConfirmNoTabViolation(const BLOBNBOX &other) const
bool horz_possible() const
BLOBNBOX_LIST small_blobs
void set_line(float new_m, float new_c, float new_error)
void NeighbourGaps(int gaps[BND_COUNT]) const
void compute_bounding_box()
C_BLOB * crotate_cblob(C_BLOB *blob, FCOORD rotation)
static const int kErrorWeight
static void DeleteNoiseBlobs(BLOBNBOX_LIST *blobs)
BlobSpecialTextType special_text_type() const
void set_special_text_type(BlobSpecialTextType new_type)
void set_repeated_set(int set_id)
float initial_min_y() const
void set_region_type(BlobRegionType new_type)
static void ComputeEdgeOffsets(Pix *thresholds, Pix *grey, BLOBNBOX_LIST *blobs)
float vert_stroke_width() const
void set_right_crossing_rule(int new_right)
void chop(BLOBNBOX_IT *start_it, BLOBNBOX_IT *blob_it, FCOORD rotation, float xheight)
void set_owner(tesseract::ColPartition *new_owner)
void set_base_char_blob(BLOBNBOX *blob)
static bool IsImageType(BlobRegionType type)
const TBOX & reduced_box() const
BLOBNBOX(C_BLOB *srcblob)
EXTERN ScrollView * to_win
void merge(BLOBNBOX *nextblob)
BlobRegionType region_type() const
void MinMaxGapsClipped(int *h_min, int *h_max, int *v_min, int *v_max) const
#define double_VAR_H(name, val, comment)
static ScrollView::Color TextlineColor(BlobRegionType region_type, BlobTextFlowType flow_type)
int left_crossing_rule() const
void find_cblob_limits(C_BLOB *blob, float leftx, float rightx, FCOORD rotation, float &ymin, float &ymax)
BLOBNBOX * base_char_blob() const
TBOX BoundsWithinLimits(int left, int right)
void set_left_crossing_rule(int new_left)
TabType left_tab_type() const
bool DeletableNoise() const
void set_leader_on_right(bool flag)
inT16 y() const
access_function