FilterBilateralInit

Initializes the bilateral filter structure.

Syntax

IppStatus ippiFilterBilateralInit_8u_C1R(IppiFilterBilateralType filter, IppiSize maxKernelSize, Ipp32f valSquareSigma, Ipp32f posSquareSigma, int stepInKernel, IppiFilterBilateralSpec* pSpec);

Parameters

filter

Type of the bilateral filter; possible value ippiFilterBilateralGauss - Gaussian bilateral filter.

maxKernelSize

Maximum size of the filter kernel.

valSquareSigma

Square of the sigma for differences of pixel values.

posSquareSigma

Square of the sigma for pixel positions.

stepInKernel

Processing step in the filter kernel.

pSpec

Pointer to the bilateral filter structure.

Description

The function ippiFilterBilateralInit is declared in the ippi.h file. It operates with ROI (see Regions of Interest in Intel IPP). This function initializes the state structure for the bilateral filter of the filter type in the external buffer. Size of the buffer must be computed by the function ippiFilterBilateralGetBufSize beforehand.

maxKernelSize specifies the maximum sizes of the filter kernel that should be the same as specified in the function ippiFilterBilateralGetBufSize.

The anchor cell is always the central cell of the kernel. Therefore, both dimensions of the filter kernel should be odd; if any of the sizes is even, the function changes its value to the nearest less odd number.

Coefficients of the bilateral filter kernel depend on their position in the kernel and on the value of some pixels of the source image laying in the kernel. Only pixels with both coordinates divisible by stepInKernel are used in calculations.

The value of the output pixel d is


Here vi,j - value of a pixel in the kernel with coordinates i and j (coordinates of the central pixel are 0, 0), i, j = -(kernelSize-1)/2, -((kernelSize-1)/2)+1, ..., -1, 0, 1, ((kernelSize-1)/2)-1, (kernelSize-1)/2.

W1i,j = Fun(valSquareSigma,(vi,j - v0,0)),

W2i,j = Fun(posSquareSigma,MaxByAbs(i,j))

where

- difference of pixel values,vi,j - v0,0



- pixel position,

valSquareSigma and posSquareSigma - squares of values of sigma for pixel differences and their positions respectively.

The Intel IPP functions implement only the Gaussian filtering, which reduces noise and smooths the image, but preserves edges. For the Gaussian filtering



S2 - valSquareSigma or posSquareSigma, I - difference of pixel values or position.

Example “Using Bilateral Filtering Functions” shows how to use the function ippiFilterBilateralInit.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error.

ippStsNullPtrErr

Indicates an error condition if the pointer pBufferSize is NULL.

ippStsSizeErr

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

ippStsMaskSizeErr

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

ippStsNotSupportedModeErr

Indicates an error condition if the type of the specified bilateral filter is not supported.

Submit feedback on this help topic

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