def onmouse(event, x, y, flags, param): global seed_pt if flags & cv2.EVENT_FLAG_LBUTTON: seed_pt = x, y update()