<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Frame lost with D415 (solved) in Items with no label</title>
    <link>https://community.intel.com/t5/Items-with-no-label/Frame-lost-with-D415-solved/m-p/647080#M14732</link>
    <description>&lt;P&gt;Hi, I need to acquire IR, depth and color images with a frame rate of 30fps. I have no trouble with IR and depth, but I lost some images when using the 3 streams.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't care if I lost some images, but I need the correct images for my processing. I use pipe.wait_for_frames()&amp;nbsp;to wait for all images but it does not prevent from lost frame. Is there a way to insure all images are correct?&lt;/P&gt;&lt;P&gt;Next is a code test, I flip image to vizualize frame lost.&lt;/P&gt;&lt;P&gt;I only use 1 realsense, on a windows 64, RS 1.19.2, and USB3 port&lt;/P&gt;&lt;P&gt;edit1: I tested with wait_for_frames() and poll_for_frames() (&lt;A href="https://github.com/IntelRealSense/librealsense/wiki/API-How-To#wait-for-coherent-set-of-frames" target="_self" alt="https://github.com/IntelRealSense/librealsense/wiki/API-How-To#wait-for-coherent-set-of-frames"&gt;&lt;/A&gt;&lt;A href="https://github.com/IntelRealSense/librealsense/wiki/API-How-To#wait-for-coherent-set-of-frames"&gt;https://github.com/IntelRealSense/librealsense/wiki/API-How-To#wait-for-coherent-set-of-frames&lt;/A&gt;) and have same trouble &lt;/P&gt;&lt;P&gt;Edit2: it was misunderstanding of the exemple, see my comment&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;CODE&gt;// License: Apache 2.0. See LICENSE file in root directory.
&amp;nbsp;
// Copyright(c) 2017 Intel Corporation. All Rights Reserved.
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
// https://github.com/IntelRealSense/librealsense/tree/master/include
&amp;nbsp;
#include &amp;lt;librealsense2/rs.hpp&amp;gt; // Include RealSense Cross Platform API
&amp;nbsp;
#include &amp;lt;librealsense2/rs_advanced_mode.hpp&amp;gt; // extra functionalities
&amp;nbsp;
#include &amp;lt;opencv2/opencv.hpp&amp;gt;  // Include OpenCV API
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
using namespace std;
&amp;nbsp;
using namespace cv;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
// acquisition parameters
&amp;nbsp;
int w = 1280;
&amp;nbsp;
int h = 720;
&amp;nbsp;
int framerate = 30;
&amp;nbsp;
rs2_stream camera_for_detect = RS2_STREAM_INFRARED; // RS2_STREAM_COLOR or RS2_STREAM_INFRARED
&amp;nbsp;
rs2_stream camera_col = RS2_STREAM_COLOR; // for dump
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
int main(int argc, char * argv[]) try
&amp;nbsp;
{
&amp;nbsp;
  // Declare depth colorizer for pretty visualization of depth data
&amp;nbsp;
  rs2::colorizer color_map;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  // Declare RealSense pipeline, encapsulating the actual device and sensors
&amp;nbsp;
  rs2::pipeline pipe;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  //Create a configuration for configuring the pipeline with a non default profile
&amp;nbsp;
  rs2::config cfg;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  //Add desired streams to configuration
&amp;nbsp;
  cfg.enable_stream(camera_for_detect, w, h, RS2_FORMAT_BGR8, framerate);
&amp;nbsp;
  cfg.enable_stream(camera_col, w, h, RS2_FORMAT_BGR8, framerate);
&amp;nbsp;
  cfg.enable_stream(RS2_STREAM_DEPTH, w, h, RS2_FORMAT_Z16, framerate);
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  // Start streaming with default recommended configuration
&amp;nbsp;
  cout &amp;lt;&amp;lt; "Start streaming" &amp;lt;&amp;lt; endl;
&amp;nbsp;
  rs2::pipeline_profile profile = pipe.start(cfg);
&amp;nbsp;
  cout &amp;lt;&amp;lt; "Start streaming OK" &amp;lt;&amp;lt; endl;
&amp;nbsp;
  rs2::device dev = profile.get_device();
&amp;nbsp;
  cout &amp;lt;&amp;lt; "GetDevice OK" &amp;lt;&amp;lt; endl;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  while (waitKey(1) &amp;lt; 0)
&amp;nbsp;
  {
&amp;nbsp;
    // Camera warmup - dropping several first frames to let auto-exposure stabilize
&amp;nbsp;
    rs2::frameset data = pipe.wait_for_frames();
&amp;nbsp;
    rs2::frame ir_frame = data.first(camera_for_detect);
&amp;nbsp;
    rs2::frame depth = data.get_depth_frame();
&amp;nbsp;
    rs2::frame depthCol = data.get_depth_frame().apply_filter(color_map);
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
    // Creating OpenCV matrix from IR image
&amp;nbsp;
    Mat ir(Size(w, h), CV_8UC3, (void*)ir_frame.get_data(), Mat::AUTO_STEP);
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
    // test frame lost
&amp;nbsp;
    flip(ir, ir, +1);
&amp;nbsp;
    imshow("FrameLostTest", ir);
&amp;nbsp;
  }
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  cout &amp;lt;&amp;lt; "Exit()" &amp;lt;&amp;lt; endl;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  return EXIT_SUCCESS;
&amp;nbsp;
}
&amp;nbsp;
catch (const rs2::error &amp;amp; e)
&amp;nbsp;
{
&amp;nbsp;
  std::cerr &amp;lt;&amp;lt; "RealSense error calling " &amp;lt;&amp;lt; e.get_failed_function() &amp;lt;&amp;lt; "(" &amp;lt;&amp;lt; e.get_failed_args() &amp;lt;&amp;lt; "):\n  " &amp;lt;&amp;lt; e.what() &amp;lt;&amp;lt; std::endl;
&amp;nbsp;
  return EXIT_FAILURE;
&amp;nbsp;
}
&amp;nbsp;
catch (const std::exception&amp;amp; e)
&amp;nbsp;
{
&amp;nbsp;
  std::cerr &amp;lt;&amp;lt; e.what() &amp;lt;&amp;lt; std::endl;
&amp;nbsp;
  return EXIT_FAILURE;
&amp;nbsp;
}
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Apr 2019 14:51:07 GMT</pubDate>
    <dc:creator>cvest</dc:creator>
    <dc:date>2019-04-15T14:51:07Z</dc:date>
    <item>
      <title>Frame lost with D415 (solved)</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Frame-lost-with-D415-solved/m-p/647080#M14732</link>
      <description>&lt;P&gt;Hi, I need to acquire IR, depth and color images with a frame rate of 30fps. I have no trouble with IR and depth, but I lost some images when using the 3 streams.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't care if I lost some images, but I need the correct images for my processing. I use pipe.wait_for_frames()&amp;nbsp;to wait for all images but it does not prevent from lost frame. Is there a way to insure all images are correct?&lt;/P&gt;&lt;P&gt;Next is a code test, I flip image to vizualize frame lost.&lt;/P&gt;&lt;P&gt;I only use 1 realsense, on a windows 64, RS 1.19.2, and USB3 port&lt;/P&gt;&lt;P&gt;edit1: I tested with wait_for_frames() and poll_for_frames() (&lt;A href="https://github.com/IntelRealSense/librealsense/wiki/API-How-To#wait-for-coherent-set-of-frames" target="_self" alt="https://github.com/IntelRealSense/librealsense/wiki/API-How-To#wait-for-coherent-set-of-frames"&gt;&lt;/A&gt;&lt;A href="https://github.com/IntelRealSense/librealsense/wiki/API-How-To#wait-for-coherent-set-of-frames"&gt;https://github.com/IntelRealSense/librealsense/wiki/API-How-To#wait-for-coherent-set-of-frames&lt;/A&gt;) and have same trouble &lt;/P&gt;&lt;P&gt;Edit2: it was misunderstanding of the exemple, see my comment&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;CODE&gt;// License: Apache 2.0. See LICENSE file in root directory.
&amp;nbsp;
// Copyright(c) 2017 Intel Corporation. All Rights Reserved.
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
// https://github.com/IntelRealSense/librealsense/tree/master/include
&amp;nbsp;
#include &amp;lt;librealsense2/rs.hpp&amp;gt; // Include RealSense Cross Platform API
&amp;nbsp;
#include &amp;lt;librealsense2/rs_advanced_mode.hpp&amp;gt; // extra functionalities
&amp;nbsp;
#include &amp;lt;opencv2/opencv.hpp&amp;gt;  // Include OpenCV API
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
using namespace std;
&amp;nbsp;
using namespace cv;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
// acquisition parameters
&amp;nbsp;
int w = 1280;
&amp;nbsp;
int h = 720;
&amp;nbsp;
int framerate = 30;
&amp;nbsp;
rs2_stream camera_for_detect = RS2_STREAM_INFRARED; // RS2_STREAM_COLOR or RS2_STREAM_INFRARED
&amp;nbsp;
rs2_stream camera_col = RS2_STREAM_COLOR; // for dump
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
int main(int argc, char * argv[]) try
&amp;nbsp;
{
&amp;nbsp;
  // Declare depth colorizer for pretty visualization of depth data
&amp;nbsp;
  rs2::colorizer color_map;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  // Declare RealSense pipeline, encapsulating the actual device and sensors
&amp;nbsp;
  rs2::pipeline pipe;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  //Create a configuration for configuring the pipeline with a non default profile
&amp;nbsp;
  rs2::config cfg;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  //Add desired streams to configuration
&amp;nbsp;
  cfg.enable_stream(camera_for_detect, w, h, RS2_FORMAT_BGR8, framerate);
&amp;nbsp;
  cfg.enable_stream(camera_col, w, h, RS2_FORMAT_BGR8, framerate);
&amp;nbsp;
  cfg.enable_stream(RS2_STREAM_DEPTH, w, h, RS2_FORMAT_Z16, framerate);
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  // Start streaming with default recommended configuration
&amp;nbsp;
  cout &amp;lt;&amp;lt; "Start streaming" &amp;lt;&amp;lt; endl;
&amp;nbsp;
  rs2::pipeline_profile profile = pipe.start(cfg);
&amp;nbsp;
  cout &amp;lt;&amp;lt; "Start streaming OK" &amp;lt;&amp;lt; endl;
&amp;nbsp;
  rs2::device dev = profile.get_device();
&amp;nbsp;
  cout &amp;lt;&amp;lt; "GetDevice OK" &amp;lt;&amp;lt; endl;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  while (waitKey(1) &amp;lt; 0)
&amp;nbsp;
  {
&amp;nbsp;
    // Camera warmup - dropping several first frames to let auto-exposure stabilize
&amp;nbsp;
    rs2::frameset data = pipe.wait_for_frames();
&amp;nbsp;
    rs2::frame ir_frame = data.first(camera_for_detect);
&amp;nbsp;
    rs2::frame depth = data.get_depth_frame();
&amp;nbsp;
    rs2::frame depthCol = data.get_depth_frame().apply_filter(color_map);
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
    // Creating OpenCV matrix from IR image
&amp;nbsp;
    Mat ir(Size(w, h), CV_8UC3, (void*)ir_frame.get_data(), Mat::AUTO_STEP);
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
    // test frame lost
&amp;nbsp;
    flip(ir, ir, +1);
&amp;nbsp;
    imshow("FrameLostTest", ir);
&amp;nbsp;
  }
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  cout &amp;lt;&amp;lt; "Exit()" &amp;lt;&amp;lt; endl;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
  return EXIT_SUCCESS;
&amp;nbsp;
}
&amp;nbsp;
catch (const rs2::error &amp;amp; e)
&amp;nbsp;
{
&amp;nbsp;
  std::cerr &amp;lt;&amp;lt; "RealSense error calling " &amp;lt;&amp;lt; e.get_failed_function() &amp;lt;&amp;lt; "(" &amp;lt;&amp;lt; e.get_failed_args() &amp;lt;&amp;lt; "):\n  " &amp;lt;&amp;lt; e.what() &amp;lt;&amp;lt; std::endl;
&amp;nbsp;
  return EXIT_FAILURE;
&amp;nbsp;
}
&amp;nbsp;
catch (const std::exception&amp;amp; e)
&amp;nbsp;
{
&amp;nbsp;
  std::cerr &amp;lt;&amp;lt; e.what() &amp;lt;&amp;lt; std::endl;
&amp;nbsp;
  return EXIT_FAILURE;
&amp;nbsp;
}
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 14:51:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Frame-lost-with-D415-solved/m-p/647080#M14732</guid>
      <dc:creator>cvest</dc:creator>
      <dc:date>2019-04-15T14:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Frame lost with D415 (solved)</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Frame-lost-with-D415-solved/m-p/647081#M14733</link>
      <description>&lt;P&gt;The system overhead and software stack may affect the stream fps and record.&amp;nbsp;  For users who want to use multiple streams simultaneously whilst avoiding dropped frames, Dorodnic the RealSense SDK Manager offers advice in the link below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/IntelRealSense/librealsense/issues/2563#issuecomment-431145365" target="_self" alt="https://github.com/IntelRealSense/librealsense/issues/2563#issuecomment-431145365"&gt;&lt;/A&gt;&lt;A href="https://github.com/IntelRealSense/librealsense/issues/2563#issuecomment-431145365"&gt;https://github.com/IntelRealSense/librealsense/issues/2563#issuecomment-431145365&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 15:42:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Frame-lost-with-D415-solved/m-p/647081#M14733</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2019-04-15T15:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Frame lost with D415 (solved)</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Frame-lost-with-D415-solved/m-p/647082#M14734</link>
      <description>&lt;P&gt;Thanks MartyG,&lt;/P&gt;&lt;P&gt;i found that there is no frame drop but a misunderstanding of the exemples.&lt;/P&gt;&lt;P&gt;I though data was not changed (frame drop) when displayed image were switching between the normal and the fliped views, while in fact it is due that cv::Mat point to frame data which is rewriten between the flip and the draw.&lt;/P&gt;&lt;P&gt;When I made a copy of ir image, then flip, then draw I have no problem.&lt;/P&gt;&lt;P&gt;There was no problem at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 17:11:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Frame-lost-with-D415-solved/m-p/647082#M14734</guid>
      <dc:creator>cvest</dc:creator>
      <dc:date>2019-04-15T17:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Frame lost with D415 (solved)</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Frame-lost-with-D415-solved/m-p/647083#M14735</link>
      <description>&lt;P&gt;Great news, thanks for letting us know.  :)&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 17:17:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Frame-lost-with-D415-solved/m-p/647083#M14735</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2019-04-15T17:17:43Z</dc:date>
    </item>
  </channel>
</rss>

