12 #include <IJsonConvertibleIO.h>
26 "RGBDVideoReader reading file {} at position {}us / {}us",
30 return "RGBDVideoReader: No open file.";
46 "Could not create color or depth subfolder in {} or they "
57 #pragma omp parallel sections
61 im_color = tim_rgbd.color_.ToLegacy();
63 fmt::format(
"{0}/color/{1:05d}.jpg", frame_path, idx);
69 im_depth = tim_rgbd.depth_.ToLegacy();
71 fmt::format(
"{0}/depth/{1:05d}.png", frame_path, idx);
82 #ifdef BUILD_LIBREALSENSE
85 auto reader = std::make_unique<RSBagReader>();
93 "Build with -DBUILD_LIBREALSENSE=ON to use RealSense bag file.");
filament::Texture::InternalFormat format
The Image class stores image with customizable width, height, num of channels and bytes per channel.
static std::unique_ptr< RGBDVideoReader > Create(const std::string &filename)
Factory function to create object based on RGBD video file type.
virtual RGBDVideoMetadata & GetMetadata()=0
Get reference to the metadata of the RGBD video playback.
virtual bool IsEOF() const =0
Check if the RGBD video file is all read.
virtual void SaveFrames(const std::string &frame_path, uint64_t start_time_us=0, uint64_t end_time_us=UINT64_MAX)
virtual bool SeekTimestamp(uint64_t timestamp)=0
Seek to the timestamp (in us).
virtual t::geometry::RGBDImage NextFrame()=0
Get next frame from the RGBD video playback and returns the RGBD object.
virtual std::string ToString() const
Text description.
virtual uint64_t GetTimestamp() const =0
Get current timestamp (in us).
virtual bool IsOpened() const =0
Check If the RGBD video file is opened.
virtual std::string GetFilename() const =0
Return filename being read.
Helper functions for the ml ops.
bool WriteImage(const std::string &filename, const geometry::Image &image, int quality=kCloudViewerImageIODefaultQuality)
bool WriteIJsonConvertibleToJSON(const std::string &filename, const cloudViewer::utility::IJsonConvertible &object)
bool MakeDirectoryHierarchy(const std::string &directory)
std::string ToLower(const std::string &s)
Convert string to the lower case.
Generic file read and write utility for python interface.