///////////////////////////////////////////////////////////////////////
// File: tesscallback.h
// Description: classes and functions to replace pointer-to-functions
// Author: Samuel Charron
//
// (C) Copyright 2006, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
///////////////////////////////////////////////////////////////////////
#ifndef _TESS_CALLBACK_SPECIALIZATIONS_H
#define _TESS_CALLBACK_SPECIALIZATIONS_H
#include "host.h" // For NULL.
struct TessCallbackUtils_ {
static void FailIsRepeatable(const char* name);
};
class TessClosure {
public:
virtual ~TessClosure() { }
virtual void Run() = 0;
};
template <class R>
class TessResultCallback {
public:
virtual ~TessResultCallback() { }
virtual R Run() = 0;
};
template <bool del, class R, class T>
class _ConstTessMemberResultCallback_0_0 : public TessResultCallback<R> {
public:
typedef TessResultCallback<R> base;
typedef R (T::*MemberSignature)() const;
private:
const T* object_;
MemberSignature member_;
public:
inline _ConstTessMemberResultCallback_0_0(
const T* object, MemberSignature member)
: object_(object),
member_(member) {
}
virtual R Run() {
if (!del) {
R result = (object_->*member_)();
return result;
} else {
R result = (object_->*member_)();
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template <bool del, class T>
class _ConstTessMemberResultCallback_0_0<del, void, T>
: public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)() const;
private:
const T* object_;
MemberSignature member_;
public:
inline _ConstTessMemberResultCallback_0_0(
const T* object, MemberSignature member)
: object_(object),
member_(member) {
}
virtual void Run() {
if (!del) {
(object_->*member_)();
} else {
(object_->*member_)();
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
}
}
};
#ifndef SWIG
template <class T1, class T2, class R>
inline typename _ConstTessMemberResultCallback_0_0<true,R,T1>::base*
NewTessCallback(
const T1* obj, R (T2::*member)() const) {
return new _ConstTessMemberResultCallback_0_0<true,R,T1>(
obj, member);
}
#endif
#ifndef SWIG
template <class T1, class T2, class R>
inline typename _ConstTessMemberResultCallback_0_0<false,R,T1>::base*
NewPermanentTessCallback(
const T1* obj, R (T2::*member)() const) {
return new _ConstTessMemberResultCallback_0_0<false,R,T1>(
obj, member);
}
#endif
template <bool del, class R, class T>
class _TessMemberResultCallback_0_0 : public TessResultCallback<R> {
public:
typedef TessResultCallback<R> base;
typedef R (T::*MemberSignature)() ;
private:
T* object_;
MemberSignature member_;
public:
inline _TessMemberResultCallback_0_0(
T* object, MemberSignature member)
: object_(object),
member_(member) {
}
virtual R Run() {
if (!del) {
R result = (object_->*member_)();
return result;
} else {
R result = (object_->*member_)();
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template <bool del, class T>
class _TessMemberResultCallback_0_0<del, void, T>
: public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)() ;
private:
T* object_;
MemberSignature member_;
public:
inline _TessMemberResultCallback_0_0(
T* object, MemberSignature member)
: object_(object),
member_(member) {
}
virtual void Run() {
if (!del) {
(object_->*member_)();
} else {
(object_->*member_)();
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
}
}
};
#ifndef SWIG
template <class T1, class T2, class R>
inline typename _TessMemberResultCallback_0_0<true,R,T1>::base*
NewTessCallback(
T1* obj, R (T2::*member)() ) {
return new _TessMemberResultCallback_0_0<true,R,T1>(
obj, member);
}
#endif
#ifndef SWIG
template <class T1, class T2, class R>
inline typename _TessMemberResultCallback_0_0<false,R,T1>::base*
NewPermanentTessCallback(
T1* obj, R (T2::*member)() ) {
return new _TessMemberResultCallback_0_0<false,R,T1>(
obj, member);
}
#endif
template <bool del, class R>
class _TessFunctionResultCallback_0_0 : public TessResultCallback<R> {
public:
typedef TessResultCallback<R> base;
typedef R (*FunctionSignature)();
private:
FunctionSignature function_;
public:
inline _TessFunctionResultCallback_0_0(
FunctionSignature function)
: function_(function) {
}
virtual R Run() {
if (!del) {
R result = (*function_)();
return result;
} else {
R result = (*function_)();
// zero out the pointer to ensure segfault if used again
function_ = NULL;
delete this;
return result;
}
}
};
template <bool del>
class _TessFunctionResultCallback_0_0<del, void>
: public TessClosure {
public:
typedef TessClosure base;
typedef void (*FunctionSignature)();
private:
FunctionSignature function_;
public:
inline _TessFunctionResultCallback_0_0(
FunctionSignature function)
: function_(function) {
}
virtual void Run() {
if (!del) {
(*function_)();
} else {
(*function_)();
// zero out the pointer to ensure segfault if used again
function_ = NULL;
delete this;
}
}
};
template <class R>
inline typename _TessFunctionResultCallback_0_0<true,R>::base*
NewTessCallback(R (*function)()) {
return new _TessFunctionResultCallback_0_0<true,R>(function);
}
template <class R>
inline typename _TessFunctionResultCallback_0_0<false,R>::base*
NewPermanentTessCallback(R (*function)()) {
return new _TessFunctionResultCallback_0_0<false,R>(function);
}
// Specified by TR1 [4.7.2] Reference modifications.
template <class T> struct remove_reference;
template<typename T> struct remove_reference { typedef T type; };
template<typename T> struct remove_reference<T&> { typedef T type; };
// Identity<T>::type is a typedef of T. Useful for preventing the
// compiler from inferring the type of an argument in templates.
template <typename T>
struct Identity {
typedef T type;
};
template <bool del, class R, class T, class P1>
class _ConstTessMemberResultCallback_1_0 : public TessResultCallback<R> {
public:
typedef TessResultCallback<R> base;
typedef R (T::*MemberSignature)(P1) const;
private:
const T* object_;
MemberSignature member_;
typename remove_reference<P1>::type p1_;
public:
inline _ConstTessMemberResultCallback_1_0(const T* object, MemberSignature member, P1 p1)
: object_(object),
member_(member), p1_(p1) { }
virtual R Run() {
if (!del) {
R result = (object_->*member_)(p1_);
return result;
} else {
R result = (object_->*member_)(p1_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template <bool del, class T, class P1>
class _ConstTessMemberResultCallback_1_0<del, void, T, P1> : public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)(P1) const;
private:
const T* object_;
MemberSignature member_;
typename remov
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源说明】 基于OpenCV+TesseractOCRiOS的银行卡号识别源码+使用文档+全部资料(优秀项目).zip基于OpenCV+TesseractOCRiOS的银行卡号识别源码+使用文档+全部资料(优秀项目).zip基于OpenCV+TesseractOCRiOS的银行卡号识别源码+使用文档+全部资料(优秀项目).zip 【备注】 1、该项目是个人高分毕业设计项目源码,已获导师指导认可通过,答辩评审分达到95分 2、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 3、本项目适合计算机相关专业(如软件工程、计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载使用,也可作为毕业设计、课程设计、作业、项目初期立项演示等,当然也适合小白学习进阶。 4、如果基础还行,可以在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
基于OpenCV+TesseractOCRiOS的银行卡号识别源码+使用文档+全部资料(优秀项目).zip (1057个子文件)
libtesseract_all.a 20.75MB
liblept.a 18.31MB
Current 1B
tesscallback.h 351KB
allheaders.h 232KB
core_c.h 127KB
G8TesseractParameters.h 66KB
types_c.h 59KB
tesseractclass.h 54KB
imgproc_c.h 51KB
pix.h 51KB
unicharset.h 40KB
elst.h 38KB
kmeans_index.h 36KB
bbgrid.h 36KB
colpartition.h 36KB
oclkernels.h 35KB
elst2.h 34KB
baseapi.h 33KB
pageres.h 31KB
clst.h 30KB
genericvector.h 30KB
blobbox.h 30KB
dict.h 28KB
dist.h 27KB
hierarchical_clustering_index.h 25KB
classify.h 25KB
wordrec.h 23KB
defs.h 22KB
ratngs.h 22KB
dawg.h 21KB
autotuned_index.h 20KB
capi.h 20KB
kdtree_single_index.h 20KB
calib3d_c.h 20KB
language_model.h 19KB
trie.h 19KB
kdtree_index.h 19KB
videoio_c.h 18KB
opencl_device_selection.h 18KB
environ.h 18KB
lsh_table.h 18KB
types_c.h 17KB
colfind.h 17KB
tablefind.h 17KB
textord.h 17KB
shapetable.h 16KB
tablerecog.h 16KB
rect.h 16KB
tabfind.h 16KB
lsh_index.h 15KB
G8Tesseract.h 15KB
recog.h 15KB
tabvector.h 15KB
result_set.h 15KB
scrollview.h 15KB
normalis.h 14KB
strokewidth.h 14KB
blamer.h 14KB
makerow.h 14KB
pageiterator.h 14KB
blobs.h 13KB
mastertrainer.h 13KB
matrix.h 13KB
ipoints.h 13KB
paragraphs_internal.h 12KB
colpartitiongrid.h 12KB
openclwrapper.h 12KB
trainingsampleset.h 12KB
coutln.h 12KB
baselinedetect.h 12KB
readbarcode.h 11KB
tracking_c.h 11KB
tessdatamanager.h 11KB
publictypes.h 11KB
oldlist.h 11KB
params.h 11KB
equationdetect.h 11KB
index_testing.h 11KB
errorcounter.h 11KB
textlineprojection.h 10KB
highgui_c.h 10KB
dewarp.h 10KB
rejctmap.h 9KB
lm_state.h 9KB
topitch.h 9KB
points.h 9KB
ambigs.h 9KB
imageio.h 9KB
ltrresultiterator.h 9KB
renderer.h 9KB
resultiterator.h 9KB
cvdef.h 9KB
morph.h 9KB
blkocc.h 9KB
intproto.h 9KB
genericheap.h 9KB
trainingsample.h 8KB
neural_net.h 8KB
arrayaccess.h 8KB
共 1057 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
资源评论
不走小道
- 粉丝: 3206
- 资源: 5122
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 本科毕业设计基于C# wpf人脸识别的考勤系统的设计与实现源码.zip
- 基于Ruoyi+uniapp实现学生考勤系统 学生考勤源码+项目说明.zip
- feae6bc968ca68a099455d8b8a8dea35
- 基于Pytorch训练CIRAR10上分类算法.zip
- Pytorch-pytorch深度学习教程之Tensorboard.zip
- 基于C++和Python开发yolov8-face作为人脸检测器dlib作为人脸识别器的人脸考勤系统源码+项目说明.zip
- Pytorch-pytorch深度学习教程之变分自动编码器.zip
- Pytorch-pytorch深度学习教程之神经风格迁移.zip
- Pytorch-pytorch深度学习教程之深度残差网络.zip
- Pytorch-pytorch深度学习教程之循环神经网络.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功