I'm creating an application in which the user will use their face to move the mouse. I have used Emgucv (wrapper for opencv) to create an application in C# which detects the face of a person and locates the center-point on their face.
I'm using the setcursorpos
function to move the cursor. What I'm doing is I'm passing the center coordinates of the face detection to setcursorpos
, so the mouse movement is very limited.
How do I move the mouse anywhere on the screen smoothly by the slightest face movement?
I wrote a c# tutorial on youtube where (source code included) where I show how to detect head movement direction.
Basically it makes use of opencv goodfeaturestotrack and then use optical flow to compute the overall motion from a set of points.