Find the center point of an object in a black-white image using C++ opencv
问题 I have the image below. My aim is to find x,y values of the center point of the object. I tried Image moments but I couldn't find any x,y values. How can I do that? The center point shoud be the red point or something close to it. 回答1: In the link you posted, you can find the center of the image here: /// Get the mass centers: vector<Point2f> mc( contours.size() ); for( int i = 0; i < contours.size(); i++ ) { mc[i] = Point2f( mu[i].m10/mu[i].m00 , mu[i].m01/mu[i].m00 ); } You can find the