Learn more about working with image channels and color spaces, and about efficient traversing through matrices.
- [Instructor] Let's dive further into working…with image channels and manipulating groups of pixels.…I'll start off by importing…Numpy as NP…followed by import CV2.…Then we'll load in our butterfly image again…using color equals CV2.imread and then…in quotations, butterfly.jpg and again…we'll specify one for a full color load.…Next, let's see about converting the number…of channels from three down to one.…
Or in other words converting this…to a grayscale image.…You can type gray equals CV2.cvt color…where the C is capitalized in color.…And then we'll pass in our color variable…followed by CV2 dot and in all caps Color underscore…RGB the number two and then G-R-A-Y.…We can then write this image back out to disc…using CV2.imwrite and then indicate…the name you want to save it out to such as Gray.jpg…and then pass in our variable gray.…
When you run the script, instead of showing it…in the user interface it's going to simply write…this file out to the disc.…Next let's take a look at what we can do…to add an additional channel to an image already loaded.…
AuthorPatrick W. Crawford
- Installing and configuring OpenCV
- Data types and structures
- Image types
- Manipulating pixels
- Scaling and rotating images
- Using video inputs
- Creating custom interfaces
- Object detection
- Face and feature detection
- Template matching
Skill Level Intermediate
NumPy Data Science Essential Trainingwith Charles Kelly3h 54m Intermediate
Python: Programming Efficientlywith Michele Vallisneri2h 15m Intermediate
1. Install and Configure OpenCV
2. Basic Image Operations
3. Object Detection
4. Face and Feature Detection
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.