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

Method LocalNormBlob

deps/tesseract/ccstruct/normalis.cpp:411–422  ·  view source on GitHub ↗

Normalize a blob using blob transformations. Less accurate, but more accurately copies the old way.

Source from the content-addressed store, hash-verified

409// Normalize a blob using blob transformations. Less accurate, but
410// more accurately copies the old way.
411void DENORM::LocalNormBlob(TBLOB* blob) const {
412 TBOX blob_box = blob->bounding_box();
413 ICOORD translation(-IntCastRounded(x_origin_), -IntCastRounded(y_origin_));
414 blob->Move(translation);
415 if (y_scale_ != 1.0f)
416 blob->Scale(y_scale_);
417 if (rotation_ != NULL)
418 blob->Rotate(*rotation_);
419 translation.set_x(IntCastRounded(final_xshift_));
420 translation.set_y(IntCastRounded(final_yshift_));
421 blob->Move(translation);
422}
423
424// Fills in the x-height range accepted by the given unichar_id, given its
425// bounding box in the usual baseline-normalized coordinates, with some

Callers 1

NormalizeMethod · 0.80

Calls 7

IntCastRoundedFunction · 0.85
MoveMethod · 0.80
set_xMethod · 0.80
set_yMethod · 0.80
bounding_boxMethod · 0.45
ScaleMethod · 0.45
RotateMethod · 0.45

Tested by

no test coverage detected