color percentage in image
I am beginner in OpenCv and I need your help how I can find a percentage of brown and yellow color in the picture when I ignore the white background
Consider using k-means clustering to split the pixels of the image into distinct clusters based on color. In this case, you'd probably want to use k=3, i.e., 3 clusters (one for the white background, one for the brown, and one for the yellow). Then it would simply be a matter of counting the number of pixels belonging to each cluster label.
OpenCV seems to have a k-means method, though I'm not familiar with it. You may want to check out the scikit-learn k-means method instead.
Asked: 2018-10-27 12:01:53 -0600
Seen: 506 times
Last updated: Oct 27 '18
read this tutorials