Untitled

 avatar
unknown
python
a year ago
575 B
2
Indexable
from math import floor
import numpy as np
from scipy.stats import qmc
import matplotlib.pyplot as plt
import cv2

img = cv2.imread('poo.png')
plt_img = plt.imread('poo.png')

l_bounds = [0]
u_bounds = [512]

sampler = qmc.Halton(d=1, scramble=False)
sample = sampler.random(n=500)

sample = qmc.scale(sample, l_bounds, u_bounds).flatten()

thing = []

for i in range(1, 501):
    thing.append((i / 500) * 511)

combined = np.vstack((sample, np.array(thing))).T
from scipy.spatial import Voronoi, voronoi_plot_2d
vor = Voronoi(combined)

fig = voronoi_plot_2d(vor)

plt.show()
Editor is loading...