Forum

Show Posts

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.


Messages - Centomini

Pages: [1]
1
Ok Paulo, it's work.

2
Camera Calibration / Set calibration data by script (contain code)
« on: May 05, 2023, 05:57:44 PM »
Hi everyone,

I have written this script to set "pixel size" and "focal length" values in the entire project without having to re-enter them by hand in Metashape's camera calibration tool.

It works perfectly.

However, I would also like to integrate into this script a set of instructions to write in the "initial" tab the type = precalibrated, set "f" to a certain number and finally lock "f" (in fixed parameters), but I am having great difficulty getting this desired part of the script to work; can you give me a hand? Thanks.

Code: [Select]
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()

3
Python and Java API / Re: List of Tweaks ?
« on: October 22, 2021, 01:26:48 AM »
I echo the previous requests for news updates because I'm also interested in this. Thank you.

Pages: [1]