#include <blobs.h>
|
| TBLOB () |
|
| TBLOB (const TBLOB &src) |
|
| ~TBLOB () |
|
TBLOB & | operator= (const TBLOB &src) |
|
TBLOB * | ClassifyNormalizeIfNeeded () const |
|
void | CopyFrom (const TBLOB &src) |
|
void | Clear () |
|
void | Normalize (const BLOCK *block, const FCOORD *rotation, const DENORM *predecessor, float x_origin, float y_origin, float x_scale, float y_scale, float final_xshift, float final_yshift, bool inverse, Pix *pix) |
|
void | Rotate (const FCOORD rotation) |
|
void | Move (const ICOORD vec) |
|
void | Scale (float factor) |
|
void | ComputeBoundingBoxes () |
|
int | NumOutlines () const |
|
TBOX | bounding_box () const |
|
bool | SegmentCrossesOutline (const TPOINT &pt1, const TPOINT &pt2) const |
|
bool | Contains (const TPOINT &pt) const |
|
void | EliminateDuplicateOutlines () |
|
void | CorrectBlobOrder (TBLOB *next) |
|
const DENORM & | denorm () const |
|
void | plot (ScrollView *window, ScrollView::Color color, ScrollView::Color child_color) |
|
int | BBArea () const |
|
int | ComputeMoments (FCOORD *center, FCOORD *second_moments) const |
|
void | GetPreciseBoundingBox (TBOX *precise_box) const |
|
void | GetEdgeCoords (const TBOX &box, GenericVector< GenericVector< int > > *x_coords, GenericVector< GenericVector< int > > *y_coords) const |
|
Definition at line 268 of file blobs.h.
◆ TBLOB() [1/2]
◆ TBLOB() [2/2]
TBLOB::TBLOB |
( |
const TBLOB & |
src | ) |
|
|
inline |
Definition at line 270 of file blobs.h.
void CopyFrom(const TBLOB &src)
◆ ~TBLOB()
◆ BBArea()
int TBLOB::BBArea |
( |
| ) |
const |
|
inline |
Definition at line 356 of file blobs.h.
359 total_area += outline->BBArea();
◆ bounding_box()
TBOX TBLOB::bounding_box |
( |
| ) |
const |
Definition at line 478 of file blobs.cpp.
482 for (outline = outline->
next; outline !=
nullptr; outline = outline->
next) {
TBOX bounding_box() const
◆ ClassifyNormalizeIfNeeded()
TBLOB * TBLOB::ClassifyNormalizeIfNeeded |
( |
| ) |
const |
Definition at line 356 of file blobs.cpp.
357 TBLOB* rotated_blob =
nullptr;
360 if (denorm_.
block() !=
nullptr &&
363 int x_middle = (box.
left() + box.
right()) / 2;
364 int y_middle = (box.
top() + box.
bottom()) / 2;
365 rotated_blob =
new TBLOB(*
this);
371 (rotation.
y() > 0 ? x_middle - box.
left() : box.
right() - x_middle);
372 rotated_blob->
Normalize(
nullptr, &rotation, &denorm_, x_middle, y_middle,
373 1.0f, 1.0f, 0.0f, target_y, denorm_.
inverse(),
const BLOCK * block() const
const int kBlnBaselineOffset
void Normalize(const BLOCK *block, const FCOORD *rotation, const DENORM *predecessor, float x_origin, float y_origin, float x_scale, float y_scale, float final_xshift, float final_yshift, bool inverse, Pix *pix)
FCOORD classify_rotation() const
TBOX bounding_box() const
◆ Clear()
◆ ComputeBoundingBoxes()
void TBLOB::ComputeBoundingBoxes |
( |
| ) |
|
Definition at line 456 of file blobs.cpp.
458 outline = outline->
next) {
459 outline->ComputeBoundingBox();
◆ ComputeMoments()
int TBLOB::ComputeMoments |
( |
FCOORD * |
center, |
|
|
FCOORD * |
second_moments |
|
) |
| const |
Definition at line 532 of file blobs.cpp.
537 CollectEdges(box,
nullptr, &accumulator,
nullptr,
nullptr);
542 if (x2nd < 1.0) x2nd = 1.0;
543 if (y2nd < 1.0) y2nd = 1.0;
544 second_moments->
set_x(x2nd);
545 second_moments->
set_y(y2nd);
546 return accumulator.
count();
void set_x(float xin)
rewrite function
FCOORD mean_point() const
TBOX bounding_box() const
const ICOORD & botleft() const
double y_variance() const
double x_variance() const
void set_y(float yin)
rewrite function
◆ Contains()
bool TBLOB::Contains |
( |
const TPOINT & |
pt | ) |
const |
|
inline |
Definition at line 331 of file blobs.h.
333 outline = outline->
next) {
334 if (outline->Contains(pt))
return true;
◆ CopyFrom()
void TBLOB::CopyFrom |
( |
const TBLOB & |
src | ) |
|
Definition at line 380 of file blobs.cpp.
384 srcline = srcline->
next) {
389 prev_outline->
next = new_outline;
390 prev_outline = new_outline;
392 denorm_ = src.denorm_;
◆ CorrectBlobOrder()
void TBLOB::CorrectBlobOrder |
( |
TBLOB * |
next | ) |
|
Definition at line 511 of file blobs.cpp.
TBOX bounding_box() const
◆ denorm()
const DENORM& TBLOB::denorm |
( |
| ) |
const |
|
inline |
◆ EliminateDuplicateOutlines()
void TBLOB::EliminateDuplicateOutlines |
( |
| ) |
|
Definition at line 490 of file blobs.cpp.
492 outline = outline->
next) {
494 for (
TESSLINE* other_outline = outline->
next; other_outline !=
nullptr;
495 last_outline = other_outline, other_outline = other_outline->
next) {
496 if (outline->SameBox(*other_outline)) {
497 last_outline->
next = other_outline->
next;
499 other_outline->
loop =
nullptr;
500 delete other_outline;
501 other_outline = last_outline;
◆ GetEdgeCoords()
Definition at line 567 of file blobs.cpp.
573 CollectEdges(box,
nullptr,
nullptr, x_coords, y_coords);
575 for (
int i = 0; i < x_coords->
size(); ++i) (*x_coords)[i].sort();
576 for (
int i = 0; i < y_coords->
size(); ++i) (*y_coords)[i].sort();
void init_to_size(int size, const T &t)
◆ GetPreciseBoundingBox()
void TBLOB::GetPreciseBoundingBox |
( |
TBOX * |
precise_box | ) |
const |
Definition at line 551 of file blobs.cpp.
553 *precise_box =
TBOX();
554 CollectEdges(box, precise_box,
nullptr,
nullptr,
nullptr);
void move(const ICOORD vec)
TBOX bounding_box() const
const ICOORD & botleft() const
◆ Move()
void TBLOB::Move |
( |
const ICOORD |
vec | ) |
|
◆ Normalize()
void TBLOB::Normalize |
( |
const BLOCK * |
block, |
|
|
const FCOORD * |
rotation, |
|
|
const DENORM * |
predecessor, |
|
|
float |
x_origin, |
|
|
float |
y_origin, |
|
|
float |
x_scale, |
|
|
float |
y_scale, |
|
|
float |
final_xshift, |
|
|
float |
final_yshift, |
|
|
bool |
inverse, |
|
|
Pix * |
pix |
|
) |
| |
Definition at line 407 of file blobs.cpp.
412 x_scale, y_scale, final_xshift, final_yshift);
424 outline->Normalize(denorm_);
void SetupNormalization(const BLOCK *block, const FCOORD *rotation, const DENORM *predecessor, float x_origin, float y_origin, float x_scale, float y_scale, float final_xshift, float final_yshift)
void LocalNormBlob(TBLOB *blob) const
void set_inverse(bool value)
◆ NumOutlines()
int TBLOB::NumOutlines |
( |
| ) |
const |
◆ operator=()
Definition at line 276 of file blobs.h.
void CopyFrom(const TBLOB &src)
◆ plot()
Definition at line 520 of file blobs.cpp.
523 outline = outline->
next)
524 outline->plot(window, color, child_color);
◆ PolygonalCopy()
TBLOB * TBLOB::PolygonalCopy |
( |
bool |
allow_detailed_fx, |
|
|
C_BLOB * |
src |
|
) |
| |
|
static |
Definition at line 337 of file blobs.cpp.
339 ApproximateOutlineList(allow_detailed_fx, src->
out_list(),
false,
C_OUTLINE_LIST * out_list()
◆ Rotate()
void TBLOB::Rotate |
( |
const FCOORD |
rotation | ) |
|
Definition at line 432 of file blobs.cpp.
434 outline = outline->
next) {
435 outline->Rotate(rotation);
◆ Scale()
void TBLOB::Scale |
( |
float |
factor | ) |
|
Definition at line 448 of file blobs.cpp.
450 outline = outline->
next) {
451 outline->Scale(factor);
◆ SegmentCrossesOutline()
bool TBLOB::SegmentCrossesOutline |
( |
const TPOINT & |
pt1, |
|
|
const TPOINT & |
pt2 |
|
) |
| const |
|
inline |
Definition at line 323 of file blobs.h.
325 outline = outline->
next) {
326 if (outline->SegmentCrosses(pt1, pt2))
return true;
◆ ShallowCopy()
Definition at line 345 of file blobs.cpp.
347 blob->denorm_ = src.denorm_;
◆ outlines
The documentation for this struct was generated from the following files:
- /usr/src/tesseract-ocr.master/src/ccstruct/blobs.h
- /usr/src/tesseract-ocr.master/src/ccstruct/blobs.cpp