Hi All,
I am trying to use the python interface to load in some pre calibrated cameras, but agisoft seems to fail when i use sensor.user_calib.
In the script (below), I create multiple camera objects and a sensor for each camera, then set the parameters, see below.
My array 'cameras' contains a camera objects with the measured focal length and principal points.
I then use chunk.matchPoints and chunk.alignCameras but the script fails with 'Error: Can't align cameras'.
The parameters in the camera calibration window for all cameras show up as zero and not the parameters which I have set.
Am i missing some settings in user_calib ?
#Add Chunk
chunk = PhotoScan.app.document.addChunk()
#Create each camera
for index in range(0,len(cameras)):
#Create Camera and load image file
camera = chunk.addCamera();
photo_file = input_directory + "%03d/"%index + "%05d.png"%frame_index
camera.open(photo_file)
camera.label = "Camera %02d"%index
camera.sensor = chunk.addSensor();
#Create Sensor
camera.sensor.label = "Sensor %02d"%index
camera.sensor.width = cameras[index].width
camera.sensor.height = cameras[index].height
#Calibration
camera.sensor.user_calib = PhotoScan.Calibration()
camera.sensor.user_calib.width = cameras[index].width
camera.sensor.user_calib.height = cameras[index].height
camera.sensor.user_calib.cx = cameras[index].cx
camera.sensor.user_calib.cy = cameras[index].cy
camera.sensor.user_calib.f = cameras[index].fx
# Finally Fix the sensor parameters
camera.sensor.fixed = True
I have also validated that the details in cameras are correct
Kind regards,
Marco