#include <boxword.h>
List of all members.
Detailed Description
Definition at line 39 of file boxword.h.
Constructor & Destructor Documentation
Member Function Documentation
Definition at line 84 of file boxword.h.
{
return boxes_[index];
}
Definition at line 95 of file boxword.cpp.
{
for (int i = 0; i < length_; ++i) {
TBOX box = boxes_[i];
box = TBOX(box.left() - 1, box.bottom() - 1,
box.right() + 1, box.top() + 1);
TBOX original_box;
C_BLOB_IT b_it(original_word->cblob_list());
for (b_it.mark_cycle_pt(); !b_it.cycled_list(); b_it.forward()) {
TBOX blob_box = b_it.data()->bounding_box();
if (block != NULL)
blob_box.rotate(block->re_rotation());
if (blob_box.major_overlap(box)) {
original_box += blob_box;
}
}
if (!original_box.null_box()) {
if (NearlyEqual<int>(original_box.left(), box.left(), kBoxClipTolerance))
box.set_left(original_box.left());
if (NearlyEqual<int>(original_box.right(), box.right(),
kBoxClipTolerance))
box.set_right(original_box.right());
if (NearlyEqual<int>(original_box.top(), box.top(), kBoxClipTolerance))
box.set_top(original_box.top());
if (NearlyEqual<int>(original_box.bottom(), box.bottom(),
kBoxClipTolerance))
box.set_bottom(original_box.bottom());
}
original_box = original_word->bounding_box();
if (block != NULL)
original_box.rotate(block->re_rotation());
boxes_[i] = box.intersection(original_box);
}
ComputeBoundingBox();
}
Definition at line 48 of file boxword.cpp.
{
bbox_ = src.bbox_;
length_ = src.length_;
boxes_.clear();
boxes_.reserve(length_);
for (int i = 0; i < length_; ++i)
boxes_.push_back(src.boxes_[i]);
}
Definition at line 59 of file boxword.cpp.
{
BoxWord* boxword = new BoxWord();
boxword->length_ = tessword->NumBlobs();
boxword->boxes_.reserve(boxword->length_);
for (int b = 0; b < boxword->length_; ++b) {
TBLOB* tblob = tessword->blobs[b];
TBOX blob_box;
for (TESSLINE* outline = tblob->outlines; outline != NULL;
outline = outline->next) {
EDGEPT* edgept = outline->loop;
do {
if (!edgept->IsHidden() || !edgept->prev->IsHidden()) {
ICOORD pos(edgept->pos.x, edgept->pos.y);
TPOINT denormed;
tblob->denorm().DenormTransform(NULL, edgept->pos, &denormed);
pos.set_x(denormed.x);
pos.set_y(denormed.y);
TBOX pt_box(pos, pos);
blob_box += pt_box;
}
edgept = edgept->next;
} while (edgept != outline->loop);
}
boxword->boxes_.push_back(blob_box);
}
boxword->ComputeBoundingBox();
return boxword;
}
Definition at line 151 of file boxword.cpp.
{
if (index < length_)
boxes_.insert(box, index);
else
boxes_.push_back(box);
length_ = boxes_.size();
ComputeBoundingBox();
}
Definition at line 134 of file boxword.cpp.
{
start = ClipToRange(start, 0, length_);
end = ClipToRange(end, 0, length_);
if (end <= start + 1)
return;
for (int i = start + 1; i < end; ++i) {
boxes_[start] += boxes_[i];
}
int shrinkage = end - 1 - start;
length_ -= shrinkage;
for (int i = start + 1; i < length_; ++i)
boxes_[i] = boxes_[i + shrinkage];
boxes_.truncate(length_);
}
Definition at line 186 of file boxword.cpp.
{
for (int i = 0; i < length_ && i < other.NumBlobs(); ++i) {
TBOX blob_box = other.blobs[i]->bounding_box();
if (blob_box == boxes_[i])
cb->Run(i);
}
delete cb;
}
The documentation for this class was generated from the following files:
- /usr/local/google/home/jbreiden/tesseract-ocr-read-only/ccstruct/boxword.h
- /usr/local/google/home/jbreiden/tesseract-ocr-read-only/ccstruct/boxword.cpp