Png Annotations

Extract frame images from input.

This module supplies an annotator that saves individual frames to some location specified on the local machine. It is only useful for its side effects as no information is returned to the FrameProcessor.

class dvt.annotate.png.PngAnnotator(**kwargs)[source]

Bases: dvt.abstract.FrameAnnotator

Annotator for saving PNG still images from an input.

The annotate method of this annotator does not return any data. It is useful only for its side effects.

output_dir

location where output frames should be saved. Will be created if the location does not yet exist.

Type:str
freq

How often to save the image. For example, setting the frequency to 2 will save every other frame in the batch.

Type:int
size

What should the size of the output images be? Set to None, the default, to preserve the size as given in the input file. Given as the desired height; the width will be scaled to keep the aspect ratio.

Type:int
frames

An optional list of frames to process. This should be a list of integers or a 1D numpy array of integers. If set to something other than None, the freq input is ignored.

Type:array of ints
name

A description of the aggregator. Used as a key in the output data.

Type:str
annotate(batch)[source]

Annotate the batch of frames with the PNG annotator.

Parameters:batch (FrameBatch) – A batch of images to annotate.
Returns:Returns an empty list.
name = 'png'