方形到梯形 [英] square to trapezoid

查看:111
本文介绍了方形到梯形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道将正方形变换成梯形是线性变换,可以使用射影矩阵来完成,但是我在确定如何构造矩阵方面遇到了一些麻烦.

I know that transforming a square into a trapezoid is a linear transformation, and can be done using the projective matrix, but I'm having a little trouble figuring out how to construct the matrix.

使用投影矩阵进行平移,缩放,旋转和剪切很简单.是否有一个简单的投影矩阵将正方形转换成梯形?

Using the projective matrix to translate, scale, rotates, and shear is straightforward. Is there a simple projective matrix which will transform a square to a trapezoid?

推荐答案

a,b,c,d是2D正方形的四个角.

a,b,c,d are the four corners of your 2D square.

a,b,c,d用齐次坐标表示,因此它们是3x1矩阵.

a,b,c,d are expressed in homogeneous coordinate and so they are 3x1 matrices.

alpha,beta,gamma和delta是2D梯形的四个角.

alpha, beta, gamma, delta are the four corners of your 2D trapezoid.

alpha,beta,gamma和delta用齐次坐标表示,因此它们是3x1矩阵.

alpha, beta, gamma, delta are expressed in homogeneous coordinate and so they are 3x1 matrices.

H是您要寻找的3x3矩阵,也称为单应性

H is the 3x3 matrix you are looking for, it is also called an homography

    h1 h2 h3
H = h4 h5 h6
    h7 h8 h9

H将a,b,c,d映射为alpha,beta,gamma,delta,因此您具有以下四个方程式

H maps a,b,c,d into alpha, beta, gamma, delta and so you have the following four equations

alpha=H*a
beta=H*b
gamma=H*c
delta=H*d

假设您知道a,b,c,d和alpha,beta,gamma,delta,则可以为九个未知数h1,h2,h3,h4,h5,h6,h7,h8,h9求解前面的四个方程组.

Assuming you know a,b,c,d and alpha, beta, gamma, delta you can solve the previous four equation system for the nine unknowns h1, h2, h3, h4, h5, h6, h7, h8, h9.

在这里,我刚刚描述了该问题的原始"解决方案,该解决方案原则上可以起作用;有关上述方法的详细说明,请参见以下页面,例如 http://www.corrmap.com/features/homography_transformation.php 在其中放置h9=1(因为H可以仅用8个参数表示),然后用八个未知数求解由八个方程组成的线性系统.您可以在论文的第2部分 Homography Estimation 中找到类似的解释. >由埃伦·杜布罗夫斯基(Elan Dubrofsky).

Here I have just described a "raw" solution to the problem, that, in principle, can work; for a detailed explanation of the above mentioned method you can see for example this page http://www.corrmap.com/features/homography_transformation.php where they put h9=1 (since H can be expressed just with 8 parameters) and then solve a linear system of eight equations in eight unknowns. You can find a similar explanation in section 2 of the thesis Homography Estimation by Elan Dubrofsky.

另一种解释是David Austin在

Another explanation is Using Projective Geometry to Correct a Camera by David Austin in the 2013 March issue of Feature Column from the AMS.

Richard Hartley和Andrew Zissermann在第二版计算机视觉中的多视图几何的第4章估计-2D投影变换"中描述了上述方法的缺点.还描述了不同且更好的算法;您可以检查此链接 http://www.cse.iitd.ac.in/〜suban/vision/geometry/node24.html 似乎遵循同一本书.

The above mentioned method, with its disadvantages, is described in chapter 4 "Estimation - 2D Projective Transformation" in the second edition of Multiple view geometry in computer vision by Richard Hartley and Andrew Zissermann where they also describe different and better algorithms; you can check this link http://www.cse.iitd.ac.in/~suban/vision/geometry/node24.html which seems to follow the same book.

您可以在 计算机视觉:模型, Simon JD Prince 的《学习与推理》.算法算法15.4:投影变换(单应性)的最大似然学习在他的

You can find another explanation of the homography in section 15.1.4, "Projective transformation model" of the book Computer Vision: Models, Learning, and Inference by Simon J.D. Prince. The algorithm Algorithm 15.4: maximum likelihood learning of projective transformation (homography) is outlined in his Algorithms booklet: the problem is solved by means of a non-linear minimization.

这篇关于方形到梯形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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