필터 지우기
필터 지우기

noise removel

조회 수: 1 (최근 30일)
mahendra kumar
mahendra kumar 2012년 6월 13일
how to remove salt and pepper noise from a image

답변 (1개)

Ryan
Ryan 2012년 6월 13일
I = 3 * sin(.3*[1:500]')*ones(1,500) + 3 * cos(.2*[1:500]')*ones(1,500) + 0.5*ones([500 500]); % Generate random sine wave image
I_noisy = imnoise(I,'salt & pepper',.02); % Add noise to the image
I_clean = medfilt2(I_noisy,[3 3],'symmetric');
I_clean2 = medfilt2(I_noisy,[9 9],'symmetric');
figure(1),imshow(I_noisy),title('Salt and Pepper Image')
figure(2),imshow(I_clean),title('Cleaned image using [3 3] filter window')
figure(3),imshow(I_clean2),title('Clean image using [9 9] filter window')
The median filter replaces the pixel at the center of an [m n] window with the median value of all of the other pixels in the window. It specializes in removing salt and pepper noise.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by