想法:想使用SIFT和SURF匹配的特征点来当做先验信息加入网络。
需求:需要极可靠的匹配点以及相应坐标以及计算视差
代码:
import numpy as np
import cv2
from matplotlib import pyplot as plt
imgname1 = 'path1'
imgname2 = 'path2'
MIN_MATCH_COUNT = 10 #设置最低特征点匹配数量为10
template = cv2.imread(imgname1,0) # queryImage
target = cv2.imread(imgname2,0) # trainImage
# Initiate SIFT and SIRF detector创建sift和surf检测器
surf = cv2.xfeatures2d.SURF_create()
sift = cv2.xfeatures2d.SIFT_create()
# find the keypoints and descriptors with SIFT or SURF
kp1, des1 = surf.detectAndCompute(template,None