#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 261 of file blobs.h.
◆ TBLOB() [1/2]
◆ TBLOB() [2/2]
TBLOB::TBLOB |
( |
const TBLOB & |
src | ) |
|
|
inline |
Definition at line 263 of file blobs.h.
void CopyFrom(const TBLOB &src)
◆ ~TBLOB()
◆ BBArea()
int TBLOB::BBArea |
( |
| ) |
const |
|
inline |
Definition at line 349 of file blobs.h.
352 total_area += outline->BBArea();
◆ bounding_box()
TBOX TBLOB::bounding_box |
( |
| ) |
const |
Definition at line 482 of file blobs.cpp.
484 return TBOX(0, 0, 0, 0);
487 for (outline = outline->
next; outline != NULL; outline = outline->
next) {
TBOX bounding_box() const
◆ ClassifyNormalizeIfNeeded()
TBLOB * TBLOB::ClassifyNormalizeIfNeeded |
( |
| ) |
const |
Definition at line 363 of file blobs.cpp.
364 TBLOB* rotated_blob = NULL;
367 if (denorm_.
block() != NULL &&
370 int x_middle = (box.
left() + box.
right()) / 2;
371 int y_middle = (box.
top() + box.
bottom()) / 2;
372 rotated_blob =
new TBLOB(*
this);
377 (rotation.
y() > 0 ? x_middle - box.
left() : box.
right() - x_middle);
378 rotated_blob->
Normalize(NULL, &rotation, &denorm_, x_middle, y_middle,
379 1.0f, 1.0f, 0.0f, target_y,
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
const BLOCK * block() const
TBOX bounding_box() const
const int kBlnBaselineOffset
◆ Clear()
◆ ComputeBoundingBoxes()
void TBLOB::ComputeBoundingBoxes |
( |
| ) |
|
Definition at line 462 of file blobs.cpp.
464 outline->ComputeBoundingBox();
◆ ComputeMoments()
int TBLOB::ComputeMoments |
( |
FCOORD * |
center, |
|
|
FCOORD * |
second_moments |
|
) |
| const |
Definition at line 535 of file blobs.cpp.
540 CollectEdges(box, NULL, &accumulator, NULL, NULL);
545 if (x2nd < 1.0) x2nd = 1.0;
546 if (y2nd < 1.0) y2nd = 1.0;
547 second_moments->
set_x(x2nd);
548 second_moments->
set_y(y2nd);
549 return accumulator.
count();
double x_variance() const
FCOORD mean_point() const
void set_x(float xin)
rewrite function
double y_variance() const
TBOX bounding_box() const
void set_y(float yin)
rewrite function
const ICOORD & botleft() const
◆ Contains()
bool TBLOB::Contains |
( |
const TPOINT & |
pt | ) |
const |
|
inline |
Definition at line 324 of file blobs.h.
326 outline = outline->
next) {
327 if (outline->Contains(pt))
return true;
◆ CopyFrom()
void TBLOB::CopyFrom |
( |
const TBLOB & |
src | ) |
|
Definition at line 386 of file blobs.cpp.
390 srcline = srcline->
next) {
395 prev_outline->
next = new_outline;
396 prev_outline = new_outline;
398 denorm_ = src.denorm_;
◆ CorrectBlobOrder()
void TBLOB::CorrectBlobOrder |
( |
TBLOB * |
next | ) |
|
Definition at line 515 of file blobs.cpp.
TBOX bounding_box() const
◆ denorm()
const DENORM& TBLOB::denorm |
( |
| ) |
const |
|
inline |
◆ EliminateDuplicateOutlines()
void TBLOB::EliminateDuplicateOutlines |
( |
| ) |
|
Definition at line 495 of file blobs.cpp.
498 for (
TESSLINE* other_outline = outline->
next; other_outline != NULL;
499 last_outline = other_outline, other_outline = other_outline->
next) {
500 if (outline->SameBox(*other_outline)) {
501 last_outline->
next = other_outline->
next;
503 other_outline->
loop = NULL;
504 delete other_outline;
505 other_outline = last_outline;
◆ GetEdgeCoords()
Definition at line 570 of file blobs.cpp.
576 CollectEdges(box, NULL, NULL, x_coords, y_coords);
578 for (
int i = 0; i < x_coords->
size(); ++i)
579 (*x_coords)[i].sort();
580 for (
int i = 0; i < y_coords->
size(); ++i)
581 (*y_coords)[i].sort();
void init_to_size(int size, T t)
◆ GetPreciseBoundingBox()
void TBLOB::GetPreciseBoundingBox |
( |
TBOX * |
precise_box | ) |
const |
Definition at line 554 of file blobs.cpp.
556 *precise_box =
TBOX();
557 CollectEdges(box, precise_box, NULL, NULL, NULL);
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 413 of file blobs.cpp.
421 x_scale, y_scale, final_xshift, final_yshift);
433 outline->Normalize(denorm_);
void set_inverse(bool value)
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
◆ NumOutlines()
int TBLOB::NumOutlines |
( |
| ) |
const |
◆ operator=()
Definition at line 269 of file blobs.h.
void CopyFrom(const TBLOB &src)
◆ plot()
Definition at line 524 of file blobs.cpp.
527 outline->plot(window, color, child_color);
◆ PolygonalCopy()
TBLOB * TBLOB::PolygonalCopy |
( |
bool |
allow_detailed_fx, |
|
|
C_BLOB * |
src |
|
) |
| |
|
static |
Definition at line 344 of file blobs.cpp.
346 ApproximateOutlineList(allow_detailed_fx, src->
out_list(),
false,
C_OUTLINE_LIST * out_list()
◆ Rotate()
void TBLOB::Rotate |
( |
const FCOORD |
rotation | ) |
|
Definition at line 441 of file blobs.cpp.
443 outline->Rotate(rotation);
◆ Scale()
void TBLOB::Scale |
( |
float |
factor | ) |
|
Definition at line 455 of file blobs.cpp.
457 outline->Scale(factor);
◆ SegmentCrossesOutline()
bool TBLOB::SegmentCrossesOutline |
( |
const TPOINT & |
pt1, |
|
|
const TPOINT & |
pt2 |
|
) |
| const |
|
inline |
Definition at line 316 of file blobs.h.
318 outline = outline->
next) {
319 if (outline->SegmentCrosses(pt1, pt2))
return true;
◆ ShallowCopy()
Definition at line 352 of file blobs.cpp.
354 blob->denorm_ = src.denorm_;
◆ outlines
The documentation for this struct was generated from the following files:
- /home/stweil/src/github/tesseract-ocr/tesseract/ccstruct/blobs.h
- /home/stweil/src/github/tesseract-ocr/tesseract/ccstruct/blobs.cpp