Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I want a c# algorithm to detect red small objects( blobs) in a background with 2 other colors( i.e blue and white) so i want to circle these red objects..
 
i know about Aforge.NET library but it's not useful in my case because I can't add the references in Windows Phone 7 solution ( it's not compatible with its run-time)
 
Thanks!
Posted 1-May-11 18:25pm
rodi1330
Edited 1-May-11 18:52pm
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Without extra library?! Well, AForce.NET is using .NET only, so, here is the plan:
 
  1. Try to solve the problem all by yourself;
  2. When you get enough experience and still face problems, build AForge.NET library and try to understand how it works; may be it will help you;
  3. Go back to item 1; repeat those items until success;
  4. If you feel you're not making further progress but your problem is not yet solved, ask a question at CodeProject, this time more concrete.
 
A hint: get red channel only and try to perform Blob Detection, see:
http://en.wikipedia.org/wiki/Blob_detection[^]
 
—SA
  Permalink  
v3
Comments
RaviRanjankr at 1-May-11 23:39pm
   
Nice response SA, My 5 :)
rodi1 at 1-May-11 23:46pm
   
Thats what happens when we need things urgently and writing quick questions.. Now , you can revise the question :)
 
Regards.
SAKryukov at 1-May-11 23:58pm
   
Urgently? Hm. That could be quite a big part of project. Didn't you know about that? Read the reference to see what's involved; it pretty much explains the algorithms and provides further references. Knowing proper keywords, you can try to find code samples...
--SA
rodi1 at 2-May-11 0:05am
   
I'm a newbie in image processing and this reference is helping me knowing the keywords for searching so thank you :)
 
The problem is that I'm only finding code samples with aforge.Net and this won't help in my case.. Do have any code sample links?
 
Thank you for your support :)
SAKryukov at 2-May-11 0:18am
   
No, I don't know any samples. I've used very expensive copy-protected commercial library just a bit and have an idea on how big some tasks are. I don't want to discourage you (because you might have enough talent and be am effective and hard worker), but the problem is exactly not for beginners.
--SA
rodi1 at 2-May-11 0:28am
   
Oh yes I'm a beginner and a passionate student developing some cool ideas.. yes it's a hard task for me but I really need it for my project. As you are expert in the field , I have a microscopic image with cells and the bacteria are colored with red and the background is blue so I want the application to circle these red bacterias automatically.. Do you have any other solution that fits my case?
 
Thank you a lot!
SAKryukov at 2-May-11 0:46am
   
You're welcome.
 
I cannot see a simpler solution. Major simplification was going to red channel only (just in your case), so it reduces the problem to a simper gray-scale problem. You can also contrast the picture before recognition, it can help. I'm not such an expert; I directed a team working for just few months on the problem using recognition; and we had just one real expert in this field.
 
I must say, your task is pretty interesting but relatively simple in recognition part.
You still can use some library but only a part of the source code, to make it clean from unused code which is not supported by your version of CLI (is it Compact Framework?).
 
If you find my answer useful, will you formally accept it (green button)?
 
--SA
rodi1 at 2-May-11 1:07am
   
Thanks again :) yes you deserve the green button -;)
 
My CLI is a compact framework yes ... I will try to do play out with contrasting. Now, I used some sort of contrast, these red particles became fluorescent which is good.. Now , the challenge is how to place a circle and recognize them.. I can't import any references like aforge.net & Emgu :( ..
SAKryukov at 2-May-11 1:16am
   
Thank you.
Well, most difficult part is still on your plate to work at... :-)
--SA
rodi1 at 2-May-11 1:25am
   
You are welcome :)
 
I used these for playing with contrasts and I can get amazing results by just using color, contrast , and gamma -;) I'm almost getting the red particles shining whereas the blue/white background is vanishing .I think I will automate the values according to my case ..
 
I can forget about circling with this solution..
 
Ain't it a good solution now?
 
http://www.codeproject.com/KB/GDI-plus/csharpgraphicfilters11.aspx
 

 
SAKryukov at 2-May-11 1:27am
   
Looks like a great article but I cannot see that the blobs are recognized.
--SA
SAKryukov at 2-May-11 0:37am
   
Thank you, Ravi.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
SAKryukov at 1-May-11 23:41pm
   
Just for a record: 1) due to OP claim that she/he knows about AForge.NET, first link is redundant; 2) second article does not have a relevant chapter which would help.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 George Jonsson 175
1 Kornfeld Eliyahu Peter 169
2 Zoltán Zörgő 139
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 1 May 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100