RealSense投影::CreateColorImageMappedToDepth返回Null,如果其中一个内部参数通
RealSense Projection::CreateColorImageMappedToDepth returns Null if one of the parameters internals were accessed through AcquireAccess
我想做的是修改通过PXCSManager::QuerySample()获取的深度图像,然后将其映射到以同样的方式获取的彩色图像。
这就是我要做的:
void SampleProcessor::CaptureFrame(PXCSenseManager* pxcsManager, const PXCCapture::Sample* sample, char lastCapturedCharacter) {
defaultFilter(sample->depth, pxcsManager->QueryCaptureManager()->QueryDevice()->QueryDepthLowConfidenceValue());
auto result = _projection->CreateColorImageMappedToDepth(timage, sample->color);
}
void SampleProcessor::defaultFilter(PXCImage * toFilter, const pxcF32 & defaultValue) {
auto imageData = PXCImage::ImageData(); //Todo: think about removing duplication with save function. Alternative to python decorators?
if (toFilter->AcquireAccess(PXCImage::ACCESS_READ_WRITE, PXCImage::PIXEL_FORMAT_DEPTH_F32, &imageData) < PXC_STATUS_NO_ERROR) {
return;
}
filterDepth(imageData, toFilter->QueryInfo(), [](pxcF32) { return true; }, defaultValue);
toFilter->ReleaseAccess(&imageData);
}
这里的"result"总是null。如果我将sample->depth, sample->color传递给投影,那么它将返回有效的图像。
我在这里做错了什么?
所以对于有同样问题的人:
我一直在用PXCImage::ACCESS_READ_WRITE
称呼AcquireAccess
(尽管PXCImage::ACCESS_WRITE
也是如此)和PXCImage::PIXEL_FORMAT_DEPTH_F32
。
这将导致内部像素格式从默认转换为PIXEL_FORMAT_DEPTH_F32
。
似乎PXCProjection
不与具有这种像素格式的图像一起工作(尽管它没有在文档中指定,或者至少我找不到任何提及这一点)。当使用这种像素格式的图像调用CreateColorImageMappedToDepth
时,只返回nullptr。真有见地=/.
PXCProjection::QueryUVMap
在相同的情况下返回STATUS_PARAM_UNSUPPORTED
,这是更多的信息,并导致我尝试像素格式。
所以总结一下:你不应该使用PIXEL_FORMAT_DEPTH_F32
作为PXCProjection
参数的图像
相关文章:
- 我不明白为什么我声明一个空的内部结构并将其传递给构造函数
- 为什么从另一个构造函数内部调用C++构造函数不修改类变量?
- 如何创建一个函数来提取向量内部字符串中的字段?
- 在另一个结构中声明内部结构会导致错误:结构使用无效
- 在VC++中从DLLMAIN内部调用D3D的CREATEDEVICE时,它会创建一个死锁(loaderlock?)。有没有办法克服这个问题?最终目标内
- 将一个函数名称传递给模板,以使用模板主体内部的几个过载
- C++:在循环内部或外部声明一个向量
- 使用 c++ 从另一个内部菜单返回到主菜单
- 是一个被认为是不同类型的班级内部的正向声明
- 当指针作为指向另一个功能内部指针的指针传递时会发生什么
- 如何查找查看一个字符串是否位于另一个字符串内部并替换它
- 为 c++ 构建一个静态库,该库在内部依赖于第三方库
- 初始化指向另一个结构内部结构的指针
- 返回一个在函数内部填充的constchar*向量是定义良好的行为吗
- 在外部功能中具有一个变量初始化或内部功能中的多个初始化是最有效的
- 为什么我可以选择*不*调用并发::代理::d一个内部运行
- 声明一个内部有指针的联合指针
- 构造一个内部有结构体的类
- RealSense投影::CreateColorImageMappedToDepth返回Null,如果其中一个内部参数通
- Calloc (), malloc() vs新建一个内部有unordered_map的结构体