From 62f23ff910ff61245be7604ed44f6d56f36865c0 Mon Sep 17 00:00:00 2001 From: kris Date: Wed, 24 Nov 2021 09:10:03 +0000 Subject: [PATCH] Don't mutate initial_centroids --- dither.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dither.pyx b/dither.pyx index 0881ef3..59b11b3 100644 --- a/dither.pyx +++ b/dither.pyx @@ -543,7 +543,7 @@ def k_means_with_fixed_centroids( cdef double error, best_error, centroid_movement, total_error cdef int centroid_idx, closest_centroid_idx, i, point_idx - cdef (unsigned char)[:, ::1] centroids_rgb12 = initial_centroids[:, :] + cdef (unsigned char)[:, ::1] centroids_rgb12 = np.copy(initial_centroids) cdef (unsigned char)[:, ::1] new_centroids_rgb12 cdef float[::1] point_cam