From aeed10dacaea10228e696f56b7093092e589289c Mon Sep 17 00:00:00 2001 From: Xi Xu Date: Wed, 23 Oct 2024 15:00:00 +0800 Subject: [PATCH] Fixed something --- 7/1.py | 5 +---- 7/2.py | 2 -- 7/3.py | 2 -- 7/{center_1.txt => center.txt} | 0 4 files changed, 1 insertion(+), 8 deletions(-) rename 7/{center_1.txt => center.txt} (100%) diff --git a/7/1.py b/7/1.py index 3a77501..d467add 100644 --- a/7/1.py +++ b/7/1.py @@ -1,12 +1,9 @@ -# 使用sklearn.cluster库中的MeanShift类,对生成的二维模拟数据进行聚类。 - import matplotlib.pyplot as plt -import numpy as np from sklearn.cluster import MeanShift, estimate_bandwidth from sklearn.datasets import make_blobs centers = [[1, 1], [-1, -1], [1, -1]] -X, _ = make_blobs(n_samples=300, centers=centers, cluster_std=0.4) +X, _ = make_blobs(n_samples=300, centers=centers, cluster_std=0.4) # type: ignore bandwidth = estimate_bandwidth(X, quantile=0.2, n_samples=300) diff --git a/7/2.py b/7/2.py index c248ebf..75ec738 100644 --- a/7/2.py +++ b/7/2.py @@ -1,5 +1,3 @@ -# 用OpenCV库中的均值漂移函数cv2.pyrMeanShiftFiltering()来实现图像分割,需要先将图像从BGR转换到YUV颜色空间,分割后将分割结果从YUV转换回BGR颜色空间显示。 - import cv2 as cv import numpy as np diff --git a/7/3.py b/7/3.py index 8d748a7..405c5be 100644 --- a/7/3.py +++ b/7/3.py @@ -1,5 +1,3 @@ -# 根据MeanShift算法的原理,手动实现Meanshift算法。 - import math import matplotlib.pyplot as plt diff --git a/7/center_1.txt b/7/center.txt similarity index 100% rename from 7/center_1.txt rename to 7/center.txt