36 #include <visp3/core/vpGaussianFilter.h> 37 #include <visp3/core/vpImageConvert.h> 38 #include <Simd/SimdLib.h> 40 #ifndef DOXYGEN_SHOULD_SKIP_THIS 41 class vpGaussianFilter::Impl
44 Impl(
unsigned int width,
unsigned int height,
float sigma,
bool deinterleave)
45 : m_funcPtrGray(NULL), m_funcPtrRGBa(NULL), m_deinterleave(deinterleave)
47 const float epsilon = 0.001f;
49 const size_t channels = 1;
50 m_funcPtrGray = SimdGaussianBlurInit(width, height, channels, &sigma, &epsilon);
53 const size_t channels = 4;
54 m_funcPtrRGBa = SimdGaussianBlurInit(width, height, channels, &sigma, &epsilon);
58 m_red.resize(height, width);
59 m_green.resize(height, width);
60 m_blue.resize(height, width);
62 m_redBlurred.resize(height, width);
63 m_greenBlurred.resize(height, width);
64 m_blueBlurred.resize(height, width);
71 SimdRelease(m_funcPtrGray);
75 SimdRelease(m_funcPtrRGBa);
88 if (!m_deinterleave) {
89 SimdGaussianBlurRun(m_funcPtrRGBa, reinterpret_cast<unsigned char *>(I.
bitmap), I.
getWidth()*4,
90 reinterpret_cast<unsigned char *
>(I_blur.
bitmap), I_blur.
getWidth()*4);
93 SimdGaussianBlurRun(m_funcPtrGray, m_red.bitmap, m_red.getWidth(), m_redBlurred.bitmap, m_redBlurred.getWidth());
94 SimdGaussianBlurRun(m_funcPtrGray, m_green.bitmap, m_green.getWidth(), m_greenBlurred.bitmap, m_greenBlurred.getWidth());
95 SimdGaussianBlurRun(m_funcPtrGray, m_blue.bitmap, m_blue.getWidth(), m_blueBlurred.bitmap, m_blueBlurred.getWidth());
102 void * m_funcPtrGray;
103 void * m_funcPtrRGBa;
112 #endif // DOXYGEN_SHOULD_SKIP_THIS 124 : m_impl(new Impl(width, height, sigma, deinterleave))
141 m_impl->apply(I, I_blur);
152 m_impl->apply(I, I_blur);
void resize(unsigned int h, unsigned int w)
resize the image : Image initialization
Type * bitmap
points toward the bitmap
void apply(const vpImage< unsigned char > &I, vpImage< unsigned char > &I_blur)
vpGaussianFilter(unsigned int width, unsigned int height, float sigma, bool deinterleave=false)
virtual ~vpGaussianFilter()
static void split(const vpImage< vpRGBa > &src, vpImage< unsigned char > *pR, vpImage< unsigned char > *pG, vpImage< unsigned char > *pB, vpImage< unsigned char > *pa=NULL)
static void merge(const vpImage< unsigned char > *R, const vpImage< unsigned char > *G, const vpImage< unsigned char > *B, const vpImage< unsigned char > *a, vpImage< vpRGBa > &RGBa)
unsigned int getHeight() const
unsigned int getWidth() const