2
$\begingroup$

I wonder if there are algorithms used to segment images efficiently. The ones I tested by now can not segment hair correctly as on this image:

enter image description here

I just want to know if someone can give me some efficient algorithms to segment the hair on this image for example without cutting it and so on (correct segmentation)

Note that I tested famous algorithms such as watershed, grabcut, mean shift ... but no one of them segments this hair correctly.

Thank you very much in advance.

$\endgroup$
1
$\begingroup$

You can find what you need here where a comparaison of lot of matting algorithms is done. You can see the rank of those algorithms' performances as well as online demonstration on a natural and complicated image.

From that study, you can guess that A Global Sampling Method for Alpha Matting is the best algorithm to resolve your problem. The algorithm is conceived by A Global Sampling Method for Alpha Matting Kaiming He, Christoph Rhemann, Carsten Rother, Xiaoou Tang and Jian Su.

Hope this helps.

Begueradj.

$\endgroup$
0
$\begingroup$

What exactly did you expect from segmentation? The problem here is that there aren't real segments to start with.

That said, this looks like a case for texture-based segmenting. most of the hair has a grooved texture with one predominant direction.

$\endgroup$
0
$\begingroup$

You could try difference matting.

I quote from A bayesian approach to digital matting

Under some circumstances, it might be possible to photograph a foreground object against a known but non-constant background. One simple approach for handling such a scene is to take a difference between the photograph and the known background and determine α to be 0 or 1 based on an arbitrary threshold. This approach, known as difference matting (see, e.g., [9]) is error prone and leads to “jagged” mattes. Smoothing such mattes by blurring can help with the jaggedness but does not generally compensate for gross errors.

Its a very simple algorithm, making it easy to implement and fast to run. You would not even need a trimap. It has the obvious accuracy problems mentioned in that paper, but given your picture is on a constant white background I doubt they would be an issue. Of course, if you wanted it to work on more complex backgrounds, you might have to come up with something else.

Also see Video background replacement without a blue screen

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.