Ivan Alek
Ivan Alek

Reputation: 1919

Image segmentation for iOS

I need a way to transform image containing human into a image containing only body sihlouette in one color. First i took a look at Canny edge detector (OpenCV implementation), but this may lead to problems with background of the image.

I`ve tried with GrabCut OpenCV implementation. This works fine in most of cases, bit it have extremely bad time performance, example for 480x320 image it takes up to 1 minute to process. Also the problem with grabcut is that user need to make interaction and to set the background area and user area, which in my case is not allowed.

So, maybe you can give me ideas about some another approach using something different than GrabCut, or suggest me how to enhance GrabBut time performance(Maybe gpu implementation). Also i need a suggestion about algorithm that will locate human body, and help grabcut algorithm with positioning of body/background area.

Example:

Example

Upvotes: 8

Views: 3263

Answers (4)

ninjaneer
ninjaneer

Reputation: 7031

Downscale the image by half the resolution (use pyrDown()), run GrabCut, use contour detection to vectorize the cut out, and upscale as necessary.

Upvotes: 1

EXC_BAD_ACCESS
EXC_BAD_ACCESS

Reputation: 338

You can use Canny's edge detection for this.

http://iosgpuar.blogspot.com/2011/12/canny-edge-detection-using-fragment.html

Upvotes: 0

thomketler
thomketler

Reputation: 418

OpenCV would be a good option for something like that. You can get a pre-built library for ios on the official site:

http://opencv.org/

And there is also a Tutorial-App using OpenCV, that may have a similar ability to what you're looking for:

http://computer-vision-talks.com/

Upvotes: 0

Dmitry Khryukin
Dmitry Khryukin

Reputation: 6438

can suggest two things to investigate which may help:

1) CIDetector class

2) OpenCV library for iOS. This project doesn't look active, but you can find some forks or related projects here.

Upvotes: 5

Related Questions