image = | maskImg (inImg,inMaskImg) |
image = | reverseMaskImg (inImg,inMaskImg) |
Mask filter algorithm, computing an output image for which each pixel equals to either corresponding pixel in input image or 0, depending on whether corresponding input mask image pixel equals 1 or 0.
Compute an output image for which each pixel equals to either corresponding pixel in input image or 0, depending on the corresponding input mask image pixel value.
A call to the maskImg wrappers, the output image values are given by:
On the contrary, a call to the reverseMaskImg wrappers, the output image values are given by:
Input, mask and output images must have same size. Input and output image buffers must have same type.
Here is an example of this mask filter applied to one 8-bits grey level image. The upper result is obtained by calling the maskImg wrapper, whereas the lower result corresponds to the reverseMaskImg wrapper :