After fiddling with MonoImage’s DetectEllipses (which is a wrapper around imaqDetectEllipses, albeit a poor one… but that’s for another day) I found that there is also a imaqDetectCircles function. I’ve found that this function returns a lot less false positives. Has anyone else had similar results? Target recognition is still not working 100% as one would hope, but hopefully with adjusting the CurveOptions and ShapeDetectionOptions parameters it should become satisfactory.
You are correct that IMAQ has an ellipse, circle and even a rectangle detection routine, and of course they are there for you to use.
As for whether this is a good idea or not, it should work pretty well assuming you are lined up directly in front of the target. As the robot moves to the side, the circle gets squished and becomes an ellipse. As the angle, changes, the circle score will fall until it is no longer reported as a valid circle.
As for the false positives, you may want to check out the white paper on the NI site. The quick things to improve the situation is to change the threshold so that weaker edges are ignored. Also, the medium sized image tends to have a much sharper edge. Small images blend the pixels and are essentially blurred. Blurred shapes make corners disappear and many shapes become more circular, and at the same time, the circle’s edge is less crisp and the score falls.
Greg McKaskle