Ask Your Question
0

Tricky image segmentation in Python

asked 2012-07-18 12:34:34 -0500

drichman gravatar image

updated 2012-07-18 15:32:13 -0500

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?

edit retag flag offensive close merge delete

Comments

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

blue gravatar imageblue ( 2012-07-18 16:06:46 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2012-09-26 03:21:33 -0500

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).

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2012-07-18 12:34:34 -0500

Seen: 1,434 times

Last updated: Sep 26 '12