Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
here they are using this code to acquire video :

C#
hVideoSrc = vision.VideoFileReader; 
hVideoSrc.Filename = 'viptrain.avi'; 
hVideoSrc.VideoOutputDataType = 'single';


i would like to replace that part with:

C#
vid=videoinput('winvideo',1); 
start(vid); 
preview(vid);


how can i do that ? please help.
Posted
Updated 13-May-12 19:41pm
v2

1 solution

cam = videoinput('winvideo',1,'YUY2_640x480');
       cam.ReturnedColorSpace = 'RGB';%Return in RGB format
       cam.TriggerRepeat = Inf;%triggers the camera repeatedly (infinity = Inf)
       cam.FrameGrabInterval = 2; %Time btw frames
       cam_on = 'false';
   try
       start(cam); %start capturing the video
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900