Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
kmeans.js
pixelcluster.js

README.md

Pixel Clustering Module

description

Pixel clustering using k-means++ algorithm

see also blog entry

sample

pixel_clustering

(Tests: IE10, Firefox23.0, Chrome28.0, Safari6.0)

usage

var ctx = document.querySelector('#Canvas').getContext('2d');
// source image, callback function
PixelCluster.load(srcImgName, function() {
  // performs k-means on a set of observation vectors forming k clusters
  var division = 100;
  var k = 4;
  var method = PixelCluster.KMEANS_PP;  // KMEANS_PP or KMEANS_RANDOM
  PixelCluster.perform(division, k, method, function(result) {
    // render the result to canvas element
    PixelCluster.render(ctx, division, result);
  });
});

license

Copyright © 2014 wellflat Licensed under the MIT License

You can’t perform that action at this time.