| 500 | } |
| 501 | |
| 502 | void 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. |
no test coverage detected