Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
626 views
in Technique[技术] by (71.8m points)

image segmentation - Finding people silhouette in OpenCV C++

I would like to extract the silhouette of a human in a photo and remove the background. The photo could be taken of the full body, only the upper body or only the lower body.

What I have done so far is track the face using Haar Cascades, but the algorithm I use does a rectangle over the face and I would need the shape of all the body. I have tried HOG as well, but as well it gives me a rectangle and it doesn't work with all photos.

It would be great if somebody could help me. I'm using OpenCV and C++.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can try the GrabCut or GraphCut algorithms (At least grabcut is present in OpenCV).

You tell them the rectangle (where the body is), and they do the best to cut the object inside. It's not fast, nor perfect, but you'll have a hard time trying to find something better.

This is an open research field, so if your images do not get cut as you want, prepare yourself for some years of post-PhD research to find better algorithms :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...