tesseract  5.0.0-alpha-619-ge9db
cjkpitch.h File Reference
#include "blobbox.h"

Go to the source code of this file.

Functions

void compute_fixed_pitch_cjk (ICOORD page_tr, TO_BLOCK_LIST *port_blocks)
 

Function Documentation

◆ compute_fixed_pitch_cjk()

void compute_fixed_pitch_cjk ( ICOORD  page_tr,
TO_BLOCK_LIST *  port_blocks 
)

Definition at line 1040 of file cjkpitch.cpp.

1041  {
1042  FPAnalyzer analyzer(page_tr, port_blocks);
1043  if (analyzer.num_rows() == 0) return;
1044 
1045  analyzer.Pass1Analyze();
1046  analyzer.EstimatePitch(true);
1047 
1048  // Perform pass1 analysis again with the initial estimation of row
1049  // pitches, for better estimation.
1050  analyzer.Pass1Analyze();
1051  analyzer.EstimatePitch(true);
1052 
1053  // Early exit if the page doesn't seem to contain fixed pitch rows.
1054  if (!analyzer.maybe_fixed_pitch()) {
1056  tprintf("Page doesn't seem to contain fixed pitch rows\n");
1057  }
1058  return;
1059  }
1060 
1061  unsigned iteration = 0;
1062  do {
1063  analyzer.MergeFragments();
1064  analyzer.FinalizeLargeChars();
1065  analyzer.EstimatePitch(false);
1066  iteration++;
1067  } while (analyzer.Pass2Analyze() && iteration < analyzer.max_iteration());
1068 
1070  tprintf("compute_fixed_pitch_cjk finished after %u iteration (limit=%u)\n",
1071  iteration, analyzer.max_iteration());
1072  }
1073 
1074  analyzer.OutputEstimations();
1075  if (textord_debug_pitch_test) analyzer.DebugOutputResult();
1076 }
tprintf
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:34
textord_debug_pitch_test
bool textord_debug_pitch_test
Definition: topitch.cpp:38