Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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: enter image description here

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

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

enter image description here

share|improve this question
    
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
1  
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

1 Answer 1

This appears to work nicely:

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

enter image description here

share|improve this answer
4  
might be worth mentioning that LocalAdaptiveBinarize is new for version 10... –  cormullion Jul 13 at 9:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.