如何更改相机参数(自动曝光,快门速度,增益)?

Pol*_*Pol 8 matlab camera image-capture image-processing computer-vision

我正在使用Matlab从2点灰度相机(Flea2)中捕捉图像,我想更改相机的一些参数,如自动曝光,增益和快门速度.到目前为止,我使用了这些命令:

%Creating the two video input of the two cameras
cam1 = videoinput('dcam',1,'Y8_640x480');
cam2 = videoinput('dcam',2,'Y8_640x480');
%get devices properties
src1 = getselectedsource(cam1);
src2 = getselectedsource(cam2);
%define and set parameters to be changed
properties = {'AutoExposureAbsolute','AutoExposureControl', 'AutoExposureMode', 'GainAbsolute', 'GainControl', 'GainMode','ShutterAbsolute','ShutterControl', 'ShutterMode'};
values = {0,'absolute', 'manual', 0,'absolute', 'manual', 0, 'manual', 5e-06, 'absolute', 'manual'};
set(src1, properties, values)
set(src2, properties, values)
Run Code Online (Sandbox Code Playgroud)

因此,如果我显示src1和src2变量,上面的属性已经被修改,但是当我预览相机时没有任何改变.

虽然使用相同的语法来改变帧速率,但我很成功.

Pol*_*Pol 1

我通过安装Point Grey Hardware 的图像采集工具箱支持包解决了这个问题。然后,您需要使用 Point Grey 驱动程序更改适配器类型:

cam = videoinput('pointgrey',1,'Mono8_640x480');

现在,您可以通过Matlab正常设置相机的属性(自动曝光、快门速度、增益)。例如,如果您想设置快门的特定值:

src = getselectedsource(cam);
set(src, 'Shutter', value)
Run Code Online (Sandbox Code Playgroud)

关于我的问题,我认为 Point Grey 相机的设备特定属性无法使用dcam驱动程序直接通过 MATLAB 进行编辑,但为了修改此类属性,您需要使用 Point Grey 硬件的 Matlab 支持包。