EYE BALL CURSOR MOVEMENT
USING OPENCV
In this
project we are instructing mouse cursor to change its location based on eye
ball movement, in this application using OPENCV we will connect to webcam and
then extract each frame from the webcam and pass to OPENCV to detect eye balls
location. Once eye ball location detected then we can extract x and y
coordinates of eye balls from OPENCV and then using python pyautogui API we can
instruct mouse to change its current location to given eyeballs X and Y Coordinates.
Below is the example to move mouse in python.
pyautogui.moveTo(int(data_x),int(data_y))
In above
line moveTo function move cursor to given data_x and data_y location
To
implement above concept we are using following modules
Video Recording:
Using this module we will connect application to webcam using OPENCV built-in
function called VideoCapture.
Frame Extraction:
Using this module we will grab frames from webcam and then extract each picture
frame by frame and send that frame to GazeTracking.
GazeTracking: Using this
module we can detect eyeballs and the extract x and y coordinates of both left
and right pupil.
MoveCursor: Using this
module we will instruct mouse to change its current location to given new x and
y location.
To
stop video recording from webcam press ‘Esc’ key.
OpenCV
is an artificial intelligence API available in python to perform various
operation on images/videos such as image recognition, face detection, eye
detection/eye ball tracking and convert images to gray or coloured images etc.
This API written in C++ languages and then make C++ functions available to call
from python using native language programming. Steps involved in face detection
using OpenCV.
Face Detection/Eye Detection Using
OpenCV
This
seems complex at first but it is very easy. Let me walk you through the entire
process and you will feel the same.
Step
1: Considering our prerequisites, we will require an image, to begin with.
Later we need to create a cascade classifier which will eventually give us the
features of the face.
Step
2: This step involves making use of OpenCV which will read the image and the
features file. So at this point, there are NumPy arrays at the primary data
points.
All
we need to do is to search for the row and column values of the face NumPyN
dimensional array. This is the array with the face rectangle coordinates.
Step
3: This final step involves displaying the image with the rectangular face box.
Screen
shots
To
run this project double click on ‘run.bat’ file to get below webcam screen.

thank you for your comment
pls call me on 8125424511