FilterBilateralInit
Initializes the bilateral context structure.
Syntax
IppStatus ippiFilterBilateralInit(IppiFilterBilateralType
filter
, IppiSize
dstRoiSize
, int
kernelWidthHeight
, IppDataType
dataType
, int
numChannels
, IppiDistanceMethodType
distMethod
, Ipp64f
valSquareSigma
, Ipp64f
posSquareSigma
, IppiFilterBilateralSpec*
pSpec
);
Platform-aware function
IppStatus ippiFilterBilateralInit_L(IppiFilterBilateralType
filter
, IppiSizeL
dstRoiSize
, IppSizeL
kernelWidthHeight
, IppDataType
dataType
, int
numChannels
, IppiDistanceMethodType
distMethod
, Ipp64f
valSquareSigma
, Ipp64f
posSquareSigma
, IppiFilterBilateralSpec*
pSpec
);
Threading Layer (TL) function based on the Platform Aware API
IppStatus ippiFilterBilateralInit_LT(IppiFilterBilateralType
filter
, IppiSizeL
dstRoiSize
, IppSizeL
kernelWidthHeight
, IppDataType
dataType
, int
numChannels
, IppiDistanceMethodType
distMethod
, Ipp64f
valSquareSigma
, Ipp64f
posSquareSigma
, IppiFilterBilateralSpec_LT*
pSpec
);
Threading Layer (TL) function based on the Classic API
IppStatus ippiFilterBilateralInit_T(IppiFilterBilateralType
filter
, IppiSize
dstRoiSize
, int
kernelWidthHeight
, IppDataType
dataType
, int
numChannels
, IppiDistanceMethodType
distMethod
, Ipp64f
valSquareSigma
, Ipp64f
posSquareSigma
, IppiFilterBilateralSpec_T*
pSpec
);
Include Files
ippi.h
ippi_l.h
ippi_tl.h
Domain Dependencies
Flavors declared in
ippi.h
:Headers:
ippcore.h
,
ippvm.h
,
ipps.h
Libraries:
ippcore.lib
,
ippvm.lib
,
ipps.lib
Parameters
- filter
- Type of the bilateral filter. Possible value isippiFilterBilateralGauss- Gaussian bilateral filter.
- dstRoiSize
- Size of the destination ROI in pixels.
- kernelWidthHeight
- Linear dimension of the square kernel. The value 1 corresponds to the distance between two adjacent pixels.
- dataType
- Data type of the source and destination images. Possible values areipp8u,ipp32f, andipp64f.
- numChannels
- Number of channels in the images.
- distMethod
- Method of defining the differences in intensity between pixels. Depending on the number of channels in the image, possible value are:
- numChannelsvalue
- PossibledistMethodvalues
- 1
- ippDistNormL1
- 3
- ippDistNormL1,ippDistNormL2
- valSquareSigma
- Square of the range parameter, which controls smoothing based on the differences in intensity between pixels.
- posSquareSigma
- Square of the spatial parameter, which controls smoothing based on the 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 FilterBilateralGetBufferSize
function.The
kernelWidthHeight
parameter specifies the linear dimension of the square filter kernel. The value 1 corresponds to the distance between the centers of two adjacent 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 indices
i
and j
that fit within the square kernelwhere
- vis the value (or channel values) of a pixel in the kernel with coordinatesijiandj
- w1=ijFun(valSquareSigma, Intensity Distance(v,ijv00))ThedistMethodTypeparameter specifies the method of defining the differences in intensity between pixels. FilterBilateral functions support two methods:ippDistNormL1, which defines the difference in intensity as the L1-norm, andippDistNormL2, which defines the difference in intensity as the L2-norm.
- w2=ijFun(posSquareSigma, Geometric Distance(v,ijv00)=sqrt(i*i+j*j))
Fun
(S
, I
)=exp
(-I
*I
/2*S
)where
- SisvalSquareSigmaorposSquareSigma
- Iis the difference between pixel values or position
Return Values
- ippStsNoErr
- Indicates no error. Any other value indicates an error.
- ippStsNullPtrErr
- Indicates an error whenpSpecisNULL.
- ippStsSizeErr
- Indicates an error whendstRoiSizehas a field with a zero or negative value.
- ippStsMaskSizeErr
- Indicates an error whenkernelWidthHeightis less than, or equal to zero.
- ippStsNotSupportedModeErr
- Indicates an error when thefilterordistMethodvalue is not supported.
- ippStsBadArgErr
- Indicates an error whenvalSquareSigmaorposSquareSigmais less than, or equal to zero.
- ippStsNumChannelsErr
- Indicates an error whennumChannelshas an illegal value.