Forum

Author Topic: Accurately placing an aerial orthomosaic from a single flight line [in Python]  (Read 1500 times)

wolffam

  • Newbie
  • *
  • Posts: 4
    • View Profile
We have an imaging system that takes photos at ~5 degrees pitched forward from 3K feet AGL.  I have found that the current routine (attach Lat/Lon/Alt Yaw/Pitch/Roll) works well when our flight plan includes multiple parallel lines but the placement of the resulting stitch is not very accurate for a single flight line.

Is there a best way to approach this situation?  I find that Metashape is consistently estimating the roll amount to be much greater for the project in question.  Would forcing Metashape to trust the input reference data instead of estimating its own alleviate the issue?

« Last Edit: February 02, 2020, 10:28:11 AM by wolffam »

wolffam

  • Newbie
  • *
  • Posts: 4
    • View Profile
Is their a way through the python API to force Metashape to trust your input orientation parameters? (Lat/Lon and YPR)

Paulo

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Hi,

by default the camera angles reference accuracy is set at 10 degrees for Yaw Pitch and roll which is very loose.

If you know your system YPR or just roll to be more precise you can change the default values by following ( for example first camera in chunk):

Code: [Select]
camera = chunk.cameras[0]

camera.reference.rotation_enabled = True

camera.reference.rotation_accuracy = Metashape.Vector( (10,10,0.1) )

In this case the roll will be constrained to 0.1 degree accuracy in alignment adjustment (its weight will then be 10 000 greater in Least Square adjustment)....

supposing your camera angles are defined as YPR
 
Code: [Select]
chunk.euler_angles
Out[12]: 2020-02-16 06:39:02 Metashape.EulerAngles.EulerAnglesYPR

By the way if you want to change all camera's reference roll accuracy to 0.1 degrees, just use :

Code: [Select]
chunk = Metashape.app.document.chunk

chunk.camera_rotation_accuracy
Out[8]: 2020-02-16 06:55:54 Vector([10.0, 10.0, 10.0])

chunk.camera_rotation_accuracy = Metashape.Vector( (10,10,0.1) )

chunk.camera_rotation_accuracy
Out[10]: 2020-02-16 06:56:02 Vector([10.0, 10.0, 0.1])

and do not forget to enable camera  reference rotation in adjustment by using:

Code: [Select]
for camera in chunk.cameras:

if camera.type == Metashape.Camera.Type.Keyframe:

continue # skipping Keyframes

camera.reference.rotation_enabled = True

same can be done with camera reference location using chunk.camera_location_accuracy attribute
« Last Edit: February 16, 2020, 04:14:07 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor