视差图,相机内参数据集
1、特征匹配中match与KnnMatch返回数据类型详解
cv2.SIFT_create().detectAndCompute()的参数:
一般是image和None, 即:
cv2.SIFT_create().detectAndCompute(image,None)cv2.SIFT_create().detectAndCompute()的返回值:
kps, features = cv2.SIFT_create().detectAndCompute()
kps是关键点。它所包含的信息有:
angle:角度,表示关键点的方向,为了保证方向不变形,SIFT算法通过对关键点周围邻域进行梯度运算,求得该点方向。-1为初值。
class_id:当要对图片进行分类时,我们可以用class_id对每个特征点进行区分,未设定时为-1,需要靠自己设定
octave:代表是从金字塔哪一层提取的得到的数据。
pt:关键点点的坐标,是两个浮点型数据。
response:响应程度,代表该点强壮大小,更确切的说,是该点角点的程度。
size:该点直径的大小
2、特征匹配中匹配方法与结果绘制的对应关系
import cv2 as cv
import numpy as np
def SIFT_Feature(img1, img2):
# 初始化ORB
# orb = cv.ORB_create()
sift = cv.SIFT_create()
(kp1, des1) = sift.detectAndCompute(img1, None)
(kp2, des2) = sift.detectAndCompute(img2, None)
# 画出关键点
outimg1 = cv.drawKeypoints(img1, keypoints=kp1, outImage=None, color=(255, 0, 0))
outimg2 = cv.drawKeypoints(img2, keypoints=kp2, outImage=None, color=(255, 0, 0))
# 显示关键点
# 对提取特征点后的图像进行横向拼接
outimg3 = np.hstack([outimg1, outimg2])
cv.imshow("Key