1 #include "../lib/args.h" 2 #include "../lib/viewer.h" 3 #include "../lib/image_io.h" 4 #include "../lib/filesystem.h" 11 int main(
int argc,
const char* argv[]) {
12 get_args(argc, argv,
"[snap_filename{}.png] [images/] [depths/] [ir/]");
20 viewer view(754+512+512, 424);
24 auto& max_ir = view.
add_int_slider(
"ir max", 0xffff, 0x0000, 0xffff);
37 view.
draw(cv::Rect(0, 0, 754, 424), image);
39 view.
draw_depth(cv::Rect(754+512, 0, 512, 424), depth, min_d, max_d);
44 cont = view.
show(keycode);
46 std::cout <<
"taking snapshot " << snap_counter << std::endl;
47 std::string out_filename = fmt::format(filename_tpl, snap_counter);
49 std::string out_image_filename =
filename_append(out_images_dir, out_filename);
50 std::string out_depth_filename =
filename_append(out_depths_dir, out_filename);
51 std::string out_ir_filename =
filename_append(out_ir_dir, out_filename);
void save_depth(const std::string &filename, const cv::Mat_< ushort > &depth)
std::string filename_append(const std::string &a, const std::string &b)
void save_texture(const std::string &filename, const cv::Mat_< cv::Vec3b > &texture)
cv::Mat_< cv::Vec3b > get_color_frame()
void draw(const cv::Mat_< cv::Vec3b > &, real blend=1.0)
cv::Mat_< ushort > get_original_ir_frame(bool undistorted=false)
void save_ir(const std::string &filename, const cv::Mat_< ushort > &ir)
int main(int argc, const char *argv[])
cv::Mat_< float > get_depth_frame(bool undistorted=false)
void draw_depth(cv::Rect rect, const cv::Mat_< float > &depth_img, float min_d, float max_d, real blend=1.0)
constexpr int enter_keycode
std::string out_dirname_opt_arg(const std::string &def)
int_slider & add_int_slider(const std::string &caption, int default_val, int min_val, int max_val, int step=1)
static cv::Mat_< uchar > visualize_ir(const cv::Mat &, float min_ir, float max_ir)
void clear(int width, int height)
std::string string_opt_arg(const std::string &def="")
void get_args(int argc, const char *argv[], const std::string &usage)