深度相机的深度测量值含义

最近想起从前工作中跟领导的一个争执点,深度相机的测量值究竟是什么,是物体到相机平面的垂直距离(点到平面到距离),还是到相机中心的点点距离。我认为是前者,被骂得很惨。。事实证明领导过分自信。

再次重申,Kinect及realsense所测量的深度值是空间点到相机平面的垂直距离。

参考链接:
It means the distance form the camera plane, i.e., perpendicular distance, not a straight line from the object to the camera lens. [1]

we assume that the image coordinate system is parallel with the base line and thus with the depth coordinate system… define the depth coordinate system to be parallel with the image coordinate system instead of the base line. [2]

  1. https://software.intel.com/en-us/forums/realsense/topic/620341
  2. Khoshelham K, Elberink S O. Accuracy and resolution of kinect depth data for indoor mapping applications[J]. Sensors, 2012, 12(2): 1437-1454.
### 如何从深度相机获取深度 为了从深度相机中提取深度,通常会涉及到特定的SDK或库函数调用来处理来自传感器的数据流。下面介绍一种基于RealSense SDK的方式实现这一功能。 #### 使用 RealSense SDK 获取深度 当采用Intel RealSense系列设备作为输入源时,可以借助官方提供的C++接口完成此操作: ```cpp #include <librealsense2/rs.hpp> // Include RealSense Cross Platform API headers #include <iostream> int main() try { rs2::pipeline pipe; auto config = rs2::config(); // 配置管道以请求色彩与深度数据流 config.enable_stream(RS2_STREAM_DEPTH); // 开始录制并等待首帧到达 pipe.start(config); while (true) { auto frames = pipe.wait_for_frames(); // 等待下一组可用帧 // 提取深度子帧 const rs2::depth_frame depth = frames.get_depth_frame(); float dist_to_center = depth.get_distance(width / 2, height / 2); // 访问中心点处的距离信息 std::cout << "The distance to the center pixel is: " << dist_to_center * 100 << "cm" << std::endl; if (cv::waitKey(1) == 'q') break; // 按'q'键退出循环 } } catch (const rs2::error & e){ std::cerr << "RealSense error calling " << e.get_failed_function() << "(" << e.get_failed_args() << "):\n " << e.what() << std::endl; return EXIT_FAILURE; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return EXIT_FAILURE; } ``` 上述代码展示了怎样利用`rs2::pipeline`类启动视频捕捉流程,并通过访问单个像素位置(此处为中心点)来读取其对应的深度测量结果[^1]。 得注意的是,在实际应用环境中可能还需要考虑其他因素如坐标系转换等问题以便更好地融合多模态感知信息。
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值