Image median filter
imout = immedian(imin,sz)
Input image
Size of the filter block
This function perform median filtering for an image, which effectively remove pepper and salt noise.
S = imread(fullpath(getIPCVpath() + "/images/coins_gray.jpg")); S_noise = imnoise(S,'salt & pepper',0.02); imshow(S_noise); S2 = immedian(S_noise,3); scf; imshow(S2);