OpenCV bucks the trend and stores color channels in BGR format, rather than RGB. In this video, learn how to look into color channels in more detail.
- [Instructor] Let's dig a little deeper … and understand what's happening with the three channels. … Each of the channels have … the same number of rows and columns. … Let's use the code from our previous section … as our starting point. … Now let's say we want to display the blue channel. … Then we want all of the rows and all of the columns, … which we represent as a colon in numpy, … and the first array is given by zero. … So, b is img, … all of the rows, all of the columns, … and because we have it in the bgr format … we want the first one, which is a zero. … And let's print that out, so print(b). … Save that, and let's run that in our command prompt. … And so I type in python, and then image.py. … And the reason we can't find the cv2 module … is because we haven't activated our virtual environment. … So I'm just going to do activate ocv4, … and then let's run that command again. … So python image.py. … And what we see here are the values of the numpy array. … Each color channel has different values, or intensities. …
- Deep learning for OpenCV
- Viewing images and video in OpenCV
- Working with blobs in the dnn module
- Image classification
- Video classification