Using the method in this post I'm trying to generate a curve for this image:
I've gone ahead and imported it and I'm using img=Binarize[img~Blur~3] to blur it a bit, which gives me:
So now I use this code:
param[x_, m_, t_] := Module[{f, n = Length[x], nf}, f = Chop[Fourier[x]][[;; Ceiling[Length[x]/2]]];
nf = Length[f];
Total[Rationalize[2 Abs[f]/Sqrt[n] Sin[Pi/2 - Arg[f] + 2. Pi Range[0, nf - 1] t], .01][[;; Min[m, nf]]]]]
tocurve[Line[data_], m_, t_] := param[#, m, t] & /@ Transpose[data]
lines = Cases[Normal@ListContourPlot[Reverse@ImageData[img], Contours -> {0.5}], _Line, -1];
ParametricPlot[Evaluate[tocurve[#, 25, t] & /@ lines], {t, 0, 1}, Frame -> True, Axes -> False]
This finally gives me these curves:
I can see the outline of Buzz pretty clearly in the center, which is what I want. What's all the extra garbage all over the image and how can I get rid of it in my curves? I'd ideally like the equation generating just the outline of Buzz.



