Untitled

mail@pastecode.io avatar
unknown
python
7 months ago
575 B
0
Indexable
Never
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()