Author Topic: filter markers by name  (Read 2963 times)


  • Newbie
  • *
  • Posts: 2
    • View Profile
filter markers by name
« on: October 20, 2014, 06:37:03 PM »
Hi all,

I would appreciate your help. I am unsure how to access the marker object name in python.

I am using a known number of markers in a certain range on fixed rig. All markers are > 600, partially obstructed markers commonly show up with values in the 1-300 range, so i want to filter any values less than 600 as shown below:

markers = chunk.markers
numMarkers = len(markers)
print(str(numMarkers) + " markers detected") 

#limit markers to 48
if numMarkers > 48:
   #go through all markers
   for i in markers:
      #retrieve marker number, check if marker is within valid range (< 600)

      num = ??

      if num < 600:
         #remove accordingly

How can i access the int that is the marker name for use in the conditional? I wrongly began by using calling index, though this only gives me the position of a marker in the list, not any information on the marker name.

Thanks for any help you can give.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13913
    • View Profile
Re: filter markers by name
« Reply #1 on: October 20, 2014, 06:45:01 PM »
Hello 3dhugo,

Marker name is accessible through marker.label. It is a string, so if you are comparing with the number you need to convert it to integer using int(marker.label) or convert number to string using str(num).
Best regards,
Alexey Pasumansky,
Agisoft LLC


  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: filter markers by name
« Reply #2 on: October 20, 2014, 06:50:13 PM »
Hi Alexey,

Great that really helps. Thanks for the quick response!