Square Homogenic coordinates

2019-06-13 23:00发布

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).

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.

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.

enter image description here

1条回答
时光不老,我们不散
2楼-- · 2019-06-13 23:53

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.

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

查看更多
登录 后发表回答