Search code examples
algorithmgraphicscluster-analysisscatter-plotpattern-recognition

How to find the circles consisting of points in a scatter diagram?


Here is a scatter diagram. It is obvious that some points are on their corresponding circle and some are not. How to find the circles and the coordinates of their centers?

the scatter diagram


Solution

  • The way to detect circles is via a Hough transform.

    You have an accumulator matrix, initially set to zero, then you go through the input. For each set pixel, you vote for the circles it could possibly be part of. So the accumulator matrix needs to be 3D (ox, oy and radius).

    You then take local maxima in the accumulator matrix, and those are the circles.