Forum

Accurately placing an aerial orthomosaic from a single flight line [in Python]

Started by wolffam, February 02, 2020, 10:24:22 AM

Previous topic - Next topic

wolffam

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?


wolffam

Is their a way through the python API to force Metashape to trust your input orientation parameters? (Lat/Lon and YPR)

Paulo

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):

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

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 :

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:

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
Best Regards,
Paul Pelletier,
Surveyor