You are not logged in.

Dear visitor, welcome to Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.


Saturday, June 10th 2017, 7:56pm

What is the math behind autolevel=remap / autolevel=prealign?

I'm trying to utilize the new autolevel feature in our workflow, but we do NOT use Ricoh Thetas, so I'm trying to adapt it for our own camera's yaw/pitch/roll values.
I can't seem to make any sense of what is happening with the remapping (or automatic determination of prealign parameters) of pr10. It seems like it doesn't act how I expect from Tait-Bryan or Euler angles.
I'd love as much detail as possible, even the full-blown nitty gritty equations behind it, but if this level of detail isn't possible, a big-picture description would be also appreciated.
In particular, I can't wrap my head around why the Yaw value (the Y value in the

Source code

statement) is affected if the Compass EXIF tag is zero, and X and Z are non-zero.
For example, I have a JPG whose Accelerometer and Compass values are set to "10 10" and "0", respectively. I then process that image with makepano, using the vtour-vr.config (with autolevel=prealign set in basicsettings.config), and I would expect to see a resulting prealign value whose X and Z values are non-zero, but whose Y value is zero.
Instead, I get

Source code


My best guess is that krpano uses Intrinsic Rotations, but since I've only ever used Extrinsic Rotations, I don't know how to confirm this. (I can't figure out what equations are being used in order to confirm this).
If krpano uses Intrinsic rotations, may I make a feature request for the ability to utilize Extrinsic? I realize this is a very niche request, and I understand if demand requires your attention on other features *smile* .

What I would REALLY love, is some pointers on how I can use my existing extrinsic yaw/pitch/roll values (standard Tait-Bryan angles a la Hugin and PTGui) with krpano so that I can save literally hundreds of hours painstakingly remapping all of our 100,000+ panos. (I have the yaw/pitch/roll values for all panos from an IMU on the camera head, but have not figured out how to takes the final step, and I'm hoping I can leverage the prealign parameter in the xml -- how easy would that be?!?! *g* ). Of course, I'd use krpano to do the autolevel / prealign for all future tours, and for existing tours, I'd just use a perl script to insert the prealign values into the existing tours' xml.

BTW, all of the above may be simply answered by giving me a link to the equations used in krpano -- perhaps even to that above linked Wikipedia page (Are these the ones ?). I am not a math guru (I used to be strong in Math, 20 years ago, but I've forgotten more than I've remembered!) so my ability to efficiently pinpoint this kind of answer is limited.
In summary, I feel too overwhelmed to try all trig equations relating to this, to painstakingly find the correct answer by trial and error, and would really appreciate any hints.
Thank you for any pointers!

Scott Goodwin
Tour example:


Monday, June 12th 2017, 4:09am

I figured out the math, finally. It's a big complex matrix mess, and I ended up writing a VBA function in Excel that calculates the prealign string for any pre-existing yaw/pitch/roll values.

It's a bit too complex to post here, but if anyone is interested, I can give more details.



Posts: 507

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message


Tuesday, June 13th 2017, 8:37am

Yes that's great !!

it seems your strength in math is still here, as obviously it's not a trivial issue.

Would love to hear more about the math behind it.

Thanks in advance step beyond 360

Similar threads