<reponame>sonnyky/porter<gh_stars>1-10
import depthai as dai

class Tracker:
    def __init__(self, pipeline):
        self.objectTracker = pipeline.createObjectTracker()

    def initTrackerColorHistogram(self):
        self.objectTracker.setDetectionLabelsToTrack([15])  # track only person
        # possible tracking types: ZERO_TERM_COLOR_HISTOGRAM, ZERO_TERM_IMAGELESS
        self.objectTracker.setTrackerType(dai.TrackerType.ZERO_TERM_COLOR_HISTOGRAM)
        # take the smallest ID when new object is tracked, possible options: SMALLEST_ID, UNIQUE_ID
        self.objectTracker.setTrackerIdAssigmentPolicy(dai.TrackerIdAssigmentPolicy.SMALLEST_ID)
        return self.objectTracker
import depthai as dai

class Tracker:
    def __init__(self, pipeline):
        self.objectTracker = pipeline.createObjectTracker()

    def initTrackerColorHistogram(self):
        self.objectTracker.setDetectionLabelsToTrack([15])  # track only person
        # possible tracking types: ZERO_TERM_COLOR_HISTOGRAM, ZERO_TERM_IMAGELESS
        self.objectTracker.setTrackerType(dai.TrackerType.ZERO_TERM_COLOR_HISTOGRAM)
        # take the smallest ID when new object is tracked, possible options: SMALLEST_ID, UNIQUE_ID
        self.objectTracker.setTrackerIdAssigmentPolicy(dai.TrackerIdAssigmentPolicy.SMALLEST_ID)
        return self.objectTracker
# track only person # possible tracking types: ZERO_TERM_COLOR_HISTOGRAM, ZERO_TERM_IMAGELESS # take the smallest ID when new object is tracked, possible options: SMALLEST_ID, UNIQUE_ID