<?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: Retrieving depth information from ZR300 in Items with no label</title>
    <link>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598592#M11925</link>
    <description>&lt;P&gt;Can I have any sample of usage?&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2018 02:51:30 GMT</pubDate>
    <dc:creator>nnain1</dc:creator>
    <dc:date>2018-02-01T02:51:30Z</dc:date>
    <item>
      <title>Retrieving depth information from ZR300</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598587#M11920</link>
      <description>&lt;P&gt;I used ZR300 for depth measurement.&lt;/P&gt;&lt;P&gt;I can't retrieve correct Depth matrix from the camera.&lt;/P&gt;&lt;P&gt;What I did was as follow and retrieve the depth matrix from the stream.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       const uint16_t * depth_image = (const uint16_t *)dev-&amp;gt;get_frame_data(rs::stream::depth);&lt;/P&gt;&lt;P&gt;        float scale = dev-&amp;gt;get_depth_scale();&lt;/P&gt;&lt;P&gt;       float data[HEIGHT*WIDTH];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        for(int dy=0; dy&lt;/P&gt;&lt;P&gt;        {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            for(int dx=0; dx&lt;/P&gt;&lt;P&gt;            {&lt;/P&gt;&lt;P&gt;                 uint16_t depth_value = depth_image[dy * depth_intrin.width + dx];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                 if(depth_value == 0)&lt;/P&gt;&lt;P&gt;                    continue;&lt;/P&gt;&lt;P&gt;                 else&lt;/P&gt;&lt;P&gt;                    data[dy*dx] = (float)depth_value * scale;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            }&lt;/P&gt;&lt;P&gt;        }&lt;/P&gt;&lt;P&gt;        Mat depthimage(HEIGHT, WIDTH, CV_32FC1, &amp;amp;data);               &lt;/P&gt;&lt;P&gt;        Mat colorimage(HEIGHT, WIDTH, CV_8UC3, (uchar*)dev-&amp;gt;get_frame_data(rs::stream::color));&lt;/P&gt;&lt;P&gt;        imshow("dst", depthimage);&lt;/P&gt;&lt;P&gt;        waitKey(1);&lt;/P&gt;&lt;P&gt;        dst.release();&lt;/P&gt;&lt;P&gt;I have another depth follow sample from realsense, that has correct object.&lt;/P&gt;&lt;P&gt;The code is&lt;/P&gt;&lt;P&gt;       glPixelTransferf(GL_RED_SCALE, 0xFFFF * dev-&amp;gt;get_depth_scale() / 2.8f);&lt;/P&gt;&lt;P&gt;        glDrawPixels(WIDTH, HEIGHT, GL_RED, GL_UNSIGNED_SHORT, dev-&amp;gt;get_frame_data(rs::stream::depth));&lt;/P&gt;&lt;P&gt;        glPixelTransferf(GL_RED_SCALE, 1.0f);&lt;/P&gt;&lt;P&gt;Red color image is the one following sample program and the image "dst" is the one using the first code.&lt;/P&gt;&lt;P&gt;Another one is the color image, we can see there is a cabinet.&lt;/P&gt;&lt;P&gt;Why I don't have correct depth image, what is wrong with my code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 02:34:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598587#M11920</guid>
      <dc:creator>nnain1</dc:creator>
      <dc:date>2018-01-12T02:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving depth information from ZR300</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598588#M11921</link>
      <description>&lt;P&gt;Hello inmn,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Sorry for the late response. While we don't usually debug customer's code, I am trying to reproduce your issue but have encountered some obstacles. Please stay tuned...&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&lt;P&gt;&amp;nbsp;&lt;/P&gt;Intel Customer Support&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2018 21:12:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598588#M11921</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-01-23T21:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving depth information from ZR300</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598589#M11922</link>
      <description>&lt;P&gt;Hello inmn,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;It seems that you have to do a conversion of the pixel formats from RealSense to OpenCV. See the file  &lt;A href="https://github.com/IntelRealSense/realsense_sdk_zr300/blob/master/sdk/src/core/image/image_conversion_util.cpp"&gt;https://github.com/IntelRealSense/realsense_sdk_zr300/blob/master/sdk/src/core/image/image_conversion_util.cpp&lt;/A&gt; for an example of how to do this.&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Let us know if this helps.&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&lt;P&gt;&amp;nbsp;&lt;/P&gt;Intel Customer Support</description>
      <pubDate>Tue, 30 Jan 2018 02:34:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598589#M11922</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-01-30T02:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving depth information from ZR300</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598590#M11923</link>
      <description>&lt;P&gt;Hello Jesus,&lt;/P&gt;&lt;P&gt;Many thanks for the reply.&lt;/P&gt;&lt;P&gt;I have the same issue for color image. I tried to grab into Opencv's Mat image.&lt;/P&gt;&lt;P&gt;What I did was&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;CODE&gt;dev.enable_stream(rs::stream::color, 640, 480, rs::format::bgr8, 60);&amp;nbsp;cv::Mat colorImg(480, 640, CV_8UC3, (unsigned char *)dev.get_frame_data(rs::stream::color));&amp;nbsp;imshow("colorImg",colorImg);&amp;nbsp;cv::waitKey(1);&lt;/CODE&gt;&lt;P&gt;Then my color image became. Is that the same issue as I need to pixel format conversion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 02:39:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598590#M11923</guid>
      <dc:creator>nnain1</dc:creator>
      <dc:date>2018-02-01T02:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving depth information from ZR300</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598591#M11924</link>
      <description>&lt;P&gt;Hello Jesus,&lt;/P&gt;&lt;P&gt;Many thanks for the reply.&lt;/P&gt;&lt;P&gt;I have the same issue for color image. I tried to grab into Opencv's Mat image.&lt;/P&gt;&lt;P&gt;What I did was&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;CODE&gt;dev.enable_stream(rs::stream::color, 640, 480, rs::format::bgr8, 60);&amp;nbsp;cv::Mat colorImg(480, 640, CV_8UC3, (unsigned char *)dev.get_frame_data(rs::stream::color));&amp;nbsp;imshow("colorImg",colorImg);&amp;nbsp;cv::waitKey(1);&lt;/CODE&gt;&lt;P&gt;Then my color image became. Is that the same issue as I need to pixel format conversion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 02:41:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598591#M11924</guid>
      <dc:creator>nnain1</dc:creator>
      <dc:date>2018-02-01T02:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving depth information from ZR300</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598592#M11925</link>
      <description>&lt;P&gt;Can I have any sample of usage?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 02:51:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598592#M11925</guid>
      <dc:creator>nnain1</dc:creator>
      <dc:date>2018-02-01T02:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving depth information from ZR300</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598593#M11926</link>
      <description>&lt;P&gt;Thanks now ok.&lt;/P&gt;&lt;P&gt;I take the image as rgb8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dev.enable_stream(rs::stream::color, 640, 480, rs::format::rgb8, 60);&lt;/P&gt;&lt;P&gt;Then convert to RGBtoBGR&lt;/P&gt;&lt;P&gt;cv::cvtColor(srcMat, grayMat, CV_RGB2BGR);&lt;/P&gt;&lt;P&gt;It works.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 03:33:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Retrieving-depth-information-from-ZR300/m-p/598593#M11926</guid>
      <dc:creator>nnain1</dc:creator>
      <dc:date>2018-02-01T03:33:38Z</dc:date>
    </item>
  </channel>
</rss>

