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
boost::optional< cv::Mat > loadImage(std::string groupName, std::string datasetName)
boost::optional< cv::Mat > load(HighFive::Group &group, std::string datasetName)
void save(std::string groupName, std::string datasetName, const cv::Mat &img)
cv::Mat createMat(std::vector< size_t > &dims)


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 Mon Feb 28 2022 22:46:06