mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-06-07 18:02:40 +08:00
Fixed crash reported as bug 697544 to debian
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@822 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
parent
64c739c8af
commit
00a79cb93a
@ -69,9 +69,15 @@ void Classify::ClearCharNormArray(uinT8* char_norm_array) {
|
|||||||
void Classify::ComputeIntCharNormArray(const FEATURE_STRUCT& norm_feature,
|
void Classify::ComputeIntCharNormArray(const FEATURE_STRUCT& norm_feature,
|
||||||
uinT8* char_norm_array) {
|
uinT8* char_norm_array) {
|
||||||
for (int i = 0; i < unicharset.size(); i++) {
|
for (int i = 0; i < unicharset.size(); i++) {
|
||||||
int norm_adjust = static_cast<int>(INT_CHAR_NORM_RANGE *
|
if (i < PreTrainedTemplates->NumClasses) {
|
||||||
ComputeNormMatch(i, norm_feature, FALSE));
|
int norm_adjust = static_cast<int>(INT_CHAR_NORM_RANGE *
|
||||||
char_norm_array[i] = ClipToRange(norm_adjust, 0, MAX_INT_CHAR_NORM);
|
ComputeNormMatch(i, norm_feature, FALSE));
|
||||||
|
char_norm_array[i] = ClipToRange(norm_adjust, 0, MAX_INT_CHAR_NORM);
|
||||||
|
} else {
|
||||||
|
// Classes with no templates (eg. ambigs & ligatures) default
|
||||||
|
// to worst match.
|
||||||
|
char_norm_array[i] = MAX_INT_CHAR_NORM;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} /* ComputeIntCharNormArray */
|
} /* ComputeIntCharNormArray */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user