IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Separated bilateral smoothing 2d

separated version of bilateral filter on 2d image More...

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::separatedBilateral2dImg (const image::ImageConstPtr &pInImg, const ipReal64 inSpaceSigma, const ipReal64 inRangeSigma)
 wrapper function for separated version of bilateral filter on 2d image More...
 
IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::separatedBilateral2dImg (const image::ImageConstPtr &pInImg, const ipUInt32 inHalfKnlSize, const ipReal64 inSpaceSigma, const ipReal64 inRangeSigma)
 wrapper function for separated version of bilateral filter on 2d image More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::separatedBilateral2dImg (const image::ImageConstPtr &pInImg, const ipUInt32 inHalfKnlSize, const ipReal64 inSpaceSigma, const ipReal64 inRangeSigma, const image::ImagePtr &pOutImg)
 wrapper function for separated version of bilateral filter on 2d image More...
 

Detailed Description

separated version of bilateral filter on 2d image

The separated bilateral filter is an approximation of the Bilateral smoothing 2d that gives resulting images that may be close to what is obtained with the original bilateral filter with dramatically better time performance. The separated bilateral filter is executed in 2 passes: first along x-axis, then along y-axis.

Output image pixel values are given by:

\[ OutImg[x, y] = \dfrac { \sum_{o_y=-n}^{n}{W_y(x, y, o_y)*OutImg_x[x, y+o_y]} } { \sum_{o_y=-n}^{n}{W_y(x, y, o_y)} } \]

where:

Input and output images must have same size.

Here is an example of a separated bilateral 2d operation applied to an 8-bits grey levels input image (with $\sigma_S=10.0$ and $\sigma_R=20.0$):

separatedBilateral2d.png
See also
M. Moreaud, F. Cokelaer, Flowing Bilateral Filter : definition and GPU implementation, Image Analysis and Stereology (revision in progress)

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::InRangeSigma [Input] sigma for range gaussian function X
ipsdk::imaproc::attr::InSpaceSigma [Input] sigma for spatial gaussian function X
ipsdk::imaproc::attr::InOptHalfKnlSize [Input Optional] half kernel size (square or cubic kernel) X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation ipsdk::imaproc::duplicateInOut (_pOutImg, _pInImg)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg,_pOutImg)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFiltering as filter

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# separable bilateral filter 2d computation
outImg = filter.separatedBilateral2dImg(inImg, 5, 3)

Example of C++ code :

Example informations

Associated library

IPSDKIPLFiltering

Header file

Code Example

// definition of a custom output geometry
ImageGeometryPtr pOutImageGeometry =
geometry2d(outImageBufferType,
pInImg->getSizeX(),
pInImg->getSizeY());
// creation of output image
boost::shared_ptr<MemoryImage> pOutImg = boost::make_shared<MemoryImage>();
pOutImg->init(*pOutImageGeometry);
// compute bilateral filter on input image
separatedBilateral2dImg(pInImg, inHalfKnlSize, inSpaceSigma, inRangeSigma, pOutImg);
See also
SeparatedBilateral2dImgLvl1
SeparatedBilateral2dImgLvl2

Function Documentation

◆ separatedBilateral2dImg() [1/3]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::separatedBilateral2dImg ( const image::ImageConstPtr pInImg,
const ipReal64  inSpaceSigma,
const ipReal64  inRangeSigma 
)

wrapper function for separated version of bilateral filter on 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ separatedBilateral2dImg() [2/3]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::separatedBilateral2dImg ( const image::ImageConstPtr pInImg,
const ipUInt32  inHalfKnlSize,
const ipReal64  inSpaceSigma,
const ipReal64  inRangeSigma 
)

wrapper function for separated version of bilateral filter on 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ separatedBilateral2dImg() [3/3]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::separatedBilateral2dImg ( const image::ImageConstPtr pInImg,
const ipUInt32  inHalfKnlSize,
const ipReal64  inSpaceSigma,
const ipReal64  inRangeSigma,
const image::ImagePtr pOutImg 
)

wrapper function for separated version of bilateral filter on 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure