OpenCV is an open source computer vision library that works with many programming languages and provides a vast scope to understand the subject of computer vision.In this example we will use OpenCV to open the camera of the system and capture the video in two different colors.
Approach: With the libraries available in OpenCV-Python below we will open two different windows, one window will show live camera result in coloured form and the another will display the same in grayscale (black and white).The code is as below
cv2 library installs automatically when openCV is installed.In order to install numpy use the following command at the cmd/linux terminal:
pip install numpy
Run the above code on your own system so that you can install the required libraries and more
- Color Spaces in OpenCV | Python
- Python | OpenCV BGR color palette with trackbars
- Detection of a specific color(blue here) using OpenCV with Python
- Python | Create video using multiple images using OpenCV
- Filter Color with OpenCV
- Python | Morphological Operations in Image Processing (Opening) | Set-1
- Windows 10 Toast Notifications with Python
- Guide to Install MongoDB with Python | Windows
- Autorun a Python script on windows startup
- How to download and install Python Latest Version on Windows
- Python | How to download windows lock-screen wallpapers
- Creating Python Virtual Environment in Windows and Linux
- Python OpenCV | cv2.imread() method
- Image Pyramid using OpenCV | Python
- Python OpenCV | cv2.ellipse() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.