Edge Detection Using the Sobel Operator Extract the edges from the test Image us
ID: 2081733 • Letter: E
Question
Edge Detection Using the Sobel Operator Extract the edges from the test Image using the Sobel edge detector. [I_sobl, t1] = edge(I, 'sobel'); figure, subplot(2, 2, 1), imshow(I), title('Original Image'); subplot(2, 2, 2), imshow(I_sobl), title('Sobel, default thresh'); Extract the edges from the test Image with Gaussian noise using the Sobel edge detector. [I_sob2, t2] = edge(I_noise, 'sobel'); subplot(2, 2, 3), imshow(I_noise), title('Image w/noise'); subplot(2, 2, 4), imshow(I_sob2), title('Sobel on noise'); How does the Sobel operator compare with the Prewitt operator with and without noise?Explanation / Answer
clc;
close all;
clear all;
[IMG2,map] = imread('lenna.jpg');
IMG1 = (rgb2gray(IMG2));
I_noise = imnoise(IMG1,'gaussian');
figure
imshow(IMG2);
% 4
[I_sob1,t1] = edge(IMG1,'sobel');
figure, subplot(2,2,1),imshow(IMG1),title('Original image');
subplot(2,2,2),imshow(I_sob1),title('Sobel, default threshold');
% 5
[I_sob2,t1] = edge(I_noise,'sobel');
subplot(2,2,3),imshow(I_noise),title('Image w/ noise');
subplot(2,2,4),imshow(I_sob2),title('Sobel on noise');
%QUESTION 5
figure
subplot(2,2,1),imshow(I_sob1),title('Sobel w/o noise');
subplot(2,2,2),imshow(I_sob2),title('Sobel w/ noise');
[I_prw2,t2] = edge(IMG1,'prewitt');
[I_prw1,t2] = edge(I_noise,'prewitt');
subplot(2,2,4),imshow(I_prw1),title('Prewitt w/o noise');
subplot(2,2,3),imshow(I_prw2),title('Prewitt w/ noise');
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.