MCPcopy Create free account
hub / github.com/creatale/node-dv / NormalizeTBLOB

Method NormalizeTBLOB

deps/tesseract/api/baseapi.cpp:2522–2529  ·  view source on GitHub ↗

* This method baseline normalizes a TBLOB in-place. The input row is used * for normalization. The denorm is an optional parameter in which the * normalization-antidote is returned. */

Source from the content-addressed store, hash-verified

2520 * normalization-antidote is returned.
2521 */
2522void TessBaseAPI::NormalizeTBLOB(TBLOB *tblob, ROW *row, bool numeric_mode) {
2523 TBOX box = tblob->bounding_box();
2524 float x_center = (box.left() + box.right()) / 2.0f;
2525 float baseline = row->base_line(x_center);
2526 float scale = kBlnXHeight / row->x_height();
2527 tblob->Normalize(NULL, NULL, NULL, x_center, baseline, scale, scale,
2528 0.0f, static_cast<float>(kBlnBaselineOffset), false, NULL);
2529}
2530
2531/**
2532 * Return a TBLOB * from the whole pix.

Callers

nothing calls this directly

Calls 4

base_lineMethod · 0.80
bounding_boxMethod · 0.45
x_heightMethod · 0.45
NormalizeMethod · 0.45

Tested by

no test coverage detected