tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
BLOBNBOX Class Reference

#include <blobbox.h>

Inheritance diagram for BLOBNBOX:
Collaboration diagram for BLOBNBOX:

Public Member Functions

 BLOBNBOX ()
 
 BLOBNBOX (C_BLOB *srcblob)
 
 ~BLOBNBOX ()
 
void rotate (FCOORD rotation)
 
void reflect_box_in_y_axis ()
 
void rotate_box (FCOORD rotation)
 
void translate_box (ICOORD v)
 
void merge (BLOBNBOX *nextblob)
 
void really_merge (BLOBNBOX *other)
 
void chop (BLOBNBOX_IT *start_it, BLOBNBOX_IT *blob_it, FCOORD rotation, float xheight)
 
void NeighbourGaps (int gaps[BND_COUNT]) const
 
void MinMaxGapsClipped (int *h_min, int *h_max, int *v_min, int *v_max) const
 
void CleanNeighbours ()
 
int GoodTextBlob () const
 
int NoisyNeighbours () const
 
bool DeletableNoise () const
 
bool DefiniteIndividualFlow ()
 
bool ConfirmNoTabViolation (const BLOBNBOX &other) const
 
bool MatchingStrokeWidth (const BLOBNBOX &other, double fractional_tolerance, double constant_tolerance) const
 
TBOX BoundsWithinLimits (int left, int right)
 
void EstimateBaselinePosition ()
 
const TBOXbounding_box () const
 
void set_bounding_box (const TBOX &new_box)
 
void compute_bounding_box ()
 
const TBOXreduced_box () const
 
void set_reduced_box (TBOX new_box)
 
int32_t enclosed_area () const
 
bool joined_to_prev () const
 
bool red_box_set () const
 
int repeated_set () const
 
void set_repeated_set (int set_id)
 
C_BLOBcblob () const
 
TabType left_tab_type () const
 
void set_left_tab_type (TabType new_type)
 
TabType right_tab_type () const
 
void set_right_tab_type (TabType new_type)
 
BlobRegionType region_type () const
 
void set_region_type (BlobRegionType new_type)
 
BlobSpecialTextType special_text_type () const
 
void set_special_text_type (BlobSpecialTextType new_type)
 
BlobTextFlowType flow () const
 
void set_flow (BlobTextFlowType value)
 
bool vert_possible () const
 
void set_vert_possible (bool value)
 
bool horz_possible () const
 
void set_horz_possible (bool value)
 
int left_rule () const
 
void set_left_rule (int new_left)
 
int right_rule () const
 
void set_right_rule (int new_right)
 
int left_crossing_rule () const
 
void set_left_crossing_rule (int new_left)
 
int right_crossing_rule () const
 
void set_right_crossing_rule (int new_right)
 
float horz_stroke_width () const
 
void set_horz_stroke_width (float width)
 
float vert_stroke_width () const
 
void set_vert_stroke_width (float width)
 
float area_stroke_width () const
 
tesseract::ColPartitionowner () const
 
void set_owner (tesseract::ColPartition *new_owner)
 
bool leader_on_left () const
 
void set_leader_on_left (bool flag)
 
bool leader_on_right () const
 
void set_leader_on_right (bool flag)
 
BLOBNBOXneighbour (BlobNeighbourDir n) const
 
bool good_stroke_neighbour (BlobNeighbourDir n) const
 
void set_neighbour (BlobNeighbourDir n, BLOBNBOX *neighbour, bool good)
 
bool IsDiacritic () const
 
int base_char_top () const
 
int base_char_bottom () const
 
int baseline_position () const
 
int line_crossings () const
 
void set_line_crossings (int value)
 
void set_diacritic_box (const TBOX &diacritic_box)
 
BLOBNBOXbase_char_blob () const
 
void set_base_char_blob (BLOBNBOX *blob)
 
void set_owns_cblob (bool value)
 
bool UniquelyVertical () const
 
bool UniquelyHorizontal () const
 
ScrollView::Color BoxColor () const
 
void plot (ScrollView *window, ScrollView::Color blob_colour, ScrollView::Color child_colour)
 
void ConstructionInit ()
 
void ReInit ()
 
void ClearNeighbours ()
 

Static Public Member Functions

static BLOBNBOXRealBlob (C_OUTLINE *outline)
 
static bool IsTextType (BlobRegionType type)
 
static bool IsImageType (BlobRegionType type)
 
static bool IsLineType (BlobRegionType type)
 
static bool UnMergeableType (BlobRegionType type)
 
static void CleanNeighbours (BLOBNBOX_LIST *blobs)
 
static void DeleteNoiseBlobs (BLOBNBOX_LIST *blobs)
 
static void ComputeEdgeOffsets (Pix *thresholds, Pix *grey, BLOBNBOX_LIST *blobs)
 
static void PlotBlobs (BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour, ScrollView *win)
 
static void PlotNoiseBlobs (BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour, ScrollView *win)
 
static ScrollView::Color TextlineColor (BlobRegionType region_type, BlobTextFlowType flow_type)
 

Private Attributes

C_BLOBcblob_ptr
 
TBOX box
 
TBOX red_box
 
signed int area:30
 
unsigned joined: 1
 
unsigned reduced: 1
 
int repeated_set_
 
TabType left_tab_type_
 
TabType right_tab_type_
 
BlobRegionType region_type_
 
BlobTextFlowType flow_
 
int16_t left_rule_
 
int16_t right_rule_
 
int16_t left_crossing_rule_
 
int16_t right_crossing_rule_
 
int16_t base_char_top_
 
int16_t base_char_bottom_
 
int16_t baseline_y_
 
int line_crossings_
 
BLOBNBOXbase_char_blob_
 
float horz_stroke_width_
 
float vert_stroke_width_
 
float area_stroke_width_
 
tesseract::ColPartitionowner_
 
BlobSpecialTextType spt_type_
 
BLOBNBOXneighbours_ [BND_COUNT]
 
bool good_stroke_neighbours_ [BND_COUNT]
 
bool horz_possible_
 
bool vert_possible_
 
bool leader_on_left_
 
bool leader_on_right_
 
bool owns_cblob_
 

Constructor & Destructor Documentation

◆ BLOBNBOX() [1/2]

BLOBNBOX::BLOBNBOX ( )
inline

◆ BLOBNBOX() [2/2]

BLOBNBOX::BLOBNBOX ( C_BLOB srcblob)
inlineexplicit

◆ ~BLOBNBOX()

BLOBNBOX::~BLOBNBOX ( )
inline

Member Function Documentation

◆ area_stroke_width()

float BLOBNBOX::area_stroke_width ( ) const
inline

◆ base_char_blob()

BLOBNBOX* BLOBNBOX::base_char_blob ( ) const
inline

◆ base_char_bottom()

int BLOBNBOX::base_char_bottom ( ) const
inline

◆ base_char_top()

int BLOBNBOX::base_char_top ( ) const
inline

◆ baseline_position()

int BLOBNBOX::baseline_position ( ) const
inline

◆ bounding_box()

const TBOX& BLOBNBOX::bounding_box ( ) const
inline

◆ BoundsWithinLimits()

TBOX BLOBNBOX::BoundsWithinLimits ( int  left,
int  right 
)

◆ BoxColor()

ScrollView::Color BLOBNBOX::BoxColor ( ) const

◆ cblob()

C_BLOB* BLOBNBOX::cblob ( ) const
inline

◆ chop()

void BLOBNBOX::chop ( BLOBNBOX_IT *  start_it,
BLOBNBOX_IT *  blob_it,
FCOORD  rotation,
float  xheight 
)

◆ CleanNeighbours() [1/2]

void BLOBNBOX::CleanNeighbours ( )

◆ CleanNeighbours() [2/2]

void BLOBNBOX::CleanNeighbours ( BLOBNBOX_LIST *  blobs)
static

◆ ClearNeighbours()

void BLOBNBOX::ClearNeighbours ( )
inline

◆ compute_bounding_box()

void BLOBNBOX::compute_bounding_box ( )
inline

◆ ComputeEdgeOffsets()

void BLOBNBOX::ComputeEdgeOffsets ( Pix *  thresholds,
Pix *  grey,
BLOBNBOX_LIST *  blobs 
)
static

◆ ConfirmNoTabViolation()

bool BLOBNBOX::ConfirmNoTabViolation ( const BLOBNBOX other) const

◆ ConstructionInit()

void BLOBNBOX::ConstructionInit ( )
inline

◆ DefiniteIndividualFlow()

bool BLOBNBOX::DefiniteIndividualFlow ( )

◆ DeletableNoise()

bool BLOBNBOX::DeletableNoise ( ) const
inline

◆ DeleteNoiseBlobs()

void BLOBNBOX::DeleteNoiseBlobs ( BLOBNBOX_LIST *  blobs)
static

◆ enclosed_area()

int32_t BLOBNBOX::enclosed_area ( ) const
inline

◆ EstimateBaselinePosition()

void BLOBNBOX::EstimateBaselinePosition ( )

◆ flow()

BlobTextFlowType BLOBNBOX::flow ( ) const
inline

◆ good_stroke_neighbour()

bool BLOBNBOX::good_stroke_neighbour ( BlobNeighbourDir  n) const
inline

◆ GoodTextBlob()

int BLOBNBOX::GoodTextBlob ( ) const

◆ horz_possible()

bool BLOBNBOX::horz_possible ( ) const
inline

◆ horz_stroke_width()

float BLOBNBOX::horz_stroke_width ( ) const
inline

◆ IsDiacritic()

bool BLOBNBOX::IsDiacritic ( ) const
inline

◆ IsImageType()

static bool BLOBNBOX::IsImageType ( BlobRegionType  type)
inlinestatic

◆ IsLineType()

static bool BLOBNBOX::IsLineType ( BlobRegionType  type)
inlinestatic

◆ IsTextType()

static bool BLOBNBOX::IsTextType ( BlobRegionType  type)
inlinestatic

◆ joined_to_prev()

bool BLOBNBOX::joined_to_prev ( ) const
inline

◆ leader_on_left()

bool BLOBNBOX::leader_on_left ( ) const
inline

◆ leader_on_right()

bool BLOBNBOX::leader_on_right ( ) const
inline

◆ left_crossing_rule()

int BLOBNBOX::left_crossing_rule ( ) const
inline

◆ left_rule()

int BLOBNBOX::left_rule ( ) const
inline

◆ left_tab_type()

TabType BLOBNBOX::left_tab_type ( ) const
inline

◆ line_crossings()

int BLOBNBOX::line_crossings ( ) const
inline

◆ MatchingStrokeWidth()

bool BLOBNBOX::MatchingStrokeWidth ( const BLOBNBOX other,
double  fractional_tolerance,
double  constant_tolerance 
) const

◆ merge()

void BLOBNBOX::merge ( BLOBNBOX nextblob)

◆ MinMaxGapsClipped()

void BLOBNBOX::MinMaxGapsClipped ( int *  h_min,
int *  h_max,
int *  v_min,
int *  v_max 
) const

◆ neighbour()

BLOBNBOX* BLOBNBOX::neighbour ( BlobNeighbourDir  n) const
inline

◆ NeighbourGaps()

void BLOBNBOX::NeighbourGaps ( int  gaps[BND_COUNT]) const

◆ NoisyNeighbours()

int BLOBNBOX::NoisyNeighbours ( ) const

◆ owner()

tesseract::ColPartition* BLOBNBOX::owner ( ) const
inline

◆ plot()

void BLOBNBOX::plot ( ScrollView window,
ScrollView::Color  blob_colour,
ScrollView::Color  child_colour 
)

◆ PlotBlobs()

void BLOBNBOX::PlotBlobs ( BLOBNBOX_LIST *  list,
ScrollView::Color  body_colour,
ScrollView::Color  child_colour,
ScrollView win 
)
static

◆ PlotNoiseBlobs()

void BLOBNBOX::PlotNoiseBlobs ( BLOBNBOX_LIST *  list,
ScrollView::Color  body_colour,
ScrollView::Color  child_colour,
ScrollView win 
)
static

◆ RealBlob()

static BLOBNBOX* BLOBNBOX::RealBlob ( C_OUTLINE outline)
inlinestatic

◆ really_merge()

void BLOBNBOX::really_merge ( BLOBNBOX other)

◆ red_box_set()

bool BLOBNBOX::red_box_set ( ) const
inline

◆ reduced_box()

const TBOX& BLOBNBOX::reduced_box ( ) const
inline

◆ reflect_box_in_y_axis()

void BLOBNBOX::reflect_box_in_y_axis ( )

◆ region_type()

BlobRegionType BLOBNBOX::region_type ( ) const
inline

◆ ReInit()

void BLOBNBOX::ReInit ( )
inline

◆ repeated_set()

int BLOBNBOX::repeated_set ( ) const
inline

◆ right_crossing_rule()

int BLOBNBOX::right_crossing_rule ( ) const
inline

◆ right_rule()

int BLOBNBOX::right_rule ( ) const
inline

◆ right_tab_type()

TabType BLOBNBOX::right_tab_type ( ) const
inline

◆ rotate()

void BLOBNBOX::rotate ( FCOORD  rotation)

◆ rotate_box()

void BLOBNBOX::rotate_box ( FCOORD  rotation)

◆ set_base_char_blob()

void BLOBNBOX::set_base_char_blob ( BLOBNBOX blob)
inline

◆ set_bounding_box()

void BLOBNBOX::set_bounding_box ( const TBOX new_box)
inline

◆ set_diacritic_box()

void BLOBNBOX::set_diacritic_box ( const TBOX diacritic_box)
inline

◆ set_flow()

void BLOBNBOX::set_flow ( BlobTextFlowType  value)
inline

◆ set_horz_possible()

void BLOBNBOX::set_horz_possible ( bool  value)
inline

◆ set_horz_stroke_width()

void BLOBNBOX::set_horz_stroke_width ( float  width)
inline

◆ set_leader_on_left()

void BLOBNBOX::set_leader_on_left ( bool  flag)
inline

◆ set_leader_on_right()

void BLOBNBOX::set_leader_on_right ( bool  flag)
inline

◆ set_left_crossing_rule()

void BLOBNBOX::set_left_crossing_rule ( int  new_left)
inline

◆ set_left_rule()

void BLOBNBOX::set_left_rule ( int  new_left)
inline

◆ set_left_tab_type()

void BLOBNBOX::set_left_tab_type ( TabType  new_type)
inline

◆ set_line_crossings()

void BLOBNBOX::set_line_crossings ( int  value)
inline

◆ set_neighbour()

void BLOBNBOX::set_neighbour ( BlobNeighbourDir  n,
BLOBNBOX neighbour,
bool  good 
)
inline

◆ set_owner()

void BLOBNBOX::set_owner ( tesseract::ColPartition new_owner)
inline

◆ set_owns_cblob()

void BLOBNBOX::set_owns_cblob ( bool  value)
inline

◆ set_reduced_box()

void BLOBNBOX::set_reduced_box ( TBOX  new_box)
inline

◆ set_region_type()

void BLOBNBOX::set_region_type ( BlobRegionType  new_type)
inline

◆ set_repeated_set()

void BLOBNBOX::set_repeated_set ( int  set_id)
inline

◆ set_right_crossing_rule()

void BLOBNBOX::set_right_crossing_rule ( int  new_right)
inline

◆ set_right_rule()

void BLOBNBOX::set_right_rule ( int  new_right)
inline

◆ set_right_tab_type()

void BLOBNBOX::set_right_tab_type ( TabType  new_type)
inline

◆ set_special_text_type()

void BLOBNBOX::set_special_text_type ( BlobSpecialTextType  new_type)
inline

◆ set_vert_possible()

void BLOBNBOX::set_vert_possible ( bool  value)
inline

◆ set_vert_stroke_width()

void BLOBNBOX::set_vert_stroke_width ( float  width)
inline

◆ special_text_type()

BlobSpecialTextType BLOBNBOX::special_text_type ( ) const
inline

◆ TextlineColor()

ScrollView::Color BLOBNBOX::TextlineColor ( BlobRegionType  region_type,
BlobTextFlowType  flow_type 
)
static

◆ translate_box()

void BLOBNBOX::translate_box ( ICOORD  v)
inline

◆ UniquelyHorizontal()

bool BLOBNBOX::UniquelyHorizontal ( ) const
inline

◆ UniquelyVertical()

bool BLOBNBOX::UniquelyVertical ( ) const
inline

◆ UnMergeableType()

static bool BLOBNBOX::UnMergeableType ( BlobRegionType  type)
inlinestatic

◆ vert_possible()

bool BLOBNBOX::vert_possible ( ) const
inline

◆ vert_stroke_width()

float BLOBNBOX::vert_stroke_width ( ) const
inline

Member Data Documentation

◆ area

signed int BLOBNBOX::area
private

◆ area_stroke_width_

float BLOBNBOX::area_stroke_width_
private

◆ base_char_blob_

BLOBNBOX* BLOBNBOX::base_char_blob_
private

◆ base_char_bottom_

int16_t BLOBNBOX::base_char_bottom_
private

◆ base_char_top_

int16_t BLOBNBOX::base_char_top_
private

◆ baseline_y_

int16_t BLOBNBOX::baseline_y_
private

◆ box

TBOX BLOBNBOX::box
private

◆ cblob_ptr

C_BLOB* BLOBNBOX::cblob_ptr
private

◆ flow_

BlobTextFlowType BLOBNBOX::flow_
private

◆ good_stroke_neighbours_

bool BLOBNBOX::good_stroke_neighbours_[BND_COUNT]
private

◆ horz_possible_

bool BLOBNBOX::horz_possible_
private

◆ horz_stroke_width_

float BLOBNBOX::horz_stroke_width_
private

◆ joined

unsigned BLOBNBOX::joined
private

◆ leader_on_left_

bool BLOBNBOX::leader_on_left_
private

◆ leader_on_right_

bool BLOBNBOX::leader_on_right_
private

◆ left_crossing_rule_

int16_t BLOBNBOX::left_crossing_rule_
private

◆ left_rule_

int16_t BLOBNBOX::left_rule_
private

◆ left_tab_type_

TabType BLOBNBOX::left_tab_type_
private

◆ line_crossings_

int BLOBNBOX::line_crossings_
private

◆ neighbours_

BLOBNBOX* BLOBNBOX::neighbours_[BND_COUNT]
private

◆ owner_

tesseract::ColPartition* BLOBNBOX::owner_
private

◆ owns_cblob_

bool BLOBNBOX::owns_cblob_
private

◆ red_box

TBOX BLOBNBOX::red_box
private

◆ reduced

unsigned BLOBNBOX::reduced
private

◆ region_type_

BlobRegionType BLOBNBOX::region_type_
private

◆ repeated_set_

int BLOBNBOX::repeated_set_
private

◆ right_crossing_rule_

int16_t BLOBNBOX::right_crossing_rule_
private

◆ right_rule_

int16_t BLOBNBOX::right_rule_
private

◆ right_tab_type_

TabType BLOBNBOX::right_tab_type_
private

◆ spt_type_

BlobSpecialTextType BLOBNBOX::spt_type_
private

◆ vert_possible_

bool BLOBNBOX::vert_possible_
private

◆ vert_stroke_width_

float BLOBNBOX::vert_stroke_width_
private

The documentation for this class was generated from the following files: