Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Find objects using NI Vision

Solved!
Go to solution

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

0 Kudos
Message 1 of 4
(3,744 Views)

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.

Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 2 of 4
(3,715 Views)
Solution
Accepted by topic author ekramul1

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  

0 Kudos
Message 3 of 4
(3,706 Views)

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.

 

 

Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 4 of 4
(3,674 Views)