# SpatialImgDetections

与 [ImgDetections](https://docs.luxonis.com/software-v3/depthai/depthai-components/messages/img_detections.md) 类似，但此消息还包括检测物体的 XYZ
坐标。

## 功能示例

 * [空间检测网络](https://docs.luxonis.com/software-v3/depthai/examples/spatial_detection_network/spatial_detection.md)

## 参考

### 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, tsSystem, detections, transformation,
segmentationMaskWidth, segmentationMaskHeight, unit)

Kind: function

### 需要帮助？

请前往 [OAKChina 官网](https://www.oakchina.cn/) 获取技术支持或解答您的任何疑问。
