Items with no label
3335 Discussions

Realsense D435 infrared image

zchen38
Beginner
1,863 Views

I want to get the infrared image of D435, so I write as followed:

rs2::pipeline pipe;

pipe.start();

rs2::frameset data=pipe.wait_for_frames();

rs2::frame infrared=data.get_infrared_frame();

const int w_i=infrared.as().get_width();

const int h_i=infrared.as().get_height();

cout<<w_i<<" "<<h_i<<endl;

But there is an error called "RealSense error calling rs2_get_frame_width(frame_ref:nullptr): null pointer passed for argument ".

Can someone give me an advice on how to get the infrared image?

0 Kudos
2 Replies
MartyG
Honored Contributor III
815 Views

The SDK 2.0 documentation offers this example for getting the left and right infrared streams:

rs2::config cfg;

cfg.enable_stream(RS2_STREAM_INFRARED, 1);

cfg.enable_stream(RS2_STREAM_INFRARED, 2);

rs2::pipeline pipe;

pipe.start(cfg);

0 Kudos
zchen38
Beginner
815 Views
0 Kudos
Reply