Find center of mass of contour image