如何在英特尔实感(Visual C ++)中保存图像 [英] How to save an image in Intel RealSense(Visual C++)
问题描述
我正在使用英特尔实感SDK(R2)。我想保存从Camera_viewer的图像。我已经工作,直到保存框架到特定的缓冲区,并从相同的检索。我想知道如何保存这些帧/图像到指定的位置/文件夹。
I'm working on Intel RealSense SDK (R2). I want to save the image from Camera_viewer. I have worked till saving the frame to specific buffers and retrieving from the same. I want to know how to save those frames/images to a specified location/folder.
这是我的代码:
PXCImage *colorIm, *depthIm;
for (int i=0; i<MAX_FRAMES; i++) {
// This function blocks until all streams are ready (depth and color)
// if false streams will be unaligned
if (psm->AcquireFrame(true)<PXC_STATUS_NO_ERROR) break;
// retrieve all available image samples
PXCCapture::Sample *sample = psm->QuerySample();
// retrieve the image or frame by type from the sample
colorIm = sample->color;
depthIm = sample->depth;
// render the frame
if (!renderColor->RenderFrame(colorIm)) break;
if (!renderDepth->RenderFrame(depthIm)) break;
// release or unlock the current frame to fetch the next frame
psm->ReleaseFrame();
}
我可以成功检索框架/图片,但我想保存这些文件以供进一步使用。
I'm able to retrieve the frames/images successfully, but I want to save those files for further use. So I want to know how to save those files in a folder.
提前感谢
推荐答案
这里提出了同样的问题,发布的答案解决了初始问题。但是有一个关于如何将图像保存到特定文件夹的后续问题。
Same question was asked here and the answer that was posted solved the initial question. However there was a follow-up question on how to save the images to specific folder.
如果您有该特定问题,则回答将是相同的 SetFileName()
。根据此链接, pxcCHAR * file是要播放或要记录的文件的完整路径。
。话虽如此,您可以创建一个自定义文件夹,并将路径指向自定义文件夹
,后跟一个有效的文件名,以保存您的图片。
If you have that specific question, then answer would be the same SetFileName()
only. According to this link, pxcCHAR *file is the full path of the file to playback or to be recorded.
. That being said, you can create a custom folder and point your path to that custom folder
followed by a valid file name to save your image.
这篇关于如何在英特尔实感(Visual C ++)中保存图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!