先说说椭圆的性质:
定义:
上面是别人写的一篇论文关于椭圆拟合的
Ellipse detection's step as following:
(1) Store all edge pixels in a one dimensional array.
(2) Clear the accumulator array .
(3) For each pixel (x1, y1), carry out the following steps
from (4) to (14).
(4) For each other pixel (x2, y2), if the distance between
(x1, y1)and (x2, y2)is greater than the required least
distance for a pair of pixels to be considered then
carry out the following steps from (5) to (14).
(5) From the pair of pixels (x1, y1)and (x2, y2), using
equations (1) to (4) to calculate the center,
orientation and length of major axis for the assumed
ellipse.
(6) For each third pixel (x, y), if the distance between
(x, y)and (x0, y0)is greater than the required least
distance for a pair of pixels to be considered then
carry out the following steps from (7) to (9).
(7) Using equations (5) and (6) to calculate the length
of minor axis.
(8) Increment the accumulator for this length of minor
axis by 1.
(9) Loop until all pixels are computed for this pair of
pixels.
(10) Find the maxium element in accumulator array. The
related length is the possible length of minor axis
for assumed ellipse. If the vote is greater than the
reqired least number for assumed ellipse, one
ellipse is detected.
(11) Output ellipse parameters.
(12) Remove the pixels on the detected ellipse from edge
pixel array.
(13) Clear accumulator array.
(14) Loop until all pairs of pixels are computed.
(15) Superimpose detected ellipses on the original
image.
(16) End.