Software Archive
Read-only legacy content
17061 Discussions

[R200] Load changed images into Scene Perception module

Félix_D_
Beginner
205 Views

Hi everyone,

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.

In "sp_controller.h", there is this "ProcessNextFrame" function that returns the sample acquired via "m_pSenseMgr->QueryScenePerceptionSample()", but I suppose that at this point the depth data is already taken in account for the scene perception.

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 ?

Thanks in advance.

Regards,
Felix

----------------------------------------
EDIT (my best attempt so far) :

Based on https://software.intel.com/en-us/forums/intel-perceptual-computing-sdk/topic/332718, I tried :

In "sp_controller.h", function ProcessNextFrame :

Having created a PXCImage * with

// depthData is filled with the modified depth buffer
depthImage = session->CreateImage(depthInfo, depthData);

Then :

PXCSyncPoint * sp;

// Creation of the new sample
PXCCapture::Sample * newSample = new PXCCapture::Sample();
newSample->color = colorImage;
newSample->depth= depthImage;

// Getting the address of the original sample
PXCCapture::Sample * originalSample;
do {
    sts = m_pSenseMgr->QueryCaptureManager()->ReadModuleStreamsAsync(m_pScenePerception->CUID, originalSample, &sp);
} while (sts < PXC_STATUS_NO_ERROR);
sp->Synchronize();

memcpy(originalSample, newSample, sizeof(newSample));

// And now the usual
pSample = m_pSenseMgr->QueryScenePerceptionSample();
m_pScenePerception->GetCameraPose(curPose);
accuracy = m_pScenePerception->QueryTrackingAccuracy();

 

I get an access violation error in "ScenePerceptionApp::UpdateLocalImages(PXCCapture::Sample *pSample)" at line :

CopyColorPxcImageToBuffer(pSample->color, m_color.get(), m_iColorWidth, m_iColorHeight);

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 ?

0 Kudos
0 Replies
Reply