简体   繁体   中英

Understanding Moments function in opencv

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??

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 (aka 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM