Ask Your Question

Revision history [back]

Correcting a spherical photo

I have a set of spherical panoramic images that include roll, pitch and yaw along with the 3d location of the camera in x,y,z. I would like to transform these images such that these rotations are removed and all images have a common orientation. My thinking to do this was as follows;

  • Consider each pixel as a point on the surface of a 3d sphere, where the x offset corresponded to horizontal angle, y offset to vertical angle and focal length as radius.
  • Convert these spherical coordinates to Cartesian coordinates Create a rotation matrix from the angles provided and use it to rotate these coordinates
  • Convert the coordinates back to spherical polar coordinates, which correspond to corrected pixel positions

While this seems to work ok visually, testing it against known coordinates in the same frame comes up with errors. I had hoped this was due to order of application of angles but this seems not to be the case. Is there a better way of doing this?