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

Pages: [1]
Python and Java API / Marker Coordinate System Transformation
« on: August 14, 2019, 08:41:28 PM »
Hello all,
I am trying to understand the behavior of adding markers using the Python API. When I add a marker using a 3-component vector of x (longitude), y (latitude) and z (altitude in meters), the marker does not end up where I expect. For example:

Code: [Select]
>>> new_vector = Metashape.Vector([-122.271735905, 45.805843149900014, 420.87088799965164])
>>> current_chunk.addMarker(new_vector)
2019-08-14 10:31:43 <Marker 'point 1'>
>>> current_chunk.markers[0].reference.location
2019-08-14 10:31:59 Vector([-122.28440570982855, 45.79698588468747, 2408.9266198698947])

What causes the coordinates to change after adding a marker? Am I confusing two different coordinate systems? And most importantly, what is the correct way to add a marker with geographic coordinates?

Python and Java API / Marker.Projection coords
« on: December 20, 2018, 11:18:26 PM »
Hi there,
I'm trying to understand how to interact with markers through the python API. My first question is about the Marker.Projection class, and the "coord" variable.
Does it define pixel XY coordinates for a marker in a specific image? And if so, how do I choose what frame I'm viewing coordinates for?
Eventually, I'd like to assign marker positions using XY coordinates in a few images (e.g., Marker_1.add_reference(DJI_0001.jpg, X=1999, Y=2004) or something like that). Feel free to point me to an existing thread if one already exists.

Thanks very much.

Python and Java API / Behavior of
« on: April 04, 2018, 06:32:21 PM »
Hi there,
I have a question about the correct use of the function in 1.4.x. In a script, I’m creating a new PhotoScan.Document() instance, and saving it to a path:
Code: [Select]
current_doc = PhotoScan.Document()
    current_chunk = current_doc.chunk
    if current_chunk == None:
        current_chunk = current_doc.addChunk(), chunks=[current_chunk])

The script aligns the images (and saves, using the same command), and then tries to build a DEM, but I keep getting an “Empty Frame Path: Please save in .PSX format” error. I’ve tried just using, using as current_doc, and pretty much every permutation of .save() I can think of, without success.

I’ve noticed that, if I’m just opening a previously created document, using .save() works the way I would expect, but when I’ve created a new document and saved it using (path=…), it doesn’t.

How can I create a new document and save it in a way that .buildDem() can recognize?

Thanks! And apologies if this is a novice question.

Pages: [1]