How do I detect the ellipses in the image attached?
Show older comments

This is a ring type target which I need to auto-detect and number. Currently I am trying to fit ellipse which is failing because I get all four connected components as separate ellipses.
What should be a robust strategy to detect the outer, the inner and the inner most ellipse so as to be able to detect code of the target?
In actual scenario, I will have many more targets like this in a single image, which will appear distorted depending upon the location of viewing camera.
Answers (1)
Image Analyst
on 6 Jul 2013
1 vote
Use bwconvhull() to get the convex hull of the whole set of objects. That will work better, but not perfect because you're missing a quadrant.
7 Comments
Ashutosh
on 7 Jul 2013
Image Analyst
on 7 Jul 2013
You can use bwboundaries(), then put all the coordinates into convhull() to get the outermost ones. Then do your fit. You can also put them into plot() or poly2mask() if you want to see which points are on the convex hull.
Image Analyst
on 7 Jul 2013
You need to use the FAQ to fit an ellipse to the boundary points. You already have the outer one (don't worry about the line connecting the points). You just need to get those coordinates for the other two ellipses. To get the center circular blobs, you can filter based on circularity (perimeter squared/(4*pi*area)) or Solidity. Not sure what the other one is but maybe it's the inner boundary of the outer sectors. You can get those by finding coordinates not on the first convex hull and not in the center blobs.
Image Analyst
on 6 Sep 2013
Ashutosh's "Answer" moved here to a comment since he incorrectly put this follow up question as an "Answer" (which it's not), and then "Accepted" it (for some reason). I deleted that answer and moved it here.
How do I assess the quality of blob detection?
I have this image containing ellipses. I need to find precise centers for all the ellipses (accuracy of order of 0.01 pixel).
I am using centroid finding and ellipse fitting algorithms to detect them and mark them. When I plot, I find that both of them are within .5 pixel but not sure which one is correct?
1) What method is best to get accuracies of order of 0.01 px ? 2) How do I say that my algorithm indeed achieved 0.01 px of accuracy?
please tell me statistical techniques to do so. I want to quantify.
Ashutosh
on 6 Sep 2013
Image Analyst
on 6 Sep 2013
You can't know the accuracy unless you have some "ground truth." I only told you one method: find the boundary points, then fit it to an ellipse. I don't know what you did after that for your second method. Did you then use poly2mask() to make a binary image and find the centroid with regionprops()?
Categories
Find more on ROI-Based Processing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
