tesseract-doxygen/textord/makerow.cpp File Reference

#include "mfcpch.h"
#include "stderr.h"
#include "blobbox.h"
#include "lmedsq.h"
#include "statistc.h"
#include "drawtord.h"
#include "blkocc.h"
#include "sortflts.h"
#include "elst.h"
#include "notdll.h"
#include "varable.h"
#include "tesseractclass.h"
#include <time.h>
#include "ocrblock.h"
#include "tessclas.h"
#include "fpchop.h"
#include "tprintf.h"
#include "tovars.h"

Defines

#define MAX_HEIGHT_MODES   12

Functions

float make_single_row (ICOORD page_tr, TO_BLOCK *block, TO_BLOCK_LIST *blocks, tesseract::Tesseract *tess)
float make_rows (ICOORD page_tr, BLOCK_LIST *blocks, TO_BLOCK_LIST *land_blocks, TO_BLOCK_LIST *port_blocks, tesseract::Tesseract *tess)
void make_initial_textrows (ICOORD page_tr, TO_BLOCK *block, FCOORD rotation, BOOL8 testing_on)
void fit_lms_line (TO_ROW *row)
void compute_page_skew (TO_BLOCK_LIST *blocks, float &page_m, float &page_err)
void cleanup_rows (ICOORD page_tr, TO_BLOCK *block, float gradient, FCOORD rotation, inT32 block_edge, BOOL8 testing_on, tesseract::Tesseract *tess)
void delete_non_dropout_rows (TO_BLOCK *block, float gradient, FCOORD rotation, inT32 block_edge, BOOL8 testing_on)
BOOL8 find_best_dropout_row (TO_ROW *row, inT32 distance, float dist_limit, inT32 line_index, TO_ROW_IT *row_it, BOOL8 testing_on)
TBOX deskew_block_coords (TO_BLOCK *block, float gradient)
void compute_line_occupation (TO_BLOCK *block, float gradient, inT32 min_y, inT32 max_y, inT32 *occupation, inT32 *deltas)
void compute_occupation_threshold (inT32 low_window, inT32 high_window, inT32 line_count, inT32 *occupation, inT32 *thresholds)
void compute_dropout_distances (inT32 *occupation, inT32 *thresholds, inT32 line_count)
void expand_rows (ICOORD page_tr, TO_BLOCK *block, float gradient, FCOORD rotation, inT32 block_edge, BOOL8 testing_on)
void adjust_row_limits (TO_BLOCK *block)
void compute_row_stats (TO_BLOCK *block, BOOL8 testing_on)
void compute_block_xheight (TO_BLOCK *block, float gradient, tesseract::Tesseract *tess)
void compute_row_xheight (TO_ROW *row, float gradient, int block_line_size, tesseract::Tesseract *tess)
void fill_heights (TO_ROW *row, float gradient, int min_height, int max_height, STATS *heights, STATS *floating_heights)
int compute_xheight_from_modes (STATS *heights, STATS *floating_heights, int min_height, int max_height, float *xheight, float *ascrise)
inT32 compute_row_descdrop (TO_ROW *row, float gradient, int xheight_blob_count, STATS *asc_heights)
inT32 compute_height_modes (STATS *heights, inT32 min_height, inT32 max_height, inT32 *modes, inT32 maxmodes)
void correct_row_xheight (TO_ROW *row, float xheight, float ascrise, float descdrop)
void separate_underlines (TO_BLOCK *block, float gradient, FCOORD rotation, BOOL8 testing_on)
void pre_associate_blobs (ICOORD page_tr, TO_BLOCK *block, FCOORD rotation, BOOL8 testing_on)
void fit_parallel_rows (TO_BLOCK *block, float gradient, FCOORD rotation, inT32 block_edge, BOOL8 testing_on)
void fit_parallel_lms (float gradient, TO_ROW *row)
void make_spline_rows (TO_BLOCK *block, float gradient, FCOORD rotation, inT32 block_edge, BOOL8 testing_on, tesseract::Tesseract *tess)
void make_baseline_spline (TO_ROW *row, TO_BLOCK *block)
BOOL8 segment_baseline (TO_ROW *row, TO_BLOCK *block, inT32 &segments, inT32 xstarts[])
double * linear_spline_baseline (TO_ROW *row, TO_BLOCK *block, inT32 &segments, inT32 xstarts[])
void assign_blobs_to_rows (TO_BLOCK *block, float *gradient, int pass, BOOL8 reject_misses, BOOL8 make_new_rows, BOOL8 drawing_skew)
OVERLAP_STATE most_overlapping_row (TO_ROW_IT *row_it, TO_ROW *&best_row, float top, float bottom, float rowsize, BOOL8 testing_blob)
int blob_x_order (const void *item1, const void *item2)
int row_y_order (const void *item1, const void *item2)
int row_spacing_order (const void *item1, const void *item2)
void mark_repeated_chars (TO_ROW *row, float block_xheight, tesseract::Tesseract *tess)

Variables

bool textord_heavy_nr = FALSE
bool textord_show_initial_rows = FALSE
bool textord_show_parallel_rows = FALSE
bool textord_show_expanded_rows = FALSE
bool textord_show_final_rows = FALSE
bool textord_show_final_blobs = FALSE
bool textord_test_landscape = FALSE
bool textord_parallel_baselines = TRUE
bool textord_straight_baselines = FALSE
bool textord_quadratic_baselines = FALSE
bool textord_old_baselines = TRUE
bool textord_old_xheight = FALSE
bool textord_fix_xheight_bug = TRUE
bool textord_fix_makerow_bug = TRUE
bool textord_cblob_blockocc = TRUE
bool textord_debug_xheights = FALSE
bool textord_biased_skewcalc = TRUE
bool textord_interpolating_skew = TRUE
int textord_skewsmooth_offset = 2
int textord_skewsmooth_offset2 = 1
int textord_test_x = -1
int textord_test_y = -1
int textord_min_blobs_in_row = 4
int textord_spline_minblobs = 8
int textord_spline_medianwin = 6
int textord_max_blob_overlaps = 4
int textord_min_xheight = 10
double textord_spline_shift_fraction = 0.02
double textord_spline_outlier_fraction = 0.1
double textord_skew_ile = 0.5
double textord_skew_lag = 0.01
double textord_linespace_iqrlimit = 0.2
double textord_width_limit = 8
double textord_chop_width = 1.5
double textord_expansion_factor = 1.0
double textord_overlap_x = 0.5
double textord_merge_desc = 0.25
double textord_merge_x = 0.5
double textord_merge_asc = 0.25
double textord_minxh = 0.25
double textord_min_linesize = 1.25
double textord_excess_blobsize = 1.3
double textord_occupancy_threshold = 0.4
double textord_underline_width = 2.0
double textord_min_blob_height_fraction = 0.75
double textord_xheight_mode_fraction = 0.4
double textord_ascheight_mode_fraction = 0.08
double textord_descheight_mode_fraction = 0.08
double textord_ascx_ratio_min = 1.3
double textord_ascx_ratio_max = 1.8
double textord_descx_ratio_min = 0.25
double textord_descx_ratio_max = 0.6
double textord_xheight_error_margin = 0.1
const double kNoiseSize = 0.5
const int kMinSize = 8

Define Documentation

#define MAX_HEIGHT_MODES   12

Function Documentation

void adjust_row_limits ( TO_BLOCK block  ) 
void assign_blobs_to_rows ( TO_BLOCK block,
float *  gradient,
int  pass,
BOOL8  reject_misses,
BOOL8  make_new_rows,
BOOL8  drawing_skew 
)
int blob_x_order ( const void *  item1,
const void *  item2 
)
void cleanup_rows ( ICOORD  page_tr,
TO_BLOCK block,
float  gradient,
FCOORD  rotation,
inT32  block_edge,
BOOL8  testing_on,
tesseract::Tesseract tess 
)
void compute_block_xheight ( TO_BLOCK block,
float  gradient,
tesseract::Tesseract tess 
)
void compute_dropout_distances ( inT32 occupation,
inT32 thresholds,
inT32  line_count 
)
inT32 compute_height_modes ( STATS heights,
inT32  min_height,
inT32  max_height,
inT32 modes,
inT32  maxmodes 
)
void compute_line_occupation ( TO_BLOCK block,
float  gradient,
inT32  min_y,
inT32  max_y,
inT32 occupation,
inT32 deltas 
)
void compute_occupation_threshold ( inT32  low_window,
inT32  high_window,
inT32  line_count,
inT32 occupation,
inT32 thresholds 
)
void compute_page_skew ( TO_BLOCK_LIST *  blocks,
float &  page_m,
float &  page_err 
)
inT32 compute_row_descdrop ( TO_ROW row,
float  gradient,
int  xheight_blob_count,
STATS asc_heights 
)
void compute_row_stats ( TO_BLOCK block,
BOOL8  testing_on 
)
void compute_row_xheight ( TO_ROW row,
float  gradient,
int  block_line_size,
tesseract::Tesseract tess 
)
int compute_xheight_from_modes ( STATS heights,
STATS floating_heights,
int  min_height,
int  max_height,
float *  xheight,
float *  ascrise 
)
void correct_row_xheight ( TO_ROW row,
float  xheight,
float  ascrise,
float  descdrop 
)
void delete_non_dropout_rows ( TO_BLOCK block,
float  gradient,
FCOORD  rotation,
inT32  block_edge,
BOOL8  testing_on 
)
TBOX deskew_block_coords ( TO_BLOCK block,
float  gradient 
)
void expand_rows ( ICOORD  page_tr,
TO_BLOCK block,
float  gradient,
FCOORD  rotation,
inT32  block_edge,
BOOL8  testing_on 
)
void fill_heights ( TO_ROW row,
float  gradient,
int  min_height,
int  max_height,
STATS heights,
STATS floating_heights 
)
BOOL8 find_best_dropout_row ( TO_ROW row,
inT32  distance,
float  dist_limit,
inT32  line_index,
TO_ROW_IT *  row_it,
BOOL8  testing_on 
)
void fit_lms_line ( TO_ROW row  ) 
void fit_parallel_lms ( float  gradient,
TO_ROW row 
)
void fit_parallel_rows ( TO_BLOCK block,
float  gradient,
FCOORD  rotation,
inT32  block_edge,
BOOL8  testing_on 
)
double* linear_spline_baseline ( TO_ROW row,
TO_BLOCK block,
inT32 segments,
inT32  xstarts[] 
)
void make_baseline_spline ( TO_ROW row,
TO_BLOCK block 
)
void make_initial_textrows ( ICOORD  page_tr,
TO_BLOCK block,
FCOORD  rotation,
BOOL8  testing_on 
)
float make_rows ( ICOORD  page_tr,
BLOCK_LIST *  blocks,
TO_BLOCK_LIST *  land_blocks,
TO_BLOCK_LIST *  port_blocks,
tesseract::Tesseract tess 
)
float make_single_row ( ICOORD  page_tr,
TO_BLOCK block,
TO_BLOCK_LIST *  blocks,
tesseract::Tesseract tess 
)
void make_spline_rows ( TO_BLOCK block,
float  gradient,
FCOORD  rotation,
inT32  block_edge,
BOOL8  testing_on,
tesseract::Tesseract tess 
)
void mark_repeated_chars ( TO_ROW row,
float  block_xheight,
tesseract::Tesseract tess 
)
OVERLAP_STATE most_overlapping_row ( TO_ROW_IT *  row_it,
TO_ROW *&  best_row,
float  top,
float  bottom,
float  rowsize,
BOOL8  testing_blob 
)
void pre_associate_blobs ( ICOORD  page_tr,
TO_BLOCK block,
FCOORD  rotation,
BOOL8  testing_on 
)
int row_spacing_order ( const void *  item1,
const void *  item2 
)
int row_y_order ( const void *  item1,
const void *  item2 
)
BOOL8 segment_baseline ( TO_ROW row,
TO_BLOCK block,
inT32 segments,
inT32  xstarts[] 
)
void separate_underlines ( TO_BLOCK block,
float  gradient,
FCOORD  rotation,
BOOL8  testing_on 
)

Variable Documentation

const int kMinSize = 8
const double kNoiseSize = 0.5

"Min pile height to make ascheight"

double textord_ascx_ratio_max = 1.8

"Max cap/xheight"

double textord_ascx_ratio_min = 1.3

"Min cap/xheight"

"Bias skew estimates with line length"

"Use new projection for underlines"

double textord_chop_width = 1.5

"Max width before chopping"

"Test xheight algorithms"

"Min pile height to make descheight"

"Max desc/xheight"

double textord_descx_ratio_min = 0.25

"Min desc/xheight"

"New row made if blob makes row this big"

"Factor to expand rows by in expand_rows"

"Prevent multiple baselines"

"Use spline baseline"

"Vigorously remove noise"

"Interpolate across gaps"

"Max iqr/median for linespace"

"Max number of blobs a big blob can overlap"

double textord_merge_asc = 0.25

"Fraction of linespace for asc height"

double textord_merge_desc = 0.25

"Fraction of linespace for desc drop"

double textord_merge_x = 0.5

"Fraction of linespace for x height"

"Min blob height/top to include blob top into xheight stats"

"Min blobs before gradient counted"

double textord_min_linesize = 1.25

"* blob height for initial linesize"

"Min credible pixel xheight"

double textord_minxh = 0.25

"fraction of linesize for min xheight"

"Fraction of neighbourhood"

"Use old baseline algorithm"

"Use old xheight algorithm"

double textord_overlap_x = 0.5

"Fraction of linespace for good overlap"

"Force parallel baselines"

"Use quadratic splines"

"Display rows after expanding"

"Display blob bounds after pre-ass"

"Display rows after final fitting"

"Display row accumulation"

"Display page correlated rows"

double textord_skew_ile = 0.5

"Ile of gradients for page skew"

double textord_skew_lag = 0.01

"Lag for skew on row accumulation"

"For smooth factor"

"For smooth factor"

"Size of window for spline segmentation"

"Min blobs in each spline segment"

"Fraction of line spacing for outlier"

"Fraction of line spacing for quad"

"Force straight baselines"

"Tests refer to land/port"

int textord_test_x = -1

"coord of test pt"

int textord_test_y = -1

"coord of test pt"

"Multiple of line_size for underline"

double textord_width_limit = 8

"Max width of blobs to make rows"

"Accepted variation"

"Min pile height to make xheight"

Generated on Sun Jul 18 17:10:51 2010 for Tesseract by  doxygen 1.6.3