Forum

Author Topic: Adding Targets (both Automatic and user defined) via Python Script  (Read 2351 times)

jzoken

  • Newbie
  • *
  • Posts: 1
    • View Profile
Hello Alexey,

I've recently upgraded to Agisoft 1.1.6 and, because of API changes, my code no longer runs. Unfortunately,  I can't figure out how to add  targets from the new documentation

Are you able to put together a couple of code fragments that show how this works?

Thanks,
Jack

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: Adding Targets (both Automatic and user defined) via Python Script
« Reply #1 on: October 30, 2015, 03:19:02 PM »
Hello Jack,

You can use the following line as a reference for the automatic coded target detection:
Code: [Select]
chunk.detectMarkers( type = PhotoScan.TargetType.CircularTarget12bit, tolerance = 15)
For the marker projection definition you can use the following:
Code: [Select]
camera = chunk.cameras[0] #first camera in the chunk
marker = chunk.marker[0] #first marker in the chunk
marker.projections[camera] = (100, 200) #assigning (100, 200) coordinate to marker projection on the image related to the camera

to add new marker to the chunk use chunk.addMarker() function.
Best regards,
Alexey Pasumansky,
Agisoft LLC