1

英特尔给出了对齐 RGB 相机和深度(IR)相机的例子,但我需要适应 opencv。该示例仅显示“在渲染中对齐”,所以我不能使用它们,因为我将使用下面的函数。

垫颜色(尺寸(640, 480),CV_8UC3,(void*)color_frame.get_data(),垫::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) 语句中的对齐功能?

前任)rs2:: frameset align_frame = ...... allocate_composite_frame......

或者,像 SR300 这样的 D435 中是否有像“depth_aligned_to_color”这样的功能?

4

1 回答 1

0

调用 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();
于 2018-05-25T02:15:39.007 回答