All Projects → antoinelame → Gazetracking

antoinelame / Gazetracking

Licence: mit
👀 Eye Tracking library easily implementable to your projects

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Gazetracking

Tiler
Tiler is a tool to create an image using all kinds of other smaller images (tiles). It is different from other mosaic tools since it can adapt to tiles with multiple shapes and sizes (i.e. not limited to squares).
Stars: ✭ 4,681 (+585.36%)
Mutual labels:  opencv
Javacv
Java interface to OpenCV, FFmpeg, and more
Stars: ✭ 5,543 (+711.57%)
Mutual labels:  opencv
Opencv
OpenCV projects: Face Recognition, Machine Learning, Colormaps, Local Binary Patterns, Examples...
Stars: ✭ 624 (-8.64%)
Mutual labels:  opencv
Shape based matching
try to implement halcon shape based matching, refer to machine vision algorithms and applications, page 317 3.11.5, written by halcon engineers
Stars: ✭ 496 (-27.38%)
Mutual labels:  opencv
Speed Camera
A Unix, Windows, Raspberry Pi Object Speed Camera using python, opencv, video streaming, motion tracking. Includes a Standalone Web Server Interface, Image Search using opencv template match and a whiptail Admin Menu Interface Includes picam and webcam Plugins for motion track security camera configuration including rclone sync script. watch-app allows remotely controller camera configuration from a remote storage service name. Uses sqlite3 and gnuplot for reporting. Recently added openalpr license plate reader support.
Stars: ✭ 539 (-21.08%)
Mutual labels:  opencv
Vehicle counting tensorflow
🚘 "MORE THAN VEHICLE COUNTING!" This project provides prediction for speed, color and size of the vehicles with TensorFlow Object Counting API.
Stars: ✭ 582 (-14.79%)
Mutual labels:  opencv
Head Pose Estimation
Real-time head pose estimation built with OpenCV and dlib
Stars: ✭ 467 (-31.63%)
Mutual labels:  opencv
Makeup
让你的“女神”逆袭,代码撸彩妆(画妆)
Stars: ✭ 655 (-4.1%)
Mutual labels:  opencv
Scanner
二维码/条码识别、身份证识别、银行卡识别、车牌识别、图片文字识别、黄图识别、驾驶证(驾照)识别
Stars: ✭ 547 (-19.91%)
Mutual labels:  opencv
Cvui
A (very) simple UI lib built on top of OpenCV drawing primitives
Stars: ✭ 619 (-9.37%)
Mutual labels:  opencv
Openvino Yolov3
YoloV3/tiny-YoloV3+RaspberryPi3/Ubuntu LaptopPC+NCS/NCS2+USB Camera+Python+OpenVINO
Stars: ✭ 500 (-26.79%)
Mutual labels:  opencv
Php Opencv
PHP extensions for OpenCV
Stars: ✭ 524 (-23.28%)
Mutual labels:  opencv
Faceswap
Real-time FaceSwap application built with OpenCV and dlib
Stars: ✭ 611 (-10.54%)
Mutual labels:  opencv
Zxing Cpp
ZXing C++ Library
Stars: ✭ 483 (-29.28%)
Mutual labels:  opencv
Opencv for ios book samples
"OpenCV for iOS" book samples
Stars: ✭ 640 (-6.3%)
Mutual labels:  opencv
Rpa
UI.Vision: Open-Source RPA Software (formerly Kantu) - Modern Robotic Process Automation with Selenium IDE++
Stars: ✭ 477 (-30.16%)
Mutual labels:  opencv
3dv tutorial
An Invitation to 3D Vision: A Tutorial for Everyone
Stars: ✭ 571 (-16.4%)
Mutual labels:  opencv
Captcha Break
captcha break based on opencv2, tesseract-ocr and some machine learning algorithm.
Stars: ✭ 667 (-2.34%)
Mutual labels:  opencv
Mvision
机器人视觉 移动机器人 VS-SLAM ORB-SLAM2 深度学习目标检测 yolov3 行为检测 opencv PCL 机器学习 无人驾驶
Stars: ✭ 6,140 (+798.98%)
Mutual labels:  opencv
Ofxcv
Alternative approach to interfacing with OpenCv from openFrameworks.
Stars: ✭ 614 (-10.1%)
Mutual labels:  opencv

Gaze Tracking

made-with-python Open Source Love License: MIT GitHub stars

This is a Python (2 and 3) library that provides a webcam-based eye tracking system. It gives you the exact position of the pupils and the gaze direction, in real time.

Demo

🚀 Quick note: I'm looking for job opportunities as a software developer, for exciting projects in ambitious companies. Anywhere in the world. Send me an email!

Installation

Clone this project:

git clone https://github.com/antoinelame/GazeTracking.git

Install these dependencies (NumPy, OpenCV, Dlib):

pip install -r requirements.txt

The Dlib library has four primary prerequisites: Boost, Boost.Python, CMake and X11/XQuartx. If you doesn't have them, you can read this article to know how to easily install them.

Run the demo:

python example.py

Simple Demo

import cv2
from gaze_tracking import GazeTracking

gaze = GazeTracking()
webcam = cv2.VideoCapture(0)

while True:
    _, frame = webcam.read()
    gaze.refresh(frame)

    new_frame = gaze.annotated_frame()
    text = ""

    if gaze.is_right():
        text = "Looking right"
    elif gaze.is_left():
        text = "Looking left"
    elif gaze.is_center():
        text = "Looking center"

    cv2.putText(new_frame, text, (60, 60), cv2.FONT_HERSHEY_DUPLEX, 2, (255, 0, 0), 2)
    cv2.imshow("Demo", new_frame)

    if cv2.waitKey(1) == 27:
        break

Documentation

In the following examples, gaze refers to an instance of the GazeTracking class.

Refresh the frame

gaze.refresh(frame)

Pass the frame to analyze (numpy.ndarray). If you want to work with a video stream, you need to put this instruction in a loop, like the example above.

Position of the left pupil

gaze.pupil_left_coords()

Returns the coordinates (x,y) of the left pupil.

Position of the right pupil

gaze.pupil_right_coords()

Returns the coordinates (x,y) of the right pupil.

Looking to the left

gaze.is_left()

Returns True if the user is looking to the left.

Looking to the right

gaze.is_right()

Returns True if the user is looking to the right.

Looking at the center

gaze.is_center()

Returns True if the user is looking at the center.

Horizontal direction of the gaze

ratio = gaze.horizontal_ratio()

Returns a number between 0.0 and 1.0 that indicates the horizontal direction of the gaze. The extreme right is 0.0, the center is 0.5 and the extreme left is 1.0.

Vertical direction of the gaze

ratio = gaze.vertical_ratio()

Returns a number between 0.0 and 1.0 that indicates the vertical direction of the gaze. The extreme top is 0.0, the center is 0.5 and the extreme bottom is 1.0.

Blinking

gaze.is_blinking()

Returns True if the user's eyes are closed.

Webcam frame

frame = gaze.annotated_frame()

Returns the main frame with pupils highlighted.

You want to help?

Your suggestions, bugs reports and pull requests are welcome and appreciated. You can also starring ⭐️ the project!

If the detection of your pupils is not completely optimal, you can send me a video sample of you looking in different directions. I would use it to improve the algorithm.

Licensing

This project is released by Antoine Lamé under the terms of the MIT Open Source License. View LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].