python opencv判斷點在自定義輪廓內
點:point
范圍: (x1, y1) 與 (x2, y2) 構成的矩形輪廓
x1, y1, x2, y2 = (0, 0, 300, 300)
point = (220, 110)
testContour = np.array([np.array([x1, y1]), np.array([x2, y1]), np.array([x2, y2]), np.array([x1, y2])])
exist = cv2.pointPolygonTest(testContour, point, True)
print("test result: ", exist)