Intel深度摄像头RealSense D435(实感双目摄像头)和目标检测结合使用

您所在的位置:网站首页 intel参数图 Intel深度摄像头RealSense D435(实感双目摄像头)和目标检测结合使用

Intel深度摄像头RealSense D435(实感双目摄像头)和目标检测结合使用

2024-03-29 02:34| 来源: 网络整理| 查看: 265

文章目录: 1 RealSense D435摄像头介绍1.1 D435外观及内部构造 1.2 D435的参数规格1.3 D435应用 2 RealSense D435摄像头的使用2.1 使用D435读取摄像头RGB和深度图 3 使用D435做目标检测和距离测量

1 RealSense D435摄像头介绍

英特尔® 实感™ D435 在我们推出的所有摄像头中视场最大,深度传感器上配置全局快门,是快速移动应用的理想选择。

1.1 D435外观及内部构造

1、外观 在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

2、内部构造

在这里插入图片描述

1.2 D435的参数规格

1、使用场景和范围

使用环境:室内 / 室外最大范围:约10米

2、深度

深度视场(FOV):87°±3° × 58°±1° × 95°±3°最小深度距离:0.105米深度输出分辨率和帧率:高达 1280 × 720 的主动立体深度分辨率。高达 90 帧/秒。

3、RGB

RGB 传感器分辨率:1920 × 1080RGB 帧率:30RGB 传感器 FOV (H × V × D):69.4° × 42.5° × 77° (±3°) 1.3 D435应用

英特尔® 实感™ 深度摄像头 D435 是一款立体追踪解决方案,可为各种应用提供高质量深度。它的宽视场非常适合机器人或增强现实和虚拟现实等应用,在这些应用中,尽可能扩大场景视角至关重要。这款外形小巧的摄像头拍摄范围高达 10 米,可轻松集成到任何解决方案中,而且配置齐全,采用英特尔实感 SDK 2.0,并提供跨平台支持。

在这里插入图片描述

2 RealSense D435摄像头的使用 2.1 使用D435读取摄像头RGB和深度图

安装python库包pyrealsense2

pip install pyrealsense2

更多pyrealsense2的python教程参考

import pyrealsense2 as rs import numpy as np import cv2 # Configure depth and color streams pipeline = rs.pipeline() config = rs.config() # config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30) # config.enable_stream(rs.stream.color, 640, 480, rs.format.bgr8, 30) config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30) config.enable_stream(rs.stream.color, 640, 480, rs.format.bgr8, 30) # Start streaming pipeline.start(config) try: while True: # Wait for a coherent pair of frames: depth and color frames = pipeline.wait_for_frames() # 深度图 depth_frame = frames.get_depth_frame() # 正常读取的视频流 color_frame = frames.get_color_frame() if not depth_frame or not color_frame: continue # Convert images to numpy arrays depth_image = np.asanyarray(depth_frame.get_data()) color_image = np.asanyarray(color_frame.get_data()) # print(f"depth_image shape: {depth_image.shape} color_image shape: {color_image.shape}") print(f"depth_image value: {depth_image}") # 里面0值很多,还有很多1900左右的值 300mm 单位是毫米=30厘米=0.3米 # depth_image shape: (480, 640) color_image shape: (480, 640, 3) # 深度图是单通道 颜色图是三通道的 # Apply colormap on depth image (image must be converted to 8-bit per pixel first) # 在深度图像上应用colormap(图像必须先转换为每像素8位) depth_colormap = cv2.applyColorMap(cv2.convertScaleAbs(depth_image, alpha=0.03), cv2.COLORMAP_JET) # Stack both images horizontally images = np.hstack((color_image, depth_colormap)) # Show images cv2.namedWindow('RealSense', cv2.WINDOW_AUTOSIZE) cv2.imshow('RealSense', images) cv2.waitKey(1) finally: # Stop streaming pipeline.stop() 3 使用D435做目标检测和距离测量

先简单说明我如何做检测到目标的距离检测的:

1)首先使用目标检测方法,检测要检测的目标2)检测到目标之后,获取目标bbox的中心坐标3)使用D435获取深度画面的深度信息4)保证检测画面和深度画面的分辨率是对应的5)根据bbox的中心坐标,去深度去中取出对应的深度信息,然后绘制出来即可!

下面是我检测人之后,并获取人距离摄像头的距离,结果如下:

在这里插入图片描述

(由于CSDN限制上传图片大小,我就裁剪了很短的一段gif,大家凑合看)

检测的问题,如果目标bbox的中心点,没有object上,这样获取到的距离就是背景上,这样就是不准确的,目前想到的方式就是通过分割的方式,然后获取分割目标区域的重心,这样获取有改善,没有尝试!

参考 : https://blog.csdn.net/glb562000520/article/details/17264151 # ToF相机介绍 参考:https://baike.baidu.com/item/%E7%A7%92/2924586 参考:https://blog.csdn.net/zhouyy858/article/details/102658020 # 超声波雷达 参考:https://blog.csdn.net/zhouyy858/article/details/100360829 # 目标跟踪

欢迎大家关注笔者,你的关注是我持续更博的最大动力 原创文章,转载告知,盗版必究 微信:suihailiang0816 QQ:931762054 wx公众号:仰望星空的小随


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3