https://github.com/acul4321/dollar-p-recognizer-godot
a godot implementation of the $p+ point cloud recognizer
https://github.com/acul4321/dollar-p-recognizer-godot
Last synced: 3 months ago
JSON representation
a godot implementation of the $p+ point cloud recognizer
- Host: GitHub
- URL: https://github.com/acul4321/dollar-p-recognizer-godot
- Owner: Acul4321
- Created: 2025-01-03T19:48:15.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-04T00:12:10.000Z (5 months ago)
- Last Synced: 2025-01-04T01:21:34.585Z (5 months ago)
- Language: GDScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dollar-p-recognizer-godot
A godot implementation of the [Dollar P+ Point Cloud Recognizer](https://depts.washington.edu/acelab/proj/dollar/pdollarplus.html)
## About
>The $P+ Point-Cloud Recognizer is a 2-D gesture recognizer designed for rapid prototyping of gesture-based user interfaces, especially for people with low vision.
>
>$P+ improves the accuracy of the $P Point-Cloud Recognizer. $P+ was developed by carefully studying the stroke-gesture performance of people with low vision, which generated insights for how to improve $P for all users.[Radu-Daniel Vatavu](http://www.eed.usv.ro/~vatavu/), University Stefan cel Mare of Suceava
## Usage
In the Godot Project Settings, upload the **gesture_recognizer.gd** as an Autoload script(Also known as a Singleton)[^1]
Now You must define In code The Recognizer and gestures you wish to classify.
#### Demo
``` gdscript
# if Autoload has been defined as 'PRecognizer' as above, we instantiate a Recognizer class
var Recognizer = PRecognizer.PDollarPlusRecognizer.new()# Create the gesture, each containing a name and an array of 'GesturePoint' objects
# The 'GesturePoint' object has a x , y component aswell as an id(what stoke the point belongs to) and an angle
var gestureT = PRecognizer.Gesture.new("T",[
PRecognizer.GesturePoint.new(30,7,1),
PRecognizer.GesturePoint.new(103,7,1),
PRecognizer.GesturePoint.new(66,7,2),
PRecognizer.GesturePoint.new(66,87,2)])var gestureLine = PRecognizer.Gesture.new("Line",[
PRecognizer.GesturePoint.new(12,347,1),
PRecognizer.GesturePoint.new(119,347,1)])# Register what gestures a Recognizer can classify by appending to the 'gestures' array of Gesture objects
Recognizer.gestures.append(gestureT)
Recognizer.gestures.append(gestireLine)# To classify the gestures we call the Recognize method to match with the previously registered Gesture objects
var result = Recognizer.Recognize([
PRecognizer.GesturePoint.new(134,220,1),
PRecognizer.GesturePoint.new(477,178,1),
PRecognizer.GesturePoint.new(316,218,2),
PRecognizer.GesturePoint.new(329,430,2)])print("Result: " + str(result.name) + " (" + str(round(result.score*100)) + ") in " + str(round(result.time*1000)) + "ms")
# Output : Result: T (28) in 7ms
```[^1]: Singleton: A global script which contains functions and variables used throughtout the program.