英特尔给出了对齐RGB相机和景深(IR)相机的示例,但我需要适应opencv。
该示例仅显示“在渲染中对齐”,因此我将无法使用它们,因为我将使用以下功能。

垫子颜色(Size(640,480),CV_8UC3,(void *)color_frame.get_data(),Mat::AUTO_STEP);

我需要像下面的句子形式对齐框架。

rs2::frameset frames = pipe.wait_for_frames();
rs2::frame color_frame = frames.get_color_frame();
rs2::frame depth_frame = color_map(frames.get_depth_frame());

因此,是否有可能我可以使用以下ex)语句之类的align函数?

例如)rs2:: frameset align_frame = ...... allocate_composite_frame......
或者,在D435中是否有像SR300这样的函数,例如“depth_aligned_to_color”?

最佳答案

调用align函数后将返回框架集,您可以找回对齐的颜色/深度图像以毫无问题地设置到CV函数中。请下载最新版本的LibRS并检查rs-align.cpp,并附上以下代码段。

//Get processed aligned frame
auto processed = align.process(frameset);

// Trying to get both other and aligned depth frames
rs2::video_frame other_frame = processed.first(align_to);
rs2::depth_frame aligned_depth_frame = processed.get_depth_frame();

关于opencv - 我如何使用opencv在D435中对齐?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/49856673/

10-12 21:32