基于opencv的图像特征点提取

import cv2 as cv

##特征点
img = cv.imread("C:/img.jpg")
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
sift = cv.xfeatures2d.SIFT_create()
kp = sift.detect(gray, None)
img = cv.drawKeypoints(gray, kp, img)

# 特征点画圈圈
img = cv.drawKeypoints(gray, kp, img, flags=cv.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)

cv.imshow("123", img)
cv.waitKey(0)
sift = cv.xfeatures2d.SIFT_create()
kp, des = sift.detectAndCompute(gray, None)

原图

基于opencv的图像特征点提取_第1张图片

 

 

你可能感兴趣的:(opencv,计算机视觉,人工智能)