Program Listing for File ObjectTracker.hpp

Return to documentation for file (include/depthai/pipeline/node/ObjectTracker.hpp)

#pragma once

#include <depthai/pipeline/Node.hpp>

#include "depthai/pipeline/datatype/Tracklets.hpp"

// standard
#include <fstream>

// shared
#include <depthai-shared/properties/ObjectTrackerProperties.hpp>

namespace dai {
namespace node {

class ObjectTracker : public NodeCRTP<Node, ObjectTracker, ObjectTrackerProperties> {
   public:
    constexpr static const char* NAME = "ObjectTracker";

    ObjectTracker(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId);
    ObjectTracker(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId, std::unique_ptr<Properties> props);

    Input inputTrackerFrame{*this, "inputTrackerFrame", Input::Type::SReceiver, false, 4, true, {{DatatypeEnum::ImgFrame, false}}};

    Input inputDetectionFrame{*this, "inputDetectionFrame", Input::Type::SReceiver, false, 4, true, {{DatatypeEnum::ImgFrame, false}}};

    Input inputDetections{*this, "inputDetections", Input::Type::SReceiver, false, 4, true, {{DatatypeEnum::ImgDetections, true}}};

    Output out{*this, "out", Output::Type::MSender, {{DatatypeEnum::Tracklets, false}}};

    Output passthroughTrackerFrame{*this, "passthroughTrackerFrame", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};

    Output passthroughDetectionFrame{*this, "passthroughDetectionFrame", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};

    Output passthroughDetections{*this, "passthroughDetections", Output::Type::MSender, {{DatatypeEnum::ImgDetections, true}}};

    void setTrackerThreshold(float threshold);

    void setMaxObjectsToTrack(std::int32_t maxObjectsToTrack);

    void setDetectionLabelsToTrack(std::vector<std::uint32_t> labels);

    void setTrackerType(TrackerType type);

    void setTrackerIdAssignmentPolicy(TrackerIdAssignmentPolicy type);

    void setTrackingPerClass(bool trackingPerClass);
};

}  // namespace node
}  // namespace dai