| 397 | // doubles (and with a float form of HatFit) was slower. |
| 398 | |
| 399 | VEC Hat::Desc_( // return HAT descriptor, Init_ must be called first |
| 400 | const double x, // in: x coord of center of patch (may be off image) |
| 401 | const double y) // in: y coord of center of patch (may be off image) |
| 402 | const |
| 403 | { |
| 404 | CV_Assert(magmat_.rows); // verify that Hat::Init_ was called |
| 405 | |
| 406 | #if _OPENMP // can't be static because multiple instances |
| 407 | vec_double mags, orients; |
| 408 | vec_double histbins; |
| 409 | #else // static faster since size rarely changes |
| 410 | static vec_double mags, orients; // the image patch grad mags and orientations |
| 411 | static vec_double histbins; // the histograms |
| 412 | #endif |
| 413 | |
| 414 | GetMagsAndOrients(mags, orients, |
| 415 | cvRound(x), cvRound(y), patchwidth_, |
| 416 | magmat_, orientmat_, pixelweights_); |
| 417 | |
| 418 | GetHistograms(histbins, |
| 419 | patchwidth_, mags, orients, |
| 420 | row_indices_, row_fracs_, col_indices_, col_fracs_); |
| 421 | |
| 422 | WrapHistograms(histbins); // wrap 360 degrees back to 0 |
| 423 | |
| 424 | VEC desc(GRIDHEIGHT * GRIDWIDTH * BINS_PER_HIST, 1); // the HAT descriptor |
| 425 | |
| 426 | CopyHistsToDesc(desc, |
| 427 | histbins); |
| 428 | |
| 429 | NormalizeDesc(desc); |
| 430 | |
| 431 | return desc; |
| 432 | } |
| 433 | |
| 434 | } // namespace stasm |
no test coverage detected