Re: [PanoTools-devel] [OT] coordinate transformations From: Pablo d'Angelo - 2006-10-17 18:05 ```Hi Erik, > Hello, > > sorry for posting off topic. The main list wasn't of much help... > > Is there someone who understands spherical coordinate transformations > - especially the rotation of euler angles (this is what we call yaw, > roll and pitch). I need to do the calculation that is done f.e. in > PTGui, there called "numerical transform". I guess Joost wants to keep the secret ;-) What you need to do is not modify the individual yaw, roll and pitch values (as you have noticed), but use transform them into one entity, like a rotation matrix, a rodriguez vector, or a quaternion. So the steps I would propose are: 1. transform rpy into a rotation matrix (3x3): M = rpy2rmat(r,p,y) 2. Multiply the rotation matrix with whatever transformation matrix: M_new = T*M; 3. extract yaw, roll pitch from M_new. Operation 1 is at least partly in the panotools source code, in the math.c and adjust.c files, it is however split over multiple functions and a bit hard to comprehend what it is really doing. Operations 2 and 3 are not required by panotools and are probably not implemented. The only really tricky part is to find out what kind of euler coordinates panotools uses, since there are 12 different ways the rotations angles can be applied, and everybody seems to call their particular scheme euler angles. The required formulas can then be found in http://ai.stanford.edu/~diebel/attitude.html I can try to figure out what kind of rpy convention panotools uses. > In practice: I have the position of an image relative to an extracted > floor cube face and need to pitch it down to the bottom of the > equirect from which the cube face was extracted previously. The goal > is automatic nadir stitching. Ah, please let us know of the script/application, when its finished :-) ciao Pablo ```

 Re: [PanoTools-devel] [OT] coordinate transformations From: Pablo d'Angelo - 2006-10-17 18:05 ```Hi Erik, > Hello, > > sorry for posting off topic. The main list wasn't of much help... > > Is there someone who understands spherical coordinate transformations > - especially the rotation of euler angles (this is what we call yaw, > roll and pitch). I need to do the calculation that is done f.e. in > PTGui, there called "numerical transform". I guess Joost wants to keep the secret ;-) What you need to do is not modify the individual yaw, roll and pitch values (as you have noticed), but use transform them into one entity, like a rotation matrix, a rodriguez vector, or a quaternion. So the steps I would propose are: 1. transform rpy into a rotation matrix (3x3): M = rpy2rmat(r,p,y) 2. Multiply the rotation matrix with whatever transformation matrix: M_new = T*M; 3. extract yaw, roll pitch from M_new. Operation 1 is at least partly in the panotools source code, in the math.c and adjust.c files, it is however split over multiple functions and a bit hard to comprehend what it is really doing. Operations 2 and 3 are not required by panotools and are probably not implemented. The only really tricky part is to find out what kind of euler coordinates panotools uses, since there are 12 different ways the rotations angles can be applied, and everybody seems to call their particular scheme euler angles. The required formulas can then be found in http://ai.stanford.edu/~diebel/attitude.html I can try to figure out what kind of rpy convention panotools uses. > In practice: I have the position of an image relative to an extracted > floor cube face and need to pitch it down to the bottom of the > equirect from which the cube face was extracted previously. The goal > is automatic nadir stitching. Ah, please let us know of the script/application, when its finished :-) ciao Pablo ```
 Re: [PanoTools-devel] [OT] coordinate transformations From: Erik Krause - 2006-10-19 17:02 ```On Tuesday, October 17, 2006 at 20:00, Pablo d'Angelo wrote: > The only really tricky part is to find out what kind of euler coordinates > panotools uses, since there are 12 different ways the rotations angles can > be applied, and everybody seems to call their particular scheme euler > angles. [...] > Ah, please let us know of the script/application, when its finished :-) Many thanks, Pablo and Rob! I have the solution so far. Currently it is in an excel only, but I can provide it to anyone who wants. The convention is the one described as pitch-roll-yaw halfway down http://mathworld.wolfram.com/EulerAngles.html The back-conversion is yaw = ARCTAN2(r11,r12) pitch = -ARCSIN(r13) roll = ARCTAN2(r33,r23) best regards -- Erik Krause Resources, not only for panorama creation: http://www.erik-krause.de/ ```
 Re: [PanoTools-devel] [OT] coordinate transformations From: Bruno Postle - 2006-10-24 22:59 ```On Thu 19-Oct-2006 at 19:02 +0200, Erik Krause wrote: > On Tuesday, October 17, 2006 at 20:00, Pablo d'Angelo wrote: > > > Ah, please let us know of the script/application, when its finished :-) > > Many thanks, Pablo and Rob! I have the solution so far. Currently it > is in an excel only, but I can provide it to anyone who wants. Thanks this is what I needed too. I've implemented it in the Panotools-Script perl module in panotools SVN. Basically, install the module (and Math::Matrix dependency) and you can rotate a PTStitcher or hugin .pto file on the command-line like so: transform-pano eg: \$ transform-pano 15 90 -30 input.pto output.pto All the component image positions will then be transformed so the panorama as a whole is rotated. Tested on Linux, should be ok on windows with perl installed. -- Bruno ```