DynAIkonTrap.filtering.filtering#

A simple interface to the frame animal filtering pipelines is provided by this module. It encapsulates both motion- and image-based filtering as well as any smoothing of this in time. Viewed from the outside the Filter may read from Camera’s output and in turn outputs only frames containing animals. Alternatively, Filter may read from EventRememberer to process motion events stored on disk. As a result, the filter may operate in two modes: a) filter BY_FRAME, b) filter BY_EVENT.

In the filter BY_FRAME mode, frames are first analysed by the MotionFilter. Frames with motion score and label indicating motion, are added to a MotionLabelledQueue. Within the queue the AnimalFilter stage is applied with only the animal frames being returned as the output of this pipeline.

In the filter BY_EVENT mode, events are loaded from the instance of EventRememberer and processed within _process_event(). This method employs a spiral-out inference strategy which checks each frame for animal detection (starting in the center frame, working outwards) animal detection is performed by applying AnimalFilter.

In both modes, the output is accessible via a queue. BY_FRAME mode produces a queue of frames containing animals, BY_EVENT mode produces a queue of events containing animal frames. This allows the pipeline to be run in a separate process.

Classes

Filter(read_from, settings[, sender_settings])

Wrapper for the complete image filtering pipeline

FilterMode(value)

A class to configure the mode the filter operates in

class Filter(read_from: Union[Camera, EventRememberer], settings: FilterSettings, sender_settings: Optional[SenderSettings] = None)#

Wrapper for the complete image filtering pipeline

Parameters:
close()#
get() Union[EventData, Frame]#

Retrieve the next animal Frame or animal EventData from the filter pipeline’s output.

Returns:

An animal frame or event

Return type:

Next (Union[EventData, Frame])

class FilterMode(value)#

A class to configure the mode the filter operates in

BY_EVENT = 1#
BY_FRAME = 0#