1
Python and Java API / Re: find out estimated co-ordinates for the cameras
« on: December 17, 2019, 04:35:37 AM »
Hello
I have latitude, longitude, accuracy for the chunk which was obtained from the relative orientation of the other camera .now I want to find the estimated coordinates and the angles using agisoft python please check the screenshot. please let me know if you need any other information
Thanks
Darshan
here is my code
import Metashape
import numpy
#doc = Metashape.app.document#active ch_flir
ch_flir = doc.chunks[2]
#print(ch_flir)
#x= numpy.loadtxt(open(r"C:\Users\Darshan Savanur\Downloads\project\py files\cameracenttermal1.csv","rb"), delimiter=",")
for camera in ch_flir.cameras:
K = camera.reference.location
print(K)
cameracenter = ch_flir.crs.unproject(K)
cameracenter = ch_flir.transform.matrix.inv().mulp(cameracenter)
T = ch_flir.transform.matrix
print(T)
m = ch_flir.crs.localframe(T.mulp(cameracenter)) #transformation matrix to the LSE coordinates in the given point
print(m)
R = (m * T * camera.transform * Metashape.Matrix().Diag([1, -1, -1, 1])).rotation()
print(T)