| bool = | median3dImg_allow8bitsCompression (inImg,inHalfKnlSizeX,inHalfKnlSizeY,inHalfKnlSizeZ,outImg) |
| image = | median3dImg (inImg,inHalfKnlSizeX,inHalfKnlSizeY,inHalfKnlSizeZ) |
Median filter on a 3d image.
The median filter is a non-linear filter used to reduce impulsive noise in an image while preserving edges.
The median filter computes, for each pixel of input image, the median of its neighbouring pixels.
On output image values are given by:
where :
function applied to a set of cardinal
(
is an odd positive integer) returns the
element of the collection
containing the elements of the set sorted by increasing value
is defined by InHalfKnlSizeX attribute
is defined by InHalfKnlSizeY attribute
is defined by InHalfKnlSizeZ attributeInput and output images must have same size.
The algorithm is optimized if at least one of the following conditions is satisfied:
and input image pixels are encoded on integersIf none of the previous conditions are satisfied, the user has all the same the possibility to execute a fast 2d median filter, by setting the attribute "InOutOptAllow8bitsCompression" to value true (this attribute is set to false by default). In this case, he will get a resulting image that will be an approximation of a real median (the resulting image will contain a maximum of 256 different grey level values).
Here are 2 examples of a median filter operation applied to a noised 8-bits grey levels input image:
:
: