scikit-image/scikit-image — pull request #397 by kuantkid (2012-12-20 07:16:32+00:00)
Title: WIP: graph cut for image segmentation

This is an early pull request for image segmentation using graph cut. I adopt code `spectral_embedding` and `discretize` from scikit-learn with and remove those unused features within the code. I add an example to `plot_segmentations` based on the result from `slic`:
![lena](https://f.cloud.github.com/assets/2232328/23889/e81e94a8-4a74-11e2-9ab4-511952cd8804.png)

The function calculates the affinity matrix as in `random_walker_segmentation` and then apply the graph cuts algorithms to get the pixel-wise discrete labels. Also, it can take pre-segmentation to accelerate the process. Image that with more than 1000 pixels wll suffer from the svd on large laplacian matrix. It currently supports `callable` function, numpy `ndarray` and some predefined methods(currently only `slic`) as a preprocessing method.

It may take some time to clean the codes and repair some trivial mistakes before review. Just send the pull request to make sure it is in the correct direction :)

PS: Actually I am not sure whether I can use code from `scikit-learn`? @amueller