Graphcut works with k-means (doesn't segfault anymore), but still
mediocre results.