Tesseract
3.02
|
#include <wordrec.h>
Public Member Functions | |||||||
Wordrec () | |||||||
virtual | ~Wordrec () | ||||||
void | CopyCharChoices (const BLOB_CHOICE_LIST_VECTOR &from, BLOB_CHOICE_LIST_VECTOR *to) | ||||||
bool | ChoiceIsCorrect (const UNICHARSET &uni_set, const WERD_CHOICE *choice, const GenericVector< STRING > &truth_text) | ||||||
void | SaveAltChoices (const LIST &best_choices, WERD_RES *word) | ||||||
void | FillLattice (const MATRIX &ratings, const LIST &best_choices, const UNICHARSET &unicharset, BlamerBundle *blamer_bundle) | ||||||
void | CallFillLattice (const MATRIX &ratings, const LIST &best_choices, const UNICHARSET &unicharset, BlamerBundle *blamer_bundle) | ||||||
void | update_ratings (const BLOB_CHOICE_LIST_VECTOR &new_choices, const CHUNKS_RECORD *chunks_record, const SEARCH_STATE search_state) | ||||||
void | SegSearch (CHUNKS_RECORD *chunks_record, WERD_CHOICE *best_choice, BLOB_CHOICE_LIST_VECTOR *best_char_choices, WERD_CHOICE *raw_choice, STATE *output_best_state, BlamerBundle *blamer_bundle) | ||||||
SEAM * | attempt_blob_chop (TWERD *word, TBLOB *blob, inT32 blob_number, bool italic_blob, SEAMS seam_list) | ||||||
SEAM * | chop_numbered_blob (TWERD *word, inT32 blob_number, bool italic_blob, SEAMS seam_list) | ||||||
SEAM * | chop_overlapping_blob (const GenericVector< TBOX > &boxes, WERD_RES *word_res, inT32 *blob_number, bool italic_blob, SEAMS seam_list) | ||||||
void | junk_worst_seam (SEAM_QUEUE seams, SEAM *new_seam, float new_priority) | ||||||
void | choose_best_seam (SEAM_QUEUE seam_queue, SEAM_PILE *seam_pile, SPLIT *split, PRIORITY priority, SEAM **seam_result, TBLOB *blob) | ||||||
void | combine_seam (SEAM_QUEUE seam_queue, SEAM_PILE seam_pile, SEAM *seam) | ||||||
inT16 | constrained_split (SPLIT *split, TBLOB *blob) | ||||||
void | delete_seam_pile (SEAM_PILE seam_pile) | ||||||
SEAM * | pick_good_seam (TBLOB *blob) | ||||||
PRIORITY | seam_priority (SEAM *seam, inT16 xmin, inT16 xmax) | ||||||
void | try_point_pairs (EDGEPT *points[MAX_NUM_POINTS], inT16 num_points, SEAM_QUEUE seam_queue, SEAM_PILE *seam_pile, SEAM **seam, TBLOB *blob) | ||||||
void | try_vertical_splits (EDGEPT *points[MAX_NUM_POINTS], inT16 num_points, EDGEPT_CLIST *new_points, SEAM_QUEUE seam_queue, SEAM_PILE *seam_pile, SEAM **seam, TBLOB *blob) | ||||||
PRIORITY | full_split_priority (SPLIT *split, inT16 xmin, inT16 xmax) | ||||||
PRIORITY | grade_center_of_blob (register BOUNDS_RECT rect) | ||||||
PRIORITY | grade_overlap (register BOUNDS_RECT rect) | ||||||
PRIORITY | grade_split_length (register SPLIT *split) | ||||||
PRIORITY | grade_sharpness (register SPLIT *split) | ||||||
PRIORITY | grade_width_change (register BOUNDS_RECT rect) | ||||||
void | set_outline_bounds (register EDGEPT *point1, register EDGEPT *point2, BOUNDS_RECT rect) | ||||||
int | crosses_outline (EDGEPT *p0, EDGEPT *p1, EDGEPT *outline) | ||||||
int | is_crossed (TPOINT a0, TPOINT a1, TPOINT b0, TPOINT b1) | ||||||
int | is_same_edgept (EDGEPT *p1, EDGEPT *p2) | ||||||
bool | near_point (EDGEPT *point, EDGEPT *line_pt_0, EDGEPT *line_pt_1, EDGEPT **near_pt) | ||||||
void | reverse_outline (EDGEPT *outline) | ||||||
virtual BLOB_CHOICE_LIST * | classify_piece (TBLOB *pieces, const DENORM &denorm, SEAMS seams, inT16 start, inT16 end, BlamerBundle *blamer_bundle) | ||||||
void | merge_fragments (MATRIX *ratings, inT16 num_blobs) | ||||||
void | get_fragment_lists (inT16 current_frag, inT16 current_row, inT16 start, inT16 num_frag_parts, inT16 num_blobs, MATRIX *ratings, BLOB_CHOICE_LIST *choice_lists) | ||||||
void | merge_and_put_fragment_lists (inT16 row, inT16 column, inT16 num_frag_parts, BLOB_CHOICE_LIST *choice_lists, MATRIX *ratings) | ||||||
void | fill_filtered_fragment_list (BLOB_CHOICE_LIST *choices, int fragment_pos, int num_frag_parts, BLOB_CHOICE_LIST *filtered_choices) | ||||||
BLOB_CHOICE_LIST * | get_piece_rating (MATRIX *ratings, TBLOB *blobs, const DENORM &denorm, SEAMS seams, inT16 start, inT16 end, BlamerBundle *blamer_bundle) | ||||||
TBOX * | record_blob_bounds (TBLOB *blobs) | ||||||
MATRIX * | record_piece_ratings (TBLOB *blobs) | ||||||
WIDTH_RECORD * | state_char_widths (WIDTH_RECORD *chunk_widths, STATE *state, int num_joints) | ||||||
FLOAT32 | get_width_variance (WIDTH_RECORD *wrec, float norm_height) | ||||||
FLOAT32 | get_gap_variance (WIDTH_RECORD *wrec, float norm_height) | ||||||
FLOAT32 | prioritize_state (CHUNKS_RECORD *chunks_record, SEARCH_RECORD *the_search) | ||||||
FLOAT32 | width_priority (CHUNKS_RECORD *chunks_record, STATE *state, int num_joints) | ||||||
FLOAT32 | seamcut_priority (SEAMS seams, STATE *state, int num_joints) | ||||||
FLOAT32 | rating_priority (CHUNKS_RECORD *chunks_record, STATE *state, int num_joints) | ||||||
program_editup | |||||||
Initialize all the things in the program that need to be initialized. init_permute determines whether to initialize the permute functions and Dawg models. | |||||||
void | program_editup (const char *textbase, bool init_classifier, bool init_permute) | ||||||
cc_recog | |||||||
Recognize a word. | |||||||
BLOB_CHOICE_LIST_VECTOR * | cc_recog (WERD_RES *word) | ||||||
program_editdown | |||||||
This function holds any nessessary post processing for the Wise Owl program. | |||||||
void | program_editdown (inT32 elasped_time) | ||||||
set_pass1 | |||||||
Get ready to do some pass 1 stuff. | |||||||
void | set_pass1 () | ||||||
set_pass2 | |||||||
Get ready to do some pass 2 stuff. | |||||||
void | set_pass2 () | ||||||
end_recog | |||||||
Cleanup and exit the recog program. | |||||||
int | end_recog () | ||||||
call_matcher | |||||||
Called from Tess with a blob in tess form. The blob may need rotating to the correct orientation for classification. | |||||||
BLOB_CHOICE_LIST * | call_matcher (const DENORM *denorm, TBLOB *blob) | ||||||
dict_word() | |||||||
Test the dictionaries, returning NO_PERM (0) if not found, or one of the PermuterType values if found, according to the dictionary. | |||||||
int | dict_word (const WERD_CHOICE &word) | ||||||
classify_blob | |||||||
Classify the this blob if it is not already recorded in the match table. Attempt to recognize this blob as a character. The recognition rating for this blob will be stored as a part of the blob. This value will also be returned to the caller.
| |||||||
BLOB_CHOICE_LIST * | classify_blob (TBLOB *blob, const DENORM &denorm, const char *string, C_COL color, BlamerBundle *blamer_bundle) | ||||||
BLOB_CHOICE_LIST * | fake_classify_blob (UNICHAR_ID class_id, float rating, float certainty) | ||||||
update_blob_classifications | |||||||
For each blob in the given word update match_table with the corresponding BLOB_CHOICES_LIST from choices. | |||||||
void | update_blob_classifications (TWERD *word, const BLOB_CHOICE_LIST_VECTOR &choices) | ||||||
best_first_search | |||||||
Find the best segmentation by doing a best first search of the solution space. | |||||||
BLOB_CHOICE_LIST_VECTOR * | evaluate_chunks (CHUNKS_RECORD *chunks_record, SEARCH_STATE search_state, BlamerBundle *blamer_bundle) | ||||||
void | best_first_search (CHUNKS_RECORD *chunks_record, BLOB_CHOICE_LIST_VECTOR *best_char_choices, WERD_RES *word, STATE *state, DANGERR *fixpt, STATE *best_state) | ||||||
void | delete_search (SEARCH_RECORD *the_search) | ||||||
evaluate_state | |||||||
Evaluate the segmentation that is represented by this state in the best first search. Add this state to the "states_seen" list. | |||||||
inT16 | evaluate_state (CHUNKS_RECORD *chunks_record, SEARCH_RECORD *the_search, DANGERR *fixpt, BlamerBundle *blamer_bundle) | ||||||
BLOB_CHOICE_LIST_VECTOR * | rebuild_current_state (WERD_RES *word, STATE *state, BLOB_CHOICE_LIST_VECTOR *char_choices, MATRIX *ratings) | ||||||
new_search | |||||||
Create and initialize a new search record. | |||||||
SEARCH_RECORD * | new_search (CHUNKS_RECORD *chunks_record, int num_joints, BLOB_CHOICE_LIST_VECTOR *best_char_choices, WERD_CHOICE *best_choice, WERD_CHOICE *raw_choice, STATE *state) | ||||||
expand_node | |||||||
Create the states that are attached to this one. Check to see that each one has not already been visited. If not add it to the priority queue. | |||||||
void | expand_node (FLOAT32 worst_priority, CHUNKS_RECORD *chunks_record, SEARCH_RECORD *the_search) | ||||||
replace_char_widths | |||||||
Replace the value of the char_width field in the chunks_record with the updated width measurements from the last_segmentation. | |||||||
void | replace_char_widths (CHUNKS_RECORD *chunks_record, SEARCH_STATE state) | ||||||
BLOB_CHOICE * | rebuild_fragments (const char *unichar, const char *expanded_fragment_lengths, int choice_index, BLOB_CHOICE_LIST_VECTOR *old_choices) | ||||||
BLOB_CHOICE_LIST * | join_blobs_and_classify (WERD_RES *word, int x, int y, int choice_index, MATRIX *ratings, BLOB_CHOICE_LIST_VECTOR *old_choices) | ||||||
pop_queue | |||||||
Get this state from the priority queue. It should be the state that has the greatest urgency to be evaluated. | |||||||
STATE * | pop_queue (HEAP *queue) | ||||||
push_queue | |||||||
Add this state into the priority queue. | |||||||
void | push_queue (HEAP *queue, STATE *state, FLOAT32 worst_priority, FLOAT32 priority, bool debug) | ||||||
point_priority | |||||||
Assign a priority to and edge point that might be used as part of a split. The argument should be of type EDGEPT. | |||||||
PRIORITY | point_priority (EDGEPT *point) | ||||||
add_point_to_list | |||||||
Add an edge point to a POINT_GROUP containg a list of other points. | |||||||
void | add_point_to_list (POINT_GROUP point_list, EDGEPT *point) | ||||||
angle_change | |||||||
Return the change in angle (degrees) of the line segments between points one and two, and two and three. | |||||||
int | angle_change (EDGEPT *point1, EDGEPT *point2, EDGEPT *point3) | ||||||
is_little_chunk | |||||||
Return TRUE if one of the pieces resulting from this split would less than some number of edge points. | |||||||
int | is_little_chunk (EDGEPT *point1, EDGEPT *point2) | ||||||
is_small_area | |||||||
Test the area defined by a split accross this outline. | |||||||
int | is_small_area (EDGEPT *point1, EDGEPT *point2) | ||||||
pick_close_point | |||||||
Choose the edge point that is closest to the critical point. This point may not be exactly vertical from the critical point. | |||||||
EDGEPT * | pick_close_point (EDGEPT *critical_point, EDGEPT *vertical_point, int *best_dist) | ||||||
prioritize_points | |||||||
Find a list of edge points from the outer outline of this blob. For each of these points assign a priority. Sort these points using a heap structure so that they can be visited in order. | |||||||
void | prioritize_points (TESSLINE *outline, POINT_GROUP points) | ||||||
new_min_point | |||||||
Found a new minimum point try to decide whether to save it or not. Return the new value for the local minimum. If a point is saved then the local minimum is reset to NULL. | |||||||
void | new_min_point (EDGEPT *local_min, POINT_GROUP points) | ||||||
new_max_point | |||||||
Found a new minimum point try to decide whether to save it or not. Return the new value for the local minimum. If a point is saved then the local minimum is reset to NULL. | |||||||
void | new_max_point (EDGEPT *local_max, POINT_GROUP points) | ||||||
vertical_projection_point | |||||||
For one point on the outline, find the corresponding point on the other side of the outline that is a likely projection for a split point. This is done by iterating through the edge points until the X value of the point being looked at is greater than the X value of the split point. Ensure that the point being returned is not right next to the split point. Return the edge point in *best_point as a result, and any points that were newly created are also saved on the new_points list. | |||||||
void | vertical_projection_point (EDGEPT *split_point, EDGEPT *target_point, EDGEPT **best_point, EDGEPT_CLIST *new_points) | ||||||
improve_one_blob | |||||||
Start with the current word of blobs and its classification. Find the worst blobs and try to divide it up to improve the ratings. | |||||||
bool | improve_one_blob (WERD_RES *word_res, BLOB_CHOICE_LIST_VECTOR *char_choices, inT32 *blob_number, SEAMS *seam_list, DANGERR *fixpt, bool split_next_to_fragment, BlamerBundle *blamer_bundle) | ||||||
modify_blob_choice | |||||||
Takes a blob and its chop index, converts that chop index to a unichar_id, and stores the chop index in place of the blob's original unichar_id. | |||||||
void | modify_blob_choice (BLOB_CHOICE_LIST *answer, int chop_index) | ||||||
chop_one_blob | |||||||
Start with the current one-blob word and its classification. Find the worst blobs and try to divide it up to improve the ratings. Used for testing chopper. | |||||||
bool | chop_one_blob (TWERD *word, BLOB_CHOICE_LIST_VECTOR *char_choices, inT32 *blob_number, SEAMS *seam_list, int *right_chop_index) | ||||||
bool | chop_one_blob2 (const GenericVector< TBOX > &boxes, WERD_RES *word_res, SEAMS *seam_list) | ||||||
chop_word_main | |||||||
Classify the blobs in this word and permute the results. Find the worst blob in the word and chop it up. Continue this process until a good answer has been found or all the blobs have been chopped up enough. Return the word level ratings. | |||||||
BLOB_CHOICE_LIST_VECTOR * | chop_word_main (WERD_RES *word) | ||||||
improve_by_chopping | |||||||
Start with the current word of blobs and its classification. Find the worst blobs and try to divide them up to improve the ratings. As long as ratings are produced by the new blob splitting. When all the splitting has been accomplished all the ratings memory is reclaimed. | |||||||
void | improve_by_chopping (WERD_RES *word, BLOB_CHOICE_LIST_VECTOR *char_choices, STATE *best_state, BLOB_CHOICE_LIST_VECTOR *best_char_choices, DANGERR *fixpt, bool *updated_best_choice) | ||||||
MATRIX * | word_associator (bool only_create_ratings_matrtix, WERD_RES *word, STATE *state, BLOB_CHOICE_LIST_VECTOR *best_char_choices, DANGERR *fixpt, STATE *best_state) | ||||||
inT16 | select_blob_to_split (const BLOB_CHOICE_LIST_VECTOR &char_choices, float rating_ceiling, bool split_next_to_fragment) | ||||||
inT16 | select_blob_to_split_from_fixpt (DANGERR *fixpt) | ||||||
void | set_chopper_blame (WERD_RES *word) | ||||||
![]() | |||||||
Classify () | |||||||
virtual | ~Classify () | ||||||
Dict & | getDict () | ||||||
const ShapeTable * | shape_table () const | ||||||
ADAPT_TEMPLATES | NewAdaptedTemplates (bool InitFromUnicharset) | ||||||
int | GetFontinfoId (ADAPT_CLASS Class, uinT8 ConfigId) | ||||||
int | PruneClasses (const INT_TEMPLATES_STRUCT *int_templates, int num_features, const INT_FEATURE_STRUCT *features, const uinT8 *normalization_factors, const uinT16 *expected_num_features, CP_RESULT_STRUCT *results) | ||||||
void | ReadNewCutoffs (FILE *CutoffFile, bool swap, inT64 end_offset, CLASS_CUTOFF_ARRAY Cutoffs) | ||||||
void | PrintAdaptedTemplates (FILE *File, ADAPT_TEMPLATES Templates) | ||||||
void | WriteAdaptedTemplates (FILE *File, ADAPT_TEMPLATES Templates) | ||||||
ADAPT_TEMPLATES | ReadAdaptedTemplates (FILE *File) | ||||||
FLOAT32 | ComputeNormMatch (CLASS_ID ClassId, const FEATURE_STRUCT &feature, BOOL8 DebugMatch) | ||||||
void | FreeNormProtos () | ||||||
NORM_PROTOS * | ReadNormProtos (FILE *File, inT64 end_offset) | ||||||
void | ConvertProto (PROTO Proto, int ProtoId, INT_CLASS Class) | ||||||
INT_TEMPLATES | CreateIntTemplates (CLASSES FloatProtos, const UNICHARSET &target_unicharset) | ||||||
void | LearnWord (const char *filename, const char *rejmap, WERD_RES *word) | ||||||
void | LearnPieces (const char *filename, int start, int length, float threshold, CharSegmentationType segmentation, const char *correct_text, WERD_RES *word) | ||||||
void | InitAdaptiveClassifier (bool load_pre_trained_templates) | ||||||
void | InitAdaptedClass (TBLOB *Blob, const DENORM &denorm, CLASS_ID ClassId, int FontinfoId, ADAPT_CLASS Class, ADAPT_TEMPLATES Templates) | ||||||
void | AdaptToPunc (TBLOB *Blob, const DENORM &denorm, CLASS_ID ClassId, int FontinfoId, FLOAT32 Threshold) | ||||||
void | AmbigClassifier (TBLOB *Blob, const DENORM &denorm, INT_TEMPLATES Templates, ADAPT_CLASS *Classes, UNICHAR_ID *Ambiguities, ADAPT_RESULTS *Results) | ||||||
void | MasterMatcher (INT_TEMPLATES templates, inT16 num_features, const INT_FEATURE_STRUCT *features, const uinT8 *norm_factors, ADAPT_CLASS *classes, int debug, int num_classes, const TBOX &blob_box, CLASS_PRUNER_RESULTS results, ADAPT_RESULTS *final_results) | ||||||
void | ExpandShapesAndApplyCorrections (ADAPT_CLASS *classes, bool debug, int class_id, int bottom, int top, float cp_rating, int blob_length, const uinT8 *cn_factors, INT_RESULT_STRUCT &int_result, ADAPT_RESULTS *final_results) | ||||||
double | ComputeCorrectedRating (bool debug, int unichar_id, double cp_rating, double im_rating, int feature_misses, int bottom, int top, int blob_length, const uinT8 *cn_factors) | ||||||
void | ConvertMatchesToChoices (const DENORM &denorm, const TBOX &box, ADAPT_RESULTS *Results, BLOB_CHOICE_LIST *Choices) | ||||||
void | AddNewResult (ADAPT_RESULTS *results, CLASS_ID class_id, int shape_id, FLOAT32 rating, bool adapted, int config, int fontinfo_id, int fontinfo_id2) | ||||||
int | GetAdaptiveFeatures (TBLOB *Blob, INT_FEATURE_ARRAY IntFeatures, FEATURE_SET *FloatFeatures) | ||||||
void | DebugAdaptiveClassifier (TBLOB *Blob, const DENORM &denorm, ADAPT_RESULTS *Results) | ||||||
void | GetAdaptThresholds (TWERD *Word, const DENORM &denorm, const WERD_CHOICE &BestChoice, const WERD_CHOICE &BestRawChoice, FLOAT32 Thresholds[]) | ||||||
PROTO_ID | MakeNewTempProtos (FEATURE_SET Features, int NumBadFeat, FEATURE_ID BadFeat[], INT_CLASS IClass, ADAPT_CLASS Class, BIT_VECTOR TempProtoMask) | ||||||
int | MakeNewTemporaryConfig (ADAPT_TEMPLATES Templates, CLASS_ID ClassId, int FontinfoId, int NumFeatures, INT_FEATURE_ARRAY Features, FEATURE_SET FloatFeatures) | ||||||
void | MakePermanent (ADAPT_TEMPLATES Templates, CLASS_ID ClassId, int ConfigId, const DENORM &denorm, TBLOB *Blob) | ||||||
void | PrintAdaptiveMatchResults (FILE *File, ADAPT_RESULTS *Results) | ||||||
void | RemoveExtraPuncs (ADAPT_RESULTS *Results) | ||||||
void | RemoveBadMatches (ADAPT_RESULTS *Results) | ||||||
void | SetAdaptiveThreshold (FLOAT32 Threshold) | ||||||
void | ShowBestMatchFor (TBLOB *Blob, const DENORM &denorm, CLASS_ID ClassId, int shape_id, BOOL8 AdaptiveOn, BOOL8 PreTrainedOn, ADAPT_RESULTS *Results) | ||||||
STRING | ClassIDToDebugStr (const INT_TEMPLATES_STRUCT *templates, int class_id, int config_id) const | ||||||
int | ClassAndConfigIDToFontOrShapeID (int class_id, int int_result_config) const | ||||||
int | ShapeIDToClassID (int shape_id) const | ||||||
UNICHAR_ID * | BaselineClassifier (TBLOB *Blob, const DENORM &denorm, ADAPT_TEMPLATES Templates, ADAPT_RESULTS *Results) | ||||||
int | CharNormClassifier (TBLOB *Blob, const DENORM &denorm, INT_TEMPLATES Templates, ADAPT_RESULTS *Results) | ||||||
int | CharNormTrainingSample (bool pruner_only, const TrainingSample &sample, GenericVector< ShapeRating > *results) | ||||||
UNICHAR_ID * | GetAmbiguities (TBLOB *Blob, const DENORM &denorm, CLASS_ID CorrectClass) | ||||||
void | DoAdaptiveMatch (TBLOB *Blob, const DENORM &denorm, ADAPT_RESULTS *Results) | ||||||
void | AdaptToChar (TBLOB *Blob, const DENORM &denorm, CLASS_ID ClassId, int FontinfoId, FLOAT32 Threshold) | ||||||
void | DisplayAdaptedChar (TBLOB *blob, const DENORM &denorm, INT_CLASS_STRUCT *int_class) | ||||||
int | AdaptableWord (TWERD *Word, const WERD_CHOICE &BestChoiceWord, const WERD_CHOICE &RawChoiceWord) | ||||||
void | EndAdaptiveClassifier () | ||||||
void | PrintAdaptiveStatistics (FILE *File) | ||||||
void | SettupPass1 () | ||||||
void | SettupPass2 () | ||||||
void | AdaptiveClassifier (TBLOB *Blob, const DENORM &denorm, BLOB_CHOICE_LIST *Choices, CLASS_PRUNER_RESULTS cp_results) | ||||||
void | ClassifyAsNoise (ADAPT_RESULTS *Results) | ||||||
void | ResetAdaptiveClassifierInternal () | ||||||
int | GetBaselineFeatures (TBLOB *Blob, const DENORM &denorm, INT_TEMPLATES Templates, INT_FEATURE_ARRAY IntFeatures, uinT8 *CharNormArray, inT32 *BlobLength) | ||||||
int | GetCharNormFeatures (TBLOB *Blob, const DENORM &denorm, INT_TEMPLATES Templates, INT_FEATURE_ARRAY IntFeatures, uinT8 *PrunerNormArray, uinT8 *CharNormArray, inT32 *BlobLength, inT32 *FeatureOutlineIndex) | ||||||
void | ComputeCharNormArrays (FEATURE_STRUCT *norm_feature, INT_TEMPLATES_STRUCT *templates, uinT8 *char_norm_array, uinT8 *pruner_array) | ||||||
bool | TempConfigReliable (CLASS_ID class_id, const TEMP_CONFIG &config) | ||||||
void | UpdateAmbigsGroup (CLASS_ID class_id, const DENORM &denorm, TBLOB *Blob) | ||||||
void | ResetFeaturesHaveBeenExtracted () | ||||||
bool | AdaptiveClassifierIsFull () | ||||||
bool | LooksLikeGarbage (const DENORM &denorm, TBLOB *blob) | ||||||
void | RefreshDebugWindow (ScrollView **win, const char *msg, int y_offset, const TBOX &wbox) | ||||||
void | ClearCharNormArray (uinT8 *char_norm_array) | ||||||
void | ComputeIntCharNormArray (const FEATURE_STRUCT &norm_feature, uinT8 *char_norm_array) | ||||||
void | ComputeIntFeatures (FEATURE_SET Features, INT_FEATURE_ARRAY IntFeatures) | ||||||
INT_TEMPLATES | ReadIntTemplates (FILE *File) | ||||||
void | WriteIntTemplates (FILE *File, INT_TEMPLATES Templates, const UNICHARSET &target_unicharset) | ||||||
CLASS_ID | GetClassToDebug (const char *Prompt, bool *adaptive_on, bool *pretrained_on, int *shape_id) | ||||||
void | ShowMatchDisplay () | ||||||
UnicityTable< FontInfo > & | get_fontinfo_table () | ||||||
UnicityTable< FontSet > & | get_fontset_table () | ||||||
void | NormalizeOutlines (LIST Outlines, FLOAT32 *XScale, FLOAT32 *YScale) | ||||||
FEATURE_SET | ExtractOutlineFeatures (TBLOB *Blob) | ||||||
FEATURE_SET | ExtractPicoFeatures (TBLOB *Blob) | ||||||
void | ReadClassFile () | ||||||
![]() | |||||||
CCStruct () | |||||||
~CCStruct () | |||||||
![]() | |||||||
CUtil () | |||||||
~CUtil () | |||||||
void | read_variables (const char *filename, bool global_only) | ||||||
![]() | |||||||
CCUtil () | |||||||
virtual | ~CCUtil () | ||||||
void | main_setup (const char *argv0, const char *basename) | ||||||
ParamsVectors * | params () |
Protected Member Functions | |
bool | SegSearchDone (int num_futile_classifications) |
void | UpdateSegSearchNodes (int starting_col, SEG_SEARCH_PENDING_LIST *pending[], BestPathByColumn *best_path_by_column[], CHUNKS_RECORD *chunks_record, HEAP *pain_points, BestChoiceBundle *best_choice_bundle, BlamerBundle *blamer_bundle) |
void | ProcessSegSearchPainPoint (float pain_point_priority, const MATRIX_COORD &pain_point, const WERD_CHOICE *best_choice, SEG_SEARCH_PENDING_LIST *pending[], CHUNKS_RECORD *chunks_record, HEAP *pain_points, BlamerBundle *blamer_bundle) |
void | InitBlamerForSegSearch (const WERD_CHOICE *best_choice, CHUNKS_RECORD *chunks_record, HEAP *pain_points, BlamerBundle *blamer_bundle, STRING *blamer_debug) |
void | FinishBlamerForSegSearch (const WERD_CHOICE *best_choice, BlamerBundle *blamer_bundle, STRING *blamer_debug) |
Additional Inherited Members | |
![]() | |
IntegerMatcher | im_ |
FEATURE_DEFS_STRUCT | feature_defs_ |
ShapeTable * | shape_table_ |
![]() | |
Image | image_ |
tesseract::Wordrec::Wordrec | ( | ) |
Definition at line 26 of file wordrec.cpp.
|
virtual |
Definition at line 144 of file wordrec.cpp.
void tesseract::Wordrec::add_point_to_list | ( | POINT_GROUP | point_list, |
EDGEPT * | point | ||
) |
Definition at line 65 of file chop.cpp.
Definition at line 87 of file chop.cpp.
SEAM * tesseract::Wordrec::attempt_blob_chop | ( | TWERD * | word, |
TBLOB * | blob, | ||
inT32 | blob_number, | ||
bool | italic_blob, | ||
SEAMS | seam_list | ||
) |
Definition at line 146 of file chopper.cpp.
void tesseract::Wordrec::best_first_search | ( | CHUNKS_RECORD * | chunks_record, |
BLOB_CHOICE_LIST_VECTOR * | best_char_choices, | ||
WERD_RES * | word, | ||
STATE * | state, | ||
DANGERR * | fixpt, | ||
STATE * | best_state | ||
) |
Definition at line 88 of file bestfirst.cpp.
Definition at line 143 of file tface.cpp.
|
inline |
BLOB_CHOICE_LIST_VECTOR * tesseract::Wordrec::cc_recog | ( | WERD_RES * | word | ) |
Definition at line 117 of file tface.cpp.
bool tesseract::Wordrec::ChoiceIsCorrect | ( | const UNICHARSET & | uni_set, |
const WERD_CHOICE * | choice, | ||
const GenericVector< STRING > & | truth_text | ||
) |
Definition at line 159 of file wordrec.cpp.
void tesseract::Wordrec::choose_best_seam | ( | SEAM_QUEUE | seam_queue, |
SEAM_PILE * | seam_pile, | ||
SPLIT * | split, | ||
PRIORITY | priority, | ||
SEAM ** | seam_result, | ||
TBLOB * | blob | ||
) |
Definition at line 178 of file findseam.cpp.
SEAM * tesseract::Wordrec::chop_numbered_blob | ( | TWERD * | word, |
inT32 | blob_number, | ||
bool | italic_blob, | ||
SEAMS | seam_list | ||
) |
Definition at line 219 of file chopper.cpp.
bool tesseract::Wordrec::chop_one_blob | ( | TWERD * | word, |
BLOB_CHOICE_LIST_VECTOR * | char_choices, | ||
inT32 * | blob_number, | ||
SEAMS * | seam_list, | ||
int * | right_chop_index | ||
) |
Definition at line 441 of file chopper.cpp.
bool tesseract::Wordrec::chop_one_blob2 | ( | const GenericVector< TBOX > & | boxes, |
WERD_RES * | word_res, | ||
SEAMS * | seam_list | ||
) |
Definition at line 502 of file chopper.cpp.
SEAM * tesseract::Wordrec::chop_overlapping_blob | ( | const GenericVector< TBOX > & | boxes, |
WERD_RES * | word_res, | ||
inT32 * | blob_number, | ||
bool | italic_blob, | ||
SEAMS | seam_list | ||
) |
Definition at line 233 of file chopper.cpp.
BLOB_CHOICE_LIST_VECTOR * tesseract::Wordrec::chop_word_main | ( | WERD_RES * | word | ) |
Definition at line 583 of file chopper.cpp.
BLOB_CHOICE_LIST * tesseract::Wordrec::classify_blob | ( | TBLOB * | blob, |
const DENORM & | denorm, | ||
const char * | string, | ||
C_COL | color, | ||
BlamerBundle * | blamer_bundle | ||
) |
Definition at line 62 of file wordclass.cpp.
|
virtual |
Definition at line 75 of file pieces.cpp.
void tesseract::Wordrec::combine_seam | ( | SEAM_QUEUE | seam_queue, |
SEAM_PILE | seam_pile, | ||
SEAM * | seam | ||
) |
tessedit_fix_sideways_chops ||
Definition at line 259 of file findseam.cpp.
Definition at line 343 of file findseam.cpp.
void tesseract::Wordrec::CopyCharChoices | ( | const BLOB_CHOICE_LIST_VECTOR & | from, |
BLOB_CHOICE_LIST_VECTOR * | to | ||
) |
Definition at line 148 of file wordrec.cpp.
void tesseract::Wordrec::delete_seam_pile | ( | SEAM_PILE | seam_pile | ) |
Definition at line 365 of file findseam.cpp.
void tesseract::Wordrec::delete_search | ( | SEARCH_RECORD * | the_search | ) |
delete_search
Terminate the current search and free all the memory involved.
Definition at line 179 of file bestfirst.cpp.
int tesseract::Wordrec::dict_word | ( | const WERD_CHOICE & | word | ) |
int tesseract::Wordrec::end_recog | ( | ) |
BLOB_CHOICE_LIST_VECTOR * tesseract::Wordrec::evaluate_chunks | ( | CHUNKS_RECORD * | chunks_record, |
SEARCH_STATE | search_state, | ||
BlamerBundle * | blamer_bundle | ||
) |
evaluate_chunks
A particular word level segmentation has been chosen. Evaluation this to find the word list that corresponds to it.
Definition at line 203 of file bestfirst.cpp.
inT16 tesseract::Wordrec::evaluate_state | ( | CHUNKS_RECORD * | chunks_record, |
SEARCH_RECORD * | the_search, | ||
DANGERR * | fixpt, | ||
BlamerBundle * | blamer_bundle | ||
) |
Definition at line 256 of file bestfirst.cpp.
void tesseract::Wordrec::expand_node | ( | FLOAT32 | worst_priority, |
CHUNKS_RECORD * | chunks_record, | ||
SEARCH_RECORD * | the_search | ||
) |
Definition at line 499 of file bestfirst.cpp.
BLOB_CHOICE_LIST * tesseract::Wordrec::fake_classify_blob | ( | UNICHAR_ID | class_id, |
float | rating, | ||
float | certainty | ||
) |
Definition at line 136 of file wordclass.cpp.
void tesseract::Wordrec::fill_filtered_fragment_list | ( | BLOB_CHOICE_LIST * | choices, |
int | fragment_pos, | ||
int | num_frag_parts, | ||
BLOB_CHOICE_LIST * | filtered_choices | ||
) |
Definition at line 136 of file pieces.cpp.
void tesseract::Wordrec::FillLattice | ( | const MATRIX & | ratings, |
const LIST & | best_choices, | ||
const UNICHARSET & | unicharset, | ||
BlamerBundle * | blamer_bundle | ||
) |
|
protected |
Definition at line 376 of file segsearch.cpp.
Definition at line 74 of file gradechop.cpp.
void tesseract::Wordrec::get_fragment_lists | ( | inT16 | current_frag, |
inT16 | current_row, | ||
inT16 | start, | ||
inT16 | num_frag_parts, | ||
inT16 | num_blobs, | ||
MATRIX * | ratings, | ||
BLOB_CHOICE_LIST * | choice_lists | ||
) |
Definition at line 292 of file pieces.cpp.
FLOAT32 tesseract::Wordrec::get_gap_variance | ( | WIDTH_RECORD * | wrec, |
float | norm_height | ||
) |
Definition at line 111 of file heuristic.cpp.
BLOB_CHOICE_LIST * tesseract::Wordrec::get_piece_rating | ( | MATRIX * | ratings, |
TBLOB * | blobs, | ||
const DENORM & | denorm, | ||
SEAMS | seams, | ||
inT16 | start, | ||
inT16 | end, | ||
BlamerBundle * | blamer_bundle | ||
) |
Definition at line 362 of file pieces.cpp.
FLOAT32 tesseract::Wordrec::get_width_variance | ( | WIDTH_RECORD * | wrec, |
float | norm_height | ||
) |
Definition at line 96 of file heuristic.cpp.
PRIORITY tesseract::Wordrec::grade_center_of_blob | ( | register BOUNDS_RECT | rect | ) |
Definition at line 95 of file gradechop.cpp.
PRIORITY tesseract::Wordrec::grade_overlap | ( | register BOUNDS_RECT | rect | ) |
Definition at line 115 of file gradechop.cpp.
Definition at line 168 of file gradechop.cpp.
Definition at line 145 of file gradechop.cpp.
PRIORITY tesseract::Wordrec::grade_width_change | ( | register BOUNDS_RECT | rect | ) |
Definition at line 191 of file gradechop.cpp.
void tesseract::Wordrec::improve_by_chopping | ( | WERD_RES * | word, |
BLOB_CHOICE_LIST_VECTOR * | char_choices, | ||
STATE * | best_state, | ||
BLOB_CHOICE_LIST_VECTOR * | best_char_choices, | ||
DANGERR * | fixpt, | ||
bool * | updated_best_choice | ||
) |
Definition at line 741 of file chopper.cpp.
bool tesseract::Wordrec::improve_one_blob | ( | WERD_RES * | word_res, |
BLOB_CHOICE_LIST_VECTOR * | char_choices, | ||
inT32 * | blob_number, | ||
SEAMS * | seam_list, | ||
DANGERR * | fixpt, | ||
bool | split_next_to_fragment, | ||
BlamerBundle * | blamer_bundle | ||
) |
Definition at line 332 of file chopper.cpp.
|
protected |
Definition at line 331 of file segsearch.cpp.
Definition at line 70 of file outlines.cpp.
Definition at line 123 of file chop.cpp.
Definition at line 104 of file outlines.cpp.
BLOB_CHOICE_LIST * tesseract::Wordrec::join_blobs_and_classify | ( | WERD_RES * | word, |
int | x, | ||
int | y, | ||
int | choice_index, | ||
MATRIX * | ratings, | ||
BLOB_CHOICE_LIST_VECTOR * | old_choices | ||
) |
Definition at line 730 of file bestfirst.cpp.
void tesseract::Wordrec::junk_worst_seam | ( | SEAM_QUEUE | seams, |
SEAM * | new_seam, | ||
float | new_priority | ||
) |
Definition at line 148 of file findseam.cpp.
void tesseract::Wordrec::merge_and_put_fragment_lists | ( | inT16 | row, |
inT16 | column, | ||
inT16 | num_frag_parts, | ||
BLOB_CHOICE_LIST * | choice_lists, | ||
MATRIX * | ratings | ||
) |
Definition at line 169 of file pieces.cpp.
Definition at line 324 of file pieces.cpp.
void tesseract::Wordrec::modify_blob_choice | ( | BLOB_CHOICE_LIST * | answer, |
int | chop_index | ||
) |
Definition at line 403 of file chopper.cpp.
bool tesseract::Wordrec::near_point | ( | EDGEPT * | point, |
EDGEPT * | line_pt_0, | ||
EDGEPT * | line_pt_1, | ||
EDGEPT ** | near_pt | ||
) |
Definition at line 116 of file outlines.cpp.
void tesseract::Wordrec::new_max_point | ( | EDGEPT * | local_max, |
POINT_GROUP | points | ||
) |
Definition at line 303 of file chop.cpp.
void tesseract::Wordrec::new_min_point | ( | EDGEPT * | local_min, |
POINT_GROUP | points | ||
) |
Definition at line 279 of file chop.cpp.
SEARCH_RECORD * tesseract::Wordrec::new_search | ( | CHUNKS_RECORD * | chunks_record, |
int | num_joints, | ||
BLOB_CHOICE_LIST_VECTOR * | best_char_choices, | ||
WERD_CHOICE * | best_choice, | ||
WERD_CHOICE * | raw_choice, | ||
STATE * | state | ||
) |
Definition at line 568 of file bestfirst.cpp.
EDGEPT * tesseract::Wordrec::pick_close_point | ( | EDGEPT * | critical_point, |
EDGEPT * | vertical_point, | ||
int * | best_dist | ||
) |
Definition at line 182 of file chop.cpp.
Definition at line 380 of file findseam.cpp.
Definition at line 607 of file bestfirst.cpp.
void tesseract::Wordrec::prioritize_points | ( | TESSLINE * | outline, |
POINT_GROUP | points | ||
) |
Definition at line 220 of file chop.cpp.
FLOAT32 tesseract::Wordrec::prioritize_state | ( | CHUNKS_RECORD * | chunks_record, |
SEARCH_RECORD * | the_search | ||
) |
Definition at line 289 of file heuristic.cpp.
|
protected |
Definition at line 257 of file segsearch.cpp.
void tesseract::Wordrec::program_editdown | ( | inT32 | elasped_time | ) |
void tesseract::Wordrec::program_editup | ( | const char * | textbase, |
bool | init_classifier, | ||
bool | init_permute | ||
) |
void tesseract::Wordrec::push_queue | ( | HEAP * | queue, |
STATE * | state, | ||
FLOAT32 | worst_priority, | ||
FLOAT32 | priority, | ||
bool | debug | ||
) |
Definition at line 629 of file bestfirst.cpp.
FLOAT32 tesseract::Wordrec::rating_priority | ( | CHUNKS_RECORD * | chunks_record, |
STATE * | state, | ||
int | num_joints | ||
) |
Definition at line 175 of file heuristic.cpp.
BLOB_CHOICE_LIST_VECTOR * tesseract::Wordrec::rebuild_current_state | ( | WERD_RES * | word, |
STATE * | state, | ||
BLOB_CHOICE_LIST_VECTOR * | old_choices, | ||
MATRIX * | ratings | ||
) |
rebuild_current_state
Transfers the given state to the word's output fields: rebuild_word, best_state, box_word, and returns the corresponding blob choices.
Definition at line 332 of file bestfirst.cpp.
BLOB_CHOICE * tesseract::Wordrec::rebuild_fragments | ( | const char * | unichar, |
const char * | expanded_fragment_lengths, | ||
int | choice_index, | ||
BLOB_CHOICE_LIST_VECTOR * | old_choices | ||
) |
Definition at line 680 of file bestfirst.cpp.
Definition at line 393 of file pieces.cpp.
Definition at line 414 of file pieces.cpp.
void tesseract::Wordrec::replace_char_widths | ( | CHUNKS_RECORD * | chunks_record, |
SEARCH_STATE | state | ||
) |
Definition at line 651 of file bestfirst.cpp.
void tesseract::Wordrec::reverse_outline | ( | EDGEPT * | outline | ) |
Definition at line 173 of file wordrec.cpp.
Definition at line 474 of file findseam.cpp.
Definition at line 142 of file heuristic.cpp.
void tesseract::Wordrec::SegSearch | ( | CHUNKS_RECORD * | chunks_record, |
WERD_CHOICE * | best_choice, | ||
BLOB_CHOICE_LIST_VECTOR * | best_char_choices, | ||
WERD_CHOICE * | raw_choice, | ||
STATE * | output_best_state, | ||
BlamerBundle * | blamer_bundle | ||
) |
Definition at line 35 of file segsearch.cpp.
|
inlineprotected |
inT16 tesseract::Wordrec::select_blob_to_split | ( | const BLOB_CHOICE_LIST_VECTOR & | char_choices, |
float | rating_ceiling, | ||
bool | split_next_to_fragment | ||
) |
Definition at line 801 of file chopper.cpp.
Definition at line 898 of file chopper.cpp.
void tesseract::Wordrec::set_chopper_blame | ( | WERD_RES * | word | ) |
Definition at line 917 of file chopper.cpp.
void tesseract::Wordrec::set_outline_bounds | ( | register EDGEPT * | point1, |
register EDGEPT * | point2, | ||
BOUNDS_RECT | rect | ||
) |
Definition at line 213 of file gradechop.cpp.
void tesseract::Wordrec::set_pass1 | ( | ) |
void tesseract::Wordrec::set_pass2 | ( | ) |
Definition at line 105 of file tface.cpp.
WIDTH_RECORD * tesseract::Wordrec::state_char_widths | ( | WIDTH_RECORD * | chunk_widths, |
STATE * | state, | ||
int | num_joints | ||
) |
Definition at line 58 of file heuristic.cpp.
void tesseract::Wordrec::try_point_pairs | ( | EDGEPT * | points[MAX_NUM_POINTS], |
inT16 | num_points, | ||
SEAM_QUEUE | seam_queue, | ||
SEAM_PILE * | seam_pile, | ||
SEAM ** | seam, | ||
TBLOB * | blob | ||
) |
Definition at line 512 of file findseam.cpp.
void tesseract::Wordrec::try_vertical_splits | ( | EDGEPT * | points[MAX_NUM_POINTS], |
inT16 | num_points, | ||
EDGEPT_CLIST * | new_points, | ||
SEAM_QUEUE | seam_queue, | ||
SEAM_PILE * | seam_pile, | ||
SEAM ** | seam, | ||
TBLOB * | blob | ||
) |
Definition at line 554 of file findseam.cpp.
void tesseract::Wordrec::update_blob_classifications | ( | TWERD * | word, |
const BLOB_CHOICE_LIST_VECTOR & | choices | ||
) |
Definition at line 152 of file wordclass.cpp.
void tesseract::Wordrec::update_ratings | ( | const BLOB_CHOICE_LIST_VECTOR & | new_choices, |
const CHUNKS_RECORD * | chunks_record, | ||
const SEARCH_STATE | search_state | ||
) |
|
protected |
Definition at line 186 of file segsearch.cpp.
void tesseract::Wordrec::vertical_projection_point | ( | EDGEPT * | split_point, |
EDGEPT * | target_point, | ||
EDGEPT ** | best_point, | ||
EDGEPT_CLIST * | new_points | ||
) |
Definition at line 332 of file chop.cpp.
FLOAT32 tesseract::Wordrec::width_priority | ( | CHUNKS_RECORD * | chunks_record, |
STATE * | state, | ||
int | num_joints | ||
) |
Definition at line 222 of file heuristic.cpp.
MATRIX * tesseract::Wordrec::word_associator | ( | bool | only_create_ratings_matrtix, |
WERD_RES * | word, | ||
STATE * | state, | ||
BLOB_CHOICE_LIST_VECTOR * | best_char_choices, | ||
DANGERR * | fixpt, | ||
STATE * | best_state | ||
) |
Definition at line 984 of file chopper.cpp.
bool tesseract::Wordrec::assume_fixed_pitch_char_segment = FALSE |
GenericVector<int> tesseract::Wordrec::blame_reasons_ |
BlobMatchTable tesseract::Wordrec::blob_match_table |
double tesseract::Wordrec::chop_center_knob = 0.15 |
double tesseract::Wordrec::chop_good_split = 50.0 |
int tesseract::Wordrec::chop_inside_angle = -50 |
int tesseract::Wordrec::chop_min_outline_area = 2000 |
int tesseract::Wordrec::chop_min_outline_points = 6 |
double tesseract::Wordrec::chop_ok_split = 100.0 |
double tesseract::Wordrec::chop_overlap_knob = 0.9 |
int tesseract::Wordrec::chop_same_distance = 2 |
double tesseract::Wordrec::chop_sharpness_knob = 0.06 |
double tesseract::Wordrec::chop_split_dist_knob = 0.5 |
int tesseract::Wordrec::chop_split_length = 10000 |
bool tesseract::Wordrec::chop_vertical_creep = 0 |
double tesseract::Wordrec::chop_width_change_knob = 5.0 |
int tesseract::Wordrec::chop_x_y_weight = 3 |
bool tesseract::Wordrec::enable_new_segsearch = false |
void(Wordrec::* tesseract::Wordrec::fill_lattice_)(const MATRIX &ratings, const LIST &best_choices, const UNICHARSET &unicharset, BlamerBundle *blamer_bundle) |
bool tesseract::Wordrec::force_word_assoc = FALSE |
bool tesseract::Wordrec::fragments_guide_chopper = FALSE |
double tesseract::Wordrec::heuristic_max_char_wh_ratio = 2.0 |
double tesseract::Wordrec::heuristic_segcost_rating_base = 1.25 |
double tesseract::Wordrec::heuristic_weight_rating = 1 |
double tesseract::Wordrec::heuristic_weight_seamcut = 0 |
double tesseract::Wordrec::heuristic_weight_width = 0 |
LanguageModel* tesseract::Wordrec::language_model_ |
EVALUATION_ARRAY tesseract::Wordrec::last_segmentation |
bool tesseract::Wordrec::merge_fragments_in_matrix = TRUE |
WERD_CHOICE* tesseract::Wordrec::prev_word_best_choice_ |
int tesseract::Wordrec::repair_unchopped_blobs = 1 |
bool tesseract::Wordrec::save_alt_choices = false |
int tesseract::Wordrec::segment_adjust_debug = 0 |
int tesseract::Wordrec::segsearch_debug_level = 0 |
double tesseract::Wordrec::segsearch_max_char_wh_ratio = 2.0 |
double tesseract::Wordrec::segsearch_max_fixed_pitch_char_wh_ratio = 2.0 |
int tesseract::Wordrec::segsearch_max_futile_classifications = 10 |
int tesseract::Wordrec::segsearch_max_pain_points = 2000 |
double tesseract::Wordrec::tessedit_certainty_threshold = -2.25 |
bool tesseract::Wordrec::use_new_state_cost = FALSE |
bool tesseract::Wordrec::wordrec_debug_blamer = false |
int tesseract::Wordrec::wordrec_debug_level = 0 |
bool tesseract::Wordrec::wordrec_enable_assoc = TRUE |
bool tesseract::Wordrec::wordrec_no_block = FALSE |
int tesseract::Wordrec::wordrec_num_seg_states = 30 |
bool tesseract::Wordrec::wordrec_run_blamer = false |
double tesseract::Wordrec::wordrec_worst_state = 1 |