|
Tesseract
3.02
|
Go to the source code of this file.
Functions | |
| void | compute_fixed_pitch_cjk (ICOORD page_tr, TO_BLOCK_LIST *port_blocks) |
| void compute_fixed_pitch_cjk | ( | ICOORD | page_tr, |
| TO_BLOCK_LIST * | port_blocks | ||
| ) |
Definition at line 1057 of file cjkpitch.cpp.
{
FPAnalyzer analyzer;
analyzer.Init(page_tr, port_blocks);
if (analyzer.num_rows() == 0) return;
analyzer.Pass1Analyze();
analyzer.EstimatePitch(true);
// Perform pass1 analysis again with the initial estimation of row
// pitches, for better estimation.
analyzer.Pass1Analyze();
analyzer.EstimatePitch(true);
// Early exit if the page doesn't seem to contain fixed pitch rows.
if (!analyzer.maybe_fixed_pitch()) {
if (textord_debug_pitch_test) {
tprintf("Page doesn't seem to contain fixed pitch rows\n");
}
return;
}
int iteration = 0;
do {
analyzer.MergeFragments();
analyzer.FinalizeLargeChars();
analyzer.EstimatePitch(false);
iteration++;
} while (analyzer.Pass2Analyze() && iteration < analyzer.max_iteration());
if (textord_debug_pitch_test) {
tprintf("compute_fixed_pitch_cjk finished after %d iteration (limit=%d)\n",
iteration, analyzer.max_iteration());
}
analyzer.OutputEstimations();
if (textord_debug_pitch_test) analyzer.DebugOutputResult();
}