Forum

Author Topic: Generate XML from known X0 Y0 Z0 Phi Theta Kappa  (Read 17296 times)

Paulo

  • Hero Member
  • *****
  • Posts: 1354
    • View Profile
Re: Generate XML from known X0 Y0 Z0 Phi Theta Kappa
« Reply #15 on: May 30, 2015, 10:07:59 PM »
Hello,

I was able to reconstruct A DENSE POINT CLOUD but just importing the camera station coordinates extracted from  the XML file (without orientation information):

Img_130415_153606.jpg   2615018.098   1264752.474   11.501
Img_130415_153409.jpg   2615018.091   1264752.474   11.501
Img_130415_153209.jpg   2615018.079   1264752.480   11.503
Img_130415_153350.jpg   2615018.091   1264752.477   11.503
Img_130415_153521.jpg   2615018.094   1264752.477   11.504
Img_130415_153245.jpg   2615018.078   1264752.477   11.501
Img_130415_153534.jpg   2615018.097   1264752.476   11.504
Img_130415_153129.jpg   2615018.074   1264752.479   11.500
Img_130415_153506.jpg   2615018.095   1264752.474   11.501
Img_130415_153108.jpg   2615018.067   1264752.483   11.500
Img_130415_153150.jpg   2615018.074   1264752.482   11.503
Img_130415_153307.jpg   2615018.084   1264752.476   11.501
Img_130415_153327.jpg   2615018.084   1264752.478   11.503
Img_130415_153048.jpg   2615018.068   1264752.486   11.504
Img_130415_150858.jpg   2615026.735   1264749.098   11.514
Img_130415_150951.jpg   2615026.728   1264749.098   11.510
Img_130415_150931.jpg   2615026.734   1264749.094   11.510
Img_130415_151030.jpg   2615026.725   1264749.107   11.514
Img_130415_151058.jpg   2615026.723   1264749.102   11.510
Img_130415_151255.jpg   2615026.712   1264749.117   11.510
Img_130415_151145.jpg   2615026.720   1264749.111   11.513
Img_130415_151123.jpg   2615026.718   1264749.108   11.510
Img_130415_151316.jpg   2615026.715   1264749.119   11.513
Img_130415_151012.jpg   2615026.730   1264749.103   11.514
Img_130415_151237.jpg   2615026.715   1264749.113   11.510
Img_130415_151211.jpg   2615026.717   1264749.115   11.513

Then as these photos correspond to 2 sets taken from 2 Total station positions, I defined 2 camera stations for each set and did a Photo alignment and then dense cloud....
See attached screen copy,

Maybe this helps,

Best Regards,
Paul Pelletier,
Surveyor

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15086
    • View Profile
Re: Generate XML from known X0 Y0 Z0 Phi Theta Kappa
« Reply #16 on: May 30, 2015, 10:09:11 PM »
Hello Jappert,

I've tried the following:
- in your project group corresponding cameras to Camera Stations instances in the Workspace pane,
- then aligned cameras based on existing matching points (using Python command .alignCameras).
In such way I've got rather good alignment results.

Then I have compared the relative orientation of the cameras in the Station groups - and it is different, meaning that the imported angles are not correct.


pap1956@gmail.com
You were faster :)
Best regards,
Alexey Pasumansky,
Agisoft LLC

Marcoo

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Generate XML from known X0 Y0 Z0 Phi Theta Kappa
« Reply #17 on: May 31, 2015, 11:34:04 AM »
Good morning everybody

Thanks again for helping me this way diligent!
First to pap1956's statement: Importing only the station/photo position doesn't really help, because the idea of this project is to do photogrammetry without control points but insted photos with known position and orientation to mount the project. So I wanted to import the EO information and only align the other photos, taken with a DSLR.

And to Alexey Pasumansky's: With the exported rotation matrix of a photo e.g. Img_130415_150858.jpg
Code: [Select]
-1.7882197691566071e-002 2.4639502854159132e-001 -9.6900449788208320e-001 2.6150267349460912e+006
-4.5462477724922123e-003 -9.6916948461555907e-001 -2.4635308344163809e-001 1.2647490981773189e+006
-9.9982976482844854e-001 1.0963452368173421e-015 1.8451053170189136e-002 1.1513585880104941e+001
.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 1.0000000000000000e+000
I calculated the orientation angles using this formulas:



The result was (see .xlsx attached):
alpha = -0.072448297rad or -4.150981675deg
beta= 14.30260558deg
gamma = 90deg
which is really different from Phi="215.8492117459314" Theta="98.825302814069616" Kappa="0" (gradians! pi rad = 180 deg = 200 grd)
Is it right to compare alpha beta gamma with phi theta kappa?  And is it a problem, that Theta starts in the total station to the zenith (0 = zenith, 100 = horizontal)

n@sk

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Generate XML from known X0 Y0 Z0 Phi Theta Kappa
« Reply #18 on: May 31, 2015, 02:50:30 PM »
Hi Jappert,

I think that if you check the formula in cells  I2, H3 & I3 the results will make more sense  ;)
(at first I thought you were trying to use the inverse, but I4 is correct)
-115.8492117g
1.174697186g
100g


regards

Marcoo

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Generate XML from known X0 Y0 Z0 Phi Theta Kappa
« Reply #19 on: May 31, 2015, 03:32:24 PM »
OK I changed the formula in I2 to =ARCTAN2(D3;C3) to get the same result like you (-115.8492), but I don't understand why. (formula was atan2(r21,r11))
The second one =1.174) I don't get. How did you change?
It seems to be an error because of the clockwise definition of the tachymeter angles. And the start with 0grd at north / zenith.
-(100+ "-115.8492") = 215.8492 (what's saved in the xml)
100 - "1.175" = 98.825 (whats saved in the xml)
100 - "100" = 0 (what's saved in the xml)

n@sk

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Generate XML from known X0 Y0 Z0 Phi Theta Kappa
« Reply #20 on: May 31, 2015, 04:31:53 PM »
I2=ATAN2(B3,B2)
H3=SQRT(B2^2+B3^2)   I3=ATAN2(-B4,H3)
I4=ATAN2(C4,D4)

(r21: second row, first column)

ATAN2 returns angles from the X+axis in the range (-200,200]  (counterclockwise)
your azimuth is in the range [0,400) from the Y+axis (clockwise)
« Last Edit: May 31, 2015, 04:51:44 PM by n@sk »

Marcoo

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Generate XML from known X0 Y0 Z0 Phi Theta Kappa
« Reply #21 on: May 31, 2015, 10:58:57 PM »
Ah it's the other side definition of the matrix elements than I had in memory..  :-\ Thanks!
I'm not sure what to do next:
a) change the formula for R in the python script
b) edit the angles before using the old formular

In my opinion, b) would be the better. How do you think do I have to correct them before using? Until now it's just this:
Code: [Select]
Phi = float(elem[1].attrib['Phi'])
a = grd2rad(Phi)
Theta = float(elem[1].attrib['Theta'])
b = grd2rad(Theta)
Kappa = float(elem[1].attrib['Kappa'])
c = grd2rad(Kappa)
with the function
Code: [Select]
def grd2rad(deg):
return deg * pi / 200