# SpatialImgDetections

Similar to [ImgDetections](https://docs.luxonis.com/software-v3/depthai/depthai-components/messages/img_detections.md), but this
message includes XYZ coordinates of the detected objects as well.

## Examples of functionality

 * [Spatial Detection
   Network](https://docs.luxonis.com/software-v3/depthai/examples/spatial_detection_network/spatial_detection.md)

## Reference

### dai::SpatialImgDetections

Kind: class

SpatialImgDetections message. Carries detection results together with spatial location data

#### ImgDetectionsT < SpatialImgDetection > Base

Kind: enum

#### LengthUnit unit

Kind: variable

Length unit used by all imgDetections'

#### std::optional< ImgTransformation > transformation

Kind: variable

#### ~SpatialImgDetections()

Kind: function

#### void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)

Kind: function

#### DatatypeEnum getDatatype()

Kind: function

Get the datatype of this specific message.

return: DatatypeEnum

#### SpatialImgDetections transformTo(const ImgTransformation & target)

Kind: function

Returns a new SpatialImgDetections message with the spatial detections transformed into the target image transformation. For each
detection, the bounding box is assumed to lie on a plane parallel to the image plane at depth parameters: target: Target image
transformation. return: SpatialImgDetections with transformed detections.

#### DEPTHAI_SERIALIZE(SpatialImgDetections, sequenceNum, ts, tsDevice, detections, transformation, segmentationMaskWidth,
segmentationMaskHeight, unit)

Kind: function

### Need assistance?

Head over to [Discussion Forum](https://discuss.luxonis.com/) for technical support or any other questions you might have.
