applies a median filter to an image
FilteredImage = MedianFilter(OriginalImage, FilterSize);
2D matrix of type boolean, uint8, uint16, uint32 or double
vector of type double with two elements, the first one specifies the height, the second one the width of the filter
2D matrix of the same size and type as OriginalImage
This function applies a median filter to an image.
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) | ![]() | ![]() |