<?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 [R200] Load changed images into Scene Perception module in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/R200-Load-changed-images-into-Scene-Perception-module/m-p/1124200#M77425</link>
    <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;
	&lt;BR /&gt;
	I'd like to know if it is possible to modify (let's say, vertical flip for instance) the raw depth images acquired by the R200 and to take those changes in account for the Scene Perception module.&lt;/P&gt;

&lt;P&gt;In "sp_controller.h", there is this "ProcessNextFrame" function that returns the sample acquired via "m_pSenseMgr-&amp;gt;QueryScenePerceptionSample()", but I suppose that at this point the depth data is already taken in account for the scene perception.&lt;/P&gt;

&lt;P&gt;So how can I get the raw depth data, apply transformations to it, and save those changes before it is loaded by the Scene Perception module ? I can't find where the Scene Perception loads the current depth data, is this done automatically without any hope of changes before this load ?&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
	Felix&lt;/P&gt;

&lt;P&gt;----------------------------------------&lt;BR /&gt;
	&lt;B&gt;EDIT&lt;/B&gt; (my best attempt so far) :&lt;/P&gt;

&lt;P&gt;Based on &lt;A href="https://software.intel.com/en-us/forums/intel-perceptual-computing-sdk/topic/332718"&gt;https://software.intel.com/en-us/forums/intel-perceptual-computing-sdk/topic/332718&lt;/A&gt;, I tried :&lt;/P&gt;

&lt;P&gt;&lt;I&gt;In "sp_controller.h", function ProcessNextFrame :&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;Having created a PXCImage * with&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;// depthData is filled with the modified depth buffer
depthImage = session-&amp;gt;CreateImage(depthInfo, depthData);
&lt;/PRE&gt;

&lt;P&gt;Then :&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;PXCSyncPoint * sp;

// Creation of the new sample
PXCCapture::Sample * newSample = new PXCCapture::Sample();
newSample-&amp;gt;color = colorImage;
newSample-&amp;gt;depth= depthImage;

// Getting the address of the original sample
PXCCapture::Sample * originalSample;
do {
    sts = m_pSenseMgr-&amp;gt;QueryCaptureManager()-&amp;gt;ReadModuleStreamsAsync(m_pScenePerception-&amp;gt;CUID, originalSample, &amp;amp;sp);
} while (sts &amp;lt; PXC_STATUS_NO_ERROR);
sp-&amp;gt;Synchronize();

memcpy(originalSample, newSample, sizeof(newSample));

// And now the usual
pSample = m_pSenseMgr-&amp;gt;QueryScenePerceptionSample();
m_pScenePerception-&amp;gt;GetCameraPose(curPose);
accuracy = m_pScenePerception-&amp;gt;QueryTrackingAccuracy();&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I get an access violation error in "ScenePerceptionApp::UpdateLocalImages(PXCCapture::Sample *pSample)" at line :&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;CopyColorPxcImageToBuffer(pSample-&amp;gt;color, m_color.get(), m_iColorWidth, m_iColorHeight);&lt;/PRE&gt;

&lt;P&gt;Any ideas why this error is raised ? Have I messed up something with data access, or badly copied some data ? I'm still a bit of a beginner in C++ so maybe I missed something basic ?&lt;/P&gt;</description>
    <pubDate>Thu, 12 May 2016 07:29:45 GMT</pubDate>
    <dc:creator>Félix_D_</dc:creator>
    <dc:date>2016-05-12T07:29:45Z</dc:date>
    <item>
      <title>[R200] Load changed images into Scene Perception module</title>
      <link>https://community.intel.com/t5/Software-Archive/R200-Load-changed-images-into-Scene-Perception-module/m-p/1124200#M77425</link>
      <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;
	&lt;BR /&gt;
	I'd like to know if it is possible to modify (let's say, vertical flip for instance) the raw depth images acquired by the R200 and to take those changes in account for the Scene Perception module.&lt;/P&gt;

&lt;P&gt;In "sp_controller.h", there is this "ProcessNextFrame" function that returns the sample acquired via "m_pSenseMgr-&amp;gt;QueryScenePerceptionSample()", but I suppose that at this point the depth data is already taken in account for the scene perception.&lt;/P&gt;

&lt;P&gt;So how can I get the raw depth data, apply transformations to it, and save those changes before it is loaded by the Scene Perception module ? I can't find where the Scene Perception loads the current depth data, is this done automatically without any hope of changes before this load ?&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
	Felix&lt;/P&gt;

&lt;P&gt;----------------------------------------&lt;BR /&gt;
	&lt;B&gt;EDIT&lt;/B&gt; (my best attempt so far) :&lt;/P&gt;

&lt;P&gt;Based on &lt;A href="https://software.intel.com/en-us/forums/intel-perceptual-computing-sdk/topic/332718"&gt;https://software.intel.com/en-us/forums/intel-perceptual-computing-sdk/topic/332718&lt;/A&gt;, I tried :&lt;/P&gt;

&lt;P&gt;&lt;I&gt;In "sp_controller.h", function ProcessNextFrame :&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;Having created a PXCImage * with&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;// depthData is filled with the modified depth buffer
depthImage = session-&amp;gt;CreateImage(depthInfo, depthData);
&lt;/PRE&gt;

&lt;P&gt;Then :&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;PXCSyncPoint * sp;

// Creation of the new sample
PXCCapture::Sample * newSample = new PXCCapture::Sample();
newSample-&amp;gt;color = colorImage;
newSample-&amp;gt;depth= depthImage;

// Getting the address of the original sample
PXCCapture::Sample * originalSample;
do {
    sts = m_pSenseMgr-&amp;gt;QueryCaptureManager()-&amp;gt;ReadModuleStreamsAsync(m_pScenePerception-&amp;gt;CUID, originalSample, &amp;amp;sp);
} while (sts &amp;lt; PXC_STATUS_NO_ERROR);
sp-&amp;gt;Synchronize();

memcpy(originalSample, newSample, sizeof(newSample));

// And now the usual
pSample = m_pSenseMgr-&amp;gt;QueryScenePerceptionSample();
m_pScenePerception-&amp;gt;GetCameraPose(curPose);
accuracy = m_pScenePerception-&amp;gt;QueryTrackingAccuracy();&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I get an access violation error in "ScenePerceptionApp::UpdateLocalImages(PXCCapture::Sample *pSample)" at line :&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;CopyColorPxcImageToBuffer(pSample-&amp;gt;color, m_color.get(), m_iColorWidth, m_iColorHeight);&lt;/PRE&gt;

&lt;P&gt;Any ideas why this error is raised ? Have I messed up something with data access, or badly copied some data ? I'm still a bit of a beginner in C++ so maybe I missed something basic ?&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 07:29:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/R200-Load-changed-images-into-Scene-Perception-module/m-p/1124200#M77425</guid>
      <dc:creator>Félix_D_</dc:creator>
      <dc:date>2016-05-12T07:29:45Z</dc:date>
    </item>
  </channel>
</rss>

