tesseract  4.1.1
intfx.cpp File Reference
#include "intfx.h"
#include <cmath>
#include "allheaders.h"
#include "ccutil.h"
#include "classify.h"
#include "helpers.h"
#include "intmatcher.h"
#include "linlsq.h"
#include "normalis.h"
#include "statistc.h"
#include "trainingsample.h"

Go to the source code of this file.

Namespaces

 tesseract
 

Macros

#define _USE_MATH_DEFINES
 

Functions

void InitIntegerFX ()
 
FCOORD FeatureDirection (uint8_t theta)
 
TrainingSampletesseract::BlobToTrainingSample (const TBLOB &blob, bool nonlinear_norm, INT_FX_RESULT_STRUCT *fx_info, GenericVector< INT_FEATURE_STRUCT > *bl_features)
 

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

Include Files and Type Defines

Definition at line 22 of file intfx.cpp.

Function Documentation

◆ FeatureDirection()

FCOORD FeatureDirection ( uint8_t  theta)

Definition at line 66 of file intfx.cpp.

66  {
67  return FCOORD(cos_table[theta], sin_table[theta]);
68 }

◆ InitIntegerFX()

void InitIntegerFX ( )

Public Code

Definition at line 49 of file intfx.cpp.

49  {
50  // Guards write access to AtanTable so we don't create it more than once.
51  static tesseract::CCUtilMutex atan_table_mutex;
52  static bool atan_table_init = false;
53  atan_table_mutex.Lock();
54  if (!atan_table_init) {
55  for (int i = 0; i < INT_CHAR_NORM_RANGE; ++i) {
56  cos_table[i] = cos(i * 2 * M_PI / INT_CHAR_NORM_RANGE + M_PI);
57  sin_table[i] = sin(i * 2 * M_PI / INT_CHAR_NORM_RANGE + M_PI);
58  }
59  atan_table_init = true;
60  }
61  atan_table_mutex.Unlock();
62 }
FCOORD
Definition: points.h:189
INT_CHAR_NORM_RANGE
#define INT_CHAR_NORM_RANGE
Definition: intproto.h:130
tesseract::CCUtilMutex
Definition: ccutil.h:40
tesseract::CCUtilMutex::Lock
void Lock()
Definition: ccutil.cpp:37
tesseract::CCUtilMutex::Unlock
void Unlock()
Definition: ccutil.cpp:45