我正在使用SetFileName()函数将RGB和深度图像保存到指定的文件位置。但这并不能节省任何费用。该代码运行没有错误,但没有保存任何内容。
这是我的代码:
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();
}
我不知道如何保存输出。有什么建议么?
最佳答案
布尔记录必须设置为true才能录制,而false则可以回放。如果您不给它提供值,则默认情况下为false。尝试说实话。
关于visual-c++ - 在英特尔实感中保存RGB和深度图像,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32288870/