简体   繁体   English

如何使用Triclops和FlyCapture SDK从PointGrey BumbleBee2立体摄像机创建深度图?

[英]How to create a depth map from PointGrey BumbleBee2 stereo camera using Triclops and FlyCapture SDKs?

I've got the BumbleBee 2 stereo camera and two mentioned SDKs. 我有BumbleBee 2立体摄像机和两个提到的SDK。

I've managed to capture a video from it in my program, rectify stereo images and get a disparity map. 我已经设法在程序中捕获了视频,纠正了立体图像并获得了视差图。 Next thing I'd like to have is a depth map similar to one, the Kinect gives. 我想拥有的下一件事是Kinect给出的类似于深度图的深度图。

The Triclops' documentation is rather short, it only references functions, without typical workflow description. Triclops的文档很短,仅引用函数,没有典型的工作流描述。 The workflow is described in examples. 示例中描述了工作流程。

Up to now I've found 2 relevant functions: family of triclopsRCDxxToXYZ() functions and triclopsExtractImage3d() function. 到目前为止,我发现了2个相关函数: triclopsRCDxxToXYZ()函数家族和triclopsExtractImage3d()函数。

Functions from the first family calculate x, y and z coordinate for a single pixel. 第一个族的函数计算单个像素的x,y和z坐标。 Z coordinate perfectly corresponds to the depth in meters. Z坐标完美对应于以米为单位的深度。 However, to use this function I should create two nested loops, as shown in the stereo3dpoints example. 但是,要使用此功能,我应该创建两个嵌套循环,如stereo3dpoints示例所示。 That gives too much overhead, because each call returns two more coordinates. 这会产生过多的开销,因为每个调用都会返回两个以上的坐标。

The second function, triclopsExtractImage3d() , always returns error TriclopsErrorInvalidParameter . 第二个函数triclopsExtractImage3d()始终返回错误TriclopsErrorInvalidParameter The documentation says only that "there is a geometry mismatch between the context and the TriclopsImage3d", which is not clear for me. 该文档仅说“上下文和TriclopsImage3d之间存在几何不匹配”,这对我来说还不清楚。

Examples of Triclops 3.3.1 SDK do not show how to use it. Triclops 3.3.1 SDK的示例未显示如何使用它。 Google brings example from Triclops SDK 3.2 , which is absent in 3.3.1. Google带来了Triclops SDK 3.2中的示例 ,该示例在3.3.1中不存在。

I've tried adding lines 253-273 from the link above to current stereo3dpoints - got that error. 我尝试将上面链接中的第253-273行添加到当前的stereo3dpoints-出现了该错误。

Does anyone have an experience with it? 有人有经验吗?

Is it valid to use triclopsExtractImage3d() or is it obsolete? 使用triclopsExtractImage3d()是否有效或已过时?

I also tried plotting values of disparity vs. z , obtained from triclopsRCDxxToXYZ() . 我还尝试绘制从triclopsRCDxxToXYZ()获得的disparityz值。

The plot shows almost exact inverse proportionality: 该图显示了几乎精确的反比例关系: 在此处输入图片说明 .

That is z = k / disparity . 那就是z = k / disparity But k is not constant across the image, it varies from approximately 2.5e-5 to 1.4e-3, that is two orders of magnitude. 但是k在整个图像上不是恒定的,它在大约2.5e-5到1.4e-3之间变化,这是两个数量级。 Therefore, it is incorrect to calculate this value once and use forever. 因此,一次计算并永久使用该值是不正确的。

Maybe it is a bit to late and you figured it out by yourself but: 也许有点晚了,您自己弄清楚了,但是:

To use triclopsExtractImage3d you have to create a 3dImage first. 要使用triclopsExtractImage3d您必须首先创建3dImage。

TriclopsImage3d *depthImage;
triclopsCreateImage3d(triclopsContext, &depthImage);
triclopsExtractImage3d(triclopsContext, depthImage);
triclopsDestroyImage3d(&depthImage);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM