mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-22 09:53:03 +08:00
Merge pull request #3205 from stweil/api
Remove TessTruthCallback from public API
This commit is contained in:
commit
87a2adabd8
@ -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");
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include <tesseract/version.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <functional> // for std::function
|
||||
#include <vector> // 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<void(const UNICHARSET&, int, PageIterator*, Pix*)>;
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user