1 #include "../lib/args.h" 2 #include "../lib/point.h" 3 #include "../lib/ply_exporter.h" 4 #include "../lib/image_io.h" 5 #include "../lib/opencv.h" 9 #include "lib/common.h" 21 cv::Mat_<real> in_float = in;
29 int main(
int argc,
const char* argv[]) {
30 get_args(argc, argv,
"input.png output.png/- output_mask.png/- reprojection_parameters.json method [=was_flipped]");
38 std::cout <<
"reading parameters" << std::endl;
42 std::cout <<
"reading input depth map" << std::endl;
43 cv::Mat_<ushort> in_depth =
load_depth(input_filename.c_str());
44 if(was_flipped) cv::flip(in_depth, in_depth, 1);
46 std::cout <<
"doing depth densification" << std::endl;
51 std::cout <<
"saving output depth map+mask" << std::endl;
53 cv::flip(out_depth, out_depth, 1);
54 cv::flip(out_mask, out_mask, 1);
56 if(!output_filename.empty())
save_depth(output_filename.c_str(), out_depth);
57 if(!output_mask_filename.empty()) cv::imwrite(output_mask_filename.c_str(), out_mask);
59 std::cout <<
"done" << std::endl;
void save_depth(const std::string &filename, const cv::Mat_< ushort > &depth)
std::unique_ptr< depth_densify_base > make_depth_densify(const std::string &method)
constexpr std::size_t texture_height
kinect_reprojection_parameters decode_kinect_reprojection_parameters(const json &j_parameters)
std::string in_filename_arg()
cv::Mat_< ushort > load_depth(const std::string &filename)
int main(int argc, const char *argv[])
constexpr std::size_t texture_width
std::string out_filename_opt_arg(const std::string &def)
void do_depth_reprojection(const cv::Mat_< ushort > &in, cv::Mat_< ushort > &out, cv::Mat_< uchar > &out_mask, const kinect_reprojection &reproj, const std::string &method)
std::vector< sample< Value > > reproject_ir_to_color_samples(const cv::Mat_< Value > &distorted_ir_values, const cv::Mat_< Depth > &distorted_ir_z, bool distort_color=true) const
bool bool_opt_arg(const std::string &expected, bool def=false)
json import_json_file(const std::string &filename)
void get_args(int argc, const char *argv[], const std::string &usage)