Skip to content

Latest commit

 

History

History
129 lines (96 loc) · 4.87 KB

auto_exposure.rst

File metadata and controls

129 lines (96 loc) · 4.87 KB

启用自动曝光及其调节

通过 API 的 SetOptionValue() 函数,就可以设定当前打开设备的各类控制值。

启用自动曝光,就是设定 Option::EXPOSURE_MODE0

以s1030为例,自动曝光时,可调节的设定有:

  • Option::MAX_GAIN 最大增益。
  • Option::MAX_EXPOSURE_TIME 最大曝光时间。
  • Option::DESIRED_BRIGHTNESS 期望亮度。

以s21XX为例,自动曝光可调节的设定有:

  • Option::MAX_GAIN 最大增益。
  • Option::MAX_EXPOSURE_TIME 最大曝光时间。
  • Option::DESIRED_BRIGHTNESS 期望亮度。
  • Option::MIN_EXPOSURE_TIME 最小曝光时间。

参考代码片段:

s1030:

s21XX:

参考运行结果,于 Linux 上:

s1030:

$ ./samples/_output/bin/ctrl_auto_exposure
I0513 14:07:57.963943 31845 utils.cc:26] Detecting MYNT EYE devices
I0513 14:07:58.457536 31845 utils.cc:33] MYNT EYE devices:
I0513 14:07:58.457563 31845 utils.cc:37]   index: 0, name: MYNT-EYE-S1000
I0513 14:07:58.457567 31845 utils.cc:43] Only one MYNT EYE device, select index: 0
I0513 14:07:58.474916 31845 auto_exposure.cc:37] Enable auto-exposure
I0513 14:07:58.491058 31845 auto_exposure.cc:38] Set MAX_GAIN to 48
I0513 14:07:58.505131 31845 auto_exposure.cc:39] Set MAX_EXPOSURE_TIME to 240
I0513 14:07:58.521375 31845 auto_exposure.cc:41] Set DESIRED_BRIGHTNESS to 192

s21XX:

$ ./samples/_output/bin/ctrl_auto_exposure
I/utils.cc:30 Detecting MYNT EYE devices
I/utils.cc:40 MYNT EYE devices:
I/utils.cc:43   index: 0, name: MYNT-EYE-S210A, sn: 07C41A190009071F
I/utils.cc:51 Only one MYNT EYE device, select index: 0
I/utils.cc:79 MYNT EYE devices:
I/utils.cc:82   index: 0, request: width: 1280, height: 400, format: Format::BGR888, fps: 10
I/utils.cc:82   index: 1, request: width: 1280, height: 400, format: Format::BGR888, fps: 20
I/utils.cc:82   index: 2, request: width: 1280, height: 400, format: Format::BGR888, fps: 30
I/utils.cc:82   index: 3, request: width: 1280, height: 400, format: Format::BGR888, fps: 60
I/utils.cc:82   index: 4, request: width: 2560, height: 800, format: Format::BGR888, fps: 10
I/utils.cc:82   index: 5, request: width: 2560, height: 800, format: Format::BGR888, fps: 20
I/utils.cc:82   index: 6, request: width: 2560, height: 800, format: Format::BGR888, fps: 30
I/utils.cc:93 There are 7 stream requests, select index: 
3
I/auto_exposure.cc:72 Enable auto-exposure
I/auto_exposure.cc:73 Set EXPOSURE_MODE to 0
I/auto_exposure.cc:75 Set MAX_GAIN to 8
I/auto_exposure.cc:76 Set MAX_EXPOSURE_TIME to 333
I/auto_exposure.cc:78 Set DESIRED_BRIGHTNESS to 122
I/auto_exposure.cc:80 Set MIN_EXPOSURE_TIME to 0

样例程序会显示图像,左上角有真实曝光时间,单位毫秒。

完整代码样例,请见 ctrl_auto_exposure.cc