From 0720b3f38bfbcd819d58e471176720da9e0d9f32 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Tue, 8 Aug 2017 16:47:15 +0200 Subject: [PATCH] Change default resolution from 70 to 300 dpi The default resolution is used for images without an explicit resolution or with an unreasonable resolution (smaller than 70 or larger than 2400). Signed-off-by: Stefan Weil --- api/baseapi.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/baseapi.cpp b/api/baseapi.cpp index d88bdbfd92..b0849665b1 100644 --- a/api/baseapi.cpp +++ b/api/baseapi.cpp @@ -106,6 +106,8 @@ const int kMaxIntSize = 22; const int kMinCredibleResolution = 70; /** Maximum believable resolution. */ const int kMaxCredibleResolution = 2400; +/** Default resolution. */ +const int kDefaultResolution = 300; TessBaseAPI::TessBaseAPI() : tesseract_(nullptr), @@ -2199,8 +2201,8 @@ bool TessBaseAPI::Threshold(Pix** pix) { // Use the minimum default resolution, as it is safer to under-estimate // than over-estimate resolution. tprintf("Warning. Invalid resolution %d dpi. Using %d instead.\n", y_res, - kMinCredibleResolution); - thresholder_->SetSourceYResolution(kMinCredibleResolution); + kDefaultResolution); + thresholder_->SetSourceYResolution(kDefaultResolution); } PageSegMode pageseg_mode = static_cast(