Background: I was trying to detect a face solely on the bases of features and the confidence of the features found. I am using a method to identify the features along with the response (confidence). Stronger features have higher responses. I was trying to identify rotations of face. So, I was thinking about using ellipse bound to identify single face from image.
Question: Is there any standard algorithm/standard library that does weighted elliptic curve fit for all the points?
(Mostly, the points would be in and around the ellipse with weights. However, there may be outliers. All points will have to be considered. The outliers will have less weight though.)
Inputs to the algorithm: coordinates of the points and the weights of the points.
Expected output from the algorithm: Minor axis, major axis, 2D orientation angle and the centre of the ellipse (using weighted curve fitting).
If there are 'n' number of features, I could calculate the centre of ellipse using the weighted average of features. But, how would I determine minor axis, major axis and the rotation of the ellipse?
Attempts: I tried with circle and it works very well. But, it does not have rotational information (it just draws a circle when face is rotated). I found literature survey about elliptical curve fits using iterative methods. I also ideated that rectangular curve fit would also do (as length of the rectangle can be major axis of ellipse and breadth of rectangle can be minor axis of ellipse).
But, I have been unable to observe any 'universal' solution. (For example, if the face is far from the camera, ellipse should be smaller accordingly. Many curve fitting algorithms use parameters which are translation variant)
Images for unweighted and weighted curve fitting:
Unweighted elliptical curve fitting would be as shown in left. It would probably just use least mean square fitting (with iterations for angles). But, this method is not desired as it would not account for the importance of features (for example, a feature of a shirt in an image would be "less important" than the one on face. Hard thresholding or binarising destroys information). Desired weighted elliptic curve fitting is as shown in right.