I'm generating set of contour curves that I would like to convert to a parametric equation. I have no idea how to do it other than polynomial fit or elliptical equation, neither of which seems unsuitable. I could even use guidance on how to research this problem. When I lookup "squarish circle" on the Interwebs, all I mostly find discussion of rectangles with rounded corners, which is NOT what I'm looking for.
The below is an idealized example of the type of contour:
I want to parameterize the curve for 1) correcting of quantization error (not shown in above image) and 2) data compression.
In the above example, like most of the of contour sets I'm working with, the inner most contours lines could easly fit to a circle/ellipse, but the same cannot be said of the outer curves, as they become more squarish.
For my application, the contours can be expected to be smooth, well-behaved, convex curves, and will have at least one axis of symmetry. But the data I'm working have finite sampling, producing quantization error in the calculated contours (particularly along angles away from $0, \pm\pi/2, \pi$). I want to correct for this quantization error by fitting the data to an a priori parametric expression that can capture the squarish nature of the curve.
I've already tried simply fitting calculated $r$ vs. $\theta$ to polynomial curves but even high-order (5+ order) polynomial produce very bad results. Equally important, standard polynomial fitting will not take advantage of the fact that, in my case (due to selective non-uniform sampling), $f(\theta)$, $f'(\theta)$ and $f''(\theta)$ can be made to have very little quantization error at $0, \pm\pi/2, \pi$.