MATLAB: Medfilt2 parameter coding problem

image enhancementImage Processing Toolboxmedfilt2

image class uint8, coding as below
>> I=imread('sample01.tif');
>> J = imnoise(I,'salt & pepper',0.02);
>> K = medfilt2(J, 'indexed',…);
it say continue entering statement, what do i need to input in order to complete the process?

Best Answer

Pass in the window size
medianFilteredImage = medfilt2(J, 'indexed', [3 3]);
You can use whatever window size you want, but for Salt and Pepper, 3 by 3 should work as long as the noise is not really severe.
Related Question