6 cv::Mat_<cv::Vec3b>
load_texture(
const std::string& filename) {
7 cv::Mat mat = cv::imread(filename, CV_LOAD_IMAGE_COLOR);
8 if(mat.empty())
throw std::runtime_error(
"could not load texture " + filename);
9 cv::Mat_<cv::Vec3b> mat_ = mat;
13 void save_texture(
const std::string& filename,
const cv::Mat_<cv::Vec3b>& texture) {
14 std::vector<int> params = { CV_IMWRITE_PNG_COMPRESSION, 0 };
15 cv::imwrite(filename, texture, params);
20 cv::Mat_<ushort>
load_ir(
const std::string& filename) {
21 cv::Mat mat = cv::imread(filename, CV_LOAD_IMAGE_ANYDEPTH);
22 if(mat.empty())
throw std::runtime_error(
"could not load ir image " + filename);
23 if(mat.depth() != CV_16U)
throw std::runtime_error(
"input ir image " + filename +
" is not must be 16 bit");
24 cv::Mat_<ushort> mat_ = mat;
28 void save_ir(
const std::string& filename,
const cv::Mat_<ushort>& ir) {
29 std::vector<int> params = { CV_IMWRITE_PNG_COMPRESSION, 0 };
30 cv::imwrite(filename, ir, params);
35 cv::Mat_<ushort>
load_depth(
const std::string& filename) {
36 cv::Mat mat = cv::imread(filename, CV_LOAD_IMAGE_ANYDEPTH);
37 if(mat.empty())
throw std::runtime_error(
"could not load depth map " + filename);
38 if(mat.depth() != CV_16U)
throw std::runtime_error(
"input depth map " + filename +
" is not must be 16 bit");
39 cv::Mat_<ushort> mat_ = mat;
43 void save_depth(
const std::string& filename,
const cv::Mat_<ushort>& depth) {
44 std::vector<int> params = { CV_IMWRITE_PNG_COMPRESSION, 0 };
45 cv::imwrite(filename, depth, params);
void save_depth(const std::string &filename, const cv::Mat_< ushort > &depth)
void save_texture(const std::string &filename, const cv::Mat_< cv::Vec3b > &texture)
cv::Mat_< ushort > load_ir(const std::string &filename)
cv::Mat_< ushort > load_depth(const std::string &filename)
void save_ir(const std::string &filename, const cv::Mat_< ushort > &ir)
cv::Mat_< cv::Vec3b > load_texture(const std::string &filename)