FilteredImage = MedianFilter(OriginalImage, FilterSize);
2D matrix of type boolean, uint8, uint16, uint32 or double
vector of type double with two components, the first one specifies the height, the second one the width of the filter
2D matrix of the same size and type as OriginalImage
OriginalImage = zeros(9, 9); // Image is generated OriginalImage(4 : 6, 4 : 6) = 1; // block of object pixels is generated OriginalImage(5, 2) = 1; // single object pixel is set, will disappear after filtering FilterSize = [3 3]; // filter has three rows and three columns FilteredImage = MedianFilter(OriginalImage, FilterSize)