Following this conversation (among others), i'm facing an original problem : GUI manipulations and my Python script issu different results.
I use this code to create the structure (working fine) :
import PhotoScan
import os
calibFile = "CalibCam11.xml"
doc = PhotoScan.app.document
doc.open("PSZ.psz")
chunk2 = PhotoScan.app.document.addChunk()
chunk2.addPhotos(["Camera11_01380.534.tiff","Camera11_01381.522.tiff","Camera11_01382.528.tiff","Camera11_01383.524.tiff","Camera11_01384.528.tiff","Camera11_01385.525.tiff","Camera11_01386.530.tiff","Camera11_01387.525.tiff","Camera11_01388.531.tiff","Camera11_01389.529.tiff","Camera11_01390.525.tiff"])
Then, with the GUI i load a calibration file, fill in the focal length, fix it, and compute the orientation (Medium quality, no pair selection, 80k tie & 8k keypoints), which works fine.
If I try to execute the same via scripting, i get different (and bad) results.
Here's my python script :
sensorFile = chunk2.addSensor()
sensorFile.label = "Cam11"
sensorFile.user_calib = PhotoScan.Calibration()
c = PhotoScan.Calibration()
c.load(calibFile)
sensorFile.user_calib = c
sensorFile.fixed = True
sensorFile.width = 2560
sensorFile.height = 2048
sensorFile.focal_length = 8.0
for cam in chunk2.cameras:
cam.sensor = sensorFile
chunk2.matchPhotos(accuracy=PhotoScan.MediumAccuracy, preselection=PhotoScan.Preselection.NoPreselection, keypoint_limit=80000, tiepoint_limit=8000)
chunk2.alignCameras()
Currently working with 1.2.6 Pro
What am I doing wrong ?
What should I change in my script to get the exact same result as with the GUI ?