how can i perform edge detection efficiently in matlab?

1 回表示 (過去 30 日間)
Aditya Shrivastava
Aditya Shrivastava 2013 年 4 月 28 日
i have tried four methods i.e. sobel,prewitt,roberts,log but not getting single correct o/p on scanned images.
this is my code- image=imread('sample_img.jpg');
image_gray=rgb2gray(image);
image_BW=im2bw(image_gray);
imshow(image_BW);
image_comp = imcomplement(image_BW);
image_filter = medfilt2(image_comp);
image_fill=imfill(image_filter,'holes');
BW = edge(image_fill,'log',0.2);
at place of "log",i tried other methods too.
thanks for the help..

回答 (2 件)

Chandra Shekhar
Chandra Shekhar 2013 年 4 月 28 日
I = imread('circuit.tif');
BW1 = edge(I,'prewitt');
BW2 = edge(I,'canny');
figure, imshow(BW1)
figure, imshow(BW2)

Image Analyst
Image Analyst 2013 年 4 月 28 日
So what's wrong with what you did? There are lots of edge detectors but until I see your image and know what your issue with edge() is, I'm hesitant to just go and list and explain a bunch of edge detection algorithms, which you can look up online anyway.
  1 件のコメント
Aditya Shrivastava
Aditya Shrivastava 2013 年 5 月 16 日
hello.. i made a customized code for edge detection... n it worked.. but thanks for the indulgence..

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by