Note
This Python sample has a corresponding C++ sample.
Filtering using Python
The sample metavision_filtering.py
shows how to use the Python bindings of Metavision Core SDK to filter and display events.
It also shows how to capture the keys pressed in a display window and use them to modify the behavior of the stream
while the camera is running.
The following filters can be applied via keyboard keys:
p -
metavision_sdk_core.PolarityFilterAlgorithm
used to show only events of positive polarityn -
metavision_sdk_core.PolarityFilterAlgorithm
used to show only events of negative polarity
The source code of this sample can be found in <install-prefix>/share/metavision/sdk/core/python_samples/metavision_filtering
when installing Metavision SDK from installer or packages. For other deployment methods, check the page
Path of Samples.
Expected Output
The sample visualizes CD events from an event-based device or an event file after filtering:

How to start
To start the sample based on the live stream from your camera, run:
python metavision_filtering.py
To start the sample based on recorded data, provide the full path to an event file (here, we use the file spinner.raw
from our Sample Recordings):
python metavision_filtering.py -i spinner.raw