Skip to main content

TextAnnotation

Text labels on 2D images

Parent Data Structure

TextAnnotation appears in the ImageAnnotations message data structure.

Data Structure

FieldTypeDescription
timestamptimeTimestamp of the annotation
positionPoint2Lower-left origin of the text label in 2D image coordinates (pixels)
textstringText to display
font_sizefloat64Font size (pixels)
text_colorcolorText color
background_colorcolorBackground fill color

position

Coordinates use the top-left corner of the top-left pixel of the image as the origin.

Reference Implementation

Visualization data structures are framework-agnostic and can be implemented using any supported message encoding:

EncodingData Structure
ROS 1foxglove_msgs/TextAnnotation
ROS 2foxglove_msgs/msg/TextAnnotation
JSONfoxglove.TextAnnotation
Protobuffoxglove.TextAnnotation
FlatBuffersfoxglove.TextAnnotation
OMG IDLfoxglove::TextAnnotation

You must use the data structure names specified above so that visualizations can recognize the data structure.