image = | meanSmoothing2dMaskImg (inImg,inMaskImg,inHalfKnlSizeX,inHalfKnlSizeY) |
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.
Here is an example of a masked mean smoothing: