I need to test some basic image processing techniques in Matlab. I need to test and compare especially two types of filters: mean filter and median filter.
To smooth
h = fspecial('average', n); filter2(h, img);
See doc fspecial: h = fspecial('average', n) returns an averaging filter. n is a 1-by-2 vector specifying the number of rows and columns in h.
doc fspecial
h = fspecial('average', n)
n
h