06-10-2013 07:20 AM
Hello,
try something like this (attachment).
One thing I noticed though - and this can give you really erroneus results: though the values of centroids when running the code more than once are the same, their positions shift. To see what I mean, try running the code once and make a print screen of the centroid values (matrix output from kmeans). Then run the code again and see that the values are basically the same, just disordered. This can give you completly false color.
If you can find the solution for this, I think this could solve your problems!
Best regards,
06-10-2013 09:09 AM
Hi Klemen,
If i run the source code more than once,the centroid values for class 1 remains the same,but for class 2,3 and 4 it's changing.Any solution for this?
Thank you
MADHUBALAN
06-11-2013 01:44 AM
Hello,
yes I was just saying that in the previous post. To my knowleddge, clustering is based on taking some random samples in the first step. So it is understandable that the values get reordered after running the algorithm more than once.
Try to tako a look at the code of the clustering algorithm; particulary the "Initial In" - these are the initial centroids. Maybe this could help you.
Or maybe perform clustering on the RGB image directly?
Best regards,
06-12-2013 07:28 AM
Hi Klemen,
In the color mask.vi file,you have used IMAQ extract 2,i dont have it in my library,when i asked you whether can i use IMAQ extract,you said i can use it,but getting a wire loose end.i.e, when i am wiring between APPENDED ARRAY of Bulid array and Y-STEP SIZE of IMAQ Ectract,it is not getting wired,can you please send me the IMAQ Extract2.
I have attached the image file..
Thank you
MADHUBALN
06-12-2013 08:25 AM
Hello,
leave "step size" unwired and wire the array to "optional rectangle". This specifies the extracted region. X step and Y step specify reduction ratio and you don't need this. Leave it unwired (default = 1).
Best regards,
06-13-2013 07:10 AM
Hi Klemen,
In this dominant color k-means clustering - Kopie (1).vi file,how to determine the percentage of color in each classes? and also how to use a different image as input in the color mask1.vi file.
THank you
MADHUBALAN
06-14-2013 02:01 AM
Hello,
please explain what do you mean by percentage of colors? What do you want to achieve. As I stated before, the problem is in that although the clustering works very good, the centroids of individual color planes are not "aligned". So you get different colors everytime, although the numbers (if put in them the right order) produce the correct dominant colors. Have you tried clustering on RGB image directly?
To change the input image replace as shown below:
Best regards,
06-14-2013 04:20 AM
Hi Klemen,
I had attached a image file of regarding color percentage of dominant color k-means clustering - Kopie (1).vi file. In the image file the first dominant colror is red,i would like to know how percentage of color(red)present in the given input image, likewise i would like to find the percentage of remaning color in the input image.
For e.g.red(70%)pink(2%),yellow(4%).
Thank you
Madhubalan