First time here? Check out the FAQ!
answered 2020-10-22 11:43:22 -0600
you need to change (y, x) to (x, y)
r = cv2.pointPolygonTest(contours[i], (y, x), False)
to
r = cv2.pointPolygonTest(contours[i], (x, y), False)