Sobel Edge detection Implementation Problem
显示 更早的评论
I m new to MATLAB,Plz guide me.i m trying to implement the Sobel Edge detection algorithm but i m not getting correct output. My output is not match with the output obtained from using the inbuild edge function.This is my code. Thanks in advance.
gx=[-1 0 1;-2 0 2;-1 0 1];
d=conv2(original_Image,gx);
gy=[1 2 1;0 0 0;-1 -2 -1];
e=conv2(Original_Image,gy);
[m n]=size(e);
for i=1:m
for j=1:n
G(i,j)=uint8(sqrt(d(i,j)*d(i,j)+e(i,j)*e(i,j)));
end
end
figure;
imshow(G);
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Object Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!