20 #ifndef TESSERACT_TEXTORD_COLFIND_H__ 21 #define TESSERACT_TEXTORD_COLFIND_H__ 42 class ColPartitionSet;
43 class ColPartitionSet_LIST;
44 class ColSegment_LIST;
45 class ColumnGroup_LIST;
48 class TempColumn_LIST;
49 class EquationDetectBase;
64 int resolution,
bool cjk_script,
double aligned_gap_fraction,
65 TabVector_LIST* vlines, TabVector_LIST* hlines,
66 int vertical_x,
int vertical_y);
125 TO_BLOCK* block, BLOBNBOX_CLIST* osd_blobs);
139 int recognition_rotation);
165 TO_BLOCK* block, Pix* photo_mask_pix, Pix* thresholds_pix,
166 Pix* grey_pix, BLOCK_LIST* blocks,
167 BLOBNBOX_LIST* diacritic_blobs, TO_BLOCK_LIST* to_blocks);
177 void DisplayBlocks(BLOCK_LIST* blocks);
186 bool MakeColumns(
bool single_column);
194 void PrintColumnCandidates(
const char* title);
201 bool BiggestUnassignedRange(
int set_count,
const bool* any_columns_possible,
202 int* start,
int* end);
204 int RangeModalColumnSet(
int** column_set_costs,
const int* assigned_costs,
210 void ShrinkRangeToLongestRun(
int** column_set_costs,
211 const int* assigned_costs,
212 const bool* any_columns_possible,
214 int* best_start,
int* best_end);
218 void ExtendRangePastSmallGaps(
int** column_set_costs,
219 const int* assigned_costs,
220 const bool* any_columns_possible,
222 int step,
int end,
int* start);
224 void AssignColumnToRange(
int column_set_id,
int start,
int end,
225 int** column_set_costs,
int* assigned_costs);
228 void ComputeMeanColumnGap(
bool any_multi_column);
236 void ReleaseBlobsAndCleanupUnused(
TO_BLOCK* block);
238 void GridSplitPartitions();
241 void GridMergePartitions();
244 void InsertRemainingNoise(
TO_BLOCK* block);
247 void GridRemoveUnderlinePartitions();
249 void GridInsertHLinePartitions();
251 void GridInsertVLinePartitions();
254 void SetPartitionTypes();
257 void SmoothPartnerRuns();
263 void AddToTempPartList(
ColPartition* part, ColPartition_CLIST* temp_list);
265 void EmptyTempPartList(ColPartition_CLIST* temp_list,
266 WorkingPartSet_LIST* work_set);
269 void TransformToBlocks(BLOCK_LIST* blocks, TO_BLOCK_LIST* to_blocks);
277 void ReflectForRtl(
TO_BLOCK* input_block, BLOBNBOX_LIST* bblobs);
291 void RotateAndReskewBlocks(
bool input_is_rtl, TO_BLOCK_LIST* to_blocks);
298 FCOORD ComputeBlockAndClassifyRotation(
BLOCK* block);
306 int min_gutter_width_;
308 int mean_column_gap_;
311 double tabfind_aligned_gap_fraction_;
335 ColPartition_LIST good_parts_;
338 ColPartition_LIST big_parts_;
340 ColPartition_LIST noise_parts_;
342 BLOBNBOX_LIST image_bblobs_;
344 TabVector_LIST horizontal_lines_;
368 #endif // TESSERACT_TEXTORD_COLFIND_H__ void set_cjk_script(bool is_cjk)
void CorrectOrientation(TO_BLOCK *block, bool vertical_text_lines, int recognition_rotation)
void SetEquationDetect(EquationDetectBase *detect)
void SetupAndFilterNoise(PageSegMode pageseg_mode, Pix *photo_mask_pix, TO_BLOCK *input_block)
const ICOORD & tright() const
bool IsVerticallyAlignedText(double find_vertical_text_ratio, TO_BLOCK *block, BLOBNBOX_CLIST *osd_blobs)
bool textord_tabfind_find_tables
const TextlineProjection * projection() const
void GetDeskewVectors(FCOORD *deskew, FCOORD *reskew)
#define BOOL_VAR_H(name, val, comment)
ColumnFinder(int gridsize, const ICOORD &bleft, const ICOORD &tright, int resolution, bool cjk_script, double aligned_gap_fraction, TabVector_LIST *vlines, TabVector_LIST *hlines, int vertical_x, int vertical_y)
const ICOORD & bleft() const
int FindBlocks(PageSegMode pageseg_mode, Pix *scaled_color, int scaled_factor, TO_BLOCK *block, Pix *photo_mask_pix, Pix *thresholds_pix, Pix *grey_pix, BLOCK_LIST *blocks, BLOBNBOX_LIST *diacritic_blobs, TO_BLOCK_LIST *to_blocks)
const DENORM * denorm() const