edge detection using sobel operator

조회 수: 51 (최근 30일)
megha
megha 2013년 12월 6일
댓글: fzhmktr 2019년 10월 2일
my question is related to edge detection using sobel operator. I am doing my project related to this subject on FPGA so i want to see that what will be the result in matlab can u tell me how to do edge detection using sobel oerator in matlab. Thank you
  댓글 수: 3
Nenad Bozinovic
Nenad Bozinovic 2016년 12월 14일
편집: Nenad Bozinovic 2016년 12월 14일
Above works but it's slow (1.218 seconds for my image). Here is a faster way:
Gx = [1 +2 +1; 0 0 0; -1 -2 -1]; Gy = Gx';
tic
temp_x = conv2(X, Gx, 'same');
temp_y = conv2(X, Gy, 'same');
lenaOutput = sqrt(temp_x.^2 + temp_y.^2);
toc
Elapsed time is 0.005787 seconds.
fzhmktr
fzhmktr 2019년 10월 2일
Hi nenad,
I try your code and I didnt get the same result as Akshay code. Your code resulting in matrix dimension while Akshay code in single value. Am I making mistake?

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2013년 12월 7일
Use imgradient() to get the true Sobel filtered image. If you use edge() it doesn't give it to you but gives you a thresholded and skeletonized version of the Sobel filtered image instead.
  댓글 수: 3
Image Analyst
Image Analyst 2013년 12월 8일
megha, are you still there?????
Nwe Nwe HtayWin
Nwe Nwe HtayWin 2019년 7월 15일
Hello, Image Analyst, who is so kind to answer most of the questions asked by anyone here.
Let me ask you one thing, I am a student of doing signature recognition process. Regardless of signature, can you please give me some example (tiny example) for training and testing. My code writing in Mat file is ok in training phase but there are some mismatch (attribute mismatch) occurs in loading .mat for recognition process. I would be very grateful if you can show small code (extract features with anymethod for training and save in .mat file) and use any method (e.g KNN) for recognition process for only image.
Thanks you so much in advance and I am sorry if this request bothers you. I am really stuck in it.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

chitresh
chitresh 2013년 12월 7일
I = imread('image_file');
BW1 = edge(I,'sobel');
imshow(BW1);

Community Treasure Hunt

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

Start Hunting!

Translated by