Está en la página 1de 6

See

discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/23400234

Automated body hair counting and length


measurement

Article in Skin Research and Technology · December 2008


DOI: 10.1111/j.1600-0846.2008.00322.x · Source: PubMed

CITATIONS READS

3 169

2 authors, including:

Pascal Vallotton
ETH Zurich
82 PUBLICATIONS 1,149 CITATIONS

SEE PROFILE

All content following this page was uploaded by Pascal Vallotton on 22 December 2014.

The user has requested enhancement of the downloaded file. All in-text references underlined in blue are added to the original document
and are linked to publications on ResearchGate, letting you access and read them immediately.
Skin Research and Technology 2008; 14: 493–497 r 2008 CSIRO
Printed in Singapore  All rights reserved Journal compilation r 2008 Blackwell Munksgaard
doi: 10.1111/j.1600-0846.2008.00322.x Skin Research and Technology

Automated body hair counting and length measurement


P. Vallotton1 and N. Thomas2
1
Biotech Imaging, CSIRO Mathematical and Information Sciences, North Ryde, NSW, Australia and 2Reckitt Benckiser Healthcare Ltd (UK), Hull, UK

Background/purpose: Hair loss or hair excess is a com- Scanner imaging ensures a sharp image over the whole
mon condition. There is a growing need to quantitatively field. The system analyses on the order of two images per
assess the success of interventions aimed at replenishing minute, making it suitable for large clinical studies. Counts
areas that lack hair or at removing hair from areas such as delivered by a human counter vs. the software were within
the back, the legs, or the arms. Non-invasive methods that 10% of each other (N 5 12).
do not require staining are highly desirable because the Conclusion: Based on our results, we expect that the soft-
staining process itself may affect the efficacy of the treat- ware will be useful to a number of researchers investigating
ment. medical and cosmetic issues involving objective assess-
Methods: We introduce a system based on a flatbed scan- ment of pilosity. The algorithm itself may be of use for other
ner and on novel and sensitive image analysis algorithms to applications.
count the number of hairs and their individual length.
Additionally, a measure of hair visibility is introduced, which Key words: hair – linear feature – hair counting – hair
allows assessing objectively the severity of the condition. length – pilosity
Results: Our system is able to detect even hairs that are
difficult to see to a human observer. It is robust to skin & Blackwell Munksgaard, 2008
impurities or variations in the skin texture and colour. Accepted for publication 30 December 2007

for body hair removal


C ONSUMER COSMETICS
represent a very large market. At the oppo-
site end of the spectrum, blockbusters drugs such
associated with low signal to noise ratios in
highly variable skin backgrounds.
In the language of image analysis, a hair is a
as finasteride may be used for hair re-growth (1). linear feature. Many general algorithms have
To support the development of such com- been developed for linear feature detection,
pounds and treatments, and to inform the patient among which non-maximum suppression (3),
in the clinics on their efficacy, methods to count ranked order filters (4), and image transforms,
hair number and length are required. Hair count- such as the Hough transform (5). Generally, few
ing is often performed manually, a labour-inten- of the available algorithms exploits the knowl-
sive approach flawed by human errors and edge that hair tend to be straight locally, and
variability between assessors. As any hair is those that do so tend to assume global linearity
much alike any other hair, it is difficult to ensure (6). Additionally, for the present application, we
that it has been counted exactly once. Addition- needed a method that was very robust to noise
ally, the counting process does not normally and would average out the noise along the hair
deliver length, or visibility information. length as the tracing proceeds. We tried a number
The automated systems known to us focus of established algorithms without success and
mainly on cranial hair (2). In contrast, we are were thus led to develop a new approach for
mainly interested in other body regions, where linear feature detection. Briefly, the algorithm
hair is much sparser and typically thinner. We are rapidly explores line segments connecting local
committed not to use staining because this pro- intensity maxima and assembles the selected
cess may have an influence on the efficacy of the segments together to form optimal hair traces.
depilatory treatment, either cream or wax. Add- This is done by considering the angles between
itionally, the staining may fail if left either for successive segment, as well as the average
too long or too short. Thus, a highly sensitive intensities along successive segments. Addition-
system is needed, capable to detect even fine hair, ally, as the best path linking two local intensity

493
Vallotton and Thomas

maxima is not always perfectly straight, some Image analysis


flexibility around the straight path was allowed. Hair is typically darker than the skin. Our algo-
Given the natural curves of the human body, a rithm can be easily modified to deal with hairs
significant issue is to guarantee that all the hairs that are lighter than the skin. We only present the
are in focus and that a reproducible image mag- case where hair is darker than the skin.
nification is used across sample images. We have
found that using a standard portable flatbed
Pre-processing
scanner delivered highly reproducible and sharp
We first transformed the colour image to the HSV
results. In order to ensure that the same area was
(Hue, Saturation, Value) colour space and only
analysed in the positive and negative controls, we
used the Value component in the sequel. The
used a small cardboard frame, with an opening
Value represents the brightness of a pixel and
the size of a business card (9 cm  6 cm).
we found that this component maximized the
Together, the methods, algorithms, and image
contrast between hair and skin.
acquisition scheme that we present constitute a
We then identified automatically the black
dependable but easy to deploy solution for body
frame cardboard using intensity thresholding,
hair measurements.
keeping only pixels lower in intensity than 30
grey values. Only pixels within the frame were
Materials and Methods analysed subsequently.
The skin may present coarse heterogeneities.
Experimental protocol
Alternately, some light may streak under the
In order to avoid crossing hairs, subjects with
cardboard and cause illumination gradients. Fi-
long hair were trimmed to approximately 4 mm
nally, for some high-curvature body area, it may
within a selected area (typically the thighs or the
not be possible to flatten the region of interest,
calves for convenience). The cardboard frame
thus creating additional heterogeneities. We
was taped by its outer rim on the test area. The
removed these heterogeneities by using a differ-
scanner window was then applied with gentle
ence of Gaussian filter. The wider filter provides
pressure, such that the whole area was in focus
an estimate of the background while the narrow
within the frame. The image was then stored for
filter slightly smooths the signal (see Fig. 2). The
later offline processing. A test image is shown in
half-width at half-maximum for these two filters
Fig. 1a. Directories containing the test images
were 10 and 0.3 pixels, respectively. The size of
were named following the following pattern:
the convolution kernel was 10  10 pixels.
‘test1’, ‘test2’ . . ., in order to distinguish the
different batches of experiments. In each direc-
tory, the images were stored as ‘1_treated.tif’, Local intensity maxima selection
‘1_untreated’, ‘2_treated.tif’, ‘2_untreated’ . . ., The image was inverted and local intensity
with the prefix distinguishing each subject in maxima were identified such that no two local
the batch. This allows the software to batch maxima were within o7 pixels of each other.
process all images in a directory and export Local intensity maxima represent pixels featuring
results in a single spreadsheet in the same direc- intensities higher than their immediate neigh-
tory. bours. The number of local maxima was consid-
The depilatory treatment was then performed, erable: on the order of several tens of thousands.
being careful to apply the treatment up to the All the maxima that were below a certain inten-
very rim of the frame. The treated area was then sity threshold IT were eliminated. This threshold
imaged again. The whole process did not last was determined self consistently by forcing the
more than a few minutes, with minor inconve- average density of retained local maxima over
nience to the subjects. the whole region of interest to a chosen value,
We used a Scanshellt 1000 flatbed scanner using the function ‘fminsearch’ of Matlabt (The
(Scanshell, Los Angeles, CA, USA) to acquire MathWorks Inc., Natik, MA, USA). We chose that
images. The scanner is capable of 600 dpi optical average density by measuring subjects with
resolution and can acquire a colour image in dense pilosity and verifying that this threshold
o5 s. At this resolution, images are 1800  3000 was not limiting for the hair identification. In the
pixels in size, with a pixel size in the object space object space, this value was equal to 50 local
measuring 0.0143 mm. maxima per square centimetre (see Fig. 2).

494
Body hair counting and length measurement

Segment selection
Segments linking neighbouring local intensity
maxima were then tested for their quality, as
measured by the average intensity along their
length. Only segments shorter than 30 pixels
were produced in order to limit the number of
segments to consider. A value of 30 pixels was
found to be large enough such that the immense
majority of segments needed to span the hairs
were generated.
Hairs are very straight locally but they are
flexible. Therefore, rather than calculating the
average intensities only along a straight line,
we let the traces explore a path 1 pixel above
(respectively to the right of) and below (respec-
tively to the left of) the straight path. The optimal
path was not allowed to cross from one side to
the other of the straight line. We found that this
restriction improved discrimination against false
positives. The average intensity on the best such
path had to be higher than the intensity threshold Fig. 1. (a) RGB image of a calf, showing the taped black cardboard
IT in order for the segment to be retained for frame that allows defining the same region of interest before and after
further analysis. the hair removal treatment. (b) Same area as in (a) but with all hair
traces found by the software and longer than 15 pixels shown in red.

Hair tracing row reporting the length of each detected hair, as


The set of selected segments formed a set of well as the integrated intensity along the hair
disconnected graph components (a forest), with evaluated from the background corrected image.
each component counting from one to several This integrated intensity provides a measure of
tens of segments. The most intense segment of hair visibility.
the component was selected as a seed segment to The hair length distribution for the sample
grow the hair from the set of individual segments image shown in Fig. 1 is given in Fig. 4. The
that compose it (see Fig. 3). This growth pro- distribution is bimodal with a large number of
ceeded from both ends of the segment. At each very short traces that could not be grown beyond
stage, the candidate segment that presented a the initial seed segment. These traces can be
most similar intensity and was most aligned with
the current segment was selected as the next hair
segment. Bends higher than 451 terminated the
hair growth. The hair length is measured as the
sum of the Euclidian distance of each segment
that composes it. The algorithm had a surprising
ability to trace hair even in local environment,
such as wounds, moles, or cracks caused by dry
skin.
The algorithm was developed under the
Matlabt (The MathWorks Inc.) programming
language. It is available from the authors for
research purposes.

Results Fig. 2. Selected local intensity maxima are indicated by black circles
overlaid on the background corrected image. The maxima mostly line
The software exports numerical results in Excelt up along hairs. The density of retained maxima was set self-consis-
tables (Microsoft, Redmont, WA, USA), with each tently to 50 cm 2 on average, in order to speed up the algorithm.

495
Vallotton and Thomas

TABLE 1. Comparison of the number of hair counted by a ‘blind’ manual


counter, and by our automated algorithm for a set of 12 sample images

Comparison of automated counts vs. manual counts.


Test image Manual counting Automated counting

1 60 59
2 1 7
3 178 175
4 237 222
5 178 175
6 153 158
7 3 28
8 61 48
9 49 57
Fig. 3. Illustration of the hair growing process. Retained local maxima 10 23 29
are the large white disks. All retained candidate segments are shown in 11 11 15
black dotted lines and connect pairs of local maxima within 30 pixels of 12 37 38
each other. The best path in the connected component is the white Total 991 1011
dotted line. Note that the hair on the left was not traced by mistake
because our method deliberately produces only one trace per connected Traces shorter than 15 pixels were not counted. All test subjects were
component. Caucasians.

eliminated from the analysis on that basis. They


correspond mostly to skin impurities, skin folds,
or ingrown hair as we verified by inspection. Discussion and Conclusion
Correspondingly, the software allows setting a
Exploiting the fact that hair are straight locally
minimum trace length for exporting the results to
and show mostly constant intensity along their
the spreadsheet. We recommend using a value of
length, we have developed an algorithm with
15 pixels such that only traces longer than 0.2 mm
good sensitivity and discrimination power. The
are exported.
algorithm does not require nor offer any para-
Initial testing of the software was performed on
meter tuning to the user, resulting in maximum
12 sample images. Hair number was counted
objectivity, and minimum hand-on time.
both manually on a high definition screen and
The software needs about 30 s to analyse an
using the software with a hair length threshold of
image of 1800  3000 pixels. This represents a
15 pixels. The total number of hair obtained using
significant improvement in speed compared with
both methods was within 10% of each other as
manual counting, which took on average 5 min
shown in Table 1.
on a high definition screen, whereby each hair
was flagged to ensure that it had been counted
30 once and only once. This form of counting
represents itself a significant improvement over
25 in situ manual counting, where that condition is
very difficult to ensure. The software can also be
20 used in a refined mode, whereby the user exam-
ines the results and modifies the counts by a few
# Traces

15 units as needed. Human attention performs


poorly for systematic tasks, but it excels at spot-
10 ting mistakes! For most images however, the
quality of the results was such that this post-
5 processing step was not necessary.
We see a few ways to further improve the
0
0 10 20 30 40 50 60 70 80
algorithm. First, we are considering to refine
Trace length (pixel) the traces obtained by our algorithm, from a set
of straight segments, to a more flexible form
Fig. 4. Histogram of trace length for the results shown in Fig. 1. The
distribution is bi-modal, with traces corresponding to real hair having based on splines. The quality of the traces
a length above 15 pixels (0.2 mm). Only traces longer than this could be further improved by using simulated
threshold are exported by the software. annealing (7).

496
Body hair counting and length measurement

We have purposefully avoided hairs that were 2. Hoffmann R. TrichoScan. A new instrument for digital
crossing each other by limiting the use of the hair analysis. Hautarzt 2002; 53: 798–804.
3. Sun CM, Vallotton P. Fast linear feature detection using
software to short or trimmed hair. Dealing with multiple directional non-maximum suppression. In:
crossing hair will require scheme whereby once a Tang YY, Wang SP, Lorette G, Yeung DS, Yan H, eds.
hair trace has been extracted from a connected Proceedings of the 18th International Conference on
Pattern Recognition, Vol, I. Los Alamitos: IEEE Compu-
component, another trace is initiated from the ter Society, 2006: 288–291.
brightest segment that remains in the component. 4. Menzies SW, Bischof L, Talbot H et al. The performance
Initial attempts have shown that this approach of SolarScan: an automated dermoscopy image analysis
works well; however, it created a significant instrument for the diagnosis of primary melanoma.
Arch Dermatol 2005; 141: 1388–1396.
number of additional false positive that would 5. Cha J, Cofer RH, Kozaitis SP. Extended Hough trans-
need to be filtered out. form for linear feature detection. Patt Recognit 2006; 39:
These extensions will be needed to extend our 1034–1043.
6. Quackenbush LJ. A review of techniques for extracting
framework to other applications, such as tracing linear features from imagery. Photogr Eng Remote Sen-
biological polymers in highly cluttered environ- sing 2004; 70: 1383–1392.
ments, neurites in noisy cell images, or wrinkles. 7. Press WH, Vetterling WT, Teukolski SA, Flannery BP.
Numerical recipes in C11: the art of scientific comput-
ing, Press CU, editor, 2001.
Acknowledgement
Address:
We are grateful to Changming Sun for internally Pascal Vallotton
reviewing this manuscript. Biotech Imaging
CSIRO Mathematical and Information Sciences
Locked Bag 17
North Ryde, NSW 1670
References Australia

1. Leavitt M, Perez-Meza D, Rao NA, Barusco M, Kaufman Tel: 161 2 9325 3208
KD, Ziering C. Effects of finasteride (1 mg) on hair Fax: 161 2 9325 3200
transplant. Dermatol Surg 2005; 31: 1268–1276. e-mail: pascal.vallotton@csiro.au

497
View publication stats

También podría gustarte