19 #ifndef TESSERACT_CCMAIN_EQUATIONDETECT_H_ 20 #define TESSERACT_CCMAIN_EQUATIONDETECT_H_ 35 class ColPartitionGrid;
36 class ColPartitionSet;
41 const char* equ_language);
120 const float foreground_density_th,
148 const float math_density_low,
169 const int textPartsLineSpacing);
173 bool IsInline(
const bool search_bottom,
174 const int textPartsLineSpacing,
195 const TBOX& part_box)
const;
273 #endif // TESSERACT_CCMAIN_EQUATIONDETECT_H_
bool IsNearMathNeighbor(const int y_gap, const ColPartition *neighbor) const
bool CheckForSeed2(const GenericVector< int > &indented_texts_left, const float foreground_density_th, ColPartition *part)
bool IsInline(const bool search_bottom, const int textPartsLineSpacing, ColPartition *part)
GenericVector< ColPartition * > cp_seeds_
void IdentifyBlobsToSkip(ColPartition *part)
BlobSpecialTextType EstimateTypeForUnichar(const UNICHARSET &unicharset, const UNICHAR_ID id) const
void SetResolution(const int resolution)
bool ExpandSeed(ColPartition *seed)
void SplitCPHor(ColPartition *part, GenericVector< ColPartition *> *parts_splitted)
void ProcessMathBlockSatelliteParts()
void PrintSpecialBlobsDensity(const ColPartition *part) const
void IdentifySpecialText()
ColPartition * SearchNNVertical(const bool search_bottom, const ColPartition *part)
void SetLangTesseract(Tesseract *lang_tesseract)
bool IsNearSmallNeighbor(const TBOX &seed_box, const TBOX &part_box) const
int LabelSpecialText(TO_BLOCK *to_block) override
ColPartitionGrid * part_grid_
void GetOutputTiffName(const char *name, STRING *image_name) const
IndentType IsIndented(ColPartition *part)
Tesseract * lang_tesseract_
bool CheckSeedFgDensity(const float density_th, ColPartition *part)
void MergePartsByLocation()
bool CheckSeedDensity(const float math_density_high, const float math_density_low, const ColPartition *part) const
EquationDetect(const char *equ_datapath, const char *equ_language)
float ComputeForegroundDensity(const TBOX &tbox)
void SearchByOverlap(ColPartition *seed, GenericVector< ColPartition *> *parts_overlap)
~EquationDetect() override
bool IsMathBlockSatellite(ColPartition *part, GenericVector< ColPartition *> *math_blocks)
void ExpandSeedVertical(const bool search_bottom, ColPartition *seed, GenericVector< ColPartition *> *parts_to_merge)
ColPartitionSet ** best_columns_
int CountAlignment(const GenericVector< int > &sorted_vec, const int val) const
void InsertPartAfterAbsorb(ColPartition *part)
void PaintColParts(const STRING &outfile) const
int EstimateTextPartLineSpacing()
void ComputeCPsSuperBBox()
void ExpandSeedHorizontal(const bool search_left, ColPartition *seed, GenericVector< ColPartition *> *parts_to_merge)
void IdentifyInlinePartsHorizontal()
bool CheckSeedBlobsCount(ColPartition *part)
void IdentifyInlinePartsVertical(const bool top_to_bottom, const int textPartsLineSpacing)
int FindEquationParts(ColPartitionGrid *part_grid, ColPartitionSet **best_columns) override
void IdentifyInlineParts()
bool CheckSeedNeighborDensity(const ColPartition *part) const
void SplitCPHorLite(ColPartition *part, GenericVector< TBOX > *splitted_boxes)
void PaintSpecialTexts(const STRING &outfile) const