# RGBDData

RGBDData bundles an aligned color frame and depth frame into a single payload. It is produced by the
[RGBD](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/rgbd.md) node after synchronizing the incoming
ImgFrame streams, and can be consumed on the host to render textured point clouds or fuse color and depth for higher-level
perception tasks.

The message exposes:

 * rgbFrame — the undistorted color image as an
   [ImgFrame](https://docs.luxonis.com/software-v3/depthai/depthai-components/messages/img_frame.md);
 * depthFrame — the registered depth map (millimeters by default);
 * Camera calibration and projection helpers for reconstructing 3D coordinates;
 * Convenience methods to iterate fused pixels or export packed RGB-D arrays.

## Usage

On the host, fetch RGBDData from the output queue:

```python
queue = device.getOutputQueue("rgbd", maxSize=2, blocking=False)
rgbd = queue.get()  # type: dai.RGBDData
rgb_frame = rgbd.getRgbFrame()
depth_frame = rgbd.getDepthFrame()
```

## Reference

### dai::RGBDData

Kind: class

RGBD message. Carries RGB and Depth frames. Frames can be either of type ImgFrame or EncodedFrame .

#### std::variant< std::shared_ptr< ImgFrame >, std::shared_ptr< EncodedFrame > > FrameVariant

Kind: enum

#### RGBDData()

Kind: function

Construct RGBD message.

#### ~RGBDData()

Kind: function

#### void setRGBFrame(const FrameVariant & frame)

Kind: function

#### void setDepthFrame(const FrameVariant & frame)

Kind: function

#### std::optional< FrameVariant > getRGBFrame()

Kind: function

#### std::optional< FrameVariant > getDepthFrame()

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(RGBDData, colorFrame, depthFrame, Buffer::ts, Buffer::tsDevice, Buffer::sequenceNum)

Kind: function

### Need assistance?

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