#include <blobs.h>
List of all members.
Public Member Functions |
| 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 |
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 |
Static Public Member Functions |
static TBLOB * | PolygonalCopy (bool allow_detailed_fx, C_BLOB *src) |
static TBLOB * | ShallowCopy (const TBLOB &src) |
Public Attributes |
TESSLINE * | outlines |
Detailed Description
Definition at line 193 of file blobs.h.
Constructor & Destructor Documentation
Member Function Documentation
Definition at line 256 of file blobs.h.
{
int total_area = 0;
for (TESSLINE* outline = outlines; outline != NULL; outline = outline->next)
total_area += outline->BBArea();
return total_area;
}
Definition at line 327 of file blobs.cpp.
{
TBLOB* rotated_blob = NULL;
if (denorm_.block() != NULL &&
denorm_.block()->classify_rotation().y() != 0.0) {
TBOX box = bounding_box();
int x_middle = (box.left() + box.right()) / 2;
int y_middle = (box.top() + box.bottom()) / 2;
rotated_blob = new TBLOB(*this);
const FCOORD& rotation = denorm_.block()->classify_rotation();
float target_y = kBlnBaselineOffset +
(rotation.y() > 0 ? x_middle - box.left() : box.right() - x_middle);
rotated_blob->Normalize(NULL, &rotation, &denorm_, x_middle, y_middle,
1.0f, 1.0f, 0.0f, target_y,
denorm_.inverse(), denorm_.pix());
}
return rotated_blob;
}
Definition at line 469 of file blobs.cpp.
{
LLSQ accumulator;
TBOX box = bounding_box();
CollectEdges(box, NULL, &accumulator, NULL, NULL);
*center = accumulator.mean_point() + box.botleft();
double x2nd = sqrt(accumulator.x_variance());
double y2nd = sqrt(accumulator.y_variance());
if (x2nd < 1.0) x2nd = 1.0;
if (y2nd < 1.0) y2nd = 1.0;
second_moments->set_x(x2nd);
second_moments->set_y(y2nd);
return accumulator.count();
}
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 433 of file blobs.cpp.
{
int result = 0;
for (TESSLINE* outline = outlines; outline != NULL; outline = outline->next)
++result;
return result;
}
TBLOB& TBLOB::operator= |
( |
const TBLOB & |
src | ) |
[inline] |
Definition at line 458 of file blobs.cpp.
{
for (TESSLINE* outline = outlines; outline != NULL; outline = outline->next)
outline->plot(window, color, child_color);
}
Definition at line 316 of file blobs.cpp.
{
TBLOB* blob = new TBLOB;
blob->denorm_ = src.denorm_;
return blob;
}
Member Data Documentation
The documentation for this struct was generated from the following files:
- /usr/local/google/home/jbreiden/tesseract-ocr-read-only/ccstruct/blobs.h
- /usr/local/google/home/jbreiden/tesseract-ocr-read-only/ccstruct/blobs.cpp