Merge pull request #3205 from stweil/api

Remove TessTruthCallback from public API
This commit is contained in:
Egor Pugin 2020-12-30 18:00:01 +03:00 committed by GitHub
commit 87a2adabd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 0 additions and 30 deletions

View File

@ -2,7 +2,6 @@
// File: apitypes.h // File: apitypes.h
// Description: Types used in both the API and internally // Description: Types used in both the API and internally
// Author: Ray Smith // Author: Ray Smith
// Created: Wed Mar 03 09:22:53 PST 2010
// //
// (C) Copyright 2010, Google Inc. // (C) Copyright 2010, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -37,7 +37,6 @@
#include <tesseract/version.h> #include <tesseract/version.h>
#include <cstdio> #include <cstdio>
#include <functional> // for std::function
#include <vector> // for std::vector #include <vector> // for std::vector
struct Pix; struct Pix;
@ -90,8 +89,6 @@ using ParamsModelClassifyFunc = float (Dict::*)(const char*, void*);
using FillLatticeFunc = void (Wordrec::*)(const MATRIX&, using FillLatticeFunc = void (Wordrec::*)(const MATRIX&,
const WERD_CHOICE_LIST&, const WERD_CHOICE_LIST&,
const UNICHARSET&, BlamerBundle*); const UNICHARSET&, BlamerBundle*);
using TruthCallback =
std::function<void(const UNICHARSET&, int, PageIterator*, Pix*)>;
/** /**
* Base class for all tesseract APIs. * Base class for all tesseract APIs.
@ -761,10 +758,6 @@ class TESS_API TessBaseAPI {
return last_oem_requested_; return last_oem_requested_;
} }
void InitTruthCallback(TruthCallback cb) {
truth_cb_ = cb;
}
void set_min_orientation_margin(double margin); void set_min_orientation_margin(double margin);
/* @} */ /* @} */
@ -825,7 +818,6 @@ class TESS_API TessBaseAPI {
std::string language_; ///< Last initialized language. std::string language_; ///< Last initialized language.
OcrEngineMode last_oem_requested_; ///< Last ocr language mode requested. OcrEngineMode last_oem_requested_; ///< Last ocr language mode requested.
bool recognition_done_; ///< page_res_ contains recognition data. bool recognition_done_; ///< page_res_ contains recognition data.
TruthCallback truth_cb_; ///< fxn for setting truth_* in WERD_RES
/** /**
* @defgroup ThresholderParams Thresholder Parameters * @defgroup ThresholderParams Thresholder Parameters

View File

@ -61,7 +61,6 @@ typedef tesseract::ProbabilityInContextFunc TessProbabilityInContextFunc;
// typedef tesseract::ParamsModelClassifyFunc TessParamsModelClassifyFunc; // typedef tesseract::ParamsModelClassifyFunc TessParamsModelClassifyFunc;
typedef tesseract::FillLatticeFunc TessFillLatticeFunc; typedef tesseract::FillLatticeFunc TessFillLatticeFunc;
typedef tesseract::Dawg TessDawg; typedef tesseract::Dawg TessDawg;
typedef tesseract::TruthCallback TessTruthCallback;
typedef tesseract::Orientation TessOrientation; typedef tesseract::Orientation TessOrientation;
typedef tesseract::ParagraphJustification TessParagraphJustification; typedef tesseract::ParagraphJustification TessParagraphJustification;
typedef tesseract::WritingDirection TessWritingDirection; typedef tesseract::WritingDirection TessWritingDirection;
@ -407,9 +406,6 @@ TESS_API int TessBaseAPINumDawgs(const TessBaseAPI* handle);
TESS_API TessOcrEngineMode TessBaseAPIOem(const TessBaseAPI* handle); TESS_API TessOcrEngineMode TessBaseAPIOem(const TessBaseAPI* handle);
TESS_API void TessBaseAPIInitTruthCallback(TessBaseAPI* handle,
TessTruthCallback cb);
TESS_API void TessBaseGetBlockTextOrientations(TessBaseAPI* handle, TESS_API void TessBaseGetBlockTextOrientations(TessBaseAPI* handle,
int** block_orientation, int** block_orientation,
bool** vertical_writing); bool** vertical_writing);

View File

@ -199,7 +199,6 @@ TessBaseAPI::TessBaseAPI()
page_res_(nullptr), page_res_(nullptr),
last_oem_requested_(OEM_DEFAULT), last_oem_requested_(OEM_DEFAULT),
recognition_done_(false), recognition_done_(false),
truth_cb_(nullptr),
rect_left_(0), rect_left_(0),
rect_top_(0), rect_top_(0),
rect_width_(0), rect_width_(0),
@ -857,17 +856,6 @@ int TessBaseAPI::Recognize(ETEXT_DESC* monitor) {
} }
#endif // ndef DISABLED_LEGACY_ENGINE #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; int result = 0;
if (tesseract_->interactive_display_mode) { if (tesseract_->interactive_display_mode) {
#ifndef GRAPHICS_DISABLED #ifndef GRAPHICS_DISABLED

View File

@ -613,11 +613,6 @@ TessOcrEngineMode TessBaseAPIOem(const TessBaseAPI* handle) {
return handle->oem(); return handle->oem();
} }
void TessBaseAPIInitTruthCallback(TessBaseAPI* handle,
TessTruthCallback cb) {
handle->InitTruthCallback(cb);
}
void TessBaseAPISetMinOrientationMargin(TessBaseAPI* handle, void TessBaseAPISetMinOrientationMargin(TessBaseAPI* handle,
double margin) { double margin) {
handle->set_min_orientation_margin(margin); handle->set_min_orientation_margin(margin);