Merge pull request #2962 from stweil/GetPageRes

Add TessBaseAPI::GetPageRes again
This commit is contained in:
zdenop 2020-05-04 15:15:29 +02:00 committed by GitHub
commit 79c3ebbbb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -800,6 +800,10 @@ class TESS_API TessBaseAPI {
//// paragraphs.cpp //////////////////////////////////////////////////// //// paragraphs.cpp ////////////////////////////////////////////////////
TESS_LOCAL void DetectParagraphs(bool after_text_recognition); TESS_LOCAL void DetectParagraphs(bool after_text_recognition);
TESS_LOCAL const PAGE_RES* GetPageRes() const {
return page_res_;
}
protected: protected:
Tesseract* tesseract_; ///< The underlying data object. Tesseract* tesseract_; ///< The underlying data object.
Tesseract* osd_tesseract_; ///< For orientation & script detection. Tesseract* osd_tesseract_; ///< For orientation & script detection.

View File

@ -257,10 +257,6 @@ TEST_F(TesseractTest, BasicLSTMTest) {
// errors due to float/int conversions (e.g., see OUTLINE::move() in // errors due to float/int conversions (e.g., see OUTLINE::move() in
// ccstruct/poutline.h) Instead, we do a loose check. // ccstruct/poutline.h) Instead, we do a loose check.
TEST_F(TesseractTest, LSTMGeometryTest) { TEST_F(TesseractTest, LSTMGeometryTest) {
#ifdef DISABLED_LEGACY_ENGINE
// Skip test because TessBaseAPI::GetPageRes is missing.
GTEST_SKIP();
#else
Pix* src_pix = pixRead(TestDataNameToPath("deslant.tif").c_str()); Pix* src_pix = pixRead(TestDataNameToPath("deslant.tif").c_str());
FriendlyTessBaseAPI api; FriendlyTessBaseAPI api;
if (api.Init(TessdataPath().c_str(), "eng", tesseract::OEM_LSTM_ONLY) == -1) { if (api.Init(TessdataPath().c_str(), "eng", tesseract::OEM_LSTM_ONLY) == -1) {
@ -303,7 +299,6 @@ TEST_F(TesseractTest, LSTMGeometryTest) {
} }
} }
pixDestroy(&src_pix); pixDestroy(&src_pix);
#endif
} }
TEST_F(TesseractTest, InitConfigOnlyTest) { TEST_F(TesseractTest, InitConfigOnlyTest) {