views:

340

answers:

4

I have a bitmap with black background and some random objects in white. How can I identify these separate objects and extract them from the bitmap?

A: 

There are several articles on CodeProject that deals with these kinds of image filters. Unfortunately, I have no idea how they work (and if I did, the answer would probably be too long for here ;P ).

leppie
+1  A: 

Feature extraction is a really complex topic and your question didn't expose the issues you face and the nature of the objects you want to extract.

Usually morphological operators help a lot for such problems (reduce noise, fill gaps, ...) I hope you already discovered AForge. Before you reinvent the wheel have a look at it. Shape recognition or blob analysis are buzz works you can have a look at in google to get some ideas for solutions to your problem.

jdehaan
A: 

It should be pretty simple to find the connected white pixel coordinates in the image if the pixels are either black or white. Start scanning pixels row by row until you find a white pixel. Keep track of where you found it, create a new data structure to hold its connected object. Do a recursive search from that pixel to its surrounding pixels, add each connected white pixel's coordinates to the data structure. When your search can't find any more connected white pixels "end" that object. Go back to where you started and continue scanning pixels. Each time you find a white pixel see if it is in one of your existing "objects". If not, create a new object and repeat your search, adding connected white pixels as you go. When you are done, you should have a set of data structures representing collections of connected white pixels. These are your objects. If you need to identify what they are or simplify them into shapes, you'll need to do some googling -- I can't help you there. It's been too long since I took that computer vision course.

tvanfosson
A: 

1) Morphological operations to make the objects appear "better"
2) Segmentation
3) Classification

Each topic is a big one. There are simple approches but your description is not too detailed...

InsertNickHere