how to compute edge roughness for a binary region

I am new to the field of imaging processing. This may seem to be very trival to human eye and maybe very trival to people in this field as well. I am trying to classify two types of objects. They have very similar shape,but some of them have smooth edges and some of them have rather rought edge. I wonder how I can quantify the edge roughness, so that the computer will see this difference,and classify these two objects into two different groups? For example, to seperate a smooth 2D shape like a watermelon, and a similar 2D shape with some sparks on the edge.
Thanks for any help!

1 Comment

Classify them HOW? Do you want to detect if they are the same shape, regardless if the edges/boundary may be smooth or rough (like a sharp triangle and a ragged one)? Or do you want to somehow characterize the roughness of the edge itself for a given shape? Those are two different things. Which do you want?

Sign in to comment.

Answers (2)

Yes. You just have to define "smooth" and "rough" edges in terms that a computer can understand. I would recommend starting by defining them in English (or native language) and then trying to teach the computer what they are.
A smooth edge for my research (edges of glass beads) is probably much different than a smooth edge in your research. Post a few images and explain what you're looking for in order to receive less generalized assistance.

6 Comments

Thanks for the reply!
I guess that is my question: how I can quantify edge roughness. For example, to seperate a smooth 2D shape like a watermelon, and a similar 2D shape with some sparks on the edge.
BTW, how do I upload images? I am sorry I am new here.
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
First calculate the edge. The one way that comes to mind is to traverse it a few pixels at a time calculating the orientation of those pixels. Then calculate the angle between every few pixels' orientations. Angles greater than some threshold would constitute a rough transition.
Weekend is beginning here, but I can probably help you with coding early next week.
Good Luck!
And Welcome to MATLAB Answers!
That would be great! I appreciate it.
cloudia, you can (re)edit the question to add new/clarifying information, helps people know what you are looking for without having to go through the comments :).
Thanks for the suggestion! Just edit it,hopefully it will be less confusing.

Sign in to comment.

OK, your clarification says that you want to characterize edge roughness, or basically how wiggly and tortuous the perimeter is. Several ways to do this and no single right answer. A "right" answer is one that works for you with your particular images. You can use fractal dimension, circularity (perimeter^2 / (4*pi*Area)), Fourier Descriptors, and maybe some other things. Perhaps you can do some research here first: http://iris.usc.edu/Vision-Notes/bibliography/contents.html
Also, you haven't posted a link to your image(s) yet. You can do that if you want extra help.

Asked:

on 7 Oct 2011

Community Treasure Hunt

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

Start Hunting!