hi every one .i am trying to acquire the video frames using the following codes .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a = imaqhwinfo; [camera_name, camera_id, format] = getCameraInfo(a);vid = videoinput(camera_name, camera_id, format);% Set the properties of the video object
set(vid, 'FramesPerTrigger', Inf);set(vid, 'ReturnedColorspace', 'rgb')vid.FrameGrabInterval = 5;%start the video aquisition here
start(vid)while(vid.FramesAcquired<=200)data = getsnapshot(vid);end%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%the camera info routine is as follows
function [camera_name, camera_id, resolution] = getCameraInfo(a)camera_name = char(a.InstalledAdaptors(end));camera_info = imaqhwinfo(camera_name);camera_id = camera_info.DeviceInfo.DeviceID(end);resolution = char(camera_info.DeviceInfo.SupportedFormats(end));%%%%%end of routine %%%
following are the errors i am getting
??? Error using ==> end Incorrect cell or structure reference involving "end". Most likely cause is a reference to multiple elements of a cell or structure followed by additional subscript or structure references.
Error in ==> getCameraInfo at 4 camera_id = camera_info.DeviceInfo.DeviceID(end);
Error in ==> redObjectTrack at 2 [camera_name, camera_id, format] = getCameraInfo(a);
please help me out of this ..Same codes are working for a desktop PC and a webcam..But when i try this on my laptop its not working ..
Best Answer