Tesseract 3.01
/data/source/tesseract-ocr/textord/makerow.h File Reference
#include "params.h"
#include "ocrblock.h"
#include "blobs.h"
#include "blobbox.h"
#include "statistc.h"
#include "notdll.h"

Go to the source code of this file.

Enumerations

enum  OVERLAP_STATE { ASSIGN, REJECT, NEW_ROW }
enum  ROW_CATEGORY { ROW_ASCENDERS_FOUND, ROW_DESCENDERS_FOUND, ROW_UNKNOWN, ROW_INVALID }

Functions

void get_min_max_xheight (int block_linesize, int *min_height, int *max_height)
ROW_CATEGORY get_row_category (const TO_ROW *row)
bool within_error_margin (float test, float num, float margin)
void fill_heights (TO_ROW *row, float gradient, int min_height, int max_height, STATS *heights, STATS *floating_heights)
float make_single_row (ICOORD page_tr, TO_BLOCK *block, TO_BLOCK_LIST *blocks)
float make_rows (ICOORD page_tr, TO_BLOCK_LIST *port_blocks)
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_making (ICOORD page_tr, TO_BLOCK *block, float gradient, FCOORD rotation, inT32 block_edge, BOOL8 testing_on)
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)
float median_block_xheight (TO_BLOCK *block, float gradient)
int compute_xheight_from_modes (STATS *heights, STATS *floating_heights, bool cap_only, int min_height, int max_height, float *xheight, float *ascrise)
inT32 compute_row_descdrop (TO_ROW *row, float gradient, int xheight_blob_count, STATS *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_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)

Variables

bool textord_show_initial_rows = 0
bool textord_show_parallel_rows = 0
bool textord_show_expanded_rows = 0
bool textord_show_final_rows = 0
bool textord_show_final_blobs = 0
bool textord_test_landscape = 0
bool textord_parallel_baselines = 1
bool textord_straight_baselines = 0
bool textord_quadratic_baselines = 0
bool textord_old_baselines = 1
bool textord_old_xheight = 1
bool textord_fix_xheight_bug = 1
bool textord_fix_makerow_bug = 1
bool textord_cblob_blockocc = 1
bool textord_debug_xheights = 0
int textord_test_x = 0
int textord_test_y = 0
int textord_min_blobs_in_row = 4
int textord_spline_minblobs = 8
int textord_spline_medianwin = 6
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.75
double textord_linespace_iqrlimit = 0.2
double textord_width_limit = 8
double textord_chop_width = 1.5
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.15
double textord_ascx_ratio_min = 1.2
double textord_ascx_ratio_max = 1.7
double textord_descx_ratio_min = 0.15
double textord_descx_ratio_max = 0.6
double textord_xheight_error_margin = 0.1
int textord_lms_line_trials = 12
bool textord_new_initial_xheight = 1

Enumeration Type Documentation

Enumerator:
ASSIGN 
REJECT 
NEW_ROW 
Enumerator:
ROW_ASCENDERS_FOUND 
ROW_DESCENDERS_FOUND 
ROW_UNKNOWN 
ROW_INVALID 

Function Documentation

void adjust_row_limits ( TO_BLOCK block)

adjust_row_limits

Change the limits of rows to suit the default fractions.

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_making ( ICOORD  page_tr,
TO_BLOCK block,
float  gradient,
FCOORD  rotation,
inT32  block_edge,
BOOL8  testing_on 
)

cleanup_rows_making

Remove overlapping rows and fit all the blobs to what's left.

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 
)

compute_occupation_threshold

Compute thresholds for textline or not for the occupation array.

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 heights 
)
void compute_row_stats ( TO_BLOCK block,
BOOL8  testing_on 
)
int compute_xheight_from_modes ( STATS heights,
STATS floating_heights,
bool  cap_only,
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 
)

delete_non_dropout_rows

Compute the linespacing and offset.

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 
)
void get_min_max_xheight ( int  block_linesize,
int *  min_height,
int *  max_height 
) [inline]
ROW_CATEGORY get_row_category ( const TO_ROW row) [inline]
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,
TO_BLOCK_LIST *  port_blocks 
)
float make_single_row ( ICOORD  page_tr,
TO_BLOCK block,
TO_BLOCK_LIST *  blocks 
)
void mark_repeated_chars ( TO_ROW row)
float median_block_xheight ( TO_BLOCK block,
float  gradient 
)
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 
)
bool within_error_margin ( float  test,
float  num,
float  margin 
) [inline]

Variable Documentation

"Min pile height to make ascheight"

double textord_ascx_ratio_max = 1.7

"Max cap/xheight"

double textord_ascx_ratio_min = 1.2

"Min cap/xheight"

"Use new projection for underlines"

double textord_chop_width = 1.5

"Max width before chopping"

"Test xheight algorithms"

"Max desc/xheight"

double textord_descx_ratio_min = 0.15

"Min desc/xheight"

"New row made if blob makes row this big"

"Prevent multiple baselines"

"Use spline baseline"

"Max iqr/median for linespace"

"Number of linew fits to do"

"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"

"Use test xheight mechanism"

"Fraction of neighbourhood"

"Use old baseline algorithm"

"Use old xheight algorithm"

"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.75

"Lag for skew on row accumulation"

"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 = 0

"coord of test pt"

int textord_test_y = 0

"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"

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines