mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-14 08:39:27 +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,
|
bool debug, bool re_invert, bool upside_down,
|
||||||
float* scale_factor, NetworkIO* inputs,
|
float* scale_factor, NetworkIO* inputs,
|
||||||
NetworkIO* outputs) {
|
NetworkIO* outputs) {
|
||||||
// Maximum width of image to train on.
|
|
||||||
const int kMaxImageWidth = 2560;
|
|
||||||
// This ensures consistent recognition results.
|
// This ensures consistent recognition results.
|
||||||
SetRandomSeed();
|
SetRandomSeed();
|
||||||
int min_width = network_->XScaleFactor();
|
int min_width = network_->XScaleFactor();
|
||||||
@ -276,6 +274,8 @@ bool LSTMRecognizer::RecognizeLine(const ImageData& image_data, bool invert,
|
|||||||
tprintf("Line cannot be recognized!!\n");
|
tprintf("Line cannot be recognized!!\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// Maximum width of image to train on.
|
||||||
|
const int kMaxImageWidth = 128 * pixGetHeight(pix);
|
||||||
if (network_->IsTraining() && pixGetWidth(pix) > kMaxImageWidth) {
|
if (network_->IsTraining() && pixGetWidth(pix) > kMaxImageWidth) {
|
||||||
tprintf("Image too large to learn!! Size = %dx%d\n", pixGetWidth(pix),
|
tprintf("Image too large to learn!! Size = %dx%d\n", pixGetWidth(pix),
|
||||||
pixGetHeight(pix));
|
pixGetHeight(pix));
|
||||||
|
Loading…
Reference in New Issue
Block a user