diff options
author | Iliyan Malchev <malchev@google.com> | 2008-09-22 10:40:17 -0700 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2008-09-22 10:40:17 -0700 |
commit | d787a7923c84fca2289d006ac9728a7e4394bc04 (patch) | |
tree | 3266a2eda4e57729a47bd57419c11c1c75a860d4 | |
parent | 89932bbf30bb592a82503fa1e2fafaf21dcc34e8 (diff) | |
download | tesseract-d787a7923c84fca2289d006ac9728a7e4394bc04.tar.gz |
add code (incomplete) to disable the integer matcher
Signed-off-by: Iliyan Malchev <malchev@google.com>
-rwxr-xr-x | Android.mk | 1 | ||||
-rw-r--r-- | classify/adaptmatch.cpp | 4 | ||||
-rw-r--r-- | classify/intproto.cpp | 3 |
3 files changed, 7 insertions, 1 deletions
@@ -299,6 +299,7 @@ LOCAL_C_INCLUDES+= \ system/tesseract/dict LOCAL_CFLAGS:=-DGRAPHICS_DISABLED +#LOCAL_CFLAGS+=-DDISABLE_INTEGER_MATCHING LOCAL_SHARED_LIBRARIES:= \ libtesseract_cc_struct \ diff --git a/classify/adaptmatch.cpp b/classify/adaptmatch.cpp index e07c6a4..766170d 100644 --- a/classify/adaptmatch.cpp +++ b/classify/adaptmatch.cpp @@ -1380,6 +1380,7 @@ void Classify::MasterMatcher(INT_TEMPLATES templates, ADAPT_RESULTS* final_results) { for (int c = 0; c < num_classes; c++) { CLASS_ID class_id = results[c].Class; +#ifndef DISABLE_INTEGER_MATCHING INT_RESULT_STRUCT& int_result = results[c].IMResult; BIT_VECTOR protos = classes != NULL ? classes[class_id]->PermProtos : AllProtosOn; @@ -1406,6 +1407,9 @@ void Classify::MasterMatcher(INT_TEMPLATES templates, if (int_result.Rating > WORST_POSSIBLE_RATING) int_result.Rating = WORST_POSSIBLE_RATING; AddNewResult(final_results, class_id, int_result.Rating, int_result.Config); +#else + AddNewResult(final_results, class_id, results[c].Rating * 2, 0); +#endif } if (matcher_debug_level >= 2 || display_ratings > 1) cprintf("\n"); diff --git a/classify/intproto.cpp b/classify/intproto.cpp index 98f6688..55c950f 100644 --- a/classify/intproto.cpp +++ b/classify/intproto.cpp @@ -1100,6 +1100,7 @@ INT_TEMPLATES Classify::ReadIntTemplates(FILE *File) { } } +#ifndef DISABLE_INTEGER_MATCHING /* then read in each class */ for (i = 0; i < NumClassesIn (Templates); i++) { /* first read in the high level struct for the class */ @@ -1230,7 +1231,7 @@ INT_TEMPLATES Classify::ReadIntTemplates(FILE *File) { this->fontinfo_table_.read(File, NewPermanentCallback(read_info), swap); this->fontset_table_.read(File, NewPermanentCallback(read_set), swap); } - +#endif return (Templates); } /* ReadIntTemplates */ |