3rdparty/OpenCV-2.3.0/modules/features2d/src/sift.cpp
static int is_too_edge_like( IplImage* dog_img, int r, int c, int curv_thr )
{
  double d, dxx, dyy, dxy, tr, det;

  /* principal curvatures are computed using the trace and det of Hessian */
  d = pixval32f(dog_img, r, c);
  dxx = pixval32f( dog_img, r, c+1 ) + pixval32f( dog_img, r, c-1 ) - 2 * d;
  dyy = pixval32f( dog_img, r+1, c ) + pixval32f( dog_img, r-1, c ) - 2 * d;
  dxy = ( pixval32f(dog_img, r+1, c+1) - pixval32f(dog_img, r+1, c-1) -
          pixval32f(dog_img, r-1, c+1) + pixval32f(dog_img, r-1, c-1) ) / 4.0;
  tr = dxx + dyy;
  det = dxx * dyy - dxy * dxy;

  /* negative determinant -> curvatures have different signs; reject feature */
  if( det <= 0 )
    return 1;

  if( tr * tr / det < ( curv_thr + 1.0 )*( curv_thr + 1.0 ) / curv_thr )
    return 0;
  return 1;
}
/*
  Determines whether a feature is too edge like to be stable by computing the
  ratio of principal curvatures at that feature.  Based on Section 4.1 of
  Lowe's paper.

  @param dog_img image from the DoG pyramid in which feature was detected
  @param r feature row
  @param c feature col
  @param curv_thr high threshold on ratio of principal curvatures

  @return Returns 0 if the feature at (r,c) in dog_img is sufficiently
    corner-like or 1 otherwise.
*/
Determines whether a feature is too edge like to be stable by computing the
ratio of principal curvatures at that feature.  Based on Section 4.1 of
Lowe's paper.
Determines whether a feature is too edge like to be stable by computing the ratio of principal curvatures at that feature . Based on Section 4 . 1 of Lowe ' s paper .
static int is_too_edge_like( IplImage* dog_img, int r, int c, int curv_thr )
{
  double d, dxx, dyy, dxy, tr, det;
  d = pixval32f(dog_img, r, c);
  dxx = pixval32f( dog_img, r, c+1 ) + pixval32f( dog_img, r, c-1 ) - 2 * d;
  dyy = pixval32f( dog_img, r+1, c ) + pixval32f( dog_img, r-1, c ) - 2 * d;
  dxy = ( pixval32f(dog_img, r+1, c+1) - pixval32f(dog_img, r+1, c-1) -
          pixval32f(dog_img, r-1, c+1) + pixval32f(dog_img, r-1, c-1) ) / 4.0;
  tr = dxx + dyy;
  det = dxx * dyy - dxy * dxy;
  if( det <= 0 )
    return 1;
  if( tr * tr / det < ( curv_thr + 1.0 )*( curv_thr + 1.0 ) / curv_thr )
    return 0;
  return 1;
}
static int is_too_edge_like ( IplImage * dog_img , int r , int c , int curv_thr ) { double d , dxx , dyy , dxy , tr , det ; d = pixval32f ( dog_img , r , c ) ; dxx = pixval32f ( dog_img , r , c + 1 ) + pixval32f ( dog_img , r , c - 1 ) - 2 * d ; dyy = pixval32f ( dog_img , r + 1 , c ) + pixval32f ( dog_img , r - 1 , c ) - 2 * d ; dxy = ( pixval32f ( dog_img , r + 1 , c + 1 ) - pixval32f ( dog_img , r + 1 , c - 1 ) - pixval32f ( dog_img , r - 1 , c + 1 ) + pixval32f ( dog_img , r - 1 , c - 1 ) ) / 4.0 ; tr = dxx + dyy ; det = dxx * dyy - dxy * dxy ; if ( det <= 0 ) return 1 ; if ( tr * tr / det < ( curv_thr + 1.0 ) * ( curv_thr + 1.0 ) / curv_thr ) return 0 ; return 1 ; }
Determines whether a feature is too edge like to be stable by computing the
ratio of principal curvatures at that feature.
Determines whether a feature is too edge like to be stable by computing the ratio of principal curvatures at that feature .
/* principal curvatures are computed using the trace and det of Hessian */ /* negative determinant -> curvatures have different signs; reject feature */