diff --git a/include/tesseract/apitypes.h b/include/tesseract/apitypes.h index 2c0e85c9d..72ef68dc8 100644 --- a/include/tesseract/apitypes.h +++ b/include/tesseract/apitypes.h @@ -2,7 +2,6 @@ // File: apitypes.h // Description: Types used in both the API and internally // Author: Ray Smith -// Created: Wed Mar 03 09:22:53 PST 2010 // // (C) Copyright 2010, Google Inc. // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/include/tesseract/baseapi.h b/include/tesseract/baseapi.h index c90c75fa0..712a5b9cc 100644 --- a/include/tesseract/baseapi.h +++ b/include/tesseract/baseapi.h @@ -37,7 +37,6 @@ #include #include -#include // for std::function #include // for std::vector struct Pix; @@ -90,8 +89,6 @@ using ParamsModelClassifyFunc = float (Dict::*)(const char*, void*); using FillLatticeFunc = void (Wordrec::*)(const MATRIX&, const WERD_CHOICE_LIST&, const UNICHARSET&, BlamerBundle*); -using TruthCallback = - std::function; /** * Base class for all tesseract APIs. @@ -761,10 +758,6 @@ class TESS_API TessBaseAPI { return last_oem_requested_; } - void InitTruthCallback(TruthCallback cb) { - truth_cb_ = cb; - } - void set_min_orientation_margin(double margin); /* @} */ @@ -825,7 +818,6 @@ class TESS_API TessBaseAPI { std::string language_; ///< Last initialized language. OcrEngineMode last_oem_requested_; ///< Last ocr language mode requested. bool recognition_done_; ///< page_res_ contains recognition data. - TruthCallback truth_cb_; ///< fxn for setting truth_* in WERD_RES /** * @defgroup ThresholderParams Thresholder Parameters diff --git a/include/tesseract/capi.h b/include/tesseract/capi.h index 7efa1994a..d7920a98e 100644 --- a/include/tesseract/capi.h +++ b/include/tesseract/capi.h @@ -61,7 +61,6 @@ typedef tesseract::ProbabilityInContextFunc TessProbabilityInContextFunc; // typedef tesseract::ParamsModelClassifyFunc TessParamsModelClassifyFunc; typedef tesseract::FillLatticeFunc TessFillLatticeFunc; typedef tesseract::Dawg TessDawg; -typedef tesseract::TruthCallback TessTruthCallback; typedef tesseract::Orientation TessOrientation; typedef tesseract::ParagraphJustification TessParagraphJustification; typedef tesseract::WritingDirection TessWritingDirection; @@ -407,9 +406,6 @@ TESS_API int TessBaseAPINumDawgs(const TessBaseAPI* handle); TESS_API TessOcrEngineMode TessBaseAPIOem(const TessBaseAPI* handle); -TESS_API void TessBaseAPIInitTruthCallback(TessBaseAPI* handle, - TessTruthCallback cb); - TESS_API void TessBaseGetBlockTextOrientations(TessBaseAPI* handle, int** block_orientation, bool** vertical_writing); diff --git a/src/api/baseapi.cpp b/src/api/baseapi.cpp index 827f369c0..38269cd96 100644 --- a/src/api/baseapi.cpp +++ b/src/api/baseapi.cpp @@ -199,7 +199,6 @@ TessBaseAPI::TessBaseAPI() page_res_(nullptr), last_oem_requested_(OEM_DEFAULT), recognition_done_(false), - truth_cb_(nullptr), rect_left_(0), rect_top_(0), rect_width_(0), @@ -857,17 +856,6 @@ int TessBaseAPI::Recognize(ETEXT_DESC* monitor) { } #endif // ndef DISABLED_LEGACY_ENGINE - if (truth_cb_ != nullptr) { - tesseract_->wordrec_run_blamer.set_value(true); - auto *page_it = new PageIterator( - page_res_, tesseract_, thresholder_->GetScaleFactor(), - thresholder_->GetScaledYResolution(), - rect_left_, rect_top_, rect_width_, rect_height_); - truth_cb_(tesseract_->getDict().getUnicharset(), - image_height_, page_it, this->tesseract()->pix_grey()); - delete page_it; - } - int result = 0; if (tesseract_->interactive_display_mode) { #ifndef GRAPHICS_DISABLED diff --git a/src/api/capi.cpp b/src/api/capi.cpp index 508634e6b..cb3e99156 100644 --- a/src/api/capi.cpp +++ b/src/api/capi.cpp @@ -613,11 +613,6 @@ TessOcrEngineMode TessBaseAPIOem(const TessBaseAPI* handle) { return handle->oem(); } -void TessBaseAPIInitTruthCallback(TessBaseAPI* handle, - TessTruthCallback cb) { - handle->InitTruthCallback(cb); -} - void TessBaseAPISetMinOrientationMargin(TessBaseAPI* handle, double margin) { handle->set_min_orientation_margin(margin);