Filter löschen
Filter löschen

How Do I set Camera Exposure in MATLAB?

60 Ansichten (letzte 30 Tage)
jim
jim am 4 Apr. 2011
Kommentiert: KAE am 11 Mär. 2019
Hi, I was trying to adjust the exposure for my webcamera, I looked on my image Acquisition toolbox and when i adjust the exposer on there it seems to use the command 'src.Exposure = 10;' (for when you want the exposure to be 10)
I wanted to set my camera exposure to say 20, and i used the same idea but it doesnt seem to work? I tried it for other numbers eg, 60, 100 etc but it seems there is no affect.
Bellow shows the code i am using to test it.
imaqhwinfo ('winvideo', 1);
video = videoinput('winvideo',1,'RGB24_640x480');
src.Exposure = 20; % changes exposure
preview(video); %Launches video preview window

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 4 Apr. 2011
What is src in your code? Do you mean video.Exposure ?
  2 Kommentare
jim
jim am 4 Apr. 2011
Bearbeitet: Walter Roberson am 9 Mär. 2019
Hi, thanks for the reply i used this in the end.
vid = videoinput('winvideo', 1, 'RGB24_640x480');
src = getselectedsource(vid);
vid.FramesPerTrigger = 1;
preview(vid);
src.Exposure = 20;
KAE
KAE am 11 Mär. 2019
If you are having trouble I recommend troubleshooting with imaqtool which will list the command line commands as you change something like the exposure time.
This let me discover that I needed to add a ExposureTimeControl command before I changed the exposure time,
vid = videoinput('winvideo', 1, 'RGB24_640x480'); % Actually a different camera
src = getselectedsource(vid);
src.ExposureTimeControl = 'normal'; % Needed to alter the exposure time
src.ExposureTime = 2.0;
Also the units of ExposureTime are seconds...just mentioning this because it is not specified on the imaqtool GUI.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by