Correction of Planar (Stretch) DistortionWritten by Paul BourkeNovember 1989
The following mathematics and illustrations came from a project to undistort photographs taken of a flat piece of land. The photographs were taken from various angles to the ground and thus needed to be "straightened" so that relative area measures could be taken. The same technique could of course be used to intentionally distort rectangular areas. The conventional (cartesian) method of uniquely specifying a point in 2 dimensions is by two coordinates. For the unit square below these two coordinates will be called mu and delta, they are the relative distances along the horizontal and vertical edges of the square. ![]()
If the square above is linearly distorted (stretched) the internal coordinate mesh is also distorted but the relative distances (mu and delta) of a point P along two connected edges remains the same. ![]()
To undistort any point P within the polygon we need to find the ratios mu and delta. Point A is given by: ![]() Point B is given by
![]() For the point P along the line AB
![]() Substituting for A and B, equation 1
![]()
This gives two equations, one for the x coordinate and the other for the y coordinate, equation 2,3 ![]()
Dividing equation (2) by (3) removes delta, solving for mu gives a quadratic of the form ![]() where
![]() After solving the quadratic for mu, delta can be calculated from (1) above. |