How to change the camera settings (auto exposure, shutter speed, gain)?

I use Matlab to capture images from 2-point gray cameras (Flea2), and I would like to change some parameters of cameras like Auto Exposure, Gain and Shutter Speed. So far I have used these commands:

%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) 

So, if I display the variables src1 and src2, these properties have been changed, but when I look at the cameras, nothing has changed.

When always using the same syntax to change the frame rate, I succeeded.

+7
image-processing matlab computer-vision camera
source share
1 answer

I solved this problem by installing the Image capture tool Support Package for the Point Gray hardware server . Then you need to change the adapter type using the Point Gray driver:

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

Now you can set the normal camera properties (auto exposure, shutter speed, gain) through Matlab. For example, if you want to set a specific shutter value:

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

As for my question, I believe that the specific properties of the Point Gray camera device cannot be edited directly through MATLAB using the dcam driver, but to change these properties you need to use the Matlab support package for Point Gray hardware.

+1
source share

All Articles