【发布时间】:2018-06-25 16:57:32
【问题描述】:
在 python 中使用 OpenCV,我试图拼接多个乱序的图像。我有一个有效的缝合方法,可以缝合两个图像,给定左右一个。
def stitch(self, images, ratio=0.75, reprojThresh=4.0,
showMatches=False):
"""
This function performs image stitching with help of other member functions of Stitcher class.
Args:
images (list) : List of two images ordered left to right
ratio (float) : Ratio for Lowe's Test
reprojThresh (float) : reprojThresh parameter for RANSAC for homography computation
showMatches (bool) : Flag for marking showing matches on input images
"""
(imageL, imageR) = images
#Find key points and features for input images
(kpsR, featuresR) = self.find_kp_features(imageR)
(kpsL, featuresL) = self.find_kp_features(imageL)
# Match features between two input images
M = self.matchKeypoints(kpsR, kpsL, featuresR, featuresL, ratio, reprojThresh)
if M is None:
return None
(matches, H, status) = M
#Perform perspective correction on second image (imageR)
result = cv2.warpPerspective(imageR, H, (imageR.shape[1] + imageL.shape[1], imageR.shape[0]))
#Insert Left image (imageL) in result to obtai stitched image
result[0:imageL.shape[0], 0:imageL.shape[1]] = imageL
if showMatches:
vis = self.drawMatches(imageR, imageL, kpsR, kpsL, matches,
status)
return (result, vis)
return result
来源:https://github.com/TejasBob/Panorama/blob/master/image-stitching-report.pdf
我已阅读以下paper,但我仍然对将多张随机顺序的图像拼接在一起的方法感到困惑。我考虑过使用捆绑调整算法,但我不知道可能的实现。
我的问题是将多个无序的图像拼接在一起的最佳方法是什么?我能做的一些合适的材料或伪代码也会有所帮助。
【问题讨论】:
-
你说的'我修好了'是什么意思?你能分享你的方法吗?
-
对不起,这是对版主评论的回应。我还没有找到解决方案。如果您有任何想法,请告诉我。
-
THIS BLOG可以帮到你!!
标签: python opencv image-processing computer-vision image-stitching