# Planar Homographies in MATLAB

I have taken an image in height 2 meters of the ground as the original image and I want to simulate another image in 50 cm's of the ground, such as the simulated image.

The focal length of my camera is 3.7 mm (f = 3.7).

I have used from planar homography: H = k'*(eye(3) - ((t*n')/d))*inv(k) for each plane in original image in MATLAB where in the camera coordinate system:

• x axis is perpendicular to buildings in the right side of the ground,
• y axis is parallel to the ground,
• and hence z axis is upward perpendicular to the ground.

The origin is camera location in original image and k is 3x3 camera calibration matrix:

[f 0 0; 0 f 0; 0 0 1]

t is the transfer matrix [0 0 -1.5], n is the normal vector of a plane, d is the plane distance to the origin, and eye(3) is camera rotation.

For example, the plane of the ground has n=[0 0 1] and d = 2, is it true?

Please help me with implementation of other planes (sky, buildings) in MATLAB.

Original image:

Simulated image: