Items with no label
3335 Discussions

Get infrared stream using C examples for D415

WArro
Beginner
1,419 Views

Hi all,

I am trying out the C examples (rs-depth) to get to get the depth and color streams using this:

//configurations:

rs2_config_enable_stream(config, RS2_STREAM_DEPTH, -1, WIDTH, HEIGHT, RS2_FORMAT_Z16, FPS, &e);

check_error(e);

rs2_config_enable_stream(config, RS2_STREAM_COLOR, -1, WIDTH, HEIGHT, RS2_FORMAT_RGB8, FPS, &e);

check_error(e);

//extracting depth and color:

if (rs2_is_frame_extendable_to(frame, RS2_EXTENSION_DEPTH_FRAME, &e) == 1) {

//this is the depth frames

} else{

//this is the color frames

}

My issue now is I cannot get the Infrared streams because I cannot see something like RS2_EXTENSION_DEPTH_FRAME for the infrared stream.

Any inputs are very much appreciated. Thanks.

0 Kudos
1 Reply
MartyG
Honored Contributor III
493 Views

A couple of SDK 2.0 versions ago, an instruction was added to make it easier to get infrared frames from an rs2:frameset.

rs2::frameset::get_infrared_frame()

See line 691 of the script linked to below for an example use:

https://github.com/IntelRealSense/librealsense/blob/master/include/librealsense2/hpp/rs_frame.hpp# L691 librealsense/rs_frame.hpp at master · IntelRealSense/librealsense · GitHub

0 Kudos
Reply