Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
dai::node::SpatialDetectionNetwork Class Reference

SpatialDetectionNetwork node. Runs a neural inference on input image and calculates spatial location data. More...

#include <SpatialDetectionNetwork.hpp>

Inheritance diagram for dai::node::SpatialDetectionNetwork:
Inheritance graph
[legend]

Public Member Functions

void setBoundingBoxScaleFactor (float scaleFactor)
 
void setDepthLowerThreshold (uint32_t lowerThreshold)
 
void setDepthUpperThreshold (uint32_t upperThreshold)
 
void setSpatialCalculationAlgorithm (dai::SpatialLocationCalculatorAlgorithm calculationAlgorithm)
 
void setSpatialCalculationStepSize (int stepSize)
 
- Public Member Functions inherited from dai::NodeCRTP< DetectionNetwork, SpatialDetectionNetwork, SpatialDetectionNetworkProperties >
std::unique_ptr< Nodeclone () const override
 
const char * getName () const override
 

Public Attributes

Output boundingBoxMapping {*this, "boundingBoxMapping", Output::Type::MSender, {{DatatypeEnum::SpatialLocationCalculatorConfig, false}}}
 
Input input {*this, "in", Input::Type::SReceiver, true, 5, true, {{DatatypeEnum::ImgFrame, false}}}
 
Input inputDepth {*this, "inputDepth", Input::Type::SReceiver, false, 4, true, {{DatatypeEnum::ImgFrame, false}}}
 
Output out {*this, "out", Output::Type::MSender, {{DatatypeEnum::SpatialImgDetections, false}}}
 
Output passthrough {*this, "passthrough", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}}
 
Output passthroughDepth {*this, "passthroughDepth", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}}
 
Output spatialLocationCalculatorOutput
 
- Public Attributes inherited from dai::NodeCRTP< DetectionNetwork, SpatialDetectionNetwork, SpatialDetectionNetworkProperties >
Propertiesproperties
 Underlying properties. More...
 

Static Public Attributes

constexpr static const char * NAME = "SpatialDetectionNetwork"
 

Protected Member Functions

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

Additional Inherited Members

- Public Types inherited from dai::NodeCRTP< DetectionNetwork, SpatialDetectionNetwork, SpatialDetectionNetworkProperties >
using Properties = SpatialDetectionNetworkProperties
 

Detailed Description

SpatialDetectionNetwork node. Runs a neural inference on input image and calculates spatial location data.

Definition at line 20 of file SpatialDetectionNetwork.hpp.

Constructor & Destructor Documentation

◆ SpatialDetectionNetwork() [1/2]

SpatialDetectionNetwork::SpatialDetectionNetwork ( const std::shared_ptr< PipelineImpl > &  par,
int64_t  nodeId 
)
protected

Definition at line 14 of file SpatialDetectionNetwork.cpp.

◆ SpatialDetectionNetwork() [2/2]

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

Definition at line 16 of file SpatialDetectionNetwork.cpp.

Member Function Documentation

◆ setBoundingBoxScaleFactor()

void SpatialDetectionNetwork::setBoundingBoxScaleFactor ( float  scaleFactor)

Specifies scale factor for detected bounding boxes.

Parameters
scaleFactorScale factor must be in the interval (0,1].

Definition at line 22 of file SpatialDetectionNetwork.cpp.

◆ setDepthLowerThreshold()

void SpatialDetectionNetwork::setDepthLowerThreshold ( uint32_t  lowerThreshold)

Specifies lower threshold in depth units (millimeter by default) for depth values which will used to calculate spatial data

Parameters
lowerThresholdLowerThreshold must be in the interval [0,upperThreshold] and less than upperThreshold.

Definition at line 26 of file SpatialDetectionNetwork.cpp.

◆ setDepthUpperThreshold()

void SpatialDetectionNetwork::setDepthUpperThreshold ( uint32_t  upperThreshold)

Specifies upper threshold in depth units (millimeter by default) for depth values which will used to calculate spatial data

Parameters
upperThresholdUpperThreshold must be in the interval (lowerThreshold,65535].

Definition at line 30 of file SpatialDetectionNetwork.cpp.

◆ setSpatialCalculationAlgorithm()

void SpatialDetectionNetwork::setSpatialCalculationAlgorithm ( dai::SpatialLocationCalculatorAlgorithm  calculationAlgorithm)

Specifies spatial location calculator algorithm: Average/Min/Max

Parameters
calculationAlgorithmCalculation algorithm.

Definition at line 34 of file SpatialDetectionNetwork.cpp.

◆ setSpatialCalculationStepSize()

void SpatialDetectionNetwork::setSpatialCalculationStepSize ( int  stepSize)

Specifies spatial location calculator step size for depth calculation. Step size 1 means that every pixel is taken into calculation, size 2 means every second etc.

Parameters
stepSizeStep size.

Definition at line 38 of file SpatialDetectionNetwork.cpp.

Member Data Documentation

◆ boundingBoxMapping

Output dai::node::SpatialDetectionNetwork::boundingBoxMapping {*this, "boundingBoxMapping", Output::Type::MSender, {{DatatypeEnum::SpatialLocationCalculatorConfig, false}}}

Outputs mapping of detected bounding boxes relative to depth map

Suitable for when displaying remapped bounding boxes on depth frame

Definition at line 51 of file SpatialDetectionNetwork.hpp.

◆ input

Input dai::node::SpatialDetectionNetwork::input {*this, "in", Input::Type::SReceiver, true, 5, true, {{DatatypeEnum::ImgFrame, false}}}

Input message with data to be inferred upon Default queue is blocking with size 5

Definition at line 33 of file SpatialDetectionNetwork.hpp.

◆ inputDepth

Input dai::node::SpatialDetectionNetwork::inputDepth {*this, "inputDepth", Input::Type::SReceiver, false, 4, true, {{DatatypeEnum::ImgFrame, false}}}

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

Definition at line 39 of file SpatialDetectionNetwork.hpp.

◆ NAME

constexpr static const char* dai::node::SpatialDetectionNetwork::NAME = "SpatialDetectionNetwork"
staticconstexpr

Definition at line 22 of file SpatialDetectionNetwork.hpp.

◆ out

Output dai::node::SpatialDetectionNetwork::out {*this, "out", Output::Type::MSender, {{DatatypeEnum::SpatialImgDetections, false}}}

Outputs ImgDetections message that carries parsed detection results.

Definition at line 44 of file SpatialDetectionNetwork.hpp.

◆ passthrough

Output dai::node::SpatialDetectionNetwork::passthrough {*this, "passthrough", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}}

Passthrough message on which the inference was performed.

Suitable for when input queue is set to non-blocking behavior.

Definition at line 58 of file SpatialDetectionNetwork.hpp.

◆ passthroughDepth

Output dai::node::SpatialDetectionNetwork::passthroughDepth {*this, "passthroughDepth", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}}

Passthrough message for depth frame on which the spatial location calculation was performed.

Suitable for when input queue is set to non-blocking behavior.

Definition at line 65 of file SpatialDetectionNetwork.hpp.

◆ spatialLocationCalculatorOutput

Output dai::node::SpatialDetectionNetwork::spatialLocationCalculatorOutput
Initial value:
{
*this, "spatialLocationCalculatorOutput", Output::Type::MSender, {{DatatypeEnum::SpatialLocationCalculatorData, false}}}

Output of SpatialLocationCalculator node, which is used internally by SpatialDetectionNetwork. Suitable when extra information is required from SpatialLocationCalculator node, e.g. minimum, maximum distance.

Definition at line 71 of file SpatialDetectionNetwork.hpp.


The documentation for this class was generated from the following files:
dai::DatatypeEnum::SpatialLocationCalculatorData
@ SpatialLocationCalculatorData


depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:20