Forum

Author Topic: Reference accuracy  (Read 5341 times)

paw.wiacek

  • Newbie
  • *
  • Posts: 6
    • View Profile
Reference accuracy
« on: February 02, 2022, 04:55:53 PM »
Hi,

I try to update cameras and markers accuracy setting by python but nothing have change for cameras and markers which have manual inputted values (bolted in GUI)
Code: [Select]
   
    chunk.camera_location_accuracy = Camera_location_accuracy
    chunk.camera_rotation_accuracy = Camera_rotation_accuracy
    chunk.marker_location_accuracy = Marker_location_accuracy   
    chunk.marker_projection_accuracy = Marker_projection_accuracy
    chunk.tiepoint_accuracy = Tiepoint_accuracy


I try also looping cameras but with the same result unfortunately


Code: [Select]

    for camera in chunk.cameras:
        camera.Reference.accuracy = Camera_location_accuracy
        camera.Reference.location_accuracy = Camera_location_accuracy
        camera.Reference.rotation_accuracy = Camera_rotation_accuracy
   
    for marker in chunk.markers:
        marker.Reference.accuracy = Marker_location_accuracy



Is there any option to "Clear Reference - location accuracy" as in GUI.

paw.wiacek

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Reference accuracy
« Reply #1 on: February 02, 2022, 04:57:17 PM »
Is there any python option similar to "Clear Reference -> location accuracy" in GUI

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15420
    • View Profile
Re: Reference accuracy
« Reply #2 on: February 02, 2022, 05:17:04 PM »
Hello paw.wiacek,

To clear the location accuracy you can use the following code:
Code: [Select]
#for cameras
for camera in chunk.cameras:
    camera.reference.location_accuracy = None

#for markers
for marker in chunk.markers:
    marker.reference.accuracy = None

If you need to set individual accuracy for certain cameras/markers, which shouldn't be related to the default chunk.camera_location_accuracy and chunk.marker_location_accuracy, you can do it in the following way:
Code: [Select]
camera.reference.location_accuracy = Metashape.Vector([x_acc, y_acc, z_acc])

marker.reference.accuracy  = Metashape.Vector([x_acc, y_acc, z_acc])
So your second code block from initial post should work, if you change "camera.Reference" to "camera.referece" and "marker.Reference" to "marker.reference", providing that, of course, that Camera_location_accuracy, Camera_rotation_accuracy, Marker_location_accuracy are pre-defined as 3-component vectors (Metashape.Vector class).
Best regards,
Alexey Pasumansky,
Agisoft LLC

paw.wiacek

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Reference accuracy
« Reply #3 on: February 02, 2022, 05:39:18 PM »
Hi Alexey,

Thank for your fast respond!

Unfortunately when I change camera.Reference.location_accuracy into camera.reference.location_accuracy I got exception 'Metashape.Camera.Reference' object attribute 'location_accuracy" is read-only

Best regards,
Pawel Wiacek

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15420
    • View Profile
Re: Reference accuracy
« Reply #4 on: February 02, 2022, 08:36:46 PM »
Hello Pawel,

You need to re-start Metashape, as it seems that the Python interpreter is broken, by camera.Reference assignment.
Best regards,
Alexey Pasumansky,
Agisoft LLC