tesseract
4.1.1
|
#include "blobbox.h"
#include "statistc.h"
#include "drawtord.h"
#include "makerow.h"
#include "pitsync1.h"
#include "pithsync.h"
#include "tovars.h"
#include "wordseg.h"
#include "topitch.h"
#include "helpers.h"
#include <memory>
Go to the source code of this file.
Macros | |
#define | BLOCK_STATS_CLUSTERS 10 |
#define | MAX_ALLOWED_PITCH 100 |
Functions | |
void | compute_fixed_pitch (ICOORD page_tr, TO_BLOCK_LIST *port_blocks, float gradient, FCOORD rotation, bool testing_on) |
void | fix_row_pitch (TO_ROW *bad_row, TO_BLOCK *bad_block, TO_BLOCK_LIST *blocks, int32_t row_target, int32_t block_target) |
void | compute_block_pitch (TO_BLOCK *block, FCOORD rotation, int32_t block_index, bool testing_on) |
bool | compute_rows_pitch (TO_BLOCK *block, int32_t block_index, bool testing_on) |
bool | try_doc_fixed (ICOORD page_tr, TO_BLOCK_LIST *port_blocks, float gradient) |
bool | try_block_fixed (TO_BLOCK *block, int32_t block_index) |
bool | try_rows_fixed (TO_BLOCK *block, int32_t block_index, bool testing_on) |
void | print_block_counts (TO_BLOCK *block, int32_t block_index) |
void | count_block_votes (TO_BLOCK *block, int32_t &def_fixed, int32_t &def_prop, int32_t &maybe_fixed, int32_t &maybe_prop, int32_t &corr_fixed, int32_t &corr_prop, int32_t &dunno) |
bool | row_pitch_stats (TO_ROW *row, int32_t maxwidth, bool testing_on) |
bool | find_row_pitch (TO_ROW *row, int32_t maxwidth, int32_t dm_gap, TO_BLOCK *block, int32_t block_index, int32_t row_index, bool testing_on) |
bool | fixed_pitch_row (TO_ROW *row, BLOCK *block, int32_t block_index) |
bool | count_pitch_stats (TO_ROW *row, STATS *gap_stats, STATS *pitch_stats, float initial_pitch, float min_space, bool ignore_outsize, bool split_outsize, int32_t dm_gap) |
float | tune_row_pitch (TO_ROW *row, STATS *projection, int16_t projection_left, int16_t projection_right, float space_size, float &initial_pitch, float &best_sp_sd, int16_t &best_mid_cuts, ICOORDELT_LIST *best_cells, bool testing_on) |
float | tune_row_pitch2 (TO_ROW *row, STATS *projection, int16_t projection_left, int16_t projection_right, float space_size, float &initial_pitch, float &best_sp_sd, int16_t &best_mid_cuts, ICOORDELT_LIST *best_cells, bool testing_on) |
float | compute_pitch_sd (TO_ROW *row, STATS *projection, int16_t projection_left, int16_t projection_right, float space_size, float initial_pitch, float &sp_sd, int16_t &mid_cuts, ICOORDELT_LIST *row_cells, bool testing_on, int16_t start, int16_t end) |
float | compute_pitch_sd2 (TO_ROW *row, STATS *projection, int16_t projection_left, int16_t projection_right, float initial_pitch, int16_t &occupation, int16_t &mid_cuts, ICOORDELT_LIST *row_cells, bool testing_on, int16_t start, int16_t end) |
void | print_pitch_sd (TO_ROW *row, STATS *projection, int16_t projection_left, int16_t projection_right, float space_size, float initial_pitch) |
void | find_repeated_chars (TO_BLOCK *block, bool testing_on) |
void | plot_fp_word (TO_BLOCK *block, float pitch, float nonspace) |
Variables | |
bool | textord_debug_pitch_test = false |
bool | textord_fast_pitch_test = false |
bool | textord_debug_pitch_metric = false |
bool | textord_show_row_cuts = false |
bool | textord_show_page_cuts = false |
bool | textord_pitch_cheat = false |
bool | textord_blockndoc_fixed = false |
double | textord_projection_scale = 0.200 |
double | textord_balance_factor = 1.0 |
#define BLOCK_STATS_CLUSTERS 10 |
Definition at line 56 of file topitch.cpp.
#define MAX_ALLOWED_PITCH 100 |
Definition at line 57 of file topitch.cpp.
void compute_block_pitch | ( | TO_BLOCK * | block, |
FCOORD | rotation, | ||
int32_t | block_index, | ||
bool | testing_on | ||
) |
Definition at line 314 of file topitch.cpp.
void compute_fixed_pitch | ( | ICOORD | page_tr, |
TO_BLOCK_LIST * | port_blocks, | ||
float | gradient, | ||
FCOORD | rotation, | ||
bool | testing_on | ||
) |
Definition at line 80 of file topitch.cpp.
float compute_pitch_sd | ( | TO_ROW * | row, |
STATS * | projection, | ||
int16_t | projection_left, | ||
int16_t | projection_right, | ||
float | space_size, | ||
float | initial_pitch, | ||
float & | sp_sd, | ||
int16_t & | mid_cuts, | ||
ICOORDELT_LIST * | row_cells, | ||
bool | testing_on, | ||
int16_t | start, | ||
int16_t | end | ||
) |
Definition at line 1376 of file topitch.cpp.
float compute_pitch_sd2 | ( | TO_ROW * | row, |
STATS * | projection, | ||
int16_t | projection_left, | ||
int16_t | projection_right, | ||
float | initial_pitch, | ||
int16_t & | occupation, | ||
int16_t & | mid_cuts, | ||
ICOORDELT_LIST * | row_cells, | ||
bool | testing_on, | ||
int16_t | start, | ||
int16_t | end | ||
) |
Definition at line 1539 of file topitch.cpp.
bool compute_rows_pitch | ( | TO_BLOCK * | block, |
int32_t | block_index, | ||
bool | testing_on | ||
) |
Definition at line 357 of file topitch.cpp.
void count_block_votes | ( | TO_BLOCK * | block, |
int32_t & | def_fixed, | ||
int32_t & | def_prop, | ||
int32_t & | maybe_fixed, | ||
int32_t & | maybe_prop, | ||
int32_t & | corr_fixed, | ||
int32_t & | corr_prop, | ||
int32_t & | dunno | ||
) |
Definition at line 660 of file topitch.cpp.
bool count_pitch_stats | ( | TO_ROW * | row, |
STATS * | gap_stats, | ||
STATS * | pitch_stats, | ||
float | initial_pitch, | ||
float | min_space, | ||
bool | ignore_outsize, | ||
bool | split_outsize, | ||
int32_t | dm_gap | ||
) |
Definition at line 1064 of file topitch.cpp.
void find_repeated_chars | ( | TO_BLOCK * | block, |
bool | testing_on | ||
) |
Definition at line 1759 of file topitch.cpp.
bool find_row_pitch | ( | TO_ROW * | row, |
int32_t | maxwidth, | ||
int32_t | dm_gap, | ||
TO_BLOCK * | block, | ||
int32_t | block_index, | ||
int32_t | row_index, | ||
bool | testing_on | ||
) |
Definition at line 840 of file topitch.cpp.
void fix_row_pitch | ( | TO_ROW * | bad_row, |
TO_BLOCK * | bad_block, | ||
TO_BLOCK_LIST * | blocks, | ||
int32_t | row_target, | ||
int32_t | block_target | ||
) |
Definition at line 149 of file topitch.cpp.
Definition at line 980 of file topitch.cpp.
void plot_fp_word | ( | TO_BLOCK * | block, |
float | pitch, | ||
float | nonspace | ||
) |
Definition at line 1825 of file topitch.cpp.
void print_block_counts | ( | TO_BLOCK * | block, |
int32_t | block_index | ||
) |
Definition at line 623 of file topitch.cpp.
void print_pitch_sd | ( | TO_ROW * | row, |
STATS * | projection, | ||
int16_t | projection_left, | ||
int16_t | projection_right, | ||
float | space_size, | ||
float | initial_pitch | ||
) |
Definition at line 1631 of file topitch.cpp.
bool row_pitch_stats | ( | TO_ROW * | row, |
int32_t | maxwidth, | ||
bool | testing_on | ||
) |
Definition at line 707 of file topitch.cpp.
bool try_block_fixed | ( | TO_BLOCK * | block, |
int32_t | block_index | ||
) |
Definition at line 541 of file topitch.cpp.
bool try_doc_fixed | ( | ICOORD | page_tr, |
TO_BLOCK_LIST * | port_blocks, | ||
float | gradient | ||
) |
Definition at line 401 of file topitch.cpp.
bool try_rows_fixed | ( | TO_BLOCK * | block, |
int32_t | block_index, | ||
bool | testing_on | ||
) |
Definition at line 555 of file topitch.cpp.
float tune_row_pitch | ( | TO_ROW * | row, |
STATS * | projection, | ||
int16_t | projection_left, | ||
int16_t | projection_right, | ||
float | space_size, | ||
float & | initial_pitch, | ||
float & | best_sp_sd, | ||
int16_t & | best_mid_cuts, | ||
ICOORDELT_LIST * | best_cells, | ||
bool | testing_on | ||
) |
Definition at line 1152 of file topitch.cpp.
float tune_row_pitch2 | ( | TO_ROW * | row, |
STATS * | projection, | ||
int16_t | projection_left, | ||
int16_t | projection_right, | ||
float | space_size, | ||
float & | initial_pitch, | ||
float & | best_sp_sd, | ||
int16_t & | best_mid_cuts, | ||
ICOORDELT_LIST * | best_cells, | ||
bool | testing_on | ||
) |
Definition at line 1264 of file topitch.cpp.
double textord_balance_factor = 1.0 |
"Ding rate for unbalanced char cells"
Definition at line 54 of file topitch.cpp.
bool textord_blockndoc_fixed = false |
"Attempt whole doc/block fixed pitch"
Definition at line 51 of file topitch.cpp.
bool textord_debug_pitch_metric = false |
"Write full metric stuff"
Definition at line 45 of file topitch.cpp.
bool textord_debug_pitch_test = false |
"Debug on fixed pitch test"
Definition at line 39 of file topitch.cpp.
bool textord_fast_pitch_test = false |
"Do even faster pitch algorithm"
Definition at line 43 of file topitch.cpp.
bool textord_pitch_cheat = false |
"Use correct answer for fixed/prop"
Definition at line 49 of file topitch.cpp.
double textord_projection_scale = 0.200 |
"Ding rate for mid-cuts"
Definition at line 52 of file topitch.cpp.
bool textord_show_page_cuts = false |
"Draw page-level cuts"
Definition at line 47 of file topitch.cpp.
bool textord_show_row_cuts = false |
"Draw row-level cuts"
Definition at line 46 of file topitch.cpp.