slmsuite.holography.toolbox.lloyds_points
- lloyds_points(grid, n_points, iterations=10, plot=False)[source]
Implements Lloyd’s Algorithm without seed
vectors
; instead, autogenerates the seedvectors
randomly. Seelloyds_algorithm()
.- Parameters
grid ((array_like, array_like) OR
SLM
OR (int, int)) – Seevoronoi_windows()
.n_points (int) – Number of points to generate inside a space.
iterations (int) – Number of iterations to apply Lloyd’s Algorithm.
plot (bool) – Whether to plot each iteration of the algorithm.
- Returns
The result of Lloyd’s Algorithm.
- Return type
numpy.ndarray