I have to use kmeans in my future work, I know it is available in OpenCV as they have a documentation page on it.
I cannot make sense of the format displayed, it has also not been explained in the given details below (it appears to be details related to OpenCV 1.1). I mean, with the C++ line:
double kmeans(InputArray data, int K, InputOutputArray bestLabels, TermCriteria criteria, int attempts, int flags, OutputArray centers=noArray() )
what datatype is data, vector or matrix? which is the input matrix, which will be the output?
I am used to reading documentation like this where it is clearly stated which is the input/output/flag etc and what data types they are.
C++: void FeatureDetector::detect(const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const
I would really appreciate if someone could give a short example of kmeans being used.
P.S. the input matrix I have ready to be used for kmeans is the one produces by DescriptorExtractor::compute
Thank you
You can find examples of using most of
OpenCV‘s functions in foldersamples. In your situation take a look at these two:kmeans.cppmatcher_simple.cpp