When finding the center coordinates using moments in OpenCV,the point is found using

Point(moment[i].m10/moment[i].m00,moment[i].m01/moment[i].m00); 

Can somebody please explain this bit to me?What do "m10","m00","m01" and "m00" mean??

2

1 Answer

Definition of moments in image processing is borrowed from physics. Assume that each pixel in image has weight that is equal to its intensity. Then the point you defined is centroid (a.k.a. center of mass) of image.

Assume that I(x,y) is the intensity of pixel (x,y) in image. Then m(i,j) is the sum for all possible x and y of: I(x,y) * (x^i) * (y^j).

Here you can read the documentation of moments used in OpenCV. They are called raw moments.

And here you can read a wiki article about all kinds of image moments (raw moments, central moments, scale/rotation invariant moments and so on). It is pretty good one and I recommend reading it.

6

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.