cozmo.annotate

Camera image annotation.

../_images/annotate.jpg

This module defines an ImageAnnotator class used by cozmo.world.World to add annotations to camera images received by Cozmo.

This can include the location of cubes, faces and pets that Cozmo currently sees, along with user-defined custom annotations.

The ImageAnnotator instance can be accessed as cozmo.world.World.image_annotator.

Module Attributes

TOP_LEFT

Top left position

BOTTOM_LEFT

Bottom left position

TOP_RIGHT

Top right position

BOTTOM_RIGHT

Bottom right position

RESAMPLE_MODE_NEAREST

Fastest resampling mode, use nearest pixel

RESAMPLE_MODE_BILINEAR

Slower, but smoother, resampling mode - linear interpolation from 2x2 grid of pixels

Functions

add_img_box_to_image(image, box, color[, text])

Draw a box on an image and optionally add text.

add_polygon_to_image(image, poly_points, ...)

Draw a polygon on an image

annotator(f)

A decorator for converting a regular function/method into an Annotator.

Classes

Annotator(img_annotator[, priority])

Annotation base class

FaceAnnotator(img_annotator[, box_color])

Adds annotations of currently detected faces to a camera image.

ImageAnnotator(world, **kw)

ImageAnnotator applies annotations to the camera image received from the robot.

ImageText(text[, position, align, color, ...])

ImageText represents some text that can be applied to an image.

ObjectAnnotator(img_annotator[, object_colors])

Adds object annotations to an Image.

PetAnnotator(img_annotator[, box_color])

Adds annotations of currently detected pets to a camera image.

TextAnnotator(img_annotator, text)

Adds simple text annotations to a camera image.