Developer Reference

  • 2020
  • 07/15/2020
  • Public Content
Contents

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 is
ippiFilterBilateralGauss
- 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 are
ipp8u
,
ipp32f
, and
ipp64f
.
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:
numChannels
value
Possible
distMethod
values
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 kernel
where
  • v
    ij
    is the value (or channel values) of a pixel in the kernel with coordinates
    i
    and
    j
  • w
    1
    ij
    =
    Fun
    (
    valSquareSigma
    , Intensity Distance(
    v
    ij
    ,
    v
    00
    ))
    The
    distMethodType
    parameter 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, and
    ippDistNormL2
    , which defines the difference in intensity as the L2-norm.
  • w
    2
    ij
    =
    Fun
    (
    posSquareSigma
    , Geometric Distance(
    v
    ij
    ,
    v
    00
    )=
    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
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 when
kernelWidthHeight
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.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804