MATLAB: Finding outer and inner edge of an ear image

earedge detectionImage Processing Toolbox

I am using MATLAB 2013a. I used lot of edge detector techniques to find out both the edges, but I am able to find only outer edge.If anyone can help me with the code to find both the edges that will be great help for my work. The final image after finding edges resembles the attached image. Reply as soon as possible. Thank you.

Best Answer

Regarding your new question about finding the "extreme endpoints", do you mean the two points that are farthest away from each other, or do you mean the actual endpoints of the line, which may not necessarily be the two points farthest from each other?
To find the two points farthest from each other, regardless if they're endpoints of a line/curve or somewhere in the middle of the curve, just so a nested for loop. Don't worry - it will be fast. See attached demo.
If you mean the endpoints of the curves only, then you need to get them using bwmorph(binaryImage, 'endpoints') and use the Pythagorean Theorem on all pairs of points.