#include <boxword.h>
Definition at line 47 of file boxword.h.
| tesseract::BoxWord::BoxWord |
( |
| ) |
|
| tesseract::BoxWord::BoxWord |
( |
const BoxWord & |
src | ) |
|
|
explicit |
Definition at line 42 of file boxword.cpp.
void CopyFrom(const BoxWord &src)
| tesseract::BoxWord::~BoxWord |
( |
| ) |
|
| const TBOX& tesseract::BoxWord::BlobBox |
( |
int |
index | ) |
const |
|
inline |
Definition at line 102 of file boxword.h.
103 return boxes_[index];
| ScriptPos tesseract::BoxWord::BlobPosition |
( |
int |
index | ) |
const |
|
inline |
Definition at line 105 of file boxword.h.
106 if (index < 0 || index >= script_pos_.
size())
108 return script_pos_[index];
| const TBOX& tesseract::BoxWord::bounding_box |
( |
| ) |
const |
|
inline |
| void tesseract::BoxWord::ClipToOriginalWord |
( |
const BLOCK * |
block, |
|
|
WERD * |
original_word |
|
) |
| |
Definition at line 138 of file boxword.cpp.
139 for (
int i = 0; i < length_; ++i) {
140 TBOX box = boxes_[i];
147 for (b_it.mark_cycle_pt(); !b_it.cycled_list(); b_it.forward()) {
148 TBOX blob_box = b_it.data()->bounding_box();
152 original_box += blob_box;
155 if (!original_box.null_box()) {
158 if (NearlyEqual<int>(original_box.right(), box.
right(),
162 box.
set_top(original_box.top());
163 if (NearlyEqual<int>(original_box.bottom(), box.
bottom(),
172 ComputeBoundingBox();
C_BLOB_LIST * cblob_list()
const int kBoxClipTolerance
bool major_overlap(const TBOX &box) const
void rotate(const FCOORD &vec)
TBOX intersection(const TBOX &box) const
FCOORD re_rotation() const
| void tesseract::BoxWord::CopyFrom |
( |
const BoxWord & |
src | ) |
|
Definition at line 54 of file boxword.cpp.
56 length_ = src.length_;
59 for (
int i = 0; i < length_; ++i)
| BoxWord * tesseract::BoxWord::CopyFromNormalized |
( |
const DENORM * |
denorm, |
|
|
TWERD * |
tessword |
|
) |
| |
|
static |
Definition at line 67 of file boxword.cpp.
72 for (
TBLOB* tblob = tessword->
blobs; tblob !=
NULL; tblob = tblob->next)
75 boxword->boxes_.reserve(boxword->length_);
77 for (
TBLOB* tblob = tessword->
blobs; tblob !=
NULL; tblob = tblob->next) {
79 for (
TESSLINE* outline = tblob->outlines; outline !=
NULL;
80 outline = outline->next) {
81 EDGEPT* edgept = outline->loop;
89 pos.set_x(denormed.
x);
90 pos.set_y(denormed.
y);
92 TBOX pt_box(pos, pos);
95 edgept = edgept->
next;
96 }
while (edgept != outline->loop);
98 boxword->boxes_.push_back(blob_box);
100 boxword->ComputeBoundingBox();
void DenormTransform(const TPOINT &pt, TPOINT *original) const
| void tesseract::BoxWord::DeleteAllBoxes |
( |
| ) |
|
| void tesseract::BoxWord::DeleteBox |
( |
int |
index | ) |
|
Definition at line 205 of file boxword.cpp.
209 ComputeBoundingBox();
virtual void remove(int index)
| void tesseract::BoxWord::InsertBox |
( |
int |
index, |
|
|
const TBOX & |
box |
|
) |
| |
Definition at line 194 of file boxword.cpp.
196 boxes_.
insert(box, index);
199 length_ = boxes_.
size();
200 ComputeBoundingBox();
void insert(T t, int index)
| const int tesseract::BoxWord::length |
( |
| ) |
const |
|
inline |
| void tesseract::BoxWord::MergeBoxes |
( |
int |
start, |
|
|
int |
end |
|
) |
| |
Definition at line 177 of file boxword.cpp.
180 if (end <= start + 1)
182 for (
int i = start + 1; i < end; ++i) {
183 boxes_[start] += boxes_[i];
185 int shrinkage = end - 1 - start;
186 length_ -= shrinkage;
187 for (
int i = start + 1; i < length_; ++i)
188 boxes_[i] = boxes_[i + shrinkage];
virtual void truncate(int size)
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
Definition at line 49 of file boxword.cpp.
void CopyFrom(const BoxWord &src)
| void tesseract::BoxWord::ProcessMatchedBlobs |
( |
const TWERD & |
other, |
|
|
TessCallback1< int > * |
cb |
|
) |
| const |
Definition at line 229 of file boxword.cpp.
232 for (
int i = 0; i < length_ && blob !=
NULL; ++i, blob = blob->
next) {
233 TBOX blob_box = blob->bounding_box();
234 if (blob_box == boxes_[i])
| void tesseract::BoxWord::SetScriptPositions |
( |
const UNICHARSET & |
unicharset, |
|
|
bool |
small_caps, |
|
|
TWERD * |
tessword, |
|
|
WERD_CHOICE * |
best_choice |
|
) |
| |
Definition at line 108 of file boxword.cpp.
114 for (
TBLOB* tblob = tessword->
blobs; tblob !=
NULL; tblob = tblob->next,
116 int class_id = best_choice->
unichar_id(blob_index);
117 TBOX blob_box = tblob->bounding_box();
118 int top = blob_box.
top();
119 int bottom = blob_box.
bottom();
120 int min_bottom, max_bottom, min_top, max_top;
125 }
else if (!small_caps) {
const int kMaxDropCapBottom
void get_top_bottom(UNICHAR_ID unichar_id, int *min_bottom, int *max_bottom, int *min_top, int *max_top) const
const int kMinSuperscriptOffset
const int kMinSubscriptOffset
const UNICHAR_ID unichar_id(int index) const
void init_to_size(int size, T t)
The documentation for this class was generated from the following files:
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/ccstruct/boxword.h
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/ccstruct/boxword.cpp