1 | initial version |
It will require a cylindrical surface model transform. See this paper for details.
Fortunately, in most cases, you can get by with an approximation by decomposing the transform into two:
This is just an approximation. If you need a mathematically correct result, you will need another paper.
Keep in mind that for perspective transform, the "center" of the quadrilateral (generally speaking) should be taken to mean the "centroid" of the quadrilateral in mathematical terms. It is the intersection point of the lines AC, BD, which are the two diagonals of the quadrilateral.
2 | add picture to illustrate how to supply four correspondence points for perspective dewarping |
It will require a cylindrical surface model transform. See this paper for details.
Fortunately, in most cases, you can get by with an approximation by decomposing the transform into two:
This is just an approximation. If you need a mathematically correct result, you will need another paper.
Keep in mind that for perspective transform, the "center" of the quadrilateral (generally speaking) should be taken to mean the "centroid" of the quadrilateral in mathematical terms. It is the intersection point of the lines AC, BD, which are the two diagonals of the quadrilateral.
Added information:
Here is an illustration of the dewarping model:
The bounded area is divided into strips. The vertical boundaries of these strips would have been parallel lines in the word coordinate system (i.e. when measured on the physical object). On the image, these vertical boundaries form a family of lines, which, together with the left and right boundaries of the object, are either coincident at a vanishing point, or are perfectly parallel with each other.
Each strip provides four coordinates (corners) for the dewarping process. In order to generate perspectively correct dewarped result, four correspondence points must be specified. If only two points were given (one from the top curve, another one from the bottom curve), the dewarped pixels will appear distorted and perspectively wrong.