02-07-2011 05:07 AM
I'm making a program that detect circles in an image and returns some statistics about the detected circles. Is there any way to somehow display the circles detected by the VI (Shape Detection) and display these on an image? I'm thinking something in the lines of this:
i) output the circles data (position coordinates and radii) to the Draw Circle VI
ii) convert picture data from Draw Circle to pixels
iii) create an array of pixels data
iv) convert array to image
v) display image
I'm clueless as to how to undertake this though. Any help is greatly appreciated.
02-07-2011 09:38 AM
You can use IMAQ Draw to draw an oval (The coordinates you enter should be the bounding box of the circle). Note that the result of this function is destructive (i.e. modifies the underlying pixels of the image.
You can also use IMAQ Overlay Oval. The advantage of using this function is that it just overlays your circle on the image, but the underlying pixels are not modified and therefore, you can still apply other image processing functions on the image.
Christophe
02-07-2011 09:57 AM
The thing is that the Detect Circles VI only outputs the circle center coordinates of the detected circles along with radius, whereas the IMAQ Draw requires bounding rectangle coordinates. I was thinking something in the lines of using the Draw Circle by Radius VI which only depends on center coordinates and radius to draw the circle, seems a lot easier..
08-04-2011 07:50 AM
Dear Ahsin,
Now i have the same problem that you have. Did you solve it ?? if you did, could you please provide me a small Vi that illustartes the solution.
thanks,
carlos
08-04-2011 11:51 AM
08-04-2011 12:10 PM
08-04-2011 12:59 PM - last edited on 08-18-2011 08:41 AM by Laura F.
Sounds interesting. I am assuming that these beads are circle-shaped?
The program is written in Norwegian, but it should be quite intuitive though.
The pictures illustrates the function of the program. It analyzes pictures of microscopic balls and returns a picture showing the detected circles/balls with their respective index and size in addition to the details of the picture as a whole. The program also generates two spreadsheet files, raw data and summary.
04-24-2013 07:18 AM
Hello,
Does anyone knows the workaround of this program? I'm still trying to figure out how did Ahsin managed to draw circles based on the data provided by Shape Detection VI. Any help is welcomed
04-24-2013 07:50 AM
Hello Cheatpeak,
It has been a while since I worked with the program now, but I will try to explain the process as far as my memory serves me.
i) Image manipulation
First you'll have to manipulate the image so that the computer is able to analyze it. This means that you will have to convert it to a binary image. If your image is RGB, you must first convert it to a greyscale image by removing one of the three color planes (I removed the green one). Then, by means of setting a gray-level treshold, the image is converted to a binary one.
ii) Image analysis
If you at this point have adjoining or "connecting" circles, they must be separated before their size can be analyzed. Else the computer will detect such circles as one continous object. This is achieved with a technique called watershed segmentation.
Given that your circles are now separated, they are ready for analysis. I personally found the Shape Detection and Circle Detection VIs to be far too inaccurate. Therefore I employed the Particle Detecton VI to find the circles.
iii) Image data overlay
To produce the results visually, I used image buffers to store the different images during the process, and in the end I combined and merged them into one single image. All of the images must me converted to grayscale images as the original image is in this format.
This is what I can remember from the top of my head. Please let me know if there's unclarity in the process (which I'm sure is due to my poor explanation).
Regards,
Ahsin
04-24-2013 08:00 AM
Hello Ahsin,
Thank you for your quick reply. So far my program is able to threshold into binary image so i guess image manipulation is fine. My question are:
1. For image analysis, between watershed segmentation and normal morphologies such as erosion/closing, which one is better?
2. For image data overlay, which subVI did you use for image buffering? Does it need to be run multiple times(in a loop)?