opencv更新单应性矩阵以适合两倍大小的图像 [英] opencv update homography matrix to fit on an image double the size
问题描述
我正在使用光流进行视频稳定.为了使calcOpticalFlowPyrLK更快地工作,我将原始图像缩小了2倍,并在该图像上运行了该函数.
如何修改同形异义词矩阵(通过findHomography检索),以便能够透视原始的较大图像.
I'm doing video stabilization using optical flow. To make calcOpticalFlowPyrLK work faster I'm downscaling the original image 2x and running the function on that.
How can I modify the homograph matrix (retrieved via findHomography) to be able to warpPerspective the original, larger, image.
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屋!