MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / NormalizeDesc

Function NormalizeDesc

jni/stasm/hat.cpp:372–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372static void NormalizeDesc( // take sqrt of elems and divide by L2 norm
373 VEC& desc) // io
374{
375 double* const data = Buf(desc);
376 for (int i = 0; i < NSIZE(desc); i++)
377 data[i] = sqrt(data[i]); // sqrt reduces effect of outliers
378 const double norm = cv::norm(desc); // L2 norm
379 if (!IsZero(norm))
380 {
381 const double scale = FINAL_SCALE / norm;
382 for (int i = 0; i < NSIZE(desc); i++)
383 data[i] *= scale;
384 }
385}
386
387// Hat::Init_ must be called before calling this function.
388//

Callers 1

Desc_Method · 0.85

Calls 3

BufFunction · 0.85
NSIZEFunction · 0.85
IsZeroFunction · 0.85

Tested by

no test coverage detected