有人可以告诉我如何应用RANSAC找到最好的4个特征匹配点及其相应的(x,y)坐标,以便我可以在我的单应性代码中使用它们吗?
功能匹配点由SIFT获得,这里是代码:
import numpy as np
import cv2
from matplotlib import pyplot as plt
def drawMatches(img1, kp1, img2, kp2, matches):
rows1 = img1.shape[0]
cols1 = img1.shape[1]
rows2 = img2.shape[0]
cols2 = img2.shape[1]
out = np.zeros((max([rows1,rows2]),cols1+cols2,3), dtype='uint8')
# Place the first image to the left
out[:rows1,:cols1] = np.dstack([img1, img1, img1])
# Place the next image to the right of it
out[:rows2,cols1:] = np.dstack([img2, img2, img2])
# For each pair of points we have between both images
# draw circles, then connect …Run Code Online (Sandbox Code Playgroud)