Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You want to use cv::moments using a.col(i), where i is the column number.

The output is a structure that contains the moments. The y location of the mass center (the mean) is m01/m00.