function vid=CamAutoassign10(dev_PS3Eye,res,dev_Quickcam) %% CAM ASSIGN % Automatically creates an image acquisition object if a PS3Eye or a % Quickcam is connected. if length(dev_PS3Eye)>0 if res==320 format='RGB32_320x240'; elseif res==640 format='RGB32_640x480'; else format='RGB32_640x480'; warning('the value set for "PS3res" is not valid, the defaukt value is used (640)') % Format of the video from the PS3Eye; must be: 'RGB32_320x240' or 'RGB32_640x480' end vid = videoinput('winvideo',dev_PS3Eye(1),format); disp(' ') disp('Cam Autoassign') disp(sprintf('1st PS3Eye (of %d) assigned as video source (winvideo device nb %d)',length(dev_PS3Eye),dev_PS3Eye(1))) elseif length(dev_Quickcam)>0 vid = videoinput('winvideo',dev_Quickcam(1)); disp(' ') disp('CAM AUTOASSIGN') disp(sprintf('1st Quickcam zoom (of %d) assigned as video source (winvideo device nb %d)',length(dev_Quickcam),dev_Quickcam(1))) else error('No camera of known type is connected, please create the image acquisition object manually') end