Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Will this code give me the coordinates for the intensity-weighted centroid of image?

Mat image;
Moments moments(image);
int x = moments.M10 / moments.M00;
int y = moments.M01 / moments.M00;

Will this code give me the coordinates for the intensity-weighted centroid of image?

image description

Mat image;
Moments moments(image);
int x = moments.M10 / moments.M00;
int y = moments.M01 / moments.M00;