GithubHelp home page GithubHelp logo

face_detection_using_rpi's Introduction

Face Detection & Recognition using OpenCV with Raspberry Pi

This Repository will explain my 4th task in Robotics and AI department at SMART METHODS summer training.

Task Requirements:

  • Use OpenCV for making a real time face detection and recognition in Raspberry Pi.

Detailed Steps:

  1. Configure the Raspbeery Pi to control the controller remotely (Click Here).

  2. Create your Python virtual environment and install NumPy then Compile OpenCV 4 from source (Click Here for full installation details).

  3. Camera Test:

    • Test the camera using this Code in full details with commenet.

    • Run the virtual environment workon cv

    • Open the path file if you have saved your .py file in a directory using cd command, in my case I will run the folowing command cd Face_Recognition/Face_Detection

    • Run you camera test file by using python folowed by your file name, in my case python Face_Detection.py

    • I will use a usb camera as shown in the figure:

    • Tested result will show an image in a Gray and RGB color:

  4. Face Detection:

    • To recognise a face first we should captutre the face (detecte it).The most common way used to detect a face or any objects, is using the "Haar Cascade classifier" (It is a machine learning based approach where a cascade function is trained from a lot of positive and negative images, It is then used to detect objects in other images).To detect faces the algorithm needs a lot of positive images (images of faces) and negative images (images without faces) to train the classifier. Then we need to extract features from it. OpenCV comes with a trainer as well as a detector. If we want to train our classifier for any object like car, planes etc. we can use OpenCV to create one using "Cascade Classifier Training".
    • The good news is that OpenCV comes with a trainer as well as a detector and we will used it to detect faces. To see my code with comments, Click here.
    • As shown in the figure below my face was detected successfully:
  5. Face and Eye Detection:

    • Now, lets detect the eyes of the face. To do that we should include the classifier for the eyes as we did in the face detection.
    • Note that, on those cases, we will include the classifier function and rectangle draw inside the face loop, because there would be no sense to detect an eye outside of a face.
    • To see my code with full comments, Click here.
    • Tested Result:
  6. Face Recognition

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.