Problem in sobel edge detection method

2 views (last 30 days)
Emre Can Ertekin
Emre Can Ertekin on 25 Jun 2018
Edited: Emre Can Ertekin on 25 Jun 2018
I need to make a sobel edge detection. I shouldn't use the shortcuts of MATLAB functions. I couldn't run the code and i can't find my error. I get a white screen as a output. I think that i didn't make the non maximum suppression so i get the error. Thanks for helping
orginal=imread('img.jpg');
orgdoub=im2double(orginal);
gray_img=rgb2gray(orgdoub);
kx=[-100,-200,-100;0 0 0 ; 100 200 100];
ky=[-100 0 100; -200 0 200 ; -100 0 100];
H= conv2(gray_img,kx,'same');
V= conv2(gray_img, ky, 'same');
E=sqrt(H.^2+V.^2);
filterimg=imfilter(gray_img,E);
edgeimg=edge(filterimg);
figure(1);
imshow(filterimg);
title('gradyantlı');
figure(2);
sob = edge(gray_img,'sobel');
imshow(sob);
title('With using sobel function ');

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!