プログラム
import cv2 import numpy as np img = cv2.imread('haruna_kankore.png') gray = cv2.imread('haruna_kankore.png', 0) gray = np.float32(gray) dst = cv2.goodFeaturesToTrack(gray,2,3,0.06) corners = cv2.goodFeaturesToTrack(gray,25,0.01,10) corners = np.int0(corners) for i in corners: x,y = i.ravel() cv2.circle(img,(x,y),3,255,-1) cv2.imwrite('Shi-Tomasi1.png', img)
出力結果
参考
Shi-Tomasiのコーナー検出とGood Features to Track(追跡に向いた特徴) — OpenCV-Python Tutorials 1 documentation