<?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: About CreateDepthImageMappedToColor function in Items with no label</title>
    <link>https://community.intel.com/t5/Items-with-no-label/About-CreateDepthImageMappedToColor-function/m-p/467170#M4224</link>
    <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;Great to know that you have found that helpful.&lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;Have a nice day!&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;-Yermi A.&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 May 2017 21:42:23 GMT</pubDate>
    <dc:creator>idata</dc:creator>
    <dc:date>2017-05-16T21:42:23Z</dc:date>
    <item>
      <title>About CreateDepthImageMappedToColor function</title>
      <link>https://community.intel.com/t5/Items-with-no-label/About-CreateDepthImageMappedToColor-function/m-p/467167#M4221</link>
      <description>&lt;P&gt;Hi,everyone~&lt;/P&gt;&lt;P&gt;    It's me again,  I am very sorry that I'm a rookie in realsense. &lt;/P&gt;&lt;P&gt;    I need to map depth image to color image space. I find a function name"CreateDepthImageMappedToColor" which may be useful to me.&lt;/P&gt;&lt;P&gt;    I find a code snippet at  &lt;A href="https://software.intel.com/en-us/node/657586"&gt;https://software.intel.com/en-us/node/657586&lt;/A&gt; &lt;A href="https://software.intel.com/en-us/node/657586"&gt;https://software.intel.com/en-us/node/657586&lt;/A&gt;&lt;/P&gt;&lt;P&gt;    And I complete the code on this basis. (Maybe it's completed...)&lt;/P&gt;&lt;P&gt;    There is no build error. But when I run, an interruption occurred at the beginning.&lt;/P&gt;&lt;P&gt;    When I single-step debug, I find that the pointer *device is NULL. (The interrupt may be due to this reason...)&lt;/P&gt;&lt;P&gt;    Can you help me to modify the code? Or do you have other completed C++ code about alignment of depth image and color image??&lt;/P&gt;&lt;P&gt;    So sorry for my poor programming, here is my full code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# include "stdio.h"&lt;/P&gt;&lt;P&gt;# include "pxcsensemanager.h"&lt;/P&gt;&lt;P&gt;# include "pxcsession.h"&lt;/P&gt;&lt;P&gt;# include "util_render.h"&lt;/P&gt;&lt;P&gt;# include "opencv.hpp"&lt;/P&gt;&lt;P&gt;# include &lt;/P&gt;&lt;P&gt;# include &lt;/P&gt;&lt;P&gt;# include &lt;/P&gt;&lt;P&gt;using namespace std;&lt;/P&gt;&lt;P&gt;using namespace cv;&lt;/P&gt;&lt;P&gt;using namespace Intel::RealSense;&lt;/P&gt;&lt;P&gt;void main()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;  PXCSenseManager *sm = PXCSenseManager::CreateInstance();&lt;/P&gt;&lt;P&gt;  sm-&amp;gt;Init();&lt;/P&gt;&lt;P&gt;  PXCCaptureManager *cmanager = sm-&amp;gt;QueryCaptureManager();&lt;/P&gt;&lt;P&gt;  PXCCapture::Device *device = cmanager-&amp;gt;QueryDevice();&lt;/P&gt;&lt;P&gt;  PXCProjection *projection = device-&amp;gt;CreateProjection();&lt;/P&gt;&lt;P&gt;  PXCCapture::Sample *sample;&lt;/P&gt;&lt;P&gt;  PXCImage::ImageData  d2c_data;&lt;/P&gt;&lt;P&gt;  PXCImage::ImageInfo  d2c_info;&lt;/P&gt;&lt;P&gt;  Mat framepic = Mat(480, 640, CV_8UC1);&lt;/P&gt;&lt;P&gt;  ushort* p;&lt;/P&gt;&lt;P&gt;  Mat output;&lt;/P&gt;&lt;P&gt;  while (sm-&amp;gt;AcquireFrame(true) &amp;gt;= PXC_STATUS_NO_ERROR) &lt;/P&gt;&lt;P&gt;  {&lt;/P&gt;&lt;P&gt;  sample = sm-&amp;gt;QuerySample();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if (sample-&amp;gt;depth) {&lt;/P&gt;&lt;P&gt;  PXCImage *depthPXCImage = projection-&amp;gt;CreateDepthImageMappedToColor(sample-&amp;gt;depth, sample-&amp;gt;color);&lt;/P&gt;&lt;P&gt;  d2c_info = depthPXCImage-&amp;gt;QueryInfo();&lt;/P&gt;&lt;P&gt;  depthPXCImage-&amp;gt;AcquireAccess(PXCImage::ACCESS_READ, &amp;amp;d2c_data);&lt;/P&gt;&lt;P&gt;  ushort* dpixels = (ushort*)d2c_data.planes[0];&lt;/P&gt;&lt;P&gt;  int dpitch = d2c_data.pitches[0] / sizeof(ushort);&lt;/P&gt;&lt;P&gt;  for (int y = 0; y&amp;lt;(int)d2c_info.height; y++)&lt;/P&gt;&lt;P&gt;  for (int x = 0; x&amp;lt;(int)d2c_info.width; x++)&lt;/P&gt;&lt;P&gt;  {&lt;/P&gt;&lt;P&gt;  ushort d = dpixels[y*dpitch + x];&lt;/P&gt;&lt;P&gt;  p = framepic.ptr(y);&lt;/P&gt;&lt;P&gt;  if (d&amp;gt;0)&lt;/P&gt;&lt;P&gt;  p[x] = d * 256 / 1200;&lt;/P&gt;&lt;P&gt;  else&lt;/P&gt;&lt;P&gt;  p[x] = 0;&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  framepic.convertTo(output, CV_8UC1, 1);&lt;/P&gt;&lt;P&gt;  imshow("depth picture", output); waitKey(1);&lt;/P&gt;&lt;P&gt;  depthPXCImage-&amp;gt;ReleaseAccess(&amp;amp;d2c_data);&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  sm-&amp;gt;ReleaseFrame();&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  sm-&amp;gt;Release();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Thank you for any help.&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2017 14:08:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/About-CreateDepthImageMappedToColor-function/m-p/467167#M4221</guid>
      <dc:creator>dzhou8</dc:creator>
      <dc:date>2017-05-15T14:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: About CreateDepthImageMappedToColor function</title>
      <link>https://community.intel.com/t5/Items-with-no-label/About-CreateDepthImageMappedToColor-function/m-p/467168#M4222</link>
      <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;Thanks for your interest in the Intel RealSense Technology.&lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;We would like to suggest you to take a look at the Projection.cpp sample under RSSDK\samples\core directory that we believe you'll find very useful. This sample demonstrate how to use the SDK Projection functions to map or project coordinates among the color image coordinate system, the depth image coordinate system, and the camera coordinate system. Additionally, you can find more information here: &lt;A href="https://software.intel.com/sites/landingpage/realsense/camera-sdk/v2016r3/documentation/html/index.html?sample_projection_cpp.html"&gt;https://software.intel.com/sites/landingpage/realsense/camera-sdk/v2016r3/documentation/html/index.html?sample_projection_cpp.html&lt;/A&gt; Sample: Projection [C++].&lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;Hope this information 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;-Yermi A.&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 00:12:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/About-CreateDepthImageMappedToColor-function/m-p/467168#M4222</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2017-05-16T00:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: About CreateDepthImageMappedToColor function</title>
      <link>https://community.intel.com/t5/Items-with-no-label/About-CreateDepthImageMappedToColor-function/m-p/467169#M4223</link>
      <description>&lt;P&gt;Hi Yermi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;I really need to take a closer look at the Projection.cpp sample with MFC framework.&lt;/P&gt;&lt;P&gt;I appreciate your help very much.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 00:48:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/About-CreateDepthImageMappedToColor-function/m-p/467169#M4223</guid>
      <dc:creator>dzhou8</dc:creator>
      <dc:date>2017-05-16T00:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: About CreateDepthImageMappedToColor function</title>
      <link>https://community.intel.com/t5/Items-with-no-label/About-CreateDepthImageMappedToColor-function/m-p/467170#M4224</link>
      <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;Great to know that you have found that helpful.&lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;Have a nice day!&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;-Yermi A.&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 21:42:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/About-CreateDepthImageMappedToColor-function/m-p/467170#M4224</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2017-05-16T21:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: About CreateDepthImageMappedToColor function</title>
      <link>https://community.intel.com/t5/Items-with-no-label/About-CreateDepthImageMappedToColor-function/m-p/467171#M4225</link>
      <description>&lt;P&gt;I find the solution of null value of the device pointer.&lt;/P&gt;&lt;P&gt;We need enablestream, such as:&lt;/P&gt;&lt;P&gt;PXCSenseManager *sm = PXCSenseManager::CreateInstance();&lt;/P&gt;&lt;P&gt;  sm-&amp;gt;EnableStream(PXCCapture::STREAM_TYPE_COLOR);&lt;/P&gt;&lt;P&gt;  sm-&amp;gt;EnableStream(PXCCapture::STREAM_TYPE_DEPTH);&lt;/P&gt;&lt;P&gt;  sm-&amp;gt;Init();&lt;/P&gt;&lt;P&gt;  PXCCapture::Device *device = sm-&amp;gt;QueryCaptureManager()-&amp;gt;QueryDevice();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the code still doesn't work well, something wrong with changing PXCImage picture to CV::Mat.&lt;/P&gt;&lt;P&gt;I am trying to solve the new problem.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 08:18:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/About-CreateDepthImageMappedToColor-function/m-p/467171#M4225</guid>
      <dc:creator>dzhou8</dc:creator>
      <dc:date>2017-05-17T08:18:12Z</dc:date>
    </item>
  </channel>
</rss>

