Forum

Author Topic: detectMarkers 'CircularTarget12bit' is not defined  (Read 804 times)

Bolli

  • Newbie
  • *
  • Posts: 21
    • View Profile
detectMarkers 'CircularTarget12bit' is not defined
« on: June 21, 2022, 08:11:32 PM »
Hi all,
I'm trying to work in a detectMarkers into a batch process via python. I'm using Metashape 1.8.3 and the 1.8.3 python api guide. I've basically copied this line of code from the api guide and the target type CircularTarget12bit is coming up as undefined ("NameError: name 'CircularTarget12bit' is not defined"). Is there another target type to represent the 12 bit Circular targets that I'm missing?

Code: [Select]
import Metashape
import os, sys
import time, datetime
import math
import json

#Define which document
doc = Metashape.app.document
doc.open(export_path + '/' + proj_name + '.psx')


#Define which chunk
chunk = Metashape.app.document.chunk

#Detect markers
chunk.detectMarkers(target_type = CircularTarget12bit,
                    tolerance = 50,
                    filter_mask = False,
                    inverted = False,
                    noparity=False)

doc.save()

Thanks for any and all advice!
Bolli

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13913
    • View Profile
Re: detectMarkers 'CircularTarget12bit' is not defined
« Reply #1 on: June 21, 2022, 08:45:23 PM »
Hello Bolli,

Try to replace CircularTarget12bit with Metashape.CircularTarget12bit
Best regards,
Alexey Pasumansky,
Agisoft LLC

Bolli

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: detectMarkers 'CircularTarget12bit' is not defined
« Reply #2 on: June 21, 2022, 08:50:57 PM »
That replacement worked. Thanks Alexey

Paulo

  • Hero Member
  • *****
  • Posts: 1036
    • View Profile
Re: detectMarkers 'CircularTarget12bit' is not defined
« Reply #3 on: June 21, 2022, 09:11:00 PM »
Very good,

whenever a parameter refers to a Metashape Class than in API the parameter should be prepended by Metashape.
Best Regards,

Paul Pelletier,
Surveyor