# Forum

### Author Topic: find out estimated co-ordinates for the cameras  (Read 2426 times)

#### Darshan

• Newbie
• Posts: 5
##### find out estimated co-ordinates for the cameras
« on: December 17, 2019, 12:50:34 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

#### Darshan

• Newbie
• Posts: 5
##### Re: find out estimated co-ordinates for the cameras
« Reply #1 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)

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)

#### Alexey Pasumansky

• Agisoft Technical Support
• Hero Member
• Posts: 14855
##### Re: find out estimated co-ordinates for the cameras
« Reply #2 on: December 25, 2019, 03:49:14 PM »
Hello Darshan,

Have you checked the following solution for calculation of the estimated camera locations and orientation angles:
https://agisoft.freshdesk.com/support/solutions/articles/31000145016-how-to-calculate-estimated-exterior-orientation-parameters-for-the-cameras-using-python
Best regards,
Alexey Pasumansky,
Agisoft LLC