TextAnnotation
Text labels on 2D images
Parent Data Structure
TextAnnotation appears in the ImageAnnotations message data structure.
Data Structure
| Field | Type | Description |
|---|---|---|
| timestamp | time | Timestamp of the annotation |
| position | Point2 | Lower-left origin of the text label in 2D image coordinates (pixels) |
| text | string | Text to display |
| font_size | float64 | Font size (pixels) |
| text_color | color | Text color |
| background_color | color | Background 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:
| Encoding | Data Structure |
|---|---|
| ROS 1 | foxglove_msgs/TextAnnotation |
| ROS 2 | foxglove_msgs/msg/TextAnnotation |
| JSON | foxglove.TextAnnotation |
| Protobuf | foxglove.TextAnnotation |
| FlatBuffers | foxglove.TextAnnotation |
| OMG IDL | foxglove::TextAnnotation |
You must use the data structure names specified above so that visualizations can recognize the data structure.