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

Pages: [1]
1
Python and Java API / Chunk AlignCameras in 1.6
« on: February 28, 2020, 12:52:07 PM »
We are updating our python script to 1.6 using the change log to tell us what has been renamed (no deprecation warnings...) at the bottom of this resource: https://www.agisoft.com/pdf/metashape_python_api_1_6_1.pdf

Maybe I am blind, but I cannot see anywhere in the change log that mentions a new parameter 'reset_alignment' to Chunk.alignCameras. To make matters worse, this new parameter defaults to a value that changes the result of the function rather than a value which would keep the result consistent with 1.5.

2
Python and Java API / Re: Camera orientation
« on: December 19, 2019, 03:48:03 PM »
To solve this, I had to use the chunks coordinate system; the camera transform and chunk transform was not sufficient. I think 'internal coordinate system' turned out not to be what I wanted. Please see these links:
https://www.agisoft.com/forum/index.php?topic=7999.0
https://agisoft.freshdesk.com/support/solutions/articles/31000145016-how-to-calculate-estimated-exterior-orientation-parameters-for-the-cameras-using-python

3
Python and Java API / Re: Camera orientation
« on: November 08, 2019, 12:47:56 PM »
Hello Llama,

Is the chunk you are working with referenced or transformed (whether chunk.transform.matrix is not an identity matrix)?

The chunk is referenced, chunk.transform.matrix is not the identity. If I perform chunk.transform.matrix.mulv( v ) the value is still not what I expect

4
Python and Java API / Re: Camera orientation
« on: November 07, 2019, 08:05:38 PM »
Hello Llama,

I suggest to use the following vector:
Code: [Select]
v = camera.transform.mulp(camera.sensor.calibration.unproject(Metashape.Vector([camera.sensor.width/2, camera.sensor.height/2]))) - camera.center
print(v.normalized())

Hello Alexey, thank you for your response.

This gives a very similar vector. Is this vector in the same coordinate system as the 3 axes as in my screenshot?

In this screenshot I am looking down the X axis, and the camera clearly appears to be facing predominantly in the negative Z direction, why then is the Z positive and its Y component larger and negative?

Apologies if I'm missing something here

5
Python and Java API / Re: Camera orientation
« on: November 07, 2019, 05:52:53 PM »
Also may I ask how to set the ground height in the Python API?

6
Python and Java API / Camera orientation
« on: November 07, 2019, 05:38:32 PM »
I am trying to get the direction vector of my cameras in what I think is the internal coordinate system, to go on to detect cameras that aligned facing upwards. Here is my current attempt:

Code: [Select]
for camera in chunk.cameras:
    if camera.transform and camera.selected:
        print(camera.transform.mulv(Metashape.Vector([0,0,1])).normalized())

I would expect the result in my screenshot to have a large -Z component, and low X and Y components since this camera is pointing straight down. However, it has quite significant X and Y components. I suspect I'm missing something obvious here, but any help would be appreciated.

Pages: [1]