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 seed vectors randomly. See lloyds_algorithm().

Parameters
  • grid ((array_like, array_like) OR SLM OR (int, int)) – See voronoi_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