|
Tesseract 3.01
|
#include "mfcpch.h"#include "stderr.h"#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 "secname.h"#include "helpers.h"Defines | |
| #define | EXTERN |
| #define | FIXED_WIDTH_MULTIPLE 5 |
| #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, BOOL8 testing_on) |
| void | fix_row_pitch (TO_ROW *bad_row, TO_BLOCK *bad_block, TO_BLOCK_LIST *blocks, inT32 row_target, inT32 block_target) |
| void | compute_block_pitch (TO_BLOCK *block, FCOORD rotation, inT32 block_index, BOOL8 testing_on) |
| BOOL8 | compute_rows_pitch (TO_BLOCK *block, inT32 block_index, BOOL8 testing_on) |
| BOOL8 | try_doc_fixed (ICOORD page_tr, TO_BLOCK_LIST *port_blocks, float gradient) |
| BOOL8 | try_block_fixed (TO_BLOCK *block, inT32 block_index) |
| BOOL8 | try_rows_fixed (TO_BLOCK *block, inT32 block_index, BOOL8 testing_on) |
| void | print_block_counts (TO_BLOCK *block, inT32 block_index) |
| void | count_block_votes (TO_BLOCK *block, inT32 &def_fixed, inT32 &def_prop, inT32 &maybe_fixed, inT32 &maybe_prop, inT32 &corr_fixed, inT32 &corr_prop, inT32 &dunno) |
| BOOL8 | row_pitch_stats (TO_ROW *row, inT32 maxwidth, BOOL8 testing_on) |
| BOOL8 | find_row_pitch (TO_ROW *row, inT32 maxwidth, inT32 dm_gap, TO_BLOCK *block, inT32 block_index, inT32 row_index, BOOL8 testing_on) |
| BOOL8 | fixed_pitch_row (TO_ROW *row, inT32 block_index) |
| BOOL8 | count_pitch_stats (TO_ROW *row, STATS *gap_stats, STATS *pitch_stats, float initial_pitch, float min_space, BOOL8 ignore_outsize, BOOL8 split_outsize, inT32 dm_gap) |
| float | tune_row_pitch (TO_ROW *row, STATS *projection, inT16 projection_left, inT16 projection_right, float space_size, float &initial_pitch, float &best_sp_sd, inT16 &best_mid_cuts, ICOORDELT_LIST *best_cells, BOOL8 testing_on) |
| float | tune_row_pitch2 (TO_ROW *row, STATS *projection, inT16 projection_left, inT16 projection_right, float space_size, float &initial_pitch, float &best_sp_sd, inT16 &best_mid_cuts, ICOORDELT_LIST *best_cells, BOOL8 testing_on) |
| float | compute_pitch_sd (TO_ROW *row, STATS *projection, inT16 projection_left, inT16 projection_right, float space_size, float initial_pitch, float &sp_sd, inT16 &mid_cuts, ICOORDELT_LIST *row_cells, BOOL8 testing_on, inT16 start, inT16 end) |
| float | compute_pitch_sd2 (TO_ROW *row, STATS *projection, inT16 projection_left, inT16 projection_right, float initial_pitch, inT16 &occupation, inT16 &mid_cuts, ICOORDELT_LIST *row_cells, BOOL8 testing_on, inT16 start, inT16 end) |
| void | print_pitch_sd (TO_ROW *row, STATS *projection, inT16 projection_left, inT16 projection_right, float space_size, float initial_pitch) |
| void | find_repeated_chars (TO_BLOCK *block, BOOL8 testing_on) |
| void | plot_fp_word (TO_BLOCK *block, float pitch, float nonspace) |
Variables | |
| EXTERN bool | textord_all_prop = 0 |
| EXTERN bool | textord_debug_pitch_test = 0 |
| EXTERN bool | textord_disable_pitch_test = 0 |
| EXTERN bool | textord_fast_pitch_test = 0 |
| EXTERN bool | textord_debug_pitch_metric = 0 |
| EXTERN bool | textord_show_row_cuts = 0 |
| EXTERN bool | textord_show_page_cuts = 0 |
| EXTERN bool | textord_pitch_cheat = 0 |
| EXTERN bool | textord_blockndoc_fixed = 0 |
| EXTERN double | textord_projection_scale = 0.200 |
| EXTERN double | textord_balance_factor = 1.0 |
| #define BLOCK_STATS_CLUSTERS 10 |
| #define EXTERN |
| #define FIXED_WIDTH_MULTIPLE 5 |
| #define MAX_ALLOWED_PITCH 100 |
| void compute_fixed_pitch | ( | ICOORD | page_tr, |
| TO_BLOCK_LIST * | port_blocks, | ||
| float | gradient, | ||
| FCOORD | rotation, | ||
| BOOL8 | testing_on | ||
| ) |
| float compute_pitch_sd | ( | TO_ROW * | row, |
| STATS * | projection, | ||
| inT16 | projection_left, | ||
| inT16 | projection_right, | ||
| float | space_size, | ||
| float | initial_pitch, | ||
| float & | sp_sd, | ||
| inT16 & | mid_cuts, | ||
| ICOORDELT_LIST * | row_cells, | ||
| BOOL8 | testing_on, | ||
| inT16 | start, | ||
| inT16 | end | ||
| ) |
| float compute_pitch_sd2 | ( | TO_ROW * | row, |
| STATS * | projection, | ||
| inT16 | projection_left, | ||
| inT16 | projection_right, | ||
| float | initial_pitch, | ||
| inT16 & | occupation, | ||
| inT16 & | mid_cuts, | ||
| ICOORDELT_LIST * | row_cells, | ||
| BOOL8 | testing_on, | ||
| inT16 | start, | ||
| inT16 | end | ||
| ) |
| void count_block_votes | ( | TO_BLOCK * | block, |
| inT32 & | def_fixed, | ||
| inT32 & | def_prop, | ||
| inT32 & | maybe_fixed, | ||
| inT32 & | maybe_prop, | ||
| inT32 & | corr_fixed, | ||
| inT32 & | corr_prop, | ||
| inT32 & | dunno | ||
| ) |
| BOOL8 count_pitch_stats | ( | TO_ROW * | row, |
| STATS * | gap_stats, | ||
| STATS * | pitch_stats, | ||
| float | initial_pitch, | ||
| float | min_space, | ||
| BOOL8 | ignore_outsize, | ||
| BOOL8 | split_outsize, | ||
| inT32 | dm_gap | ||
| ) |
| BOOL8 find_row_pitch | ( | TO_ROW * | row, |
| inT32 | maxwidth, | ||
| inT32 | dm_gap, | ||
| TO_BLOCK * | block, | ||
| inT32 | block_index, | ||
| inT32 | row_index, | ||
| BOOL8 | testing_on | ||
| ) |
| void fix_row_pitch | ( | TO_ROW * | bad_row, |
| TO_BLOCK * | bad_block, | ||
| TO_BLOCK_LIST * | blocks, | ||
| inT32 | row_target, | ||
| inT32 | block_target | ||
| ) |
| void plot_fp_word | ( | TO_BLOCK * | block, |
| float | pitch, | ||
| float | nonspace | ||
| ) |
| void print_pitch_sd | ( | TO_ROW * | row, |
| STATS * | projection, | ||
| inT16 | projection_left, | ||
| inT16 | projection_right, | ||
| float | space_size, | ||
| float | initial_pitch | ||
| ) |
| float tune_row_pitch | ( | TO_ROW * | row, |
| STATS * | projection, | ||
| inT16 | projection_left, | ||
| inT16 | projection_right, | ||
| float | space_size, | ||
| float & | initial_pitch, | ||
| float & | best_sp_sd, | ||
| inT16 & | best_mid_cuts, | ||
| ICOORDELT_LIST * | best_cells, | ||
| BOOL8 | testing_on | ||
| ) |
| float tune_row_pitch2 | ( | TO_ROW * | row, |
| STATS * | projection, | ||
| inT16 | projection_left, | ||
| inT16 | projection_right, | ||
| float | space_size, | ||
| float & | initial_pitch, | ||
| float & | best_sp_sd, | ||
| inT16 & | best_mid_cuts, | ||
| ICOORDELT_LIST * | best_cells, | ||
| BOOL8 | testing_on | ||
| ) |
| EXTERN bool textord_all_prop = 0 |
"All doc is proportial text"
| EXTERN double textord_balance_factor = 1.0 |
"Ding rate for unbalanced char cells"
| EXTERN bool textord_blockndoc_fixed = 0 |
"Attempt whole doc/block fixed pitch"
| EXTERN bool textord_debug_pitch_metric = 0 |
"Write full metric stuff"
| EXTERN bool textord_debug_pitch_test = 0 |
"Debug on fixed pitch test"
| EXTERN bool textord_disable_pitch_test = 0 |
"Turn off dp fixed pitch algorithm"
| EXTERN bool textord_fast_pitch_test = 0 |
"Do even faster pitch algorithm"
| EXTERN bool textord_pitch_cheat = 0 |
"Use correct answer for fixed/prop"
| EXTERN double textord_projection_scale = 0.200 |
"Ding rate for mid-cuts"
| EXTERN bool textord_show_page_cuts = 0 |
"Draw page-level cuts"
| EXTERN bool textord_show_row_cuts = 0 |
"Draw row-level cuts"