Forum

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

3dhugo

  • 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 = ??
      print(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: 14846
    • 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

3dhugo

  • 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!