Forum

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

Darshan

  • Newbie
  • *
  • Posts: 5
    • View Profile
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
    • View Profile
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)

#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)

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14966
    • View Profile
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