mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 06:30:14 +08:00
Fixed issue 249
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@342 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
parent
ce5de3094f
commit
97cefb1c12
@ -42,6 +42,8 @@ const double kMaxRectangularFraction = 0.75;
|
||||
// Fraction of width or height to allow transition from kMinRectangularFraction
|
||||
// to kMaxRectangularFraction, equivalent to a dy/dx skew.
|
||||
const double kMaxRectangularGradient = 0.1; // About 6 degrees.
|
||||
// Minimum image size to be worth looking for images on.
|
||||
const int kMinImageFindSize = 100;
|
||||
|
||||
// Finds image regions within the source pix (page image) and returns
|
||||
// the image regions as a Boxa, Pixa pair, analgous to pixConnComp.
|
||||
@ -52,6 +54,9 @@ void ImageFinder::FindImages(Pix* pix, Boxa** boxa, Pixa** pixa) {
|
||||
*pixa = NULL;
|
||||
|
||||
#ifdef HAVE_LIBLEPT
|
||||
if (pixGetWidth(pix) < kMinImageFindSize ||
|
||||
pixGetHeight(pix) < kMinImageFindSize)
|
||||
return; // Not worth looking at small images.
|
||||
// Reduce by factor 2.
|
||||
Pix *pixr = pixReduceRankBinaryCascade(pix, 1, 0, 0, 0);
|
||||
pixDisplayWrite(pixr, textord_tabfind_show_images);
|
||||
|
Loading…
Reference in New Issue
Block a user