Hi,
I am trying to change the exposure time with an Edit Field, but I am problem accessing the camera properties wihin the app.
For example I define the camera properties as 'scr', then I set Camera Exposure and other properties when the camera starts.
% Code that executes after component creation
function startupFcn(app) clc delete(imaqfind); % Create video object
imaqreset % resettar videoiput
app.VidObj = videoinput('gentl', 1, 'Mono12'); % camera properties
scr=getselectedsource(app.VidObj); % setting the exposure time
scr.ExposureTimeAbs = 100000; % us 100 ms = 100'000 us
But then I want to add some kind of editable field (like EditField) where I can enter a number that will set the exposure time of the camera. Like, ..
function ExposureTimemsEditFieldValueChanged(app, event) value = app.ExposureTimemsEditField.Value; % in ms
% 100 ms = 100'000us; 1 ms = 1000 us
% camera properties 'again'
scr=getselectedsource(app.VidObj); scr.ExposureTimeAbs = value*1000; % anges i us
disp(['The exposure time was changed to ',num2str(value),' microseconds'])
However, the scr does not "exist" here as it is not a global property. I tried to add it as a global object, bu it didnt like the app.scr everywhere. So I call the scr again with getselectedsource function. Nothing seems to be happening though.
How can i change the exposure time "again" so it will change?
I have tried to change the exposuretime here with code above, but it seems to be nothing happening.
Best Answer