7 #include <opencv2/opencv.hpp> 18 const int h = vf.get_height();
22 return Mat(Size(w, h), CV_8UC3, (
void*)f.
get_data(), Mat::AUTO_STEP);
26 auto r_rgb = Mat(Size(w, h), CV_8UC3, (
void*)f.
get_data(), Mat::AUTO_STEP);
28 cvtColor(r_rgb, r_bgr, COLOR_RGB2BGR);
33 return Mat(Size(w, h), CV_16UC1, (
void*)f.
get_data(), Mat::AUTO_STEP);
37 return Mat(Size(w, h), CV_8UC1, (
void*)f.
get_data(), Mat::AUTO_STEP);
41 return Mat(Size(w, h), CV_32FC1, (
void*)f.
get_data(), Mat::AUTO_STEP);
44 throw std::runtime_error(
"Frame format is not supported yet!");
51 dm.convertTo( dm, CV_64F );
stream_profile get_profile() const
const void * get_data() const
GLdouble GLdouble GLdouble w
GLfloat GLfloat GLfloat GLfloat h
static cv::Mat depth_frame_to_meters(const rs2::depth_frame &f)
rs2_format format() const
static cv::Mat frame_to_mat(const rs2::frame &f)