3rdparty/OpenCV-2.3.0/modules/features2d/src/sift.cpp
static int is_extremum( IplImage*** dog_pyr, int octv, int intvl, int r, int c )
{
  double val = pixval32f( dog_pyr[octv][intvl], r, c );
  int i, j, k;

  /* check for maximum */
  if( val > 0 )
    {
      for( i = -1; i <= 1; i++ )
        for( j = -1; j <= 1; j++ )
          for( k = -1; k <= 1; k++ )
            if( val < pixval32f( dog_pyr[octv][intvl+i], r + j, c + k ) )
              return 0;
    }

  /* check for minimum */
  else
    {
      for( i = -1; i <= 1; i++ )
        for( j = -1; j <= 1; j++ )
          for( k = -1; k <= 1; k++ )
            if( val > pixval32f( dog_pyr[octv][intvl+i], r + j, c + k ) )
              return 0;
    }

  return 1;
}
/*
  Determines whether a pixel is a scale-space extremum by comparing it to it's
  3x3x3 pixel neighborhood.

  @param dog_pyr DoG scale space pyramid
  @param octv pixel's scale space octave
  @param intvl pixel's within-octave interval
  @param r pixel's image row
  @param c pixel's image col

  @return Returns 1 if the specified pixel is an extremum (max or min) among
    it's 3x3x3 pixel neighborhood.
*/
Determines whether a pixel is a scale-space extremum by comparing it to it's
3x3x3 pixel neighborhood.
Determines whether a pixel is a scale - space extremum by comparing it to it ' s 3x3x3 pixel neighborhood .
static int is_extremum( IplImage*** dog_pyr, int octv, int intvl, int r, int c )
{
  double val = pixval32f( dog_pyr[octv][intvl], r, c );
  int i, j, k;
  if( val > 0 )
    {
      for( i = -1; i <= 1; i++ )
        for( j = -1; j <= 1; j++ )
          for( k = -1; k <= 1; k++ )
            if( val < pixval32f( dog_pyr[octv][intvl+i], r + j, c + k ) )
              return 0;
    }
  else
    {
      for( i = -1; i <= 1; i++ )
        for( j = -1; j <= 1; j++ )
          for( k = -1; k <= 1; k++ )
            if( val > pixval32f( dog_pyr[octv][intvl+i], r + j, c + k ) )
              return 0;
    }
  return 1;
}
static int is_extremum ( IplImage * * * dog_pyr , int octv , int intvl , int r , int c ) { double val = pixval32f ( dog_pyr [ octv ] [ intvl ] , r , c ) ; int i , j , k ; if ( val > 0 ) { for ( i = -1 ; i <= 1 ; i ++ ) for ( j = -1 ; j <= 1 ; j ++ ) for ( k = -1 ; k <= 1 ; k ++ ) if ( val < pixval32f ( dog_pyr [ octv ] [ intvl + i ] , r + j , c + k ) ) return 0 ; } else { for ( i = -1 ; i <= 1 ; i ++ ) for ( j = -1 ; j <= 1 ; j ++ ) for ( k = -1 ; k <= 1 ; k ++ ) if ( val > pixval32f ( dog_pyr [ octv ] [ intvl + i ] , r + j , c + k ) ) return 0 ; } return 1 ; }
Determines whether a pixel is a scale-space extremum by comparing it to it's
3x3x3 pixel neighborhood.
Determines whether a pixel is a scale - space extremum by comparing it to it ' s 3x3x3 pixel neighborhood .
/* check for maximum */ /* check for minimum */