1

There is an article on how to detect circles in images using pairs of gradient vectors (assuming the circle is dark and background is bright).

The thing is that gradient of image intensity at each pixel of the edge of the circle is directed outwards the circle, perpendicularly to it.

The algorithm is to find all gradient vector pairs (see the picture) that are in almost opposite directions ($\vec{V_1}$ and $\vec{V_2}$); and, also, $\vec{V_1}$ and $\vec{P_1P_2}$ are almost it opposite directions. As a midpoint of $P_1$ and $P_2$ we get circle center, and the distance between the points divided by 2 is the radius, we found a candidate circle. The extraction of the real circles from our statistics is not described in the paper, but is easy to invent.

enter image description here

And what I want is to make the algorithm to work with ellipses.

What can I do? Maybe add point $P_3$ and corresponding vector $V_3$. I want to find candidate ellipses somehow. Do three points with gradients at these points strictly define an ellipse?

  • Before engaging in your topic, You better include some basic explanation on how to do that, we are not obliged to read all the paper just to understand your question, Don't forget that you are in MathSE not Image processing or something – chouaib Oct 16 '14 at 05:53
  • What exactly is the input? Do you have two or three "gradients" (point-vector pairs) that you know belong to the same ellipse? Or do you just have an unorganized collection of gradients corresponding to several unknown ellipses? –  Oct 21 '14 at 04:30
  • 1
  • @Rahul Input is a grayscale image of pixels (a matrix). I know gradient of image intensity at each point, except for a few pixels at edges maybe, doesnt' matter (Sobel derivatives are used). – Andrey Moiseev Oct 21 '14 at 08:11

1 Answers1

0

The same algorithm can be directly applied to detect ellipses because every pair of vectors as described in the paper will satisfy the conditions $i$ and $ii$ also. Needed hacks to tackle the radius :

$1$- scan all the radii, the minimum will be the small radius of the ellipse.

$2$- the maximum will be the big radius of ellipse.

$3$- they all meet at the same point which is the center of the ellipse

Drawbacks :

$1$- you will have difficulties when you have mixed circles and ellipses in the same image.

以上

chouaib
  • 541
  • Unfortunately, the second condition doesn't work for ellipses. Opposite-directed vectors can be found, but they do not lie on a single line, except for vectors at the points where ellipse axes intersect the ellipse. – Andrey Moiseev Oct 16 '14 at 06:32