01-12-2011 12:16 PM
Hi.
Are there any practical starter guides in Vision apart from the manual and concept manual? I'm trying to detect a number of circles in an image within a specified range of radiuses/diameters, but not sure as to how. I have tried different setting in Vision Assistant, with litte success however. Is there any help to get?
Regards,
Ahsin
01-12-2011 02:53 PM
Without seeing the image, it is hard to suggest the best solution.
If you can threshold your image to display the circles only as particles, the Circle Detection function in the Binary palette should work for you. The difficulty with this approach would be in the thresholding/segmentation phase, to extract your circles.
You can also work with the grayscale image, and try the Shape Detection step, located in the Machine Vision palette, to detect the circles.
-Christophe
01-13-2011 03:38 AM - edited 01-13-2011 03:39 AM
Thanks for the reply.
The image is as follows (it's in graytones):
01-13-2011 08:10 AM
This image is going to be hard to threshold, so the binary option is probably out.
I would probably start by trying pattern matching. Geometric or standard pattern matching might work well.
For standard pattern matching, I would consider creating a template manually. Create a white background and draw a black circle the same diameter as your circles. This is your template image. In a second image, create a white background and draw a black circle with a slightly larger (3-5 pixels, maybe) diameter. This is the mask you use when training your template. You might need to invert the colors on the mask. The two images should be the same size with the circles centered on the same point.
If speed is an issue, you might want to resample your image to a lower resolution, locate the circles, and transform the coordinates back to your original image. Pattern matching works faster on smaller images.
Bruce
01-14-2011 04:44 AM
01-14-2011 07:35 AM
I'm really grateful for the replies, thanks a bunch!
Now that the program recognizes the circles (not all of them though), how do I get it to measure diameter, area etc. of the circles? The only parameters showing are X and Y-coordinates, angle, scale and occlusion.
01-14-2011 09:19 AM
Open the Particle Analysis step and click the Select Measurements button. You'll be able to select from a list of numerous measurements the step computes on the particles.
Christophe
01-16-2011 04:53 PM
You can use IMAQ-find-circles function to determine the radius and then calculate the area.
01-17-2011 06:27 AM - edited 01-17-2011 06:27 AM
Hi,
As the particles are seem to be in contact, the computer counts them as being one single object. Hence the find-circle step doesn't detect them.
01-17-2011 10:15 AM
You have several options to separate the particles.
-Use the Separate Objects function from the Advanced Morphology tab.
-Another option is to use the Watershed algorithm, which is well described in the Image Processing Handbook:
An example is provided in Vision Assistant (Solution Wizard>>Pharmaceutical>>Pills Inspection). You will have to modify it to implement what it suggested in the book and to adapt it to your image.
Christophe