平方同位坐标 [英] Square Homogenic coordinates

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

问题描述

我在3D空间中有一个正方形的2D图片(投影)。我知道这是一个完美的方形(90度角,长度相等的边)。

I have a 2D picture (projection) of a square in 3D space. I know that this is a perfect square (90 degree angles, and equal length sides).

我想能够在投影,并在正方形上找到真实坐标。从互联网上的一点点看,我已经明白,这些被称为同源坐标的点。 (这是正确的吗?)。为了简单起见,请假设每个正方形边缘的长度为1。

I would like to be able to poke a point on the projection of the square and find the "real" coordinates on the square. From reading a little bit around the internet I have come to understand that these are called "homogenic coordinates" of the point. (is this right?). For simplicities sake, please assume that the length of each of the square's edges is 1.

为了简单起见,假设相机是一个非失真的针孔相机,如果需要,我可以测量任何属性。此外,相机上的x,y坐标的长度是对称的。

For simplicity's sake assume that the camera is a non-distorted pinhole camera, and that I can measure any of it's properties if needed. Also that the x,y coordinates on the camera are symmetric in length.

我的程序是,我想在棋盘上找到一个棋子。我很容易检测到板的角落,很容易找到该片。但我试图跳过检测电路板上的各个方块。

My program is that I am trying to locate a chess piece on a chessboard. It's easy for me to detect the board's corners, and easy to locate the piece. However I'm trying to skip detecting the individual squares on the board.

推荐答案

您的四边形顶点(u(i),v(i))是方形顶点(x(i),y(i))的透视投影。要找到正方形上某点的坐标,你必须使用四对点来找到反透视变换的矩阵,并将此矩阵应用到给定的点坐标。

Paul Heckbert的文章展示了这个过程的数学。

Your quad vertices (u(i),v(i)) are perspective projection of square vertices (x(i),y(i)). To find coordinates of some point on square, you have to find matrix of inverse perspective transform using four pairs of points, and apply this matrix to given point coordinates.
Paul Heckbert article shows the math of this process.

您可以找到即用库来计算persp。矩阵。 C ++版本: Agg2

Probably you can find ready-to-use libraries for calculation of persp. matrix. C++ variant: Agg2

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

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