<?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 Re: Quickly saving an image sequence from D435 in Items with no label</title>
    <link>https://community.intel.com/t5/Items-with-no-label/Quickly-saving-an-image-sequence-from-D435/m-p/471330#M4359</link>
    <description>&lt;P&gt;Hello Jmagen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;We hope the following suggestions help you.&lt;OL&gt;&lt;LI&gt;Offload the save routine to a dedicated thread (using librealsense queus to pass frames around). You may also `frame.keep` API to keep . This should be sufficient to save sequences of (at least) tens of frames&lt;/LI&gt;&lt;LI&gt;PNG has an built-in compression mechanism. According to `stbi` &lt;A href="https://github.com/nothings/stb/blob/master/stb_image_write.h"&gt;https://github.com/nothings/stb/blob/master/stb_image_write.h&lt;/A&gt; documentation it is enabled by default:  PNG allows you to set the deflate compression level by setting the global variable 'stbi_write_png_compression_level' (it defaults to 8)."&lt;/LI&gt;&lt;/OL&gt;We haven't experimented with the feature, but according to &lt;A href="https://superuser.com/questions/845394/how-is-png-lossless-given-that-it-has-a-compression-parameter"&gt;https://superuser.com/questions/845394/how-is-png-lossless-given-that-it-has-a-compression-parameter&lt;/A&gt; this modifying this value to 0  (0 no compression, 9 – max) should positively affect the performance.&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Regards,&lt;P&gt;&amp;nbsp;&lt;/P&gt;Jesus G.&lt;P&gt;&amp;nbsp;&lt;/P&gt;Intel Customer Support&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Mar 2018 17:16:22 GMT</pubDate>
    <dc:creator>idata</dc:creator>
    <dc:date>2018-03-12T17:16:22Z</dc:date>
    <item>
      <title>Quickly saving an image sequence from D435</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Quickly-saving-an-image-sequence-from-D435/m-p/471329#M4358</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have taken the rs-save-to-disk approach to capture an image sequence from a D435 camera (on a button click) to be converted into a video file. The only problem is that the stbi_write_png() function is slow. The stream itself runs at a smooth 30fps when this function is not being called; when the function is called, however, everything slows down; frames are saved at a rate of 4 frames per second and the stream's deteriorated framerate reflects this.&lt;/P&gt;&lt;P&gt;Does anyone know of a faster, alternative method to stbi_write_png() for saving an image sequence? If possible, I would like to capture frames at the same rate in which the vid_frames are displayed in the stream. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;jmagen&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 23:49:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Quickly-saving-an-image-sequence-from-D435/m-p/471329#M4358</guid>
      <dc:creator>JMage</dc:creator>
      <dc:date>2018-03-06T23:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Quickly saving an image sequence from D435</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Quickly-saving-an-image-sequence-from-D435/m-p/471330#M4359</link>
      <description>&lt;P&gt;Hello Jmagen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;We hope the following suggestions help you.&lt;OL&gt;&lt;LI&gt;Offload the save routine to a dedicated thread (using librealsense queus to pass frames around). You may also `frame.keep` API to keep . This should be sufficient to save sequences of (at least) tens of frames&lt;/LI&gt;&lt;LI&gt;PNG has an built-in compression mechanism. According to `stbi` &lt;A href="https://github.com/nothings/stb/blob/master/stb_image_write.h"&gt;https://github.com/nothings/stb/blob/master/stb_image_write.h&lt;/A&gt; documentation it is enabled by default:  PNG allows you to set the deflate compression level by setting the global variable 'stbi_write_png_compression_level' (it defaults to 8)."&lt;/LI&gt;&lt;/OL&gt;We haven't experimented with the feature, but according to &lt;A href="https://superuser.com/questions/845394/how-is-png-lossless-given-that-it-has-a-compression-parameter"&gt;https://superuser.com/questions/845394/how-is-png-lossless-given-that-it-has-a-compression-parameter&lt;/A&gt; this modifying this value to 0  (0 no compression, 9 – max) should positively affect the performance.&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Regards,&lt;P&gt;&amp;nbsp;&lt;/P&gt;Jesus G.&lt;P&gt;&amp;nbsp;&lt;/P&gt;Intel Customer Support&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 17:16:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Quickly-saving-an-image-sequence-from-D435/m-p/471330#M4359</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-03-12T17:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Quickly saving an image sequence from D435</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Quickly-saving-an-image-sequence-from-D435/m-p/471331#M4360</link>
      <description>&lt;P&gt;Hey jmagen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you try OpenCV? More specifically, using the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cv::Mat rgbMat(height, width, CV_8UC3); // Create OpenCV inputArray for saving, CV_8UC3 for color and depth images, CV_8UC1 for INFRARED images&lt;/P&gt;&lt;P&gt;memcpy(rgbMat.data, frame.get_data(), sizeof(unsigned char) * IMAGE_SIZE); // copy from frame, IMAGE_SIZE is the WIDTH * HEIGHT * bytes_per_pixel&lt;/P&gt;&lt;P&gt;cv::imwrite(filename, rgbMat); // save to disk&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do this either in a dedicated thread or the same thread as the fetching of frames. The latter case will give you around 10Hz frequency.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 20:47:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Quickly-saving-an-image-sequence-from-D435/m-p/471331#M4360</guid>
      <dc:creator>LGu4</dc:creator>
      <dc:date>2018-03-19T20:47:09Z</dc:date>
    </item>
  </channel>
</rss>

