#include <boxword.h>
Definition at line 37 of file boxword.h.
◆ BoxWord() [1/2]
tesseract::BoxWord::BoxWord |
( |
| ) |
|
◆ BoxWord() [2/2]
tesseract::BoxWord::BoxWord |
( |
const BoxWord & |
src | ) |
|
|
explicit |
Definition at line 36 of file boxword.cpp.
void CopyFrom(const BoxWord &src)
◆ ~BoxWord()
tesseract::BoxWord::~BoxWord |
( |
| ) |
|
|
default |
◆ BlobBox()
const TBOX& tesseract::BoxWord::BlobBox |
( |
int |
index | ) |
const |
|
inline |
◆ bounding_box()
const TBOX& tesseract::BoxWord::bounding_box |
( |
| ) |
const |
|
inline |
◆ ChangeBox()
void tesseract::BoxWord::ChangeBox |
( |
int |
index, |
|
|
const TBOX & |
box |
|
) |
| |
◆ ClipToOriginalWord()
void tesseract::BoxWord::ClipToOriginalWord |
( |
const BLOCK * |
block, |
|
|
WERD * |
original_word |
|
) |
| |
Definition at line 92 of file boxword.cpp.
93 for (
int i = 0; i < length_; ++i) {
101 for (b_it.mark_cycle_pt(); !b_it.cycled_list(); b_it.forward()) {
102 TBOX blob_box = b_it.data()->bounding_box();
103 if (block !=
nullptr)
106 original_box += blob_box;
109 if (!original_box.null_box()) {
112 if (NearlyEqual<int>(original_box.right(), box.
right(),
116 box.
set_top(original_box.top());
117 if (NearlyEqual<int>(original_box.bottom(), box.
bottom(),
122 if (block !=
nullptr)
126 ComputeBoundingBox();
void rotate(const FCOORD &vec)
FCOORD re_rotation() const
TBOX intersection(const TBOX &box) const
TBOX bounding_box() const
bool major_overlap(const TBOX &box) const
const int kBoxClipTolerance
C_BLOB_LIST * cblob_list()
◆ CopyFrom()
void tesseract::BoxWord::CopyFrom |
( |
const BoxWord & |
src | ) |
|
Definition at line 45 of file boxword.cpp.
47 length_ = src.length_;
50 for (
int i = 0; i < length_; ++i)
◆ CopyFromNormalized()
BoxWord * tesseract::BoxWord::CopyFromNormalized |
( |
TWERD * |
tessword | ) |
|
|
static |
Definition at line 56 of file boxword.cpp.
59 boxword->length_ = tessword->
NumBlobs();
61 boxword->boxes_.reserve(boxword->length_);
63 for (
int b = 0; b < boxword->length_; ++b) {
67 outline = outline->
next) {
68 EDGEPT* edgept = outline->loop;
75 pos.set_x(denormed.
x);
76 pos.set_y(denormed.
y);
77 TBOX pt_box(pos, pos);
80 edgept = edgept->
next;
81 }
while (edgept != outline->loop);
83 boxword->boxes_.push_back(blob_box);
85 boxword->ComputeBoundingBox();
void DenormTransform(const DENORM *last_denorm, const TPOINT &pt, TPOINT *original) const
GenericVector< TBLOB * > blobs
const DENORM & denorm() const
◆ DeleteAllBoxes()
void tesseract::BoxWord::DeleteAllBoxes |
( |
| ) |
|
◆ DeleteBox()
void tesseract::BoxWord::DeleteBox |
( |
int |
index | ) |
|
◆ InsertBox()
void tesseract::BoxWord::InsertBox |
( |
int |
index, |
|
|
const TBOX & |
box |
|
) |
| |
Definition at line 148 of file boxword.cpp.
150 boxes_.
insert(box, index);
153 length_ = boxes_.
size();
154 ComputeBoundingBox();
void insert(const T &t, int index)
◆ length()
int tesseract::BoxWord::length |
( |
| ) |
const |
|
inline |
◆ MergeBoxes()
void tesseract::BoxWord::MergeBoxes |
( |
int |
start, |
|
|
int |
end |
|
) |
| |
Definition at line 131 of file boxword.cpp.
134 if (end <= start + 1)
136 for (
int i = start + 1; i < end; ++i) {
137 boxes_[start] += boxes_[i];
139 int shrinkage = end - 1 - start;
140 length_ -= shrinkage;
141 for (
int i = start + 1; i < length_; ++i)
142 boxes_[i] = boxes_[i + shrinkage];
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
◆ operator=()
Definition at line 40 of file boxword.cpp.
void CopyFrom(const BoxWord &src)
◆ ProcessMatchedBlobs()
void tesseract::BoxWord::ProcessMatchedBlobs |
( |
const TWERD & |
other, |
|
|
TessCallback1< int > * |
cb |
|
) |
| const |
Definition at line 190 of file boxword.cpp.
192 for (
int i = 0; i < length_ && i < other.
NumBlobs(); ++i) {
193 TBOX blob_box = other.
blobs[i]->bounding_box();
194 if (blob_box == boxes_[i])
GenericVector< TBLOB * > blobs
The documentation for this class was generated from the following files:
- /usr/src/tesseract-ocr.master/src/ccstruct/boxword.h
- /usr/src/tesseract-ocr.master/src/ccstruct/boxword.cpp