Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default tolerance too low; setParameter function may be useful #6

Closed
micuat opened this issue Aug 20, 2014 · 2 comments
Closed

Default tolerance too low; setParameter function may be useful #6

micuat opened this issue Aug 20, 2014 · 2 comments

Comments

@micuat
Copy link
Contributor

micuat commented Aug 20, 2014

While trying the oF example, I noticed the default tolerance is too low to identify a gesture. I tried

void ofApp::setup(){
...
    // PARAMETERS are set by default
    parameters.numberParticles      = 2000;         // can be less for low CPU resources
    parameters.tolerance            = 5.f;         // set auto
    parameters.resamplingThreshold  = 500;          // 1/4 of the number of particles
    parameters.distribution         = 0.0f;         // non zero if T-distribution
    parameters.phaseVariance        = 0.000001;     // magic number
    parameters.speedVariance        = 0.001;        // magic number
    parameters.scaleVariance = vector<float>(1, 0.00001); // TODO: Check that default works like this.
    parameters.rotationVariance = vector<float>(1, 0.00001);

    // CREATE the corresponding GVF
    gvf.setup(config, parameters);
...

and it seems good enough for recognition.

Another thing is that the above code is too long so that can it be simply done by gvf.setTolerance(float) kind of function? I haven't thoroughly read the code so I'm not sure if individually changing parameters will cause problems or not.

@bcaramiaux
Copy link
Owner

Hi micuat,

The value of the tolerance depends on the range of data. For instance, if the incoming data values are between 0.0 and 1.0, atypical tolerance value is 0.2 (20% of the range).

Regarding the code highlighted, I let it like that in order to see the different parameters that can be changed. Indeed there is a function:
void setTolerance(float tolerance); in ofxGVF.h

@micuat
Copy link
Contributor Author

micuat commented Aug 21, 2014

I missed that function 👍
The only issue is setTolerance(float) must be called after setup(ofxGVFConfig) otherwise overwritten by default, which I think is counterintuitive to oF standard

@micuat micuat closed this as completed Aug 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants