I want to write a program, (python opencv?), that will find the first N densest points in the region. Densest, meaning the point with the most of its own colored points near it. For example, finding the densest points of red would look like:
I understand I should preprocess the image with filters. Is there any other methods I should apply to improve performance?
What algorithm would be most effective to find the densest points in this image?
Is it possible to get the set of neighbors for each dense point?
Is it possible to obtain the polygon shape from the densest point and its set of neighbor points?