public static void main(String[] args) throws IOException
{
// read a buffered image from file
BufferedImage srcimg = ImageIO.read(new File("../../images/DSCN4909s400.bmp"));
// then create a Clusterer, FastMatrixMS is a simple Mean Shift Clusterer for images
FastMatrixMS a = new FastMatrixMS(Tools.matrixFromImage(srcimg));
// setup filter parametrs
a.setColorRange(7f);
a.setSquareRange((short)20);
// process
a.doClustering();
// paint clusters on image
BufferedImage img = Tools.paintClusters(srcimg.getWidth(), srcimg.getHeight(), a.getClusters(), false);
// write results to file
ImageIO.write(img, "bmp", new File("./out_.bmp"));
}