src/search_engine/relja_retrival/external/KMCode_relja/descriptor/dog.cpp
/* Find a peak in the histogram and return corresponding angle.
*/
Find a peak in the histogram and return corresponding angle.
Find a peak in the histogram and return corresponding angle .
float FindOriPeaks(float *hist, int bins)
{
    int i, maxloc = 0;
    float maxval = 0.0;
    for (i = 0; i < bins; i++)
      if (hist[i] > maxval) {
	maxval = hist[i];
	maxloc = i;
      }
    return (2.0 * M_PI * (maxloc + 0.5) / bins - M_PI);
}
float FindOriPeaks ( float * hist , int bins ) { int i , maxloc = 0 ; float maxval = 0.0 ; for ( i = 0 ; i < bins ; i ++ ) if ( hist [ i ] > maxval ) { maxval = hist [ i ] ; maxloc = i ; } return ( 2.0 * M_PI * ( maxloc + 0.5 ) / bins - M_PI ) ; }
Find a peak in the histogram and return corresponding angle.
Find a peak in the histogram and return corresponding angle .
/* Find peak in histogram. */ /* Set angle in range -PI to PI. */