SpatialLocationCalculatorConfig
Examples of functionality
Reference
class
dai::SpatialLocationCalculatorConfig
variable
int32_t globalStepSize
variable
uint32_t globalLowerThreshold
variable
uint32_t globalUpperThreshold
variable
SpatialLocationCalculatorAlgorithm globalCalculationAlgorithm
variable
int32_t globalKeypointRadius
variable
bool calculateSpatialKeypoints
variable
bool useSegmentation
variable
bool segmentationPassthrough
variable
float bBoxScaleFactor
variable
std::vector< SpatialLocationCalculatorConfigData > config
function
SpatialLocationCalculatorConfig()function
~SpatialLocationCalculatorConfig()function
void setROIs(std::vector< SpatialLocationCalculatorConfigData > ROIs)Specify additional regions of interest (ROI) to calculate their spatial coordinates. Results of ROI coordinates are available on SpatialLocationCalculatorData output.
Parameters
- ROIs: Vector of configuration parameters for ROIs (region of interests)
function
void addROI(SpatialLocationCalculatorConfigData & ROI)Add a new region of interest (ROI) to configuration data.
Parameters
- roi: Configuration parameters for ROI
function
void setDepthThresholds(uint32_t lowerThreshold, uint32_t upperThreshold)Set the lower and upper depth value thresholds to be used in the spatial calculations.
Parameters
- lowerThreshold: Lower threshold in depth units (millimeter by default).
- upperThreshold: Upper threshold in depth units (millimeter by default).
function
void setCalculationAlgorithm(SpatialLocationCalculatorAlgorithm calculationAlgorithm)Set spatial location calculation algorithm. Possible values:
- MEDIAN: Median of all depth values in the ROI
- AVERAGE: Average of all depth values in the ROI
- MIN: Minimum depth value in the ROI
- MAX: Maximum depth value in the ROI
- MODE: Most frequent depth value in the ROI
function
void setStepSize(int32_t stepSize)Set step size for spatial location calculation. Step size 1 means that every pixel is taken into calculation, size 2 means every second etc. for AVERAGE, MIN, MAX step size is 1; for MODE/MEDIAN it's 2.
function
void setKeypointRadius(int32_t radius)Set radius around keypoints to calculate spatial coordinates.
Parameters
- radius: Radius in pixels.
Parameters
function
void setCalculateSpatialKeypoints(bool calculateSpatialKeypoints)If false, spatial coordinates of keypoints will not be calculated.
Parameters
- calculateSpatialKeypoints:
Parameters
function
void setUseSegmentation(bool useSegmentation)Specify whether to consider only segmented pixels within a detection bounding box for spatial calculations.
Parameters
- useSegmentation:
Parameters
function
void setSegmentationPassthrough(bool passthroughSegmentation)Specify whether to passthrough segmentation mask along with spatial detections.
Parameters
- passthroughSegmentation:
Parameters
function
void setBoundingBoxScaleFactor(float scaleFactor)Set scale factor for bounding boxes used in spatial calculations.
Parameters
- scaleFactor: Scale factor must be in the interval (0,1].
function
std::vector< SpatialLocationCalculatorConfigData > getConfigData()Retrieve configuration data for SpatialLocationCalculator
Returns
Vector of configuration parameters for ROIs (region of interests)
function
std::pair< int32_t, int32_t > getDepthThresholds()function
SpatialLocationCalculatorAlgorithm getCalculationAlgorithm()function
int32_t getStepSize()function
int32_t getKeypointRadius()Retrieve radius around keypoints used to calculate spatial coordinates.
function
bool getCalculateSpatialKeypoints()Retrieve whether keypoints are used for spatial location calculation.
Parameters
function
bool getUseSegmentation()Retrieve whether segmentation is used for spatial location calculation.
Parameters
function
bool getSegmentationPassthrough()Retrieve whether segmentation is passed through along with spatial detections.
Parameters
function
float getBoundingBoxScaleFactor()Retrieve scale factor for bounding boxes used in spatial calculations.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)inline function
DatatypeEnum getDatatype()function
DEPTHAI_SERIALIZE(SpatialLocationCalculatorConfig, globalStepSize, globalLowerThreshold, globalUpperThreshold, globalCalculationAlgorithm, globalKeypointRadius, calculateSpatialKeypoints, useSegmentation, segmentationPassthrough, bBoxScaleFactor, config)Need assistance?
Head over to Discussion Forum for technical support or any other questions you might have.