1
Camera Calibration / Re: Set calibration data by script (contain code)
« on: May 05, 2023, 07:28:51 PM »
Ok Paulo, it's work.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
import Metashape
# Desired values
pixel_size = (set pixel size)
focal_length = (set focal length)
# Access the current project
doc = Metashape.app.document
# Iterate through all chunks
for chunk in doc.chunks:
# Iterate through all chunks
for camera in chunk.cameras:
if camera.sensor is not None:
# Set the pixel size and focal length
camera.sensor.pixel_size = Metashape.Vector([pixel_size, pixel_size])
camera.sensor.focal_length = focal_length
# Save the document
doc.save()