Thursday, 15 August 2013

Hands Free Mouse Pointer Control with OpenCV

So I've been busy with a lot of things lately and one of the things I've been working on is a program that tracks a coloured marker (I use a lime green ball) using my laptop's webcam and controls the movement of the my mouse pointer.

I posted the code on github. Note that I did this on Ubuntu with xdotool installed. So this code won't compile and run unless you have Linux with xdotool installed.

Here's a video demonstration of the program working:

What I'm really impressed with is extremely low latency I can achieve with this program. Since I was using real time image processing I expected there to be a significant lag in the movement of the mouse when compared to the movement of the ball. But as it turns out, the latency is almost unnoticeable. Hopefully I can develop this into a full blown hands free interface for my laptop.