COMP9517 lab2 SIFT
https://www.cnblogs.com/my-love-is-python/p/10414135.html
Task1:
sift一些函数及用法
detector = cv2.xfeatures2d.SIFT_create()
keyPoints = detector.detect(img,None)
imgWithPoint = cv2.drawKeyPoints( img,keyPoints,img )
https://docs.opencv.org/3.4.9/d5/d3c/classcv_1_1xfeatures2d_1_1SIFT.html
contrastThreshold | The contrast threshold used to filter out weak features in semi-uniform (low-contrast) regions. The larger the threshold, the less features are produced by the detector. |
Task2:
https://www.tutorialkart.com/opencv/python/opencv-python-resize-image/
cv2.resize()
https://docs.opencv.org/master/dc/dc3/tutorial_py_matcher.html
bf = cv2.BFMatcher()
Sift 感觉都是用的bf.knnMatch()
Task3:
1) 旋转的中心是 image[1]//2, image[0]//2 需要颠倒过来, 旋转的度数,顺时针为负
center = get_img_center(img)
rotated_img = rotate(img,center[1],center[0],-60)