Search
Consider the images were captured with the following EXIF info (focal length is in milimeters):
The images were then resized.
Panorama
i-j
i
U[i-1,j-1]
U{i,j}
j
U[j-1,i-1]
U{j,i}
H_ij
u2h_optim
06_errors.pdf
H_i4
H_44
H_4i
06_borders.pdf
06_panorama.png
K
06_data.mat
06_borders_c.pdf
06_panorama_c.png
The cylinder is defined in the coordinate system γ (blue) of the image 04 (green) such that:
This leads that the cylinder has radius = 1 in the γ system. The cylinder surface is a set of points $[x_{\gamma} y_{\gamma} z_{\gamma}]^\top$ such that
$$x_{\gamma}^2 + z_{\gamma}^2 = 1$$
For parametrisation of the cylinder surface we define two coordinate systems: the first (magenta) is based on γ, second (red) is pixel-based system of panoramic image.
First, the surface of the cylinder is parametrised by circumference length (equal to angle since radius=1) and by the $y_{\gamma}$ coordinate. The ray $\lambda [x_{\gamma} y_{\gamma} z_{\gamma}]^\top$ intersects the cylinder in the point
$$\lambda=\frac{1}{\sqrt{x_{\gamma}^2 + z_{\gamma}^2}}$$
$$[ a_{c\gamma}; y_{c\gamma} ] = [ \mbox{the angle given by } x_{\gamma} \mbox{ and } z_{\gamma}; \frac{y_{\gamma}}{\sqrt{x_{\gamma}^2 + z_{\gamma}^2}} ]$$
Second, the pixel size must be applied and image origin adjusted. Since the horizontal pixel size is 1/K(1,1) measured in units given by γ system, this leads to
$$[ x_c; y_c ] = K_{11} [ a_{c\gamma}; y_{c\gamma} ] + [x_{0c}; y_{0c} ]$$
where the origin $[x_{0c}; y_{0c}]$ must be found such that all pixels from the input images will fit into the resulting panorama.
Upload an archive consisting of:
06_histograms.pdf
hw06.m
hw06.py