00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef FIXXHT_H
00021 #define FIXXHT_H
00022
00023 #include "varable.h"
00024 #include "statistc.h"
00025 #include "pageres.h"
00026 #include "notdll.h"
00027
00028 extern double_VAR_H (x_ht_fraction_of_caps_ht, 0.7,
00029 "Fract of cps ht est of xht");
00030 extern double_VAR_H (x_ht_variation, 0.35,
00031 "Err band as fract of caps/xht dist");
00032 extern double_VAR_H (x_ht_sub_variation, 0.5,
00033 "Err band as fract of caps/xht dist");
00034 extern BOOL_VAR_H (rej_trial_ambigs, TRUE,
00035 "reject x-ht ambigs when under trial");
00036 extern BOOL_VAR_H (x_ht_conservative_ambigs, FALSE,
00037 "Dont rely on ambigs + maxht");
00038 extern BOOL_VAR_H (x_ht_check_est, TRUE, "Cross check estimates");
00039 extern BOOL_VAR_H (x_ht_case_flip, FALSE, "Flip or reject suspect case");
00040 extern BOOL_VAR_H (x_ht_include_dodgy_blobs, TRUE,
00041 "Include blobs with possible noise?");
00042 extern BOOL_VAR_H (x_ht_limit_flip_trials, TRUE,
00043 "Dont do trial flips when ambigs are close to xht?");
00044 extern BOOL_VAR_H (rej_use_check_block_occ, TRUE,
00045 "Analyse rejection behaviour");
00046 extern STRING_VAR_H (chs_non_ambig_caps_ht,
00047 "!#$%&()/12346789?ABDEFGHIKLNQRT[]\\bdfhkl",
00048 "Reliable ascenders");
00049 extern STRING_VAR_H (chs_x_ht, "acegmnopqrsuvwxyz", "X height chars");
00050 extern STRING_VAR_H (chs_non_ambig_x_ht, "aenqr", "reliable X height chars");
00051 extern STRING_VAR_H (chs_ambig_caps_x, "cCmMoO05sSuUvVwWxXzZ",
00052 "X ht or caps ht chars");
00053 extern STRING_VAR_H (chs_bl_ambig_caps_x, "pPyY",
00054 " Caps or descender ambigs");
00055 extern STRING_VAR_H (chs_caps_ht,
00056 "!#$%&()/0123456789?ABCDEFGHIJKLMNOPQRSTUVWXYZ[]\\bdfhkl{|}",
00057 "Ascender chars");
00058 extern STRING_VAR_H (chs_desc, "gjpqy", "Descender chars");
00059 extern STRING_VAR_H (chs_non_ambig_bl,
00060 "!#$%&01246789?ABCDEFGHIKLMNORSTUVWXYZabcdehiklmnorstuvwxz",
00061 "Reliable baseline chars");
00062 extern STRING_VAR_H (chs_odd_top, "ijt", "Chars with funny ascender region");
00063 extern STRING_VAR_H (chs_odd_bot, "()35JQ[]\\/{}|", "Chars with funny base");
00064 extern STRING_VAR_H (chs_bl,
00065 "!#$%&()/01246789?ABCDEFGHIJKLMNOPRSTUVWXYZ[]\\abcdefhiklmnorstuvwxz{}",
00066 "Baseline chars");
00067 extern STRING_VAR_H (chs_non_ambig_desc, "gq", "Reliable descender chars");
00068 void re_estimate_x_ht(
00069 WERD_RES *word_res,
00070 float *trial_x_ht
00071 );
00072 void check_blob_occ(char *proposed_char,
00073 inT16 blob_ht_above_baseline,
00074 float x_ht,
00075 float caps_ht,
00076 char *confirmed_char);
00077 float estimate_from_stats(STATS &stats);
00078 void improve_estimate(WERD_RES *word_res,
00079 float &est_x_ht,
00080 float &est_caps_ht,
00081 STATS &x_ht,
00082 STATS &caps_ht);
00083 void reject_ambigs(
00084 WERD_RES *word);
00085
00086 void est_ambigs(WERD_RES *word_res,
00087 STATS &stats,
00088 float *ambig_lc_x_est,
00089 float *ambig_uc_caps_est
00090 );
00091 BOOL8 dodgy_blob(PBLOB *blob);
00092 #endif