How can I extract objects from a bitmap?

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

+2


source to share


4 answers


Feature extraction is a very complex topic, and your question did not reveal the problems you are having or the nature of the objects you want to extract.



Usually morphological operators help in solving problems like this (reduce noise, fill in gaps, ...) I hope you have already discovered AForge . Before you reinvent the wheel, take a look at it. Shape recognition or blob parsing are beeps you can look at on google for some ideas for solving your problem.

+1


source


It should be fairly easy to find the associated white coordinates of a pixel in an image if the pixels are either black or white. Start scanning pixels line by line until you find a white pixel. Keep track of where you found it, create a new data structure to hold the related object. Do a recursive search from this pixel to the surrounding pixels, add each associated white pixel coordinate to the data structure. When your search cannot find more associated white pixels, "complete" that object. Go back to where you started and continue scanning pixels. Every time you find a white pixel, see if it is in one of your existing "objects". If not, create a new object and search again, adding associated white pixels as you go. When you're doneyou should have a set of data structures that represent collections of related white pixels. These are your objects. If you need to define what they are or simplify them into shapes, you will need to do some kind of internet search - I can't help you. It was too long since I took a computer vision course.



+1


source


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

0


source


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

Each topic is big. There are simple statements, but your description is not very detailed ...

0


source







All Articles