#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 284 of file blobs.h.
◆ TBLOB() [1/2]
◆ TBLOB() [2/2]
TBLOB::TBLOB |
( |
const TBLOB & |
src | ) |
|
|
inline |
Definition at line 286 of file blobs.h.
void CopyFrom(const TBLOB &src)
◆ ~TBLOB()
◆ BBArea()
int TBLOB::BBArea |
( |
| ) |
const |
|
inline |
Definition at line 372 of file blobs.h.
375 total_area += outline->BBArea();
◆ bounding_box()
TBOX TBLOB::bounding_box |
( |
| ) |
const |
Definition at line 468 of file blobs.cpp.
472 for (outline = outline->
next; outline !=
nullptr; outline = outline->
next) {
TBOX bounding_box() const
◆ ClassifyNormalizeIfNeeded()
TBLOB * TBLOB::ClassifyNormalizeIfNeeded |
( |
| ) |
const |
Definition at line 346 of file blobs.cpp.
347 TBLOB* rotated_blob =
nullptr;
350 if (denorm_.
block() !=
nullptr &&
353 int x_middle = (box.
left() + box.
right()) / 2;
354 int y_middle = (box.
top() + box.
bottom()) / 2;
355 rotated_blob =
new TBLOB(*
this);
361 (rotation.
y() > 0 ? x_middle - box.
left() : box.
right() - x_middle);
362 rotated_blob->
Normalize(
nullptr, &rotation, &denorm_, x_middle, y_middle,
363 1.0f, 1.0f, 0.0f, target_y, denorm_.
inverse(),
const int kBlnBaselineOffset
TBOX bounding_box() const
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)
const BLOCK * block() const
FCOORD classify_rotation() const
◆ Clear()
◆ ComputeBoundingBoxes()
void TBLOB::ComputeBoundingBoxes |
( |
| ) |
|
Definition at line 446 of file blobs.cpp.
448 outline = outline->
next) {
449 outline->ComputeBoundingBox();
◆ ComputeMoments()
int TBLOB::ComputeMoments |
( |
FCOORD * |
center, |
|
|
FCOORD * |
second_moments |
|
) |
| const |
Definition at line 522 of file blobs.cpp.
527 CollectEdges(box,
nullptr, &accumulator,
nullptr,
nullptr);
532 if (x2nd < 1.0) x2nd = 1.0;
533 if (y2nd < 1.0) y2nd = 1.0;
534 second_moments->
set_x(x2nd);
535 second_moments->
set_y(y2nd);
536 return accumulator.
count();
double y_variance() const
double x_variance() const
FCOORD mean_point() const
void set_y(float yin)
rewrite function
void set_x(float xin)
rewrite function
const ICOORD & botleft() const
◆ Contains()
bool TBLOB::Contains |
( |
const TPOINT & |
pt | ) |
const |
|
inline |
Definition at line 347 of file blobs.h.
349 outline = outline->
next) {
350 if (outline->Contains(pt))
return true;
◆ CopyFrom()
void TBLOB::CopyFrom |
( |
const TBLOB & |
src | ) |
|
Definition at line 370 of file blobs.cpp.
374 srcline = srcline->
next) {
375 auto* new_outline =
new TESSLINE(*srcline);
379 prev_outline->
next = new_outline;
380 prev_outline = new_outline;
382 denorm_ = src.denorm_;
◆ CorrectBlobOrder()
void TBLOB::CorrectBlobOrder |
( |
TBLOB * |
next | ) |
|
◆ denorm()
const DENORM& TBLOB::denorm |
( |
| ) |
const |
|
inline |
◆ EliminateDuplicateOutlines()
void TBLOB::EliminateDuplicateOutlines |
( |
| ) |
|
Definition at line 480 of file blobs.cpp.
482 outline = outline->
next) {
484 for (
TESSLINE* other_outline = outline->
next; other_outline !=
nullptr;
485 last_outline = other_outline, other_outline = other_outline->
next) {
486 if (outline->SameBox(*other_outline)) {
487 last_outline->
next = other_outline->
next;
489 other_outline->
loop =
nullptr;
490 delete other_outline;
491 other_outline = last_outline;
◆ GetEdgeCoords()
Definition at line 557 of file blobs.cpp.
563 CollectEdges(box,
nullptr,
nullptr, x_coords, y_coords);
565 for (
int i = 0; i < x_coords->
size(); ++i) (*x_coords)[i].sort();
566 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 541 of file blobs.cpp.
543 *precise_box =
TBOX();
544 CollectEdges(box, precise_box,
nullptr,
nullptr,
nullptr);
void move(const ICOORD vec)
◆ 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 397 of file blobs.cpp.
402 x_scale, y_scale, final_xshift, final_yshift);
414 outline->Normalize(denorm_);
void LocalNormBlob(TBLOB *blob) const
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)
◆ NumOutlines()
int TBLOB::NumOutlines |
( |
| ) |
const |
◆ operator=()
◆ plot()
Definition at line 510 of file blobs.cpp.
513 outline = outline->
next)
514 outline->plot(window, color, child_color);
◆ PolygonalCopy()
TBLOB * TBLOB::PolygonalCopy |
( |
bool |
allow_detailed_fx, |
|
|
C_BLOB * |
src |
|
) |
| |
|
static |
Definition at line 327 of file blobs.cpp.
328 auto* tblob =
new TBLOB;
329 ApproximateOutlineList(allow_detailed_fx, src->
out_list(),
false,
C_OUTLINE_LIST * out_list()
◆ Rotate()
void TBLOB::Rotate |
( |
const FCOORD |
rotation | ) |
|
Definition at line 422 of file blobs.cpp.
424 outline = outline->
next) {
425 outline->Rotate(rotation);
◆ Scale()
void TBLOB::Scale |
( |
float |
factor | ) |
|
Definition at line 438 of file blobs.cpp.
440 outline = outline->
next) {
441 outline->Scale(factor);
◆ SegmentCrossesOutline()
bool TBLOB::SegmentCrossesOutline |
( |
const TPOINT & |
pt1, |
|
|
const TPOINT & |
pt2 |
|
) |
| const |
|
inline |
Definition at line 339 of file blobs.h.
341 outline = outline->
next) {
342 if (outline->SegmentCrosses(pt1, pt2))
return true;
◆ ShallowCopy()
Definition at line 335 of file blobs.cpp.
336 auto* blob =
new TBLOB;
337 blob->denorm_ = src.denorm_;
◆ outlines
The documentation for this struct was generated from the following files: