Skip to content

A Python hand gesture recognition library for Kinetic User Interface (KUI).

License

Notifications You must be signed in to change notification settings

MumbaiHackathon/spockpy

 
 

Repository files navigation

spockpy ✊ ✋ ✌️ ☝️

"A Python hand gesture recognition library for Kinetic User Interface (KUI)."

Documentation Status

Table of Contents

Installation

1. Download the repository

Clone the base repository onto your desktop with git as follows:

$ git clone [email protected]:achillesrasquinha/spockpy
2. Install necessary dependencies

spockpy is primarily built on OpenCV for a large number of standard Computer Vision helpers and techniques. In order to install spockpy, you may have to build OpenCV (2.x or 3.x, depending on your Python version) first.

For Linux users, use our build scripts as follows:

$ chnmod +x build/*
$ build/get-opencv.sh

Next, install necessary Python dependencies as follows:

$ pip install -r requirements.txt

Finally, go ahead and install spockpy onto your system.

$ python setup.py install

To check whether you've installed spockpy, simply import spockpy:

>>> import spockpy

Come this far? You have my Vulcan Salute!

Requrirements

spockpy requires a robust WebCamera to get going! There are no other requirements. You are now, requirement-less.

Usage

spockpy creates a virtual trackpad (we call this, the HoverPad) for users to interact with the interface. Create a spockpy.HoverPad class as follows:

>>> import spockpy
>>> pad = spockpy.HoverPad()

To display the HoverPad, use the show class method as follows:

>>> pad.show()

That's it! spockpy.HoverPad releases a set of event objects from the get_event class method. You can now get spockpy.Event objects from frames of the current frame by simply:

>>> event = pad.get_event()
>>> event.type == spockpy.Event.SPOCK
True

Hand as a Mouse Pointer

spockpy.Event objects generate x, y coordinates of the tip of a user's index finger. 👆 To get the current coordinates of a frame, simply:

>>> event.get_tip()
(12, 40)

This retrives you a set of coordinates of the index finger relative to the screen.

Examples

How about Rock?

What about Paper?

Also, maybe Spock?

Integration

spockpy comes with a handy number of examples. To launch the app, launch it as follows:

>>> import spockpy
>>> app = spockpy.App()
>>> app.run()

OR via the command-line

$ python -m spockpy

Contribution

Keen in enhancing the API? Have better suggestions on the spockpy.detect method? Found some typos? Then go ahead and send in a Pull Request!

License

This repository has been released under the Apache License 2.0

This project had been built by Achilles Rasquinha (@achillesrasquinha, [email protected]) and Ameya Shenoy (@codingCoffee, [email protected]) in a time-frame of 30 hours for the Mumbai Hackathon 2017, held by the awesome developers at ERPNext.

About

A Python hand gesture recognition library for Kinetic User Interface (KUI).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 69.4%
  • HTML 22.3%
  • Shell 5.3%
  • JavaScript 1.5%
  • Other 1.5%