RawImage
A raw image
Panel support
RawImage
is used in the 3D and Image panels.
Schema
field | type | description |
---|---|---|
timestamp | Timestamp | Timestamp of image |
frame_id | string | Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image. |
width | uint32 | Image width in pixels |
height | uint32 | Image height in pixels |
encoding | string | Encoding of the raw image data. See the data field description for supported values. |
step | uint32 | Byte length of a single row. This is usually some multiple of width depending on the encoding, but can be greater to incorporate padding. |
data | bytes | Raw image data. |
data
For each encoding
value, the data
field contains image pixel data serialized as follows:
yuv422
oruyvy
:- Pixel colors are decomposed into Y'UV channels.
- Pixel channel values are represented as unsigned 8-bit integers.
- U and V values are shared between horizontal pairs of pixels. Each pair of output pixels is serialized as [U, Y1, V, Y2].
step
must be greater than or equal towidth
* 2.
yuv422_yuy2
oryuyv
:- Pixel colors are decomposed into Y'UV channels.
- Pixel channel values are represented as unsigned 8-bit integers.
- U and V values are shared between horizontal pairs of pixels. Each pair of output pixels is encoded as [Y1, U, Y2, V].
step
must be greater than or equal towidth
* 2.
rgb8
:- Pixel colors are decomposed into Red, Green, and Blue channels.
- Pixel channel values are represented as unsigned 8-bit integers.
- Each output pixel is serialized as [R, G, B].
step
must be greater than or equal towidth
* 3.
rgba8
:- Pixel colors are decomposed into Red, Green, Blue, and Alpha channels.
- Pixel channel values are represented as unsigned 8-bit integers.
- Each output pixel is serialized as [R, G, B, Alpha].
step
must be greater than or equal towidth
* 4.
bgr8
or8UC3
:- Pixel colors are decomposed into Red, Blue, Green, and Alpha channels.
- Pixel channel values are represented as unsigned 8-bit integers.
- Each output pixel is serialized as [B, G, R].
step
must be greater than or equal towidth
* 3.
bgra8
:- Pixel colors are decomposed into Blue, Green, Red, and Alpha channels.
- Pixel channel values are represented as unsigned 8-bit integers.
- Each output pixel is encoded as [B, G, R, Alpha].
step
must be greater than or equal towidth
* 4.
32FC1
:- Pixel brightness is represented as a single-channel, 32-bit little-endian IEEE 754 floating-point value, ranging from 0.0 (black) to 1.0 (white).
step
must be greater than or equal towidth
* 4.
bayer_rggb8
,bayer_bggr8
,bayer_rggb8
,bayer_gbrg8
, orbayer_grgb8
:- Pixel colors are decomposed into Red, Blue and Green channels.
- Pixel channel values are represented as unsigned 8-bit integers, and serialized in a 2x2 bayer filter pattern.
- The order of the four letters after
bayer_
determine the layout, so forbayer_wxyz8
the pattern is:
w | x
- + -
y | zstep
must be greater than or equal towidth
.
mono8
or8UC1
:- Pixel brightness is represented as unsigned 8-bit integers.
step
must be greater than or equal towidth
.
mono16
or16UC1
:- Pixel brightness is represented as 16-bit unsigned little-endian integers. Rendering of these values is controlled in Image panel color mode settings.
step
must be greater than or equal towidth
* 2.
Reference implementations
Foxglove schemas are framework-agnostic, and can be implemented using any supported message encoding:
encoding | schema |
---|---|
ROS 1 | foxglove_msgs/RawImage |
ROS 2 | foxglove_msgs/msg/RawImage |
JSON | foxglove.RawImage |
Protobuf | foxglove.RawImage |
FlatBuffers | foxglove.RawImage |
OMG IDL | foxglove::RawImage |
You must use the schema names specified above for Foxglove to recognize the schema.