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

#include <edgblob.h>

Collaboration diagram for OL_BUCKETS:

Public Member Functions

 ~OL_BUCKETS ()=default
 
C_OUTLINE_LIST * start_scan ()
 
C_OUTLINE_LIST * scan_next ()
 
OL_BUCKETS::OL_BUCKETS

Construct an array of buckets for associating outlines into blobs.

 OL_BUCKETS (ICOORD bleft, ICOORD tright)
 
OL_BUCKETS::operator(

Return a pointer to a list of C_OUTLINEs corresponding to the given pixel coordinates.

C_OUTLINE_LIST * operator() (int16_t x, int16_t y)
 
OL_BUCKETS::count_children

Find number of descendants of this outline.

int32_t count_children (C_OUTLINE *outline, int32_t max_count)
 
OL_BUCKETS::outline_complexity

This is the new version of count_child.

The goal of this function is to determine if an outline and its interiors could be part of a character blob. This is done by computing a "complexity" index for the outline, which is the return value of this function, and checking it against a threshold. The max_count is used for short-circuiting the recursion and forcing a rejection that guarantees to fail the threshold test. The complexity F for outline X with N children X[i] is F(X) = N + sum_i F(X[i]) * edges_children_per_grandchild so each layer of nesting increases complexity exponentially. An outline can be rejected as a text blob candidate if its complexity is too high, has too many children(likely a container), or has too many layers of nested inner loops. This has the side-effect of flattening out boxed or reversed video text regions.

int32_t outline_complexity (C_OUTLINE *outline, int32_t max_count, int16_t depth)
 
OL_BUCKETS::extract_children

Find number of descendants of this outline.

void extract_children (C_OUTLINE *outline, C_OUTLINE_IT *it)
 

Private Attributes

std::unique_ptr< C_OUTLINE_LIST[]> buckets
 
int16_t bxdim
 
int16_t bydim
 
ICOORD bl
 
ICOORD tr
 
int32_t index
 

Constructor & Destructor Documentation

◆ OL_BUCKETS()

OL_BUCKETS::OL_BUCKETS ( ICOORD  bleft,
ICOORD  tright 
)

◆ ~OL_BUCKETS()

OL_BUCKETS::~OL_BUCKETS ( )
default

Member Function Documentation

◆ count_children()

int32_t OL_BUCKETS::count_children ( C_OUTLINE outline,
int32_t  max_count 
)

◆ extract_children()

void OL_BUCKETS::extract_children ( C_OUTLINE outline,
C_OUTLINE_IT *  it 
)

◆ operator()()

C_OUTLINE_LIST * OL_BUCKETS::operator() ( int16_t  x,
int16_t  y 
)

◆ outline_complexity()

int32_t OL_BUCKETS::outline_complexity ( C_OUTLINE outline,
int32_t  max_count,
int16_t  depth 
)

◆ scan_next()

C_OUTLINE_LIST* OL_BUCKETS::scan_next ( )
inline

◆ start_scan()

C_OUTLINE_LIST* OL_BUCKETS::start_scan ( )
inline

Member Data Documentation

◆ bl

ICOORD OL_BUCKETS::bl
private

◆ buckets

std::unique_ptr<C_OUTLINE_LIST[]> OL_BUCKETS::buckets
private

◆ bxdim

int16_t OL_BUCKETS::bxdim
private

◆ bydim

int16_t OL_BUCKETS::bydim
private

◆ index

int32_t OL_BUCKETS::index
private

◆ tr

ICOORD OL_BUCKETS::tr
private

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