| 358 | } |
| 359 | |
| 360 | static void CopyHistsToDesc( // copy histograms to descriptor, skipping pad bins |
| 361 | VEC& desc, // out |
| 362 | const vec_double& histbins) // in |
| 363 | { |
| 364 | for (int row = 0; row < GRIDHEIGHT; row++) |
| 365 | for (int col = 0; col < GRIDWIDTH; col++) |
| 366 | memcpy(Buf(desc) + |
| 367 | (row * GRIDWIDTH + col) * BINS_PER_HIST, |
| 368 | &histbins[HistIndex(row, col, 0)], |
| 369 | BINS_PER_HIST * sizeof(histbins[0])); |
| 370 | } |
| 371 | |
| 372 | static void NormalizeDesc( // take sqrt of elems and divide by L2 norm |
| 373 | VEC& desc) // io |