03-04-2009 02:07 PM
Hi,
I would like to locate object clusters in a group of .tiff images. I would ilke to find the center of the mass and the average pixel value of each cluster (so that I can calculate the center of mass of the aggregate). In addition, I would like to draw polygon(sqiggly lines) showing the perimeter of each cluster (similar to the MaginWand2 example). Each Image may contain one or more clusters. I am developing a stand alone appliction using .Net . I would appreciate any help in the this.
Thanks,
Ekramul
Solved! Go to Solution.
03-06-2009 06:50 AM
Hi Ekramul,
You could try using Vision Assistant to come up with a few steps to do what you want. The cluster will have to be identified by pixel value/shape. A Region of Interest can be created around the area where the cluster is found. Then, there are functions such as 'Quantify' and 'Centroid' for grayscale images that can give you the average pixel value and the centre of mass. When drawing an ROI, you can opt to draw one freehand - similar to what you mentioned in the MagicWand2 example.
Of course, the actual algorithm used would depend on your image. I hope this gives you a general idea of a way to go about this.
03-06-2009 11:11 AM
This is what I did to get the center of mass of the cluster:
1. Called CountAndMeasure method on ROI to get a report on all the objects in ROI
2. Called LightMeterRectangle on each of the bounding rectangle obtained in step 1.
3. Get the Mean Intensity of each rectangle from the report object returned in step2
4. Multiplied the mean intensity with the area of the rectangle to get the total intensity. This is not quite the total intensity, this is only proportioal to the total intensity. This is acceptable in our application.
5. Used the this total intensity and the center of mass of the rectangle to compute the aggregate center of mass of all indentified objects.
This solution seems acceptable for our application. Please make a commet. I have not figured out a way to duplicate the MagicWand functionality in this appliation yet. I will leave it for later.
Suggestions for future enhancements:
1. LightMeterRectangle will return total intensity
2. CountAndMeasureObjects will return total number of pixels in the rectangle.
Thanks,
Ekramul
03-09-2009 06:00 PM
Hello Ekramul,
Glad that you have got your application working. As I mentioned, you could consider using the IMAQ Quantify and IMAQ Centroid VIs or the equivalent steps in Vision Assistant. As for suggestions for future enhancements, it would be great if you could submit them to our Product Suggestion Center: http://digital.ni.com/applications/psc.nsf/default?openform . These suggestions are taken very seriously by our R&D department for future releases.