0

I got the code to move the mouse cursor from this question.

My project involves using face tracking to move the mouse cursor, but the face cannot move too much. How do I adjust the sensitivity of the movement, as in the face need only to move a little for the mouse cursor to move a lot, like adjusting the mouse sensitivity in the windows settings.

Community
  • 1
  • 1
Edwin
  • 886
  • 2
  • 13
  • 32
  • 1
    Possible duplicate of [Dynamically changing Mouse speed](http://stackoverflow.com/questions/2931122/dynamically-changing-mouse-speed) – Alex Dec 21 '15 at 13:05

2 Answers2

1

The measurement from your face tracker would create a measurement value from the range [low1, high1]

Your Cursor.Position.X would take a value between zero to screen width. Lets notate this range as [low2, high2].

You need to assign Cursor.Position.X such as:

low2 + (value - low1) * (high2 - low2) / (high1 - low1)

The range you define as [low2, high2] will determine the speed of the movement. Shorter range will move the mouse faster.

Can Guney Aksakalli
  • 1,320
  • 1
  • 11
  • 24
0

Just use a factor to adjust the transformation from face movement to cursor movement.

AntiHeadshot
  • 1,130
  • 9
  • 24