私は後者の比較のために上記のような絵で固定点を見つけたいと私はボードの左上隅を取ると思いました。私はいくつかのことを試しましたが、結果は緑色の点で示されています。私は上の方ではなく、ボードのコーナーでその点を取る方法を見つけたいと思います。私はまた、その点を同じボードの絵のセットで同じにしたいと思っていますが、向きが変わっているかもしれません。人々はエッジ検出に依存する方法を見て
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
blurred = cv2.GaussianBlur(gray, (3, 3), 0)
edged = cv2.Canny(blurred, 10, 200)
edged = cv2.dilate(edged, None, iterations=6)
edged = cv2.erode(edged, None, iterations=6)
(contourss, _) = cv2.findContours(edged.copy(), cv2.RETR_EXTERNAL,
cv2.CHAIN_APPROX_SIMPLE)
contourss = sorted(contourss, key=cv2.contourArea, reverse=True)[:10]
cv2.drawContours(image, contourss[0], -1, (0, 255, 0), 2)
rect1 = cv2.minAreaRect(contourss[0])
box1 = cv2.cv.BoxPoints(rect1)
box1 = np.int0(box1)
topleftPer=[]
for i in box1[1]:
topleftPer.append(i)
pt = (topleftPer[0], topleftPer[1])
cv2.circle(image, pt, 5, (0, 255, 0), -1)
このコーナーは、実際にカーブとして定義されていません。あなたはより良い判断基準を与えるべきです。 –