Cv2.moments Center of the contour OpenCV center of contour - PyImageSearch # compute the center of the contour M = cv2.moments(c) cX = int(M["m10"] / M["m00"]) cY = int(M["m01"] / M["m00"]) return cX, cY See also opencv Image moment OpenCV:Moments