src/search_engine/relja_retrival/external/KMCode_relja/descriptor/dog.cpp
/* Check whether 20 points sampled on a ring of radius 3 pixels around
   the center point are all less than Dip * "val".
*/
Check whether 20 points sampled on a ring of radius 3 pixels around
the center point are all less than Dip * "val".
Check whether 20 points sampled on a ring of radius 3 pixels around the center point are all less than Dip * " val " .
int CheckDip(float val, DARY *image, int row, int col)
{
    float x, y, nx, ny, cosine, sine;
    int i;
    float Dip=0.95;
    x = 3.0;
    y = 0.0;
    sine = sin(M_PI / 20.0);
    cosine = cos(M_PI / 20.0);
    for (i = 0; i < 40; i++) {
	if (! CheckDipPoint(Dip * val, image, row + 0.5 + y, col + 0.5 + x))
	    return 0;
	nx = cosine * x - sine * y;
	ny = sine * x + cosine * y;
	x = nx;
	y = ny;
    }
    return 1;
}
int CheckDip ( float val , DARY * image , int row , int col ) { float x , y , nx , ny , cosine , sine ; int i ; float Dip = 0.95 ; x = 3.0 ; y = 0.0 ; sine = sin ( M_PI / 20.0 ) ; cosine = cos ( M_PI / 20.0 ) ; for ( i = 0 ; i < 40 ; i ++ ) { if ( ! CheckDipPoint ( Dip * val , image , row + 0.5 + y , col + 0.5 + x ) ) return 0 ; nx = cosine * x - sine * y ; ny = sine * x + cosine * y ; x = nx ; y = ny ; } return 1 ; }
Check whether 20 points sampled on a ring of radius 3 pixels around
the center point are all less than Dip * "val".
Check whether 20 points sampled on a ring of radius 3 pixels around the center point are all less than Dip * " val " .
/* Create a vector of length 4 pixels (2*scale was used in orig). */ /* Rotate this vector around a circle in increments of PI/20 and
       check the dip of each point. */