Coder Social home page Coder Social logo

chrismiles / cmunistrokegesturerecognizer Goto Github PK

View Code? Open in Web Editor NEW
652.0 55.0 63.0 295 KB

A port of the $1 Unistroke Recognizer (aka Dollar Gesture Recognizer) to iOS as a UIGestureRecognizer.

Objective-C 45.63% C 24.62% MATLAB 8.51% JavaScript 21.24%

cmunistrokegesturerecognizer's Introduction

$1 Unistroke Gesture Recognizer for iOS

CMUnistrokeGestureRecognizer is a port of the $1 Unistroke Recognizer (aka Dollar Gesture Recognizer) to iOS by Chris Miles.

Read more about it at http://blog.chrismiles.info/2012/12/introducing-cmunistrokegesturerecognizer.html

The $1 Unistroke Recognizer was originally authored by:

  • Jacob O. Wobbrock, University of Washington
  • Andrew D. Wilson, Microsoft Research
  • Yang Li, University of Washington

CMUnistrokeGestureRecognizer is a UIGestureRecognizer subclass, able to recognize any number of unistroke gestures configured by the user. Stroke paths are registered as UIBezierPath objects, making it easy to create and display paths.

The core unistroke recognizer algorithm is written in C, although uses GLKVector2 and GLKMath for high performance vector math on iOS devices. As such, the GLKit framework is required. Unit tests are included.

CMUnistrokeGestureRecognizer is open source, released under an MIT license.

A demo iOS application is included, showing how CMUnistrokeGestureRecognizer can be used and containing all the test strokes used by the algorithm authors. The demo app is open source and released under a MIT license.

CMUnistrokeGestureRecognizer

Support

CMUnistrokeGestureRecognizer is provided open source with no warranty and no guarantee of support. However, best effort is made to address issues raised on Github.

If you would like assistance with integrating CMUnistrokeGestureRecognizer or modifying it for your needs, contact the author Chris Miles [email protected] for consulting opportunities.

License

CMUnistrokeGestureRecognizer is Copyright (c) Chris Miles 2012 and released open source under a MIT license.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

cmunistrokegesturerecognizer's People

Contributors

chrismiles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmunistrokegesturerecognizer's Issues

straight lines recognition

It fails to recognise straight lines. unistrokeRecognizerPathDistance uses GLKVector2Distance and GLKVector2Distance can return nan. I guess you should check for that

Crash : while creating new template

I found the following crash while adding a new template.
I am using IOS 5.0 simulator.

logs are follows:

2012-12-28 03:14:44.447 CMUnistrokeDemo[1402:c07] -[CMUnistrokeGestureRecognizer isUnistrokeRecognized] Recognized: result->score = 0.648028 result->name = 'Check'
2012-12-28 03:14:46.406 CMUnistrokeDemo[1402:c07] -[CMUnistrokeGestureRecognizer isUnistrokeRecognized] NOT Recognized
2012-12-28 03:14:51.599 CMUnistrokeDemo[1402:c07] -[CMUnistrokeGestureRecognizer isUnistrokeRecognized] Recognized: result->score = 0.678593 result->name = 'Delete'
2012-12-28 03:14:59.601 CMUnistrokeDemo[1402:c07] -[CMUnistrokeGestureRecognizer isUnistrokeRecognized] Recognized: result->score = 0.852226 result->name = 'Star'
2012-12-28 03:16:12.941 CMUnistrokeDemo[1402:c07] -[CMUnistrokeGestureRecognizer isUnistrokeRecognized] Recognized: result->score = 0.754231 result->name = 'Right Curly Brace'
2012-12-28 03:16:21.794 CMUnistrokeDemo[1402:c07] -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]: unrecognized selector sent to instance 0x7b63400
2012-12-28 03:16:21.857 CMUnistrokeDemo[1402:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]: unrecognized selector sent to instance 0x7b63400'
*** First throw call stack:
(0x1376052 0x106cd0a 0x1377ced 0x12dcf00 0x12dcce2 0x7638 0x275e0f 0x276589 0x261dfd 0x270851 0x21b301 0x1377e72 0xfb92d 0x105827 0x8bfa7 0x8dea6 0x8d580 0x134a9ce 0x12e1670 0x12ad4f6 0x12acdb4 0x12acccb 0x217b879 0x217b93e 0x1dca9b 0x64cd 0x1c45 0x1)
terminate called throwing an exception(lldb)

Recognize Circle with Center & Radius/Diameter

I'm using your project to detect if user draws a circle. The detection is fine. However, I'd like to know if it's a circle detected, then what is it's center and radius.

Can you help me with this?

Make it Multi Stroke Gesture Recognizer

Hi,
Thanks for the great code! Anyway, do you think how hard it'll be to make this code recognize multi-stroke?

I am thinking of recognizing the first stroke, filter the 3 templates with highest percentage and wait for the second and....

Any suggestion is much appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.