Skip to content

Files

Latest commit

6f61fd0 · Apr 5, 2019

History

History
This branch is 5648 commits behind IntelRealSense/librealsense:master.

imshow

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Apr 5, 2019
Nov 23, 2017
Feb 1, 2019

rs-imshow Sample

Overview

This example is a "hello-world" code snippet for Intel RealSense cameras integration with OpenCV. The sample will open an OpenCV UI window and render colorized depth stream to it. The following code snippet is used to create cv::Mat from rs2::frame:

// Query frame size (width and height)
const int w = depth.as<rs2::video_frame>().get_width();
const int h = depth.as<rs2::video_frame>().get_height();

// Create OpenCV matrix of size (w,h) from the colorized depth data
Mat image(Size(w, h), CV_8UC3, (void*)depth.get_data(), Mat::AUTO_STEP);