opencv更新单应性矩阵以适合两倍大小的图像 [英] opencv update homography matrix to fit on an image double the size

查看:367
本文介绍了opencv更新单应性矩阵以适合两倍大小的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用光流进行视频稳定.为了使calcOpticalFlowPyrLK更快地工作,我将原始图像缩小了2倍,并在该图像上运行了该函数.

如何修改同形异义词矩阵(通过findHomography检索),以便能够透视原始的较大图像.

解决方案

Let B be the transformation you have computed, you can multiply B by another homography, A, to get AB = C, where C is a homography that does both transformations, this is equivalent to apply first B and then A. To find A you can use getPerspectiveTransform.

Edit: by AB I meant matrix multiplication, not element-wise multiplication.

Edit 2: to get A you pass the four corners of the two images in the same order to getPerspectiveTransform such that the corners of the downsampled image are the source points and the corners of the original image are the destination points.

这篇关于opencv更新单应性矩阵以适合两倍大小的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆