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

    Code
    prealign="X|Y|Z"

    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

    Code
    prealign="-10.15|-1.75|-9.85"


    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
    Fishviews
    https://www.fishviews.com
    Tour example: https://tours.fishviews.com/public/green-lake

  • 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.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!