Hello Guest
No Avatar
Sign In to Remove
Posts: 
4
Reputation: 
0
Posted: May 12, 2013, 12:24 AM
  • Group: Member
How do you find the Kmean for any picture? Could you make one for that, or at least explain?
Posts: 
400
Reputation: 
20
Posted: May 12, 2013, 6:13 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
Here is an explanation from the Kmean Color Stripe app I made. If you need further explanation just write back.

Quote
How does K-mean Clustering Work?
K-means partitions all data points into k number of clusters according to there "closeness" to the centroid assigned to the cluster. Then you take the averages of all of the points in each cluster to form a new centroid for that cluster. Rinse and repeat until there is no change in the centroids.

In this case, our data points is the RGB data of each point and we calculate the closeness by using the euclidean distance formula for 3d space. The position of the pixel in the image has nothing to do with how the pixels are grouped. You can see this rgb distance relationship in the graph.
Source (Look at the FAQ)
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
4
Reputation: 
0
Posted: May 12, 2013, 11:45 AM
  • Group: Member
I want to be able to find the dominant color through kmean of any image, not just a favicon. Can you make an app for that? Or at least direct me on how to go about that. Preferably in a way similar to your color stripe app. It works the best out of anything I try
Posts: 
400
Reputation: 
20
Posted: May 14, 2013, 9:53 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
I want to be able to find the dominant color through kmean of any image, not just a favicon. Can you make an app for that? Or at least direct me on how to go about that. Preferably in a way similar to your color stripe app. It works the best out of anything I try

I am working on Kmeans class so that you can implement it however you need. Hope to open source it on GitHub.
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
4
Reputation: 
0
Posted: May 14, 2013, 3:30 PM
  • Group: Member
Thank you
Posts: 
400
Reputation: 
20
Posted: May 19, 2013, 11:32 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
Thank you

I just made a GitHub project called KmeansImage that will do everything you need. It's a simple php class that will give you all the options to find the dominant color of any png image.

The whole file is documented and there a couple demos that show how to use it.
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
4
Reputation: 
0
Posted: May 20, 2013, 12:26 AM
  • Group: Member
Thank you, how do you use it?
Posts: 
400
Reputation: 
20
Posted: May 20, 2013, 12:32 AM  -- Last Edit: May 20, 2013, 1:37 AM by MLM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
Thank you, how do you use it?

I am not sure on your specific question now. Do you want to know how to manually do this or have the script do the work?

To run PHP, just put it on a server with PHP set up or if you want to run this locally you can run WAMP (for windows) or MAMP (for mac, I have never used)

Once you have a space that can execute PHP, just navigate to the demo folder in the browser and run the demos. You can change the image by just editing the demo file.
<3 Nerve, Sk8, Labradoodle, Austin