How to change camera parameters (auto exposure, shutter speed, gain)?
Asked Answered
P

1

8

I am using Matlab to capture images from 2 Point Grey Cameras (Flea2) and I would like to change some parameters of the cameras such as 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 src1 and src2 variables the above properties has been modified but when I preview the cameras nothing has changed.

While using always the same syntax for changing the frame rate I am successful.

Poltroon answered 27/2, 2016 at 18:2 Comment(2)
I assume you hit a bug in the driver. I would try it with some other library (opencv?) and check if the same error exists. If so you can be sure the camera manufacturer caused the issue.Daughter
did you ask Point Grey support yet?Plunk
P
1

I solved this problem installing the Image Acquisition Toolbox Support Package for Point Grey Hardware. Then, you need to change the adapter type using the Point Grey driver:

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

Now, you can set normally the properties of the cameras (auto exposure, shutter speed, gain) through Matlab. For example, if you want so set a specific value of the Shutter:

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

Concerning my question I suppose that the device specific properties of Point Grey cameras cannot be edited directly through MATLAB with the dcam driver, but in order to modify such properties you need to use the Matlab support package for Point Grey Hardware.

Poltroon answered 8/3, 2016 at 13:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.