Giter Club home page Giter Club logo

face-detection-and-tracking's Introduction

Face-detection-and-tracking

This is a basic project to demonstrate a face detection and tracking system using python and opencv on a jetson nano developement board.

Setting up the environment:

  1. Hardware requirements.
  2. Software requirements.

Hardware requirements:

  1. A jetson nano developement kit
  2. Two raspberry pi v2 8MP camera.
  3. A stereo camera actuator system.

Here we are using jetson nano developement board as master computer and two raspberry pi v2 camera for capturing images. We can connect two CSI camera to jetson nano b01, since it support two CSI camera port.

The next important part is the servo assisted stereo camera holder to achive pan and tilt movement of the camera. For this we will be using the "Stereo_Camera_Actuator" system. Please refer this repository https://github.com/asujaykk/Stereo_Camera_Actuator to build one.

Software requirements:

First boot your jetson nano developement board with latest JDK. Then we need to install the following modules and libraries.

  1. First clone this repository to your working directory.

     git clone https://github.com/asujaykk/Face-detection-and-tracking.git
    
  2. Camera module : To read images from two cameras. Add Camera module to "Face-detection-and-tracking" folder.

     cd Face-detection-and-tracking
     git clone https://github.com/asujaykk/Camera.git
    
  3. Serial module : To send command to Stereo_Camera_Actuator for changing camera angle. Serial module need to be installed in your PC using below command

     pip3 install pyserial
    
  4. OpenCv library : For detecting and tracking face in the image. Opencv is pre installed in jetson SDK. So no need to install it explicitly.

Running the face tracker.

First connect 'Stereo_Camera_System' (arduino board) to jetson nano via usb cable.
Connect LEFT camera to CAM0 CSI port.
Connect RIGHT camera to CAM1 CSI port.

  1. Open terminal and navigate to your working directory

  2. Open Face-detection-and-tracking directory:

     cd Face-detection-and-tracking
    
  3. Run the following command to start face tracking process.

     python3 face_tracker.py
    

    If you are getting permission error with serial port, then please run below command .

     sudo chmod 666 /dev/ttyACM0
    

    Also restart the 'nvargus-daemon' with below command. to release the two camera instances which was not closed properly in the first run.

     sudo systemctl restart nvargus-daemon
    

    Then again run 'python3 face_tracker.py'

  4. If the system is working fine, then you will receive the folloing messages on the terminal.
    SCA initializing...
    SCA initialized.

    After this message, two camera stream window will appear (one for left camera and another for right camera). If there is any face detected in the frame, then the overall system will continously track that face until the face leave the visible range of the camera.

  5. The following GIF shows the output of the detection and tracking system. 20221105_010505

face-detection-and-tracking's People

Contributors

asujaykk avatar

Watchers

 avatar  avatar

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.