Skip to content

An image recognition to play Chrome Dinosaur game with the face

License

Notifications You must be signed in to change notification settings

Lucisu/DinosaurFace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dinosaur Face

An image recognition to play Chrome Dinosaur game with the face



Installation

$ git clone https://github.com/Lucisu/DinosaurFace.git
$ cd DinosaurFace
$ pip3 install -r requirements.txt
Don't forget: You need install CMake before install Dlib

Execute

Open Chrome, with the game, and:

$ python3 main.py
Note
When the script starts, it will try to find the dinosaur. If finded, the frame with your webcam video will be displayed, and you need click on Chrome window to focus.

How does it work

First, script try to find the dinosaur, to prevent launching keys in the wrong place.

After that, using shape_predictor_68_face_landmarks.dat and OpenCV, we can track some face points.

The main points are in the sides and in the nose. Based on difference between nose height and sides of the face, generate the key press.

Lift your nose to jump, lower it to lower the dinosaur.

It's very simple, but cool :)

About

An image recognition to play Chrome Dinosaur game with the face

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages