图像拼接--Automatic Panoramic Image Stitching using Invariant Features

Automatic Panoramic Image Stitching using Invariant Features
《International Journal of Computer Vision》 , 2007 , 74 (1) :59-73

本文提出使用 SIFT 做特征点匹配,然后用 bundle adjustment 计算图像坐标转换参数(类似 Homography),最后使用 multi-band blending 得到最终的拼接图

算法流程如下所示:
在这里插入图片描述

1)提取 SIFT 特征点
2)使用 k-d tree 做特征点匹配
3)对每个图像:
(1)提出 m 个 和该图像最匹配的图像
(2)使用 RANSAC 寻找几何位置一致的匹配对求解 homography
(3)使用一个 probabilistic model 验证 匹配是否正确
4)对不同场景图像进行聚类
5)对于每个场景图像
(1)使用 bundle adjustment 求解所有相机的旋转参数和相机焦距
(2) 使用 multi-band blending 拼图

在这里插入图片描述
在这里插入图片描述

Connected components of image matches
在这里插入图片描述
在这里插入图片描述

automatic straightening
在这里插入图片描述

gain compensation
在这里插入图片描述
在这里插入图片描述

Multi-band blending
在这里插入图片描述

Stitching with rotation and zoom
在这里插入图片描述

11

  • 4
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Panoramic stitching is the process of combining multiple images to create a single panoramic image. Optical flow tracing is a technique used to track the movement of pixels between consecutive frames in a video or between multiple images. Here's an example of how you can implement panoramic stitching using the optical flow tracing principle in Python: 1. Start by importing the necessary libraries, such as OpenCV, Numpy, and Matplotlib. ``` import cv2 import numpy as np import matplotlib.pyplot as plt ``` 2. Load the images that you want to stitch into a list. ``` images = [cv2.imread('image1.jpg'), cv2.imread('image2.jpg'), ... ] ``` 3. Use the Lucas-Kanade optical flow method to track the movement of pixels between the images. ``` gray_images = [cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) for img in images] prev_gray = gray_images[0] flow = None for i in range(1, len(gray_images)): curr_gray = gray_images[i] flow = cv2.calcOpticalFlowFarneback(prev_gray, curr_gray, flow, 0.5, 3, 15, 3, 5, 1.2, 0) prev_gray = curr_gray ``` 4. Use the optical flow information to warp the images and align them. ``` warped_images = [] for i in range(len(images)): H = np.eye(3) for j in range(i): H = np.dot(H, cv2.estimateRigidTransform(gray_images[j], gray_images[i], False)) warped = cv2.warpPerspective(images[i], H, (images[i].shape[1] + int(H[0,2]), images[i].shape[0] + int(H[1,2]))) warped_images.append(warped) ``` 5. Finally, use the aligned images to create a single panoramic image. ``` panorama = warped_images[0] for i in range(1, len(warped_images)): panorama = cv2.addWeighted(panorama, 1, warped_images[i], 1, 0) ``` This is just a basic example, and you may need to adjust the parameters or use a different approach depending on your specific use case. But I hope it gives you an idea of how to implement panoramic stitching using the optical flow tracing principle in Python.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值