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

Function NormalizeDirection

deps/tesseract/classify/intfx.cpp:171–182  ·  view source on GitHub ↗

Helper normalizes the direction, assuming that it is at the given unnormed_pos, using the given denorm, starting at the root_denorm.

Source from the content-addressed store, hash-verified

169// Helper normalizes the direction, assuming that it is at the given
170// unnormed_pos, using the given denorm, starting at the root_denorm.
171uinT8 NormalizeDirection(uinT8 dir, const FCOORD& unnormed_pos,
172 const DENORM& denorm, const DENORM* root_denorm) {
173 // Convert direction to a vector.
174 FCOORD unnormed_end;
175 unnormed_end.from_direction(dir);
176 unnormed_end += unnormed_pos;
177 FCOORD normed_pos, normed_end;
178 denorm.NormTransform(root_denorm, unnormed_pos, &normed_pos);
179 denorm.NormTransform(root_denorm, unnormed_end, &normed_end);
180 normed_end -= normed_pos;
181 return normed_end.to_direction();
182}
183
184// Helper returns the mean direction vector from the given stats. Use the
185// mean direction from dirs if there is information available, otherwise, use

Callers 1

GatherPointsFunction · 0.85

Calls 3

from_directionMethod · 0.80
NormTransformMethod · 0.80
to_directionMethod · 0.80

Tested by

no test coverage detected