问题标签 [mean-shift]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python-2.7 - pyrMeanShiftFiltering 中的颜色窗口半径是什么意思?
我对 RGB 颜色向量的理解是它有 3 个分量,例如 [100, 100, 100]。但是,从文档sr – The color window radius
中, Python 函数中的参数cv2.pyrMeanShiftFiltering(src, sp, sr[, dst[, maxLevel[, termcrit]]])
接受一个 int。
颜色半径究竟是什么意思?我还想了解最小值和最大值,以及单位的含义。
python - 通常如何从 Mean Shift Clustering 中检索集群?
我目前已经在 python 中实现了均值移位聚类。我使用了 matplotlib,得到了我期望的随机输入聚类结果。但是,我对通常如何将每个点的集群减少到几个集群感到困惑。
我的意思是平均偏移将每个点输出为一个簇,尽管许多点实际上可能对应于同一个簇。我有几种方法可以在理论上做到这一点,但对我来说似乎很奇怪,我看过的一个教程实际上没有解释你如何在输出中实际提取独特的集群:
可以为每个点提供一个集群列表,在对每个点进行移位后,检查新创建的集群是否等于给定点(或某个近距离度量),将移位点的原始点添加到集群. 否则,创建一个新集群作为对 [cluster_location: [cluster_points]]
可以有一个散列(字典),您可以在其中散列集群位置,然后如果您当前的集群位置存在,则将未移位的点添加到该集群,否则创建一个新的集群散列索引。
我倾向于做 B,但我想知道从 Mean Shift 进行聚类检索的标准方法实际上是什么。
python-3.x - 使用 Mean Shift 进行文档聚类
我拿了一堆文档并为所有文档中的每个标记计算 tf*idf 并为每个文档创建向量(每个 n 维,n 是语料库中唯一单词的数量)。我无法弄清楚如何创建使用 sklearn.cluster.MeanShift 从向量中聚类
image-processing - MeanShift公式理解
我正在使用来自这里的想法来实现用于对象跟踪的 MeanShift 算法:http ://www.cse.psu.edu/~rtc12/CSE598C/meanShiftColor.pdf
现在我有后续帧的反投影图像。此类图像中的每个像素都标记了属于被跟踪对象的概率:
w(x i ) = 反投影图像中的像素。
x = 当前中心像素。
我不明白是什么spatial kernel
。
假设它可以是大小为 5x5 的 2D 高斯核,则 K(x i -x)*w(x i ) 可以用预模糊图像的像素代替。
我的代码看起来是这样的:
所以我只是通过平滑的反投影图像进行迭代,并且对于每个像素:
将其值添加到分母,
将其值乘以从当前中心到分母的偏移。
它在第二次迭代时收敛,但 shift 是错误的,我不知道如何调试它。可能是公式实现中的问题。
请用人类语言向我解释什么是空间内核以及如何将其应用于权重图像。谢谢!
python - Scikit mean shift algorithm returns black picture
I am trying to perform image segmentation using scikit mean shift algorithm. I use opencv to display the segmented image. My problem is the following: I use the code as given in different examples, and when I display the image after segmentation, I get a black image. I was wondering if someone could see what my mistake is... Thanks a lot for the help !
Here is my code:
numpy - 为什么 OpenCV 的 Meanshift 跟踪算法只在第一次跟踪对象?
我正在运行 meanshift 跟踪算法来跟踪 OpenCV 中的实时流(使用网络摄像头)中的对象,但是该算法仅在第一次运行时有效,并且在我再次运行程序时不起作用,除非我重新启动计算机。为什么会这样?算法取自:https ://docs.opencv.org/trunk/db/df8/tutorial_py_meanshift.html
python - AttributeError:“builtin_function_or_method”对象没有属性“段”
使用meanshift算法在图像分割中面临以下行中的错误:
完整的追溯是:
python - Scikit learn: Applying Mean Shift on a multi-dimensional dataset
I have a dataset which has 14 different features/columns and 4328 rows, values of which I have then processed and converted into a NumPy array of shape (4328, 14). I have then applied Mean Shift on this NumPy array to train my model, which segregates the data points into 29 different clusters.
Cluster centres:
Now, I tried plotting these clusters in a 2D plane which then produced this plot:
Now, I'm not really sure why my clusters along with the various data points were plotted in a single line, with the value of X-axis for each coordinate being 0. Am I missing something here? Is there a different way I should be preprocessing my dataset if I want to cluster them into different clusters?
Edit 1:
Code used to plot the above graph (clf
is the name of my model object):