OpenCV c++ K-Means Color Clustering
Hi,
I found some interesting article about colour clustering with OpenCV and Python:
https://www.pyimagesearch.com/2014/05...
I am trying to convert that into c++. Until now without success. Did someone do that already?
Currently I have a problem with following lines:
// reshape the image to be a list of pixels image = image.reshape((image.shape[0] * image.shape[1], 3))
// cluster the pixel intensities clt = KMeans(n_clusters = args["clusters"]) clt.fit(image)
you probably should not try to solve a c++ problem from a python blog ..
I know, but I need to perform image so like in provided link. Needed results in my situation is to obtain information about 3-4 main colours on the image with the information about quantity of the colour on the image.
"Needed results in my situation is to obtain information about 3-4 main colours on the image with the information about quantity" -- can it be you wanted a histogram, instead, not clustering (which makes "artificial" centers ?