This Video Shows how to Capture and save the camera feed using OpenCV. It also Details how to select different cameras.
As always, To compare your scripts, if you have issues, I have included notes and the completed scripts at the bottom of the page which you can view or download from my Google Drive. The scripts also have notes as comments which appear after a #.
Remember if you can’t view fullscreen, you can right click the ‘youtube’ icon in the bottom right and select ‘view on Youtube.com’
The supplementary information can be found on the official OpenCV website https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html
The # is used in python to comment code after it on the same line. The importance of using this to comment code is the compiler ignores this when running the code but anyone coming later to work with your code can see why you have used the code you have or any notes you may have put in to modify it.
Some people say that “””comments””” is ok for multi line comments but this is wrong as it can get you into trouble. This is because it is a ‘docstring’ which is treated slightly differently. more info on ‘docstrings’ and their rules can be found here https://www.python.org/dev/peps/pep-0257/ but it is a slightly more advanced topic that you should save for later. Just remember only use a ‘#’ for comments on each line.
Github OpenCV repository https://github.com/opencv/opencv/
Below is the link to the Google Drive repository for this lesson. You can either view online or download.