# Designer Computer Vision API¶

class metavision_designer_cv.ActivityFilter

Filters events based on their activity.

ActivityFilter consumes an Event2d stream and propagates events only if events of same polarity have happened during a certain time window in the past, in its neighborhood.

Args:

source (Producer): Pointer to the Producer object which provides the stream

activity_time_ths (int): Length of the time window for activity filtering (in us)

activity_ths (int): Minimum number of events in the neighborhood for activity filtering

trail_ths (int): Length of the time window for trail filtering (in us)

get_activity_threshold(self: metavision_designer_cv.ActivityFilter) → int

Returns the value of activity_ths parameter of the ActivityFilter

Returns:

unsigned short: activity_ths value

get_activity_time_threshold(self: metavision_designer_cv.ActivityFilter) → int

Returns the value of current activity_time_ths parameter of the ActivityFilter

Returns:

int: activity_time_ths value

get_trail_time_threshold(self: metavision_designer_cv.ActivityFilter) → int

Returns the current trail_ths parameter of the ActivityFilter

Returns:

int: trail_ths value

set_activity_threshold(self: metavision_designer_cv.ActivityFilter, activity_ths: int) → None

Sets the activity_ths parameter of the ActivityFilter

Args:

activity_ths (int): Minimum number of events in the neighborhood for activity filtering

set_activity_time_threshold(self: metavision_designer_cv.ActivityFilter, activity_time_ths: int) → None

Sets the value of activity_time_ths parameter of the ActivityFilter

Args:

Activity_time_ths (int) : Length of the time window for activity filtering (in us).

set_trail_time_threshold(self: metavision_designer_cv.ActivityFilter, trail_ths: int) → None

Sets the value of trail_ths parameter of the ActivityFilter

Args:

trail_ths (int): Length of the time window for trail filtering (in us).

class metavision_designer_cv.ActivityNoiseFilter

Filters noise from events stream.

ActivityNoiseFilter will only output events if there has been at least one another event in its neighborhood in a given time window. This neighborhood is composed of the 8 pixels surrounding the given pixel.

Args:

source (Producer): Producer source providing the events

threshold (int): Length of the time window for activity filtering (in us)

get_threshold(self: metavision_designer_cv.ActivityNoiseFilter) → int

Returns the current value of the threshold parameter of the ActivityNoiseFilter

Returns:

int: Length of the time window for activity filtering (in us)

set_threshold(self: metavision_designer_cv.ActivityNoiseFilter, threshold: int) → None

Sets the threshold parameter of the ActivityNoiseFilter

Args:

threshold (int) : Length of the time window for activity filtering (in us)

class metavision_designer_cv.EventCounter

Counts the number of events in a Controller step and writes statistics to CSV.

EventCounter is a commodity class to collect statistics on event rate. It computes peak rate and average rate of a source producer and writes results to a CSV log file. It works on steps that must match the Controller slice_duration. EventCounter signals whenever the average event rate exceeds a certain threshold by updating its 2D array output. In this specific output, the 2D size is (1,1) and contains either ‘0’ when average rate is below threshold, and ‘1’ otherwise.

Args:

source (Producer): Component providing the input events

filename (str): Name of the file to generate

step_time (int): Time interval for peak event rate computation, in us

scaling_time (int): Time interval for average event rate computation, in us

enable_log (bool, optional): Activate logging to CSV file (default : True)

threshold (float, optional): Threshold for the output signal, in MEv/s (default : 20)

variance (bool, optional): Computing variance if true (default : False)

enable_log(self: metavision_designer_cv.EventCounter, state: bool) → None

Enables or disables data logging

Args:

state (bool): Enables logs if state = True

get_average_rate(self: metavision_designer_cv.EventCounter) → tuple

Retrieves the last computed average rate

Returns:

float: Time (in seconds) when the last average rate has been computed

float: Average rate value, in kEV/s

get_events_number(self: metavision_designer_cv.EventCounter) → int

Retrieves the total number of events processed since the beginning

Returns:

int: Total number of events counted from the input source

get_peak_rate(self: metavision_designer_cv.EventCounter) → tuple

Retrieves last computed peak rate

Returns:

float: Time (in seconds) when the last peak rate has been computed

float: peak rate value, in kEV/s

polarity_to_count(self: metavision_designer_cv.EventCounter, polarity: int) → None

Counts only the events that have a given polarity. All events counted by default.

Args:

polarity (int): Polarity to count. Use -1 to disable filter

print_stats(self: metavision_designer_cv.EventCounter) → None

Prints statistics

set_log_destination(self: metavision_designer_cv.EventCounter, filename: str) → None

Sets the output log file

Args:

filename (str): Name of the log file to create

set_scaling_time_us(self: metavision_designer_cv.EventCounter, timestamp: int) → None

Sets the scaling time in microseconds for average rate computation

Args:

timestamp (int): Scaling time to set

set_step_time_us(self: metavision_designer_cv.EventCounter, timestamp: int) → None

Sets the step time in microseconds for peak rate computation

Args:

timestamp (int): Step time to set

class metavision_designer_cv.FlowFrameGenerator

Builds a display of sparse flow events

The FlowFrameGenerator consumes an EventCD stream from a producer and an EventOpticalFlow stream from a SparseOpticalFlow producer and generates a display image in the 2D array output.

Args:

ev_source (Producer): EventCD stream producer

flow_source (Producer): EventOpticalFlow stream producer

colored (bool): Shows colored arrows if true

class metavision_designer_cv.SparseOpticalFlow

Computes a sparse Optical Flow on a stream of EventCD.

This SparseOpticalFlow component consumes a stream of EventCD from input source and generates a stream of EventOpticalFlow. It can be tuned to work either on fast or slow objects using the Tuning enum. EventOpticalFlow extends EventCD by adding velocity vectors and feature id to the input. EventOpticalFlow stream can be displayed using a FlowFrameGenerator.

Args:

source (Producer): Input EventCD stream producer

tuning (Tuning): One of FAST_OBJECTS or SLOW_OBJECTS

class Tuning

Members:

FAST_OBJECTS

SLOW_OBJECTS

property name

(self: handle) -> str

set_height_limit(self: metavision_designer_cv.SparseOpticalFlow, min_y: int, max_y: int) → None

Sets a vertical ROI

Args:

min_y (int): Min limit for vertical ROI

max_y (int): Max limit for vertical ROI

class metavision_designer_cv.SpatioTemporalContrast

Noise filter suppressing redundant events at edge level.

The SpatioTemporalContrast filter uses the exponential response of a pixel to a change of light to filter out wrong detections and trails. For an event to be accepted, it needs to be preceded by another one in a given time window. This ensures that the contrast detection is evolving fast enough at the pixel level. Optionally, one can also cut all the following events until a change of polarity in the event stream. SpatioTemporalContrast consumes an EventCD stream and produces a filtered EventCD stream.

Args:

source (Producer): Component providing the input EventCD stream

threshold (int): Length of the time window of the filter in us

cut_trail (bool, optional): Filter out trail events (default : True)

get_cut_trail(self: metavision_designer_cv.SpatioTemporalContrast) → bool

Gets the current cut trail state

Returns: bool: Current cut_trail state

get_threshold(self: metavision_designer_cv.SpatioTemporalContrast) → int

Gets the current threshold value

Returns: int: Current threshold value

set_cut_trail(self: metavision_designer_cv.SpatioTemporalContrast, state: bool) → None

Configures the cut trail state

Args:

state (bool): Current cut_trail state

set_threshold(self: metavision_designer_cv.SpatioTemporalContrast, threshold: int) → None

Configures the filter threshold

Args:

timestamp (int): length of the time window of the filter in us

class metavision_designer_cv.TrailFilter

Suppresses consecutive events of same polarity over a fixed time window.

This filter removes the trail of events by suppressing the sequence of events having the same polarity over a fixed time window. It operates at the pixel level. Each time the event polarity changes, or the time window is passed, the filter is reset. It consumes a stream of EventCD and generates a filtered stream of EventCD.

Args:

source (Producer): EventCD source threshold (int): Duration of the time window in us

get_threshold(self: metavision_designer_cv.TrailFilter) → int

Returns the current value of the threshold parameter of the TrailFilter

Returns:

int: Current duration of the time window in us

set_threshold(self: metavision_designer_cv.TrailFilter, threshold: int) → None

Sets the threshold parameter of the TrailFilter

Args:

threshold (int): Duration of the time window in us