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

Pages: [1]
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)

2
Python and Java API / 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

3
Python and Java API / Metashape.Chunk' object has no attribute 'camera'
« on: December 15, 2019, 02:51:32 PM »
Hi

i am trying to for the rotation matrix from the camera center and the camera position input and i am getting the below error

 <Chunk 'Chunk 3'>
2019-12-15 12:44:51 Traceback (most recent call last):
2019-12-15 12:44:51   File "C:/Users/Darshan Savanur/Downloads/project/py files/script2.py", line 13, in <module>
2019-12-15 12:44:51     for camera in ch_flir.camera:
2019-12-15 12:44:51 AttributeError: 'Metashape.Chunk' object has no attribute 'camera'
2019-12-15 12:44:51 Error: 'Metashape.Chunk' object has no attribute 'camera'

please help me on this .. I think there is something wrong with my labels in my other code which generates csv with camera co-ordinates and camera center ...please check the attached file which generates this csv


import Metashape
import numpy


doc = Metashape.app.document#active ch_flir

ch_flir = doc.chunks[2]
print(ch_flir)
cameracenter= numpy.loadtxt(open(r"C:\Users\Darshan Savanur\Downloads\project\py files\cameracenttermal.csv","rb"), delimiter=",")

R = []

for camera in ch_flir.camera:
   
    d = ch_flir.crs.project(ch_flir.transform.matrix.mulp(cameracenter))
    T = ch_flir.transform.matrix
   
    print (T)

4
Python and Java API / Re: find yaw pitch roll using camera reference
« on: December 11, 2019, 12:56:27 PM »
Hello Darshan,

Do you have any additional information for this project except for the coordinates of the camera locations?


I have the orientation parameter of the other camera and the transformation matrix from that other camera to my new camera ,now I want to determine orientations of my new camera

5
Python and Java API / find yaw pitch roll using camera reference
« on: December 11, 2019, 02:58:01 AM »
Hi

I have added the camera position information of my images which was calculated using python obtained by calculation using the relative transformation of two cameras, now I want to calculate the estimated yaw, pitch, roll from this camera reference positions ...is it possible using meta shape python?..please check the attached pictures to know what parameters i have

Thanks
Darshan

Pages: [1]