public class OneDollar extends Object
Constructor and Description |
---|
OneDollar(PApplet parent)
Constructor of the recognizer.
|
Modifier and Type | Method and Description |
---|---|
OneDollar |
add(String name,
int[] points)
Add new template to recognizer.
|
OneDollar |
addGesture(String name,
int[] points)
Add new template to recognizer.
|
OneDollar |
bind(Integer id,
String templates,
Object object,
String callback)
Bind local callback on candidate.
|
OneDollar |
bind(Integer id,
String templates,
String callback)
Bind local callback on candidate.
|
OneDollar |
bind(String templates,
Object object,
String callback)
Bind object callback to candidate.
|
OneDollar |
bind(String templates,
String callback)
Bind sketch callback to candidate.
|
void |
check()
Run the recognition and in case of success execute the binded callback.
|
void |
check(int[] candidate)
Run the recognition with specific candidate and in case of success execute the binded callback.
|
void |
clean()
Manually cleanup of all inactive candidates.
|
OneDollar |
disableAutoCheck()
Disable auto recognition of gestures.
|
OneDollar |
disableAutoClean()
Disable auto clean of inactive candidates.
|
OneDollar |
disableMaxTime()
Disable maximum duration check.
|
OneDollar |
disableMinDistance()
Disable minimum distance check.
|
OneDollar |
disableMinSimilarity()
Disable minimum similarity check.
|
OneDollar |
disableMinSpeed()
Disable minimum speed.
|
OneDollar |
draw()
Draw all candidates points as lines.
|
OneDollar |
enableAutoCheck()
Enable auto recognition of gestures.
|
OneDollar |
enableAutoClean()
Enable auto clean of inactive candidates.
|
OneDollar |
enableMaxTime()
Enable maximum duration check.
|
OneDollar |
enableMinDistance()
Enable minimum distance check.
|
OneDollar |
enableMinSimilarity()
Enable minimum similarity check.
|
OneDollar |
enableMinSpeed()
Enable minimum speed.
|
OneDollar |
end(Integer id)
Deprecated.
That method is deprecated.
|
OneDollar |
forget(String name)
Remove specified template from recognizer.
|
OneDollar |
forgetAll()
Remove all learned templates.
|
float |
getMinSpeed()
Get the minimum speed.
|
OneDollar |
learn(String name,
int[] points)
Add new template to recognizer.
|
OneDollar |
off(Integer id,
String templates)
Unbind local callback of specific candidate.
|
OneDollar |
off(String template)
Unbind callback from template.
|
OneDollar |
on(Integer id,
String templates,
Object object,
String callback)
Bind local callback on candidate.
|
OneDollar |
on(Integer id,
String templates,
String callback)
Bind local callback on candidate.
|
OneDollar |
on(String templates,
Object object,
String callback)
Bind object callback to candidate.
|
OneDollar |
on(String templates,
String callback)
Bind sketch callback to candidate.
|
void |
post()
The post() method will be execute after the draw() method.
|
void |
pre()
The pre() method will be execute before the draw() methode.
|
OneDollar |
remove(String name)
Remove specified template from recognizer.
|
OneDollar |
removeGesture(String name)
Remove specified template from recognizer.
|
OneDollar |
setBoundingBox(Integer px)
Set the size of bounding box of the 1$ Unistroke Recognition algorithm.
|
OneDollar |
setFragmentationRate(Integer parts)
Set the fragmentation rate of the 1$ Unistroke Recognition algorithm.
|
OneDollar |
setMaxLength(Integer length)
Deprecated.
There is no use for that preprocessing, it's better to use the
setMaxTime method. |
OneDollar |
setMaxTime(int ms)
Set the time to live of candidates points.
|
OneDollar |
setMinDistance(int length)
Set the minimum distance of a candidate.
|
OneDollar |
setMinLength(Integer length)
Deprecated.
Please use the
setMinDistance method. |
OneDollar |
setMinScore(Integer percent)
Deprecated.
Please use the
setMinSimilarity method, it's more semantic. |
OneDollar |
setMinSimilarity(int percent)
Set the minimum equality in percent between candidate and template.
|
OneDollar |
setMinSpeed(float pxms)
Set the minimum speed.
|
OneDollar |
setRotationAngle(Integer degrees)
Set the rotation angle of the 1$ Unistroke Recognition algorithm.
|
OneDollar |
setRotationStep(Integer degrees)
Set the rotation step of the 1$ Unistroke Recognition algorithm.
|
OneDollar |
setVerbose(Boolean value)
Show result messages.
|
OneDollar |
start(Integer id)
Deprecated.
That method is deprecated.
|
String |
toString()
Print all settings.
|
OneDollar |
track(float x,
float y) |
OneDollar |
track(int[] positions) |
OneDollar |
track(int id,
float x,
float y) |
OneDollar |
track(int x,
int y) |
OneDollar |
track(int id,
int[] positions) |
OneDollar |
track(int id,
int x,
int y) |
OneDollar |
track(int id,
PVector position) |
OneDollar |
track(PVector position) |
OneDollar |
unbind(Integer id,
String templates)
Unbind local callback of specific candidate.
|
OneDollar |
unbind(String template)
Unbind callback from template.
|
void |
update(Integer id,
float x,
float y)
Deprecated.
Please use the
track method. |
OneDollar |
update(Integer id,
PVector position)
Deprecated.
Please use the
track method. |
public OneDollar(PApplet parent)
parent
- Reference of the processing sketch (this).public OneDollar learn(String name, int[] points)
name
- Name of template.points
- Points as array of template.public OneDollar addGesture(String name, int[] points)
name
- Name of template.points
- Points as array of template.public OneDollar add(String name, int[] points)
name
- Name of template.points
- Points as array of template.public OneDollar forget(String name)
name
- Name of template.public OneDollar removeGesture(String name)
name
- Name of template.public OneDollar remove(String name)
name
- Name of template.public OneDollar forgetAll()
public void check()
public void check(int[] candidate)
candidate
- public void clean()
public OneDollar enableAutoClean()
public OneDollar enableAutoCheck()
public OneDollar disableAutoCheck()
public OneDollar disableAutoClean()
public void pre()
public void post()
public OneDollar on(String templates, Object object, String callback)
templates
- Name of added templates.object
- Object, which implemented the callback.callback
- Name of callback.public OneDollar bind(String templates, Object object, String callback)
templates
- Name of added templates.object
- Object, which implemented the callback.callback
- Name of callback.public OneDollar on(String templates, String callback)
templates
- Name of added templates.callback
- Name of callback in current sketch.public OneDollar bind(String templates, String callback)
templates
- Name of added templates.callback
- Name of callback in current sketch.public OneDollar off(String template)
template
- public OneDollar unbind(String template)
template
- public OneDollar on(Integer id, String templates, Object object, String callback)
id
- Unique id of candidate.templates
- Name of added templates.object
- Object, which implemented the callback.callback
- Name of callback.public OneDollar bind(Integer id, String templates, Object object, String callback)
id
- Unique id of candidate.templates
- Name of added templates.object
- Object, which implemented the callback.callback
- Name of callback.public OneDollar on(Integer id, String templates, String callback)
id
- Unique id of candidate.templates
- Name of added templates.callback
- Name of callback in current sketch.public OneDollar bind(Integer id, String templates, String callback)
id
- Unique id of candidate.templates
- Name of added templates.callback
- Name of callback in current sketch.public OneDollar off(Integer id, String templates)
id
- Unique id of candidate.templates
- Name of the added templates.public OneDollar unbind(Integer id, String templates)
id
- Unique id of candidate.templates
- Name of the added templates.public OneDollar draw()
public OneDollar track(int id, int[] positions)
public OneDollar track(int id, int x, int y)
public OneDollar track(int id, float x, float y)
public OneDollar track(int x, int y)
public OneDollar track(float x, float y)
public OneDollar track(int[] positions)
public OneDollar start(Integer id)
id
- Unique id of candidate.public OneDollar update(Integer id, PVector position)
track
method.id
- Unique id of candidate.position
- New x and y position of the candidate.public void update(Integer id, float x, float y)
track
method.id
- Unique id of candidate.x
- New x position of the candidate.y
- New y position of the candidate.public OneDollar end(Integer id)
id
- Unique id of candidate.public OneDollar setMinSimilarity(int percent)
percent
- Integer between 0 and 100.public OneDollar enableMinSimilarity()
public OneDollar disableMinSimilarity()
public OneDollar setMinScore(Integer percent)
setMinSimilarity
method, it's more semantic.percent
- Integer between 0 and 100.public OneDollar setMaxTime(int ms)
ms
- Time in millisecond.public OneDollar enableMaxTime()
public OneDollar disableMaxTime()
public OneDollar setMinLength(Integer length)
setMinDistance
method.length
- Length in pixel.public OneDollar setMinDistance(int length)
length
- public OneDollar enableMinDistance()
public OneDollar disableMinDistance()
public OneDollar setMaxLength(Integer length)
setMaxTime
method.length
- Length in pixel.public OneDollar setMinSpeed(float pxms)
pxms
- public float getMinSpeed()
pxms
- public OneDollar enableMinSpeed()
public OneDollar disableMinSpeed()
public OneDollar setRotationAngle(Integer degrees)
degrees
- Angle in degree.public OneDollar setRotationStep(Integer degrees)
degrees
- Angle in degree.public OneDollar setBoundingBox(Integer px)
px
- public OneDollar setFragmentationRate(Integer parts)
parts
- Number of resampling.public OneDollar setVerbose(Boolean value)
value
- Show or hide.Processing library OneDollarUnistrokeRecognizer by Darius Morawiec. (C) 2013-2015