首页 > 其他分享 >240726 sift特征点检测

240726 sift特征点检测

时间:2024-09-01 10:55:35浏览次数:12  
标签:DRAW img 检测 imshow cv2 SIFT sift 240726


240726 sift特征点检测_计算机视觉

# -*- coding: utf-8 -*-
 import sysimport cv2
 import numpy as np# 加载数据
 input_file = 'table.jpg' #sys.argv[1]
 img = cv2.imread(input_file)
 img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
 # 提取关键点
 sift = cv2.xfeatures2d.SIFT_create()
 keypoints = sift.detect(img_gray, None)
 # 画出特征点
 img_sift = np.copy(img)
 cv2.drawKeypoints(img, keypoints, img_sift, flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)
 # 展示
 cv2.imshow('Input image', img)
 cv2.imshow('SIFT features', img_sift)
 cv2.waitKey()


 

标签:DRAW,img,检测,imshow,cv2,SIFT,sift,240726
From: https://blog.51cto.com/u_15862653/11888518

相关文章