1 | initial version |
Your answer : http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=videocapture#VideoCapture
The VideoCapture functionality does all you want, by reading directly frames from your webcam :)