Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Opencv 使用球体的图像配准-扭曲图像不变_Opencv_Image Processing_Orb_Image Registration - Fatal编程技术网

Opencv 使用球体的图像配准-扭曲图像不变

Opencv 使用球体的图像配准-扭曲图像不变,opencv,image-processing,orb,image-registration,Opencv,Image Processing,Orb,Image Registration,我试着注册两张相似的图片;然而,在执行代码后,我最终得到了确切的参考图片 我注册这两张图片的主要目的是找出差异,有什么想法我如何才能获得差异 orb= cv.ORB_create(1000) kp1, des1 = orb.detectAndCompute(grey, None) kp2, dess2 = orb.detectAndCompute(greyy, None) matcher = cv.DescriptorMatcher_create(cv.DescriptorMatcher_B

我试着注册两张相似的图片;然而,在执行代码后,我最终得到了确切的参考图片

我注册这两张图片的主要目的是找出差异,有什么想法我如何才能获得差异

orb= cv.ORB_create(1000)
kp1, des1 = orb.detectAndCompute(grey, None)
kp2, dess2 = orb.detectAndCompute(greyy, None)  
matcher = cv.DescriptorMatcher_create(cv.DescriptorMatcher_BRUTEFORCE_HAMMING)

matches = matcher.match(des1, des2, None)
matches = sorted(matches, key=lambda x:x.distance)

points1 = np.zeros((len(matches), 2), dtype=np.float32)
points2 = np.zeros((len(matches), 2), dtype=np.float32)

for i, match in enumerate(matches):
    points1[i, :] = kp1[match.queryIdx].pt
    points2[i, :] = kp2[match.trainIdx].pt

h, mask= cv.findHomography(points1, points2, cv.RANSAC)

regimg = cv.warpPerspective(img1, h, (width,height))
cv.imshow('registered', regimg)

按照评论中的要求:

您的图像看起来像什么?你也可以分享吗?@YunusTemurlenk我已经发布了我使用orb后得到的结果,注册的图像看起来就像左边的一个,是参考,我只想计算它们之间的差异。你有这么多不正确的匹配。您应该检查通过findhomography获得的有效匹配,以查看它们如何影响注册。