IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Masked mean filter used to blur a 2d image. More...

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::meanSmoothing2dMaskImg (const image::ImageConstPtr &pInImg, const image::ImageConstPtr &pInMaskImg, const ipUInt32 inHalfKnlSizeX, const ipUInt32 inHalfKnlSizeY)
 wrapper function for Masked mean filter used to blur a 2d image More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::meanSmoothing2dMaskImg (const image::ImageConstPtr &pInImg, const image::ImageConstPtr &pInMaskImg, const ipUInt32 inHalfKnlSizeX, const ipUInt32 inHalfKnlSizeY, const image::ImagePtr &pOutImg)
 wrapper function for Masked mean filter used to blur a 2d image More...
 

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::InMaskImg [Input] Binary image for masking operation X
ipsdk::imaproc::attr::InHalfKnlSizeX [Input] half kernel size along X axis for operation X
ipsdk::imaproc::attr::InHalfKnlSizeY [Input] half kernel size along Y axis for operation 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) && 
ipsdk::imaproc::matchSize (_pInImg,_pInMaskImg)

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

Associated library

IPSDKIPLFiltering

Header file

Code Example

// compute the masked mean smoothing
ImagePtr pOutImg = meanSmoothing2dMaskImg(pInImg, pMaskImg, inHalfKnlSize, inHalfKnlSize);
See also
MeanSmoothing2dMaskImgLvl1
MeanSmoothing2dMaskImgLvl2
MeanSmoothing2dMaskImgLvl3

Function Documentation

◆ meanSmoothing2dMaskImg() [1/2]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::meanSmoothing2dMaskImg ( const image::ImageConstPtr pInImg,
const image::ImageConstPtr pInMaskImg,
const ipUInt32  inHalfKnlSizeX,
const ipUInt32  inHalfKnlSizeY 
)

wrapper function for Masked mean filter used to blur a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ meanSmoothing2dMaskImg() [2/2]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::meanSmoothing2dMaskImg ( const image::ImageConstPtr pInImg,
const image::ImageConstPtr pInMaskImg,
const ipUInt32  inHalfKnlSizeX,
const ipUInt32  inHalfKnlSizeY,
const image::ImagePtr pOutImg 
)

wrapper function for Masked mean filter used to blur a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure