Hi I am dealing with an image processing issue where I have parts of an ellipse visible (which is a circle projection) while other parts of an ellipse are blocked by another objects on a scene. I wonder whether I can derive the center of such an ellipse. Note that the ellipses are located in an arbitrary position and rotation angle
Asked
Active
Viewed 77 times
0
-
3No, you need at least five points to find the ellipse. Or three points and some other information. – Intelligenti pauca May 11 '24 at 16:40
-
Thank you! In my case, it is fine I guess since I have plenty of pixels located on a theoretical ellipse. I wonder if it is ok to aproximate since actually none of the pixels sits exactly on an ellipse. What do you think – Igor May 14 '24 at 08:56
-
1For fitting points to an ellipse see here, for instance: https://math.stackexchange.com/a/4738768/255730 – Intelligenti pauca May 14 '24 at 13:04
1 Answers
2
The minimum number of points you need is 5 as far as I am aware
Let P,Q,R,S be four points the general conic passing through these four points is given by
$$(PQ)(RS)=\lambda(PR)(QS)$$ where PQ is the equation of the line joining P,Q and lambda is a parameter
Substituting the 5 the point will give you lambda but it has no guarantee of being an ellipse
Once you do have the equation finding the centre is trivial
RandomGuy
- 1,937
-
Thank you very much sir. Can you please describe me the process in some pseudocode manner? – Igor May 14 '24 at 07:28
-
1This is not extremely programmer friendly cuz you like have to hard code a really long formula for lambda but the calculation itself isn't extremely taxing its just disgusting to look at. – RandomGuy May 14 '24 at 12:58
-
1Lambda will come as a function of $x_i,y_i$ its best you multiply all the line equations by hand or wolfram and hard code the formula once u have lambda u can back substitute to get equation – RandomGuy May 14 '24 at 13:01