Forum

Author Topic: Wrong orientation after alignment  (Read 2291 times)

Lia

  • Newbie
  • *
  • Posts: 12
    • View Profile
Wrong orientation after alignment
« on: August 24, 2021, 04:16:43 PM »
Hi everyone,

I have aligned about 244 images that have considerable overlap. I upload the external reference for each image. However, the point cloud default frontal view (xyz) shows the model from one side, not the frontal view. When I align the same images without coordinates, Metashape seems to do better work.

I have used the Lat long coordinates in decimal degrees WGS84 and run the alignment.  I have also transformed it to UTM. However, the final result is the same.

I have modified the default accuracy to the accuracy of the "GPS" used (see image attached). Because the structure modelled has a steep slope, I have tried pitch 0 and pith 90, but it did not improve the orientation of the point cloud. 

I attach the reports of the models with different in ( GCS WGS84, UTM N25, no coordinates, screenshot). Hence, you may be able to see what is wrong and how can I fix it.

I am looking forward to getting advice from the Agisoft Metashape experts.

Thank you,

Lia

Paulo

  • Hero Member
  • *****
  • Posts: 804
    • View Profile
Re: Wrong orientation after alignment
« Reply #1 on: August 24, 2021, 06:03:26 PM »
Hello Lia,

could you show a screenshot of View Errors window of reference pane to see what the pitch error is on your alignment as in folowing...

This is a video extraction with little exif info on focal and pixel size but does a mean distance to cliff of 2.94 m seem reasonable?

To take into account the initial (source value) of 90 degrees pitch (i.e. camera is looking in front of ROV ), you may have to check all orientation angles (i.e. select all cameras and in right button context menu, select check....), set camera's Accuracy (°) to 300/10/10 to reflect Yaw is not defined at all and set Capture distance to 3 m in Reference Settings dialog window see Setting georeferenced coordinate sytem from User manual:
Quote
Specify Capture distance parameters for the datasets where the images are captured with the oblique
camera mount (more than 20-30 degrees from the vertical).

PS. I am astounded by the fact that your positioning system has an accuracy of a few meters for a ROV diving 2000 m below sea level! Do you know how your system achieves that accuracy?
« Last Edit: August 24, 2021, 06:43:13 PM by Paulo »
Best Regards,

Paul Pelletier

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13295
    • View Profile
Re: Wrong orientation after alignment
« Reply #2 on: August 24, 2021, 06:55:46 PM »
Hello Lia,

Please try to set Pitch values for all cameras back to 0 degrees, then enable the check box in front of Yaw values for all the cameras and press Update button on the Referenece pane toolbar.
For the cameras in the southern part, where Yaw is much different from 0 leave the mentioned checkbox unchecked.

In case the movement has been performed in the opposite direction, you may also need to set Yaw to 180 degrees instead of 0 value.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Paulo

  • Hero Member
  • *****
  • Posts: 804
    • View Profile
Re: Wrong orientation after alignment
« Reply #3 on: August 24, 2021, 08:08:46 PM »
Lia,

another way is to get your Yaw or bearing from 2 succesive camera coordinates, by exporting your source coordinates (lat,lon) into a spreadsheet and calculate bearing or yaw of camera using actual and previous camera coordinates as shown below....and then you can set all camera orientation accuracy to be usual 10 degrees...
« Last Edit: August 25, 2021, 06:19:39 AM by Paulo »
Best Regards,

Paul Pelletier

Lia

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Wrong orientation after alignment
« Reply #4 on: August 27, 2021, 11:42:35 PM »
Hi Alexey and Paulo,

Thank you so much for the advice. The problem seems to be solved. However, I have a few questions about the pitch.

But first, this is what I did and the correspondent screenshots and reports.

*I set the pitch at 0. I checked the yaw boxes (except the southeast cameras), and I set yaw at 0 degrees.  Attachments: 1_Yaw0_Pitch0_D7_B_frontview, Report_D7_461_B_lat_long_yaw0 (Notice that: the camera location total error is 5.4m)
*I set the pitch at 0. I calculated the yaw using the coordinates (as described by Paulo), range (-1.18 to 1.57 degrees). Attachments: 2_Yaw-calculated_Pitch0_D7_frontview, Report_D7_461_B_lat_long_yaw_exact_pitch0 (Notice that: the camera location total error is 5.4m)

The models have the front view as desired. However, why are we setting the pitch at 0 degrees?. The camera in the ROV does not have a downward-facing set-up as assumed when setting pitch at zero (https://www.agisoft.com/forum/index.php?topic=10515.0). It is because the structure recorded has a steep slope, so the camera has a forward-facing setup.  However, the pitch set at 90 degrees does not produce a good result, as observed in the initial post. The pitch at 0 degrees, as you advised, works. However, the side-view of the model is less steep than I would expect. I have tried different "pitches," and a 30 degrees pitch produced a model that seems to fit the best (camera location total error 4.39m). However, this is my empirical view.
Regarding the previous I have the following question:
Would you suggest letting it in 0 or in 30 degrees and why ?.
How pitch works in Metashape? is Metashape very sensitive to a not precise pitch?
Is there a way to calculate it?
(I will attach the report and screenshots of the model setting pitch at 30 degrees in the next message since this platform only allow 4 attachments at the time)

Note: In every case, I had to resize and rotate the region. Metashape always gave me a sideways or upsidedown region. I don't know why.

King regard,


Lia YS
 

Lia

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Wrong orientation after alignment
« Reply #5 on: August 27, 2021, 11:50:56 PM »
 
Hi Alexey and Paulo,

As I mentioned in the previous message, I send the screen shots of the model with yaw 30 degrees.

 (and an additional side view of the model with yaw at 0 degrees 1_Yaw0_Pitch0_D7_B_sideview)


Kind regards,

Lia YS

Hi Alexey and Paulo,

Thank you so much for the advice. The problem seems to be solved. However, I have a few questions about the pitch.

But first, this is what I did and the correspondent screenshots and reports.

*I set the pitch at 0. I checked the yaw boxes (except the southeast cameras), and I set yaw at 0 degrees.  Attachments: 1_Yaw0_Pitch0_D7_B_frontview, Report_D7_461_B_lat_long_yaw0 (Notice that: the camera location total error is 5.4m)
*I set the pitch at 0. I calculated the yaw using the coordinates (as described by Paulo), range (-1.18 to 1.57 degrees). Attachments: 2_Yaw-calculated_Pitch0_D7_frontview, Report_D7_461_B_lat_long_yaw_exact_pitch0 (Notice that: the camera location total error is 5.4m)

The models have the front view as desired. However, why are we setting the pitch at 0 degrees?. The camera in the ROV does not have a downward-facing set-up as assumed when setting pitch at zero (https://www.agisoft.com/forum/index.php?topic=10515.0). It is because the structure recorded has a steep slope, so the camera has a forward-facing setup.  However, the pitch set at 90 degrees does not produce a good result, as observed in the initial post. The pitch at 0 degrees, as you advised, works. However, the side-view of the model is less steep than I would expect. I have tried different "pitches," and a 30 degrees pitch produced a model that seems to fit the best (camera location total error 4.39m). However, this is my empirical view.
Regarding the previous I have the following question:
Would you suggest letting it in 0 or in 30 degrees and why ?.
How pitch works in Metashape? is Metashape very sensitive to a not precise pitch?
Is there a way to calculate it?
(I will attach the report and screenshots of the model setting pitch at 30 degrees in the next message since this platform only allow 4 attachments at the time)

Note: In every case, I had to resize and rotate the region. Metashape always gave me a sideways or upsidedown region. I don't know why.

King regard,


Lia YS
 

Lia

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Wrong orientation after alignment
« Reply #6 on: August 27, 2021, 11:55:16 PM »
Hi Paulo,

Regarding your question about USBL, we use Global Acoustic Positioning System (GAPS)

The accuracy is 1% of the depth in our case. However, some recent GAPS equipment can be even more precise https://www.ixblue.com/products/gaps-series


Kind regards,

Lia YS

Paulo

  • Hero Member
  • *****
  • Posts: 804
    • View Profile
Re: Wrong orientation after alignment
« Reply #7 on: August 28, 2021, 12:29:50 AM »
Hello Lia,

thanks for the extra information!
If the camera is facing straight in front of ROV instead of down towards ocean floor, then initial pitch should be set to 90 degrees and the orientation check boxes set and a new transformation update done...

To better understand the problem,   could you export the reference data to a text file  with all options ticked and send it? as in following screen...

Also if you have data on the camera caracteristics (pixel size, focal length in mm), this could help the processing....

It seems that your calculated yaw is in radians. You should calculate in degrees i.e. divide your yaw by PI() and multiply by 180...Your calculated yaw range of (-1.18 to 1.57 ) is in radians so real caculated range in degrees is (-67.6 to 90). And look at sign of calculated yaw. it seems inversed. For example for following 2 consecutive positions (-31.452927   52.348217) and (-31.452928   52.34821713) you have a yaw of 1.37 radians but it should be -:
ID   Longitude(°)   Latitude(°)         X                         Y                                Yaw(°)            Yaw(radians)
1   -31.452927   52.348217            
2   -31.452928   52.34821713   -1.06615E-08   2.18166E-09   -78.43526324   -1.37

PS. the GAPS positioning system is incredible!  The M7 GAPS has a cep50 accuracy of 0.06% to 0.53% of slant range (varying according to SNR) or at 95% probability something like 0.12% to 1.06%. So at a slant range of 2000 m we get a 95% accuracy of 2.4 m to 20 m....Your average camera location error of 5 to 6 m corresponds to lower middle range  of this accuracy estimate...
« Last Edit: August 28, 2021, 04:52:49 PM by Paulo »
Best Regards,

Paul Pelletier

Lia

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Wrong orientation after alignment
« Reply #8 on: August 30, 2021, 01:08:31 AM »
Hi Paulo,

Setting the pitch to 90 degrees does not produce the best reconstruction. Alexey suggested setting yaw in 0 and pitch in 90, and the model looked good. However, 30 degrees pitch and 0 degrees yaws were the best. Still I want to make sense of why to set the values in one or another way. I should have transformed the yaw values to degrees. In that case, the values are very different from zero. I send the document attached.

Kind regards,

Lia

Paulo

  • Hero Member
  • *****
  • Posts: 804
    • View Profile
Re: Wrong orientation after alignment
« Reply #9 on: August 30, 2021, 02:19:35 AM »
Lia,

thanks for the file,it will help... However could you re-export the reference file but this time with precision set to 8. This will allow a better calculation of estimated source yaw....

Hope to get new reference txt file from you,
Best Regards,

Paul Pelletier

Paulo

  • Hero Member
  • *****
  • Posts: 804
    • View Profile
Re: Wrong orientation after alignment
« Reply #10 on: August 30, 2021, 03:03:03 AM »
Lia,

there is certainly something wrong with your input camera location coordinates. Your set has 244 pictures extracted from video at every second. So that means, you have one picture every second, correct?. But if I look at the path of these 244 fotos they represent a distance travelled of a bit more than 10 meters in 4 minutes (244 sec)...or a displacement of a few cm between 2 consecutive pictures, which is highly improbable....

So maybe you can check how your camera georeferencing was done..... or maybe the ROV has a very fine slight movement....

But anyway, I would try doing a new adjustemet by setting your pitch to 90 deg in reference source, checking the box beside Yaw and doing a new alignment using following command from console pane:

Code: [Select]
Metashape.app.document.chunk.alignCameras()
and see what you get...
« Last Edit: August 30, 2021, 07:03:03 AM by Paulo »
Best Regards,

Paul Pelletier

Paulo

  • Hero Member
  • *****
  • Posts: 804
    • View Profile
Re: Wrong orientation after alignment
« Reply #11 on: August 30, 2021, 06:53:16 AM »
Lia,

this may explain why adjustment with pitch 0 or 30 does not correctly represent the situation. I plotted the initial (source) camera positions with red dots and final (adjusted or estimated) camera positions with green dots in Global Mapper both in 3d view (left side) and plan view (right side). As can be seen the displacement (black vectors) from source to final adjusted positions is greater at beginning and end of ROV trajectory. This is especially true in Z (elevation) as seen in 3D view. That is why using pitch of 0 or 30 will not represent the slope correctly...as final Z positions are basically levelled thus model will have little slope while it is clear that ROV is going up facing a cliff...So using initial pitch of 90 deg should fix this slope problem...

Hope this may bring a liitle bit more insight...
« Last Edit: August 30, 2021, 08:58:47 AM by Paulo »
Best Regards,

Paul Pelletier

Lia

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Wrong orientation after alignment
« Reply #12 on: August 30, 2021, 09:11:37 PM »
Hi Paulo,

Thanks for the detailed explanation. I set pitch 90° and check yaw. I am sharing the new CSV with the mentioned changes and precision 8. However, the model is bent forward if I set pitch at 90°, as you can observe in the screenshot I share.

The frequency rate of the video is 25 FPS. From which we extract one frame every second.  The ROV moves continuously at a similar but not identical speed (moving a few centimeters every second).


Kind regards,

Lia

Paulo

  • Hero Member
  • *****
  • Posts: 804
    • View Profile
Re: Wrong orientation after alignment
« Reply #13 on: August 30, 2021, 11:29:14 PM »
Hi Lia,

Eureka! I think we have it! The result seems OK with points representing cliff at about 45 - 50 deg slope.... Maybe you can include the pdf report for this pitch 90 adjustment...

I plotted again the source (red) and estimated (green) camera positions for this result... and as you can see, now estimated camera positions in Z (elevation) are no longer levelled but follow an ascent at about 45 to 50 deg slope corresponding to sea cliff (drawn in blue in 3d view)

PS. with this adjustment the total RMS camera position  error is less than 2 meters. Incredible....

        Error_(m)  X_error   Y_error   Z_error  Error_(deg)   Yaw_error  Pitch_error   Roll_error
RMS  1.726      1.132       0.883        0.957          5.573             4.828             1.209             2.506
at 95% confidence level this represents an XY error of 2.5 m which is very good....
« Last Edit: August 31, 2021, 03:23:49 AM by Paulo »
Best Regards,

Paul Pelletier

Lia

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Wrong orientation after alignment
« Reply #14 on: August 31, 2021, 03:35:02 AM »
Hi Paulo,

Yes, 45° pitch seem to work better for this reconstruction. Thanks for your help, I appreciate it!. I send the reports attached. However, I am quite concerned since the structure ("cliff") looks vertical when setting the pitch at 45° (see the screenshot attached). I expected a forward-looking camera setup on the ROV, but it seems like it had a certain angle. Is it what the pitch of 45 ° indicates?.
I will reconstruct many vertical structures, so I will need to understand why to set the pitch at one or another degree.

I am also thinking about the calculation of yaw. In the end, we let it as zero, but it wasn't zero according to the calculations using the coordinates. Why is the model working with yaw set at 0°?
 
I hope you can give me some insights to understand the logic behind the results that we obtained.

Have a great night.

Best regards,

Lia