Agisoft Metashape
Agisoft Metashape => Python and Java API => Topic started by: grommit on February 25, 2015, 11:15:30 PM
-
Hi all,
I'm tasked with converting the Agisoft camera calibrations to OpenCV, and I'd like to write straight out from Photoscan a file that contains the xyz translation of a camera and a Rodrigues vector decribing its aim and rotation. Can anyone give a hint as to how to access the needed extrinsic data from AGI inside Python?
Guessing out loud:
import cv2
import PhotoScan
from cv2 import Rodrigues
doc = PhotoScan.app.document
camera=doc.chunk.cameras[0]
cv2.Rodrigues(camera.transform,myRod)
myStation=camera.center
...savesomething