AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

An almost simple problem (how to solve???)

The forum is to discuss topics related to different areas of image processing and computer vision.

An almost simple problem (how to solve???)

Postby qsx1 » Tue Jun 21, 2011 5:49 pm

As you can see in the problem.png file attached, I want to input a Bitmap having a black background and some white points accumulations. I want then to find the position of only those accumulations that are in a given size range. Hence, if the regions are to small then I don't want them (in picture I draw a red circle around these unwanted regions). The green regions are the ones that satisfy my size range.

How can I implement this (in C#) using AForge.Net and findContours (and maybe using dilation and erosion to fill the empty spaces in the clusters before applying findContours)? The input is a Bitmap similar to the one attached here. The output should be a list of center coordinates for each of the accumulation.

Please help me with this problem. It is very urgent for me!!!!!!!!! Any help (sample code) would be appriciated. Thank you!!!!!!!!!
Attachments
Problem.png
Problem.png (6.29 KiB) Viewed 350 times
qsx1
 
Posts: 2
Joined: Tue Jun 21, 2011 5:43 pm

Re: An almost simple problem (how to solve???)

Postby andrew.kirillov » Tue Jun 21, 2011 7:55 pm

Try using BlobCounter. For every found blob it will provide its size, area, etc.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 2567
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: An almost simple problem (how to solve???)

Postby qsx1 » Tue Jun 21, 2011 8:08 pm

Before using BlobCounter I should use the FillHoles class to fill the gaps in the objects. This should work, true?

Thank you.
qsx1
 
Posts: 2
Joined: Tue Jun 21, 2011 5:43 pm

Re: An almost simple problem (how to solve???)

Postby andrew.kirillov » Tue Jun 21, 2011 10:59 pm

It is up to you. BlobCounter will work anyway. If you fill holes, then only area of objects will get different, not width or height. So if area is important for you, then yes - fill all the holes.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 2567
Joined: Fri Jan 23, 2009 9:12 am
Location: UK




Return to Image Processing and Computer Vision