$30
Scene. The back side of Villa Melzi d’Eril in Bellagio. In the bottom view below, all lines lie on a same horizontal plane ∏. In addition the facades 1 and 5 are coplanar, and both are parallel to facade 3. Furthermore, facades 2 and 4 are perpendicular to facades 1, 3 and 5. The sun is placed at the point at the infinity 𝑆𝑆 = [3.9 −1 𝑧𝑧 0]𝑇𝑇 -where 𝑧𝑧 is irrelevant- wrt to the reference frame reported in the picture. The layout of the architectonic elements on facade 3 is symmetric with respect to a central vertical axis. Windows of facades 1, 3 and 5 are are equally wide.
Windows of facades 2 and 4 can not be expoited in reconstruction since they are poorly visible.
Image. An image of the back side of Villa Melzi d’Eril is taken by a digital camera. The camera skew factor is assumed to be null; the aspect ratio is unknown (thus natural camera can not be assumed), as well as the principal point and the focal distance. The camera height (z-coordinate) over the ground plane is 1.5 m.
ASSIGNMENT
Write and test a Matlab program that analyzes the given image in order to extract the informatin items listed below.
Image Processing.
F1. Feature extraction. Combining the learned techniques, find edges, corner features and straight lines in the image. Then manually select those features and those lines, that are useful for the subsequent steps.
Geometry
G1. 2D reconstruction of a horizontal section. Rectify (2D reconstruct) the horizontal section of the building from the useful selected image lines and features, including vertical shadows. In particular, determine the ratio between the width of facade 2 (or 4) and the width of facade 3.
Hint: use normalized coordinates to reduce numerical errors (e.g. set image size = 1) and exploit the symmetry of facede 3 to improve accuracy.
G2. Calibration. First extract a vertical vanishing point and then use it together with useful information extracted during the rectificatino step, in order to estimate the calibration matrix K containing the intrinsic parameters of the camera, namely. focal distance, aspect ratio and position of principal point.
G3. Reconstruction of a vertical facade. Use the knowledge of K to rectify also a vertical facade, as, e.g., facade 3.
G4. Localization. Determine the relative pose (i.e. position and orientation) between facade 3 and the camera reference. Use information about the camera height to solve for scale.
Design suitable techniques to solve the indicated steps and implement the designed solutions in Matlab. For each intermediate steps include experimental results obtained by applying the chosen techniques to the given image. Write a well written report including the explanation of the followed approach and the obtained results (both numerical and graphical) for each step.