anwers all questions.... Practical Image and Video Processing Using MATLAB CH14
ID: 2081765 • Letter: A
Question
anwers all questions.... Practical Image and Video Processing Using MATLAB CH14
Edge detection methods are often compared by their ability to detect edges in noisy images. Let us perform the Prewitt operator on the Lenna image with additive Gaussian noise. 3. Add noise to the test image and extract its edges. I noise immoise (I, 'gaussian'); I prw2, t2] edge (I noise prewitt subplot (2,2,3) imshow (I noise) title Image w/ noise subplot (2,2, 4) imshow (I prw2), title Prewitt on noise Question 2 How did the Prewitt edge detector perform in the presence of noise (compared to no noise)? Question 3 Did MATLAB use a different threshold value for the noisy image? Question 4 Try using different threshold values. Do these different values affect the operator's response to noise? How does the threshold value affect the edges of the object?Explanation / Answer
8.%PREWITT
N(1:m,1:n)=0
for i=1:m-2;
for j=1:m-2;
N(i,j)=-1*b(i,j)-1*b(i,j+1)-1*b(i,j+2)+0+0+0+1*b(i+2,j)+1*b(i+2,j+1)+1*b(i+2,j+2);
end;
end;
O(1:m,1:n)=0
for i=1:m-2;
for j=1:m-2;
O(i,j)=-1*b(i,j)+0+1*b(i,j+2)-1*b(i+2,j)+0+1*b(i+1,j+2)-1*b(i+2,j)+0+1*b(i+2,j+2);
end;
end;
figure;
subplot(2,2,1)
imshow(N)
title('Prewit Gx');
subplot(2,2,2)
imshow(O)
title('Prewit Gy');
Z=N+O;
subplot(2,2,3)
imshow(Z)
title('Prewit Gx+Gy');
subplot(2,2,4)
imshow(b)
title('Original Image');
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.