c++ - Visualize motion/gesture from acceleration data -


i have implemented gesture detection algorithm user can define own gestures. gestures defined acceleration values send accelerometer.

now question is: is possible visualize performed gesture, user can identify gesture performed?

my first idea , try use verlet velocity integration (as describec here: http://lolengine.net/blog/2011/12/14/understanding-motion-in-games) calculate corresponding positions , use form line strip in opengl. rendering works, result not @ performed gesture looked like.

this code:

    float deltatime = 0.01;     posdata null;     null.x = 0.0f;     null.y = 0.0f;     null.z = 0.0f;     this->vertices.push_back(null);     float velx = 0.0f;     float vely = 0.0f;     float velz = 0.0f;      (int = 0; < accdata.size(); i++) {         float oldvelx = velx;         float oldvely = vely;         float oldvelz = velz;         velx = velx + accdata[i].x * deltatime;         vely = vely + accdata[i].y * deltatime;         velz = velz + accdata[i].z * deltatime;         posdata newpos;         newpos.x = vertices[i].x + (oldvelx + velx) * 0.5 * deltatime;         newpos.y = vertices[i].y + (oldvely + vely) * 0.5 * deltatime;         newpos.z = vertices[i].z + (oldvelz + velz) * 0.5 * deltatime;         this->vertices.push_back(newpos);     } 

i using deltatime of 0.01 because accelerometer sends acceleration data every 10 milliseconds. wondering: there wrong calculation? work way? there library can this? other suggestions?

as theoretical physics , monte-carlo-simulation man, i've thought discrepancies you've observed. wrote "real" gesture curve (3d) didn't resemble @ calculatet curve. might want consider several aspects of problem @ hand. first, know "real" gesture curve in space. have "some" curve in mind, needn't "real" curve performed one's hand. second, know quality of accelerometer, accuracy, latency or other intricacies? third point, know "measured" acceleration data, fit "some" nice , smooth curve when drawn in x-y-plot shape? if curve isn't smooth-looking, 1 needs assumptions acceleration data perform linear, or better, spline-fit. afterwards can integrate analytical formulae. -- might think in terms of signing electronically when ups parcel service asks to, signature on pad? happens acceleration system, without "intelligent" curvature-smoothing algorithm. hope comment helpful in 1 way or ... regards, m.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -