Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How does the Centre of mass calculation within the Vision particle analysis function work?

I have been using the particle analysis function to establish the centre of mass of some particles. However on analysis some of the stated CofG's are clearly wrong. Does anybody know why this could be or how you can access the code that performs the calcution to check it?
0 Kudos
Message 1 of 4
(3,096 Views)
A great resource for understanding how the IMAQ Vision algorithms work is the IMAQ Vision Concepts Manual. It installs with IMAQ Vision and can be found under the Start>>Programs>>National Instruments>>Vision>>Documentation menu. On page 10-3 of the manual it shows and explains the exact forumula used to find a particle's center of mass.

Please let me know if you need further explaination.

Kyle V
Message 2 of 4
(3,096 Views)
mattmc wrote in message news:<506500000008000000D9790000-1042324653000@exchange.ni.com>...
> I have been using the particle analysis function to establish the
> centre of mass of some particles. However on analysis some of the
> stated CofG's are clearly wrong. Does anybody know why this could be
> or how you can access the code that performs the calcution to check
> it?

Hi,
I don't think you can access the code that performs the calculation,
because that is NI's DLL, unless they let you see the source C/C++
code. But I know one algorithm to get the mass center is using the
moments calculation,
m(p,q)=double integral over x^py^qf(x,y)dxdy, and the mass center is:
Xc=m(1,0)/m(0,0), Yc=m(0,1)/m(0,0)
As a matter fact, you can see m(0,0) is actually the area
size of the
particle.
Irene
www.geocities.com/irene_he
0 Kudos
Message 3 of 4
(3,096 Views)
For very large particles in very large images (in the neighborhood of 1600 by 1600 pixels) Particle Analysis may run into an integer overflow condition which causes incorrect results for Center of Mass, Orientation, SumX, SumY, and all moment based calculations.

This problem is corrected in versions 7.0.2 and higher.

A workaround is to call �IMAQ Set Simple Calibration� with X Step = 1, X Step = 1 and then use �Real-World Measurements� instead of �Pixel Measurements�.

Kevin C.
Software Engineer
National Instruments
IMAQ Vision
0 Kudos
Message 4 of 4
(3,096 Views)