You probably want to fit to closed bezier splines (curves).
There is a page with a Java applet that does such fitting. Take a look at their (uncommented, bleh) PSegment.java
If that doesn't do the job well enough, Fitting B-Spline Curves to Point Clouds by Squared Distance Minimization should be overkill for the task.
For more info, Google (Scholar) searches for things like "b-spline fitting" and "closed bezier spline" should help.