Items with no label
3335 Discussions

Getting SYNC image

YDai2
Novice
2,872 Views

Hi,when I try to get the depth ,IR, color image with SR300, but there is nothing int Sample struct , my code is based on the SDK Example 17, So any ideas of how to accomplish it? many thanks.

here is my code:

int main(){

PXCImage *IR;

PXCImage *Depth;

PXCImage::ImageData IRdata;

pxcStatus sts;

PXCCapture::Sample *sample;

PXCSenseManager *pp=PXCSenseManager::CreateInstance();

pp->EnableStream(PXCCapture::STREAM_TYPE_DEPTH,0,0,0,PXCCapture::Device::STREAM_OPTION_STRONG_STREAM_SYNC);

pp->EnableStream(PXCCapture::STREAM_TYPE_IR,0,0,0,PXCCapture::Device::STREAM_OPTION_STRONG_STREAM_SYNC);

pp->EnableStream(PXCCapture::STREAM_TYPE_COLOR,0,0,0,PXCCapture::Device::STREAM_OPTION_STRONG_STREAM_SYNC);

pp->Init();

PXCCapture::Device *device = pp->QueryCaptureManager()->QueryDevice();

device->ResetProperties(PXCCapture::STREAM_TYPE_ANY);

device->SetMirrorMode(PXCCapture::Device::MirrorMode::MIRROR_MODE_DISABLED);

for(int i=0;i<1;i++)

{

sts=pp->AcquireFrame(true);

sample= pp->QuerySample();

IR = (*sample)[PXCCapture::STREAM_TYPE_IR];

Depth = (*sample)[PXCCapture::STREAM_TYPE_DEPTH];

IR ->AcquireAccess(PXCImage::ACCESS_WRITE,&IRdata);

pp->ReleaseFrame();

}

return 0;

}

6 Replies
idata
Employee
410 Views

Hi Div3,

 

 

Thank you for contacting us.

 

 

From what I understand from your case, you're looking at https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?doc_essential_strong_synchronization.html as a reference to build your code, and your goal is to enable strong synchronization, right? We'd like to do a bit of research before providing a suggestion.

 

Could you tell us more information about your environment such as DCM version, SDK Release version, is the error from the picture you posted the only message you receive, are there additional error logs. The more information you can provide, the better.

 

 

Regards,

 

-Sergio A

 

0 Kudos
YDai2
Novice
410 Views

Hi, Sergio,

thanks for your reply. You are right, I would like to get the IR,depth images with closest time stamp,and do some further treatment with them,here is the detailed information:

--------------------------

SDK :10.0.26.396

DCM:3.3.27.5718

OS:windows 10

Programming platform: VS2012

---------------------------------

when the code exercises at

IR->AcquireAccess(PXCImage::ACCESS_WRITE,PXCImage::PIXEL_FORMAT_Y16,&IRdata);

Sorry, I have no English version of VS2012. theThrew error means "An access violation occurred while reading location '0x00000000'"

and the error seams comes from the "pxcimage.h"

On the face of this problem,get nothing from after exercise code

sts=pp->AcquireFrame(true);sample= pp->QuerySample();

when I change the parameter of function to "false", only "depth" of "sample" has data.

and then, I remove the option "PXCCapture::Device::STREAM_OPTION_STRONG_STREAM_SYNC",all the streams I enabled has data,

but this is not what I need, So it is a little weird. any further information requirement, please that me know. thanks a lot.

0 Kudos
idata
Employee
410 Views

Thank you for sending the details we requested. We'll review this new information and hope to find something useful. We'll contact you as soon as we have an update.

 

 

-Sergio A

 

0 Kudos
idata
Employee
410 Views

Hi Div3,

 

 

Thank you for your patience. We've been working on your case and noticed that you're looking at only one frame as seen in this statement for(int i=0;i<1;i++). You should try capturing more frames for sync to happen. You can test your code with the CameraViewer sample.<p> 

 

Let us know your results.

 

 

-Sergio A

 

0 Kudos
idata
Employee
410 Views

Hi Div3,

 

 

Do you still need assistance with this thread?

 

 

-Sergio

 

0 Kudos
YDai2
Novice
410 Views

Hi, Sergio,

sorry for late response, I still need to fix this problem, I will try in couple of days,thank you so much, and I will send out my results

0 Kudos
Reply