So, I have an assignment: to use modification of Kruskal's algorithm to separate an image into regions and identify which of them are circles and print their radii.
Finding regions is relatively simple, I did that. Finding circles is trickier, though. My idea is to find all border points of a region, find average point – possible center of this circle – and compute distances between each border point and 'center'. Then, if they do not differ much, this indeed is a circle.
First of all, is this even viable? Secondly, this method will recognize very thin rings as circles as well, and I don't want that. How do I fix this?
UPD: How do I effectively find border points? Last layer of BFS? Points with less than 6 neighbours (looks like bruteforce to me, though)?