#include <boxword.h>
Definition at line 39 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 |
( |
| ) |
|
◆ 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 95 of file boxword.cpp.
96 for (
int i = 0; i < length_; ++i) {
104 for (b_it.mark_cycle_pt(); !b_it.cycled_list(); b_it.forward()) {
105 TBOX blob_box = b_it.data()->bounding_box();
109 original_box += blob_box;
112 if (!original_box.null_box()) {
115 if (NearlyEqual<int>(original_box.right(), box.
right(),
119 box.
set_top(original_box.top());
120 if (NearlyEqual<int>(original_box.bottom(), box.
bottom(),
129 ComputeBoundingBox();
void rotate(const FCOORD &vec)
const int kBoxClipTolerance
FCOORD re_rotation() const
bool major_overlap(const TBOX &box) const
TBOX intersection(const TBOX &box) const
C_BLOB_LIST * cblob_list()
TBOX bounding_box() const
◆ CopyFrom()
void tesseract::BoxWord::CopyFrom |
( |
const BoxWord & |
src | ) |
|
Definition at line 48 of file boxword.cpp.
50 length_ = src.length_;
53 for (
int i = 0; i < length_; ++i)
◆ CopyFromNormalized()
BoxWord * tesseract::BoxWord::CopyFromNormalized |
( |
TWERD * |
tessword | ) |
|
|
static |
Definition at line 59 of file boxword.cpp.
62 boxword->length_ = tessword->
NumBlobs();
64 boxword->boxes_.reserve(boxword->length_);
66 for (
int b = 0; b < boxword->length_; ++b) {
70 outline = outline->
next) {
71 EDGEPT* edgept = outline->loop;
78 pos.set_x(denormed.
x);
79 pos.set_y(denormed.
y);
80 TBOX pt_box(pos, pos);
83 edgept = edgept->
next;
84 }
while (edgept != outline->loop);
86 boxword->boxes_.push_back(blob_box);
88 boxword->ComputeBoundingBox();
GenericVector< TBLOB * > blobs
void DenormTransform(const DENORM *last_denorm, const TPOINT &pt, TPOINT *original) const
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 151 of file boxword.cpp.
153 boxes_.
insert(box, index);
156 length_ = boxes_.
size();
157 ComputeBoundingBox();
void insert(T t, int index)
◆ length()
int tesseract::BoxWord::length |
( |
| ) |
const |
|
inline |
◆ MergeBoxes()
void tesseract::BoxWord::MergeBoxes |
( |
int |
start, |
|
|
int |
end |
|
) |
| |
Definition at line 134 of file boxword.cpp.
137 if (end <= start + 1)
139 for (
int i = start + 1; i < end; ++i) {
140 boxes_[start] += boxes_[i];
142 int shrinkage = end - 1 - start;
143 length_ -= shrinkage;
144 for (
int i = start + 1; i < length_; ++i)
145 boxes_[i] = boxes_[i + shrinkage];
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
◆ operator=()
Definition at line 43 of file boxword.cpp.
void CopyFrom(const BoxWord &src)
◆ ProcessMatchedBlobs()
void tesseract::BoxWord::ProcessMatchedBlobs |
( |
const TWERD & |
other, |
|
|
TessCallback1< int > * |
cb |
|
) |
| const |
Definition at line 193 of file boxword.cpp.
195 for (
int i = 0; i < length_ && i < other.
NumBlobs(); ++i) {
196 TBOX blob_box = other.
blobs[i]->bounding_box();
197 if (blob_box == boxes_[i])
GenericVector< TBLOB * > blobs
The documentation for this class was generated from the following files: