I hope I ask this in the correct place. How do I get the width and height ratio of for example a sheet of paper (or some other rectangular thing) from a image. 
I have built a program that that changes the perspective a paper in a image, but I don't know what the ratio of the width and hight of the paper is. (Of course I know when it is an A4 sheet, but not for all rectangular objects). Is it even possible to calculate this?