方齐次坐标 [英] Square Homogenic coordinates

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

问题描述

我有一张 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天全站免登陆