Forum

Author Topic: Automated addition of markers  (Read 3054 times)

PhotoScan

  • Newbie
  • *
  • Posts: 3
    • View Profile
Automated addition of markers
« on: August 12, 2015, 01:19:56 AM »
I am writing a script to automatically add markers to an existing model. For each marker I have the following information:
the names of each image that it should appear in
the pixel coordinates at which it will reside for each image it appears in
GPS information (x,y,z) that should be applied to the marker.

I know how to add the GPS information (marker.reference.location), but I cannot figure out how to add this marker to any images. I would appreciate any help doing this. Thanks.

Edit: I am using PhotoScan 1.1.5

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Automated addition of markers
« Reply #1 on: August 12, 2015, 06:53:54 PM »
Hello,

Here's a brief code that puts marker projection on the given photo:

Code: [Select]
chunk = PhotoScan.app.document.chunk #active chunk
marker = chunk.markers[0] #actual marker
camera = chunk.cameras[0] #camera when we are planning to put marker projection
x, y = 512, 376 #coordinates of the marker projection on camera image
marker.projections[camera] = (x, y)
Best regards,
Alexey Pasumansky,
Agisoft LLC

PhotoScan

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Automated addition of markers
« Reply #2 on: August 12, 2015, 09:06:46 PM »
Thanks, this is exactly what I was looking for.