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 - totoromo

Pages: [1]
1
Hi,

I haven't found any topic more relevant than this one for my question.
I would like to export the adjusted camera calibration through the Python API, but neither the forum nor the doc seem to treat that question. Is it possible ?

Regards

2
Feature Requests / Re: better support for rigid camera rig
« on: January 31, 2017, 07:20:26 PM »
Hi,

I'm exhuming this old topic as i haven't found anything new about the subject.
Has there been any advance a better support for camera rigs ?

3
Hi Alexey,

Thanks for your quick answer.
When Iopen Camera Calibration window from GUI after loading the calibration information from script, i don't notice any difference from what is done when i load the calibration manually (values are apparently correctly loaded).

I tried to put sensorFile.user_calib = c assignment after defining sensor width and height, but it doesn't change anything.

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

Pages: [1]