pyrealsense2 sensor.get_supported_options()(获取当前sensor支持的参数)
文章目录
- 获取当前color sensor支持的参数
- 获取当前depth sensor支持的参数
- 获取color_sensor和depth_sensor各自不同的参数
- 获取color_sensor和depth_sensor相同的参数
获取当前color sensor支持的参数
# -*- coding: utf-8 -*-
"""
@File : 200109_获取受支持的参数.py
@Time : 2020/1/9 8:59
@Author : Dontla
@Email : sxana@qq.com
@Software: PyCharm
"""
import time
import numpy as np
import pyrealsense2 as rs
import cv2ctx = rs.context()pipeline = rs.pipeline(ctx)
cfg = rs.config()
cfg.enable_device('838212073161')
cfg.enable_stream(rs.stream.depth, 640, 360, rs.format.z16, 30)
cfg.enable_stream(rs.stream.color, 640, 360, rs.format.bgr8, 30)
pipeline_profile = pipeline.start(cfg)# [0]是获取depth_sesor,[1]是获取color_sensor
sensor = pipeline.get_active_profile().get_device().query_sensors()[1]print(sensor.get_supported_options())
结果:
[option.backlight_compensation, option.brightness, option.contrast, option.exposure, option.gain, option.gamma, option.hue, option.saturation, option.sharpness, option.white_balance, option.enable_auto_exposure, option.enable_auto_white_balance, option.frames_queue_size, option.power_line_frequency, option.auto_exposure_priority, option.global_time_enabled]
获取当前depth sensor支持的参数
代码同上,除下句之外
sensor = pipeline.get_active_profile().get_device().query_sensors()[0]
[option.exposure, option.gain, option.enable_auto_exposure, option.visual_preset, option.laser_power, option.emitter_enabled, option.frames_queue_size, option.asic_temperature, option.error_polling_enabled, option.projector_temperature, option.output_trigger_enabled, option.depth_units, option.stereo_baseline, option.inter_cam_sync_mode, option.emitter_on_off, option.global_time_enabled]
获取color_sensor和depth_sensor各自不同的参数
写了个简单的代码,获取color_sensor和depth_sensor各自不同的参数:
color_frame_options = ['option.backlight_compensation','option.brightness','option.contrast','option.exposure','option.gain','option.gamma','option.hue','option.saturation,''option.sharpness','option.white_balance','option.enable_auto_exposure','option.enable_auto_white_balance','option.frames_queue_size','option.power_line_frequency','option.auto_exposure_priority','option.global_time_enabled']depth_frame_options = ['option.exposure','option.gain', 'option.enable_auto_exposure', 'option.visual_preset', 'option.laser_power','option.emitter_enabled', 'option.frames_queue_size', 'option.asic_temperature','option.error_polling_enabled', 'option.projector_temperature', 'option.output_trigger_enabled','option.depth_units', 'option.stereo_baseline', 'option.inter_cam_sync_mode','option.emitter_on_off', 'option.global_time_enabled']color_different_options = []
depth_different_options = []for i in color_frame_options:flag = Falsefor j in depth_frame_options:if i == j:flag = Truebreakif not flag:color_different_options.append(i)for i in depth_frame_options:flag = Falsefor j in color_frame_options:if i == j:flag = Truebreakif not flag:depth_different_options.append(i)print(color_different_options)print(depth_different_options)
结果:
color_different_options:[‘option.backlight_compensation’, ‘option.brightness’, ‘option.contrast’, ‘option.gamma’, ‘option.hue’, ‘option.saturation,option.sharpness’, ‘option.white_balance’, ‘option.enable_auto_white_balance’, ‘option.power_line_frequency’, ‘option.auto_exposure_priority’]
depth_different_options:[‘option.visual_preset’, ‘option.laser_power’, ‘option.emitter_enabled’, ‘option.asic_temperature’, ‘option.error_polling_enabled’, ‘option.projector_temperature’, ‘option.output_trigger_enabled’, ‘option.depth_units’, ‘option.stereo_baseline’, ‘option.inter_cam_sync_mode’, ‘option.emitter_on_off’]
获取color_sensor和depth_sensor相同的参数
color_frame_options = ['option.backlight_compensation','option.brightness','option.contrast','option.exposure','option.gain','option.gamma','option.hue','option.saturation,''option.sharpness','option.white_balance','option.enable_auto_exposure','option.enable_auto_white_balance','option.frames_queue_size','option.power_line_frequency','option.auto_exposure_priority','option.global_time_enabled']depth_frame_options = ['option.exposure','option.gain', 'option.enable_auto_exposure', 'option.visual_preset', 'option.laser_power','option.emitter_enabled', 'option.frames_queue_size', 'option.asic_temperature','option.error_polling_enabled', 'option.projector_temperature', 'option.output_trigger_enabled','option.depth_units', 'option.stereo_baseline', 'option.inter_cam_sync_mode','option.emitter_on_off', 'option.global_time_enabled']equal_options = []
for i in color_frame_options:for j in depth_frame_options:if i == j:equal_options.append(i)print('equal_options:{}'.format(equal_options))
# equal_options:['option.exposure', 'option.gain', 'option.enable_auto_exposure', 'option.frames_queue_size', 'option.global_time_enabled']
结果:
equal_options:[‘option.exposure’, ‘option.gain’, ‘option.enable_auto_exposure’, ‘option.frames_queue_size’, ‘option.global_time_enabled’]
参考文章:Intel Realsense D435 pyrealsense2 options类
pyrealsense2 sensor.get_supported_options()(获取当前sensor支持的参数)相关推荐
- The PNP sensor:- This is a sensor who...
2019独角兽企业重金招聘Python工程师标准>>> The PNP sensor:- This is a sensor whose output pulls up to the ...
- js获取url地址栏参数的方法,解决中文乱码问题,能支持中文参数
js获取url地址栏参数的方法,解决中文乱码问题,能支持中文参数 参考文章: (1)js获取url地址栏参数的方法,解决中文乱码问题,能支持中文参数 (2)https://www.cnblogs.co ...
- java获取jsp页面参数_jsp页面中获取servlet请求中的参数方法总结
jsp页面中获取servlet请求中的参数的办法详解 在JAVA WEB应用中,如何获取servlet请求中的参数,并传递给跳转的JSP页面?例如访问http://localhost:8088/bbs ...
- 【Android FFMPEG 开发】FFMPEG 获取编解码器 ( 获取编解码参数 | 查找编解码器 | 获取编解码器上下文 | 设置上下文参数 | 打开编解码器 )
文章目录 博客简介 . FFMPEG 编解码器获取流程 I . FFMPEG 获取音视频流的编解码参数 AVCodecParameters *codecpar II . FFMPEG 查找解码器 av ...
- python excel token_python+excel接口自动化获取token并作为请求参数进行传参操作
1.登录接口登录后返回对应token封装: import json import requests from util.operation_json import OperationJson from ...
- SpringBoot2+Netty+WebSocket(netty实现websocket,支持URL参数)
关于Netty Netty 是一个利用 Java 的高级网络的能力,隐藏其背后的复杂性而提供一个易于使用的 API 的客户端/服务器框架. 更新 2019-7-11 新增URL参数支持,并解决了带参U ...
- 获取父页面URL的参数对应值及左对齐字符串
1 /**//// <summary> 2 /// 返回包含中文字符的字符串长度. 3 /// C# 的string.Length中中文字只做1 ...
- go函数详解:函数定义、形参、返回值定义规范、函数内存分析、不支持重载、支持可变参数、基本数据类型和数组默认都是值传递的、支持自定义数据类型、函数返回值命名
引入 [1]为什么要使用函数: 提高代码的复用型,减少代码的冗余,代码的维护性也提高了 [2]函数的定义: 为完成某一功能的程序指令(语句)的集合,称为函数. [3]基本语法 func 函数名(形参列 ...
- Golang中支持可变参数
Golang中支持可变参数 (如果你希望函数带有可变数量的参数) package main import "fmt" //定义一个函数,函数的参数为:可变参数 ... 参数的数量可 ...
最新文章
- Py之mpld3:mpld3的简介、安装、使用方法之详细攻略
- vscode 调试python 无法连接远程服务器_vscode 远程调试python的方法
- 护士计算机等级考试报名时间2015,湖南大学2015年9月全国计算机等级考试报名时间...
- windows server 2008 开机进度条闪过后重启_Windows无法启动:先用PE把桌面重要数据拷出来再说其他...
- Redis集群搭建~Redis-x64-3.2.100版本
- 编程语言中,差、交、并、自然连接、选择、投影、笛卡尔积分别都是什么运算...
- 利用反射,批量启动WCF服务
- 需求条目化:一个让用户故事有效落地的套路
- 基于visual Studio2013解决C语言竞赛题之1031猜数
- 如何判断Linux服务器是否被入侵?
- mysql导入txt linux_Linux中将txt导入到mysql的方法教程
- 对校招生培养工作的建议_对学校人才培养工作有哪些意见和建议
- 大数(小于10000)N的阶乘准确值(效率)
- 电商api全境,Python网络爬虫与数据采集
- 2012年部分节假日安排
- 【codevs 4246】奶牛的身高 差分约束
- 安卓小游戏之2048
- 使用联想智能引擎的电脑,将会懂你的心思
- for循环,for...in循环,forEach循环的区别
- 【fragment】Android Fragments 详细使用
热门文章
- SAP ABAP 客户退出
- 如何蒸螃蟹?教你蒸螃蟹3个小窍门
- C++使用new和不使用new关键字实例化对象的区别
- 在命令行下进行Oracle用户解锁
- SAP传输停止错误:Test call of transport control program (tp) ended with return code 0208!
- PLSQL Developer使用技巧整理
- F4IF_INT_TABLE_VALUE_REQUEST如何返回多于一个列
- 不懂就问,我月薪三千,离用lamer开mini还有多远?
- mysql in 很大 优化_【转】mysql in语句优化
- java什么是局部变量,什么是java的局部变量,成员变量,全局变量?