I need to classify arbitrary 2D shapes. The classification should be invariant to at least affine transform. To achieve this invariance, I decided to "normalize" each shape by fitting it to a unit circle.
The shape is topologically equivalent to a circle, only deformed. I need to remove any linear deformations (translation, rotation, scale, skew) by fitting it in the unit circle so that the remaining deformities will characterize the shape.
The following picture illustrates the shape in red with its boundary denoted by $\alpha$ and the circle is denoted by $\beta$:
Now I would like to find a transform of the shape boundary points, such that distance between $\alpha$ and $\beta$ is minimized (in a least-squares sense).
The boundary point is $\alpha(t),\; t\in <0, 1>$ and the transform may look like this:
$P\alpha(t)+T=\pmatrix{a & b\\c & d}\pmatrix{\alpha_{x}(t)\\\alpha_{y}(t)}+\pmatrix{t_{x}\\t_{y}}$
The transform have six parameters: $a,b,c,d,t_{x}$ and $t_{y}$.
The solution may look like this:
I am able to parametrize the shape boundary to obtain any point on the boundary $\alpha$:
$\alpha=\{\alpha(t),\quad t\in <0,1)\}$
Now the problem can be formulated as a minimization problem, where objective function is given by:
$e=\int_{0}^{1}\left( ||P\alpha(t)+T||_{2}-1\right)^{2} dt$
In other words, $e$ is the distance between transformed boundary points $\alpha(t)$ and the unit circle. The norm $||\cdot||_{2}$ is simply a distance of the transformed point from origin, hence radius. We subtract this from the unit radius and square the result.
In practice, I will have a finite set of boundary points, so the above equation become a sum of squares.
Now for the question part:
Is this shape "normalization" sufficient for comparing shapes with affine invariance?
The least-squares solution is obviously not unique as the shape can be flipped and rotate freely within the unit circle. An ellipse would remove the rotation freedom, but there will still be a possible flip. Maybe a skewed ellipse or parallelogram would make the solution unique, but computing distance to these can be cumbersome. Is there a better way of how to ensure uniqueness of the solution?