Designer Computer Vision API

class metavision_designer_cv.ActivityNoiseFilter(self: metavision_designer_cv.ActivityNoiseFilter, source: metavision_designer_engine.Producer, threshold: int)None

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.

Parameters
  • 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

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

Return type

int

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

Sets the threshold parameter of the ActivityNoiseFilter

Parameters

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

class metavision_designer_cv.EventCounter(self: metavision_designer_cv.EventCounter, source: metavision_designer_engine.Producer, filename: str, step_time: int, scaling_time: int, enable_log: bool = True, threshold: float = 19.0, variance: bool = False)None

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.

Parameters
  • 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

Parameters

state (bool) – Enables logs if state = True

get_average_rate(self: metavision_designer_cv.EventCounter)tuple

Retrieves the last computed average rate

Returns

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

float: Average rate value, in kEV/s

Return type

float

get_events_number(self: metavision_designer_cv.EventCounter)int

Retrieves the total number of events processed since the beginning

Returns

Total number of events counted from the input source

Return type

int

get_peak_rate(self: metavision_designer_cv.EventCounter)tuple

Retrieves last computed peak rate

Returns

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

float: peak rate value, in kEV/s

Return type

float

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.

Parameters

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

Parameters

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

Parameters

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

Parameters

timestamp (int) – Step time to set

class metavision_designer_cv.FlowFrameGenerator(self: metavision_designer_cv.FlowFrameGenerator, ev_source: metavision_designer_engine.Producer, flow_source: metavision_designer_engine.Producer, colored: bool)None

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.

Parameters
  • ev_source (Producer) – EventCD stream producer

  • flow_source (Producer) – EventOpticalFlow stream producer

  • colored (bool) – Shows colored arrows if true

class metavision_designer_cv.SparseOpticalFlow(self: metavision_designer_cv.SparseOpticalFlow, source: metavision_designer_engine.Producer, tuning: Metavision::SparseOpticalFlowAlgorithm::Parameters::Tuning)None

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.

Parameters
  • source (Producer) – Input EventCD stream producer

  • tuning (Tuning) – One of FAST_OBJECTS or SLOW_OBJECTS

class Tuning(self: metavision_designer_cv.SparseOpticalFlow.Tuning, value: int)None

Members:

FAST_OBJECTS

SLOW_OBJECTS

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

Sets a vertical ROI

Parameters
  • min_y (int) – Min limit for vertical ROI

  • max_y (int) – Max limit for vertical ROI

class metavision_designer_cv.SpatioTemporalContrast(self: metavision_designer_cv.SpatioTemporalContrast, source: metavision_designer_engine.Producer, threshold: int, cut_trail: bool = True)None

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.

Parameters
  • 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

Parameters

state (bool) – Current cut_trail state

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

Configures the filter threshold

Parameters

timestamp (int) – Length of the time window of the filter in us

class metavision_designer_cv.TrailFilter(self: metavision_designer_cv.TrailFilter, source: metavision_designer_engine.Producer, threshold: int)None

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.

Parameters
  • 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

Current duration of the time window in us

Return type

int

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

Sets the threshold parameter of the TrailFilter

Parameters

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