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

Function InitIntegerFX

deps/tesseract/classify/intfx.cpp:55–66  ·  view source on GitHub ↗

---------------------------------------------------------------------------- Public Code ----------------------------------------------------------------------------**/ ---------------------------------------------------------------------------*/

Source from the content-addressed store, hash-verified

53----------------------------------------------------------------------------**/
54/*---------------------------------------------------------------------------*/
55void InitIntegerFX() {
56 static bool atan_table_init = false;
57 atan_table_mutex.Lock();
58 if (!atan_table_init) {
59 for (int i = 0; i < INT_CHAR_NORM_RANGE; ++i) {
60 cos_table[i] = cos(i * 2 * PI / INT_CHAR_NORM_RANGE + PI);
61 sin_table[i] = sin(i * 2 * PI / INT_CHAR_NORM_RANGE + PI);
62 }
63 atan_table_init = true;
64 }
65 atan_table_mutex.Unlock();
66}
67
68// Returns a vector representing the direction of a feature with the given
69// theta direction in an INT_FEATURE_STRUCT.

Callers 2

InitMethod · 0.85

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected