src/search_engine/relja_retrival/external/KMCode_relja/descriptor/dog.cpp
/* Convolve image with the a 1-D Gaussian kernel vector along image rows.
   The Gaussian has a sigma of sqrt(2), which results in the following kernel:
     (.030 .105 .222 .286 .222 .105 .030)
   Pixels outside the image are set to the value of the closest image pixel.
*/
Convolve image with the a 1-D Gaussian kernel vector along image rows.
The Gaussian has a sigma of sqrt(2), which results in the following kernel:
(.030 .105 .222 .286 .222 .105 .030)
Pixels outside the image are set to the value of the closest image pixel.
Convolve image with the a 1 - D Gaussian kernel vector along image rows . The Gaussian has a sigma of sqrt ( 2 ) which results in the following kernel : ( . 030 . 105 . 222 . 286 . 222 . 105 . 030 ) Pixels outside the image are set to the value of the closest image pixel .
void _HorConvSqrt2(DARY *image,  DARY *result)
{
    int rows, cols, r, c;
    float **pix, **rpix, *prc, p1;
    rows = image->y();
    cols = image->x();
    pix = image->fel;
    rpix = result->fel;
    for (r = 0; r < rows; r++) {
      for (c = 3; c < cols - 3; c++) {
	prc =  pix[r] + c;
	rpix[r][c] = 0.030 * prc[-3] + 0.105 * prc[-2] + 0.222 * prc[-1] +
	  0.286 * prc[0] + 0.222 * prc[1] + 0.105 * prc[2] + 0.030 * prc[3];
      }
      for (c = 0; c < 3; c++) {
	p1 = (c < 1) ? pix[r][0] : pix[r][c-1];
	prc =  pix[r] + c;
	rpix[r][c] = 0.135 * pix[r][0] + 0.222 * p1 +
	  0.286 * prc[0] + 0.222 * prc[1] + 0.105 * prc[2] + 0.030 * prc[3];
      }
      for (c = cols - 3; c < cols; c++) {
	p1 = (c >= cols - 1) ? pix[r][cols-1] : pix[r][c+1];
	prc =  pix[r] + c;
	rpix[r][c] = 0.030 * prc[-3] + 0.105 * prc[-2] + 0.222 * prc[-1] +
	  0.286 * prc[0] + 0.222 * p1 + 0.135 * pix[r][cols-1];
      }
    }
}
void _HorConvSqrt2 ( DARY * image , DARY * result ) { int rows , cols , r , c ; float * * pix , * * rpix , * prc , p1 ; rows = image -> y ( ) ; cols = image -> x ( ) ; pix = image -> fel ; rpix = result -> fel ; for ( r = 0 ; r < rows ; r ++ ) { for ( c = 3 ; c < cols - 3 ; c ++ ) { prc = pix [ r ] + c ; rpix [ r ] [ c ] = 0.030 * prc [ -3 ] + 0.105 * prc [ -2 ] + 0.222 * prc [ -1 ] + 0.286 * prc [ 0 ] + 0.222 * prc [ 1 ] + 0.105 * prc [ 2 ] + 0.030 * prc [ 3 ] ; } for ( c = 0 ; c < 3 ; c ++ ) { p1 = ( c < 1 ) ? pix [ r ] [ 0 ] : pix [ r ] [ c - 1 ] ; prc = pix [ r ] + c ; rpix [ r ] [ c ] = 0.135 * pix [ r ] [ 0 ] + 0.222 * p1 + 0.286 * prc [ 0 ] + 0.222 * prc [ 1 ] + 0.105 * prc [ 2 ] + 0.030 * prc [ 3 ] ; } for ( c = cols - 3 ; c < cols ; c ++ ) { p1 = ( c >= cols - 1 ) ? pix [ r ] [ cols - 1 ] : pix [ r ] [ c + 1 ] ; prc = pix [ r ] + c ; rpix [ r ] [ c ] = 0.030 * prc [ -3 ] + 0.105 * prc [ -2 ] + 0.222 * prc [ -1 ] + 0.286 * prc [ 0 ] + 0.222 * p1 + 0.135 * pix [ r ] [ cols - 1 ] ; } } }
Convolve image with the a 1-D Gaussian kernel vector along image rows.
Convolve image with the a 1 - D Gaussian kernel vector along image rows .
/* Handle easiest case of pixels that do not overlap the boundary. */ /* For pixels near boundary, use value of boundary pixel. */