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.


Topics - Kaspar Johannes Schneider

Pages: [1]
1
I am working with a test project containing two images. Both shot from approximately 3 m towards the floor. The photos have been taken handheld with a DSLR.

Summary of the project:
  • Seven markers (coded targets)
  • Four markers are reference markers with a known location, all of them in a plain (floor)
  • The reference markers define the coordinate system. I enter their known location into the reference pane
  • Three markers, that I want to get their location. The location should be in respect to the coordinate system defined by the reference markers

If I switch to "View Estimated" in the reference pane, Metashape shows me the location of the unknown markers in meters. However, if I try to access the values through Python, it returns None, see code below.

I can access the positions of the markers and could transform them into meters myself and align them with my coordinate system in python (see code bellow). However, it would be nice to get the location of the markers from Metashape since they are known to Metashape.


My Question:
How can I access the locations of the markers through the Python API?

Printing the location of the markers:
Code: [Select]
>>> chunk = Metashape.app.document.chunks[0]
>>> for marker in chunk.markers:
...     print(marker.reference.location)

2019-04-10 10:43:07 None
2019-04-10 10:43:07 None
2019-04-10 10:43:07 None
2019-04-10 10:43:07 Vector([0.6, 0.375, 0.0])
2019-04-10 10:43:07 Vector([0.0, 0.375, 0.0])
2019-04-10 10:43:07 Vector([0.6, 0.0, 0.0])
2019-04-10 10:43:07 Vector([0.0, 0.0, 0.0])

Printing the position of the markers:
Code: [Select]
>>> chunk = Metashape.app.document.chunks[0]
>>> for marker in chunk.markers:
... print(marker.position)
...
2019-04-10 10:52:15 Vector([-1.4113132307602854, 0.0882688990110554, -4.452523572010532])
2019-04-10 10:52:15 Vector([-0.5591181822734794, 0.1058108623840947, -4.584972387400069])
2019-04-10 10:52:15 Vector([-0.9319427602606366, 0.0550744033151845, -4.512162225800721])
2019-04-10 10:52:15 Vector([-0.15048646230572668, 0.7777740724289381, -4.722076031239419])
2019-04-10 10:52:15 Vector([-2.1146734883026497, 0.6626549568104686, -4.627042682200283])
2019-04-10 10:52:15 Vector([-0.06550919103603609, -0.4980640313039025, -4.633104942878641])
2019-04-10 10:52:15 Vector([-2.044947801323979, -0.6179052161781581, -4.544628735583648])
>>>



Pages: [1]