This paper focuses on the development of medical software for clinical applications using advanced image processing algorithms. Three critical issues of hair segmentation and counting are addressed in this paper. First, the removal of any bright spots due to oil or moisture, which generate circular patternsin the middle of the hair and significantly affect the accuracy of determining the line. Second, two contacting or overlapping hairs are recognized and counted as a single hair.
To solve this problem, we proposed a hair-bundling algorithm to calculate any concealed hairs. Finally, hairs may be wavy or curly, making the conventional Hough-based line detection algorithm unsuitable, since it suffers from parameter selections, such as the minimum length of line segment, and distance between line segments. Our proposed hair counting algorithm is substantially more accurate than the Hough-based one, and robust to curls, oily scalp, noise-corruption, and overlapping hairs, under various white balance.