1 Reply Latest reply on Dec 19, 2017 5:30 PM by Intel Corporation

    Getting infrared image immediately crashes application


      Copying the rs-capture.cpp example and modified it by enabling infrared streams and attempting to render it:


      #include <librealsense2/rs.hpp> // Include RealSense Cross Platform API

      #include "example.hpp"          // Include short list of convenience functions for rendering


      int main(int argc, char * argv[]) try


      window app(1280, 720, "RealSense Capture Example");

      texture infrared_image;


      rs2::config cfg;

      cfg.enable_stream(RS2_STREAM_INFRARED, 1);

      cfg.enable_stream(RS2_STREAM_INFRARED, 2);

      rs2::pipeline pipe;




      while (app) // Application still alive?


      rs2::frameset data = pipe.wait_for_frames(); // Wait for next set of frames from the camera


      rs2::frame infrared = data.first(RS2_STREAM_INFRARED);


      infrared_image.render(infrared, { 0, 0, app.width() / 2, app.height() });





      This exits with code 1


      Exception thrown at 0x00007FFC4A7B3C58 (KernelBase.dll) in capture.exe: 0x40080201: WinRT originate error (parameters: 0x00000000C00D36B3, 0x0000000000000027, 0x000000A29CAFD410).

      Exception thrown at 0x00007FFC4A7B3C58 in capture.exe: Microsoft C++ exception: std::runtime_error at memory location 0x000000A29CAFF408.


      No other debugging information is provided.


      Is there a working example to show the raw infrared camera's output? I'm not understanding the difference between data.first vs simply data.get_color_frame() etc (which IR image is missing from).