Hello,
I have many thousands of images that I wanted to organize into different calibration groups based on the date they were collected, which is reflected in the label. I wrote the script below to accomplish this. While the script works for this purpose, it also forces the resolution of all images to 0x0 (screenshot attached). If I try to align the images, it goes through one batch where 0 points are detected for each image, and I get the error "Error: Can't select tile size." If I click on the image in the workspace, it still shows the appropriate dimensions,17588 x 16039.
Is this a bug, or am I doing something wrong in the script?
Thank you
chunk = Metashape.app.document.chunk
# Make list of dates to create calibration groups
calGroups = []
for camera in chunk.cameras:
yr = camera.label[:2]
if yr not in calGroups:
calGroups.append(yr)
#Create the calibration groups
for i in calGroups:
sensor = chunk.addSensor()
sensor.label = i
sensor.type = Metashape.Sensor.Type.Frame
sensor.focal_length = 208.047
sensor.pixel_height = 0.0125
sensor.pixel_width = 0.0125
#Assign cameras to calibration groups.
for camera in chunk.cameras:
for s in chunk.sensors:
if s.label == camera.label[:2]:
camera.sensor = s