Fixed something

This commit is contained in:
xixu-me committed 2024-10-23 15:00:00 +08:00
1 parent abf854e021
commit aeed10daca
4 files changed
+1 -8

No files matched your search

+1 -4
View File
@@ -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)
-2
View File
@@ -1,5 +1,3 @@
# 用OpenCV库中的均值漂移函数cv2.pyrMeanShiftFiltering()来实现图像分割,需要先将图像从BGR转换到YUV颜色空间,分割后将分割结果从YUV转换回BGR颜色空间显示。
import cv2 as cv
import numpy as np
-2
View File
@@ -1,5 +1,3 @@
# 根据MeanShift算法的原理,手动实现Meanshift算法。
import math
import matplotlib.pyplot as plt
View File
File renamed without changes.