Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Center of mass/gravity based on grayscale values - how with IMAQ?

Hi,

I do:
imaqAutoThreshold()
imaqParticleFilter()
imaqCalcCoeff() with IMAQ_CENTER_MASS_X and Y

I guess that with imaqCalcCoeff, the center of mass is calculated on binary data? Is this assumption correct?

What I would like, is to have sub-pixel accuray, which means finding the center of mass using grayscale values.

How can I do this with IMAQ?

Thanks,
Torbjørn
0 Kudos
Message 1 of 3
(3,209 Views)
You are correct that binary data is used for your method.

Use IMAQ Centroid to calculate the center of mass based on grayscale values. You can calculate it for the entire image, or you can use a mask to limit it to a smaller region.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 3
(3,209 Views)
Thank you, Bruce! I will give it a shot!

Torbjørn
0 Kudos
Message 3 of 3
(3,209 Views)