44 #ifndef vpImageFilter_H
45 #define vpImageFilter_H
53 #include <visp/vpImage.h>
54 #include <visp/vpImageException.h>
55 #include <visp/vpMatrix.h>
56 #include <visp/vpMath.h>
85 #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)
88 const unsigned int gaussianFilterSize,
89 const double thresholdCanny,
90 const unsigned int apertureSobel);
103 const unsigned int r,
const unsigned int c)
108 + 12.0 * ( fr[r-1][c] + fr[r][c-1] + fr[r+1][c] + fr[r][c+1] )
109 + 9.0 * ( fr[r-1][c-1] + fr[r+1][c-1] + fr[r-1][c+1] + fr[r+1][c+1])
110 + 5.0 * ( fr[r-2][c] + fr[r][c-2] + fr[r+2][c] + fr[r][c+2] )
111 + 4.0 * ( fr[r-2][c+1] + fr[r-2][c-1] + fr[r-1][c-2] + fr[r+1][c-2] +
112 fr[r+2][c-1] + fr[r+2][c+1] + fr[r-1][c+2] + fr[r+1][c+2] )
113 + 2.0 * ( fr[r-2][c-2] + fr[r+2][c-2] + fr[r-2][c+2] + fr[r+2][c+2] )
130 const unsigned int r,
const unsigned int c)
132 return (2047.0 *(fr[r][c+1] - fr[r][c-1])
133 +913.0 *(fr[r][c+2] - fr[r][c-2])
134 +112.0 *(fr[r][c+3] - fr[r][c-3]))/8418.0;
147 const unsigned int r,
const unsigned int c)
149 return (2047.0 *(fr[r+1][c] - fr[r-1][c])
150 +913.0 *(fr[r+2][c] - fr[r-2][c])
151 +112.0 *(fr[r+3][c] - fr[r-3][c]))/8418.0;
168 filter =
new double[t/2] ;
172 for(i=1; i<=(t-1)/2; i++)
174 filter[i] = (i/(s2*sqrt(2*M_PI)))*exp((i*i)/(-2*s2));
196 const unsigned int r,
const unsigned int c,
197 double *filter,
const unsigned int size)
204 for(i=1; i<=(size-1)/2; i++)
206 result += filter[i]*(I[r][c+i] - I[r][c-i]) ;
227 const unsigned int r,
const unsigned int c,
228 double *filter,
const unsigned int size)
235 for(i=1; i<=(size-1)/2; i++)
237 result += filter[i]*(I[r+i][c] - I[r-i][c]) ;
Definition of the vpMatrix class.
static void coefficientGaussianDerivative(double *filter, const unsigned int t)
static double gaussianFilter(vpImage< T > &fr, const unsigned int r, const unsigned int c)
static double derivativeFilterY(vpImage< T > &I, const unsigned int r, const unsigned int c, double *filter, const unsigned int size)
static double derivativeFilterX(vpImage< T > &fr, const unsigned int r, const unsigned int c)
static double derivativeFilterX(vpImage< T > &I, const unsigned int r, const unsigned int c, double *filter, const unsigned int size)
static double derivativeFilterY(vpImage< T > &fr, const unsigned int r, const unsigned int c)
static double sqr(double x)
Definition of the vpImage class member functions.
Various image filter, convolution, etc...