Skip to content

Goal651/face_movement_detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Direction Tracker IoT

This is an IoT project. It uses a camera to see your face. It moves a motor to follow your face.

What It Does

  • Finds faces in camera picture
  • Watches face movement left and right
  • Turns motor left or right when face moves
  • Shows boxes and lines on screen
  • Sends commands to Arduino
  • Can work without Arduino for testing
  • You can change settings

What You Need (Hardware)

  • Arduino board
  • Stepper motor
  • Camera (webcam or laptop camera)
  • USB cable

What You Need (Software)

  • Python 3.7 or newer
  • OpenCV
  • NumPy
  • PySerial

How to Start

  1. Get project files
  2. Install programs: pip install -r requirements.txt
  3. Upload Arduino code to board
  4. Connect motor to Arduino pins 8,9,10,11
  5. Connect Arduino to computer

How to Run

Run: python3 index.py

Press 'q' to stop.

How to Change Settings

In index.py, change numbers:

  • MOVEMENT_THRESHOLD = 10 (how much face moves to turn motor)
  • LEFT_ROTATION = -25 (degrees left)
  • RIGHT_ROTATION = 25 (degrees right)
  • SCALE_FACTOR = 1.1 (face finder sensitivity)
  • MIN_NEIGHBORS = 3 (face finder strictness)

How It Works

  1. Find face in picture
  2. Find center of face
  3. Check if face moved
  4. Send turn command to Arduino
  5. Arduino turns motor

Arduino Commands

Python sends: rotate 25 or rotate -10

Number is degrees (positive = one way, negative = other way).

Problems?

  • "Arduino not found": Check USB and cable
  • No face found: Good light, closer to camera
  • Motor not moving: Check Arduino code and wires
  • Wrong turn: Change LEFT_ROTATION and RIGHT_ROTATION

Files

  • index.py - Main program
  • stepper_motor_angle_control.ino - Arduino code
  • requirements.txt - Programs to install
  • USAGE.md - More help

Future

  • Add up/down motor
  • Smoother motor moves
  • Auto center button
  • Web page control
  • Follow different people

License

Free to use and share.

About

This is a software whihc detects human face and follow him

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors