1
Python and Java API / Re: Reset adjusted camera calibration parameters with python
« on: September 27, 2019, 09:32:45 PM »
A final update for the hive-mind, I found a way that allowed me to use Paul's recommendations and loop through files. This worked for me with version 1.5.4. Thanks again Paul for your recommendations!
Code: [Select]
for file in files:
Metashape.app.document.open(file)
doc = Metashape.app.document
chunk = doc.chunk # could add another loop here if more than one chunk.
for sensor in chunk.sensors:
calibration = sensor.calibration
calibration.cx = 0
calibration.cy = 0
calibration.p1 = 0
calibration.p2 = 0
calibration.p3 = 0
calibration.p4 = 0
calibration.b1 = 0
calibration.b2 = 0
calibration.k1 = 0
calibration.k2 = 0
calibration.k3 = 0
calibration.k4 = 0
sensor.calibration = calibration
doc.save()