Region Growing Algorithm with threshold or bounds
similar to k-mean clustering where the candidate pixel is classified based on the distance that is closest to the mean of the cluster. On the other hand, region growing based segmentation analyzes the neighboring pixels to determine whether or not to add the pixel to the seed region. and similar to the k-means, the process is iterated over all the pixels. First threshold the image and input some seed values usually through mouse clicks and finally iteratively use the 4/8-neighborhood connectivity.
I'm trying to find or create a region growing algorithm which takes in an array of seeds and a sort of "cost" array so that when regions are created, they do so in a way which can be controlled by a threshold put on cost.
For example, I want to input seed locations and population counts in 2D numpy arrays of the same size. The final result would ideally be a set of regions associated with the seeds which are constrained by the population array so that no one region would have a much higher population count than others.
I have looked into skimage.segmentation.watershed and have created a basic region segmentation using inverse distance weighting with numpy, but I'm unsure of where to go from here.