Skip to content

Instantly share code, notes, and snippets.

@andijakl
Created November 23, 2020 13:37
Show Gist options
  • Save andijakl/9c34334c338f70cde7e84c3cfc1a4e88 to your computer and use it in GitHub Desktop.
Save andijakl/9c34334c338f70cde7e84c3cfc1a4e88 to your computer and use it in GitHub Desktop.
Python OpenCV implementation to calculate keypoints and their descriptors with SIFT
# 1. Detect keypoints and their descriptors
# Based on: https://docs.opencv.org/master/dc/dc3/tutorial_py_matcher.html
# Initiate SIFT detector
sift = cv.SIFT_create()
# find the keypoints and descriptors with SIFT
kp1, des1 = sift.detectAndCompute(img1, None)
kp2, des2 = sift.detectAndCompute(img2, None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment