OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Wed, 26 Sep 2012 08:06:16 -0500Can OpenCV's mean shift implementation be used for finding local maxima in data, rather than tracking or detection?http://answers.opencv.org/question/2628/can-opencvs-mean-shift-implementation-be-used-for-finding-local-maxima-in-data-rather-than-tracking-or-detection/I want to use mean shift to find all of the local maxima above some threshold value. However, I'm not sure if OpenCV's implementation is adaptable in this way. So the question is simple: is it? And if it is, how can it be used for that purpose?Tue, 25 Sep 2012 16:04:04 -0500http://answers.opencv.org/question/2628/can-opencvs-mean-shift-implementation-be-used-for-finding-local-maxima-in-data-rather-than-tracking-or-detection/Answer by elmiguelao for <p>I want to use mean shift to find all of the local maxima above some threshold value. However, I'm not sure if OpenCV's implementation is adaptable in this way. So the question is simple: is it? And if it is, how can it be used for that purpose?</p>
http://answers.opencv.org/question/2628/can-opencvs-mean-shift-implementation-be-used-for-finding-local-maxima-in-data-rather-than-tracking-or-detection/?answer=2642#post-id-2642Tentatively, there is the [openCV method](http://docs.opencv.org/modules/core/doc/clustering.html?highlight=kmeans) for finding **k-means** for an arbitrary set of points, **but** you would need to know how many clusters you want to find, and there could be convergence issues depending on how the data is spread and how the algorithm (iterative) starts. So it might be of no help to you ;)
I found this image condenses completely the tons of k-means mathematical theory :) (from [http://www.cs.cmu.edu/~dpelleg/kmeans.html](http://www.cs.cmu.edu/~dpelleg/kmeans.html)) :
![image description](http://www.cs.cmu.edu/~dpelleg/kmeans-images/f3.gif)Wed, 26 Sep 2012 02:38:35 -0500http://answers.opencv.org/question/2628/can-opencvs-mean-shift-implementation-be-used-for-finding-local-maxima-in-data-rather-than-tracking-or-detection/?answer=2642#post-id-2642Comment by harddrive for <p>Tentatively, there is the <a href="http://docs.opencv.org/modules/core/doc/clustering.html?highlight=kmeans">openCV method</a> for finding <strong>k-means</strong> for an arbitrary set of points, <strong>but</strong> you would need to know how many clusters you want to find, and there could be convergence issues depending on how the data is spread and how the algorithm (iterative) starts. So it might be of no help to you ;)</p>
<p>I found this image condenses completely the tons of k-means mathematical theory :) (from <a href="http://www.cs.cmu.edu/~dpelleg/kmeans.html"></a><a href="http://www.cs.cmu.edu/~dpelleg/kmeans.html">http://www.cs.cmu.edu/~dpelleg/kmeans.html</a>) :</p>
<p><img alt="image description" src="http://www.cs.cmu.edu/~dpelleg/kmeans-images/f3.gif"></p>
http://answers.opencv.org/question/2628/can-opencvs-mean-shift-implementation-be-used-for-finding-local-maxima-in-data-rather-than-tracking-or-detection/?comment=2651#post-id-2651Interesting. I am aware of the k-means implementation but I was thinking of mean-shift for determining collecting svm responses. I suppose k-means is an option too but it's tough to know beforehand how many positive responses would be made by the svm.Wed, 26 Sep 2012 08:06:16 -0500http://answers.opencv.org/question/2628/can-opencvs-mean-shift-implementation-be-used-for-finding-local-maxima-in-data-rather-than-tracking-or-detection/?comment=2651#post-id-2651