当前位置: 首页 > news >正文

RealSense、ZED 和奥比中光Astra几款主流相机介绍及应用

以下是英特尔 RealSense、Stereolabs ZED 和奥比中光Astra几款相机的详细对比,包括参数、性能以及二次开发等支持,附带代码示例。

详细信息对比和二次开发示例

1. 英特尔 RealSense (例如 D435/D455)

  • 深度技术:立体视觉 + 红外投影
  • 分辨率
    • D435: 1280x720 @ 30fps
    • D455: 1920x1080 @ 30fps
  • 工作范围:0.2 米到 10 米
  • 视场角 (FOV):宽度 86°,高度 57°
  • 通讯接口:USB 3.0
  • SDK 支持: Intel RealSense SDK
  • 二次开发支持:C++, Python, ROS 等
  • 安装依赖
pip install pyrealsense2

代码示例(Python)

import pyrealsense2 as rs
import numpy as np
import cv2# 创建管道
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)# 启动流
pipeline.start(config)try:while True: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# 将帧转换为numpy数组depth_image = np.asanyarray(depth_frame.get_data())color_image = np.asanyarray(color_frame.get_data())# 显示图像cv2.imshow('Color', color_image)cv2.imshow('Depth', depth_image)if cv2.waitKey(1) & 0xFF == ord('q'):break
finally:pipeline.stop()cv2.destroyAllWindows()

代码示例(C++)

#include <librealsense2/rs.hpp> // Include RealSense Cross Platform API
#include <iostream>int main() {// Create a RealSense pipeliners2::pipeline p;// Start the pipeline with default configurationp.start();while (true) {// Wait for a new framers2::frameset frames = p.wait_for_frames();// Get the depth framers2::depth_frame depth = frames.get_depth_frame();// Get the color framers2::frame color = frames.get_color_frame();if (!depth || !color) continue;// Get the dimensions of the imageint width = depth.get_width();int height = depth.get_height();std::cout << "Depth Frame: " << width << "x" << height << std::endl;// Process the images (for demonstration, we just print the size)// Here you can add your own image processing code// Break the loop on a specific condition (e.g., pressing a key)// For this example, we'll just run indefinitely}return 0;
}

2. ZED (Stereolabs)

  • 深度技术:立体视觉 + IMU
  • 分辨率
    • ZED 2: 4416x1242 @ 15fps(720p模式约 60fps)
  • 工作范围:0.5 米到 20 米
  • 视场角 (FOV):水平 110°,垂直 75°
  • 通讯接口:USB 3.0
  • SDK 支持:ZED SDK
  • 二次开发支持:C++, Python, Unity, ROS 等
    安装依赖
    参考 ZED SDK 安装指南

代码示例(Python)

import sys
import time
import pyzed.sl as sl# 创建相机对象
zed = sl.Camera()# 配置相机
init_params = sl.InitParameters()
init_params.camera_resolution = sl.RESOLUTION.HD720
init_params.depth_mode = sl.DEPTH_MODE.PERFORMANCE
zed.open(init_params)while True:# 捕获图像if zed.grab() == sl.ERROR_CODE.SUCCESS:image = sl.Mat()zed.retrieve_image(image, sl.VIEW.COLOR)depth = sl.Mat()zed.retrieve_measure(depth, sl.MEASURE.DEPTH)# 获取图像数据image_ocv = image.get_data()depth_ocv = depth.get_data()# 显示图像cv2.imshow("ZED Color", image_ocv)cv2.imshow("ZED Depth", depth_ocv)if cv2.waitKey(1) & 0xFF == ord('q'):break# 关闭相机
zed.close()

代码示例(C++)

#include <sl/Camera.hpp>int main(int argc, char **argv) {sl::Camera zed;sl::InitParameters init_params;init_params.camera_resolution = sl::RESOLUTION::HD720;init_params.depth_mode = sl::DEPTH_MODE::PERFORMANCE;// 开始相机if (zed.open(init_params) != sl::ERROR_CODE::SUCCESS) {std::cerr << "Error opening ZED camera." << std::endl;return EXIT_FAILURE;}sl::Mat image, depth;while (true) {if (zed.grab() == sl::ERROR_CODE::SUCCESS) {zed.retrieveImage(image, sl::VIEW::LEFT);zed.retrieveMeasure(depth, sl::MEASURE::DEPTH);// 显示图像和深度cv::imshow("ZED Image", image.getCvMat());cv::imshow("ZED Depth", depth.getCvMat());if (cv::waitKey(1) == 'q') break;}}zed.close();return EXIT_SUCCESS;
}

3. 奥比中光(Orbbec)

  • 深度技术:结构光
  • 分辨率
    • Astra: 640x480 @ 30fps
    • Astra Pro: 1280x720 @ 30fps
  • 工作范围:0.4 米到 8 米
  • 视场角 (FOV):水平 60°,垂直 49°
  • 通讯接口:USB 2.0 / USB 3.0
  • SDK 支持:奥比中光 SDK
  • 二次开发支持:C++, C#, Python, Unity 等
  • 安装依赖
    参考 奥比中光 SDK 安装指南

代码示例(Python)

import numpy as np
import cv2
import openni2# 初始化
openni2.initialize()
dev = openni2.Device.open_any()
depth_stream = dev.create_depth_stream()
color_stream = dev.create_color_stream()# 开启流
depth_stream.start()
color_stream.start()while True:depth_frame = depth_stream.read_frame()color_frame = color_stream.read_frame()depth_data = np.frombuffer(depth_frame.get_buffer_as_uint16(), dtype=np.uint16)color_data = np.frombuffer(color_frame.get_buffer_as_uint8(), dtype=np.uint8)# 处理深度数据depth_image = depth_data.reshape((depth_frame.height, depth_frame.width))color_image = color_data.reshape((color_frame.height, color_frame.width, 3))# 显示图像cv2.imshow('Color Image', color_image)cv2.imshow('Depth Image', depth_image)if cv2.waitKey(1) & 0xFF == ord('q'):break# 停止流
depth_stream.stop()
color_stream.stop()
openni2.unload()

代码示例(C++)

#include <OpenNI.h>
#include <iostream>int main() {openni::OpenNI::initialize();openni::Device device;if (device.open(openni::ANY_DEVICE) != openni::STATUS_OK) {std::cerr << "Could not open device." << std::endl;return -1;}openni::VideoStream depthStream, colorStream;depthStream.create(device, openni::SENSOR_DEPTH);colorStream.create(device, openni::SENSOR_COLOR);depthStream.start();colorStream.start();openni::VideoFrameRef depthFrame, colorFrame;while (true) {depthStream.readFrame(&depthFrame);colorStream.readFrame(&colorFrame);// 显示深度和颜色// 需添加显示代码 (如使用 OpenCV)if (/* 检测退出条件 */) break;}depthStream.stop();colorStream.stop();device.close();openni::OpenNI::shutdown();return 0;
}

综合参数对比

参数英特尔 RealSenseStereolabs ZED奥比中光
深度技术立体视觉 + 红外投影立体视觉 + IMU结构光
分辨率D435: 1280x720; D455: 1920x1080ZED 2: 4416x1242Astra: 640x480; Pro: 1280x720
工作范围0.2 米到 10 米0.5 米到 20 米0.4 米到 8 米
视场角 (FOV)86° x 57°110° x 75°60° x 49°
通讯接口USB 3.0USB 3.0USB 2.0 / USB 3.0
SDKIntel RealSense SDKZED SDK奥比中光 SDK
二次开发支持丰富的文档与社区详细API与示例文档与多平台支持
参数Intel RealSense D435iZED Mini奥比中光 Astra Pro
分辨率1280x720 (RGB), 640x480 (Depth)1280x720 (RGB), 720p (Depth)1280x720 (RGB), 640x480 (Depth)
深度范围0.3m - 10m0.3m - 20m0.5m - 8m
帧率30 fps (depth + RGB)60 fps (depth + RGB)30 fps (depth + RGB)
通讯接口USB 3.0USB 3.0USB 3.0
视场角69.4° x 42.5°110° x 80°90° x 60°

综合性能对比

  • 计算能力:

    • RealSense 配备 IMU,适合移动设备和机器人。
    • ZED 提供高精度深度数据和较大的视场角,适合 AR/VR 应用。
    • 奥比中光专注于深度图像和手势识别等应用,适合人机交互。
  • 使用场景:

    • RealSense: 机器人视觉、手势识别。
    • ZED: 虚拟现实、增强现实、3D 映射。
    • 奥比中光: 智能家居、互动游戏。

总结

以上是对三种不同厂家相机的基本信息对比及二次开发示例,可作为小白简单了解和熟悉。不同的项目需求可以选择不同的相机,根据具体应用场景进行开发。

相关文章:

  • [遇到问题] Word中插入公式横线“-”变成了长连字符
  • centos9 nginx 版本
  • SpringBoot框架下体育馆管理系统的构建
  • Leetcode 887. 鸡蛋掉落
  • SpringBoot启动过程简述 和 SpringCloud 的五大组键
  • C语言编写一个五子棋游戏-代码实例讲解与分析
  • 给 git 添加扩展命令
  • Qt实现远程开关机
  • Flink Lookup Join的工作原理、性能优化和应用场景
  • systemd使用入门
  • 数据结构——顺序表(基础代码题)
  • golang 如何生成唯一的 UUID
  • 一个OpenHarmony rk3568编译问题
  • 品牌增长新引擎:TikTok达人内容营销策略解析
  • 6--苍穹外卖-SpringBoot项目中菜品管理 详解(二)
  • 【MySQL经典案例分析】 Waiting for table metadata lock
  • Android优雅地处理按钮重复点击
  • C++类的相互关联
  • Codepen 每日精选(2018-3-25)
  • Essential Studio for ASP.NET Web Forms 2017 v2,新增自定义树形网格工具栏
  • Java超时控制的实现
  • JS变量作用域
  • Laravel深入学习6 - 应用体系结构:解耦事件处理器
  • Nacos系列:Nacos的Java SDK使用
  • 从地狱到天堂,Node 回调向 async/await 转变
  • 基于 Babel 的 npm 包最小化设置
  • 融云开发漫谈:你是否了解Go语言并发编程的第一要义?
  • 如何优雅的使用vue+Dcloud(Hbuild)开发混合app
  • 白色的风信子
  • 不要一棍子打翻所有黑盒模型,其实可以让它们发挥作用 ...
  • 资深实践篇 | 基于Kubernetes 1.61的Kubernetes Scheduler 调度详解 ...
  • ​创新驱动,边缘计算领袖:亚马逊云科技海外服务器服务再进化
  • ## 基础知识
  • #FPGA(基础知识)
  • (1)虚拟机的安装与使用,linux系统安装
  • (31)对象的克隆
  • (delphi11最新学习资料) Object Pascal 学习笔记---第8章第5节(封闭类和Final方法)
  • (ZT)薛涌:谈贫说富
  • (附源码)springboot猪场管理系统 毕业设计 160901
  • (附源码)计算机毕业设计SSM疫情下的学生出入管理系统
  • (一)Kafka 安全之使用 SASL 进行身份验证 —— JAAS 配置、SASL 配置
  • (原+转)Ubuntu16.04软件中心闪退及wifi消失
  • *算法训练(leetcode)第四十五天 | 101. 孤岛的总面积、102. 沉没孤岛、103. 水流问题、104. 建造最大岛屿
  • .net 4.0 A potentially dangerous Request.Form value was detected from the client 的解决方案
  • .NET Core日志内容详解,详解不同日志级别的区别和有关日志记录的实用工具和第三方库详解与示例
  • .Net Core中Quartz的使用方法
  • .net 程序发生了一个不可捕获的异常
  • .net 连接达梦数据库开发环境部署
  • .NET 通过系统影子账户实现权限维持
  • .Net的C#语言取月份数值对应的MonthName值
  • @GetMapping和@RequestMapping的区别
  • @ModelAttribute 注解
  • @Validated和@Valid校验参数区别
  • [ CTF ] WriteUp- 2022年第三届“网鼎杯”网络安全大赛(朱雀组)
  • [000-01-011].第2节:持久层方案的对比