You are on page 1of 4

JANUARY 2005 9

Color and Pattern Analysis of Printed Fabric by an Unsupervised


Clustering Method
CHUNG-FENG JEFFREY KUO, CHUNG-YANG SHIH, CHIH-YUAN KAO, AND JIUNN-YIH LEE
Intelligence Control and Simulation Laboratory, Department of Polymer Engineering, National Taiwan
University of Science and Technology, Taipei, Taiwan, Republic of China

ABSTRACT
In this paper, a novel approach to color and pattern analysis is proposed for printed
fabric. An unsupervised analysis method is developed using a fuzzy C-means (FCM)
clustering algorithm and a specific cluster-validity criterion (SC criterion). First, the printed
fabric is captured by a color scanner and converted into full color digital files, then the
mean filter is used to smooth the color of the image. The search for good cluster numbers
is made by the SC criterion, and the corresponding color clusters are obtained based on the
FCM clustering algorithm. Finally, the color and pattern features of the printed fabric are
calculated. The experimental results show that this approach is very suitable for analyzing
the colors and patterns of printed fabrics.

Although digital image analysis techniques for fabrics be analyzed automatically for color numbers, color val-
have progressed, the focus has been mainly on analyzing ues, and area percentages of certain colors. And for the
gray-scale fabric images. However, since the visual per- patterns formed by each color, we can analyze the sta-
ception of color images is much more important than that tistical value of numbers, areas, centers and other related
of gray-scale images, it is highly desirable to develop an pattern characteristics.
automatic recognition system of multicolor weaves using
color image analysis techniques [1, 3].
Color and pattern are two key issues of textile appear- Research Methods
ance. They not only determine the value of the fabric, but
they also act as a necessary discriminative guide for FUZZY C-MEANS CLUSTERING METHOD
different fabrics, especially printed ones. Unlike woven
fabrics, the color patterns of printed fabrics can only be The clustering method attempts to assess the relation-
described by the color numbers, color values, and pat- ships between patterns of a data set by organizing the
terns. In addition, the patterns of printed fabrics vary, patterns into clusters. We use FCM clustering [2] to op-
causing difficulties when describing these patterns with timize the following objective function:
words or even simpler ways. This variety of printed

冘 冘u
c n
patterns also causes difficulties with automation, and it
means that all analysis, recognition, and comparison J⫽ ij
m
d ij2 (1)
i⫽1 j⫽1
needs to be done manually. Moreover, due to the influ-
ence of the undulating weave on the fabric’s appearance,
the colors displayed are more complex than other ordi- where c is the number of clusters, uij ⑀ [0,1] expresses the
nary flat materials, leading to complications with color membership degree of the data point xj belonging to the
recognition. In addition, the technique of color image ith fuzzy group, dij ⫽ 储Wi ⫺ Xj储 is the Euclidean distance
processing is still at a premature stage. Therefore, studies between the ith cluster center wi and the jth data point xj
of automatic analysis systems for colored fabrics have hit and m ⑀ (1, ⬁) is a weighting exponent that influences the
a roadblock. fuzziness of the clusters [5].
In this paper, we propose an unsupervised clustering This FCM algorithm is implemented as follows:
method to analyze colors and patterns on printed fabrics. 1. Choose the number of clusters c, the weighting
Without using samples or a priori information about data exponent to influence the fuzziness of the clusters,
structures, the clustering algorithms attempt to partition and the terminative precision ␧.
the data set into clusters, such that data within a cluster 2. Initialize the fuzzy C-partition and set the iteration
are more similar to each other than to those belonging to counter to t ⫽ 1.
different clusters. The colors on printed fabrics can thus 3. Update the centers matrix

Textile Res. J. 75(1), 9 –12 (2005) 0040-5175/$15.00


Downloaded from trj.sagepub.com at NORTHERN ARIZONA UNIVERSITY on May 24, 2015
10 TEXTILE RESEARCH JOURNAL

k ⫽ r ⫹ i, and

n

共u ij *兲 mx j
冘冉 1max
ⱕ i ⱕ c冊
n 2
j⫽1 u i ij
wi ⫽

冘共u *兲
n
j⫽1
m FC ⫽ .


ij
n
j⫽1 maxi uij
1ⱕiⱕc
for 1 ⱕ i ⱕ c, and the memberships degree matrix j⫽1

(U),
The maximum SC for a given number of clusters c is

冋 册
⫺1 expected to detect a well-defined fuzzy c-partition.
冘储储 xx ⫺⫺ ww 储储
c 2/共m⫺1兲
j i
u ij ⫽ 2/共m⫺1兲 .
k⫽1 j k Experimental Analysis
4. If 兩U(t ⫹ 1) ⫺ U(t)兩 ⬍⫽ ␧ stop, otherwise t ⫽ t ⫹ 1, The experimental material is a four-color printed fab-
therefore go to step 3. ric, 7 in. ⫻ 7 in., and the Matlab [4] is the software tool
used to develop this system. An Epson 2400 Photo
CLUSTER-VALIDITY ANALYSIS scanner with a resolution of 96 dpi digitizes the printed
fabric image into a full-color model. In the color space,
The aim of the classification is to generate a well- we can refer to a single pixel’s red, green, and blue
defined C-partition that is as close as possible to the values as a color pixel vector ⫺ (R, G, B). The captured
natural structure of the data. The specific cluster-validity image consists of 672 ⫻ 672 pixels. In order to reduce
criterion (SC) is used to measure the quality of the fuzzy the color differentiation caused by the undulating weave
C-partitions provided by the fuzzy clustering algorithm. structure on the fabric’s appearance, the mean filters are
This cluster-validity is based on two functions. The first used to process the scanned full-color image.
function calculates the ratio by considering geometric
and fuzzy membership properties. The second function UNSUPERVISED CLUSTERING STRATEGY
evaluates it by using only the properties of fuzzy mem-
berships. In this paper, we adopt the SC cluster-validity The search for good clustering takes the following
index introduced by Zahid et al. [6]: iteration steps:
1. Initial setting: c ⫽ 2, cmax ⫽ 10.
S FS 2. Use the FCM algorithm (m ⫽ 2, ␧ ⫽ 0.00001) to
SC ⫽ ⫺ , (2)
␲ FC compute the cluster centers matrix, memberships
degree matrix, and SC.
where
3. Let c ⫽ c ⫹ 1; if c ⱕ cmax then go to step 2.

冘储w ⫺ w៮ 储
c According to the definition above, the maximum SC
i value is used to examine which cluster number set is
i⫽1 better; that is, how many color clusters should the colors
S⫽ ,
c be divided into. We also record the fuzzy clustering
centers matrix and the memberships degree matrix of the
w៮ is the mean of the whole data set, best cluster number to produce a pixel clustering distri-
bution diagram for follow-up color and pattern analysis.
冘共u 兲 储 x ⫺ w 储
n
m 2 The pixel clustering distribution diagram is created by
ij j i


c
i⫽1
drawing pixels of each cluster on a new picture.
␲⫽ ,

冘u
n
i⫽1 COLOR AND PATTERN ANALYSIS
ij
j⫽1 For color characteristic analysis, the color value is
obtained from the cluster center of the best cluster num-

冘min共u , u 兲
n
bers. Sum the area of each cluster’s pixel for the area
2
ij kj percentage of the color. For pattern analysis, first obtain
冘冘
c⫺1 c⫺i
j⫽1
FS ⫽ , the pattern of the printed fabric by drawing pixels of each

冘min共u , u 兲
i⫽1 r⫽1
n cluster on a new picture. Then, use the morphology
ij kj operation of erosion and dilation to remove lines or
j⫽1 spots, which are classified as incorrect, on the pattern

Downloaded from trj.sagepub.com at NORTHERN ARIZONA UNIVERSITY on May 24, 2015


JANUARY 2005 11

edges caused by the processing of mean filters. Next, TABLE I. Some SC indices for different cluster numbers.
calculate the numbers and the center point locations of Cluster number
individual patterns formed by each cluster. However, in
order to avoid the influence of incomplete individual 2 4 6 8 10
patterns on the image fringes upon the analysis, eliminate Four-color printed fabric 0.40 9.57 6.12 3.49 3.12
these individual patterns before figuring out their pattern
characteristic values. Finally, calculate these character-
istic values of the individual patterns, including Area (the
actual number of pixels in the single pattern), Extent (the
Area divided by the area of the bounding box), Orienta-
tion (the angle between the x-axis and the major axis of
the ellipse that has the same second-moments as the
single pattern), and Eccentricity (the ratio of the distance
between the foci of the ellipse and its major axis length).
An ellipse whose Eccentricity is 0 is actually a circle,
while an ellipse whose Eccentricity is 1 is a line segment.

Results and Discussion


Figure 1 shows the color digital image of the four-
color printed fabric with 672 ⫻ 672 pixels captured by a
color scanner. By way of statistics, the RGB values of
29,272 pixels in the images are different. After the mean
filters process, the color numbers are reduced to 15,372.
Then, take these colors to form color value matrices and
process the FCM clustering of the color value. From Table
I, the color number of the four-color printed fabric is 4; FIGURE 2. Clustering results for different cluster numbers.
this is because, among the cluster number sets 2 to 10,
the cluster number equal to 4 has the highest SC index
value. In addition, mark the location of each cluster of Figure 3 shows the segmentation of the patterns that
pixels on Figure 2 to form the pattern that consists of are formed by the pixels of cluster 1, which already
color clusters. Compared to Figure 1, the clustering re- removes the incomplete individual patterns on the image
sult conforms to the color pattern of the fabric. fringes. Also, mark the central point of each individual

FIGURE 1. Full-color digital image of printed fabric. FIGURE 3. Segmentation of cluster 1.

Downloaded from trj.sagepub.com at NORTHERN ARIZONA UNIVERSITY on May 24, 2015


12 TEXTILE RESEARCH JOURNAL

pattern shown as the ⫹ symbol on the figure and the clustering algorithm and the SC clusters-validity index, is
location of the box that surrounds this pattern. Finally, very effective for analyzing the color characteristics and
mark the related color characteristic values and pattern pattern characteristics of printed fabrics automatically.
characteristic values on Table II. From the mean and We have proved that this method can overcome the
standard deviation of the Area, Extent, Orientation, and difficulties of manual recognition and word descriptions
Eccentricity values, the patterns of these four clusters of color pattern characteristics of a printed fabric. In addi-
consist of rectangles of similar sizes. tion, since we use personal computers and color scanners
for automatic analysis and recognition of color printed
TABLE II. Color and pattern characteristics of printed fabric
fabrics, this study is very practical and economical.

Features Itemsa Cluster 1 Cluster 2 Cluster 3 Cluster 4


Literature Cited
R 118 25 168 235
G 124 25 169 230 1. Bernard, P., Vanderhaeghen, K., and Kiekens, P., Color
Color Measurement of Pile Fabrics, Textile Res. J. 69(8), 552–
B 145 36 169 220
Area, % 35.20 15.53 25.29 23.98 558 (1999).
Number of pattern 78 28 50 54 2. Bezdek, J. C., “Pattern Recognition with Fuzzy Objective
Area, m* 1457 1620 1547 1574
Area, s* 185 184 285 215 Function Algorithm,” Plenum Press, NY, 1981.
Extent, m* 0.97 0.96 0.96 0.97 3. Dupont, D., Steen, D., and Caze, C., Modeling Color
Pattern Extent, s* 0.02 0.02 0.02 0.02 Alteration After the Spinning Process, Textile Res. J. 71(9),
Orientation, m* ⫺19.93 ⫺29.27 ⫺27.97 ⫺37.07 755–761 (2001).
Orientation, s* 71.45 72.01 69.29 61.16
4. Fausett, L. V., “Applied Numerical Analysis Using
Eccentricity, m* 0.44 0.46 0.41 0.40
Eccentricity, s* 0.16 0.14 0.17 0.16 MATLAB,” Prentice Hall, NJ, 1999.
5. Wong, C. C., Chen, C. C., and Su, M. C., A Novel
a
m* mean value, s* standard deviation. Algorithm for Data Clustering, Pattern Recog. 34, 425–
442 (2001).
6. Zahid, N., Abouelala, O., Limouri, M., and Essaid, A.,
Conclusions Unsupervised Fuzzy Clustering, Pattern Recog. Lett. 20,
From our results, the unsupervised printed fabric color 123–129 (1999).
pattern analysis method, established by the FCM fuzzy Manuscript received June 9, 2003; accepted December 3, 2003.

Downloaded from trj.sagepub.com at NORTHERN ARIZONA UNIVERSITY on May 24, 2015

You might also like