I am trying to use a webcam in a function that i run with the gui while at the same time displaying the live video of the webcam in my gui. I can so far get the live video on my gui but when I try to start my function with the gui i get this error below. I have made vid global in my function not the gui and that's how i got the live video to display on the gui finally but i still cant figure out what to do to get both the function and my gui using the one webcam.
Thanks in advance!!!!!!
Error using videoinput (line 379)
winvideo: The device associated with device ID 1 is already in use. A new videoinput object cannot be created for this device while it is in use.
Error in AutofocusGUIGOOD (line 8) vid = videoinput('winvideo', 1, 'YUY2_640x480');
Error in LIBSGUI624>pushbutton1_Callback (line 89) AutofocusGUIGOOD(Ss , SR);
Error in gui_mainfcn (line 96) feval(varargin{:});
Error in LIBSGUI624 (line 43) gui_mainfcn(gui_State, varargin{:});
Best Answer