FilterGauss

Filters an image using a Gaussian kernel.

Syntax

IppStatus ippiFilterGauss_<mod>(const Ipp<datatype>* pSrc, int srcStep, Ipp<datatype>* pDst, int dstStep, IppiSize dstRoiSize, IppiMaskSize mask);

Supported values for mod:

8u_C1R 16u_C1R 16s_C1R 32f_C1R
8u_C3R 16u_C3R 16s_C3R 32f_C3R
8u_C4R 16u_C4R 16s_C4R 32f_C4R
8u_AC4R 16u_AC4R 16s_AC4R 32f_AC4R

Parameters

pSrc

Pointer to the source image ROI.

srcStep

Distance in bytes between starts of consecutive lines in the source image.

pDst

Pointer to the destination image ROI.

dstStep

Distance in bytes between starts of consecutive lines in the destination image.

dstRoiSize

Size of the source and destination ROI in pixels.

mask

Predefined mask of IppiMaskSize type.

Description

The function ippiFilterGauss is declared in the ippi.h file. It operates with ROI (see Regions of Interest in Intel IPP). This function applies a lowpass Gaussian filter to an image ROI. The corresponding kernel is the matrix of either 3x3 or 5x5 size.

The 3x3 filter uses the kernel:

1/16 2/16 1/16
2/16 4/16 2/16
1/16 2/16 1/16

These filter coefficients correspond to a 2-dimensional Gaussian distribution with standard deviation 0.85.

The 5x5 filter uses the kernel:

2/571 7/571 12/571 7/571 2/571
7/571 31/571 52/571 31/571 7/571
12/571 52/571 127/571 52/571 12/571
7/571 31/571 52/571 31/571 7/571
2/571 7/571 12/571 7/571 2/571

These filter coefficients correspond to a 2-dimensional Gaussian distribution with standard deviation 1.0.

The anchor cell is the center cell of the kernels (red). The size of the source image ROI is equal to dstRoiSize, the size of the destination image ROI.

To ensure valid operation when image boundary pixels are processed, the application should correctly define additional border pixels (see Borders).

Example “Using the Logarithm Function” shows how to use the function ippiFilterGauss_8u_C1R.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or a warning.

ippStsNullPtrErr

Indicates an error condition if pSrc or pDst is NULL.

ippStsSizeErr

Indicates an error condition if dstRoiSize has a field with a zero or negative value.

ippStsStepErr

Indicates an error condition if srcStep or dstStep has a zero or negative value.

ippStsMaskSizeErr

Indicates an error condition if mask has an illegal value.

Using the Gauss Filter

Ipp8u src[9*9] = {
      0, 1, 2, 3, 4, 5, 6, 7, 0,
      1, 2, 3, 4, 5, 6, 7, 0, 1,
      2, 3, 4, 5, 6, 7, 0, 1, 2,
      3, 4, 5, 6, 7, 0, 1, 2, 3,
      4, 5, 6, 7, 0, 1, 2, 3, 4,
      5, 6, 7, 0, 1, 2, 3, 4, 5,
      6, 7, 0, 1, 2, 3, 4, 5, 6,
      7, 0, 1, 2, 3, 4, 5, 6, 7,
      0, 1, 2, 3, 4, 5, 6, 7, 0
   };
Ipp8u dst[9*9];
IppiSize roiSize = { 9, 9 };

ippiFilterGauss_8u_C1R ( src, 9, dst, 9, roiSize, ippMskSize5x5 );

Result:

0 1 2 3 4 5 6 7 0
1 2 3 4 5 6 7 0 1
2 3 4 5 6 7 0 1 2
3 4 5 6 7 0 1 2 3    src
4 5 6 7 0 1 2 3 4
5 6 7 0 1 2 3 4 5
6 7 0 1 2 3 4 5 6
7 0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7 0

80 62 58 59 60 60 60 57 44
26 15 14 15 15 16 15 12 09
05 04 04 05 05 04 03 02 02
03 04 05 05 04 03 02 02 03
04 05 05 04 03 02 02 03 04        dst
05 05 04 03 02 02 03 04 05
05 04 03 02 02 03 04 05 08
12 13 13 13 13 14 15 18 26
39 48 53 54 52 50 50 53 63

for example, on real picture it can look like this

                    size 128x128          size  124x124
                    roi  124x124           roi  124x124
                                          ippMskSize5x5



+ ippiAddRandGauss_Direct_8u_C3IR (.., 2, 50, 57328065)

                    size 128x128          size  124x124
                    roi  124x124           roi  124x124
                                          ippMskSize5x5




Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.