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

#include <equationdetect.h>

Inheritance diagram for tesseract::EquationDetect:
Collaboration diagram for tesseract::EquationDetect:

Public Types

enum  IndentType {
  NO_INDENT, LEFT_INDENT, RIGHT_INDENT, BOTH_INDENT,
  INDENT_TYPE_COUNT
}
 

Public Member Functions

 EquationDetect (const char *equ_datapath, const char *equ_language)
 
 ~EquationDetect ()
 
void SetLangTesseract (Tesseract *lang_tesseract)
 
int LabelSpecialText (TO_BLOCK *to_block)
 
int FindEquationParts (ColPartitionGrid *part_grid, ColPartitionSet **best_columns)
 
void SetResolution (const int resolution)
 
- Public Member Functions inherited from tesseract::EquationDetectBase
 EquationDetectBase ()=default
 
virtual ~EquationDetectBase ()
 

Protected Member Functions

void IdentifySpecialText (BLOBNBOX *blob, const int height_th)
 
BlobSpecialTextType EstimateTypeForUnichar (const UNICHARSET &unicharset, const UNICHAR_ID id) const
 
void IdentifySpecialText ()
 
void IdentifyBlobsToSkip (ColPartition *part)
 
void MergePartsByLocation ()
 
void SearchByOverlap (ColPartition *seed, GenericVector< ColPartition *> *parts_overlap)
 
void InsertPartAfterAbsorb (ColPartition *part)
 
void IdentifySeedParts ()
 
bool CheckSeedBlobsCount (ColPartition *part)
 
float ComputeForegroundDensity (const TBOX &tbox)
 
bool CheckForSeed2 (const GenericVector< int > &indented_texts_left, const float foreground_density_th, ColPartition *part)
 
int CountAlignment (const GenericVector< int > &sorted_vec, const int val) const
 
bool CheckSeedFgDensity (const float density_th, ColPartition *part)
 
void SplitCPHorLite (ColPartition *part, GenericVector< TBOX > *splitted_boxes)
 
void SplitCPHor (ColPartition *part, GenericVector< ColPartition *> *parts_splitted)
 
bool CheckSeedDensity (const float math_density_high, const float math_density_low, const ColPartition *part) const
 
IndentType IsIndented (ColPartition *part)
 
void IdentifyInlineParts ()
 
void ComputeCPsSuperBBox ()
 
void IdentifyInlinePartsHorizontal ()
 
int EstimateTextPartLineSpacing ()
 
void IdentifyInlinePartsVertical (const bool top_to_bottom, const int textPartsLineSpacing)
 
bool IsInline (const bool search_bottom, const int textPartsLineSpacing, ColPartition *part)
 
bool ExpandSeed (ColPartition *seed)
 
void ExpandSeedHorizontal (const bool search_left, ColPartition *seed, GenericVector< ColPartition *> *parts_to_merge)
 
void ExpandSeedVertical (const bool search_bottom, ColPartition *seed, GenericVector< ColPartition *> *parts_to_merge)
 
bool IsNearSmallNeighbor (const TBOX &seed_box, const TBOX &part_box) const
 
bool CheckSeedNeighborDensity (const ColPartition *part) const
 
void ProcessMathBlockSatelliteParts ()
 
bool IsMathBlockSatellite (ColPartition *part, GenericVector< ColPartition *> *math_blocks)
 
ColPartitionSearchNNVertical (const bool search_bottom, const ColPartition *part)
 
bool IsNearMathNeighbor (const int y_gap, const ColPartition *neighbor) const
 
void GetOutputTiffName (const char *name, STRING *image_name) const
 
void PaintColParts (const STRING &outfile) const
 
void PaintSpecialTexts (const STRING &outfile) const
 
void PrintSpecialBlobsDensity (const ColPartition *part) const
 

Protected Attributes

Tesseract equ_tesseract_
 
Tesseractlang_tesseract_
 
ColPartitionGridpart_grid_
 
ColPartitionSet ** best_columns_
 
TBOXcps_super_bbox_
 
GenericVector< ColPartition * > cp_seeds_
 
int resolution_
 
int page_count_
 

Additional Inherited Members

- Static Public Member Functions inherited from tesseract::EquationDetectBase
static void RenderSpecialText (Pix *pix, BLOBNBOX *blob)
 

Member Enumeration Documentation

◆ IndentType

Enumerator
NO_INDENT 
LEFT_INDENT 
RIGHT_INDENT 
BOTH_INDENT 
INDENT_TYPE_COUNT 

Constructor & Destructor Documentation

◆ EquationDetect()

tesseract::EquationDetect::EquationDetect ( const char *  equ_datapath,
const char *  equ_language 
)

◆ ~EquationDetect()

tesseract::EquationDetect::~EquationDetect ( )

Member Function Documentation

◆ CheckForSeed2()

bool tesseract::EquationDetect::CheckForSeed2 ( const GenericVector< int > &  indented_texts_left,
const float  foreground_density_th,
ColPartition part 
)
protected

◆ CheckSeedBlobsCount()

bool tesseract::EquationDetect::CheckSeedBlobsCount ( ColPartition part)
protected

◆ CheckSeedDensity()

bool tesseract::EquationDetect::CheckSeedDensity ( const float  math_density_high,
const float  math_density_low,
const ColPartition part 
) const
protected

◆ CheckSeedFgDensity()

bool tesseract::EquationDetect::CheckSeedFgDensity ( const float  density_th,
ColPartition part 
)
protected

◆ CheckSeedNeighborDensity()

bool tesseract::EquationDetect::CheckSeedNeighborDensity ( const ColPartition part) const
protected

◆ ComputeCPsSuperBBox()

void tesseract::EquationDetect::ComputeCPsSuperBBox ( )
protected

◆ ComputeForegroundDensity()

float tesseract::EquationDetect::ComputeForegroundDensity ( const TBOX tbox)
protected

◆ CountAlignment()

int tesseract::EquationDetect::CountAlignment ( const GenericVector< int > &  sorted_vec,
const int  val 
) const
protected

◆ EstimateTextPartLineSpacing()

int tesseract::EquationDetect::EstimateTextPartLineSpacing ( )
protected

◆ EstimateTypeForUnichar()

BlobSpecialTextType tesseract::EquationDetect::EstimateTypeForUnichar ( const UNICHARSET unicharset,
const UNICHAR_ID  id 
) const
protected

◆ ExpandSeed()

bool tesseract::EquationDetect::ExpandSeed ( ColPartition seed)
protected

◆ ExpandSeedHorizontal()

void tesseract::EquationDetect::ExpandSeedHorizontal ( const bool  search_left,
ColPartition seed,
GenericVector< ColPartition *> *  parts_to_merge 
)
protected

◆ ExpandSeedVertical()

void tesseract::EquationDetect::ExpandSeedVertical ( const bool  search_bottom,
ColPartition seed,
GenericVector< ColPartition *> *  parts_to_merge 
)
protected

◆ FindEquationParts()

int tesseract::EquationDetect::FindEquationParts ( ColPartitionGrid part_grid,
ColPartitionSet **  best_columns 
)
virtual

◆ GetOutputTiffName()

void tesseract::EquationDetect::GetOutputTiffName ( const char *  name,
STRING image_name 
) const
protected

◆ IdentifyBlobsToSkip()

void tesseract::EquationDetect::IdentifyBlobsToSkip ( ColPartition part)
protected

◆ IdentifyInlineParts()

void tesseract::EquationDetect::IdentifyInlineParts ( )
protected

◆ IdentifyInlinePartsHorizontal()

void tesseract::EquationDetect::IdentifyInlinePartsHorizontal ( )
protected

◆ IdentifyInlinePartsVertical()

void tesseract::EquationDetect::IdentifyInlinePartsVertical ( const bool  top_to_bottom,
const int  textPartsLineSpacing 
)
protected

◆ IdentifySeedParts()

void tesseract::EquationDetect::IdentifySeedParts ( )
protected

◆ IdentifySpecialText() [1/2]

void tesseract::EquationDetect::IdentifySpecialText ( BLOBNBOX blob,
const int  height_th 
)
protected

◆ IdentifySpecialText() [2/2]

void tesseract::EquationDetect::IdentifySpecialText ( )
protected

◆ InsertPartAfterAbsorb()

void tesseract::EquationDetect::InsertPartAfterAbsorb ( ColPartition part)
protected

◆ IsIndented()

EquationDetect::IndentType tesseract::EquationDetect::IsIndented ( ColPartition part)
protected

◆ IsInline()

bool tesseract::EquationDetect::IsInline ( const bool  search_bottom,
const int  textPartsLineSpacing,
ColPartition part 
)
protected

◆ IsMathBlockSatellite()

bool tesseract::EquationDetect::IsMathBlockSatellite ( ColPartition part,
GenericVector< ColPartition *> *  math_blocks 
)
protected

◆ IsNearMathNeighbor()

bool tesseract::EquationDetect::IsNearMathNeighbor ( const int  y_gap,
const ColPartition neighbor 
) const
protected

◆ IsNearSmallNeighbor()

bool tesseract::EquationDetect::IsNearSmallNeighbor ( const TBOX seed_box,
const TBOX part_box 
) const
protected

◆ LabelSpecialText()

int tesseract::EquationDetect::LabelSpecialText ( TO_BLOCK to_block)
virtual

◆ MergePartsByLocation()

void tesseract::EquationDetect::MergePartsByLocation ( )
protected

◆ PaintColParts()

void tesseract::EquationDetect::PaintColParts ( const STRING outfile) const
protected

◆ PaintSpecialTexts()

void tesseract::EquationDetect::PaintSpecialTexts ( const STRING outfile) const
protected

◆ PrintSpecialBlobsDensity()

void tesseract::EquationDetect::PrintSpecialBlobsDensity ( const ColPartition part) const
protected

◆ ProcessMathBlockSatelliteParts()

void tesseract::EquationDetect::ProcessMathBlockSatelliteParts ( )
protected

◆ SearchByOverlap()

void tesseract::EquationDetect::SearchByOverlap ( ColPartition seed,
GenericVector< ColPartition *> *  parts_overlap 
)
protected

◆ SearchNNVertical()

ColPartition * tesseract::EquationDetect::SearchNNVertical ( const bool  search_bottom,
const ColPartition part 
)
protected

◆ SetLangTesseract()

void tesseract::EquationDetect::SetLangTesseract ( Tesseract lang_tesseract)

◆ SetResolution()

void tesseract::EquationDetect::SetResolution ( const int  resolution)

◆ SplitCPHor()

void tesseract::EquationDetect::SplitCPHor ( ColPartition part,
GenericVector< ColPartition *> *  parts_splitted 
)
protected

◆ SplitCPHorLite()

void tesseract::EquationDetect::SplitCPHorLite ( ColPartition part,
GenericVector< TBOX > *  splitted_boxes 
)
protected

Member Data Documentation

◆ best_columns_

ColPartitionSet** tesseract::EquationDetect::best_columns_
protected

◆ cp_seeds_

GenericVector<ColPartition*> tesseract::EquationDetect::cp_seeds_
protected

◆ cps_super_bbox_

TBOX* tesseract::EquationDetect::cps_super_bbox_
protected

◆ equ_tesseract_

Tesseract tesseract::EquationDetect::equ_tesseract_
protected

◆ lang_tesseract_

Tesseract* tesseract::EquationDetect::lang_tesseract_
protected

◆ page_count_

int tesseract::EquationDetect::page_count_
protected

◆ part_grid_

ColPartitionGrid* tesseract::EquationDetect::part_grid_
protected

◆ resolution_

int tesseract::EquationDetect::resolution_
protected

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