Skip to content

Latest commit

 

History

History
110 lines (77 loc) · 4 KB

manual_exposure.rst

File metadata and controls

110 lines (77 loc) · 4 KB

启用手动曝光及其调节

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

启用手动曝光,就是设定 Option::EXPOSURE_MODE1

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

  • Option::GAIN 增益。
  • Option::BRIGHTNESS 亮度,或者说曝光时间。
  • Option::CONTRAST 对比度,或者说黑电平校准。

以s2100/s210a为例,手动曝光时,可调节的设定有:

  • Option::BRIGHTNESS 亮度,或者说曝光时间。

参考代码片段:

s1030:

s2100/s210a:

参考运行结果,于 Linux 上:

s1030:

$ ./samples/_output/bin/tutorials/ctrl_manual_exposure
I0513 14:09:17.104431 31908 utils.cc:26] Detecting MYNT EYE devices
I0513 14:09:17.501519 31908 utils.cc:33] MYNT EYE devices:
I0513 14:09:17.501551 31908 utils.cc:37]   index: 0, name: MYNT-EYE-S1000
I0513 14:09:17.501562 31908 utils.cc:43] Only one MYNT EYE device, select index: 0
I0513 14:09:17.552918 31908 manual_exposure.cc:37] Enable manual-exposure
I0513 14:09:17.552953 31908 manual_exposure.cc:38] Set GAIN to 24
I0513 14:09:17.552958 31908 manual_exposure.cc:39] Set BRIGHTNESS to 120
I0513 14:09:17.552963 31908 manual_exposure.cc:40] Set CONTRAST to 116

s2100/s210a:

$ ./samples/_output/bin/tutorials/ctrl_manual_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/manual_exposure.cc:62 Enable manual-exposure
I/manual_exposure.cc:63 Set EXPOSURE_MODE to 1
I/manual_exposure.cc:65 Set BRIGHTNESS to 120

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

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