OpenEV
Extending OpenCV to event-based vision
Loading...
Searching...
No Matches
ev::Davis Class Reference

This class extends AbstractCamera_ to operate with DAVIS event cameras. DAVIS cameras offer events (DVS), framed images (APS), and IMU data. More...

#include <davis.hpp>

Inheritance diagram for ev::Davis:
ev::AbstractCamera_

Public Member Functions

void start (void) override
 Starts device.
 
BiasValue getBias (const uint8_t name) const
 Retrieve the bias value associated with the given name.
 
bool setBias (const uint8_t name, const BiasValue &value)
 Set the bias value associated with the given name.
 
void enableDvs (bool state)
 Enable DVS.
 
void setDvsTimeInterval (uint32_t usec)
 Set DVS maximum time interval between subsequent transmissions.
 
void setDvsEventsPerPacket (uint32_t n)
 Set DVS maximum number of events per transmission.
 
void enableAps (bool state)
 Enable APS.
 
void setApsTimeInterval (uint32_t usec)
 Set APS maximum time interval between subsequent transmissions.
 
void setExposure (uint32_t exposure)
 Set APS exposure time.
 
void enableImu (bool state)
 Enable IMU.
 
bool getData (Vector &events) override
 Get DVS data.
 
bool getData (Queue &events) override
 Get DVS data.
 
bool getData (StampedMat &frame)
 Get APS data.
 
bool getData (StampedMatVector &frames)
 Get APS data.
 
bool getData (StampedMatQueue &frames)
 Get APS data.
 
bool getData (Imu &imu)
 Get IMU data.
 
bool getData (ImuVector &imu)
 Get IMU data.
 
bool getData (ImuQueue &imu)
 Get IMU data.
 
bool getData (Vector &events, StampedMat &frame)
 Get DVS+APS data.
 
bool getData (Vector &events, StampedMatVector &frames)
 Get DVS+APS data.
 
bool getData (Queue &events, StampedMatQueue &frames)
 Get DVS+APS data.
 
bool getData (Vector &events, Imu &imu)
 Get DVS+IMU data.
 
bool getData (Vector &events, ImuVector &imu)
 Get DVS+IMU data.
 
bool getData (Queue &events, ImuQueue &imu)
 Get DVS+IMU data.
 
bool getData (Vector &events, StampedMat &frame, Imu &imu)
 Get DVS+APS+IMU data.
 
bool getData (Vector &events, StampedMatVector &frame, ImuVector &imu)
 Get DVS+APS+IMU data.
 
bool getData (Queue &events, StampedMatQueue &frame, ImuQueue &imu)
 Get DVS+APS+IMU data.
 
void getEventRaw (std::vector< uint64_t > &data)
 Retrieve raw event data.
 
std::size_t getEventRaw (uint64_t *data, const bool allow_realloc=true)
 Retrieve raw event data.
 
- Public Member Functions inherited from ev::AbstractCamera_
void setTimeOffset (const double offset)
 Set offset to add after receiving events.
 
void stop ()
 Stop reading data.
 
cv::Size getSensorSize () const
 Get device sensor size.
 
cv::Rect getRoi () const
 Get current ROI.
 
bool setRoi (const cv::Rect &roi)
 Set current ROI. Events outside the ROI are not considered. Images are cropped according to the ROI.
 
BiasValue getBias (const int8_t config_bias, const uint8_t name) const
 Retrieve the bias value associated with a specific configuration and name.
 
bool setBias (const int8_t config_bias, const uint8_t name, const BiasValue &value)
 Set the bias value associated with a specific configuration and name.
 
void flush (double msec) const
 Discard data during an interval of time.
 

Static Public Attributes

static constexpr uint32_t DEFAULT_INTERVAL = 20000
 
static constexpr uint32_t DEFAULT_EXPOSURE = 6500
 

Detailed Description

This class extends AbstractCamera_ to operate with DAVIS event cameras. DAVIS cameras offer events (DVS), framed images (APS), and IMU data.

Examples
example-davis.cpp.

Member Function Documentation

◆ enableAps()

void ev::Davis::enableAps ( bool state)

Enable APS.

Parameters
stateTrue to enable, false to disable
Examples
example-davis.cpp.

◆ enableDvs()

void ev::Davis::enableDvs ( bool state)

Enable DVS.

Parameters
stateTrue to enable, false to disable
Examples
example-davis.cpp.

◆ enableImu()

void ev::Davis::enableImu ( bool state)

Enable IMU.

Parameters
stateTrue to enable, false to disable
Examples
example-davis.cpp.

◆ getBias()

ev::BiasValue ev::Davis::getBias ( const uint8_t name) const

Retrieve the bias value associated with the given name.

Parameters
nameThe identifier for the bias value to retrieve.
Returns
The bias value corresponding to the given name.

◆ getData() [1/17]

bool ev::Davis::getData ( Imu & imu)

Get IMU data.

Parameters
imuImu data destination
Returns
True if imu data not empty

◆ getData() [2/17]

bool ev::Davis::getData ( ImuQueue & imu)

Get IMU data.

Parameters
imuImu data queue to which imu data will be added
Returns
True if queue not empty

◆ getData() [3/17]

bool ev::Davis::getData ( ImuVector & imu)

Get IMU data.

Parameters
imuImu data vector to which imu data will be added
Returns
True if vector not empty

◆ getData() [4/17]

bool ev::Davis::getData ( ev::Queue & events)
overridevirtual

Get DVS data.

Parameters
eventsEvent queue to which events will be added.
Returns
True if queue not empty

Implements ev::AbstractCamera_.

◆ getData() [5/17]

bool ev::Davis::getData ( ev::Queue & events,
ev::ImuQueue & imu )

Get DVS+IMU data.

Parameters
eventsEvent queue to which events will be added
imuImu data queue to which imu data will be added
Returns
True if event queue or imu data queue not empty

◆ getData() [6/17]

bool ev::Davis::getData ( ev::Queue & events,
ev::StampedMatQueue & frames,
ev::ImuQueue & imu )

Get DVS+APS+IMU data.

Parameters
eventsEvent queue to which events will be added
framesFrame queue to which frame will be added
imuImu data queue to which imu data will be added
Returns
True if event queue, frame queue, or imu data queue not empty

◆ getData() [7/17]

bool ev::Davis::getData ( ev::Queue & events,
ev::StampedMatQueue & frames )

Get DVS+APS data.

Parameters
eventsEvent queue to which events will be added
framesFrame queue to which frame will be added
Returns
True if event queue or frame queue not empty

◆ getData() [8/17]

bool ev::Davis::getData ( StampedMat & frame)

Get APS data.

Parameters
frameFrame destination
Returns
True if frame not empty

◆ getData() [9/17]

bool ev::Davis::getData ( StampedMatQueue & frames)

Get APS data.

Parameters
framesFrame queue to which frame will be added
Returns
True if queue not empty

◆ getData() [10/17]

bool ev::Davis::getData ( StampedMatVector & frames)

Get APS data.

Parameters
framesFrame vector to which frame will be added
Returns
True if vector not empty

◆ getData() [11/17]

bool ev::Davis::getData ( ev::Vector & events)
overridevirtual

Get DVS data.

Parameters
eventsEvent vector to which events will be added
Returns
True if vector not empty

Implements ev::AbstractCamera_.

Examples
example-davis.cpp.

◆ getData() [12/17]

bool ev::Davis::getData ( ev::Vector & events,
ev::Imu & imu )

Get DVS+IMU data.

Parameters
eventsEvent vector to which events will be added
imuImu data destination
Returns
True if event vector or imu data not empty

◆ getData() [13/17]

bool ev::Davis::getData ( ev::Vector & events,
ev::ImuVector & imu )

Get DVS+IMU data.

Parameters
eventsEvent vector to which events will be added
imuImu data vector to which imu data will be added
Returns
True if event vector or imu data vector not empty

◆ getData() [14/17]

bool ev::Davis::getData ( ev::Vector & events,
ev::StampedMat & frame )

Get DVS+APS data.

Parameters
eventsEvent vector to which events will be added
frameFrame destination
Returns
True if event vector or frame not empty

◆ getData() [15/17]

bool ev::Davis::getData ( ev::Vector & events,
ev::StampedMat & frame,
ev::Imu & imu )

Get DVS+APS+IMU data.

Parameters
eventsEvent vector to which events will be added
frameFrame destination
imuImu data destination
Returns
True if event vector, frame, or imu data not empty

◆ getData() [16/17]

bool ev::Davis::getData ( ev::Vector & events,
ev::StampedMatVector & frames,
ev::ImuVector & imu )

Get DVS+APS+IMU data.

Parameters
eventsEvent vector to which events will be added
framesFrame vector to which frame will be added
imuImu data vector to which imu data will be added
Returns
True if event vector, frame vector, or imu data vector not empty

◆ getData() [17/17]

bool ev::Davis::getData ( ev::Vector & events,
ev::StampedMatVector & frames )

Get DVS+APS data.

Parameters
eventsEvent vector to which events will be added
framesFrame vector to which frame will be added
Returns
True if event vector or frame vector not empty

◆ getEventRaw() [1/2]

void ev::Davis::getEventRaw ( std::vector< uint64_t > & data)

Retrieve raw event data.

Parameters
dataA vector to which the raw event data will be added.
Note
Events are encoded as follows: Mask for x: 11111111111111100000000000000000 00000000000000000000000000000000 Mask for y: 00000000000000011111111111111100 00000000000000000000000000000000 Mask for p: 00000000000000000000000000000010 00000000000000000000000000000000 Mask for t: 00000000000000000000000000000000 11111111111111111111111111111111

◆ getEventRaw() [2/2]

std::size_t ev::Davis::getEventRaw ( uint64_t * data,
const bool allow_realloc = true )

Retrieve raw event data.

Parameters
dataA vector to which the raw event data will be added.
allow_reallocIf true, this function will assume data is empty and automatically manage its size (reallocating if needed).
Returns
The size of the vector.
Note
Events are encoded as follows: Mask for x: 11111111111111100000000000000000 00000000000000000000000000000000 Mask for y: 00000000000000011111111111111100 00000000000000000000000000000000 Mask for p: 00000000000000000000000000000010 00000000000000000000000000000000 Mask for t: 00000000000000000000000000000000 11111111111111111111111111111111

◆ setApsTimeInterval()

void ev::Davis::setApsTimeInterval ( uint32_t usec)

Set APS maximum time interval between subsequent transmissions.

Parameters
usecMaximum time interval in microseconds

◆ setBias()

bool ev::Davis::setBias ( const uint8_t name,
const BiasValue & value )

Set the bias value associated with the given name.

Parameters
nameThe identifier for the bias value to set.
valueThe new bias value to set.
Returns
True if the bias value was successfully set, false otherwise.

◆ setDvsEventsPerPacket()

void ev::Davis::setDvsEventsPerPacket ( uint32_t n)

Set DVS maximum number of events per transmission.

Warning
Set to zero to disable.
Parameters
nMaximum number of events
Examples
example-davis.cpp.

◆ setDvsTimeInterval()

void ev::Davis::setDvsTimeInterval ( uint32_t usec)

Set DVS maximum time interval between subsequent transmissions.

Warning
Set to zero to disable.
Parameters
usecMaximum time interval in microseconds
Examples
example-davis.cpp.

◆ setExposure()

void ev::Davis::setExposure ( uint32_t exposure)

Set APS exposure time.

Parameters
usecExposure time in microseconds

◆ start()

void ev::Davis::start ( void )
overridevirtual

Starts device.

Implements ev::AbstractCamera_.

Examples
example-davis.cpp.

The documentation for this class was generated from the following files: