Let assume that I have a picture of a square table and I want to put 3d cube on top of it like this : table image
and I have this information : pixel coordinates
How can I calculate the transformation matrix? I believe that the answer is in the perspective coordinates but I couldn't figure it out.