#include "ccstruct.h"
#include "statistc.h"
#include "quadlsq.h"
#include "detlinefit.h"
#include "makerow.h"
#include "drawtord.h"
#include "oldbasel.h"
#include "textord.h"
#include "tprintf.h"
Go to the source code of this file.
Namespaces | |
tesseract | |
Macros | |
#define | EXTERN |
#define | TURNLIMIT 1 /*min size for turning point */ |
#define | X_HEIGHT_FRACTION 0.7 /*x-height/caps height */ |
#define | DESCENDER_FRACTION 0.5 /*descender/x-height */ |
#define | MIN_ASC_FRACTION 0.20 /*min size of ascenders */ |
#define | MIN_DESC_FRACTION 0.25 /*min size of descenders */ |
#define | MINASCRISE 2.0 /*min ascender/desc step */ |
#define | MAXHEIGHTVARIANCE 0.15 /*accepted variation in x-height */ |
#define | MAXHEIGHT 300 /*max blob height */ |
#define | MAXOVERLAP 0.1 /*max 10% missed overlap */ |
#define | MAXBADRUN 2 /*max non best for failed */ |
#define | HEIGHTBUCKETS 200 /* Num of buckets */ |
#define | DELTAHEIGHT 5.0 /* Small amount of diff */ |
#define | GOODHEIGHT 5 |
#define | MAXLOOPS 10 |
#define | MODENUM 10 |
#define | MAXPARTS 6 |
#define | SPLINESIZE 23 |
#define | ABS(x) ((x)<0 ? (-(x)) : (x)) |
Functions | |
int | get_blob_coords (TO_ROW *row, inT32 lineheight, TBOX *blobcoords, BOOL8 &holed_line, int &outcount) |
void | make_first_baseline (TBOX blobcoords[], int blobcount, int xcoords[], int ycoords[], QSPLINE *spline, QSPLINE *baseline, float jumplimit) |
void | make_holed_baseline (TBOX blobcoords[], int blobcount, QSPLINE *spline, QSPLINE *baseline, float gradient) |
int | partition_line (TBOX blobcoords[], int blobcount, int *numparts, char partids[], int partsizes[], QSPLINE *spline, float jumplimit, float ydiffs[]) |
void | merge_oldbl_parts (TBOX blobcoords[], int blobcount, char partids[], int partsizes[], int biggestpart, float jumplimit) |
int | get_ydiffs (TBOX blobcoords[], int blobcount, QSPLINE *spline, float ydiffs[]) |
int | choose_partition (register float diff, float partdiffs[], int lastpart, float jumplimit, float *drift, float *lastdelta, int *partcount) |
int | partition_coords (TBOX blobcoords[], int blobcount, char partids[], int bestpart, int xcoords[], int ycoords[]) |
*merge_partitions(partids,partcount,blobcount,bestpart) discards funny looking More... | |
int | segment_spline (TBOX blobcoords[], int blobcount, int xcoords[], int ycoords[], int degree, int pointcount, int xstarts[]) |
BOOL8 | split_stepped_spline (QSPLINE *baseline, float jumplimit, int xcoords[], int xstarts[], int &segments) |
void | insert_spline_point (int xstarts[], int segment, int coord1, int coord2, int &segments) |
void | find_lesser_parts (TO_ROW *row, TBOX blobcoords[], int blobcount, char partids[], int partsizes[], int partcount, int bestpart) |
void | old_first_xheight (TO_ROW *row, TBOX blobcoords[], int initialheight, int blobcount, QSPLINE *baseline, float jumplimit) |
void | make_first_xheight (TO_ROW *row, TBOX blobcoords[], int lineheight, int init_lineheight, int blobcount, QSPLINE *baseline, float jumplimit) |
void | find_top_modes (STATS *stats, int statnum, int modelist[], int modenum) |
void | pick_x_height (TO_ROW *row, int modelist[], int lefts[], int rights[], STATS *heightstat, int mode_threshold) |
Variables | |
EXTERN bool | textord_really_old_xheight = FALSE |
EXTERN bool | textord_oldbl_debug = FALSE |
EXTERN bool | textord_debug_baselines = FALSE |
EXTERN bool | textord_oldbl_paradef = TRUE |
EXTERN bool | textord_oldbl_split_splines = TRUE |
EXTERN bool | textord_oldbl_merge_parts = TRUE |
EXTERN bool | oldbl_corrfix = TRUE |
EXTERN bool | oldbl_xhfix = FALSE |
EXTERN bool | textord_ocropus_mode = FALSE |
EXTERN double | oldbl_xhfract = 0.4 |
EXTERN int | oldbl_holed_losscount = 10 |
EXTERN double | oldbl_dot_error_size = 1.26 |
EXTERN double | textord_oldbl_jumplimit = 0.15 |
const int | kMinModeFactorOcropus = 32 |
const int | kMinModeFactor = 12 |
#define ABS | ( | x | ) | ((x)<0 ? (-(x)) : (x)) |
Definition at line 73 of file oldbasel.cpp.
#define DELTAHEIGHT 5.0 /* Small amount of diff */ |
Definition at line 66 of file oldbasel.cpp.
#define DESCENDER_FRACTION 0.5 /*descender/x-height */ |
Definition at line 57 of file oldbasel.cpp.
#define EXTERN |
Definition at line 35 of file oldbasel.cpp.
#define GOODHEIGHT 5 |
Definition at line 67 of file oldbasel.cpp.
#define HEIGHTBUCKETS 200 /* Num of buckets */ |
Definition at line 65 of file oldbasel.cpp.
#define MAXBADRUN 2 /*max non best for failed */ |
Definition at line 64 of file oldbasel.cpp.
#define MAXHEIGHT 300 /*max blob height */ |
Definition at line 62 of file oldbasel.cpp.
#define MAXHEIGHTVARIANCE 0.15 /*accepted variation in x-height */ |
Definition at line 61 of file oldbasel.cpp.
#define MAXLOOPS 10 |
Definition at line 68 of file oldbasel.cpp.
#define MAXOVERLAP 0.1 /*max 10% missed overlap */ |
Definition at line 63 of file oldbasel.cpp.
#define MAXPARTS 6 |
Definition at line 70 of file oldbasel.cpp.
#define MIN_ASC_FRACTION 0.20 /*min size of ascenders */ |
Definition at line 58 of file oldbasel.cpp.
#define MIN_DESC_FRACTION 0.25 /*min size of descenders */ |
Definition at line 59 of file oldbasel.cpp.
#define MINASCRISE 2.0 /*min ascender/desc step */ |
Definition at line 60 of file oldbasel.cpp.
#define MODENUM 10 |
Definition at line 69 of file oldbasel.cpp.
#define SPLINESIZE 23 |
Definition at line 71 of file oldbasel.cpp.
#define TURNLIMIT 1 /*min size for turning point */ |
Definition at line 55 of file oldbasel.cpp.
#define X_HEIGHT_FRACTION 0.7 /*x-height/caps height */ |
Definition at line 56 of file oldbasel.cpp.
int choose_partition | ( | register float | diff, |
float | partdiffs[], | ||
int | lastpart, | ||
float | jumplimit, | ||
float * | drift, | ||
float * | lastdelta, | ||
int * | partcount | ||
) |
Definition at line 957 of file oldbasel.cpp.
void find_lesser_parts | ( | TO_ROW * | row, |
TBOX | blobcoords[], | ||
int | blobcount, | ||
char | partids[], | ||
int | partsizes[], | ||
int | partcount, | ||
int | bestpart | ||
) |
Definition at line 1371 of file oldbasel.cpp.
void find_top_modes | ( | STATS * | stats, |
int | statnum, | ||
int | modelist[], | ||
int | modenum | ||
) |
Definition at line 1624 of file oldbasel.cpp.
int get_blob_coords | ( | TO_ROW * | row, |
inT32 | lineheight, | ||
TBOX * | blobcoords, | ||
BOOL8 & | holed_line, | ||
int & | outcount | ||
) |
Definition at line 441 of file oldbasel.cpp.
Definition at line 906 of file oldbasel.cpp.
void insert_spline_point | ( | int | xstarts[], |
int | segment, | ||
int | coord1, | ||
int | coord2, | ||
int & | segments | ||
) |
Definition at line 1347 of file oldbasel.cpp.
void make_first_baseline | ( | TBOX | blobcoords[], |
int | blobcount, | ||
int | xcoords[], | ||
int | ycoords[], | ||
QSPLINE * | spline, | ||
QSPLINE * | baseline, | ||
float | jumplimit | ||
) |
Definition at line 511 of file oldbasel.cpp.
void make_first_xheight | ( | TO_ROW * | row, |
TBOX | blobcoords[], | ||
int | lineheight, | ||
int | init_lineheight, | ||
int | blobcount, | ||
QSPLINE * | baseline, | ||
float | jumplimit | ||
) |
Definition at line 1539 of file oldbasel.cpp.
void make_holed_baseline | ( | TBOX | blobcoords[], |
int | blobcount, | ||
QSPLINE * | spline, | ||
QSPLINE * | baseline, | ||
float | gradient | ||
) |
Definition at line 654 of file oldbasel.cpp.
void merge_oldbl_parts | ( | TBOX | blobcoords[], |
int | blobcount, | ||
char | partids[], | ||
int | partsizes[], | ||
int | biggestpart, | ||
float | jumplimit | ||
) |
Definition at line 793 of file oldbasel.cpp.
void old_first_xheight | ( | TO_ROW * | row, |
TBOX | blobcoords[], | ||
int | initialheight, | ||
int | blobcount, | ||
QSPLINE * | baseline, | ||
float | jumplimit | ||
) |
Definition at line 1454 of file oldbasel.cpp.
int partition_coords | ( | TBOX | blobcoords[], |
int | blobcount, | ||
char | partids[], | ||
int | bestpart, | ||
int | xcoords[], | ||
int | ycoords[] | ||
) |
*merge_partitions(partids,partcount,blobcount,bestpart) discards funny looking
Definition at line 1084 of file oldbasel.cpp.
int partition_line | ( | TBOX | blobcoords[], |
int | blobcount, | ||
int * | numparts, | ||
char | partids[], | ||
int | partsizes[], | ||
QSPLINE * | spline, | ||
float | jumplimit, | ||
float | ydiffs[] | ||
) |
Definition at line 712 of file oldbasel.cpp.
void pick_x_height | ( | TO_ROW * | row, |
int | modelist[], | ||
int | lefts[], | ||
int | rights[], | ||
STATS * | heightstat, | ||
int | mode_threshold | ||
) |
Definition at line 1664 of file oldbasel.cpp.
int segment_spline | ( | TBOX | blobcoords[], |
int | blobcount, | ||
int | xcoords[], | ||
int | ycoords[], | ||
int | degree, | ||
int | pointcount, | ||
int | xstarts[] | ||
) |
Definition at line 1115 of file oldbasel.cpp.
BOOL8 split_stepped_spline | ( | QSPLINE * | baseline, |
float | jumplimit, | ||
int | xcoords[], | ||
int | xstarts[], | ||
int & | segments | ||
) |
Definition at line 1240 of file oldbasel.cpp.
const int kMinModeFactor = 12 |
Definition at line 1621 of file oldbasel.cpp.
const int kMinModeFactorOcropus = 32 |
Definition at line 1620 of file oldbasel.cpp.
"Improve correlation of heights"
Definition at line 44 of file oldbasel.cpp.
EXTERN double oldbl_dot_error_size = 1.26 |
"Max aspect ratio of a dot"
Definition at line 51 of file oldbasel.cpp.
EXTERN int oldbl_holed_losscount = 10 |
"Max lost before fallback line used"
Definition at line 50 of file oldbasel.cpp.
"Fix bug in modes threshold for xheights"
Definition at line 46 of file oldbasel.cpp.
EXTERN double oldbl_xhfract = 0.4 |
"Fraction of est allowed in calc"
Definition at line 48 of file oldbasel.cpp.
"Debug baseline generation"
Definition at line 40 of file oldbasel.cpp.
"Make baselines for ocropus"
Definition at line 47 of file oldbasel.cpp.
"Debug old baseline generation"
Definition at line 39 of file oldbasel.cpp.
EXTERN double textord_oldbl_jumplimit = 0.15 |
"X fraction for new partition"
Definition at line 53 of file oldbasel.cpp.
"Merge suspect partitions"
Definition at line 43 of file oldbasel.cpp.
"Use para default mechanism"
Definition at line 41 of file oldbasel.cpp.
"Split stepped splines"
Definition at line 42 of file oldbasel.cpp.
"Use original wiseowl xheight"
Definition at line 38 of file oldbasel.cpp.