src/search_engine/relja_retrival/external/KMCode_relja/descriptor/dog.cpp
/* Same as _HorConvSqrt2, but convolve along vertical direction.
*/
Same as _HorConvSqrt2, but convolve along vertical direction.
Same as _HorConvSqrt2 but convolve along vertical direction .
void _VerConvSqrt2( DARY *image,  DARY *result)
{
    int rows, cols, r, c;
    float **pix, **rpix, p1;
    rows = image->y();
    cols = image->x();
    pix = image->fel;
    rpix = result->fel;
    for (c = 0; c < cols; c++) {
      for (r = 3; r < rows - 3; r++) {
	rpix[r][c] = 0.030 * pix[r-3][c] + 0.105 * pix[r-2][c] +
	  0.222 * pix[r-1][c] + 0.286 * pix[r][c] + 0.222 * pix[r+1][c] +
	  0.105 * pix[r+2][c] + 0.030 * pix[r+3][c];
      }
      for (r = 0; r < 3; r++) {
	p1 = (r < 1) ? pix[0][c] : pix[r-1][c];
	rpix[r][c] = 0.135 * pix[0][c] + 0.222 * p1 +
	  0.286 * pix[r][c] + 0.222 * pix[r+1][c] +
	  0.105 * pix[r+2][c] + 0.030 * pix[r+3][c];
      }
      for (r = rows - 3; r < rows; r++) {
	p1 = (r >= rows - 1) ? pix[rows-1][c] : pix[r+1][c];
	rpix[r][c] = 0.030 * pix[r-3][c] + 0.105 * pix[r-2][c] +
	  0.222 * pix[r-1][c] + 0.286 * pix[r][c] + 0.222 * p1 +
	  0.135 * pix[rows-1][c];
      }
    }
}
void _VerConvSqrt2 ( DARY * image , DARY * result ) { int rows , cols , r , c ; float * * pix , * * rpix , p1 ; rows = image -> y ( ) ; cols = image -> x ( ) ; pix = image -> fel ; rpix = result -> fel ; for ( c = 0 ; c < cols ; c ++ ) { for ( r = 3 ; r < rows - 3 ; r ++ ) { rpix [ r ] [ c ] = 0.030 * pix [ r - 3 ] [ c ] + 0.105 * pix [ r - 2 ] [ c ] + 0.222 * pix [ r - 1 ] [ c ] + 0.286 * pix [ r ] [ c ] + 0.222 * pix [ r + 1 ] [ c ] + 0.105 * pix [ r + 2 ] [ c ] + 0.030 * pix [ r + 3 ] [ c ] ; } for ( r = 0 ; r < 3 ; r ++ ) { p1 = ( r < 1 ) ? pix [ 0 ] [ c ] : pix [ r - 1 ] [ c ] ; rpix [ r ] [ c ] = 0.135 * pix [ 0 ] [ c ] + 0.222 * p1 + 0.286 * pix [ r ] [ c ] + 0.222 * pix [ r + 1 ] [ c ] + 0.105 * pix [ r + 2 ] [ c ] + 0.030 * pix [ r + 3 ] [ c ] ; } for ( r = rows - 3 ; r < rows ; r ++ ) { p1 = ( r >= rows - 1 ) ? pix [ rows - 1 ] [ c ] : pix [ r + 1 ] [ c ] ; rpix [ r ] [ c ] = 0.030 * pix [ r - 3 ] [ c ] + 0.105 * pix [ r - 2 ] [ c ] + 0.222 * pix [ r - 1 ] [ c ] + 0.286 * pix [ r ] [ c ] + 0.222 * p1 + 0.135 * pix [ rows - 1 ] [ c ] ; } } }
Same as _HorConvSqrt2, but convolve along vertical direction.
Same as _HorConvSqrt2 but convolve along vertical direction .
/* Handle easiest case of pixels that do not overlap the boundary. */ /* For pixels near boundary, use value of boundary pixel. */