#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, 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 302 of file blobs.h.
Constructor & Destructor Documentation
Member Function Documentation
Definition at line 741 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);
}
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);
}
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);
}
}
TWERD& TWERD::operator= |
( |
const TWERD & |
src | ) |
[inline] |
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