- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As in the documentation I have used SetFileName() function to save the RGB and Depth image to the specified file location. But that's not saving anything. The code runs without error, but nothing gets saved.
Here's my code:
void RecordORPlayback(pxcCHAR *file, pxcBool record)
{
// Create a SenseManager instance
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
// Set file recording or playback
sm->QueryCaptureManager()->SetFileName(file,record);
// Select the color stream
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR,640,480,0);
sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH,640,480,0);
PXCImage *colorIm, *depthIm;
// Initialize and Record 300 frames
sm->Init();
for (int i=0;i<300;i++) {
// This function blocks until a color sample is ready
if (sm->AcquireFrame(true)<PXC_STATUS_NO_ERROR) break;
// Retrieve the sample
PXCCapture::Sample *sample=sm->QuerySample();
// Work on the image sample->color
colorIm=sample->color;
depthIm=sample->depth;
// Go fetching the next sample
sm->ReleaseFrame();
}
// close down
sm->Release();
}
I have no idea how to save the output. Any suggestions?
Thanks in advance
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have a look at the Clip Editor example
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Samontab
Yes, but I didn't understand how to connect that with camera_viewer.cpp . Is there any other way to achieve my goals?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, you have the bytes of the image in memory so you could use a 3rd party library for saving it.
At the lowest level this could be for example libjpeg, or libpng.
If you are planning to process the images as well, you could use OpenCV which has those libraries and more already built-in.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page