#include <blobs.h>
List of all members.
Public Member Functions |
| | TWERD () |
| | TWERD (const TWERD &src) |
| | ~TWERD () |
| TWERD & | operator= (const TWERD &src) |
| void | BLNormalize (const BLOCK *block, const ROW *row, Pix *pix, bool inverse, float x_height, float baseline_shift, bool numeric_mode, tesseract::OcrEngineMode hint, const TBOX *norm_box, DENORM *word_denorm) |
| void | CopyFrom (const TWERD &src) |
| void | Clear () |
| void | ComputeBoundingBoxes () |
| int | NumBlobs () const |
| TBOX | bounding_box () const |
| void | MergeBlobs (int start, int end) |
| void | plot (ScrollView *window) |
Static Public Member Functions |
| static TWERD * | PolygonalCopy (bool allow_detailed_fx, WERD *src) |
Public Attributes |
| GenericVector< TBLOB * > | blobs |
| bool | latin_script |
Detailed Description
Definition at line 395 of file blobs.h.
Constructor & Destructor Documentation
| TWERD::TWERD |
( |
| ) |
[inline] |
| TWERD::TWERD |
( |
const TWERD & |
src | ) |
[inline] |
| TWERD::~TWERD |
( |
| ) |
[inline] |
Member Function Documentation
| void TWERD::BLNormalize |
( |
const BLOCK * |
block, |
|
|
const ROW * |
row, |
|
|
Pix * |
pix, |
|
|
bool |
inverse, |
|
|
float |
x_height, |
|
|
float |
baseline_shift, |
|
|
bool |
numeric_mode, |
|
|
tesseract::OcrEngineMode |
hint, |
|
|
const TBOX * |
norm_box, |
|
|
DENORM * |
word_denorm |
|
) |
| |
Definition at line 807 of file blobs.cpp.
{
TBOX word_box = bounding_box();
if (norm_box != NULL) word_box = *norm_box;
float word_middle = (word_box.left() + word_box.right()) / 2.0f;
float input_y_offset = 0.0f;
float final_y_offset = static_cast<float>(kBlnBaselineOffset);
float scale = kBlnXHeight / x_height;
if (hint == tesseract::OEM_CUBE_ONLY || row == NULL) {
word_middle = word_box.left();
input_y_offset = word_box.bottom();
final_y_offset = 0.0f;
if (hint == tesseract::OEM_CUBE_ONLY)
scale = 1.0f;
} else {
input_y_offset = row->base_line(word_middle) + baseline_shift;
}
for (int b = 0; b < blobs.size(); ++b) {
TBLOB* blob = blobs[b];
TBOX blob_box = blob->bounding_box();
float mid_x = (blob_box.left() + blob_box.right()) / 2.0f;
float baseline = input_y_offset;
float blob_scale = scale;
if (numeric_mode) {
baseline = blob_box.bottom();
blob_scale = ClipToRange(kBlnXHeight * 4.0f / (3 * blob_box.height()),
scale, scale * 1.5f);
} else if (row != NULL && hint != tesseract::OEM_CUBE_ONLY) {
baseline = row->base_line(mid_x) + baseline_shift;
}
blob->Normalize(block, NULL, NULL, word_middle, baseline, blob_scale,
blob_scale, 0.0f, final_y_offset, inverse, pix);
}
if (word_denorm != NULL) {
word_denorm->SetupNormalization(block, NULL, NULL, word_middle,
input_y_offset, scale, scale,
0.0f, final_y_offset);
word_denorm->set_inverse(inverse);
word_denorm->set_pix(pix);
}
}
| TBOX TWERD::bounding_box |
( |
| ) |
const |
| void TWERD::ComputeBoundingBoxes |
( |
| ) |
|
| void TWERD::CopyFrom |
( |
const TWERD & |
src | ) |
|
| void TWERD::MergeBlobs |
( |
int |
start, |
|
|
int |
end |
|
) |
| |
| int TWERD::NumBlobs |
( |
| ) |
const [inline] |
| TWERD& TWERD::operator= |
( |
const TWERD & |
src | ) |
[inline] |
| TWERD * TWERD::PolygonalCopy |
( |
bool |
allow_detailed_fx, |
|
|
WERD * |
src |
|
) |
| [static] |
Member Data Documentation
The documentation for this struct was generated from the following files: