ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::t::io::RSBagReader Class Reference

#include <RSBagReader.h>

Inheritance diagram for cloudViewer::t::io::RSBagReader:
Collaboration diagram for cloudViewer::t::io::RSBagReader:

Public Member Functions

 RSBagReader (size_t buffer_size=DEFAULT_BUFFER_SIZE)
 
 RSBagReader (const RSBagReader &)=delete
 
RSBagReaderoperator= (const RSBagReader &)=delete
 
virtual ~RSBagReader ()
 
virtual bool IsOpened () const override
 Check If the RSBag file is opened. More...
 
virtual bool IsEOF () const override
 Check if the RSBag file is all read. More...
 
virtual bool Open (const std::string &filename) override
 
virtual void Close () override
 Close the opened RSBag playback. More...
 
virtual const RGBDVideoMetadataGetMetadata () const override
 Get (read-only) metadata of the playback. More...
 
virtual RGBDVideoMetadataGetMetadata () override
 Get reference to the metadata of the RGBD video playback. More...
 
virtual bool SeekTimestamp (uint64_t timestamp) override
 
virtual uint64_t GetTimestamp () const override
 Get current timestamp (in us). More...
 
virtual t::geometry::RGBDImage NextFrame () override
 Copy next frame from the bag file and return the RGBDImage object. More...
 
virtual std::string GetFilename () const override
 Return filename being read. More...
 
virtual void SaveFrames (const std::string &frame_path, uint64_t start_time_us=0, uint64_t end_time_us=UINT64_MAX)
 
virtual std::string ToString () const
 Text description. More...
 
- Public Member Functions inherited from cloudViewer::t::io::RGBDVideoReader
 RGBDVideoReader ()
 
virtual ~RGBDVideoReader ()
 
virtual void SaveFrames (const std::string &frame_path, uint64_t start_time_us=0, uint64_t end_time_us=UINT64_MAX)
 
virtual std::string ToString () const
 Text description. More...
 

Static Public Attributes

static const size_t DEFAULT_BUFFER_SIZE = 32
 

Additional Inherited Members

- Static Public Member Functions inherited from cloudViewer::t::io::RGBDVideoReader
static std::unique_ptr< RGBDVideoReaderCreate (const std::string &filename)
 Factory function to create object based on RGBD video file type. More...
 

Detailed Description

RealSense Bag file reader.

Only the first color and depth streams from the bag file will be read.

Note: A few frames may be dropped if user code takes a long time (>10 frame intervals) to process a frame.

Definition at line 49 of file RSBagReader.h.

Constructor & Destructor Documentation

◆ RSBagReader() [1/2]

cloudViewer::t::io::RSBagReader::RSBagReader ( size_t  buffer_size = DEFAULT_BUFFER_SIZE)
explicit

Constructor

Parameters
buffer_size(optional) Max number of frames to store in the frame buffer

Definition at line 35 of file RSBagReader.cpp.

◆ RSBagReader() [2/2]

cloudViewer::t::io::RSBagReader::RSBagReader ( const RSBagReader )
delete

◆ ~RSBagReader()

cloudViewer::t::io::RSBagReader::~RSBagReader ( )
virtual

Definition at line 40 of file RSBagReader.cpp.

References Close(), and IsOpened().

Member Function Documentation

◆ Close()

void cloudViewer::t::io::RSBagReader::Close ( )
overridevirtual

Close the opened RSBag playback.

Implements cloudViewer::t::io::RGBDVideoReader.

Definition at line 77 of file RSBagReader.cpp.

Referenced by Open(), cloudViewer::t::io::pybind_sensor(), and ~RSBagReader().

◆ GetFilename()

virtual std::string cloudViewer::t::io::RSBagReader::GetFilename ( ) const
inlineoverridevirtual

Return filename being read.

Implements cloudViewer::t::io::RGBDVideoReader.

Definition at line 97 of file RSBagReader.h.

◆ GetMetadata() [1/2]

virtual const RGBDVideoMetadata& cloudViewer::t::io::RSBagReader::GetMetadata ( ) const
inlineoverridevirtual

Get (read-only) metadata of the playback.

Implements cloudViewer::t::io::RGBDVideoReader.

Definition at line 78 of file RSBagReader.h.

Referenced by cloudViewer::t::io::pybind_sensor().

◆ GetMetadata() [2/2]

virtual RGBDVideoMetadata& cloudViewer::t::io::RSBagReader::GetMetadata ( )
inlineoverridevirtual

Get reference to the metadata of the RGBD video playback.

Implements cloudViewer::t::io::RGBDVideoReader.

Definition at line 83 of file RSBagReader.h.

◆ GetTimestamp()

uint64_t cloudViewer::t::io::RSBagReader::GetTimestamp ( ) const
overridevirtual

Get current timestamp (in us).

Implements cloudViewer::t::io::RGBDVideoReader.

Definition at line 211 of file RSBagReader.cpp.

References IsOpened(), and LogWarning.

Referenced by cloudViewer::t::io::pybind_sensor().

◆ IsEOF()

bool cloudViewer::t::io::RSBagReader::IsEOF ( ) const
overridevirtual

Check if the RSBag file is all read.

Implements cloudViewer::t::io::RGBDVideoReader.

Definition at line 167 of file RSBagReader.cpp.

Referenced by cloudViewer::t::io::pybind_sensor().

◆ IsOpened()

virtual bool cloudViewer::t::io::RSBagReader::IsOpened ( ) const
inlineoverridevirtual

Check If the RSBag file is opened.

Implements cloudViewer::t::io::RGBDVideoReader.

Definition at line 64 of file RSBagReader.h.

Referenced by GetTimestamp(), NextFrame(), Open(), cloudViewer::t::io::pybind_sensor(), SeekTimestamp(), and ~RSBagReader().

◆ NextFrame()

t::geometry::RGBDImage cloudViewer::t::io::RSBagReader::NextFrame ( )
overridevirtual

Copy next frame from the bag file and return the RGBDImage object.

Implements cloudViewer::t::io::RGBDVideoReader.

Definition at line 169 of file RSBagReader.cpp.

References cloudViewer::t::io::RGBDVideoMetadata::fps_, IsOpened(), LogError, and LogInfo.

Referenced by cloudViewer::t::io::pybind_sensor().

◆ Open()

bool cloudViewer::t::io::RSBagReader::Open ( const std::string &  filename)
overridevirtual

◆ operator=()

RSBagReader& cloudViewer::t::io::RSBagReader::operator= ( const RSBagReader )
delete

◆ SaveFrames()

void cloudViewer::t::io::RGBDVideoReader::SaveFrames

Save synchronized and aligned individual frames to subfolders.

Parameters
frame_pathFrames will be stored in stream subfolders 'color' and 'depth' here. The intrinsic camera calibration for the color stream will be saved in 'intrinsic.json'.
start_time_us(default 0) Start saving frames from this time (us)
end_time_us(default video length) Save frames till this time (us)

Definition at line 62 of file RGBDVideoReader.cpp.

Referenced by cloudViewer::t::io::pybind_sensor().

◆ SeekTimestamp()

bool cloudViewer::t::io::RSBagReader::SeekTimestamp ( uint64_t  timestamp)
overridevirtual

Seek to the timestamp (in us).

Parameters
timestampTime in us to seek to.

Implements cloudViewer::t::io::RGBDVideoReader.

Definition at line 192 of file RSBagReader.cpp.

References IsOpened(), LogWarning, Open(), and cloudViewer::t::io::RGBDVideoMetadata::stream_length_usec_.

Referenced by cloudViewer::t::io::pybind_sensor().

◆ ToString()

std::string cloudViewer::t::io::RGBDVideoReader::ToString

Text description.

Definition at line 70 of file RGBDVideoReader.cpp.

Referenced by cloudViewer::t::io::pybind_sensor().

Member Data Documentation

◆ DEFAULT_BUFFER_SIZE

const size_t cloudViewer::t::io::RSBagReader::DEFAULT_BUFFER_SIZE = 32
static

Definition at line 51 of file RSBagReader.h.

Referenced by cloudViewer::t::io::pybind_sensor().


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