-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
graph cut for image segmentation #397
Conversation
That is pretty cool :) As both projects are BSD-Licensed, moving code is no problem. You just have to leave in the authors afaik. Btw, I wouldn't call this "graph cuts" but rather "normalized cuts". |
@amueller Thanks for the information. I will ping you after I clean the code, as it is quite premature for now (it also fails on travis currently). Directly copy the code may not be a good idea as Comments are welcome. |
/ping @kuantkid Any further progress? |
@stefanv I am busy job hunting and thesis those months. I will return back after two weeks or so. Sorry for the lag :). If anyone is interested, please go ahead. |
@kuantkid All the best! We look forward to having you back. |
You might want to implement the more robust scheme from this paper (see section 6): http://berkeley.intel-research.net/arahimi/c/papers/rahimi-ncut.pdf |
/ping @kuantkid |
@stefanv Sorry this is terribly delayed by various personal reasons during this graduate time. I will begin work now :) |
@kuantkid Are you planning on working on this PR again? |
Is the PR still being worked? If not, I can pick from where the work was left and attempt to finish up. |
btw, what about using this segmentation? https://github.com/Borda/pyImSegm |
@Borda great work! How fast is your code? |
@soupault it depends on several parameters/aspects, such as how many features you want to compute, what is the size of superpixels, etc., but in general, it is a couple of seconds... |
@Borda could you, please, elaborate on what you have in mind? I see that your repo implements, so to say, a framework for segmentation. Are you suggesting to consider your implementation or Graph Cut, or something more? |
@soupault I am not sure if I should suggest anything, I was giving an example that there are also some other graph-cut based segmentation... I think that using super-pixels features is quite useful and make the segmentation more robust and running graph-cut on large images is impossible to compare to running it on an image of the same size decomposed into super-pixels... The graph-cut is standard, and computed features are simple or what should I elaborate? |
Hi @souravsingh @Borda are any of you still interested in bringing this to life again? :) |
it looks quite old... @alexdesiqueira do you mean to finish this PR or what I proposed makes Graph-Cut on superpixels? I could do the superpixel version, just need to find python graph-cut running on all OS, because pyGCO is now compiled only for Linux... I was considering Borda/pyImSegm#21 |
@alexdesiqueira @Borda the superpixel version exists in |
@jni so it means that there is no need for another superpixel - graphCut, right? |
That's my reading of the situation, yes... This PR actually predates |
I see two ways we could proceed here:
|
As per @jni's comment, I'm closing this PR. The plan is to bring the respective function in |
This is an early pull request for image segmentation using graph cut. I adopt code
spectral_embedding
anddiscretize
from scikit-learn with and remove those unused features within the code. I add an example toplot_segmentations
based on the result fromslic
: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 supportscallable
function, numpyndarray
and some predefined methods(currently onlyslic
) 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