I have extracted a subimage from the main image and applies contour and found the contour centroid , so I have the centroid coordinates of subimage. My subimage size is