Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 3/22/2024
Public
Document Table of Contents

FilterBilateralBorderInit

Initializes the bilateral context structure.

Syntax

IppStatus ippiFilterBilateralBorderInit(IppiFilterBilateralType filter, IppiSize dstRoiSize, int radius, IppDataType dataType, int numChannels, IppiDistanceMethodType distMethod, Ipp32f valSquareSigma, Ipp32f posSquareSigma, IppiFilterBilateralSpec* pSpec);

Platform-aware function

IppStatus ippiFilterBilateralBorderInit_L(IppiFilterBilateralType filter, IppiSizeL dstRoiSize, int radius, IppDataType dataType, int numChannels, IppiDistanceMethodType distMethod, Ipp32f valSquareSigma, Ipp32f posSquareSigma, IppiFilterBilateralSpec* pSpec);

Threading layer function

IppStatus ippiFilterBilateralBorderInit_LT(IppiFilterBilateralType filter, IppiSizeL dstRoiSize, int radius, IppDataType dataType, int numChannels, IppiDistanceMethodType distMethod, Ipp32f valSquareSigma, Ipp32f posSquareSigma, IppiFilterBilateralSpec_LT* pSpec);

Include Files

ippi.h

Flavors with the _LT suffix: ippi_tl.h

Flavors with the _L suffix: ippi_l.h

Domain Dependencies

Flavors declared in ippi.h:

Headers: ippcore.h, ippvm.h, ipps.h

Libraries: ippcore.lib, ippvm.lib, ipps.lib

Flavors declared in ippi_tl.h:

Libraries: ippcore.lib, ippvm.lib, ipps.lib, ippi.lib, ippcore_tl.lib, ippi_tl.lib

Parameters

filter

Type of the bilateral filter. Possible value is ippiFilterBilateralGauss - Gaussian bilateral filter.

dstRoiSize

Size of the destination ROI in pixels.

radius

Radius of the round kernel. The radius value equal to 1 corresponds to distance between the closest pixels.

dataType

Data type of the source and destination images. Possible values are ipp8u and ipp32f.

numChannels

Number of channels in the images.

distMethod

Method of defining intensive distance between pixels. Possible value is ippDistNormL1.

valSquareSigma

Square of the sigma for intensive distance between pixels.

posSquareSigma

Square of the sigma for geometric distance between pixels.

pSpec

Pointer to the bilateral context structure.

Description

This function initializes the bilateral context structure pSpecSize for bilateral filtering. Before using this function, compute the size of the context structure using the FilterBilateralBorderGetBufferSize function.

The radius parameter specifies the radius of the round filter kernel. The radius value equal to 1 corresponds to the distance between centers of the closest pixels.

Coefficients of the bilateral filter kernel depend on their positions in the kernel and on the intensity value of the source image pixels lying in the kernel.

The value of the output pixel d is computed by the following formula:

For all i and j that i*i+j*j<=radius*radius (for central pixel of the kernel i=0, j=0)

where

  • vij is the value (or channel values) of a pixel in the kernel with coordinates i and j

  • w1ij=Fun(valSquareSigma, Intensity Distance(vij, v00))

    The distMethodType parameter specifies the method of defining the intensive distance between pixels. Currently the only supported method is ippDistNormL1, which defines the intensive distance as norma L1.

  • w2ij=Fun(posSquareSigma, Geometric Distance(vij, v00)=sqrt(i*i+j*j))

Fun(S, I)=exp(-I*I/2*S)

where

  • S is valSquareSigma or posSquareSigma

  • I is the difference between pixel values or position

For an example on how to use this function, refer to the example provided with the FilterBilateralBorder function description.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error.

ippStsNullPtrErr

Indicates an error when pSpec is NULL.

ippStsSizeErr

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

ippStsMaskSizeErr

Indicates an error whenradius is less than, or equal to zero.

ippStsNotSupportedModeErr

Indicates an error when the filter or distMethod value is not supported.

ippStsBadArgErr

Indicates an error when valSquareSigma or posSquareSigma is less than, or equal to zero.

ippStsNumChannelsErr

Indicates an error when numChannels has an illegal value.

See Also