I have some highly misaligned panoramic images, and I want to convert them into perfectly aligned cube faces.
Here’s my process:
- I obtain the image.prealign (x|y|z) values using krpano Tools → Edit pano-type → Set North and Level the Pano.
- I invert the values: positive becomes negative, and negative becomes positive.
- I run krpanotools spheretocube CUBE pano.tif cube.tif -rotate=XYZ,x,y,z
In some cases, the cube faces are generated perfectly aligned. But not always.
When I change -rotate=XYZ,x,y,z to -rotate=ZYX,x,y,z, the cube faces that were previously misaligned become perfectly aligned. However, those that were already aligned now become misaligned.
I have two examples:
- prealign="-2.547|-41.74|1.762" → with -rotate=XYZ,2.547,41.74,-1.762, the cube faces are perfect.
- prealign="-0.416|75.013|-2.556" → with -rotate=ZYX,0.416,-75.013,2.556, the cube faces are perfect.
Here’s my question: how do I determine when to use XYZ and when to use ZYX?
Is there a formula or a method to figure this out?
Thanks!
Translated by ChatGPT.