# Image Processing: Detecting and counting small objects

I would like to analyze close-up images of human hair. My goal is to detect and count the number of hair strands and determine their width, but I am having a hard time binarizing the image. Seems like there is too much noise. Any suggestions ?

Image is below:

I used the following code and got a result that does not detect all the hairs:

arm2 = ColorNegate[DeleteSmallComponents[Binarize[arm, 0.42]]]


-
You should try to take the image. Run ReplacePixelValue and change all of the values that have Pixel Values you know are not hair to plain white so Binarize would have an easier time to distinguish. Make sure that you also account the fact that the edges of the hair ends will be lighter than the center. Let me know how it goes. Good Luck. I will try it on my own later on if you don't get it. –  mildused Jul 12 at 23:58
This or this may be related. Searching for related questions is recommended. –  bobthechemist Jul 13 at 0:53
I already saw the first link and didn't have luck using their code. Thanks for the second link. I'll look into it. –  Aí Phi Nguyễn Jul 14 at 15:57

DeleteSmallComponents @ LocalAdaptiveBinarize[ColorNegate[img], 10, {1, 1, 0.02}]

might be worth mentioning that LocalAdaptiveBinarize is new for version 10... –  cormullion Jul 13 at 9:43