To grab frames from a computer's webcam, or even from a video file, you can simply call the VideoCapture::open() function with the camera number or video filename, then grab the frames using the C++ stream operator, as mentioned in the, Accessing the webcam section in Chapter 13, Cartoonifier and Skin Color Analysis on the Raspberry Pi.