Forum

Author Topic: Need help with addMarker method  (Read 7207 times)

tpubben

  • Newbie
  • *
  • Posts: 11
    • View Profile
Need help with addMarker method
« on: July 14, 2017, 09:06:00 PM »
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?
« Last Edit: July 15, 2017, 12:27:05 AM by tpubben »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15650
    • View Profile
Re: Need help with addMarker method
« Reply #1 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.
Best regards,
Alexey Pasumansky,
Agisoft LLC

tuqubao

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Need help with addMarker method
« Reply #2 on: July 23, 2017, 04:17:23 PM »
 :)

tuqubao

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Need help with addMarker method
« Reply #3 on: July 23, 2017, 04:25:29 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.
« Last Edit: July 23, 2017, 04:29:11 PM by tuqubao »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15650
    • View Profile
Re: Need help with addMarker method
« Reply #4 on: July 27, 2017, 04:01:02 PM »
Hello tuqubao,

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

Code: [Select]
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