Forum

Need help with addMarker method

Started by tpubben, July 14, 2017, 09:06:00 PM

Previous topic - Next topic

tpubben

Ok, so I can get photoscan to add markers based on the 2D pixel coordinates for a photo.

For example, i can place a marker onto a photo by saying where that pixel is in x/y coordinates.

However, unlike when I place a marker manually, it does not show up with an estimated geographic coordinate.

How do I project those markers to the chunk for an estimated 3D coordinate?

Alexey Pasumansky

Hello tpubben,

You need to have at least two projections for the marker on the aligned photos to have information about its estimated position in the space.
Best regards,
Alexey Pasumansky,
Agisoft LLC


tuqubao

#3
Quote from: Alexey Pasumansky on July 15, 2017, 03:45:32 PM
Hello tpubben,

You need to have at least two projections for the marker on the aligned photos to have information about its estimated position in the space.

I also question. when my project is rendering finished, I add a marker to one photos by mouse click frome inside photoscan's photos's window,  another 2d coordinate  will automate add to the other photos ,and I can get the marker 3d coordinate info by the python api. I do the thing right by mamual, but when I add marker by coder , I can't get the right marker 3d coordinate .
this is why and how, please.

Alexey Pasumansky

Hello tuqubao,

I have posted the solution in the similar thread:
http://www.agisoft.com/forum/index.php?topic=7446.0

chunk = PhotoScan.app.document.chunk
camera = chunk.cameras[0]
point2D = PhotoScan.Vector([imgX,imgY]) # coordinates of the point on the given photo
sensor = camera.sensor
calibration = sensor.calibration
x = chunk.point_cloud.pickPoint(camera.center, camera.transform.mulp(sensor.calibration.unproject(point2D)))
chunk.addMarker(point = x)
Best regards,
Alexey Pasumansky,
Agisoft LLC