Simple Viewer using Python

The sample metavision_simple_viewer.py shows how to use the Python API of Metavision Core SDK to display events from a live Camera or a RAW file.

The source code of this sample can be found in <install-prefix>/share/metavision/sdk/core/python_samples/metavision_simple_viewer 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 a RAW file:

Expected Output from Metavision Simple Viewer Sample

How to start

To start the sample based on the live stream from your camera, run:

Linux

python3 metavision_simple_viewer.py

Windows

python metavision_simple_viewer.py

To start the sample based on recorded data, provide the full path to a RAW file (here, we use the file spinner.raw from our Sample Recordings):

Linux

python3 metavision_simple_viewer.py -i spinner.raw

Windows

python metavision_simple_viewer.py -i spinner.raw

Code Notes

This sample is using the class LiveReplayEventsIterator that allows to replay a RAW file approximately at recording speed. A more basic viewer like the one shown in metavision_sdk_get_started is using EventsIterator which will play the file as fast as possible.