This is my code.
import cv2 #detect all centers of objects #mark all centers #return modified image def markCenter(canny,img): #get contours using cv2