SDK Driver Camera Features

class Metavision::AntiFlickerModule

Facility class to handle anti-flicker configuration on the hardware side.

Public Functions

AntiFlickerModule(I_AntiFlickerModule *afk)

Constructor.

~AntiFlickerModule()

Destructor.

void enable()

Enables the anti-flicker filter.

void disable()

Disables the anti-flicker filter.

void set_frequency(uint32_t frequency_center, uint32_t bandwidth, bool stop = true)

Sets anti-flicker parameters.

Defines the frequency band to be kept or removed : [frequency_center - bandwidth/2, frequency_center + bandwidth/2] This frequency range should be in the range [50 - 500] Hz

Note

: band-stop removes all frequencies between min and max band-pass removes all events outside of the band sequence defined

Parameters
  • frequency_center: Center of the frequency band (in Hz)

  • bandwidth: Range of frequencies around the frequency_center (in Hz)

  • stop: If true, band-stop (by default); if false, band-pass

Exceptions
  • runtime: exception if frequency band is not in the range [50 - 500] Hz

void set_frequency_band(uint32_t min_freq, uint32_t max_freq, bool stop = true)

Sets anti-flicker parameters.

Defines the frequency band to be kept or removed in the range [50 - 500] Hz

Note

: band-stop removes all frequencies between min and max band-pass removes all events outside of the band sequence defined

Parameters
  • min_freq: Lower frequency of the band (in Hz)

  • max_freq: Higher frequency of the band (in Hz)

  • stop: If true, band-stop; if false, band-pass

Exceptions
  • runtime: exception if frequencies are outside of the range [50 - 500] Hz

I_AntiFlickerModule *get_facility() const

Gets corresponding facility in HAL library.

class Metavision::Biases

Facility class to handle biases.

Public Functions

Biases(I_LL_Biases *i_ll_biases)

Constructor.

~Biases()

Destructor.

void set_from_file(const std::string &biases_filename)

Sets camera biases from a bias file at biases_filename.

Throws CameraException in case of failure. This could happen for example if given path does not exists.

Parameters
  • biases_filename: Path to the bias file used to configure the camera

void save_to_file(const std::string &dest_file) const

Save the current biases into a file.

Parameters
  • dest_file: the destination file

std::string get_current_biases_file_path() const

Note

This method is deprecated since version 2.1.0 and will be removed in next releases

I_LL_Biases *get_facility() const

Get corresponding facility in HAL library.

enum Metavision::CameraErrorCode

Enum that holds camera error codes for Camera Exception.

See

CameraException

Values:

enumerator CameraError = 0x100000

Base Metavision SDK Driver camera error.

enumerator FailedInitialization = CameraError | 0x01000

Camera failed initialization.

enumerator CameraNotFound = FailedInitialization | 0x1

Failed initialisation due to a camera not found.

enumerator InternalInitializationError = FailedInitialization | 0x100

Metavision SDK Driver Internal Initialization problem.

enumerator RuntimeError = CameraError | 0x02000

Camera runtime errors.

enumerator BiasesError = RuntimeError | 0x200

Fails to set biases.

enumerator CameraNotInitialized = RuntimeError | 0x2

Error due to a non initialized camera.

enumerator InvalidRawfile = RuntimeError | 0x3

Invalid RAW file.

enumerator DataTransferFailed = RuntimeError | 0x4

Error while retrieving data from source.

enumerator RoiError = RuntimeError | 0x6

Fails to set ROI.

enumerator UnsupportedFeature = RuntimeError | 0x100

Error while trying to use a feature unsupported by the camera.

enumerator FirmwareIsNotUpToDate = RuntimeError | 0x07

Device firmware is not up to date.

enumerator DeprecatedFeature = RuntimeError | 0x08

Error while trying to use a deprecated feature.

enumerator InvalidArgument = CameraError | 0x03000

Errors related to invalid arguments.

enumerator FileDoesNotExist = InvalidArgument | 0x1

File does not exist.

enumerator NotARegularFile = InvalidArgument | 0x2

File is not a regular file.

enumerator WrongExtension = InvalidArgument | 0x3

File extension is not the one expected.

enumerator CouldNotOpenFile = InvalidArgument | 0x4

Could not open file.

class Metavision::CameraException : public std::system_error

Class for all exceptions thrown by Metavision SDK Driver.

See

http://www.cplusplus.com/reference/system_error/system_error/

See

http://en.cppreference.com/w/cpp/error/error_code

Public Functions

CameraException(CameraErrorCodeType e)

Creates an exception of type e with default error message.

See

CameraErrorCode

Parameters
  • e: Camera error code

CameraException(CameraErrorCodeType e, std::string additional_info)

Creates an exception of type e with an error description in additional_info.

See

CameraErrorCode

Parameters
  • e: Camera error code

  • additional_info: error description

class Metavision::CameraGeneration

Facility class to handle camera generation.

Public Types

enum Type

Values:

enumerator CD
enumerator EM

Public Functions

~CameraGeneration()

Destructor.

Deletes a CameraGeneration class instance.

short version_major() const

Returns the major version of the camera’s generation.

short version_minor() const

Returns the minor version of the camera’s generation.

Type type() const

bool operator==(const CameraGeneration &c) const

overrides “equal to” operator

bool operator!=(const CameraGeneration &c) const

overrides “not equal to” operator

bool operator<(const CameraGeneration &c) const

overrides “less than” operator

bool operator<=(const CameraGeneration &c) const

overrides “less than or equal to” operator

bool operator>(const CameraGeneration &c) const

overrides “greater than” operator

bool operator>=(const CameraGeneration &c) const

overrides “greater than or equal to” operator

Private &get_pimpl()

For internal use.

class Metavision::CD

Facility class to handle CD events.

Public Functions

~CD()

Destructor.

Deletes a CD class instance.

CallbackId add_callback(const EventsCDCallback &cb)

Subscribes to CD events.

Registers a callback that will be called each time a buffer of eventCD has been decoded.

See

EventsCDCallback

Return

ID of the added callback

Parameters
  • cb: Callback to call each time a buffer of eventCD has been decoded

bool remove_callback(CallbackId callback_id)

Removes a previously registered callback.

Return

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

See

add_callback

Parameters
  • callback_id: Callback ID

Private &get_pimpl()

For internal use.

class Metavision::ExtTrigger

Facility class to handle External Triggers events.

Public Functions

~ExtTrigger()

Destructor.

Deletes a ExtTrigger class instance.

CallbackId add_callback(const EventsExtTriggerCallback &cb)

Subscribes to external trigger events.

Registers a callback that will be called each time a buffer of external trigger event has been decoded.

See

EventsExtTriggerCallback

Return

ID of the added callback

Parameters
  • cb: Callback to call each time a buffer of ext trigger event has been decoded

bool remove_callback(CallbackId callback_id)

Removes a previously registered callback.

Return

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

See

add_callback

Parameters
  • callback_id: Callback ID

Private &get_pimpl()

For internal use.

class Metavision::Geometry

Facility class to get the geometry of a Device.

Public Functions

Geometry(I_Geometry *geom)

Constructor.

~Geometry()

Destructor.

int width() const

Width of the sensor.

int height() const

Height of the sensor.

I_Geometry *get_facility() const

Get corresponding facility in HAL library.

class Metavision::IlluminanceModule

Facility class to handle the Illuminance module Allows enabling the illumination sensor in order to receive EventIlluminance events.

Note

This class is deprecated since version 2.1.0 and will be removed in next releases

Public Functions

~IlluminanceModule()

Destructor.

void enable()

Enables illuminance monitoring.

class Metavision::ImuModule

Facility class to handle IMUs.

Note

This class is deprecated since version 2.1.0 and will be removed in next releases

Public Functions

~ImuModule()

Destructor.

void enable()

Enables imu.

void disable()

Disables imu.

class Metavision::NoiseFilterModule

Facility class to handle noise filter module configuration on the hardware side.

The types of noise filter are Spatio-Temporal Contrast (STC) and Trail.

Public Functions

NoiseFilterModule(I_NoiseFilterModule *noise_filter)

Constructor.

~NoiseFilterModule()

Destructor.

void enable(I_NoiseFilterModule::Type type, uint32_t threshold)

Enables the NoiseFilterModule in the mode STC or Trail with the corresponding threshold.

Note

STC keeps the second event within a burst of events with the same polarity Trail keeps the first event within a burst of events with the same polarity

Parameters
  • type: Defines the type of the filter

  • threshold: Delay in microsecond between two bursts of events

void disable()

Disables filtering.

No events are removed by this filter anymore.

I_NoiseFilterModule *get_facility() const

Gets corresponding facility in HAL library.

class Metavision::RawData

Facility class to handle RAW data.

Public Functions

~RawData()

Destructor.

Deletes a RawData class instance.

CallbackId add_callback(const RawDataCallback &cb)

Subscribes to RAW data callback.

Registers a callback that will be called each time a buffer of RAW data has been received.

See

RawDataCallback

Return

ID of the added callback

Parameters
  • cb: Callback to call each time a buffer of RAW data has been received

bool remove_callback(CallbackId callback_id)

Removes a previously registered callback.

Return

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

See

add_callback

Parameters
  • callback_id: Callback ID

Private &get_pimpl()

For internal use.

class Metavision::Roi

Facility class to handle ROIs.

Public Functions

Roi(I_ROI *roi)

Constructor.

~Roi()

Destructor.

void set(Rectangle roi)

Sets an hardware ROI on the sensor.

When an ROI is set successfully, no events will be output by the sensor outside of this ROI. Since this is a hardware ROI, there is no processing added to filter the events. Setting an ROI will unset any previously set ROI.

Parameters
  • roi: The ROI to set on the sensor

void set(const std::vector<bool> &cols_to_enable, const std::vector<bool> &rows_to_enable)

Sets several rectangular hardware ROI from binary maps of lines and columns.

The binary map arguments must have the sensor’s dimension. Throws a CameraException if input doesn’t have the correct size.

Parameters
  • cols_to_enable: vector of boolean of size sensor’s width representing the binary map of the columns to disable (0) or to enable (1)

  • rows_to_enable: vector of boolean of size sensor’s height representing the binary map of the rows to disable (0) or to enable (1)

void set(const std::vector<Rectangle> &to_set)

Sets several rectangular hardware ROI from Roi::Rectangle vector.

Any line or column enabled by a single ROI is also enabled for all the other. Example: Input vector is composed with 2 rois (0, 0, 50, 50), (100, 100, 50, 50). In the sensor, it will result in 4 regions as follow

  • (0, 0, 50, 50)

  • (0, 100, 50, 50)

  • (100, 0, 50, 50)

  • (100, 100, 50, 50) Indeed, rows and columns from 0 to 50 and 100 to 150 are enabled.

Example: Input vector is composed with 2 ROIs: (0, 0, 50, 50), (25, 25, 50, 50). In the sensor, it will result in 1 region as follow

  • (0, 0, 75, 75)

Parameters

void unset()

Unsets any set ROI on the sensor.

I_ROI *get_facility() const

Gets corresponding facility in HAL library.

struct Rectangle

Basic struct used to set a hardware region of interest (ROI) - a rectangle - on the sensor.

This struct defines an ROI of with*height pixels going from [x, y] to [x + width -1, y + height -1]

Public Members

int x = 0

the ROI top left column coordinate of the ROI

int y = 0

the ROI top left row coordinate of the ROI

int width = 0

the width of the ROI

int height = 0

the height of the ROI

class Metavision::TemperatureModule

Facility class to handle the Temperature module Allows enabling the temperature sensor in order to receive EventTemperature events.

Note

This class is deprecated since version 2.1.0 and will be removed in next releases

Public Functions

~TemperatureModule()

Destructor.

void enable()

Enables temperature monitoring.

void disable()

Disables temperature monitoring.

float get_temperature(int source)

Returns the temperature.

class Metavision::TriggerOut

Trigger out signal handler class.

The trigger out is a signal generator. Its purpose is to synchronize two (or more) devices.

The configurable signal through this interface is a periodic 1 microsecond pulse.

Public Functions

TriggerOut(I_TriggerOut *i_trigger_out)

Constructor.

~TriggerOut()

Destructor.

void set_pulse_period(uint32_t period_us)

Sets the trigger out signal pulse period.

By default, the system has a period of 100 us meaning that, when enabled, a pulse of 1 microsecond will occur every 100us.

Parameters
  • period_us: the signal period in microseconds.

void set_duty_cycle(double period_ratio)

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 \(@frac{pulse_width_us}{period_us}\) and thus must be in the range [0, 1]. The period is set with set_pulse_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.

Parameters
  • period_ratio: Ratio representing \(@frac{pulse_width_us}{period_us}\) which must be in the range [0, 1] (value is clamped in this range otherwise)

void enable()

Enables the trigger out signal.

void disable()

Disables the trigger out signal.

I_TriggerOut *get_facility() const

Get corresponding facility in HAL library.