HAL Python bindings API

The Device object of metavision_hal allows a user to access the camera functionalities by requesting access to a facility using one of the call listed below. Note that facilities availability depends on the device type (camera or RAW file) and on the Prophesee sensor generation.

Facility Name

Method

Camera (sensor)

availability

RAW File

availability

Anti-flicker

get_i_antiflicker_module()

Gen4.1, IMX636 and GenX320

No

Camera Synchronization

get_i_camera_synchronization()

Yes

No

Digital Crop

get_i_digital_crop()

Gen4.1, IMX636 and GenX320

No

Digital Event Mask

get_i_digital_event_mask()

Gen4.1, IMX636 and GenX320

No

Event CD Decoder

get_i_event_cd_decoder()

Yes

Yes

Event External Trigger Decoder

get_i_event_ext_trigger_decoder()

Yes

Yes

Event Frame Diff Decoder

get_i_event_frame_diff_decoder()

GenX320

Yes

Event Frame Histo Decoder

get_i_event_frame_histo_decoder()

GenX320

Yes

Event Rate Control (ERC)

get_i_erc_module()

Gen4.1, IMX636 and GenX320

No

Event Rate Activity Filter

get_i_event_rate()

Gen3.1 and GenX320

No

Event Trail Filter (STC, Trail)

get_i_event_trail_filter_module()

Gen4.1, IMX636 and GenX320

No

Events Stream

get_i_events_stream()

Yes

Yes

Event Stream Decoder

get_i_events_stream_decoder()

Yes

Yes

Geometry

get_i_geometry()

Yes

Yes

HAL Software Info

get_i_hal_software_info()

Yes

Yes

Hardware Identification

get_i_hw_identification()

Yes

Yes

Hardware Register

get_i_hw_register()

Yes

No

Biases

get_i_ll_biases()

Yes

No

Monitoring

get_i_monitoring()

Dead Time available

on Gen4.1, IMX636 and GenX320

No

Plugin Software Info

get_i_plugin_software_info()

Yes

Yes

ROI

get_i_roi()

Yes

No

ROI Pixel Mask

get_i_roi_pixel_mask()

GenX320 only

No

Trigger In

get_i_trigger_in()

Yes

No

Trigger Out

get_i_trigger_out()

Depends on EVK model

No

Those methods can be used directly as shown in the metavision_hal_get_started sample. Alternatively, the class EventsIterator from SDK Core can be constructed from a HAL device while offering a more abstracted and rich API. Here is an example where we create an event iterator on a camera on which we disabled ERC:

from metavision_core.event_io.raw_reader import initiate_device
from metavision_core.event_io import EventsIterator

# first we create a HAL device
device = initiate_device(path=args.input_path)
if device.get_i_erc_module():  # we test if the facility is available on this device before using it
    device.get_i_erc_module().enable(False)

# now we can create an EventsIterator from the Device
mv_iterator = EventsIterator.from_device(device=device)
for evs in mv_iterator:
    any_algo.process_events(evs)

# Note that it is not recommended to leave a device in the global scope. So either create the HAL device in a
# function or delete it explicitly afterwards. Otherwise, it could result in an undefined behaviour.
del device
class metavision_hal.DeviceConfig(*args, **kwargs)

Class storing a map of (key,values) that can be used to customize how a device should be opened.

warning

The class stores values as string for ease of use, so proper care should be taken to make sure that the value can be properly parsed when calling one of the functions to get the (typed) value

see

DeviceDiscovery::list_device_config_options

see

DeviceDiscovery::open

Overloaded function.

  1. __init__(self: metavision_hal.DeviceConfig) -> None

  2. __init__(self: metavision_hal.DeviceConfig, arg0: metavision_hal.DeviceConfig) -> None

biases_range_check_bypass(self: metavision_hal.DeviceConfig) bool

Gets the status of the "bypass biases range check" option.

return

true if biases range check should be bypassed, false otherwise

enable_biases_range_check_bypass(self: metavision_hal.DeviceConfig, enabled: bool) None
format(self: metavision_hal.DeviceConfig) str

Gets the event format.

return

string representing current event format setting

get(self: metavision_hal.DeviceConfig, key: str, def: str = '') str

Gets the (typed) value for a named key in the config dictionary if it exists and can be extracted from the corresponding value safely or the provided default value.

key

Name of the config key

def

Default value if the config key is not found

return

Value of the config This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static get_biases_range_check_bypass_key() str
get_bool(self: metavision_hal.DeviceConfig, key: str, def: bool = True) bool

Gets the (typed) value for a named key in the config dictionary if it exists and can be extracted from the corresponding value safely or the provided default value.

T

type of the value to return as :key: Name of the config key

def

Default value if the config key is not found

return

Value of the config

get_double(self: metavision_hal.DeviceConfig, key: str, def: float = 0.0) float

Gets the (typed) value for a named key in the config dictionary if it exists and can be extracted from the corresponding value safely or the provided default value.

T

type of the value to return as :key: Name of the config key

def

Default value if the config key is not found

return

Value of the config

static get_format_key() str
get_int(self: metavision_hal.DeviceConfig, key: str, def: int = 0) int

Gets the (typed) value for a named key in the config dictionary if it exists and can be extracted from the corresponding value safely or the provided default value.

T

type of the value to return as :key: Name of the config key

def

Default value if the config key is not found

return

Value of the config

set(*args, **kwargs)

Overloaded function.

  1. set(self: metavision_hal.DeviceConfig, key: str, value: bool) -> None

Sets a value for a named key in the config dictionary This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

  1. set(self: metavision_hal.DeviceConfig, key: str, value: str) -> None

Sets a value for a named key in the config dictionary This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

  1. set(self: metavision_hal.DeviceConfig, key: str, value: int) -> None

Sets a value for a named key in the config dictionary This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

  1. set(self: metavision_hal.DeviceConfig, key: str, value: float) -> None

Sets a value for a named key in the config dictionary This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

set_format(self: metavision_hal.DeviceConfig, format: str) None

Sets the event format.

format

String representing event format to set

class metavision_hal.DeviceConfigOption(*args, **kwargs)

Class representing options allowed for a device configuration entry.

For each key available in a DeviceConfig as reported by DeviceDiscovery::list_device_config_options””, there is a corresponding option listing the type and accepted values when opening the Device via DeviceDiscovery::open It is composed of a type (boolean, numeric or string) and a set of accepted values

note

The DeviceConfig class is string based to keep its usage simple and generic, whereas this class represent a type and optional range/set of values. The added information can be useful to guide the user when presenting the options that are available, but ultimately the value set for a specific key will be a string, so care must be taken when converting the value before calling one of the functions to set a (key,value) pair in the DeviceConfig

see

DeviceConfig

Overloaded function.

  1. __init__(self: metavision_hal.DeviceConfigOption) -> None

  2. __init__(self: metavision_hal.DeviceConfigOption, arg0: bool) -> None

  3. __init__(self: metavision_hal.DeviceConfigOption, arg0: int, arg1: int, arg2: int) -> None

  4. __init__(self: metavision_hal.DeviceConfigOption, arg0: float, arg1: float, arg2: float) -> None

  5. __init__(self: metavision_hal.DeviceConfigOption, arg0: list[str], arg1: str) -> None

  6. __init__(self: metavision_hal.DeviceConfigOption, arg0: metavision_hal.DeviceConfigOption) -> None

class Type(self: metavision_hal.DeviceConfigOption.Type, value: int) None

Members:

INVALID

BOOLEAN

INT

DOUBLE

STRING

property name
get_default_value(self: metavision_hal.DeviceConfigOption) object

Gets the set of accepted values.

return

The default value

get_range(self: metavision_hal.DeviceConfigOption) object

Gets the range of accepted values.

return

The range of accepted values for options representing a numeric type (Int or Double)

get_values(self: metavision_hal.DeviceConfigOption) list[str]

Gets the set of accepted values.

return

The set of accepted values for options representing a string type

type(self: metavision_hal.DeviceConfigOption) metavision_hal.DeviceConfigOption.Type

Gets the type of this class.

return

The type that is represented by this class

class metavision_hal.DeviceDiscovery

Discovery of connected device.

static list() list[str]

Lists serial numbers of available sources, including remote cameras.

static list_available_sources() list[Metavision::CameraDescription]

Lists available sources, including remote cameras.

static list_available_sources_local() list[Metavision::CameraDescription]

Lists only local available sources.

note

A source is considered local if we communicate directly with it.

static list_available_sources_remote() list[Metavision::CameraDescription]

Lists only remote available sources.

note

A source is considered remote if it is part of another SoC and hence communication is indirect.

static list_device_config_options(serial: str) dict[str, Metavision::DeviceConfigOption]

Lists DeviceConfig options supported by the camera.

serial

Serial number of the camera which options’ should be listed. If it is an empty string, the first available camera will be considered

return

A map of (key,option) that represent the DeviceConfig options

static list_local() list[str]

Lists serial numbers of local available sources.

note

A camera is considered local if we communicate directly with it.

static list_remote() list[str]

Lists serial numbers of remote available sources.

note

A camera is considered remote if it is part of another SoC and hence communication is indirect.

static open(*args, **kwargs)

Overloaded function.

  1. open(serial: str) -> Metavision::Device

Builds a new Device.

serial

Serial number of the camera to open. If it is an empty string, the first available camera will be opened

return

A new Device

  1. open(serial: str, config: Metavision::DeviceConfig) -> Metavision::Device

Builds a new Device.

serial

Serial number of the camera to open. If it is an empty string, the first available camera will be opened

config

Configuration used to build the camera

return

A new Device

static open_raw_file(*args, **kwargs)

Overloaded function.

  1. open_raw_file(raw_file: os.PathLike) -> Metavision::Device

Builds a new Device from file.

raw_file

Path to the file to open

return

A new Device

  1. open_raw_file(raw_file: os.PathLike, file_config: Metavision::RawFileConfig) -> Metavision::Device

Builds a new Device from file.

raw_file

Path to the file to open

file_config

Configuration describing how to read the file (see RawFileConfig)

return

A new Device

class metavision_hal.I_AntiFlickerModule

Anti-flicker module.

class AntiFlickerMode(self: metavision_hal.I_AntiFlickerModule.AntiFlickerMode, value: int) None

Members:

BandStop

BandPass

property name
enable(self: metavision_hal.I_AntiFlickerModule, b: bool) bool

Toggles Anti-flicker activation.

b

Desired state. b = true means Anti-flicker active, and b = false means Anti-flicker inactive.

note

When Anti-flicker is inactive, all the events generated by the sensor are transmitted. Potential bandwidth limitation might occur.

return

true on success

get_band_high_frequency(self: metavision_hal.I_AntiFlickerModule) int

Gets highest frequency of the band.

get_band_low_frequency(self: metavision_hal.I_AntiFlickerModule) int

Gets lowest frequency of the band.

get_duty_cycle(self: metavision_hal.I_AntiFlickerModule) float

Gets the duty cycle for Antiflicker filter.

return

The duty cycle for Antiflicker filter as a percentage

get_filtering_mode(self: metavision_hal.I_AntiFlickerModule) Metavision::I_AntiFlickerModule::AntiFlickerMode

Gets filtering mode.

get_frequency_band(self: metavision_hal.I_AntiFlickerModule) tuple[int, int]

Gets frequency band setting.

get_max_supported_duty_cycle(self: metavision_hal.I_AntiFlickerModule) float

Gets maximum supported duty cycle value.

get_max_supported_frequency(self: metavision_hal.I_AntiFlickerModule) int

Gets maximum supported frequency.

get_max_supported_start_threshold(self: metavision_hal.I_AntiFlickerModule) int

Gets the Antiflicker start threshold maximum supported value.

return

Start threshold maximum supported value

get_max_supported_stop_threshold(self: metavision_hal.I_AntiFlickerModule) int

Gets the Antiflicker stop threshold maximum supported value.

return

Stop threshold maximum supported value

get_min_supported_duty_cycle(self: metavision_hal.I_AntiFlickerModule) float

Gets minimum supported duty cycle value.

get_min_supported_frequency(self: metavision_hal.I_AntiFlickerModule) int

Gets minimum supported frequency.

get_min_supported_start_threshold(self: metavision_hal.I_AntiFlickerModule) int

Gets the Antiflicker start threshold minimum supported value.

return

Start threshold minimum supported value

get_min_supported_stop_threshold(self: metavision_hal.I_AntiFlickerModule) int

Gets the Antiflicker stop threshold minimum supported value.

return

Stop threshold minimum supported value

get_start_threshold(self: metavision_hal.I_AntiFlickerModule) int

Gets the Antiflicker start threshold.

return

The threshold in number of bursts

get_stop_threshold(self: metavision_hal.I_AntiFlickerModule) int

Gets the Antiflicker stop threshold.

return

The threshold in number of bursts

is_enabled(self: metavision_hal.I_AntiFlickerModule) bool

Returns Anti-flicker activation state.

return

The Anti-flicker state

set_duty_cycle(self: metavision_hal.I_AntiFlickerModule, percent_activity: float) bool

Sets the duty cycle for Antiflicker filter.

duty_cycle

Target duty cycle of Antiflicker filter as a percentage

return

true on success, false otherwise

set_filtering_mode(self: metavision_hal.I_AntiFlickerModule, arg0: Metavision::I_AntiFlickerModule::AntiFlickerMode) bool

Sets the anti-flicker filtering mode.

mode

Anti-flicker mode

note

Facility might be reset if parameter is changed while enabled

return

true on success

set_frequency_band(self: metavision_hal.I_AntiFlickerModule, min_freq: int, max_freq: int) bool

Sets anti-flicker parameters.

Defines the frequency band to be kept or removed in the range [min_supported_freq, max_supported_freq] Hz where minimum and maximum supported frequencies can be obtained with get_min_supported_frequency

low_freq

Lowest frequency of the band (in Hz)

high_freq

Highest frequency of the band (in Hz)

note

Facility might be reset if parameter is changed while enabled :exception: if frequencies are outside of the range [min_supported_freq, max_supported_freq] Hz

return

true on success

set_start_threshold(self: metavision_hal.I_AntiFlickerModule, threshold: int) bool

Sets the threshold above which Antiflicker should start filtering.

threshold

Number of successive periodic event bursts falling within the frequency band

return

true on success, false otherwise

set_stop_threshold(self: metavision_hal.I_AntiFlickerModule, threshold: int) bool

Sets the threshold below which Antiflicker should stop filtering.

threshold

Number of successive periodic event bursts falling within the frequency band

return

true on success, false otherwise

class metavision_hal.I_CameraSynchronization

Facility that controls the camera mode (standalone, master or slave)

get_mode(self: metavision_hal.I_CameraSynchronization) Metavision::I_CameraSynchronization::SyncMode

Retrieves Synchronization mode.

return

synchronization mode

set_mode_master(self: metavision_hal.I_CameraSynchronization) bool

Sets the camera as master.

The camera sends clock signal to another device

warning

This function must be called before starting the camera

return

true on success

set_mode_slave(self: metavision_hal.I_CameraSynchronization) bool

Sets the camera as slave.

The camera receives the clock from another device

warning

This function must be called before starting the camera

return

true on success

set_mode_standalone(self: metavision_hal.I_CameraSynchronization) bool

Sets the camera in standalone mode.

The camera does not interact with other devices.

warning

This function must be called before starting the camera

return

true on success

class metavision_hal.I_Decoder

Interface for decoding a stream of events.

This class is meant to receive raw data from the camera, and dispatch parts of the buffer to instances of I_EventDecoder for specific event types.

add_time_callback(self: metavision_hal.I_Decoder, cb: object) None

Adds a function that will be called from time to time, giving current timestamp.

cb

Callback to add

return

ID of the added callback

note

This method is not thread safe. You should add/remove the various callback before starting the streaming

note

It’s not allowed to add/remove a callback from the callback itself

decode(*args, **kwargs)

Overloaded function.

  1. decode(self: metavision_hal.I_Decoder, arg0: object) -> None

Decodes raw data. Identifies the events in the buffer and dispatches it to the instance Event Decoder corresponding to each event type

Parameters

RawData – Numpy array of Events

  1. decode(self: metavision_hal.I_Decoder, RawData: std::vector<unsigned char, std::allocator<unsigned char> >) -> None

Decodes raw data. Identifies the events in the buffer and dispatches it to the instance Event Decoder corresponding to each event type

Parameters

RawData – Array of events

get_last_timestamp(self: metavision_hal.I_Decoder) int

Gets the timestamp of the last event.

return

Timestamp of the last event

remove_callback(self: metavision_hal.I_Decoder, callback_id: int) bool

Removes a previously registered time callback.

callback_id

Callback ID

return

true if the callback has been unregistered correctly, false otherwise.

note

This method is not thread safe. You should add/remove the various callback before starting the streaming

class metavision_hal.I_DigitalCrop

Digital Crop feature All pixels outside of the cropping region will be dropped by the sensor.

enable(self: metavision_hal.I_DigitalCrop, arg0: bool) bool

Applies Digital Crop.

state

If true, enables Digital Crop. If false, disables it

return

true on success

get_window_region(self: metavision_hal.I_DigitalCrop) tuple[int, int, int, int]

Gets the digital crop window region currently defined.

return

digital crop window region currently defined

is_enabled(self: metavision_hal.I_DigitalCrop) bool

Returns Digital Crop activation state.

return

The Digital Crop state

set_window_region(self: metavision_hal.I_DigitalCrop, arg0: tuple[int, int, int, int], arg1: bool) bool

Defines digital crop window region.

region

The region of pixels that should be cropped

reset_origin

If true, the origin of the event output coordinates will shift to the Crop Window start

warning

When reset_origin is true, start_x must be a multiple of 32 and end_x a multiple of 31, if not then the function will fail and return false.

return

true on success

class metavision_hal.I_DigitalEventMask

Interface for Digital Event Mask commands.

get_pixel_masks(self: metavision_hal.I_DigitalEventMask) list[Metavision::I_DigitalEventMask::I_PixelMask]

Get all available masks.

return

a list of pixel masks pointer

class metavision_hal.I_ErcModule

Interface for Event Rate Controller (ERC) commands.

enable(self: metavision_hal.I_ErcModule, b: bool) bool

Toggles ERC activation.

b

Desired state. b = true means ERC active, and b = false means ERC inactive.

note

When ERC is inactive, all the events generated by the sensor are transmitted. Potential bandwidth limitation might occur.

return

true on success

get_cd_event_count(self: metavision_hal.I_ErcModule) int

Gets the maximum number of events that ERC will transmit over the count period.

return

The maximum event count

note

See set_cd_event_count to define the event count parameter.

get_cd_event_rate(self: metavision_hal.I_ErcModule) int

Gets the CD event rate set point of the ERC.

return

The event rate expressed in events per second

note

See set_cd_event_rate to define the event rate target.

get_count_period(self: metavision_hal.I_ErcModule) int

Gets the count period.

return

The count period duration expressed in microseconds

get_max_supported_cd_event_count(self: metavision_hal.I_ErcModule) int

Gets the maximum supported value for cd_event_count setting.

get_max_supported_cd_event_rate(self: metavision_hal.I_ErcModule) int

Gets the maximum supported value for cd_event_rate setting.

get_min_supported_cd_event_count(self: metavision_hal.I_ErcModule) int

Gets the minimum supported value for cd_event_count setting.

get_min_supported_cd_event_rate(self: metavision_hal.I_ErcModule) int

Gets the minimum supported value for cd_event_rate setting.

is_enabled(self: metavision_hal.I_ErcModule) bool

Returns ERC activation state.

return

The ERC state

set_cd_event_count(self: metavision_hal.I_ErcModule, event_count: int) bool

Sets the maximum number of events that ERC block should let pass over the count period.

event_count

The desired maximum number of event per reference period

note

If you wish to parameterize the ERC with a set point expressed with an event rate use set_cd_event_rate instead. The 2 methods operate on the same register and conversions are managed automatically.

return

true on success

set_cd_event_rate(self: metavision_hal.I_ErcModule, events_per_sec: int) bool

Sets the target CD event rate of the ERC.

events_per_sec

Event rate expressed in events per second

note

Event rate is computed by ERC block as the number of events generated by the sensor divided by the count period. To get the count period value, see get_count_period.

note

This method and set_cd_event_count operate over the same register. It is Expected that after parameterizing ERC using event rate, result of get_cd_event_count also changes.

return

true on success

class metavision_hal.I_EventRateActivityFilterModule

Interface for accessing the sensor event rate activity filter.

This sensor level filter is based on the event rate only. If enabled, the sensor will transfer data if and only if the event rate is above a given event rate and below a given event rate. It avoids streaming background noise information without relevant activity and streaming high event rate flashing scenes, saving bandwidth and power.

enable(self: metavision_hal.I_EventRateActivityFilterModule, enable_filter: bool) bool

Enables/disables the event rate activity filter.

enable_filter

Whether to enable the filter

get_max_supported_thresholds(self: metavision_hal.I_EventRateActivityFilterModule) Metavision::I_EventRateActivityFilterModule::thresholds

Gets band pass filter hysteresis maximum thresholds configuration.

return

thresholds event rate thresholds structure.

get_min_supported_thresholds(self: metavision_hal.I_EventRateActivityFilterModule) Metavision::I_EventRateActivityFilterModule::thresholds

Gets band pass filter hysteresis minimum thresholds configuration.

return

thresholds event rate thresholds structure.

get_thresholds(self: metavision_hal.I_EventRateActivityFilterModule) Metavision::I_EventRateActivityFilterModule::thresholds

Gets band pass filter hysteresis thresholds.

return

thresholds event rate thresholds structure.

is_enabled(self: metavision_hal.I_EventRateActivityFilterModule) bool

Returns the event rate activity filter state.

return

the filter state

is_thresholds_supported(self: metavision_hal.I_EventRateActivityFilterModule) Metavision::I_EventRateActivityFilterModule::thresholds

Gets band pass filter hysteresis thresholds supported by the sensor.

return

thresholds thresholds structure with values 0/1 depending if corresponding threshold is supported.

set_thresholds(self: metavision_hal.I_EventRateActivityFilterModule, threshold_ev_s: Metavision::I_EventRateActivityFilterModule::thresholds) bool

Sets band pass filter hysteresis thresholds.

thresholds_ev_s

Event rate thresholds data structure in evt/s

warning

Partially initialize structure thresholds_ev_s could lead to random threshold values being set. Use is_thresholds_supported function to know which threshold values could be omitted.

return

true if the input value was correctly set (i.e. it falls in the range of acceptable values for the sensor)

class thresholds

Band pass filter hysteresis thresholds for event rate activity filter.

Note

Not all thresholds are supported given the sensor generation :lower_bound_start: Event rate threshold for the band pass filter to start filtering incoming events. Below this threshold, no events are streamed.

Lower_bound_stop

Event rate threshold for the band pass filter to stop filtering and resume streaming of incoming events. Above this threshold, events are streamed again after the filter was actively dropping events using the lower_bound_start threshold condition.

Upper_bound_start

Event rate threshold for the band pass filter to start filtering incoming events. Above this threshold, no events are streamed.

Upper_bound_stop

Event rate threshold for the band pass filter to stop filtering and resume streaming of incoming events. Below this threshold, events are streamed again after the filter was actively dropping events using the upper_bound_start threshold condition.

class metavision_hal.I_EventTrailFilterModule

Noise filter module.

class Type(self: metavision_hal.I_EventTrailFilterModule.Type, value: int) None

Members:

TRAIL

STC_CUT_TRAIL

STC_KEEP_TRAIL

property name
enable(self: metavision_hal.I_EventTrailFilterModule, state: bool) bool

Enables the EventTrailFilterModule with previously configured settings. Filtering type and threshold should be set before enabling.

state

If true, enables the module. If false, disables it

return

true on success

get_available_types(self: metavision_hal.I_EventTrailFilterModule) set[metavision_hal.I_EventTrailFilterModule.Type]

Returns the set of available types of filters.

return

set of available types of filters

get_max_supported_threshold(self: metavision_hal.I_EventTrailFilterModule) int

Gets the maximum supported value for event trail filtering threshold delay (in microseconds)

return

The maximum supported threshold value

get_min_supported_threshold(self: metavision_hal.I_EventTrailFilterModule) int

Gets the minimum supported value for event trail filtering threshold delay (in microseconds)

return

The minimum supported threshold value

get_threshold(self: metavision_hal.I_EventTrailFilterModule) int

Gets the event trail filtering threshold delay (in microseconds)

return

The event trail filtering threshold

get_type(self: metavision_hal.I_EventTrailFilterModule) metavision_hal.I_EventTrailFilterModule.Type

Gets the event trail filtering type.

return

The event trail filtering type

is_enabled(self: metavision_hal.I_EventTrailFilterModule) bool

Returns EventTrailFilterModule activation state.

return

The EventTrailFilterModule state

set_threshold(self: metavision_hal.I_EventTrailFilterModule, threshold: int) bool

Sets the event trail filtering threshold delay.

threshold

Delay (in microseconds) between two bursts of events

note

Facility might be reset if parameter is changed while enabled

return

true on success

set_type(self: metavision_hal.I_EventTrailFilterModule, type: metavision_hal.I_EventTrailFilterModule.Type) bool

Sets the event trail filtering type.

note

Facility might be reset if parameter is changed while enabled

return

true on success

class metavision_hal.I_EventsStream

Class for getting buffers from cameras or files.

get_latest_raw_data(self: metavision_hal.I_EventsStream) Metavision::DataTransfer::BufferPtr

Gets latest raw data from the event buffer.

Gets raw data from the event buffer received since the last time this function was called.

return

Pointer to a vector of Event structures

note

This function must be called to write the buffer of events in the log file defined in log_raw_data

log_raw_data(self: metavision_hal.I_EventsStream, f: str) bool

Enables the logging of the stream of events in the input file f.

This methods first writes the header retrieved through I_HW_Identification. Buffers of data are then written each time get_latest_raw_data is called (i.e. in the same thread it is called).

f

The file to log into

return

true if the file could be opened for writing, false otherwise or if the file name f is the same as the one read from

warning

The writing of each buffer of event will have to be triggered by calls to get_latest_raw_data

poll_buffer(self: metavision_hal.I_EventsStream) int

Returns a value that informs if some events are available in the buffer from the camera or the file.

return

Value that informs if some events are available in the buffer - 1 if there are events available - 0 if no events are available - -1 if an error occurred or no more events will ever be available (like when reaching end of file)

start(self: metavision_hal.I_EventsStream) None

Starts streaming events.

stop(self: metavision_hal.I_EventsStream) None

Stops streaming events.

stop_log_raw_data(self: metavision_hal.I_EventsStream) None

Stops logging RAW data.

Does nothing if no recording has been started

wait_next_buffer(self: metavision_hal.I_EventsStream) int

Returns a value that informs if some events are available in the buffer from the camera and blocks waiting until more events are available.

return

Value that informs if some events are available in the buffer - 1 if there are events available - -1 if an error occurred or no more events will ever be available (like when reaching end of file)

class metavision_hal.I_Geometry

Class to access information on the size of the sensor.

get_height(self: metavision_hal.I_Geometry) int

Returns height of the sensor in pixels.

return

Sensor’s height

get_width(self: metavision_hal.I_Geometry) int

Returns width of the sensor in pixels.

return

Sensor’s width

class metavision_hal.I_HALSoftwareInfo

Class that provides information about the HAL software.

get_software_info(self: metavision_hal.I_HALSoftwareInfo) metavision_sdk_base.SoftwareInfo

Gets plugin’s software information.

return

The plugin’s software information

class metavision_hal.I_HW_Identification

Facility to provide information about the available system.

get_available_data_encoding_formats(self: metavision_hal.I_HW_Identification) list[str]

Returns the name of the available data encoding formats.

return

The available data encoding formats

note

Currently the available formats are: - EVT2 - EVT21 - EVT3

get_connection_type(self: metavision_hal.I_HW_Identification) str

Returns the connection with the camera as a string.

return

A string providing the type of connection with the available camera

get_current_data_encoding_format(self: metavision_hal.I_HW_Identification) str

Returns the name of the currently used data encoding format.

return

The currently used data encoding format

see

get_available_data_encoding_formats

get_device_config_options(self: metavision_hal.I_HW_Identification) dict[str, Metavision::DeviceConfigOption]

Lists device config options supported by the camera.

return

the map of (key,option) device config options

get_header(self: metavision_hal.I_HW_Identification) Metavision::RawFileHeader

Returns a header that can be used to log a RAW file.

return

A header that contains information compatible with this system

get_integrator(self: metavision_hal.I_HW_Identification) str

Returns the integrator name.

return

Name of the integrator

get_sensor_info(self: metavision_hal.I_HW_Identification) Metavision::I_HW_Identification::SensorInfo

Returns the detail about the available sensor.

return

The sensor information

get_serial(self: metavision_hal.I_HW_Identification) str

Returns the serial number of the camera.

return

Serial number as a string

get_system_info(self: metavision_hal.I_HW_Identification) dict

Returns all available information.

return

Map of key-value

note

The purpose of this function is mainly for debug and display system information The class provides a basic implementation that can be enriched by inherit class

class metavision_hal.I_HW_Register

Interface facility for writing/reading hardware registers.

read_register(*args, **kwargs)

Overloaded function.

  1. read_register(self: metavision_hal.I_HW_Register, address: int) -> int

Reads register.

address

Address of the register to read

return

Value read

  1. read_register(self: metavision_hal.I_HW_Register, address: str) -> int

Reads register.

address

Address of the register to read

return

Value read

  1. read_register(self: metavision_hal.I_HW_Register, address: str, bitfield: str) -> int

Reads register.

address

Address of the register to read

bitfield

Bit field of the register to read

return

Value read

write_register(*args, **kwargs)

Overloaded function.

  1. write_register(self: metavision_hal.I_HW_Register, address: int, v: int) -> None

Writes register.

address

Address of the register to write

v

Value to write

  1. write_register(self: metavision_hal.I_HW_Register, address: str, v: int) -> None

Writes register.

address

Address of the register to write

v

Value to write

  1. write_register(self: metavision_hal.I_HW_Register, address: str, bitfield: str, v: int) -> None

Writes register.

address

Address of the register to write

bitfield

Bit field of the register to write

v

Value to write

class metavision_hal.I_LL_Biases

Interface facility for Low Level Biases.

get(self: metavision_hal.I_LL_Biases, bias_name: str) int

Gets bias value.

bias_name

Name of the bias whose value to get

return

The bias value

get_all_biases(self: metavision_hal.I_LL_Biases) dict

Gets all biases values.

return

A map containing the biases values

get_bias_info(self: metavision_hal.I_LL_Biases, bias_name: str) Metavision::LL_Bias_Info

Gets bias metadata.

bias_name

Name of the bias whose metadata to get

return

Metadata of the bias

set(self: metavision_hal.I_LL_Biases, bias_name: str, bias_value: int) bool

Sets bias value.

bias_name

Bias to set

bias_value

Value to set the bias to

return

true on success

class metavision_hal.I_Monitoring

Interface facility to monitor sensor parameters (such as temperature and illumination)

get_illumination(self: metavision_hal.I_Monitoring) int

Gets illumination.

return

Sensor’s illumination (in lux) or throw on Error

get_pixel_dead_time(self: metavision_hal.I_Monitoring) int

Gets Pixel Dead Time (aka. "refractory period"). This is the minimum time latency between the generation of 2 events by a pixel.

return

Estimated dead time (in us) throw on Error

get_temperature(self: metavision_hal.I_Monitoring) int

Gets temperature.

return

Sensor’s temperature (in C) or throw on Error

class metavision_hal.I_PixelMask

Interface for Digital Pixel Mask commands.

Note

Each mask can be associated with a pixel and enabled/disabled on demand

get_mask(self: metavision_hal.I_PixelMask) tuple[int, int, bool]

Get the current mask settings.

return

a tuple that packs the X and Y pixel coordinates and a boolean defining whether the mask is enabled

set_mask(self: metavision_hal.I_PixelMask, arg0: int, arg1: int, arg2: bool) bool

Set coordinate for the pixel to be masked.

x

the pixel horizontal coordinate

y

the pixel vertical coordinate

enabled

when true, the mask will prevent pixel from generating CD event

return

true on success

class metavision_hal.I_PluginSoftwareInfo

Provides information about the Plugin software.

get_plugin_integrator_name(self: metavision_hal.I_PluginSoftwareInfo) str

Gets plugin integrator name.

return

The name of the plugin integrator

get_plugin_name(self: metavision_hal.I_PluginSoftwareInfo) str

Gets plugin name.

return

The plugin name

get_software_info(self: metavision_hal.I_PluginSoftwareInfo) metavision_sdk_base.SoftwareInfo

Gets HAL’s software information.

return

HAL’s software information

class metavision_hal.I_ROI

Interface facility for ROI (Region Of Interest)

class Mode(self: metavision_hal.I_ROI.Mode, value: int) None

Members:

ROI

RONI

property name
class Window(*args, **kwargs)

Defines a simple rectangular window.

Overloaded function.

  1. __init__(self: metavision_hal.I_ROI.Window, arg0: metavision_hal.I_ROI.Window) -> None

  2. __init__(self: metavision_hal.I_ROI.Window, arg0: int, arg1: int, arg2: int, arg3: int) -> None

Creates a window defined by the corners {(x, y), (x + width, y + height)}.

to_string(self: metavision_hal.I_ROI.Window) str

Returns the window as a string.

return

Human readable string representation of a window

enable(self: metavision_hal.I_ROI, enable: bool) bool

Applies ROI.

state

If true, enables ROI. If false, disables it

warning

At least one ROI should have been set before calling this function

return

true on success

get_max_supported_windows_count(self: metavision_hal.I_ROI) int

Gets the maximum number of windows.

return

the maximum number of windows that can be set via set_windows

set_lines(self: metavision_hal.I_ROI, cols: list, rows: list) None
set_mode(self: metavision_hal.I_ROI, mode: Metavision::I_ROI::Mode) bool

Sets the window mode.

mode

window mode to set (ROI or RONI)

return

true on success

set_window(self: metavision_hal.I_ROI, roi: Metavision::I_ROI::Window) bool

Sets a window.

The window will be applied according to the current mode (ROI or RONI) :window: window to set

return

true on success

set_windows(self: metavision_hal.I_ROI, roi_list: list) None
class metavision_hal.I_RoiPixelMask

Interface facility for ROI (Region Of Interest) pixel mask.

apply_pixels(self: metavision_hal.I_RoiPixelMask) None

Apply pixels configuration to sensor Pixels selected to be masked with the set_pixel function are applied to the sensor hardware.

set_pixel(self: metavision_hal.I_RoiPixelMask, arg0: int, arg1: int, arg2: bool) bool

Set individual pixel ROI mask The pixel coordinates are stored in the driver and will be sent to the sensor when apply_pixels function is called.

column

Pixel x coordinate

row

Pixel y coordinate

enable

Pixel will be masked when true

return

true on success

class metavision_hal.I_TriggerIn

Interface to handle external trigger signals.

class Channel(self: metavision_hal.I_TriggerIn.Channel, value: int) None

Members:

MAIN

AUX

LOOPBACK

property name
disable(self: metavision_hal.I_TriggerIn, channel: metavision_hal.I_TriggerIn.Channel) bool

Disables external trigger monitoring.

channel

external trigger channel to disable

return

true if external trigger monitoring was successfully disabled, false otherwise

enable(self: metavision_hal.I_TriggerIn, channel: metavision_hal.I_TriggerIn.Channel) bool

Enables external trigger monitoring.

channel

external trigger channel to enable

return

true if external trigger monitoring was successfully enabled, false otherwise

warning

External trigger monitoring is disabled by default on camera start

get_available_channels(self: metavision_hal.I_TriggerIn) dict[metavision_hal.I_TriggerIn.Channel, int]

Returns the map of available channels.

The returned map lists the available channels and gives the mapping between the Channel enum and the numeric value that can be found in the corresponding event id field
see

Metavision::EventExtTrigger

return

a map of available channels

is_enabled(self: metavision_hal.I_TriggerIn, channel: metavision_hal.I_TriggerIn.Channel) bool

Checks if external trigger monitoring is enabled.

channel

external trigger channel to check

return

true if external trigger monitoring is enabled, False otherwise

class metavision_hal.I_TriggerOut

Internal interface for trigger out signal configuration.

Note

The trigger out signal is a binary signal

disable(self: metavision_hal.I_TriggerOut) bool

Disables the trigger out.

enable(self: metavision_hal.I_TriggerOut) bool

Enables the trigger out.

return

true if trigger was successfully enabled, false otherwise

set_duty_cycle(self: metavision_hal.I_TriggerOut, period_ratio: float) bool

Sets the duty cycle of the trigger out signal i.e. the pulse duration.

The duty cycle represents the part of the signal, during which its value is 1 (0 otherwise). Duty cycle represents the quantity pulse_width_us/period_us and thus must be in the range [0, 1]. The period is set with set_period.

Setting a duty cycle of 0.5 (50%) means that the value of the signal is 1 during the first half of each period, and 0 during the second half.

period_ratio

the ratio representing pulse_width_us/period_us which must be in the range [0,1] (value is clamped in this range otherwise)

return

true on success

set_period(self: metavision_hal.I_TriggerOut, period_us: int) bool

Sets the trigger out signal period (in us)

period_us

the period to set (in us)

return

true on success

class metavision_hal.LL_Bias_Info

Base class used to represent Low Level Biases metadata.

get_bias_allowed_range(self: metavision_hal.LL_Bias_Info) tuple[int, int]

Gets the bias’ range of allowed values.

return

A pair representing the [min, max] range of values allowed

get_bias_range(self: metavision_hal.LL_Bias_Info) tuple[int, int]

Gets the bias’ range of valid values.

The range of values returned is by default the recommended one If the DeviceConfig::biases_range_check_bypass option has been enabled via the DeviceConfig when opening the device, the range returned is the allowed one

return

A pair representing the [min, max] range of values supported by the bias

Gets the bias’ range of recommended values.

return

A pair representing the [min, max] range of values recommended

get_category(self: metavision_hal.LL_Bias_Info) str

Gets the bias’ category.

return

bias category string

get_description(self: metavision_hal.LL_Bias_Info) str

Gets the bias’ description.

return

bias description string

is_modifiable(self: metavision_hal.LL_Bias_Info) bool

Gets the bias’ modifiable parameter.

return

True if bias’ value can be modified

class metavision_hal.RawBuffer

Generic Buffer type used by DataTransfer.

BufferPtr is a type erased wrapper around a buffer from a Buffer Pool. It is used to hold a buffer of data that can be transferred by the DataTransfer down the pipeline without having them to know about the underlying buffer implementation.

size(self: metavision_hal.RawBuffer) int

Accessor to the buffer size.

class metavision_hal.RawFileConfig(*args, **kwargs)

RAW files configuration’s options.

Overloaded function.

  1. __init__(self: metavision_hal.RawFileConfig) -> None

  2. __init__(self: metavision_hal.RawFileConfig, arg0: metavision_hal.RawFileConfig) -> None

property build_index

True if indexing should be performed when opening the file Alternatively, indexing can still be requested by calling I_EventsStream::index directly

property do_time_shifting

Take the first timer high of the file as origin of time.

property n_events_to_read

Number of events_byte_size blocks to read. At each read, n_events_to_read_*sizeof(RAW_event) bytes are read. :warning: sizeof(RAW_event) is defined by the events format contained in the RAW file read.

property n_read_buffers

The maximum number of buffers to allocate and use for reading. Each buffer contains at most n_events_to_read_ RAW events. The maximum memory allocated to read the RAW file will be read_buffers_count_ * n_events_to_read_ * sizeof(RAW_event). One can use this parameters to have a finer control on offline memory usage

class metavision_hal.RawFileHeader(*args, **kwargs)

A dedicated class to handle RAW file headers and handle easily their mandatory fields.

Overloaded function.

  1. __init__(self: metavision_hal.RawFileHeader) -> None

  2. __init__(self: metavision_hal.RawFileHeader, arg0: metavision_hal.RawFileHeader) -> None

  3. __init__(self: metavision_hal.RawFileHeader, arg0: dict) -> None

Parameters

dict (dictionary) – a python dictionary holding key value pairs of string types.

get_camera_integrator_name(self: metavision_hal.RawFileHeader) str

Gets the integrator name of the source used to generate the RAW file.

return

Returns the integrator name if any, or an empty string otherwise

get_plugin_integrator_name(self: metavision_hal.RawFileHeader) str

Gets the integrator name of the plugin used to generate the RAW file.

return

Returns the integrator name if any, or an empty string otherwise

get_plugin_name(self: metavision_hal.RawFileHeader) str

Gets the name of the plugin to use to read the RAW file.

return

Returns the name of the plugin if any, or an empty string otherwise

set_camera_integrator_name(self: metavision_hal.RawFileHeader, integrator_name: str) None

Sets the name of the integrator of the source used to generate the RAW file.

integrator_name

Name of the integrator

set_plugin_integrator_name(self: metavision_hal.RawFileHeader, integrator_name: str) None

Sets the name of the integrator of the plugin used to generate the RAW file.

integrator_name

Name of the integrator

set_plugin_name(self: metavision_hal.RawFileHeader, plugin_name: str) None

Sets the name of the plugin to use to read the RAW file.

plugin_name

Name of the plugin

class metavision_hal.SensorInfo

Information about the type of sensor available.

Examples for Gen3.1 Sensor: - major_version = 3 - minor_version = 1

property major_version

Sensor Generation.

property minor_version

Sensor Revision.

property name

Sensor Name.

metavision_hal.get_hal_software_info() metavision_sdk_base.SoftwareInfo
class metavision_hal.ConnectionType(self: metavision_hal.ConnectionType, value: int) None

Members:

MIPI_LINK

USB_LINK

NETWORK_LINK

PROPRIETARY_LINK