Given the limitations of template matching on orientation and lighting, other methods of face detection have developed over time. This module covers the use of another machine-learning-based face detection algorithm available with OpenCV. While in some ways similar to template matching, this method is much more robust and configurable for a particular use case.
- [Instructor] Now, let's take a look at the specific…use case of detecting faces in image…using the pre-learn hard classifier.…Again, note that detection is not the same…thing as recognition; we are only detecting if and where…faces are located in an image.…For this, we're going to use the pre-included hard classifier…found in the chapter four of module five folder.…You can see this is…the haarcascade_frontalface_default.xml file.…Now, let's jump into our scripting window where…we'll load up the chapter four module five python file.…Note that we've already loaded in our image;…faces.jpeg and fill color as indicated by the value of one.…
Next, for the actual classifier,…we want to turn this into gray scale.…For this, we can type gray equals cv2.cvtColor…and then pass img,cv2.COLOR_BGR2GRAY.…Next, let's actually define the path…for our xml file by typing path equals…"haarcascade_frontalface_default.xml".…
Next, let's actually create our cascade object.…To do this, we'll type face_cascade equals…cv2.CascadeClassifier and then we will pass in our path.…
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.