Equirectangular rotation_v0.1 - FoxelSA/libgnomonic GitHub Wiki
The equirectangular rotation transformation allows to apply three angle rotation, according to the three frame unit vectors, of the equirectangular mapping. This function is typically used when the camera that takes a panorama is not aligned with scene natural horizon in order to straighten it up.
The applied rotation transform brings the original panorama on the rotated one using the following expression : considering the three rotation matrices associated to the basic vectors, the rotation transform is given by :
R(x,y,z) = R_z(z) R_y(y) R_x(x)
The x and y basis vectors are coplanar with the equirectangular horizon plane of the original mapping and x is pointing toward the equirectangle mapping left edge, when the y one point the last quarter of the mapping.
To illustrate the rotation transformation, the following equirectangular mapping of a panorama obtained using an Eyesis4Pi camera (copyright (c) Didier Mouron under CC BY-SA license) :
The following equirectangular mapping is obtained using a rotation of 45 degrees along the x axis of the previous mapping :
The following mapping is obtained through a 45 degrees rotation along the y axis :
This last single angle rotation example is obtained considering a 45 degrees rotation along the y axis :
The rotation transformation can apply multiple rotation angles at the same time. The following equirectangular mapping is obtained with a 45 degrees rotation along each unit vector :
One as to keep in mind that such transformation, even considering a high order interpolation method, has effect on the image. Significant number of successive transformations decrease the quality of the image.