Up to now I have been segmenting some grayscale images using either Otsu's method or K-means. I noticed however that the segmentation cannot be "perfect" only based on the intensity. At least one would have to consider local gradients in the image.
I then did some research and came across the graph cut segmentation algorithm. I thought this algorithm would be beneficial since
- The relationship between neighboring pixels is considered
- I could incorporate prior knowledge if I know of pixels that belong to a certain class beforehand.
I now have been doing some tests using Shai's MATLAB Graph Cut wrapper and noticed that Graph Cut does not seem as beneficial as I thought. Based on the gradient I can reduce the penalty for a class border, but I can't encourage the algorithm to draw boundaries at edges - if a boundary is not present in the initialization via K-Means/Otsus (to create Dc) the algorithm won't draw one even though there might be a strong local edge. I think this is due to the fact that costs need to be positive. Hence it seems as that Graph-Cut here only helps to smoothen boundaries but it won't help me to introduce "new ones".
Long story short: Does my story above sound plausible to you, i.e. do my conclusions make sense? Or, is there a way to use edges to create boundaries?
Thanks!
PS. Sorry, I can't show a real image I am talking about here :(