algorithm - Efficient Line Smoothing (Simplify) -


i creating painting application in actionscript (althought question not actionscript related). basic idea start painting when mouse pressed , tracking mouse movements. want acchieve is:

  1. reduce mouse "noise" and
  2. create more smoother looking lines.

right now, (1) problematic because thousands of mouse movements within few seconds. due (1) line can jaggy. current idea: when user finishes drawing line, store movements in array , reduce them (median threshold) , use spline algorithm recreate line.

any better approaches?

see efficient curve fitting sarah frisken. available at author's page.


Comments