Skip to content

vargheesk/face-detection-using-haar-cascade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✨ Face Detection using Haar Cascade

🎯 Overview

This project provides a simple, yet classic, implementation of real-time face detection using the Haar Cascade classifier from the OpenCV (Open Source Computer Vision Library).

The Haar Cascade algorithm is a machine learning-based approach where a cascade function is trained from a large number of positive (images with faces) and negative (images without faces) images. This technique is highly effective for fast, robust, and real-time object detection.

🌟 Features

  • Face Detection: Accurately identifies human faces in a static image.
  • Bounding Box Visualization: Draws a rectangle around each detected face.
  • Lightweight Implementation: Relies primarily on the optimized OpenCV library.
  • Jupyter Notebook Interface: Easy-to-follow, interactive execution via prj.ipynb.

⚙️ Technologies Used

Technology Purpose Icon
Python Primary programming language 🐍
OpenCV (cv2) Core computer vision and Haar Cascade engine 🤖
Matplotlib Visualization of the final output image 🖼️
Jupyter Notebook Interactive environment for running the code 📓

📂 Project Structure

This repository contains the necessary files to execute the face detection program.

File Name Description Icon
prj.ipynb The main Jupyter Notebook containing all the detection code. [code: prj.ipynb]
haarcascade_frontalface_default.xml The pre-trained Haar Cascade classifier XML file for frontal face detection. This is essential for the OpenCV process. [code: haarcascade_frontalface_default.xml]
image.jpg A sample image used by the notebook for demonstration purposes. [code: image.jpg]
.gitignore Standard file for ignoring temporary/unwanted files. [code: .gitignore]

🛠️ Prerequisites & Setup

To run this project, you need Python and the core libraries installed.

1. Install Python

Ensure you have Python 3.x installed on your system.

2. Install Dependencies

Install the required libraries using pip. It is highly recommended to use a virtual environment.

# Create a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`

# Install required libraries
pip install opencv-python matplotlib jupyter

About

This repository jumpstarts the computer vision journey with a classic implementation of face detection. Utilizing OpenCV's Haar Cascade classifier, it provides efficient scripts for identifying faces in images and real-time video streams using pre-trained models.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors