mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-06-11 20:53:24 +08:00
Use default keyword instead of empty ctors/dtors.
This commit is contained in:
parent
0a93ad2aae
commit
785b5e8134
@ -37,9 +37,6 @@ LTRResultIterator::LTRResultIterator(PAGE_RES* page_res, Tesseract* tesseract,
|
|||||||
paragraph_separator_("\n") {
|
paragraph_separator_("\n") {
|
||||||
}
|
}
|
||||||
|
|
||||||
LTRResultIterator::~LTRResultIterator() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns the null terminated UTF-8 encoded text string for the current
|
// Returns the null terminated UTF-8 encoded text string for the current
|
||||||
// object at the given level. Use delete [] to free after use.
|
// object at the given level. Use delete [] to free after use.
|
||||||
char* LTRResultIterator::GetUTF8Text(PageIteratorLevel level) const {
|
char* LTRResultIterator::GetUTF8Text(PageIteratorLevel level) const {
|
||||||
|
@ -62,7 +62,8 @@ class TESS_API LTRResultIterator : public PageIterator {
|
|||||||
int scale, int scaled_yres,
|
int scale, int scaled_yres,
|
||||||
int rect_left, int rect_top,
|
int rect_left, int rect_top,
|
||||||
int rect_width, int rect_height);
|
int rect_width, int rect_height);
|
||||||
virtual ~LTRResultIterator();
|
|
||||||
|
virtual ~LTRResultIterator() = default;
|
||||||
|
|
||||||
// LTRResultIterators may be copied! This makes it possible to iterate over
|
// LTRResultIterators may be copied! This makes it possible to iterate over
|
||||||
// all the objects at a lower level, while maintaining an iterator to
|
// all the objects at a lower level, while maintaining an iterator to
|
||||||
|
@ -51,7 +51,7 @@ class MutableIterator : public ResultIterator {
|
|||||||
: ResultIterator(
|
: ResultIterator(
|
||||||
LTRResultIterator(page_res, tesseract, scale, scaled_yres, rect_left,
|
LTRResultIterator(page_res, tesseract, scale, scaled_yres, rect_left,
|
||||||
rect_top, rect_width, rect_height)) {}
|
rect_top, rect_width, rect_height)) {}
|
||||||
virtual ~MutableIterator() {}
|
virtual ~MutableIterator() = default;
|
||||||
|
|
||||||
// See PageIterator and ResultIterator for most calls.
|
// See PageIterator and ResultIterator for most calls.
|
||||||
|
|
||||||
|
@ -37,9 +37,6 @@ BoxWord::BoxWord(const BoxWord& src) {
|
|||||||
CopyFrom(src);
|
CopyFrom(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
BoxWord::~BoxWord() {
|
|
||||||
}
|
|
||||||
|
|
||||||
BoxWord& BoxWord::operator=(const BoxWord& src) {
|
BoxWord& BoxWord::operator=(const BoxWord& src) {
|
||||||
CopyFrom(src);
|
CopyFrom(src);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -40,7 +40,7 @@ class BoxWord {
|
|||||||
public:
|
public:
|
||||||
BoxWord();
|
BoxWord();
|
||||||
explicit BoxWord(const BoxWord& src);
|
explicit BoxWord(const BoxWord& src);
|
||||||
~BoxWord();
|
~BoxWord() = default;
|
||||||
|
|
||||||
BoxWord& operator=(const BoxWord& src);
|
BoxWord& operator=(const BoxWord& src);
|
||||||
|
|
||||||
|
@ -28,9 +28,4 @@ const double CCStruct::kAscenderFraction = 0.25;
|
|||||||
const double CCStruct::kXHeightCapRatio = CCStruct::kXHeightFraction /
|
const double CCStruct::kXHeightCapRatio = CCStruct::kXHeightFraction /
|
||||||
(CCStruct::kXHeightFraction + CCStruct::kAscenderFraction);
|
(CCStruct::kXHeightFraction + CCStruct::kAscenderFraction);
|
||||||
|
|
||||||
CCStruct::CCStruct() {}
|
|
||||||
|
|
||||||
CCStruct::~CCStruct() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
namespace tesseract {
|
namespace tesseract {
|
||||||
class CCStruct : public CUtil {
|
class CCStruct : public CUtil {
|
||||||
public:
|
public:
|
||||||
CCStruct();
|
CCStruct() = default;
|
||||||
~CCStruct();
|
~CCStruct() = default;
|
||||||
|
|
||||||
// Globally accessible constants.
|
// Globally accessible constants.
|
||||||
// APPROXIMATIONS of the fractions of the character cell taken by
|
// APPROXIMATIONS of the fractions of the character cell taken by
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
class CRACKEDGE {
|
class CRACKEDGE {
|
||||||
public:
|
public:
|
||||||
CRACKEDGE() {}
|
CRACKEDGE() = default;
|
||||||
|
|
||||||
ICOORD pos; /*position of crack */
|
ICOORD pos; /*position of crack */
|
||||||
int8_t stepx; //edge step
|
int8_t stepx; //edge step
|
||||||
|
@ -41,9 +41,6 @@ const int kMaxRealDistance = 2.0;
|
|||||||
DetLineFit::DetLineFit() : square_length_(0.0) {
|
DetLineFit::DetLineFit() : square_length_(0.0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DetLineFit::~DetLineFit() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete all Added points.
|
// Delete all Added points.
|
||||||
void DetLineFit::Clear() {
|
void DetLineFit::Clear() {
|
||||||
pts_.clear();
|
pts_.clear();
|
||||||
|
@ -56,7 +56,7 @@ namespace tesseract {
|
|||||||
class DetLineFit {
|
class DetLineFit {
|
||||||
public:
|
public:
|
||||||
DetLineFit();
|
DetLineFit();
|
||||||
~DetLineFit();
|
~DetLineFit() = default;
|
||||||
|
|
||||||
// Delete all Added points.
|
// Delete all Added points.
|
||||||
void Clear();
|
void Clear();
|
||||||
|
@ -61,7 +61,7 @@ struct FontSpacingInfo {
|
|||||||
*/
|
*/
|
||||||
struct FontInfo {
|
struct FontInfo {
|
||||||
FontInfo() : name(nullptr), properties(0), universal_id(0), spacing_vec(nullptr) {}
|
FontInfo() : name(nullptr), properties(0), universal_id(0), spacing_vec(nullptr) {}
|
||||||
~FontInfo() {}
|
~FontInfo() = default;
|
||||||
|
|
||||||
// Writes to the given file. Returns false in case of error.
|
// Writes to the given file. Returns false in case of error.
|
||||||
bool Serialize(FILE* fp) const;
|
bool Serialize(FILE* fp) const;
|
||||||
|
@ -29,8 +29,7 @@
|
|||||||
class DLLSYM DIR128
|
class DLLSYM DIR128
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DIR128() {
|
DIR128() = default;
|
||||||
} //empty constructor
|
|
||||||
|
|
||||||
DIR128( //constructor
|
DIR128( //constructor
|
||||||
int16_t value) { //value to assign
|
int16_t value) { //value to assign
|
||||||
|
@ -48,8 +48,7 @@ class BLOCK:public ELIST_LINK
|
|||||||
int16_t xmax, //< top right
|
int16_t xmax, //< top right
|
||||||
int16_t ymax);
|
int16_t ymax);
|
||||||
|
|
||||||
~BLOCK () {
|
~BLOCK () = default;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set space size etc.
|
* set space size etc.
|
||||||
|
@ -33,8 +33,7 @@ class ROW:public ELIST_LINK
|
|||||||
{
|
{
|
||||||
friend void tweak_row_baseline(ROW *, double, double);
|
friend void tweak_row_baseline(ROW *, double, double);
|
||||||
public:
|
public:
|
||||||
ROW() {
|
ROW() = default;
|
||||||
} //empty constructor
|
|
||||||
ROW( //constructor
|
ROW( //constructor
|
||||||
int32_t spline_size, //no of segments
|
int32_t spline_size, //no of segments
|
||||||
int32_t *xstarts, //segment boundaries
|
int32_t *xstarts, //segment boundaries
|
||||||
|
@ -86,8 +86,7 @@ class PAGE_RES { // page result
|
|||||||
BLOCK_LIST *block_list, // real blocks
|
BLOCK_LIST *block_list, // real blocks
|
||||||
WERD_CHOICE **prev_word_best_choice_ptr);
|
WERD_CHOICE **prev_word_best_choice_ptr);
|
||||||
|
|
||||||
~PAGE_RES () { // destructor
|
~PAGE_RES () = default;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@ -109,13 +108,11 @@ class BLOCK_RES:public ELIST_LINK {
|
|||||||
|
|
||||||
ROW_RES_LIST row_res_list;
|
ROW_RES_LIST row_res_list;
|
||||||
|
|
||||||
BLOCK_RES() {
|
BLOCK_RES() = default;
|
||||||
} // empty constructor
|
|
||||||
|
|
||||||
BLOCK_RES(bool merge_similar_words, BLOCK *the_block); // real block
|
BLOCK_RES(bool merge_similar_words, BLOCK *the_block); // real block
|
||||||
|
|
||||||
~BLOCK_RES () { // destructor
|
~BLOCK_RES () = default;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@ -130,13 +127,11 @@ class ROW_RES:public ELIST_LINK {
|
|||||||
int32_t whole_word_rej_count; // rejs in total rej wds
|
int32_t whole_word_rej_count; // rejs in total rej wds
|
||||||
WERD_RES_LIST word_res_list;
|
WERD_RES_LIST word_res_list;
|
||||||
|
|
||||||
ROW_RES() {
|
ROW_RES() = default;
|
||||||
} // empty constructor
|
|
||||||
|
|
||||||
ROW_RES(bool merge_similar_words, ROW *the_row); // real row
|
ROW_RES(bool merge_similar_words, ROW *the_row); // real row
|
||||||
|
|
||||||
~ROW_RES() { // destructor
|
~ROW_RES() = default;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@ -660,8 +655,7 @@ class PAGE_RES_IT {
|
|||||||
public:
|
public:
|
||||||
PAGE_RES * page_res; // page being iterated
|
PAGE_RES * page_res; // page being iterated
|
||||||
|
|
||||||
PAGE_RES_IT() {
|
PAGE_RES_IT() = default;
|
||||||
} // empty contructor
|
|
||||||
|
|
||||||
PAGE_RES_IT(PAGE_RES *the_page_res) { // page result
|
PAGE_RES_IT(PAGE_RES *the_page_res) { // page result
|
||||||
page_res = the_page_res;
|
page_res = the_page_res;
|
||||||
|
@ -126,7 +126,7 @@ using ParamsTrainingHypothesisList = GenericVector<ParamsTrainingHypothesis>;
|
|||||||
// explored on PASS1, PASS2, fix xheight pass, etc).
|
// explored on PASS1, PASS2, fix xheight pass, etc).
|
||||||
class ParamsTrainingBundle {
|
class ParamsTrainingBundle {
|
||||||
public:
|
public:
|
||||||
ParamsTrainingBundle() {}
|
ParamsTrainingBundle() = default;
|
||||||
// Starts a new hypothesis list.
|
// Starts a new hypothesis list.
|
||||||
// Should be called at the beginning of a new run of the segmentation search.
|
// Should be called at the beginning of a new run of the segmentation search.
|
||||||
void StartHypothesisList() {
|
void StartHypothesisList() {
|
||||||
|
@ -45,8 +45,7 @@ class ICOORD
|
|||||||
ycoord = yin;
|
ycoord = yin;
|
||||||
}
|
}
|
||||||
///destructor
|
///destructor
|
||||||
~ICOORD () {
|
~ICOORD () = default;
|
||||||
}
|
|
||||||
|
|
||||||
///access function
|
///access function
|
||||||
int16_t x() const {
|
int16_t x() const {
|
||||||
@ -163,8 +162,7 @@ class DLLSYM ICOORDELT:public ELIST_LINK, public ICOORD
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
///empty constructor
|
///empty constructor
|
||||||
ICOORDELT() {
|
ICOORDELT() = default;
|
||||||
}
|
|
||||||
///constructor from ICOORD
|
///constructor from ICOORD
|
||||||
ICOORDELT (ICOORD icoord):ICOORD (icoord) {
|
ICOORDELT (ICOORD icoord):ICOORD (icoord) {
|
||||||
}
|
}
|
||||||
@ -190,8 +188,7 @@ class DLLSYM FCOORD
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
///empty constructor
|
///empty constructor
|
||||||
FCOORD() {
|
FCOORD() = default;
|
||||||
}
|
|
||||||
///constructor
|
///constructor
|
||||||
///@param xvalue x value
|
///@param xvalue x value
|
||||||
///@param yvalue y value
|
///@param yvalue y value
|
||||||
|
@ -27,13 +27,11 @@
|
|||||||
|
|
||||||
class DLLSYM POLY_BLOCK {
|
class DLLSYM POLY_BLOCK {
|
||||||
public:
|
public:
|
||||||
POLY_BLOCK() {
|
POLY_BLOCK() = default;
|
||||||
}
|
|
||||||
// Initialize from box coordinates.
|
// Initialize from box coordinates.
|
||||||
POLY_BLOCK(const TBOX& box, PolyBlockType type);
|
POLY_BLOCK(const TBOX& box, PolyBlockType type);
|
||||||
POLY_BLOCK(ICOORDELT_LIST *points, PolyBlockType type);
|
POLY_BLOCK(ICOORDELT_LIST *points, PolyBlockType type);
|
||||||
~POLY_BLOCK () {
|
~POLY_BLOCK () = default;
|
||||||
}
|
|
||||||
|
|
||||||
TBOX *bounding_box() { // access function
|
TBOX *bounding_box() { // access function
|
||||||
return &box;
|
return &box;
|
||||||
|
@ -25,8 +25,7 @@
|
|||||||
class QUAD_COEFFS
|
class QUAD_COEFFS
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QUAD_COEFFS() {
|
QUAD_COEFFS() = default;
|
||||||
} //empty constructor
|
|
||||||
QUAD_COEFFS( //constructor
|
QUAD_COEFFS( //constructor
|
||||||
double xsq, //coefficients
|
double xsq, //coefficients
|
||||||
float x,
|
float x,
|
||||||
|
@ -71,7 +71,7 @@ class BLOB_CHOICE: public ELIST_LINK
|
|||||||
float yshift, // the larger of y shift (top or bottom)
|
float yshift, // the larger of y shift (top or bottom)
|
||||||
BlobChoiceClassifier c); // adapted match or other
|
BlobChoiceClassifier c); // adapted match or other
|
||||||
BLOB_CHOICE(const BLOB_CHOICE &other);
|
BLOB_CHOICE(const BLOB_CHOICE &other);
|
||||||
~BLOB_CHOICE() {}
|
~BLOB_CHOICE() = default;
|
||||||
|
|
||||||
UNICHAR_ID unichar_id() const {
|
UNICHAR_ID unichar_id() const {
|
||||||
return unichar_id_;
|
return unichar_id_;
|
||||||
|
@ -116,8 +116,7 @@ class REJ
|
|||||||
BOOL8 rej_before_quality_accept();
|
BOOL8 rej_before_quality_accept();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
REJ() { //constructor
|
REJ() = default;
|
||||||
}
|
|
||||||
|
|
||||||
REJ( //classwise copy
|
REJ( //classwise copy
|
||||||
const REJ &source) {
|
const REJ &source) {
|
||||||
|
@ -30,8 +30,7 @@ ELISTIZEH(C_BLOB)
|
|||||||
class C_BLOB:public ELIST_LINK
|
class C_BLOB:public ELIST_LINK
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
C_BLOB() {
|
C_BLOB() = default;
|
||||||
}
|
|
||||||
explicit C_BLOB(C_OUTLINE_LIST *outline_list);
|
explicit C_BLOB(C_OUTLINE_LIST *outline_list);
|
||||||
// Simpler constructor to build a blob from a single outline that has
|
// Simpler constructor to build a blob from a single outline that has
|
||||||
// already been fully initialized.
|
// already been fully initialized.
|
||||||
|
@ -59,7 +59,7 @@ class ROW; //forward decl
|
|||||||
|
|
||||||
class WERD : public ELIST2_LINK {
|
class WERD : public ELIST2_LINK {
|
||||||
public:
|
public:
|
||||||
WERD() {}
|
WERD() = default;
|
||||||
// WERD constructed with:
|
// WERD constructed with:
|
||||||
// blob_list - blobs of the word (we take this list's contents)
|
// blob_list - blobs of the word (we take this list's contents)
|
||||||
// blanks - number of blanks before the word
|
// blanks - number of blanks before the word
|
||||||
@ -75,8 +75,7 @@ class WERD : public ELIST2_LINK {
|
|||||||
// W_BOL and W_EOL flags are set according to the given values.
|
// W_BOL and W_EOL flags are set according to the given values.
|
||||||
WERD* ConstructFromSingleBlob(bool bol, bool eol, C_BLOB* blob);
|
WERD* ConstructFromSingleBlob(bool bol, bool eol, C_BLOB* blob);
|
||||||
|
|
||||||
~WERD() {
|
~WERD() = default;
|
||||||
}
|
|
||||||
|
|
||||||
// assignment
|
// assignment
|
||||||
WERD & operator= (const WERD &source);
|
WERD & operator= (const WERD &source);
|
||||||
|
@ -114,7 +114,7 @@ class UnicharIdArrayUtils {
|
|||||||
class AmbigSpec : public ELIST_LINK {
|
class AmbigSpec : public ELIST_LINK {
|
||||||
public:
|
public:
|
||||||
AmbigSpec();
|
AmbigSpec();
|
||||||
~AmbigSpec() {}
|
~AmbigSpec() = default;
|
||||||
|
|
||||||
// Comparator function for sorting AmbigSpec_LISTs. The lists will
|
// Comparator function for sorting AmbigSpec_LISTs. The lists will
|
||||||
// be sorted by their wrong_ngram arrays. Example of wrong_ngram vectors
|
// be sorted by their wrong_ngram arrays. Example of wrong_ngram vectors
|
||||||
@ -142,7 +142,7 @@ using UnicharAmbigsVector = GenericVector<AmbigSpec_LIST *>;
|
|||||||
|
|
||||||
class UnicharAmbigs {
|
class UnicharAmbigs {
|
||||||
public:
|
public:
|
||||||
UnicharAmbigs() {}
|
UnicharAmbigs() = default;
|
||||||
~UnicharAmbigs() {
|
~UnicharAmbigs() {
|
||||||
replace_ambigs_.delete_data_pointers();
|
replace_ambigs_.delete_data_pointers();
|
||||||
dang_ambigs_.delete_data_pointers();
|
dang_ambigs_.delete_data_pointers();
|
||||||
|
@ -27,10 +27,6 @@ CCUtil::CCUtil() :
|
|||||||
" whether to adapt to a character", ¶ms_) {
|
" whether to adapt to a character", ¶ms_) {
|
||||||
}
|
}
|
||||||
|
|
||||||
CCUtil::~CCUtil() {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
CCUtilMutex::CCUtilMutex() {
|
CCUtilMutex::CCUtilMutex() {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
mutex_ = CreateMutex(0, FALSE, 0);
|
mutex_ = CreateMutex(0, FALSE, 0);
|
||||||
|
@ -51,7 +51,7 @@ class CCUtilMutex {
|
|||||||
class CCUtil {
|
class CCUtil {
|
||||||
public:
|
public:
|
||||||
CCUtil();
|
CCUtil();
|
||||||
virtual ~CCUtil();
|
virtual ~CCUtil() = default;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Read the arguments and set up the data path.
|
// Read the arguments and set up the data path.
|
||||||
|
@ -57,7 +57,7 @@ namespace tesseract {
|
|||||||
template <typename Pair>
|
template <typename Pair>
|
||||||
class GenericHeap {
|
class GenericHeap {
|
||||||
public:
|
public:
|
||||||
GenericHeap() {}
|
GenericHeap() = default;
|
||||||
// The initial size is only a GenericVector::reserve. It is not enforced as
|
// The initial size is only a GenericVector::reserve. It is not enforced as
|
||||||
// the size limit of the heap. Caller must implement their own enforcement.
|
// the size limit of the heap. Caller must implement their own enforcement.
|
||||||
explicit GenericHeap(int initial_size) {
|
explicit GenericHeap(int initial_size) {
|
||||||
|
@ -41,7 +41,7 @@ class IndexMapBiDi;
|
|||||||
// It must be initialized by copying from an IndexMapBiDi or by DeSerialize.
|
// It must be initialized by copying from an IndexMapBiDi or by DeSerialize.
|
||||||
class IndexMap {
|
class IndexMap {
|
||||||
public:
|
public:
|
||||||
virtual ~IndexMap() {}
|
virtual ~IndexMap() = default;
|
||||||
|
|
||||||
// SparseToCompact takes a sparse index to an index in the compact space.
|
// SparseToCompact takes a sparse index to an index in the compact space.
|
||||||
// Uses a binary search to find the result. For faster speed use
|
// Uses a binary search to find the result. For faster speed use
|
||||||
|
@ -32,7 +32,7 @@ namespace tesseract {
|
|||||||
// of simple or smart-pointer data using a separate key. Similar to STL pair.
|
// of simple or smart-pointer data using a separate key. Similar to STL pair.
|
||||||
template <typename Key, typename Data>
|
template <typename Key, typename Data>
|
||||||
struct KDPair {
|
struct KDPair {
|
||||||
KDPair() {}
|
KDPair() = default;
|
||||||
KDPair(Key k, Data d) : data(d), key(k) {}
|
KDPair(Key k, Data d) : data(d), key(k) {}
|
||||||
|
|
||||||
int operator==(const KDPair<Key, Data>& other) const {
|
int operator==(const KDPair<Key, Data>& other) const {
|
||||||
@ -49,7 +49,7 @@ struct KDPair {
|
|||||||
// and recasting of data pointers for use with DoublePtr.
|
// and recasting of data pointers for use with DoublePtr.
|
||||||
template <typename Key, typename Data>
|
template <typename Key, typename Data>
|
||||||
struct KDPairInc : public KDPair<Key, Data> {
|
struct KDPairInc : public KDPair<Key, Data> {
|
||||||
KDPairInc() {}
|
KDPairInc() = default;
|
||||||
KDPairInc(Key k, Data d) : KDPair<Key, Data>(k, d) {}
|
KDPairInc(Key k, Data d) : KDPair<Key, Data>(k, d) {}
|
||||||
// Operator< facilitates sorting in increasing order.
|
// Operator< facilitates sorting in increasing order.
|
||||||
int operator<(const KDPairInc<Key, Data>& other) const {
|
int operator<(const KDPairInc<Key, Data>& other) const {
|
||||||
@ -65,7 +65,7 @@ struct KDPairInc : public KDPair<Key, Data> {
|
|||||||
// and recasting of data pointers for use with DoublePtr.
|
// and recasting of data pointers for use with DoublePtr.
|
||||||
template <typename Key, typename Data>
|
template <typename Key, typename Data>
|
||||||
struct KDPairDec : public KDPair<Key, Data> {
|
struct KDPairDec : public KDPair<Key, Data> {
|
||||||
KDPairDec() {}
|
KDPairDec() = default;
|
||||||
KDPairDec(Key k, Data d) : KDPair<Key, Data>(k, d) {}
|
KDPairDec(Key k, Data d) : KDPair<Key, Data>(k, d) {}
|
||||||
// Operator< facilitates sorting in decreasing order by using operator> on
|
// Operator< facilitates sorting in decreasing order by using operator> on
|
||||||
// the key values.
|
// the key values.
|
||||||
|
@ -34,7 +34,7 @@ namespace tesseract {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
class ObjectCache {
|
class ObjectCache {
|
||||||
public:
|
public:
|
||||||
ObjectCache() {}
|
ObjectCache() = default;
|
||||||
~ObjectCache() {
|
~ObjectCache() {
|
||||||
mu_.Lock();
|
mu_.Lock();
|
||||||
for (int i = 0; i < cache_.size(); i++) {
|
for (int i = 0; i < cache_.size(); i++) {
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#else
|
#else
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <time.h>
|
#include <ctime>
|
||||||
#include "host.h"
|
#include "host.h"
|
||||||
|
|
||||||
/*Maximum lengths of various strings*/
|
/*Maximum lengths of various strings*/
|
||||||
|
@ -111,7 +111,7 @@ class ParamUtils {
|
|||||||
// Definition of various parameter types.
|
// Definition of various parameter types.
|
||||||
class Param {
|
class Param {
|
||||||
public:
|
public:
|
||||||
~Param() {}
|
~Param() = default;
|
||||||
|
|
||||||
const char *name_str() const { return name_; }
|
const char *name_str() const { return name_; }
|
||||||
const char *info_str() const { return info_; }
|
const char *info_str() const { return info_; }
|
||||||
|
@ -49,7 +49,7 @@ class TESS_API STRING
|
|||||||
STRING(const STRING &string);
|
STRING(const STRING &string);
|
||||||
STRING(const char *string);
|
STRING(const char *string);
|
||||||
STRING(const char *data, int length);
|
STRING(const char *data, int length);
|
||||||
~STRING ();
|
~STRING();
|
||||||
|
|
||||||
// Writes to the given file. Returns false in case of error.
|
// Writes to the given file. Returns false in case of error.
|
||||||
bool Serialize(FILE* fp) const;
|
bool Serialize(FILE* fp) const;
|
||||||
|
@ -128,7 +128,7 @@ class TessdataManager {
|
|||||||
TessdataManager();
|
TessdataManager();
|
||||||
explicit TessdataManager(FileReader reader);
|
explicit TessdataManager(FileReader reader);
|
||||||
|
|
||||||
~TessdataManager() {}
|
~TessdataManager() = default;
|
||||||
|
|
||||||
bool swap() const { return swap_; }
|
bool swap() const { return swap_; }
|
||||||
bool is_loaded() const { return is_loaded_; }
|
bool is_loaded() const { return is_loaded_; }
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <assert.h>
|
#include <cassert>
|
||||||
#include "unichar.h"
|
#include "unichar.h"
|
||||||
#include "host.h"
|
#include "host.h"
|
||||||
#include "unicharmap.h"
|
#include "unicharmap.h"
|
||||||
|
@ -163,8 +163,6 @@ ErrorCounter::ErrorCounter(const UNICHARSET& unicharset, int fontsize)
|
|||||||
font_counts_.init_to_size(fontsize, empty_counts);
|
font_counts_.init_to_size(fontsize, empty_counts);
|
||||||
multi_unichar_counts_.init_to_size(unicharset.size(), 0);
|
multi_unichar_counts_.init_to_size(unicharset.size(), 0);
|
||||||
}
|
}
|
||||||
ErrorCounter::~ErrorCounter() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Accumulates the errors from the classifier results on a single sample.
|
// Accumulates the errors from the classifier results on a single sample.
|
||||||
// Returns true if debug is true and a CT_UNICHAR_TOPN_ERR error occurred.
|
// Returns true if debug is true and a CT_UNICHAR_TOPN_ERR error occurred.
|
||||||
|
@ -153,7 +153,7 @@ class ErrorCounter {
|
|||||||
// Constructor is private. Only anticipated use of ErrorCounter is via
|
// Constructor is private. Only anticipated use of ErrorCounter is via
|
||||||
// the static ComputeErrorRate.
|
// the static ComputeErrorRate.
|
||||||
ErrorCounter(const UNICHARSET& unicharset, int fontsize);
|
ErrorCounter(const UNICHARSET& unicharset, int fontsize);
|
||||||
~ErrorCounter();
|
~ErrorCounter() = default;
|
||||||
|
|
||||||
// Accumulates the errors from the classifier results on a single sample.
|
// Accumulates the errors from the classifier results on a single sample.
|
||||||
// Returns true if debug is true and a CT_UNICHAR_TOPN_ERR error occurred.
|
// Returns true if debug is true and a CT_UNICHAR_TOPN_ERR error occurred.
|
||||||
|
@ -93,7 +93,7 @@ class IntegerMatcher {
|
|||||||
// Center of Similarity Curve.
|
// Center of Similarity Curve.
|
||||||
static const float kSimilarityCenter;
|
static const float kSimilarityCenter;
|
||||||
|
|
||||||
IntegerMatcher() : classify_debug_level_(0) {}
|
IntegerMatcher() : classify_debug_level_(nullptr) {}
|
||||||
|
|
||||||
void Init(tesseract::IntParam *classify_debug_level);
|
void Init(tesseract::IntParam *classify_debug_level);
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ struct UnicharRating;
|
|||||||
// Interface base class for classifiers that produce ShapeRating results.
|
// Interface base class for classifiers that produce ShapeRating results.
|
||||||
class ShapeClassifier {
|
class ShapeClassifier {
|
||||||
public:
|
public:
|
||||||
virtual ~ShapeClassifier() {}
|
virtual ~ShapeClassifier() = default;
|
||||||
|
|
||||||
// Classifies the given [training] sample, writing to results.
|
// Classifies the given [training] sample, writing to results.
|
||||||
// If page_pix is not nullptr, the overriding function may call
|
// If page_pix is not nullptr, the overriding function may call
|
||||||
|
@ -37,7 +37,7 @@ class TessClassifier : public ShapeClassifier {
|
|||||||
public:
|
public:
|
||||||
TessClassifier(bool pruner_only, tesseract::Classify* classify)
|
TessClassifier(bool pruner_only, tesseract::Classify* classify)
|
||||||
: pruner_only_(pruner_only), classify_(classify) {}
|
: pruner_only_(pruner_only), classify_(classify) {}
|
||||||
virtual ~TessClassifier() {}
|
virtual ~TessClassifier() = default;
|
||||||
|
|
||||||
// Classifies the given [training] sample, writing to results.
|
// Classifies the given [training] sample, writing to results.
|
||||||
// See ShapeClassifier for a full description.
|
// See ShapeClassifier for a full description.
|
||||||
|
@ -20,10 +20,4 @@
|
|||||||
|
|
||||||
namespace tesseract {
|
namespace tesseract {
|
||||||
|
|
||||||
CUtil::CUtil() {
|
|
||||||
}
|
|
||||||
|
|
||||||
CUtil::~CUtil() {
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace tesseract
|
} // namespace tesseract
|
||||||
|
@ -27,8 +27,8 @@ namespace tesseract {
|
|||||||
|
|
||||||
class CUtil : public CCUtil {
|
class CUtil : public CCUtil {
|
||||||
public:
|
public:
|
||||||
CUtil();
|
CUtil() = default;
|
||||||
~CUtil();
|
~CUtil() = default;
|
||||||
void read_variables(const char *filename, bool global_only);
|
void read_variables(const char *filename, bool global_only);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ class Dawg {
|
|||||||
inline const STRING &lang() const { return lang_; }
|
inline const STRING &lang() const { return lang_; }
|
||||||
inline PermuterType permuter() const { return perm_; }
|
inline PermuterType permuter() const { return perm_; }
|
||||||
|
|
||||||
virtual ~Dawg() {}
|
virtual ~Dawg() = default;
|
||||||
|
|
||||||
/// Returns true if the given word is in the Dawg.
|
/// Returns true if the given word is in the Dawg.
|
||||||
bool word_in_dawg(const WERD_CHOICE &word) const;
|
bool word_in_dawg(const WERD_CHOICE &word) const;
|
||||||
|
@ -30,9 +30,6 @@ Convolve::Convolve(const STRING& name, int ni, int half_x, int half_y)
|
|||||||
half_x_(half_x), half_y_(half_y) {
|
half_x_(half_x), half_y_(half_y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Convolve::~Convolve() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Writes to the given file. Returns false in case of error.
|
// Writes to the given file. Returns false in case of error.
|
||||||
bool Convolve::Serialize(TFile* fp) const {
|
bool Convolve::Serialize(TFile* fp) const {
|
||||||
if (!Network::Serialize(fp)) return false;
|
if (!Network::Serialize(fp)) return false;
|
||||||
|
@ -35,7 +35,7 @@ class Convolve : public Network {
|
|||||||
// The area of convolution is 2*half_x + 1 by 2*half_y + 1, forcing it to
|
// The area of convolution is 2*half_x + 1 by 2*half_y + 1, forcing it to
|
||||||
// always be odd, so the center is the current pixel.
|
// always be odd, so the center is the current pixel.
|
||||||
Convolve(const STRING& name, int ni, int half_x, int half_y);
|
Convolve(const STRING& name, int ni, int half_x, int half_y);
|
||||||
virtual ~Convolve();
|
virtual ~Convolve() = default;
|
||||||
|
|
||||||
STRING spec() const override {
|
STRING spec() const override {
|
||||||
STRING spec;
|
STRING spec;
|
||||||
|
@ -41,9 +41,6 @@ FullyConnected::FullyConnected(const STRING& name, int ni, int no,
|
|||||||
: Network(type, name, ni, no), external_source_(nullptr), int_mode_(false) {
|
: Network(type, name, ni, no), external_source_(nullptr), int_mode_(false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
FullyConnected::~FullyConnected() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns the shape output from the network given an input shape (which may
|
// Returns the shape output from the network given an input shape (which may
|
||||||
// be partially unknown ie zero).
|
// be partially unknown ie zero).
|
||||||
StaticShape FullyConnected::OutputShape(const StaticShape& input_shape) const {
|
StaticShape FullyConnected::OutputShape(const StaticShape& input_shape) const {
|
||||||
|
@ -28,7 +28,7 @@ namespace tesseract {
|
|||||||
class FullyConnected : public Network {
|
class FullyConnected : public Network {
|
||||||
public:
|
public:
|
||||||
FullyConnected(const STRING& name, int ni, int no, NetworkType type);
|
FullyConnected(const STRING& name, int ni, int no, NetworkType type);
|
||||||
virtual ~FullyConnected();
|
virtual ~FullyConnected() = default;
|
||||||
|
|
||||||
// Returns the shape output from the network given an input shape (which may
|
// Returns the shape output from the network given an input shape (which may
|
||||||
// be partially unknown ie zero).
|
// be partially unknown ie zero).
|
||||||
|
@ -37,9 +37,6 @@ Input::Input(const STRING& name, const StaticShape& shape)
|
|||||||
if (shape.height() == 1) ni_ = shape.depth();
|
if (shape.height() == 1) ni_ = shape.depth();
|
||||||
}
|
}
|
||||||
|
|
||||||
Input::~Input() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Writes to the given file. Returns false in case of error.
|
// Writes to the given file. Returns false in case of error.
|
||||||
bool Input::Serialize(TFile* fp) const {
|
bool Input::Serialize(TFile* fp) const {
|
||||||
return Network::Serialize(fp) && shape_.Serialize(fp);
|
return Network::Serialize(fp) && shape_.Serialize(fp);
|
||||||
|
@ -29,7 +29,7 @@ class Input : public Network {
|
|||||||
public:
|
public:
|
||||||
Input(const STRING& name, int ni, int no);
|
Input(const STRING& name, int ni, int no);
|
||||||
Input(const STRING& name, const StaticShape& shape);
|
Input(const STRING& name, const StaticShape& shape);
|
||||||
virtual ~Input();
|
virtual ~Input() = default;
|
||||||
|
|
||||||
STRING spec() const override {
|
STRING spec() const override {
|
||||||
STRING spec;
|
STRING spec;
|
||||||
|
@ -27,9 +27,6 @@ Maxpool::Maxpool(const STRING& name, int ni, int x_scale, int y_scale)
|
|||||||
no_ = ni;
|
no_ = ni;
|
||||||
}
|
}
|
||||||
|
|
||||||
Maxpool::~Maxpool() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reads from the given file. Returns false in case of error.
|
// Reads from the given file. Returns false in case of error.
|
||||||
bool Maxpool::DeSerialize(TFile* fp) {
|
bool Maxpool::DeSerialize(TFile* fp) {
|
||||||
bool result = Reconfig::DeSerialize(fp);
|
bool result = Reconfig::DeSerialize(fp);
|
||||||
|
@ -29,7 +29,7 @@ namespace tesseract {
|
|||||||
class Maxpool : public Reconfig {
|
class Maxpool : public Reconfig {
|
||||||
public:
|
public:
|
||||||
Maxpool(const STRING& name, int ni, int x_scale, int y_scale);
|
Maxpool(const STRING& name, int ni, int x_scale, int y_scale);
|
||||||
virtual ~Maxpool();
|
virtual ~Maxpool() = default;
|
||||||
|
|
||||||
// Accessors.
|
// Accessors.
|
||||||
STRING spec() const override {
|
STRING spec() const override {
|
||||||
|
@ -97,8 +97,6 @@ Network::Network(NetworkType type, const STRING& name, int ni, int no)
|
|||||||
backward_win_(nullptr),
|
backward_win_(nullptr),
|
||||||
randomizer_(nullptr) {}
|
randomizer_(nullptr) {}
|
||||||
|
|
||||||
Network::~Network() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Suspends/Enables/Permanently disables training by setting the training_
|
// Suspends/Enables/Permanently disables training by setting the training_
|
||||||
// flag. Serialize and DeSerialize only operate on the run-time data if state
|
// flag. Serialize and DeSerialize only operate on the run-time data if state
|
||||||
|
@ -106,7 +106,7 @@ class Network {
|
|||||||
public:
|
public:
|
||||||
Network();
|
Network();
|
||||||
Network(NetworkType type, const STRING& name, int ni, int no);
|
Network(NetworkType type, const STRING& name, int ni, int no);
|
||||||
virtual ~Network();
|
virtual ~Network() = default;
|
||||||
|
|
||||||
// Accessors.
|
// Accessors.
|
||||||
NetworkType type() const {
|
NetworkType type() const {
|
||||||
|
@ -36,7 +36,7 @@ namespace tesseract {
|
|||||||
class NetworkScratch {
|
class NetworkScratch {
|
||||||
public:
|
public:
|
||||||
NetworkScratch() : int_mode_(false) {}
|
NetworkScratch() : int_mode_(false) {}
|
||||||
~NetworkScratch() {}
|
~NetworkScratch() = default;
|
||||||
|
|
||||||
// Sets the network representation. If the representation is integer, then
|
// Sets the network representation. If the representation is integer, then
|
||||||
// default (integer) NetworkIOs are separated from the always-float variety.
|
// default (integer) NetworkIOs are separated from the always-float variety.
|
||||||
|
@ -32,9 +32,6 @@ Parallel::Parallel(const STRING& name, NetworkType type) : Plumbing(name) {
|
|||||||
type_ = type;
|
type_ = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
Parallel::~Parallel() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns the shape output from the network given an input shape (which may
|
// Returns the shape output from the network given an input shape (which may
|
||||||
// be partially unknown ie zero).
|
// be partially unknown ie zero).
|
||||||
StaticShape Parallel::OutputShape(const StaticShape& input_shape) const {
|
StaticShape Parallel::OutputShape(const StaticShape& input_shape) const {
|
||||||
|
@ -28,7 +28,7 @@ class Parallel : public Plumbing {
|
|||||||
public:
|
public:
|
||||||
// ni_ and no_ will be set by AddToStack.
|
// ni_ and no_ will be set by AddToStack.
|
||||||
Parallel(const STRING& name, NetworkType type);
|
Parallel(const STRING& name, NetworkType type);
|
||||||
virtual ~Parallel();
|
virtual ~Parallel() = default;
|
||||||
|
|
||||||
// Returns the shape output from the network given an input shape (which may
|
// Returns the shape output from the network given an input shape (which may
|
||||||
// be partially unknown ie zero).
|
// be partially unknown ie zero).
|
||||||
|
@ -26,9 +26,6 @@ Plumbing::Plumbing(const STRING& name)
|
|||||||
: Network(NT_PARALLEL, name, 0, 0) {
|
: Network(NT_PARALLEL, name, 0, 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Plumbing::~Plumbing() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Suspends/Enables training by setting the training_ flag. Serialize and
|
// Suspends/Enables training by setting the training_ flag. Serialize and
|
||||||
// DeSerialize only operate on the run-time data if state is false.
|
// DeSerialize only operate on the run-time data if state is false.
|
||||||
void Plumbing::SetEnableTraining(TrainingState state) {
|
void Plumbing::SetEnableTraining(TrainingState state) {
|
||||||
|
@ -31,7 +31,7 @@ class Plumbing : public Network {
|
|||||||
public:
|
public:
|
||||||
// ni_ and no_ will be set by AddToStack.
|
// ni_ and no_ will be set by AddToStack.
|
||||||
explicit Plumbing(const STRING& name);
|
explicit Plumbing(const STRING& name);
|
||||||
virtual ~Plumbing();
|
virtual ~Plumbing() = default;
|
||||||
|
|
||||||
// Returns the required shape input to the network.
|
// Returns the required shape input to the network.
|
||||||
StaticShape InputShape() const override { return stack_[0]->InputShape(); }
|
StaticShape InputShape() const override { return stack_[0]->InputShape(); }
|
||||||
|
@ -26,9 +26,6 @@ Reconfig::Reconfig(const STRING& name, int ni, int x_scale, int y_scale)
|
|||||||
x_scale_(x_scale), y_scale_(y_scale) {
|
x_scale_(x_scale), y_scale_(y_scale) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Reconfig::~Reconfig() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns the shape output from the network given an input shape (which may
|
// Returns the shape output from the network given an input shape (which may
|
||||||
// be partially unknown ie zero).
|
// be partially unknown ie zero).
|
||||||
StaticShape Reconfig::OutputShape(const StaticShape& input_shape) const {
|
StaticShape Reconfig::OutputShape(const StaticShape& input_shape) const {
|
||||||
|
@ -33,7 +33,7 @@ namespace tesseract {
|
|||||||
class Reconfig : public Network {
|
class Reconfig : public Network {
|
||||||
public:
|
public:
|
||||||
Reconfig(const STRING& name, int ni, int x_scale, int y_scale);
|
Reconfig(const STRING& name, int ni, int x_scale, int y_scale);
|
||||||
virtual ~Reconfig();
|
virtual ~Reconfig() = default;
|
||||||
|
|
||||||
// Returns the shape output from the network given an input shape (which may
|
// Returns the shape output from the network given an input shape (which may
|
||||||
// be partially unknown ie zero).
|
// be partially unknown ie zero).
|
||||||
|
@ -27,8 +27,6 @@ namespace tesseract {
|
|||||||
Reversed::Reversed(const STRING& name, NetworkType type) : Plumbing(name) {
|
Reversed::Reversed(const STRING& name, NetworkType type) : Plumbing(name) {
|
||||||
type_ = type;
|
type_ = type;
|
||||||
}
|
}
|
||||||
Reversed::~Reversed() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns the shape output from the network given an input shape (which may
|
// Returns the shape output from the network given an input shape (which may
|
||||||
// be partially unknown ie zero).
|
// be partially unknown ie zero).
|
||||||
|
@ -28,7 +28,7 @@ namespace tesseract {
|
|||||||
class Reversed : public Plumbing {
|
class Reversed : public Plumbing {
|
||||||
public:
|
public:
|
||||||
explicit Reversed(const STRING& name, NetworkType type);
|
explicit Reversed(const STRING& name, NetworkType type);
|
||||||
virtual ~Reversed();
|
virtual ~Reversed() = default;
|
||||||
|
|
||||||
// Returns the shape output from the network given an input shape (which may
|
// Returns the shape output from the network given an input shape (which may
|
||||||
// be partially unknown ie zero).
|
// be partially unknown ie zero).
|
||||||
|
@ -30,9 +30,6 @@ Series::Series(const STRING& name) : Plumbing(name) {
|
|||||||
type_ = NT_SERIES;
|
type_ = NT_SERIES;
|
||||||
}
|
}
|
||||||
|
|
||||||
Series::~Series() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns the shape output from the network given an input shape (which may
|
// Returns the shape output from the network given an input shape (which may
|
||||||
// be partially unknown ie zero).
|
// be partially unknown ie zero).
|
||||||
StaticShape Series::OutputShape(const StaticShape& input_shape) const {
|
StaticShape Series::OutputShape(const StaticShape& input_shape) const {
|
||||||
|
@ -28,7 +28,7 @@ class Series : public Plumbing {
|
|||||||
public:
|
public:
|
||||||
// ni_ and no_ will be set by AddToStack.
|
// ni_ and no_ will be set by AddToStack.
|
||||||
explicit Series(const STRING& name);
|
explicit Series(const STRING& name);
|
||||||
virtual ~Series();
|
virtual ~Series() = default;
|
||||||
|
|
||||||
// Returns the shape output from the network given an input shape (which may
|
// Returns the shape output from the network given an input shape (which may
|
||||||
// be partially unknown ie zero).
|
// be partially unknown ie zero).
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#ifndef TESSERACT_LSTM_STRIDEMAP_H_
|
#ifndef TESSERACT_LSTM_STRIDEMAP_H_
|
||||||
#define TESSERACT_LSTM_STRIDEMAP_H_
|
#define TESSERACT_LSTM_STRIDEMAP_H_
|
||||||
|
|
||||||
#include <string.h>
|
#include <cstring>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "tprintf.h"
|
#include "tprintf.h"
|
||||||
|
|
||||||
|
@ -32,8 +32,6 @@ namespace tesseract {
|
|||||||
|
|
||||||
TFNetwork::TFNetwork(const STRING& name) : Network(NT_TENSORFLOW, name, 0, 0) {}
|
TFNetwork::TFNetwork(const STRING& name) : Network(NT_TENSORFLOW, name, 0, 0) {}
|
||||||
|
|
||||||
TFNetwork::~TFNetwork() {}
|
|
||||||
|
|
||||||
int TFNetwork::InitFromProtoStr(const string& proto_str) {
|
int TFNetwork::InitFromProtoStr(const string& proto_str) {
|
||||||
if (!model_proto_.ParseFromString(proto_str)) return 0;
|
if (!model_proto_.ParseFromString(proto_str)) return 0;
|
||||||
return InitFromProto();
|
return InitFromProto();
|
||||||
|
@ -36,7 +36,7 @@ namespace tesseract {
|
|||||||
class TFNetwork : public Network {
|
class TFNetwork : public Network {
|
||||||
public:
|
public:
|
||||||
explicit TFNetwork(const STRING& name);
|
explicit TFNetwork(const STRING& name);
|
||||||
virtual ~TFNetwork();
|
virtual ~TFNetwork() = default;
|
||||||
|
|
||||||
// Returns the required shape input to the network.
|
// Returns the required shape input to the network.
|
||||||
StaticShape InputShape() const override { return input_shape_; }
|
StaticShape InputShape() const override { return input_shape_; }
|
||||||
|
@ -147,9 +147,6 @@ AlignedBlob::AlignedBlob(int gridsize,
|
|||||||
: BlobGrid(gridsize, bleft, tright) {
|
: BlobGrid(gridsize, bleft, tright) {
|
||||||
}
|
}
|
||||||
|
|
||||||
AlignedBlob::~AlignedBlob() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return true if the given coordinates are within the test rectangle
|
// Return true if the given coordinates are within the test rectangle
|
||||||
// and the debug level is at least the given detail level.
|
// and the debug level is at least the given detail level.
|
||||||
bool AlignedBlob::WithinTestRegion(int detail_level, int x, int y) {
|
bool AlignedBlob::WithinTestRegion(int detail_level, int x, int y) {
|
||||||
|
@ -81,7 +81,7 @@ struct AlignedBlobParams {
|
|||||||
class AlignedBlob : public BlobGrid {
|
class AlignedBlob : public BlobGrid {
|
||||||
public:
|
public:
|
||||||
AlignedBlob(int gridsize, const ICOORD& bleft, const ICOORD& tright);
|
AlignedBlob(int gridsize, const ICOORD& bleft, const ICOORD& tright);
|
||||||
virtual ~AlignedBlob();
|
virtual ~AlignedBlob() = default;
|
||||||
|
|
||||||
// Return true if the given coordinates are within the test rectangle
|
// Return true if the given coordinates are within the test rectangle
|
||||||
// and the debug level is at least the given detail level.
|
// and the debug level is at least the given detail level.
|
||||||
|
@ -808,9 +808,6 @@ BaselineDetect::BaselineDetect(int debug_level, const FCOORD& page_skew,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BaselineDetect::~BaselineDetect() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Finds the initial baselines for each TO_ROW in each TO_BLOCK, gathers
|
// Finds the initial baselines for each TO_ROW in each TO_BLOCK, gathers
|
||||||
// block-wise and page-wise data to smooth small blocks/rows, and applies
|
// block-wise and page-wise data to smooth small blocks/rows, and applies
|
||||||
// smoothing based on block/page-level skew and block-level linespacing.
|
// smoothing based on block/page-level skew and block-level linespacing.
|
||||||
|
@ -244,7 +244,7 @@ class BaselineDetect {
|
|||||||
BaselineDetect(int debug_level, const FCOORD& page_skew,
|
BaselineDetect(int debug_level, const FCOORD& page_skew,
|
||||||
TO_BLOCK_LIST* blocks);
|
TO_BLOCK_LIST* blocks);
|
||||||
|
|
||||||
~BaselineDetect();
|
~BaselineDetect() = default;
|
||||||
|
|
||||||
// Finds the initial baselines for each TO_ROW in each TO_BLOCK, gathers
|
// Finds the initial baselines for each TO_ROW in each TO_BLOCK, gathers
|
||||||
// block-wise and page-wise data to smooth small blocks/rows, and applies
|
// block-wise and page-wise data to smooth small blocks/rows, and applies
|
||||||
|
@ -27,16 +27,10 @@ namespace tesseract {
|
|||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
// BBGrid IMPLEMENTATION.
|
// BBGrid IMPLEMENTATION.
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
GridBase::GridBase() {
|
|
||||||
}
|
|
||||||
|
|
||||||
GridBase::GridBase(int gridsize, const ICOORD& bleft, const ICOORD& tright) {
|
GridBase::GridBase(int gridsize, const ICOORD& bleft, const ICOORD& tright) {
|
||||||
Init(gridsize, bleft, tright);
|
Init(gridsize, bleft, tright);
|
||||||
}
|
}
|
||||||
|
|
||||||
GridBase::~GridBase() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// (Re)Initialize the grid. The gridsize is the size in pixels of each cell,
|
// (Re)Initialize the grid. The gridsize is the size in pixels of each cell,
|
||||||
// and bleft, tright are the bounding box of everything to go in it.
|
// and bleft, tright are the bounding box of everything to go in it.
|
||||||
void GridBase::Init(int gridsize, const ICOORD& bleft, const ICOORD& tright) {
|
void GridBase::Init(int gridsize, const ICOORD& bleft, const ICOORD& tright) {
|
||||||
|
@ -52,9 +52,9 @@ template<class BBC, class BBC_CLIST, class BBC_C_IT> class GridSearch;
|
|||||||
// It holds the geometry and scale of the grid.
|
// It holds the geometry and scale of the grid.
|
||||||
class GridBase {
|
class GridBase {
|
||||||
public:
|
public:
|
||||||
GridBase();
|
GridBase() = default;
|
||||||
GridBase(int gridsize, const ICOORD& bleft, const ICOORD& tright);
|
GridBase(int gridsize, const ICOORD& bleft, const ICOORD& tright);
|
||||||
virtual ~GridBase();
|
virtual ~GridBase() = default;
|
||||||
|
|
||||||
// (Re)Initialize the grid. The gridsize is the size in pixels of each cell,
|
// (Re)Initialize the grid. The gridsize is the size in pixels of each cell,
|
||||||
// and bleft, tright are the bounding box of everything to go in it.
|
// and bleft, tright are the bounding box of everything to go in it.
|
||||||
|
@ -52,7 +52,7 @@ class REGION_OCC:public ELIST_LINK
|
|||||||
float max_x; //Highest x in region
|
float max_x; //Highest x in region
|
||||||
int16_t region_type; //Type of crossing
|
int16_t region_type; //Type of crossing
|
||||||
|
|
||||||
REGION_OCC() {} // constructor used
|
REGION_OCC() = default; // constructor used
|
||||||
// only in COPIER etc
|
// only in COPIER etc
|
||||||
REGION_OCC( //constructor
|
REGION_OCC( //constructor
|
||||||
float min,
|
float min,
|
||||||
@ -133,8 +133,7 @@ class BAND
|
|||||||
int16_t min; //nominal min
|
int16_t min; //nominal min
|
||||||
int16_t min_min; //lower min
|
int16_t min_min; //lower min
|
||||||
|
|
||||||
BAND() {
|
BAND() = default; // constructor
|
||||||
} // constructor
|
|
||||||
|
|
||||||
void set( // initialise a band
|
void set( // initialise a band
|
||||||
int16_t new_max_max, // upper max
|
int16_t new_max_max, // upper max
|
||||||
|
@ -25,9 +25,6 @@ BlobGrid::BlobGrid(int gridsize, const ICOORD& bleft, const ICOORD& tright)
|
|||||||
: BBGrid<BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT>(gridsize, bleft, tright) {
|
: BBGrid<BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT>(gridsize, bleft, tright) {
|
||||||
}
|
}
|
||||||
|
|
||||||
BlobGrid::~BlobGrid() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Inserts all the blobs from the given list, with x and y spreading,
|
// Inserts all the blobs from the given list, with x and y spreading,
|
||||||
// without removing from the source list, so ownership remains with the
|
// without removing from the source list, so ownership remains with the
|
||||||
// source list.
|
// source list.
|
||||||
|
@ -33,7 +33,7 @@ using BlobGridSearch = GridSearch<BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT>;
|
|||||||
class BlobGrid : public BBGrid<BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT> {
|
class BlobGrid : public BBGrid<BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT> {
|
||||||
public:
|
public:
|
||||||
BlobGrid(int gridsize, const ICOORD& bleft, const ICOORD& tright);
|
BlobGrid(int gridsize, const ICOORD& bleft, const ICOORD& tright);
|
||||||
virtual ~BlobGrid();
|
virtual ~BlobGrid() = default;
|
||||||
|
|
||||||
// Inserts all the blobs from the given list, with x and y spreading,
|
// Inserts all the blobs from the given list, with x and y spreading,
|
||||||
// without removing from the source list, so ownership remains with the
|
// without removing from the source list, so ownership remains with the
|
||||||
|
@ -68,11 +68,11 @@ CLISTIZEH(ColPartition)
|
|||||||
*/
|
*/
|
||||||
class ColPartition : public ELIST2_LINK {
|
class ColPartition : public ELIST2_LINK {
|
||||||
public:
|
public:
|
||||||
ColPartition() {
|
// This empty constructor is here only so that the class can be ELISTIZED.
|
||||||
// This empty constructor is here only so that the class can be ELISTIZED.
|
// TODO(rays) change deep_copy in elst.h line 955 to take a callback copier
|
||||||
// TODO(rays) change deep_copy in elst.h line 955 to take a callback copier
|
// and eliminate CLASSNAME##_copier.
|
||||||
// and eliminate CLASSNAME##_copier.
|
ColPartition() = default;
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @param blob_type is the blob_region_type_ of the blobs in this partition.
|
* @param blob_type is the blob_region_type_ of the blobs in this partition.
|
||||||
* @param vertical is the direction of logical vertical on the possibly skewed image.
|
* @param vertical is the direction of logical vertical on the possibly skewed image.
|
||||||
|
@ -66,17 +66,12 @@ const double kMaxPartitionSpacing = 1.75;
|
|||||||
// decision in GridSmoothNeighbour.
|
// decision in GridSmoothNeighbour.
|
||||||
const int kSmoothDecisionMargin = 4;
|
const int kSmoothDecisionMargin = 4;
|
||||||
|
|
||||||
ColPartitionGrid::ColPartitionGrid() {
|
|
||||||
}
|
|
||||||
ColPartitionGrid::ColPartitionGrid(int gridsize,
|
ColPartitionGrid::ColPartitionGrid(int gridsize,
|
||||||
const ICOORD& bleft, const ICOORD& tright)
|
const ICOORD& bleft, const ICOORD& tright)
|
||||||
: BBGrid<ColPartition, ColPartition_CLIST, ColPartition_C_IT>(gridsize,
|
: BBGrid<ColPartition, ColPartition_CLIST, ColPartition_C_IT>(gridsize,
|
||||||
bleft, tright) {
|
bleft, tright) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ColPartitionGrid::~ColPartitionGrid() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handles a click event in a display window.
|
// Handles a click event in a display window.
|
||||||
void ColPartitionGrid::HandleClick(int x, int y) {
|
void ColPartitionGrid::HandleClick(int x, int y) {
|
||||||
BBGrid<ColPartition,
|
BBGrid<ColPartition,
|
||||||
|
@ -34,10 +34,10 @@ class ColPartitionGrid : public BBGrid<ColPartition,
|
|||||||
ColPartition_CLIST,
|
ColPartition_CLIST,
|
||||||
ColPartition_C_IT> {
|
ColPartition_C_IT> {
|
||||||
public:
|
public:
|
||||||
ColPartitionGrid();
|
ColPartitionGrid() = default;
|
||||||
ColPartitionGrid(int gridsize, const ICOORD& bleft, const ICOORD& tright);
|
ColPartitionGrid(int gridsize, const ICOORD& bleft, const ICOORD& tright);
|
||||||
|
|
||||||
virtual ~ColPartitionGrid();
|
virtual ~ColPartitionGrid() = default;
|
||||||
|
|
||||||
// Handles a click event in a display window.
|
// Handles a click event in a display window.
|
||||||
void HandleClick(int x, int y);
|
void HandleClick(int x, int y);
|
||||||
|
@ -46,9 +46,6 @@ ColPartitionSet::ColPartitionSet(ColPartition* part) {
|
|||||||
ComputeCoverage();
|
ComputeCoverage();
|
||||||
}
|
}
|
||||||
|
|
||||||
ColPartitionSet::~ColPartitionSet() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns the number of columns of good width.
|
// Returns the number of columns of good width.
|
||||||
int ColPartitionSet::GoodColumnCount() const {
|
int ColPartitionSet::GoodColumnCount() const {
|
||||||
int num_good_cols = 0;
|
int num_good_cols = 0;
|
||||||
|
@ -39,12 +39,11 @@ using PartSetVector = GenericVector<ColPartitionSet*>;
|
|||||||
// ColPartitionSets are used in building the column layout of a page.
|
// ColPartitionSets are used in building the column layout of a page.
|
||||||
class ColPartitionSet : public ELIST_LINK {
|
class ColPartitionSet : public ELIST_LINK {
|
||||||
public:
|
public:
|
||||||
ColPartitionSet() {
|
ColPartitionSet() = default;
|
||||||
}
|
|
||||||
explicit ColPartitionSet(ColPartition_LIST* partitions);
|
explicit ColPartitionSet(ColPartition_LIST* partitions);
|
||||||
explicit ColPartitionSet(ColPartition* partition);
|
explicit ColPartitionSet(ColPartition* partition);
|
||||||
|
|
||||||
~ColPartitionSet();
|
~ColPartitionSet() = default;
|
||||||
|
|
||||||
// Simple accessors.
|
// Simple accessors.
|
||||||
const TBOX& bounding_box() const {
|
const TBOX& bounding_box() const {
|
||||||
|
@ -23,12 +23,6 @@
|
|||||||
|
|
||||||
namespace tesseract {
|
namespace tesseract {
|
||||||
|
|
||||||
EquationDetectBase::EquationDetectBase() {
|
|
||||||
}
|
|
||||||
|
|
||||||
EquationDetectBase::~EquationDetectBase() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void EquationDetectBase::RenderSpecialText(Pix* pix,
|
void EquationDetectBase::RenderSpecialText(Pix* pix,
|
||||||
BLOBNBOX* blob) {
|
BLOBNBOX* blob) {
|
||||||
ASSERT_HOST(pix != nullptr && pixGetDepth(pix) == 32 && blob != nullptr);
|
ASSERT_HOST(pix != nullptr && pixGetDepth(pix) == 32 && blob != nullptr);
|
||||||
|
@ -31,8 +31,8 @@ class ColPartitionSet;
|
|||||||
|
|
||||||
class EquationDetectBase {
|
class EquationDetectBase {
|
||||||
public:
|
public:
|
||||||
EquationDetectBase();
|
EquationDetectBase() = default;
|
||||||
virtual ~EquationDetectBase();
|
virtual ~EquationDetectBase() = default;
|
||||||
|
|
||||||
// Iterate over the blobs inside to_block, and set the blobs that we want to
|
// Iterate over the blobs inside to_block, and set the blobs that we want to
|
||||||
// process to BSTT_NONE. (By default, they should be BSTT_SKIP). The function
|
// process to BSTT_NONE. (By default, they should be BSTT_SKIP). The function
|
||||||
|
@ -29,8 +29,7 @@ class FPSEGPT_LIST;
|
|||||||
class FPCUTPT
|
class FPCUTPT
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FPCUTPT() { //empty
|
FPCUTPT() = default;
|
||||||
}
|
|
||||||
void setup ( //start of cut
|
void setup ( //start of cut
|
||||||
FPCUTPT cutpts[], //predecessors
|
FPCUTPT cutpts[], //predecessors
|
||||||
int16_t array_origin, //start coord
|
int16_t array_origin, //start coord
|
||||||
|
@ -32,8 +32,7 @@ class FPSEGPT_LIST;
|
|||||||
class FPSEGPT:public ELIST_LINK
|
class FPSEGPT:public ELIST_LINK
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FPSEGPT() { //empty
|
FPSEGPT() = default;
|
||||||
}
|
|
||||||
FPSEGPT( //constructor
|
FPSEGPT( //constructor
|
||||||
int16_t x); //position
|
int16_t x); //position
|
||||||
FPSEGPT( //constructor
|
FPSEGPT( //constructor
|
||||||
|
@ -27,8 +27,7 @@ class SORTED_FLOAT:public ELIST_LINK
|
|||||||
friend class SORTED_FLOATS;
|
friend class SORTED_FLOATS;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SORTED_FLOAT() {
|
SORTED_FLOAT() = default;
|
||||||
} //empty constructor
|
|
||||||
SORTED_FLOAT( //create one
|
SORTED_FLOAT( //create one
|
||||||
float value, //value of entry
|
float value, //value of entry
|
||||||
int32_t key) { //reference
|
int32_t key) { //reference
|
||||||
|
@ -2066,8 +2066,6 @@ ColSegment::ColSegment()
|
|||||||
num_text_cells_(0),
|
num_text_cells_(0),
|
||||||
type_(COL_UNKNOWN) {
|
type_(COL_UNKNOWN) {
|
||||||
}
|
}
|
||||||
ColSegment::~ColSegment() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Provides a color for BBGrid to draw the rectangle.
|
// Provides a color for BBGrid to draw the rectangle.
|
||||||
ScrollView::Color ColSegment::BoxColor() const {
|
ScrollView::Color ColSegment::BoxColor() const {
|
||||||
|
@ -46,7 +46,7 @@ CLISTIZEH(ColSegment)
|
|||||||
class ColSegment : public ELIST_LINK {
|
class ColSegment : public ELIST_LINK {
|
||||||
public:
|
public:
|
||||||
ColSegment();
|
ColSegment();
|
||||||
~ColSegment();
|
~ColSegment() = default;
|
||||||
|
|
||||||
// Simple accessors and mutators
|
// Simple accessors and mutators
|
||||||
const TBOX& bounding_box() const {
|
const TBOX& bounding_box() const {
|
||||||
|
@ -79,9 +79,6 @@ StructuredTable::StructuredTable()
|
|||||||
max_text_height_(INT32_MAX) {
|
max_text_height_(INT32_MAX) {
|
||||||
}
|
}
|
||||||
|
|
||||||
StructuredTable::~StructuredTable() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void StructuredTable::Init() {
|
void StructuredTable::Init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ namespace tesseract {
|
|||||||
class StructuredTable {
|
class StructuredTable {
|
||||||
public:
|
public:
|
||||||
StructuredTable();
|
StructuredTable();
|
||||||
~StructuredTable();
|
~StructuredTable() = default;
|
||||||
|
|
||||||
// Initialization code. Must be called after the constructor.
|
// Initialization code. Must be called after the constructor.
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -165,9 +165,6 @@ CLISTIZE(TabVector)
|
|||||||
|
|
||||||
// The constructor is private. See the bottom of the file...
|
// The constructor is private. See the bottom of the file...
|
||||||
|
|
||||||
TabVector::~TabVector() {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Public factory to build a TabVector from a list of boxes.
|
// Public factory to build a TabVector from a list of boxes.
|
||||||
// The TabVector will be of the given alignment type.
|
// The TabVector will be of the given alignment type.
|
||||||
|
@ -70,11 +70,10 @@ ELISTIZEH(TabConstraint)
|
|||||||
// by implicit reference counting via the elements of the list.
|
// by implicit reference counting via the elements of the list.
|
||||||
class TabConstraint : public ELIST_LINK {
|
class TabConstraint : public ELIST_LINK {
|
||||||
public:
|
public:
|
||||||
TabConstraint() {
|
// This empty constructor is here only so that the class can be ELISTIZED.
|
||||||
// This empty constructor is here only so that the class can be ELISTIZED.
|
// TODO(rays) change deep_copy in elst.h line 955 to take a callback copier
|
||||||
// TODO(rays) change deep_copy in elst.h line 955 to take a callback copier
|
// and eliminate CLASSNAME##_copier.
|
||||||
// and eliminate CLASSNAME##_copier.
|
TabConstraint() = default;
|
||||||
}
|
|
||||||
|
|
||||||
// Create a constraint for the top or bottom of this TabVector.
|
// Create a constraint for the top or bottom of this TabVector.
|
||||||
static void CreateConstraint(TabVector* vector, bool is_top);
|
static void CreateConstraint(TabVector* vector, bool is_top);
|
||||||
@ -112,11 +111,10 @@ class TabConstraint : public ELIST_LINK {
|
|||||||
// that represents a tab stop or a rule line.
|
// that represents a tab stop or a rule line.
|
||||||
class TabVector : public ELIST2_LINK {
|
class TabVector : public ELIST2_LINK {
|
||||||
public:
|
public:
|
||||||
TabVector() {
|
// TODO(rays) fix this in elst.h line 1076, where it should use the
|
||||||
// TODO(rays) fix this in elst.h line 1076, where it should use the
|
// copy constructor instead of operator=.
|
||||||
// copy constructor instead of operator=.
|
TabVector() = default;
|
||||||
}
|
~TabVector() = default;
|
||||||
~TabVector();
|
|
||||||
|
|
||||||
// Public factory to build a TabVector from a list of boxes.
|
// Public factory to build a TabVector from a list of boxes.
|
||||||
// The TabVector will be of the given alignment type.
|
// The TabVector will be of the given alignment type.
|
||||||
|
@ -226,9 +226,6 @@ Textord::Textord(CCStruct* ccstruct)
|
|||||||
double_MEMBER(textord_blshift_xfraction, 9.99,
|
double_MEMBER(textord_blshift_xfraction, 9.99,
|
||||||
"Min size of baseline shift", ccstruct_->params()) {}
|
"Min size of baseline shift", ccstruct_->params()) {}
|
||||||
|
|
||||||
Textord::~Textord() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make the textlines and words inside each block.
|
// Make the textlines and words inside each block.
|
||||||
void Textord::TextordPage(PageSegMode pageseg_mode, const FCOORD& reskew,
|
void Textord::TextordPage(PageSegMode pageseg_mode, const FCOORD& reskew,
|
||||||
int width, int height, Pix* binary_pix,
|
int width, int height, Pix* binary_pix,
|
||||||
|
@ -68,7 +68,7 @@ using WordSearch = GridSearch<WordWithBox, WordWithBox_CLIST, WordWithBox_C_IT>;
|
|||||||
class Textord {
|
class Textord {
|
||||||
public:
|
public:
|
||||||
explicit Textord(CCStruct* ccstruct);
|
explicit Textord(CCStruct* ccstruct);
|
||||||
~Textord();
|
~Textord() = default;
|
||||||
|
|
||||||
// Make the textlines and words inside each block.
|
// Make the textlines and words inside each block.
|
||||||
// binary_pix is mandatory and is the binarized input after line removal.
|
// binary_pix is mandatory and is the binarized input after line removal.
|
||||||
|
Loading…
Reference in New Issue
Block a user