Detection of regions on an image

Hi everybody!
I am a beginner in the use of the library "OpenCV" and I am looking to make a shape detection in an image.
Do not believe it, but I did google searches, on this forum and all that stuff, but I can not find my happiness (probably due to my inexperience in this domain)
I will not ask you to lay my code, but only to give me directions to take, which methods to use, or even names or web pages.

So, I have images, background is usually clear in color.
When I import it, I want to put in grayscale, and play on the brightness to try to get (not completely) a white background.

In this image I can have objects and text.

What I want to do exactly, it is extracting these regions, and export rectangular images.

I know Currently transform an image in grayscale, I also know get a zone, but unfortunately I can not detect areas.

Here is a picture made in paint (the best tool in the world ^ ^) that I would obtain, the red rectangles are the regions to be exported.

http://img99.imageshack.us/img99/1202/zones.png


The next stage is to test whether the detected objects are present in another image with a reliability index (gender: I'm 97% sure that this object is present), then I will see later, because I believe that 'there are methods like stuff or sift ...

Thank you in advance for the help!
Last edited on
No one to help me... ? ;)
This is known as image segmentation. There is a great deal of literature and knowledge on the subject. Armed with the name of this, you can now go looking.

The crux of many methods is to just think about how to do it, knowing that the image is represented and as 2D grid of numbers, and apply that programatically. How did you know that the areas to be extracted are the rectangles outlined in red? Now code that.
i suggest u search in
www.sourceforge.net
Thanks Moschops,
I will read documentation about image segmentation this week-end (because no internet this week...)
I want to extract rectangles outlined in red. All images I will import in my database will have an other number of shapes with differents forms...
But first step : read about image segmentation! ;)

Thanks
Nckb,

you won't need sophisticated segmentation techniques here (if your drawing faithfully represents your case), they wouldn't address your problem.

You will first binarize the image by thresholding, then detect the connected components (also called blobs). These are the strokes on your drawing. For each, determine the bounding box.

Then you will need a non-standard step of blob grouping, based on a proximity criterion. Group the boxes that are close together or overlapping. Cast in terms of a graph problem, this is another instance of connected components labeling. (See http://en.wikipedia.org/wiki/Connected_component_(graph_theory) )

Beware anyway that any grouping criterion will be somewhat arbitrary and can lead to unwanted results (fragmentation and/or fusion).
Last edited on
Very interesting detection of blobs. I read some topics about this and I like it. Do you know the performance of detection?
I must study how to implement it with Opencv or Emgu. I saw some sample code for image segmentation, and it remains "simple" to code it, I must also see if I have the ability to use the blobs!
Have you sample code about this detection?

Thanks for your help,

Nckb
Topic archived. No new replies allowed.