# ImgAnnotations

ImgAnnotations 存储可以渲染在 [ImgFrame](https://docs.luxonis.com/software-v3/depthai/depthai-components/messages/img_frame.md)
之上的叠加层。每个注释都可以描述矢量图元——点、线段、折线、边界框或文本标签——以及颜色和厚度等样式信息。该消息由能够为帧添加额外上下文（例如追踪器叠加层）的节点生成，并且也可以在主机上编排，然后将数据发送回设备。

将 ImgAnnotations 与 [ImageManip](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/image_manip.md) 或
[Script](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/script.md)
节点结合使用，直接在设备输出上绘制诊断信息或用户界面元素。在主机上，您可以遍历注释列表，使用 OpenCV 或其他可视化库进行渲染。

## 参考

### dai::ImgAnnotations

Kind: class

ImgAnnotations message. Carries annotations for an image.

#### std::vector< ImgAnnotation > annotations

Kind: variable

Transform .

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

Kind: variable

#### ImgAnnotations()

Kind: function

Construct ImgAnnotations message.

#### ImgAnnotations(std::vector< ImgAnnotation > annotations)

Kind: function

#### ~ImgAnnotations()

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

#### DEPTHAI_SERIALIZE(ImgAnnotations, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, annotations,
transformation)

Kind: function

### 需要帮助？

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