44 const cv::Mat& stitched_ir_frame_16bb,
int image_width,
int image_height)
47 cv::Mat depth_8bit_image = cv::Mat::zeros(image_height, image_width, CV_8UC1);
48 unsigned short max_element = 8192;
49 float scale_factor = 255.0f / max_element;
50 stitched_depth_frame_16bb.convertTo(depth_8bit_image, CV_8UC1, scale_factor, 0);
53 cv::Mat depth_8bit_rgb_image = cv::Mat::zeros(image_height, image_width, CV_8UC3);
54 cv::cvtColor(depth_8bit_image, depth_8bit_rgb_image, cv::COLOR_GRAY2BGR);
57 cv::Mat ir_8bit_image = cv::Mat::zeros(image_height, image_width, CV_8UC1);
59 stitched_ir_frame_16bb.convertTo(ir_8bit_image, CV_8UC1, 1, 0);
62 cv::Mat ir_8bit_rgb_image = cv::Mat::zeros(image_height, image_width, CV_8UC3);
63 cv::cvtColor(ir_8bit_image, ir_8bit_rgb_image, cv::COLOR_GRAY2BGR);
66 cv::Mat final_out_image = cv::Mat::zeros(cv::Size(image_width, image_height * 2), CV_8UC3);
67 cv::vconcat(ir_8bit_rgb_image, depth_8bit_rgb_image, final_out_image);
70 cv::namedWindow(
"Stitch_Output", cv::WINDOW_AUTOSIZE);
71 cv::imshow(
"Stitch_Output", final_out_image);
97 cv::Size(image_width, image_height),
true);
100 std::cout <<
"Could not open output video file for the input " << input_file_name << std::endl;