Items with no label
3335 Discussions

Trying to obtain the values of a frame

idata
Employee
1,046 Views

Hi, i´m working with this an R200, and i´d lke to obtain the values of each frame i´m taking. I want the value of the color pixel, and the depth value also.

This is the code i´m working with:

void readFrame(pxcCHAR *file, bool record) {

PXCSenseManager* sm = PXCSenseManager::CreateInstance();

// Set file playback name

sm->QueryCaptureManager()->SetFileName(file, false);

// Enable stream and Initialize

sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR, 640, 480, 0);//En la página ponía 0, 0, simplemente.

sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH, 0, 0, 0);

sm->Init();

// Set realtime=false and pause=true

sm->QueryCaptureManager()->SetRealtime(false);

sm->QueryCaptureManager()->SetPause(true);

// Streaming loop

for (int i = 0; i < 25; i++) {

// Set to work on every frame of data

sm->QueryCaptureManager()->SetFrameByIndex(i);

sm->FlushFrame();

// Ready for the frame to be ready

pxcStatus sts = sm->AcquireFrame(true);

if (sts < PXC_STATUS_NO_ERROR) break;

// Retrieve the sample and work on it. The image is in sample->color.

PXCCapture::Sample* sample = sm->QuerySample();

PXCImage* depthIm = sm -> CreateDepthImageMappedToColor(sample->depth, sample->color);

sm -> QueryVertices(sample->depth, vertices.data());

for (int i = 0; i < 500000000; i++) {}

// Resume processing the next frame

sm->ReleaseFrame();

}

// Clean up

sm->Release();

}

Any ideas of what to put to obtain the values i´m looking for, and where to put it?

Thank you!

0 Kudos
1 Solution
idata
Employee
181 Views

Hello Migueel,

 

 

Thanks for reaching out!

 

 

First of all, since you are using an R200 I'm assuming you are using the SDK R2, please correct me if I'm wrong.

 

 

I believe the information in this link https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?pixelformat_pxcimage.html will be of help for you. It lists several important such as PIXEL_FORMAT_DEPTH_RAW and PIXEL_FORMAT_RGB32 and guide you to the document where it is explained how to get these values.

 

Another link that you might find useful is https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?doc_essential_capture_color_or_depth_samples.html, it explains how to capture individual color or depth streams.

 

 

I hope this information helps you get started,

 

Pedro M.

View solution in original post

0 Kudos
1 Reply
idata
Employee
182 Views

Hello Migueel,

 

 

Thanks for reaching out!

 

 

First of all, since you are using an R200 I'm assuming you are using the SDK R2, please correct me if I'm wrong.

 

 

I believe the information in this link https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?pixelformat_pxcimage.html will be of help for you. It lists several important such as PIXEL_FORMAT_DEPTH_RAW and PIXEL_FORMAT_RGB32 and guide you to the document where it is explained how to get these values.

 

Another link that you might find useful is https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?doc_essential_capture_color_or_depth_samples.html, it explains how to capture individual color or depth streams.

 

 

I hope this information helps you get started,

 

Pedro M.
0 Kudos
Reply