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

Method SetupNormalization

deps/tesseract/ccstruct/normalis.cpp:95–114  ·  view source on GitHub ↗

Initializes the denorm for a transformation. For details see the large comment in normalis.h. Arguments: block: if not NULL, then this is the first transformation, and block->re_rotation() needs to be used after the Denorm transformation to get back to the image coords. rotation: if not NULL, apply this rotation after translation to the origin and scaling. (Usually a classify rotation.) predecesso

Source from the content-addressed store, hash-verified

93// final_xshift: The x component of the final translation.
94// final_yshift: The y component of the final translation.
95void DENORM::SetupNormalization(const BLOCK* block,
96 const FCOORD* rotation,
97 const DENORM* predecessor,
98 float x_origin, float y_origin,
99 float x_scale, float y_scale,
100 float final_xshift, float final_yshift) {
101 Clear();
102 block_ = block;
103 if (rotation == NULL)
104 rotation_ = NULL;
105 else
106 rotation_ = new FCOORD(*rotation);
107 predecessor_ = predecessor;
108 x_origin_ = x_origin;
109 y_origin_ = y_origin;
110 x_scale_ = x_scale;
111 y_scale_ = y_scale;
112 final_xshift_ = final_xshift;
113 final_yshift_ = final_yshift;
114}
115
116// Helper for SetupNonLinear computes an image of shortest run-lengths from
117// the x/y edges provided.

Callers 6

SetupBLCNDenormsMethod · 0.80
CorrectOrientationMethod · 0.80
FindBlocksMethod · 0.80
ReflectForRtlMethod · 0.80
NormalizeMethod · 0.80
BLNormalizeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected