mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-13 07:59:04 +08:00
Merge pull request #2977 from stweil/limit
This commit is contained in:
commit
f9f8da1b8c
@ -265,8 +265,6 @@ bool LSTMRecognizer::RecognizeLine(const ImageData& image_data, bool invert,
|
||||
bool debug, bool re_invert, bool upside_down,
|
||||
float* scale_factor, NetworkIO* inputs,
|
||||
NetworkIO* outputs) {
|
||||
// Maximum width of image to train on.
|
||||
const int kMaxImageWidth = 2560;
|
||||
// This ensures consistent recognition results.
|
||||
SetRandomSeed();
|
||||
int min_width = network_->XScaleFactor();
|
||||
@ -276,6 +274,8 @@ bool LSTMRecognizer::RecognizeLine(const ImageData& image_data, bool invert,
|
||||
tprintf("Line cannot be recognized!!\n");
|
||||
return false;
|
||||
}
|
||||
// Maximum width of image to train on.
|
||||
const int kMaxImageWidth = 128 * pixGetHeight(pix);
|
||||
if (network_->IsTraining() && pixGetWidth(pix) > kMaxImageWidth) {
|
||||
tprintf("Image too large to learn!! Size = %dx%d\n", pixGetWidth(pix),
|
||||
pixGetHeight(pix));
|
||||
|
Loading…
Reference in New Issue
Block a user