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

时间:2016-02-27 18:02:15

标签: matlab image-processing camera computer-vision image-capture

我正在使用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)

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

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

1 个答案:

答案 0 :(得分:1)

我解决了安装Image Acquisition Toolbox Support Package for Point Grey Hardware的问题。 然后,您需要使用点灰色驱动程序更改适配器类型:

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

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

src = getselectedsource(cam);
set(src, 'Shutter', value)

关于我的问题,我认为Point Grey摄像机的设备特定属性不能通过MATLAB使用 dcam 驱动程序直接编辑,但为了修改这些属性,您需要使用Matlab支持包对于Point Grey Hardware。

相关问题