I tried to write the code that will run SaltPepperNoise but I am making an error where can you help if it is not working.
I press run in the editor, but pause is stuck.
x=imread('PEPPERS.TIF');
x=im2double(x);
[row,col]=size(x);
for i=1:row
for j=1:col
N=floor(rand(1000,1000)+0.01)*255;
end
end
subplot(1,2,1)
imshow(x);
title('original');
subplot(1,2,2)
imshow(N);
title('SaltPeperImage');

답변 (1개)

Bhargavi Maganuru
Bhargavi Maganuru 2020년 4월 27일

0 개 추천

The variable N inside the loop is changing everytime and finally N is just a number.
To add salt and pepper noise to image, you can use imnoise function.

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2020년 4월 22일

답변:

2020년 4월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by