hdf5/ImageIO.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef LVR2_IO_HDF5_IMAGEIO_HPP
4 #define LVR2_IO_HDF5_IMAGEIO_HPP
5 
6 #include <boost/optional.hpp>
7 #include <opencv2/core.hpp>
8 #include <opencv2/core/traits.hpp>
9 #include <highfive/H5DataSet.hpp>
10 #include <highfive/H5DataSpace.hpp>
11 #include <highfive/H5File.hpp>
12 
13 namespace lvr2 {
14 
15 namespace hdf5features {
16 
17 template<typename Derived>
18 class ImageIO {
19 public:
20 
21  void save(std::string groupName,
22  std::string datasetName,
23  const cv::Mat& img
24  );
25 
26  void save(HighFive::Group& group,
27  std::string datasetName,
28  const cv::Mat& img
29  );
30 
31  boost::optional<cv::Mat> load(HighFive::Group& group,
32  std::string datasetName);
33 
34  boost::optional<cv::Mat> load(std::string groupName,
35  std::string datasetName);
36 
37  boost::optional<cv::Mat> loadImage(std::string groupName,
38  std::string datasetName);
39 
40 protected:
41 
42  template<typename T>
43  cv::Mat createMat(std::vector<size_t>& dims);
44 
45  Derived* m_file_access = static_cast<Derived*>(this);
46 
47 };
48 
49 } // namespace hdf5features
50 
51 } // namespace lvr2
52 
53 #include "ImageIO.tcc"
54 
55 #endif // LVR2_IO_HDF5_IMAGEIO_HPP
lvr2::hdf5features::ImageIO
Definition: hdf5/ImageIO.hpp:18
H5File.hpp
H5DataSet.hpp
lvr2::hdf5features::ImageIO::m_file_access
Derived * m_file_access
Definition: hdf5/ImageIO.hpp:45
H5DataSpace.hpp
lvr2::hdf5features::ImageIO::createMat
cv::Mat createMat(std::vector< size_t > &dims)
HighFive::Group
Definition: H5Group.hpp:20
lvr2::hdf5features::ImageIO::load
boost::optional< cv::Mat > load(HighFive::Group &group, std::string datasetName)
lvr2::hdf5features::ImageIO::loadImage
boost::optional< cv::Mat > loadImage(std::string groupName, std::string datasetName)
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::hdf5features::ImageIO::save
void save(std::string groupName, std::string datasetName, const cv::Mat &img)


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:23