Sorry, this content is no longer available

Ask Your Question
0

Tricky image segmentation in Python

asked Jul 18 '12

drichman gravatar image

updated Jul 18 '12

I'm trying to segment a live video feed in real time. The frames look much like this: http://img515.imageshack.us/img515/9531/depthimg2.jpg In particular, I need to extract pieces like the smaller box in the center-right of the frame.

The problem is that the background isn't completely black. I've been trying to use FindContours, but it has a hard time because it treats the image as binary. Is there some sort of blob detection that handles multiple layers?

Preview: (hide)

Comments

Try applying adaptiveThreshold to binarize the image before passing to FindCountours.

blue gravatar imageblue (Jul 18 '12)edit

1 answer

Sort by » oldest newest most voted
0

answered Sep 26 '12

elmiguelao gravatar image

If you know the amount of segments to extract, mean-shift segmentation via openCV k-means can do the trick, although the inclusion might be a problem to be dealt with separately. I made a post on k-means here http://answers.opencv.org/question/2628/can-opencvs-mean-shift-implementation-be-used-for/.

More info can be found in this slides: http://robots.stanford.edu/cs223b04/CS%20223-B%20L11%20Segmentation.ppt (slide 41 onwards).

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Jul 18 '12

Seen: 2,279 times

Last updated: Sep 26 '12