Calculate a location on a square, on square's projection on a plane I have the projection of a square on a plane. I know it's four corners' coordinates on said plane. (This is from a picture of a square taken by a camera at an unknown relation to the square.)
I now need to be able to locate any point on the square (in square coordinates) on the plane. (I assume that the center of the square (point 0.5/0.5) is "located" on the plane at the intersection of the diagonals, but I need to be able to locate any arbitrary point.)
I first thought of calculating the percent of the distance on the sides and then finding their intersection. For example, to find point 0.2,0.6 I would find the 0.2 point on the top and bottom sides, create a line between them, and do the same for point 0.6 on the left and right sides. Then find the intersection of these 2 lines. But this would only be an approximation, because the closer side of the square to the camera would have more square-distance per projection-distance.
So how do I achieve the correct calculation?
 A: This is not a complete solution but for all practical purposes it should be sufficient. Let $A'B'C'D'$ be a square in the space and $ABCD$ be its perspective projection on the plane. Let $E$ be the intersection of $AB$ And $CD$. Let $M$ and $N$ be the images of the midpoints of $A'D'$ and $B'C'$. Let $G$ be the intersection of $AC$ and $BD$. Then $M,N,G$ and $E$ are collinear. This is because on the square the line passing through the midpoints of two opposite sides goes through the center of the square and is parallel to the other two sides. Parallel lines in perspective geometry have a vanishing point (or stay parallel if the vanishing point is infinity). We can locate $G$ and $E$ on the image. Draw a line through them to locate $M$ and $N$. Then $MNCD$ is the image of a rectangle. In a similar fashion we can locate the midpoints of its sides. Continuing this way we can locate all the points with coordinates $m/2^n$ on the four sides of the figure. By connecting these points, we obtain a grid inside the figure where each subfigure is the image of a rectangle. We can locate the center of each subfigure by intersecting its diagonals. This gives a mesh of points inside the figure corresponding to the points inside the square. For higher precision, increase $n$ the number of subdivisions of the sides. 
A: The scene plane in which the square lies and the image plane are related by a planar projective transformation. This answer explains a way to compute the transformation. To use that method, you need to choose a coordinate system for the square’s plane. Your idea of treating it as a unit square by computing the fractions of the distances along both dimensions does that, and makes the matrix $A$ for the source part of the map particularly easy to compute: solving $$\begin{pmatrix}0&1&0\\0&0&1\\1&1&1\end{pmatrix} \begin{pmatrix}\lambda\\\mu\\\tau\end{pmatrix} = \begin{pmatrix}1\\1\\1\end{pmatrix}$$ gives $(-1,1,1)^T$, and so $$A^{-1} = \begin{pmatrix}1&1&-1\\1&0&0\\0&1&0\end{pmatrix}.$$ Take care to put the corresponding vertices of the image quadrilateral in the correct order when computing $B$. Note that this doesn’t require knowing anything about the perspective projection itself: you just need the vertex coordinates in the image.
