File tree 4 files changed +31
-1
lines changed 4 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 1
1
.idea
2
2
vendor /
3
- image-clustering
3
+
4
+ # binaries
5
+ image-clustering
6
+ bin /
7
+ current
Original file line number Diff line number Diff line change
1
+ # Image clustering in Go
2
+
3
+ The _ image-clustering_ program partitions the pixel in an image
4
+ based on their color to a pre-defined number of clusters.
5
+ Each cluster is a random color assigned. The resulting image
6
+ will represent each pixel in its corresponding cluster-color.
7
+
8
+
9
+ #### Example
10
+
11
+ original | result with 10 clusters
12
+ :-------------------------:|:-------------------------:
13
+ ![ ] ( data/img3.png ) | ![ ] ( data/img3_c10.png )
14
+
15
+
16
+ ### K-Means Clustering
17
+
18
+ To achieve this we use __ K-Means Clustering__ , an iterative algorithm to partition a set
19
+ of data points (here colors) into a pre-defined number (k) of clusters.
20
+
21
+ The algorithm starts by assigning each cluster a randomly created centroid.
22
+ The centroid is the _ "average"_ of the points in the cluster.<br >
23
+ After we assigned each pixel based on their color
24
+ to the cluster with nearest centroid, we recompute the centroids
25
+ by assigning them to the average of their members.
26
+ This two steps are repeated until the centroids converged.
You can’t perform that action at this time.
0 commit comments