agents.components.imagestovideo

agents.components.imagestovideo#

Module Contents#

Classes#

VideoMessageMaker

This component generates ROS video messages from input image messages. A video message is a collection of image messages that have a perceivable motion. I.e. the primary task of this component is to make intentionality decisions about what sequence of consecutive images should be treated as one coherent temporal sequence. The motion estimation method used for selecting images for a video can be configured in component config.

API#

class agents.components.imagestovideo.VideoMessageMaker(*, inputs: List[agents.ros.Topic], outputs: List[agents.ros.Topic], config: Optional[agents.config.VideoMessageMakerConfig] = None, trigger: Union[agents.ros.Topic, List[agents.ros.Topic]], callback_group=None, component_name: str = 'video_maker_component', **kwargs)#

Bases: agents.components.component_base.Component

This component generates ROS video messages from input image messages. A video message is a collection of image messages that have a perceivable motion. I.e. the primary task of this component is to make intentionality decisions about what sequence of consecutive images should be treated as one coherent temporal sequence. The motion estimation method used for selecting images for a video can be configured in component config.

Parameters:
  • inputs (list[Topic]) – The input topics for the object detection. This should be a list of Topic objects or FixedInput objects, limited to Image type.

  • outputs (list[Topic]) – The output topics for the object detection. This should be a list of Topic objects, Video type.

  • config (VideoMessageMakerConfig) – The configuration for the video message generation. This should be an instance of VideoMessageMakerConfig.

  • trigger (Union[Topic, list[Topic]]) – The trigger value or topic for the object detection. This can be a single Topic object or a list of Topic objects.

  • callback_group (str) – An optional callback group for the video message generation. If provided, this should be a string. Otherwise, it defaults to None.

  • component_name (str) – The name of the video message generation component. This should be a string and defaults to “video_maker_component”.

Example usage:

image_topic = Topic(name="image", msg_type="Image")
video_topic = Topic(name="video", msg_type="Video")
config = VideoMessageMakerConfig()
video_message_maker = VideoMessageMaker(
    inputs=[image_topic],
    outputs=[video_topic],
    config=config,
)