Mouse control via webcam

DMouse was developed as a simple and easy-to-use application that allows you to control your mouse cursor with the help of a webcam.

Now, you can perform various actions with the help of your hand. All you have to do is calibrate it and you’re ready to go.

How to use DMouse:

Birth story of DMouse-How it was born: DMouse’s Birth (Scroll Down).

First Run!

Wireless Angry Birds with DMouse:

Short Story on DMouse’s Birth:

I always thought how do these computer geeks work with image processing and was eagerly waiting for this subject throughout my career .My liking towards this subject is also but obvious because I believe that if god can create human beings like us ,give us brains faster than core-i7,eyes having resolution far more than 12MP, than at least as a human being I am able to provide some intelligence to any machine.
I remember on incident of some robbery happened in our neighborhood when I was in 5th semester, at that time it clicked in my mind -if there were a camera mounted on the vault then it would have detected the missing ornament just by subtracting the two images-before and after. But 5th semester was too early for that and I wondered if such a thing might be practically possible.
Finally it was possible on the day I met the ultimate software-MATLAB, I have to admit here-”Its capabilities are out of this world”. Just think of doing any damn thing with your computer and it will do it for you, from complex calculations to controlling devices at your home, just everything.
I still remember how I spent mine 5-6 hours searching on internet about getting an image out of any camera in software with help of programming. And when I found the thing I made my first image processing program-”Thief finder”.
What I did was just getting one image than wait for one second and then get another image. If the difference between the two images is beyond some limit than play a large sound else it remains-”Keep finger on your lips”.
if a-b=2 then silent
if a-b>50 then roar.

Then made a ball follower robot which can follow the red ball moving before its eyes. it was able to see in controlled environment only, means if change the light intensity in room than it will go blind. It also lacked one functionality- it can only judge whether ball moved to left or right , no line program was written to make it judge the absolute position in space that is left, right, up, down.
Finally in one of my laboratory sessions at college if was given task of finding a center of the given object in image, when I did it I felt roaring on the top of my voice because it was solution to my problem, although I was not able to roar in college.
Now comes the DMouse, one day I was “Facebooking” as usual on my laptop and playing poker, I was sleeping and felt uneasy to play while keeping laptop on my bed. I just wondered if I could move my cursor in screen just by moving hand in front of my camera, I implemented it at same time ,did complex calculations and programming and found that it worked!!!!
Although it was very vibrating cursor , you can’t even click on a big icon with that thing. Eventually I learned concepts like morphology, erode, smooth, etc. applied them in my program and at last I was successful. There’s one interesting thing in the name of this mouse, first I thought of keeping its name camera mouse or c-mouse but when I was saving my program I accidentally clicked on d which comes just above c in keyboard and saved it. It’s funny that I kept it as it is and thought I would name it DMouse (Dhaval’s Mouse).

Thank You,
Dhaval H. Palsana.

Sincere thanks to:
My Parents, Brother, Family, Teachers, Friends and all those who read this boring article up to the end!

Creative Commons License
DMouse by Dhaval Palsana is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Based on a work at
Permissions beyond the scope of this license may be available at


18 thoughts on “DMouse

  1. Dhaval…I read your boring artical upto the end and i must say it’s very impressive 🙂

  2. “Dhaval…I read your boring artical upto the end and i must say it’s very impressive 🙂 ” ~ Rita

  3. Gud one bro…

    Keep it up !

    OpenCV behind it all ? !!!

    If ure doing it wid matlab try wid OpenCV. U jst might start loving it. MABTLAB is a fantastic design and test platform but doesnot make sense for designing end-user application.

    Again +1 for ur gr8 project.

  4. Nice work dear.I really want to see it

  5. Ok luck

  6. Its Nice Started by you, You develop a mouse working in air without any base…. greatttttttt

  7. Just developed 5-Point calibration for DMouse , the points are placed in such a way that once you calibrate it with any object of your choice-say finger or pen cap then it will always track that in any light (of course not in dark).But due to submissions have n time to test in on my own laptop……so sad…..:-(

  8. Its great….i think you must launch final and stable version as soon as possible….

  9. How you are moving cursor! I mean how it is mapped to computer resolution? Did you use any specific formula/ technique? Please share!

  10. I am getting an error. The console says”ERROR: SampleCB – buffer sizes do not match” any suggestions? The webcam never shows any image so I am unable to calibrate the program. I am on windows 8, with an i5.

    • The issue you are facing seems to be with the abrupt camera resolution or might be the wrong selection of camera driver because I have hard coded the default camera bit in coding. If you are having some coding experience we can sort this out, I will provide you code and you can change the bit until it works fine for you.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s