how to animate bezier curve

Hi, I’m trying to build a simple example that reads data from a txt file and visualizes as an animated the curve like poorman’s oscillscope: http://accrochages.drone.ws/en/node/90
As there is always noisy data point in the txt file, what are ways to draw smooth curve? maybe animated bezier curve? or is there a simpler way to do it? thanks.

One place to start might be with using an ofPath, adding bezier points, and then calling simplify() on that line before you draw it. Depending on what else you’re doing, something like fitLine http://docs.opencv.org/modules/imgproc/doc/structural-analysis-and-shape-descriptors.html might help too.

Thanks Joshua, I had the following but when i called simplify, it crashed:

in update
testLine.curveTo(x, y[1]);

in draw
testLine.simplify(0.3);
testLine.draw();

without calling simplify function, it still doesn’t look smooth. any suggestion?

I’m looking at a couple of other examples:
cur.getSmoothed(8) in CV example
ofCurveVertex()
polyline has similar methods, too

still no luck in animating the smooth curve?!