src/search_engine/relja_retrival/external/KMCode_relja/descriptor/dog.cpp
/* Find the local maxima and minima of the DOG images in the dog pyramid.
*/
Find the local maxima and minima of the DOG images in the dog pyramid.
Find the local maxima and minima of the DOG images in the dog pyramid .
void FindMaxMin(vector<DARY *> gauss,vector<DARY *> dog,vector<DARY *> ori,float scale, vector<CornerDescriptor*> &corners, 
		float thres)
{
    int i, r, c, rows, cols;
    float val;
    int levels=(int)dog.size();
    uint cor_nb=corners.size();
    for (i = 1; i < levels - 2; i++) {
      rows = dog[i]->y();
      cols = dog[i]->x();
      for (r = 5; r < rows - 5; r++)
	for (c = 5; c < cols - 5; c++) {
	  val = dog[i]->fel[r][c];
	  if (fabs(val) > thres  &&
	      LocalMaxMin(val, dog[i], r, c, 0,1.5) &&
	      LocalMaxMin(val, dog[i-1], r, c, -1,1.5) &&
	      LocalMaxMin(val, dog[i+1], r, c, 1,1.5) ){	   
	    InterpKeyPoint(i, dog[i],gauss[i],ori[i],
			   gauss[i + 2], ori[i + 2], r, c,scale, corners);
	  }
	}
      cout << "\rscale "<< (i*1.414)<< "      "<< flush;
      cor_nb=corners.size();
    }
}
void FindMaxMin ( vector < DARY * > gauss , vector < DARY * > dog , vector < DARY * > ori , float scale , vector < CornerDescriptor * > & corners , float thres ) { int i , r , c , rows , cols ; float val ; int levels = ( int ) dog . size ( ) ; uint cor_nb = corners . size ( ) ; for ( i = 1 ; i < levels - 2 ; i ++ ) { rows = dog [ i ] -> y ( ) ; cols = dog [ i ] -> x ( ) ; for ( r = 5 ; r < rows - 5 ; r ++ ) for ( c = 5 ; c < cols - 5 ; c ++ ) { val = dog [ i ] -> fel [ r ] [ c ] ; if ( fabs ( val ) > thres && LocalMaxMin ( val , dog [ i ] , r , c , 0 , 1.5 ) && LocalMaxMin ( val , dog [ i - 1 ] , r , c , -1 , 1.5 ) && LocalMaxMin ( val , dog [ i + 1 ] , r , c , 1 , 1.5 ) ) { InterpKeyPoint ( i , dog [ i ] , gauss [ i ] , ori [ i ] , gauss [ i + 2 ] , ori [ i + 2 ] , r , c , scale , corners ) ; } } cout << " \r " << ( i * 1.414 ) << " " << flush ; cor_nb = corners . size ( ) ; } }
Find the local maxima and minima of the DOG images in the dog pyramid.
Find the local maxima and minima of the DOG images in the dog pyramid .
// fprintf(stderr, "Searching %d image levels, from size %dx%d\n", //    (int)dog.size(), dog[0]->y(), dog[0]->x()); /* Search through each scale, leaving 1 scale below and 2 above. */ /* Only find peaks at least 5 pixels from borders. */ /*&&
	      CheckDip(val, dog[i], r, c)*/