find edge in image

Go To StackoverFlow.com

0

How can I detect the edges in an image without using method 'edge', with only using mathematical operations (matrix or Derived or div or any other)? Indeed, how can I rewrite the function edge by using the algorithm Canny or sobel or any other?

For example:

enter image description here

pink rectangle 256*256 black rectangle 127*127

Answer:Canny Tutorial

2012-04-04 16:58
by user1263390
Why do you want to re-write it when a perfectly useable function already exists? Do you wish to customise edge in some way? You can use both the canny and sobel algorithms with edge - Bill Cheatham 2012-04-04 17:12


2

You state that you wish to use Canny, Sobel or another algorithm. These can both be used in edge. Try for example:

BW = edge(I,'canny');

where I is your image matrix. If you are interested in finding out how edge works, type

edit edge

into your command window. You will then get to see MATLAB's own implementation.

You may wish to reimplement edge from scratch, to gain a good understanding of how image processing algorithms work. If so, I would direct you towards the following sources:

For your specific example with the rectangles, it is quite possible to use edge to find the edges. The one trick you have to do is to convert the rgb image to a grayscale one, using rgb2gray. Try for example:

rgb_image = imread('iarLe.png');
gray_image = rgb2gray(rgb_image);
edge_image = edge(gray_image);
imshow(edge_image);

enter image description here

2012-04-04 17:20
by Bill Cheatham
http://www.cs.ucf.edu/~mikel/Research/Edge_Detection.ht - 0x90 2012-04-04 17:37
no ,with out use method'edge' and only with pluse,minuse, div , sqrt,.. - user1263390 2012-04-04 17:49
You still haven't explained why you want someone else to help you to do this when there is a very well implemented version, with source code available, in MATLAB already. Why do you need a new version of edge - Bill Cheatham 2012-04-04 17:51
Because in his university they forgot to buy the package that includes edge :- - Nathan Fellman 2012-04-04 18:01
@Nathan, I would believe that if it weren't for the specific requirements such as only using plus minus divide etc. I think this question is missing a tag - Bill Cheatham 2012-04-04 18:05
do you think so? Let's ask... @user1263390, is this a homework question - Nathan Fellman 2012-04-04 18:35
how apply solbe to a matri - user1263390 2012-04-04 18:47
Ads