src/search_engine/relja_retrival/external/KMCode_relja/descriptor/dog.cpp
/* Find the position of the key point by interpolation in position, and
   create key vector.  Output its location as a square.
     The (grad2,ori2) provide gradient and orientation sampled one octave
   above that of (grad,ori).
*/
Find the position of the key point by interpolation in position, and
create key vector.  Output its location as a square.
The (grad2,ori2) provide gradient and orientation sampled one octave
above that of (grad,ori).
Find the position of the key point by interpolation in position and create key vector . Output its location as a square . The ( grad2 ori2 ) provide gradient and orientation sampled one octave above that of ( grad ori ) .
void InterpKeyPoint(int level, DARY *dog, DARY *grad, DARY *ori, 
		    DARY *grad2, DARY *ori2, int r, int c, float scale, 
		    vector<CornerDescriptor*> &corners)
{
  float center, lscale, rval, cval, opeak;
    center = dog->fel[r][c];
    lscale = 1.414 * pow(1.5, (double) level);
    rval = r + InterpPeak(dog->fel[r-1][c], center, dog->fel[r+1][c]);
    cval = c + InterpPeak(dog->fel[r][c-1], center, dog->fel[r][c+1]);
    rval = (rval + 1.0) * lscale / 1.414;
    cval = (cval + 1.0) * lscale / 1.414;
    opeak = FindOri(grad, ori, r, c);
    corners.push_back(new CornerDescriptor(cval,rval,rval,lscale,opeak));
    corners[corners.size()-1]->setType(3);
}
void InterpKeyPoint ( int level , DARY * dog , DARY * grad , DARY * ori , DARY * grad2 , DARY * ori2 , int r , int c , float scale , vector < CornerDescriptor * > & corners ) { float center , lscale , rval , cval , opeak ; center = dog -> fel [ r ] [ c ] ; lscale = 1.414 * pow ( 1.5 , ( double ) level ) ; rval = r + InterpPeak ( dog -> fel [ r - 1 ] [ c ] , center , dog -> fel [ r + 1 ] [ c ] ) ; cval = c + InterpPeak ( dog -> fel [ r ] [ c - 1 ] , center , dog -> fel [ r ] [ c + 1 ] ) ; rval = ( rval + 1.0 ) * lscale / 1.414 ; cval = ( cval + 1.0 ) * lscale / 1.414 ; opeak = FindOri ( grad , ori , r , c ) ; corners . push_back ( new CornerDescriptor ( cval , rval , rval , lscale , opeak ) ) ; corners [ corners . size ( ) - 1 ] -> setType ( 3 ) ; }
Find the position of the key point by interpolation in position, and
create key vector.
Find the position of the key point by interpolation in position and create key vector .
/* Scale relative to input image.  Represents size of Gaussian
       for smaller of DOG filters used at this scale. */ /* Scale up center location to account for level's scale change.
       A peak at (0,0) in gradient image would be at (0.5,0,5) in
       original image.  Add another 0.5 to place at pixel center.
       Therefore, peak at (0,0) gives location on boundary from 0 to 1. */ /* If image was floatd to find keypoints, then row,col must be reduced
       by factor of 2 to put in coordinates of original image. */ /* Find orientation(s) for this keypoint.*/ //MakeKeypoint(lscale, opeak, r, c, rval, cval, grad, ori, grad2, ori2);