Skip to content

Instantly share code, notes, and snippets.

@harrisonhjones
Created October 27, 2014 18:44
Show Gist options
  • Save harrisonhjones/13b45f7be3059cca6982 to your computer and use it in GitHub Desktop.
Save harrisonhjones/13b45f7be3059cca6982 to your computer and use it in GitHub Desktop.
vid = videoinput('winvideo', 1, 'RGB24_320x240'); %select input device
hvpc = vision.VideoPlayer; %create video player object
src = getselectedsource(vid);
vid.FramesPerTrigger =1;
vid.TriggerRepeat = Inf;
vid.ReturnedColorspace = 'rgb';
src.FrameRate = '30';
start(vid)
%start main loop for image acquisition
for t=1:500
imgO=getdata(vid,1,'uint8'); %get image from camera
hvpc.step(imgO); %see current image in player
end
@harrisonhjones
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment