Info

This question is closed. Reopen it to edit or answer.

two cameras simultaneously on a gui / timer issues

1 view (last 30 days)
Dimitrios
Dimitrios on 5 Feb 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
Dear all, I am building a gui with guide and I need to have two axes running live videos simultaneously and controlled separately. The videos are actually series of images in a while loop. After searching a bit, I think I could use timer to do that. Unfortunately I have problems implementing it, it keeps giving me an error - too many input arguments and I don't understand why. Below is the part of the code, as clean as possible, with the while loop and after that the one with the timer.
function pvideo_Callback(hObject, eventdata, handles)
%...
%functions to set camera/sensor parameters
%...
handles.Stop=0;
guidata(hObject, handles);
while gstatus==20072
[returnCode,video]=GetMostRecentImage(xpixels*ypixels);
for fil=1:ypixels
for col=1:xpixels
im1(fil,col)=video(xpixels*(fil-1)+col);
end
end
axes(handles.lucvid),imagesc(im1), colormap gray
end
Here is a try with the use of timer
function pvideo_Callback(hObject, eventdata, handles)
%...
%functions to set camera/sensor parameters
%...
handles.timer1 = timer('ExecutionMode', 'fixedRate','Period', 1, ...
'TimerFcn', {@Luca_Frame_Callback,hObject, handles});
start(handles.timer1);
guidata(hObject,handles);
function Luca_Frame_Callback(hObject, handles)
[returnCode,video]=GetMostRecentImage(xpixels*ypixels);
for fil=1:ypixels
for col=1:xpixels
im1(fil,col)=video(xpixels*(fil-1)+col);
end
end
axes(handles.lucvid),imagesc(im1), colormap gray
  1 Comment
Sean de Wolski
Sean de Wolski on 5 Feb 2014
Have you tried using the Image Acquisition Toolbox? It provides some of the framework for you.

Answers (0)

Community Treasure Hunt

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

Start Hunting!