Class SpatialLocationCalculator

Inheritance Relationships

Base Types

Class Documentation

class SpatialLocationCalculator : public dai::DeviceNodeCRTP<DeviceNode, SpatialLocationCalculator, SpatialLocationCalculatorProperties>, public dai::HostRunnable

SpatialLocationCalculator node. Calculates the spatial locations of detected objects based on the input depth map. Spatial location calculations can be additionally refined by using a segmentation mask. If keypoints are provided, the spatial location is calculated around each keypoint.

Public Functions

SpatialLocationCalculator() = default
inline SpatialLocationCalculator(std::unique_ptr<Properties> props)
void setRunOnHost(bool runOnHost)

Specify whether to run on host or device By default, the node will run on device.

virtual bool runOnHost() const override

Check if the node is set to run on host

virtual void run() override
inline DeviceNodeCRTP()
inline DeviceNodeCRTP(const std::shared_ptr<Device> &device)
inline DeviceNodeCRTP(std::unique_ptr<Properties> props)
inline DeviceNodeCRTP(std::unique_ptr<Properties> props, bool confMode)
inline DeviceNodeCRTP(const std::shared_ptr<Device> &device, std::unique_ptr<Properties> props, bool confMode)

Public Members

std::shared_ptr<SpatialLocationCalculatorConfig> initialConfig = std::make_shared<SpatialLocationCalculatorConfig>()

Initial config to use when calculating spatial location data.

Input inputConfig = {*this, {"inputConfig", DEFAULT_GROUP, false, 4, {{{DatatypeEnum::SpatialLocationCalculatorConfig, false}}}, DEFAULT_WAIT_FOR_MESSAGE}}

Input SpatialLocationCalculatorConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.

Input inputDetections = {*this, {"inputDetections", DEFAULT_GROUP, true, 1, {{{DatatypeEnum::ImgDetections, false}}}, DEFAULT_WAIT_FOR_MESSAGE}}

Input messages on which spatial location will be calculated. Possible datatypes are ImgDetections or Keypoints.

Input inputDepth = {*this, {"inputDepth", DEFAULT_GROUP, false, 4, {{{DatatypeEnum::ImgFrame, false}}}, DEFAULT_WAIT_FOR_MESSAGE}}

Input message with depth data used to retrieve spatial information about detected object. Default queue is non-blocking with size 4.

Output out = {*this, {"out", DEFAULT_GROUP, {{{DatatypeEnum::SpatialLocationCalculatorData, false}}}}}

Outputs SpatialLocationCalculatorData message that carries spatial locations for each additional ROI that is specified in the config.

Output outputDetections = {*this, {"outputDetections", DEFAULT_GROUP, {{DatatypeEnum::SpatialImgDetections, false}}}}

Outputs SpatialImgDetections message that carries spatial locations along with original input data.

Output passthroughDepth = {*this, {"passthroughDepth", DEFAULT_GROUP, {{{DatatypeEnum::ImgFrame, false}}}}}

Passthrough message on which the calculation was performed. Suitable for when input queue is set to non-blocking behavior.

Public Static Attributes

static constexpr const char *NAME = "SpatialLocationCalculator"

Protected Functions

virtual Properties &getProperties() override