transform a trapezium into a rectangle
When taking an image of a physical document (i.e. a flat piece of paper) but the camera has not been aligned properly with the plane where the paper was lying on, so that the paper in the picture has some "trapez" to it, how can I rectify that?
Also, how can I rectify that when there are hundreds of such pictures and the plane-misalignment is slightly different in each picture? (whole book photographed)
I am not talking about image rotation, but more about the "trapez-effect" you get when camera and paper are not exactly on the same plane.