Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Clusterization in OpenCV

I have a two questions about clusterization in OpenCV. I'm using kmeans clustering.

  • How to get mask of each post-clusterized layer of image? To understand this question I want to show an example. If I clusterize image on 3 clusters and after clusterisation I have this image:

output

(white is first cluster, gray is second and black - third).

So after splitting my aim is to get these three masks:

White: , gray: and black: .

  • What is the fastest way to clusterize only some part of image (I have two images - original image and mask image)? So, for example, if I clusterize image on n clusters after clusterization with mask I want to have n+1 cluster (+1 because of mask).

I'm looking for the fastest solutions of these problems.

Thanks in advance.