Base abstract class for dataset readers.
More...
#include <reader_base.hpp>
Base abstract class for dataset readers.
The overloaded nextData() functions all increment the frame counter, so only one of them should be called within a single pipeline iteration.
- Note
- Derived classes should adhere to the following rules:
◆ Reader()
Construct a Reader from a ReaderConfig.
- Note
- This constructor should be called in all derived class constructors.
- Parameters
-
| [in] | c | The configuration struct to use. |
◆ ~Reader()
| virtual se::Reader::~Reader |
( |
| ) |
|
|
inlinevirtual |
◆ nextData() [1/3]
Read the next depth image.
- Note
- The frame number is incremented when calling this function.
- Parameters
-
| [out] | depth_image | The next depth image. |
- Returns
- An appropriate status code.
◆ nextData() [2/3]
Read the next depth and RGBA images.
- Note
- The frame number is incremented when calling this function.
- Parameters
-
| [out] | depth_image | The next depth image. |
| [out] | rgba_image | The next RGBA image. |
- Returns
- An appropriate status code.
◆ nextData() [3/3]
| ReaderStatus se::Reader::nextData |
( |
Image< float > & |
depth_image, |
|
|
Image< uint32_t > & |
rgba_image, |
|
|
Eigen::Matrix4f & |
T_WB |
|
) |
| |
Read the next depth and RGBA images and ground truth pose.
- Note
- The frame number is incremented when calling this function.
- Parameters
-
| [out] | depth_image | The next depth image. |
| [out] | rgba_image | The next RGBA image. |
| [out] | T_WB | The next ground truth pose. |
- Returns
- An appropriate status code.
◆ getPose()
| ReaderStatus se::Reader::getPose |
( |
Eigen::Matrix4f & |
T_WB, |
|
|
const size_t |
frame |
|
) |
| |
Read the ground truth pose at the provided frame number.
Each line in the ground truth file should correspond to a single depth/RGBA image pair and have a format
... tx ty tz qx qy qz qw,
that is the pose is encoded in the last 7 columns of the line.
- Parameters
-
| [in] | frame | The frame number of the requested ground truth pose. |
| [out] | T_WB | The ground truth pose. |
- Returns
- An appropriate status code.
◆ restart()
| virtual void se::Reader::restart |
( |
| ) |
|
|
pure virtual |
◆ name()
| virtual std::string se::Reader::name |
( |
| ) |
const |
|
pure virtual |
◆ good()
| bool se::Reader::good |
( |
| ) |
const |
The state of the reader.
If good() returns false, there is no need to keep reading frames.
- Returns
- True if the last call to one of the Reader::next*() functions completed successfully.
◆ frame()
| size_t se::Reader::frame |
( |
| ) |
const |
The current frame number.
Frame numbering starts from 0, so the number of frames read so far is frame() + 1.
- Returns
- The number of frames read. Returns SIZE_MAX if no frames have been read yet.
◆ numFrames()
| size_t se::Reader::numFrames |
( |
| ) |
const |
The total number of frames in the current dataset.
- Returns
- The total number of frames. Returns 0 if the number of frames is unknown (e.g. for camera input).
◆ depthImageRes()
| Eigen::Vector2i se::Reader::depthImageRes |
( |
| ) |
const |
The dimensions of the depth images.
- Returns
- A 2D vector containing the width and height of the images.
◆ RGBAImageRes()
| Eigen::Vector2i se::Reader::RGBAImageRes |
( |
| ) |
const |
The dimensions of the RGBA images.
- Returns
- A 2D vector containing the width and height of the images.
◆ isLiveReader()
| bool se::Reader::isLiveReader |
( |
| ) |
const |
Whether the reader uses a live camera as input.
- Returns
- True if the input is from a live camera, false otherwise.
◆ mergeStatus()
Merge se::ReaderStatus values keeping the worst one.
- Parameters
-
- Returns
- The worst of the 2 statuses.
◆ readPose()
| ReaderStatus se::Reader::readPose |
( |
Eigen::Matrix4f & |
T_WB, |
|
|
const size_t |
frame, |
|
|
const char |
delimiter = ' ' |
|
) |
| |
|
protected |
Read the ground truth pose at the provided frame number.
Each line in the ground truth file should correspond to a single depth/RGBA image pair and have a format
... tx ty tz qx qy qz qw,
that is the pose is encoded in the last 7 columns of the line.
- Note
- Use getPose(...) to request a pose. It keeps track of the ground_truth_frame_ and ifstream state.
- Parameters
-
| [out] | T_WB | The ground truth pose. |
| [in] | frame | The frame number of the requested ground truth pose. |
| [in] | delimiter | The character delimiting columns in the file. Defaults to space. |
- Returns
- An appropriate status code.
◆ nextPose()
Read the next ground truth pose.
Each line in the ground truth file should correspond to a single depth/RGBA image pair and have a format
... tx ty tz qx qy qz qw,
that is the pose is encoded in the last 7 columns of the line.
- Note
- The frame number is NOT incremented inside this function.
- Parameters
-
| [out] | T_WB | The next ground truth pose. |
- Returns
- An appropriate status code.
◆ sequence_path_
| std::string se::Reader::sequence_path_ |
|
protected |
◆ ground_truth_file_
| std::string se::Reader::ground_truth_file_ |
|
protected |
◆ ground_truth_fs_
| std::ifstream se::Reader::ground_truth_fs_ |
|
protected |
◆ depth_image_res_
| Eigen::Vector2i se::Reader::depth_image_res_ |
|
protected |
◆ rgba_image_res_
| Eigen::Vector2i se::Reader::rgba_image_res_ |
|
protected |
◆ fps_
◆ spf_
◆ drop_frames_
| bool se::Reader::drop_frames_ |
|
protected |
◆ verbose_
◆ is_live_reader_
| bool se::Reader::is_live_reader_ |
|
protected |
◆ status_
◆ frame_
| size_t se::Reader::frame_ |
|
protected |
The frame_ is initialized to SIZE_MAX, so that when first incremented it becomes 0.
Unsigned integer overflow is defined behaviour in C/C++ so this is safe to do.
◆ num_frames_
| size_t se::Reader::num_frames_ |
|
protected |
The documentation for this class was generated from the following file: