mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 06:30:14 +08:00
Avoid crash with --psm 0 and LSTM traineddata
Orientation and script detect only worked with legacy models and crashed with LSTM models. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
59ebd58fcc
commit
32e92def49
@ -1541,6 +1541,10 @@ void Classify::DoAdaptiveMatch(TBLOB *Blob, ADAPT_RESULTS *Results) {
|
||||
&bl_features);
|
||||
if (sample == nullptr) return;
|
||||
|
||||
// TODO: With LSTM, static_classifier_ is nullptr.
|
||||
// Return to avoid crash in CharNormClassifier.
|
||||
if (static_classifier_ == nullptr) return;
|
||||
|
||||
if (AdaptedTemplates->NumPermClasses < matcher_permanent_classes_min ||
|
||||
tess_cn_matching) {
|
||||
CharNormClassifier(Blob, *sample, Results);
|
||||
|
Loading…
Reference in New Issue
Block a user