Skip to main content

Implementation of the $N 2D gesture recognizer

Project description

dollarN

Python implementation of $N, the 2D multistrokes recognizer

http://depts.washington.edu/acelab/proj/dollar/ndollar.html

The $N Multistroke Recognizer is a 2-D multistroke recognizer designed for rapid prototyping of gesture-based user interfaces. $N is built upon the $1 Unistroke Recognizer. $N automatically generalizes examples of multistrokes to encompass all possible stroke orders and directions, meaning you can make and define multistrokes using any stroke order and direction you wish, provided you begin at either endpoint of each component stroke, and $N will generalize so as to recognize other ways to articulate that same multistroke. A version of $N utilizing Protractor, optional here, improves $N's speed.

Features

Example of use:

import dollarN as dN

r = dN.recognizer()
#By default, a recognizer gives a positive result when gestures have
#the same number of strokes only. This can be turned off:
#r.set_same_nb_strokes(False)

#Rotation invariance can also be turned off:
#r.set_rotation_invariance(False)

#Adding gestures: multistrokes with names
r.add_gesture('U', [   [[0.,5.], [0.,0.], [5.,0.], [5.,5.]]    ]) # one stroke
r.add_gesture('X', [   [[0.,0.], [5.,5.]], [[0.,5.], [5.,0.]]  ]) # two strokes
r.add_gesture('T', [   [[0.,5.], [5.,5.]], [[2.5,0.], [2.5,5.]]]) # two strokes

#Launching a recognition
test = [[[0, 5.2], [5.,5.]], [[2.5, 0.], [2.5,5.]]]
print( r.recognize(test) )
{'name': 'T', 'value': 0.9484976300936439, 'time': 0.006083965301513672}

Demo

A demo is available with tkDollarN.py here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dollarN-1.2.4.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

dollarN-1.2.4-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file dollarN-1.2.4.tar.gz.

File metadata

  • Download URL: dollarN-1.2.4.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for dollarN-1.2.4.tar.gz
Algorithm Hash digest
SHA256 d2ffee1efbbd4ae185f2d6e5a3043b2cda78b9ab488335bcd9eed9a3eac8e94f
MD5 d1da581eb78719fe386c848d47d83929
BLAKE2b-256 e533b1b142c4c15d945ba6f06b9ee2be1a4895168034135ba0a7ba7ee783a675

See more details on using hashes here.

Provenance

File details

Details for the file dollarN-1.2.4-py3-none-any.whl.

File metadata

  • Download URL: dollarN-1.2.4-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for dollarN-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fa1212854d798121931e3b37cf8bd5c162762d1635e1fe93a55d817eddc6add6
MD5 cc7fef3f9babe5cb4b224888d702795d
BLAKE2b-256 1db2d2d6f07baa47ad3c877c0f45d609e726368f2ffd379687a6c852f2d620c0

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page