Program Listing for File ObjectTrackerProperties.hpp

Return to documentation for file (include/depthai/properties/ObjectTrackerProperties.hpp)

#pragma once

// std
#include <vector>

// project
#include "depthai/common/optional.hpp"
#include "depthai/properties/Properties.hpp"

namespace dai {

enum class TrackerType : std::int32_t {
    SHORT_TERM_KCF = 1,
    SHORT_TERM_IMAGELESS = 3,
    ZERO_TERM_IMAGELESS = 5,
    ZERO_TERM_COLOR_HISTOGRAM = 6
};

enum class TrackerIdAssignmentPolicy : std::int32_t {
    UNIQUE_ID,
    SMALLEST_ID
};

struct ObjectTrackerProperties : PropertiesSerializable<Properties, ObjectTrackerProperties> {
    float trackerThreshold = 0.0;
    std::int32_t maxObjectsToTrack = 60;
    std::vector<std::uint32_t> detectionLabelsToTrack;
    TrackerType trackerType = TrackerType::SHORT_TERM_IMAGELESS;
    TrackerIdAssignmentPolicy trackerIdAssignmentPolicy = TrackerIdAssignmentPolicy::UNIQUE_ID;
    bool trackingPerClass = true;
    float occlusionRatioThreshold = 0.2f;
    uint32_t trackletMaxLifespan = 120;
    uint32_t trackletBirthThreshold = 3;

    ~ObjectTrackerProperties() override;
};

DEPTHAI_SERIALIZE_EXT(ObjectTrackerProperties,
                      trackerThreshold,
                      maxObjectsToTrack,
                      detectionLabelsToTrack,
                      trackerType,
                      trackerIdAssignmentPolicy,
                      trackingPerClass,
                      occlusionRatioThreshold,
                      trackletMaxLifespan,
                      trackletBirthThreshold);

}  // namespace dai