O'Reilly logo

OpenNI Cookbook by Soroush Falahati

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working sample for controlling the mouse by hand

As a last recipe of this chapter, we will write a working example for using nite::HandTracker. In this recipe, we will show you how to control the position of the mouse cursor using the NiTE hand tracker feature and how to simulate a click event.

We are going to use the Hand Raise gesture for the tracking of hands and the Click (push) gesture for the mouse click. Also, because of the low resolution of the depth output compared to the resolution of the monitor, which results in low accuracy of the hand tracker, we decided to move the mouse depending on its distance with the starting point. This is similar to how you control your mouse with a joystick.

Note

This sample is Windows only because it uses ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required