MCPcopy Create free account
hub / github.com/Smorodov/Multitarget-tracker / acosTable

Function acosTable

src/Tracker/staple/fhog.cpp:64–73  ·  view source on GitHub ↗

build lookup table a[] s.t. a[x*n]~=acos(x) for x in [-1,1]

Source from the content-addressed store, hash-verified

62
63// build lookup table a[] s.t. a[x*n]~=acos(x) for x in [-1,1]
64float* acosTable() {
65 const int n=10000, b=10; int i;
66 static float a[n*2+b*2]; static bool init=false;
67 float *a1=a+n+b; if( init ) return a1;
68 for( i=-n-b; i<-n; i++ ) a1[i]=PI;
69 for( i=-n; i<n; i++ ) a1[i]=float(acos(i/float(n)));
70 for( i=n; i<n+b; i++ ) a1[i]=0;
71 for( i=-n-b; i<n/10; i++ ) if( a1[i] > PI-1e-6f ) a1[i]=PI-1e-6f;
72 init=true; return a1;
73}
74
75// compute gradient magnitude and orientation at each location (uses sse)
76void gradMag( float *I, float *M, float *O, int h, int w, int d, bool full ) {

Callers 1

gradMagFunction · 0.85

Calls 1

acosFunction · 0.85

Tested by

no test coverage detected