<?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 No one could help ? in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Can-not-get-raw-depth-data/m-p/1089398#M64720</link>
    <description>&lt;P&gt;No one could help ?&lt;/P&gt;</description>
    <pubDate>Mon, 07 Dec 2015 13:07:18 GMT</pubDate>
    <dc:creator>Hui_L_3</dc:creator>
    <dc:date>2015-12-07T13:07:18Z</dc:date>
    <item>
      <title>Can not get raw depth data</title>
      <link>https://community.intel.com/t5/Software-Archive/Can-not-get-raw-depth-data/m-p/1089395#M64717</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I tired to get raw depth data by calling function AcquireAccess(ACCESS_READ, PIXEL_FORMAT_DEPTH_RAW, &amp;amp;data);&amp;nbsp;&lt;/P&gt;

&lt;P&gt;But it always failed. If I use PIXEL_FORMAT_DEPTH or &amp;nbsp;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;PIXEL_FORMAT_DEPTH_F32, then data.type is correct but the data values remain the same, which means floating point data is value is the same with the depth ones.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Anybody know what is the reason ? I am using R200.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 11:34:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Can-not-get-raw-depth-data/m-p/1089395#M64717</guid>
      <dc:creator>Hui_L_3</dc:creator>
      <dc:date>2015-11-30T11:34:13Z</dc:date>
    </item>
    <item>
      <title>Please provide the part how</title>
      <link>https://community.intel.com/t5/Software-Archive/Can-not-get-raw-depth-data/m-p/1089396#M64718</link>
      <description>&lt;P&gt;Please provide the part how you enable the stream or whole codes so I can help you find the issue. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 17:08:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Can-not-get-raw-depth-data/m-p/1089396#M64718</guid>
      <dc:creator>Xusheng_L_Intel</dc:creator>
      <dc:date>2015-11-30T17:08:01Z</dc:date>
    </item>
    <item>
      <title>Quote:David Lu (Intel) wrote:</title>
      <link>https://community.intel.com/t5/Software-Archive/Can-not-get-raw-depth-data/m-p/1089397#M64719</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;David Lu (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Please provide the part how you enable the stream or whole codes so I can help you find the issue. Thanks!&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Hi David,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Here are the codes, at the line 21:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;Windows.h&amp;gt;
#include &amp;lt;assert.h&amp;gt;
#include &amp;lt;iomanip&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;string&amp;gt;
#include &amp;lt;opencv2/opencv.hpp&amp;gt;
#include "pxcsensemanager.h"
#include "pxcmetadata.h"
#include "util_cmdline.h"
#include "util_render.h"
#include &amp;lt;conio.h&amp;gt;


static void
cvtPXCImageToMat(PXCImage *inImg, cv::Mat *outImg, PXCImage::PixelFormat format) {
	int cvDataType;
	int cvDataWidth;

	PXCImage::ImageData data;

	/* The function either failed or gives wrong format of data !!!!
	 */
	inImg-&amp;gt;AcquireAccess(PXCImage::Access::ACCESS_READ, format, &amp;amp;data);
	PXCImage::ImageInfo imgInfo = inImg-&amp;gt;QueryInfo();

	std::cout &amp;lt;&amp;lt; "The required format is: " &amp;lt;&amp;lt; format &amp;lt;&amp;lt; ", \n the actual format is: " &amp;lt;&amp;lt; data.format &amp;lt;&amp;lt; "\n";

	switch (data.format) {
	case PXCImage::PIXEL_FORMAT_DEPTH:
	case PXCImage::PIXEL_FORMAT_DEPTH_RAW:
		cvDataType = CV_16U;
		cvDataWidth = 2;
		break;
	case PXCImage::PIXEL_FORMAT_DEPTH_F32:
		cvDataType = CV_32F;
		cvDataWidth = 4;
		break;
	}

	assert(data.planes[1] == NULL);
	assert(data.pitches[0] % cvDataWidth == 0);
	outImg-&amp;gt;create(imgInfo.height, data.pitches[0] / cvDataWidth, cvDataType);
	memcpy(outImg-&amp;gt;data, data.planes[0], imgInfo.height*imgInfo.width*cvDataWidth*sizeof(pxcBYTE));
	inImg-&amp;gt;ReleaseAccess(&amp;amp;data);
}

#define SAFE_RELEASE(pt) ((pt)-&amp;gt;Release())

static void
recording() {
	PXCSenseManager *pm = PXCSenseManager::CreateInstance();
	pm-&amp;gt;EnableStream(PXCCapture::STREAM_TYPE_DEPTH, 320, 240, 30.f);
	pm-&amp;gt;Init();

	UtilRender *renderD = new UtilRender(L"Depth");
	cv::Mat depth;
	while (1) {
		if (pm-&amp;gt;AcquireFrame(true) &amp;lt; PXC_STATUS_NO_ERROR) break;
		const PXCCapture::Sample *sample = pm-&amp;gt;QuerySample();
		if (sample) {
			if (sample-&amp;gt;depth) {
				cvtPXCImageToMat(sample-&amp;gt;depth, &amp;amp;depth, PXCImage::PIXEL_FORMAT_DEPTH_RAW);
				renderD-&amp;gt;RenderFrame(sample-&amp;gt;depth);
			}
			if (27 == cvWaitKey(10)) break;
		}
		pm-&amp;gt;ReleaseFrame();
	}

	delete renderD;
	SAFE_RELEASE(pm);
}

int
main(int argc, char *argv[]) {
	recording();
	return 0;
}&lt;/PRE&gt;

&lt;P&gt;In my machine if I changed the format to DEPTH_RAW it will fail, if I changed it to DEPTH_F32, the pixel values are the same with the DEPTH ones. Which is useless for me. If you could identify the reason, that's will be helpful !&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 09:50:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Can-not-get-raw-depth-data/m-p/1089397#M64719</guid>
      <dc:creator>Hui_L_3</dc:creator>
      <dc:date>2015-12-01T09:50:00Z</dc:date>
    </item>
    <item>
      <title>No one could help ?</title>
      <link>https://community.intel.com/t5/Software-Archive/Can-not-get-raw-depth-data/m-p/1089398#M64720</link>
      <description>&lt;P&gt;No one could help ?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 13:07:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Can-not-get-raw-depth-data/m-p/1089398#M64720</guid>
      <dc:creator>Hui_L_3</dc:creator>
      <dc:date>2015-12-07T13:07:18Z</dc:date>
    </item>
    <item>
      <title>Hi, </title>
      <link>https://community.intel.com/t5/Software-Archive/Can-not-get-raw-depth-data/m-p/1089399#M64721</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;
	I just subscribed to the thread / I had a similar issue in C# and it ended up to be a wrong frame release for me. (data was not refreshing as they should).&amp;nbsp;&lt;BR /&gt;
	&lt;BR /&gt;
	I will look into the code pasted in the coming days and see if i can come up with any valuable input :)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 13:15:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Can-not-get-raw-depth-data/m-p/1089399#M64721</guid>
      <dc:creator>Yiannis_C_</dc:creator>
      <dc:date>2015-12-07T13:15:44Z</dc:date>
    </item>
  </channel>
</rss>

