日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

pyrealsense2 sensor.get_supported_options()(获取当前sensor支持的参数)

發布時間:2025/3/20 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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支持的参数)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。