Ask Your Question
0

00,01 and 10 in image moments

asked 2014-07-02 02:17:16 -0600

thearduinoguy gravatar image

I am new to Open CV and was trying to find the centroid of an object. I understnad the moments object. But what do these mean

double dM01 = oMoments.m01; double dM10 = oMoments.m10; double dArea = oMoments.m00;

Can someone explain how the x and y coordinates are obtained by doing the following computation: int posX = dM10 / dArea; int posY = dM01 / dArea;

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-07-02 05:12:34 -0600

Michael Burdinov gravatar image

updated 2014-07-02 05:42:52 -0600

A. You can read about 'Raw Image Moments' in wikipedia to get better understanding of them.

B. Now about the centroid. Given set of n values: A1, A2, ..., An, and weights of those values: W1, W2, ..., Wn.

Weighted average = (A1* W1 + A2* W2 + ... + An* Wn) / (W1 + W2 + ... + Wn)

Centroid = Center of mass (a.k.a. Center of gravity) = Weighted average

A1* W1 + A2* W2 + ... + An* Wn is dM01 (or dM10)

W1 + W2 + ... + Wn is dArea

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-07-02 02:17:16 -0600

Seen: 427 times

Last updated: Jul 02 '14