Created
March 8, 2024 00:24
-
-
Save shrimo/05f865d7ea8be5cdcbffb1a32d42b4d7 to your computer and use it in GitHub Desktop.
Feature points (CV)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
file = "image.jpg" | |
img = cv2.imread(file) | |
[ | |
cv2.circle(img, (np.int32(ppt)), 5, (0, 255, 0), 1) | |
for ppt in [ | |
(int(points.pt[0]), int(points.pt[1])) | |
for points in [ | |
keypoints | |
for keypoints in cv2.SIFT_create(500).detectAndCompute( | |
cv2.cvtColor(img, cv2.COLOR_BGR2GRAY), None | |
) | |
][0] | |
] | |
] | |
cv2.imshow("image", img) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment