IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Masked Mean Smoothing 2dSee full documentation
imagemeanSmoothing2dMaskImg (inImg,inMaskImg,inHalfKnlSizeX,inHalfKnlSizeY)

Detailed Description

Masked mean filter used to blur a 2d image.

This algorithm apply a box filter by taking into account only the pixels allowed by the input mask. Every pixel outside the mask is set to 0.

The figure below illustrates the 3x3 smoothing of 2 pixels according to a neighbourhood defined by a mask. The blue pixels represent the pixels allowed by the mask and the numerical values are the intensities to smooth in the input image.

meanSmoothing2dMasked_example.png

Here is an example of a masked mean smoothing:

meanSmoothing2dMasked_result.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFiltering as filter

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# mean smoothing filter 2d computation
outImg = filter.meanSmoothing2dMaskImg(inImg, maskImg, 3, 3)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLFiltering/Processor/MeanSmoothing2dMaskImg/MeanSmoothing2dMaskImg.h>

Code Example

// compute the masked mean smoothing
ImagePtr pOutImg = meanSmoothing2dMaskImg(pInImg, pMaskImg, inHalfKnlSize, inHalfKnlSize);