mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-06-12 21:53:25 +08:00
Fixed problem with blank pages
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@750 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
parent
b301d39e2b
commit
fbf7968490
@ -634,8 +634,7 @@ PageIterator* TessBaseAPI::AnalyseLayout() {
|
|||||||
page_res_ = new PAGE_RES(block_list_, NULL);
|
page_res_ = new PAGE_RES(block_list_, NULL);
|
||||||
DetectParagraphs(false);
|
DetectParagraphs(false);
|
||||||
return new PageIterator(
|
return new PageIterator(
|
||||||
page_res_, tesseract_,
|
page_res_, tesseract_, thresholder_->GetScaleFactor(),
|
||||||
thresholder_->GetScaleFactor(),
|
|
||||||
thresholder_->GetScaledYResolution(),
|
thresholder_->GetScaledYResolution(),
|
||||||
rect_left_, rect_top_, rect_width_, rect_height_);
|
rect_left_, rect_top_, rect_width_, rect_height_);
|
||||||
}
|
}
|
||||||
@ -653,6 +652,10 @@ int TessBaseAPI::Recognize(ETEXT_DESC* monitor) {
|
|||||||
return -1;
|
return -1;
|
||||||
if (page_res_ != NULL)
|
if (page_res_ != NULL)
|
||||||
delete page_res_;
|
delete page_res_;
|
||||||
|
if (block_list_->empty()) {
|
||||||
|
page_res_ = new PAGE_RES(block_list_, &tesseract_->prev_word_best_choice_);
|
||||||
|
return 0; // Empty page.
|
||||||
|
}
|
||||||
|
|
||||||
tesseract_->SetBlackAndWhitelist();
|
tesseract_->SetBlackAndWhitelist();
|
||||||
recognition_done_ = true;
|
recognition_done_ = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user