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;
61 int resolution, TabVector_LIST* vlines, TabVector_LIST* hlines,
62 int vertical_x,
int vertical_y);
129 int recognition_rotation);
147 Pix* scaled_color,
int scaled_factor,
148 TO_BLOCK* block, Pix* photo_mask_pix,
149 BLOCK_LIST* blocks, TO_BLOCK_LIST* to_blocks);
159 void DisplayBlocks(BLOCK_LIST* blocks);
168 bool MakeColumns(
bool single_column);
176 void PrintColumnCandidates(
const char* title);
182 bool BiggestUnassignedRange(
int set_count,
const bool* any_columns_possible,
183 int* start,
int* end);
185 int RangeModalColumnSet(
int** column_set_costs,
const int* assigned_costs,
191 void ShrinkRangeToLongestRun(
int** column_set_costs,
192 const int* assigned_costs,
193 const bool* any_columns_possible,
195 int* best_start,
int* best_end);
199 void ExtendRangePastSmallGaps(
int** column_set_costs,
200 const int* assigned_costs,
201 const bool* any_columns_possible,
203 int step,
int end,
int* start);
205 void AssignColumnToRange(
int column_set_id,
int start,
int end,
206 int** column_set_costs,
int* assigned_costs);
209 void ComputeMeanColumnGap();
217 void ReleaseBlobsAndCleanupUnused(
TO_BLOCK* block);
219 void GridSplitPartitions();
222 void GridMergePartitions();
225 void InsertRemainingNoise(
TO_BLOCK* block);
228 void GridRemoveUnderlinePartitions();
230 void GridInsertHLinePartitions();
232 void GridInsertVLinePartitions();
235 void SetPartitionTypes();
238 void SmoothPartnerRuns();
244 void AddToTempPartList(
ColPartition* part, ColPartition_CLIST* temp_list);
246 void EmptyTempPartList(ColPartition_CLIST* temp_list,
247 WorkingPartSet_LIST* work_set);
250 void TransformToBlocks(BLOCK_LIST* blocks, TO_BLOCK_LIST* to_blocks);
258 void ReflectForRtl(
TO_BLOCK* input_block, BLOBNBOX_LIST* bblobs);
272 void RotateAndReskewBlocks(
bool input_is_rtl, TO_BLOCK_LIST* to_blocks);
279 FCOORD ComputeBlockAndClassifyRotation(
BLOCK* block);
284 int min_gutter_width_;
286 int mean_column_gap_;
310 ColPartition_LIST good_parts_;
313 ColPartition_LIST big_parts_;
315 ColPartition_LIST noise_parts_;
317 BLOBNBOX_LIST image_bblobs_;
319 TabVector_LIST horizontal_lines_;
343 #endif // TESSERACT_TEXTORD_COLFIND_H__