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

This class extends AbstractDataset to download and open the sequences of the Event-Camera Dataset. More...

#include <event-camera-dataset.hpp>

Inheritance diagram for ev::EventCameraDataset:
ev::AbstractDataset

Public Member Functions

std::string name () const override
 Name of the dataset.
std::string shortname () const override
 Short name of the dataset, also used as directory name.
std::vector< std::string > sequences () const override
 Sequences published by the dataset.
std::string url (const std::string &sequence) const override
 Address of the zip file of a sequence.
cv::Size sensorSize (const std::string &sequence) const override
 Sensor size of the camera that recorded a sequence.
std::string cameraName (const std::string &sequence) const override
 Name of the camera that recorded a sequence.
Public Member Functions inherited from ev::AbstractDataset
 AbstractDataset (const AbstractDataset &)=delete
 AbstractDataset (AbstractDataset &&) noexcept=default
AbstractDataset & operator= (const AbstractDataset &)=delete
AbstractDataset & operator= (AbstractDataset &&) noexcept=default
void setDirectory (const std::string &directory)
 Set the directory where the sequences of this dataset are kept.
std::string directory () const
 Directory where the sequences of this dataset are kept.
std::string path (const std::string &sequence) const
 Directory of a sequence.
bool isAvailable (const std::string &sequence) const
 Check if a sequence has been downloaded.
bool download (const std::string &sequence, const Progress &progress=nullptr)
 Download a sequence and extract it in path(). Nothing is done if the sequence is already available.
bool open (const std::string &sequence, const Progress &progress=nullptr)
 Open a sequence, downloading it first if it is not available.
void close ()
 Close the sequence.
bool isOpen () const
 Check if a sequence is open.
const std::string & sequence () const
 Name of the sequence that is open.
ConcurrentQueue & events (const std::size_t n=0)
 Read a given number of events, add them to the queue, and return it, see AbstractReader_::events().
void prefetch (const std::size_t n)
 Keep the queue at a given number of events from a background thread, see AbstractReader_::prefetch().
std::size_t prefetchCapacity () const
 Number of events prefetch() keeps in the queue, see AbstractReader_::prefetchCapacity().
void setRoi (const cv::Rect &roi)
 Deliver only the events inside a region of interest, as the cameras of the devices module do. The events keep their coordinates.
cv::Rect getRoi () const
 Get the region of interest.
void reset ()
 Go back to the beginning of the sequence, see AbstractReader_::reset().
const FrameFileVector & frames () const
 Frames of the sequence, empty if it has none.
const ImuVector & imu () const
 Inertial measurements of the sequence, empty if it has none.
const std::string & error () const
 Reason why the last download() failed.

Static Public Attributes

static constexpr int WIDTH = 240
static constexpr int HEIGHT = 180
static constexpr double SECONDS_TO_MICROSECONDS = 1e6
static constexpr std::array< const char *, 27 > SEQUENCES
 Sequences published by the dataset.

Additional Inherited Members

Public Types inherited from ev::AbstractDataset
using Progress = std::function<void(double, double)>
 Function called while a sequence is being downloaded.
Static Public Member Functions inherited from ev::AbstractDataset
static std::string cacheDirectory ()
 Directory where downloaded datasets are kept by default.

Detailed Description

This class extends AbstractDataset to download and open the sequences of the Event-Camera Dataset.

Note
E. Mueggler, H. Rebecq, G. Gallego, T. Delbruck and D. Scaramuzza, "The Event-Camera Dataset and Simulator: Event-based Data for Pose Estimation, Visual Odometry, and SLAM", International Journal of Robotics Research, Vol. 36, Issue 2, 2017.
Examples
example-event-camera-dataset.cpp.

Member Function Documentation

◆ cameraName()

std::string ev::EventCameraDataset::cameraName ( const std::string & sequence) const
nodiscardoverridevirtual

Name of the camera that recorded a sequence.

Parameters
sequenceSequence name
Returns
Camera name

Implements ev::AbstractDataset.

Examples
example-event-camera-dataset.cpp.

◆ name()

std::string ev::EventCameraDataset::name ( ) const
nodiscardoverridevirtual

Name of the dataset.

Returns
Name

Implements ev::AbstractDataset.

Examples
example-event-camera-dataset.cpp.

◆ sensorSize()

cv::Size ev::EventCameraDataset::sensorSize ( const std::string & sequence) const
nodiscardoverridevirtual

Sensor size of the camera that recorded a sequence.

Parameters
sequenceSequence name
Returns
Sensor size in pixels

Implements ev::AbstractDataset.

Examples
example-event-camera-dataset.cpp.

◆ sequences()

std::vector< std::string > ev::EventCameraDataset::sequences ( ) const
nodiscardoverridevirtual

Sequences published by the dataset.

Returns
Sequence names

Implements ev::AbstractDataset.

Examples
example-event-camera-dataset.cpp.

◆ shortname()

std::string ev::EventCameraDataset::shortname ( ) const
nodiscardoverridevirtual

Short name of the dataset, also used as directory name.

Returns
Short name

Implements ev::AbstractDataset.

Examples
example-event-camera-dataset.cpp.

◆ url()

std::string ev::EventCameraDataset::url ( const std::string & sequence) const
nodiscardoverridevirtual

Address of the zip file of a sequence.

Parameters
sequenceSequence name
Returns
URL

Implements ev::AbstractDataset.

Examples
example-event-camera-dataset.cpp.

Member Data Documentation

◆ HEIGHT

int ev::EventCameraDataset::HEIGHT = 180
staticconstexpr

Sensor height in pixels

◆ SEQUENCES

std::array<const char *, 27> ev::EventCameraDataset::SEQUENCES
staticconstexpr
Initial value:
{
"shapes_rotation", "shapes_translation", "shapes_6dof",
"poster_rotation", "poster_translation", "poster_6dof",
"boxes_rotation", "boxes_translation", "boxes_6dof",
"hdr_poster", "hdr_boxes",
"outdoors_walking", "outdoors_running",
"dynamic_rotation", "dynamic_translation", "dynamic_6dof",
"calibration",
"office_zigzag", "office_spiral",
"urban",
"slider_close", "slider_far", "slider_hdr_close", "slider_hdr_far", "slider_depth",
"simulation_3planes", "simulation_3walls",
}

Sequences published by the dataset.

◆ WIDTH

int ev::EventCameraDataset::WIDTH = 240
staticconstexpr

Sensor width in pixels


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