I'm trying to do the opposite of this : Given a two-dimensional image of (continuous) intensities, create a set of irregularly spaced accumulation points, i.e. points that irregularly cover the 2D map, being closer to each other in areas of high intensity ( but without overlapping! ).
My first attempt was "weighted" by k-means. Since I did not find a working implementation of weighted k-means, the way to input weights is to repeat the points with high intensity. Here is my code:
import numpy as np from sklearn.cluster import KMeans def accumulation_points_finder(x, y, data, n_points, method, cut_value):
Here are two different results: 1) Using all data pixels. 2) Using only pixels above a certain threshold (RMS).


As you can see, the dots appear more regular than those concentrated in areas of high intensity.
So my question is that there is a (deterministic, if possible) best method for calculating such accumulation points.
source share