Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java circle recognition from an arraylist of points

I currently have an arraylist of points from a freehand drawing on a canvas. I was wondering if there is a simple algorithm to detect if that shape represents a circle.I have already researched this a little and the main items I am pointed at are either the Hough transform or having bitmap images but both of these seem a little over the top for what I need it for. Any pointers to algorithms or implementation would be very helpful.

thanks in advance sansoms,

like image 961
adam Avatar asked Jan 18 '26 06:01

adam


1 Answers

enter image description here

If I interpret your question correctly, you want to know if all the points are on a circle.

As illustrated in the picture, we pick three points A, B, C from the list and compute the origin O of the presumed circle. By checking the distance between O and each point from the list, we can conclude whether these points are on a circle.

like image 167
Terry Li Avatar answered Jan 20 '26 18:01

Terry Li