Skip to content

This C++ program utilizes the OpenCV library for real-time face detection. It captures video from a camera and employs Haar cascades to identify and highlight faces in each frame. The detected faces are outlined with rectangles, and the application displays the count of faces found on the top left corner.

License

Notifications You must be signed in to change notification settings

shyakachaste/facedetection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Detection with OpenCV

This repository contains a simple C++ program for face detection using OpenCV. The program captures video from a camera and uses Haar cascades for face detection.

Prerequisites

Before running the program, make sure you have the following installed:

  • OpenCV: You can install it using your preferred package manager or by building it from source. Ensure that OpenCV is properly linked in your project.

Program Features

  • Face detection using Haar cascades.
  • Displays the number of faces found in each frame.
  • Draws rectangles around detected faces.
  • Shows a count of the faces found on the top left corner.

Usage

The program captures video from the default camera (camera index 1). Adjust the camera index in the code if needed.

Press the 'Esc' key to exit the program.

Haar Cascade XML File

The program uses the Haar cascade file haarcascade_frontalface_default.xml for face detection. Ensure that this file is present in the same directory as the executable or provide the correct path in the code.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Feel free to modify and use the code according to your needs.

About

This C++ program utilizes the OpenCV library for real-time face detection. It captures video from a camera and employs Haar cascades to identify and highlight faces in each frame. The detected faces are outlined with rectangles, and the application displays the count of faces found on the top left corner.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages