MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / normalizeDesc

Function normalizeDesc

src/backend/cpu/kernel/sift.hpp:502–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500}
501
502void normalizeDesc(float* desc, const int histlen) {
503 float len_sq = 0.0f;
504
505 for (int i = 0; i < histlen; i++) len_sq += desc[i] * desc[i];
506
507 float len_inv = 1.0f / sqrt(len_sq);
508
509 for (int i = 0; i < histlen; i++) { desc[i] *= len_inv; }
510}
511
512// Computes feature descriptors for features in an array. Based on Section 6
513// of Lowe's paper.

Callers 2

computeDescriptorFunction · 0.70
computeGLOHDescriptorFunction · 0.70

Calls 1

sqrtFunction · 0.85

Tested by

no test coverage detected