Controlling mouse pointer using hand movement

  • Follow


I need to develop a project in which i need to control movement of the mouse pointer on my screen by moving my hand in front of a web camera.i can track hand and can plot graph from it .this is the video from it .

http://www.youtube.com/watch?v=hYrzaHmZZjc

now i want to control the mouse .but i dont know mouse pointer function in matlab to handle mouse.
plz help me
0
Reply yasiru 7/2/2010 5:26:07 AM

Dear yasiru,

> I need to develop a project in which i need to control movement of the mouse pointer on my screen by moving my hand in front of a web camera.i can track hand and can plot graph from it .this is the video from it .
> 
> now i want to control the mouse .but i dont know mouse pointer function in matlab to handle mouse.

On Windows you can set the position of the Mouse cursor with:
  set(0, 'PointerLocation', [X, Y]);
More flexible and most likely working on Linux and MacOS also:
  robot = java.awt.Robot;
  robot.mouseMove(X, Y)
  robot.mousePress(java.awt.event.InputEvent.BUTTON1_MASK);
  robot.mouseRelease(java.awt.event.InputEvent.BUTTON1_MASK);

Good luck, Jan
0
Reply Jan 7/2/2010 7:15:24 AM


Dear Yasiru,

> now i want to control the mouse .but i dont know mouse pointer function in matlab to handle mouse.

BTW.: See also this thread from today:
  http://www.mathworks.com/matlabcentral/newsreader/view_thread/285933
Sometimes reading other posts can be helpful.

Kind regards, Jan
0
Reply Jan 7/2/2010 7:23:22 AM

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <i0k3mc$7h2$1@fred.mathworks.com>...
> Dear yasiru,
> 
> > I need to develop a project in which i need to control movement of the mouse pointer on my screen by moving my hand in front of a web camera.i can track hand and can plot graph from it .this is the video from it .
> > 
> > now i want to control the mouse .but i dont know mouse pointer function in matlab to handle mouse.
> 
> On Windows you can set the position of the Mouse cursor with:
>   set(0, 'PointerLocation', [X, Y]);
> More flexible and most likely working on Linux and MacOS also:
>   robot = java.awt.Robot;
>   robot.mouseMove(X, Y)
>   robot.mousePress(java.awt.event.InputEvent.BUTTON1_MASK);
>   robot.mouseRelease(java.awt.event.InputEvent.BUTTON1_MASK);
> 
> Good luck, Jan

thanks i did it.

http://www.youtube.com/watch?v=CURiHWRo7CI
0
Reply yasiru 7/3/2010 7:23:04 PM

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <i0k45a$72a$1@fred.mathworks.com>...
> Dear Yasiru,
> 
> > now i want to control the mouse .but i dont know mouse pointer function in matlab to handle mouse.
> 
> BTW.: See also this thread from today:
>   http://www.mathworks.com/matlabcentral/newsreader/view_thread/285933
> Sometimes reading other posts can be helpful.
> 
> Kind regards, Jan


thank jan
0
Reply yasiru 7/3/2010 7:24:04 PM

hey can any one help me to find the coordinates of my hand as i move it in front of my webcam when it is triggered in matlab 
 thankyou in advance
i will be higly obliged to you 
0
Reply faizan 12/28/2010 12:55:41 PM

6 Replies
1150 Views

(page loaded in 0.06 seconds)

Similiar Articles:













7/21/2012 4:15:32 AM


Reply: