  This paper presents a method for metric rectification of planar objects that
preserves angles and length ratios. An inner structure of an object is assumed
to follow the laws of Manhattan World i.e. the majority of line segments are
aligned with two orthogonal directions of the object. For that purpose we
introduce the method that estimates the position of two vanishing points
corresponding to the main object directions. It is based on an original
optimization function of segments that estimates a vanishing point position.
For calculation of the rectification homography with two vanishing points we
propose a new method based on estimation of the camera rotation so that the
camera axis is perpendicular to the object plane. The proposed method can be
applied for rectification of various objects such as documents or building
facades. Also since the camera rotation is estimated the method can be employed
for estimation of object orientation (for example, during a surgery with
radiograph of osteosynthesis implants). The method was evaluated on the
MIDV-500 dataset containing projectively distorted images of documents with
complex background. According to the experimental results an accuracy of the
proposed method is better or equal to the-state-of-the-art if the background
occupies no more than half of the image. Runtime of the method is around 3ms on
core i7 3610qm CPU.
