KNOWLEDGE REPRESENTATION AND REASONING FOR
AIR-NAILER COLOR CONFIGURATION
BASED ON HSV SPACE
Fan Jing, Shen Ying and Wang Zhihao
Software College, Zhejiang University of Technology, Hangzhou, P. R. China
Keywords: Color Configuration, Color Representation, Color Reasoning, CAD.
Abstract: Computer aided color design is one of the hotspots in industrial design area. Based on current color
configuration research, this paper focuses on knowledge representation and reasoning of color design for
air-nailer color configuration system. Firstly, color representation including color type and color value is
discussed. Secondly, color reasoning based on HSV space among main color, first assistant color and
second assistant color is investigated. At last, the application is represented, which has been tested
efficiency and accurate in air-nailer color design.
1 INTRODUCTION
Computer aided color design (CACD) is a kind of
computer aided technology. As we all know, a
product with better color configuration will win at
similar performance and price. Computer aided color
configuration system comes to help people doing
better job. Commonly, the color design software has
powerful functions of color presentation such as
quick painting,
color mixing and digital specification
of color. Theories of color configuration provide
guide to the implementation of color configuration
application systems (Faber, 2006). Since the feeling
of color, evaluation of color assortment, and the
color schemes are complex tasks related to many
fields, there are still some unsolved problems in
existed systems, such as how to supply multiple
choices for color assortment; how to apply domain
knowledge in specific color design; and how to
evaluate color design under individual preference
difference.
Besides its key position in design process, color
design has its own art characteristics such as
uncertainty and divergence (Xiangyang, 2004). It is
hard for designer to fit all constraints. The research
of knowledge representation and reasoning of color
configuration focuses on providing methods to solve
the problems.
In this paper, we introduce the knowledge
representation and reasoning of color configuration
used in a computer aided air-nailer color
configuration system. Color representation for
specific air-nailer product is the first thing to deal
with. Then we define three types of color area in air-
nailer appearance: main color area, first assistant
color area and second assistant color area.
By
investigating their relationship, we set up reasoning
strategy (Yunhe, Shouqian and Enwei, 1999). At last,
we explain our cases briefly and present the interface
of the system.
2 COLOR REPRESENTATION
2.1 Color Type Representation
Color type can be denoted as a quadruple called
ColorType. ColorType =(PA, SA, MT, CC). Here
PA is private attribute, SA is shared attribute, MT is
a set of method and CC is collision condition.
PA = (HArea, SArea, VArea) (1)
SA= (CType, Cdescription, Csysmbol,
Cusage, Charmony)
(2)
MT=(HSVtoRGB (), RGBtoHSV ()) (3)
CC=(CCType, CHSVArea, CCReason) (4)
CHSVArea = (CHArea, CSArea, CVArea) (5)
HArea, SArea, VArea correspond to H, S, V
fields for color type in HSV space, where H means
Hue, S means Saturation and V means Value. Each
pair of HArea fields is supposed not to be intersected.
356
Jing F., Ying S. and Zhihao W. (2009).
KNOWLEDGE REPRESENTATION AND REASONING FOR AIR-NAILER COLOR CONFIGURATION BASED ON HSV SPACE.
In Proceedings of the 11th International Conference on Enterprise Information Systems - Artificial Intelligence and Decision Support Systems, pages
356-359
DOI: 10.5220/0002001403560359
Copyright
c
SciTePress
CType is the name of color tone. Cdescription,
Csysmbol, Cusage and Charmony denote
respectively the description, symbolic meaning,
applicable situation and matching degree.
Two kinds of algorithms are listed in MT. They
supply the conversion between HSV space and RGB
space of color (Berlin and Kay, 1969).
CCType is the name of color tone which
conflicts with current color. CHSVArea
= (CHArea,
CSArea, CVArea)
is the conflicted color area. CHArea,
CSArea, CVArea correspond to H, S, V fields in
CHSVArea. CCReason is the reason of confliction.
A color type may have multiple conflicted types.
2.2 Color Value Representation
Color value in each region of different
configurations belongs to a color type. In our scheme,
class ColorDetail inherits all non-private attributes
from ColorType. Here ColorDetail is denoted as a
five-tuple with Identifier ID and listed in (6), while
Identifier ID is listed in (7). Although same color
value can be used in whole design process repeatedly,
the function and usage method of the color usually
are different in the different stage, and ID is
necessary to distinguish the different use. ID is only
a part of ColorDetail and not of ColorType. And Pid
means configuration procedure of that the color is
used, Lid denotes region the color is in.
ColorDetail=(ID, PA, SA, MT, CC)) (6)
ID = (Pid, Lid) (7)
PA=(HValue, SValue, VValue, RValue,
GValue, BValue, RGBValue, CName)
(8)
PA is a private attribute. HValue, SValue and
VValue are the values of H, S, and V fields in the
HSV color space. Method HSVToRGB () in MT
can translate HSV space into RGB space and return
RValue, GValue and BValue. RBGValue can be
gotten by other relative method. CName is the name
of typical colors. It can be NULL.
SA includes shared attributes of ColorType. If a
color has special attributes, SA of sub class
ColorDetail will cover SA from super class
ColorType. MT here is similar in ColorType, but
MT of ColorDetail can’t cover the MT of super class.
Collision condition CC inherits from ColorType.
3 REASONING PROCESS IN
COLOR CONFIGURATION
In our air-nailer samples, there are 2% monochrome,
45% dual-color and 53% triple-color. Obviously,
ID
Pid
Lid
PA
BValue
HValue
SValue
RValue
VValue
RGBValue
GValue
CName
SA
CType
Cdescription
Charmony
Csysmbol
Cusa
g
e
MT
HSVtoRGB
()
RGBtoHSV
()
CC
CSArea
CHArea
CVArea
CHSVAre
CCT
yp
e
CCReason
ColorDetail
Figure 1: Tree structure of ColorDetail.
simple style is very popular in air-nailer color design.
Accordingly, decision of main color, first assistant
color and second assistant color are the three stages
in our configuration process.
3.1 Main Color Decision
The process of air-nailer main color decision is
presented in Figure 2.
Figure 2: Main color decision process
There may be two different cases as follows:
1. User chooses color value, system will reason
and analyze whether the color value is suitable. It
can be seen as reasoning from color value to color
attribute. For example, if user offers a red color with
the RGB value 0x80000h, our air-nailer color design
KNOWLEDGE REPRESENTATION AND REASONING FOR AIR-NAILER COLOR CONFIGURATION BASED ON
HSV SPACE
357
system is expected to deduce its implicit information
such as applicable situation, meaning and color type.
2. User knows color attribute and applicable
situation, while system recommends suitable color.
It can be regarded as reasoning from color attribute
to value.
3.1.1 Reasoning from Value to Attribute
During main color decision procedure, if user
chooses the color Main_part_color in RGB form
with color palette, as Main_part_color belongs to
class ColorDetail, it can turn to HValue
1
, SValue
1
,
VValue
1
, RValue
1
, GValue
1
, BValue
1
, and
RGBValue
1
in PA using method HSVToRGB () in
ColorDetail. Pid
1
, Lid
1
in ID can also be computed
during color configuration when Pid
1
=1 denotes
main color, and Lid
1
means the id of area to be
determined.
Once we set main color, some analysis has to be
done. From HValue
1
, SValue
1
, VValue
1
in
Main_part_color, ColorType
1
can be deduced to get
responding Cdescription
1
, Csymbol
1
, Cusage
1
and
Charmony
1
. All four attributes make references for
designers.
3.1.2 Reasoning from Attribute to Value
In this reasoning, user determines the condition set R
according to needs of color description, symbolic
meaning, applicable situation and matching degree.
The condition set R includes condition identifier set
RequestId and condition information set
UserRequest. We named color type set as ct
l
, color
value set as cd
l
. ColorType(x) denotes that x is color
type, Include(A, b) denotes that b belongs set A
Have(a, b)denotes that a has attribute b.
The reasoning rule is as follows:
x ( ColorType(x) Have (x, R) )
y( Include(x, y) Have(x, R) )
(9)
If one kind of color has specific attribute, then all
the color value belong to this kind should have this
attribute.
Then we can deduce color value from its
attribute as follows.
System will try to match table ct
1
in air-nailer
color configuration standard database with user
requirement R. Then the matched set of color type is
called CType.
Based on CType, system will search color table
cd
1
. Since color value CD inherits shared attribute
SA in color type, then we can get expected result as
set P.
3.2 First Assistant Color Configuration
First assistant color can be deduced just like main
color. According color harmony theory, we set color
configuration rule to deduce which color is suitable
as assistant color. We need to decide hue, lightness,
purity for the assistant one.
Harmony parameter set including six conditions
is named as HSpace. Similarly, there are ten
conditions are chosen for purity and lightness called
SSpace and VSpace separately.
HSpace= {α
1
, … , α
6
}(α<=180) (10)
SSpace = {β
1
, … , β
10
}
(β<=max (SValue
1
, 100-SValue
1
)
(11)
VSpace= {δ
1
, … , δ
10
}
(δ<= max (VValue
1
, 100-VValue
1
)
(12)
Assistant color value can be reasoned if user set
condition α
i
, β
m
, and δ
n
(i[1,6], m[1,10], n[1,10],
i, m, nN). The equation is listed as follows:
HValue
2
={HValue
1
+α
i
, HValue
1
-α
i
} (13)
SValue
2
={SValue
1
+β
m
, SValue
1
-β
m
} (14)
VValue
2
={ VValue
1
+δ
n
, VValue
1
-δ
n
} (15)
Sometimes, the value of Hvalue
2
will beyond range
of [0,360]. If it is greater than 360, it can be revised
as θ=θ-360. Otherwise, if it is less than 0, it can be
revised as θ=θ+360. If the value of SValue
2
or
VValue
2
is not valid ([0,100]), then set flag as “1” to
denote that it is invalid. Since HValue
2
must have
two items, SValue
2
and VValue
2
may have one or
two items, Cartesian product of all three sets of hue,
purity and lightness (HValue
2
* SValue
2
*VValue
2
)
can get 2 to 8 items. Thus we get set
First_assist_color_Union by method HSVToRGB ()
in method set MT of ColorDetail.
First_assist_color_Union = {S_Color
1
, …,
S_Color
i
}
2<= i <=8, i n
(16)
The last step for assistant color configuration is
conflict detection. Since main color type called
ColorType
1
has been defined at previous stage, so as
conflict condition CC inherits from ColorType
1
.
Each item called S_Color
i
in Fisrt_assist_color set
can be converted from RGB space to HSV space at
first. Next, if parameter hue Hue
i
, purity Saturation
i
and lightness Value
i
in S_Color
i
locate in CC’s
CHSVArea and Hue
i
CHArea, Saturation
i
CSArea, Value
i
CVArea, then we conclude that
S_Color
i
conflicts with Main_part_color. The color
value will be marked at this point to warn the user.
ICEIS 2009 - International Conference on Enterprise Information Systems
358
3.3 Second Assistant Color
Configuration
Second assistant color can be deduced after main and
first assistant color being set. It means that input
Main_part_color, First_assist_color and conditions,
and then output Second_assist_color. It is similar to
first assistant color configuration, but in detail the
settings of hue, purity and lightness are different.
4 APPLICATION
We complete a system with intelligent reasoning and
multivariate comprehensive evaluation for air-nailer
color configuration. Main functions of the system are
listed. Figure 3 shows typical modules (in Chinese).
Figure 3: Main color configuration and Preview.
1. Color Configuration. It provides some assistant
design information during color configuration,
mainly including: color analysis, condition color
configuration, conflict detection, etc.
2. Color Configuration modification. It provides
parameters to adjust color configuration.
3. Color Evaluation. It evaluates the practical
appraisal on a completed color configuration, and
gets a comprehensive evaluation about the
current scheme.
4. Color Configuration Preview. It applies the
completed color configuration to air-nailer
pictures, and gives the preview.
5. Color Scheme Saving. It collects and saves
these successful color configuration schemes.
6. Information Management. It provides the
functions of input, update and deletes color
knowledge, configuration rules, configuration
instances, etc.
5 CONCLUSIONS
Color basic theory and color harmony theory are
combined well using in the method of knowledge
representation for air-nailer color configuration. In
this paper, we describe a color knowledge model
briefly, it can be applied in the field of air-nailer
color design, and it also implements bidirectional
reasoning between color value and color attribute.
This model partially solves the problem about
reasoning difficulty caused by color diversity. In this
model both precise-matching and fuzzy-matching
have come true, and good analysis results can be
gotten when system judges color collision.
From the research, it can be seen that color
knowledge model will provide an effective assistant
to the designer, and improve efficiency and quality
of a design scheme.
ACKNOWLEDGEMENTS
This paper is supported by the project of Science and
Technology Planning of Zhejiang Province (No.
2005C11038, 2007C21011), and of Department of
Education of Zhejiang Province (No. 20070273).
REFERENCES
Berlin, B., Kay, P., 1969. Basic Color Terms: Their
Universality and Evolution. University of California
Press, Berkeley.
Burchett, K., 2002. Color harmony. In Color Research and
Application.
Faber B., 2006. Color Psychology and Color Therapy: A
Factual Study of the Influence of Color on Human Life.
Kessinger Publishing.
Munsellm, A., 1969. A Grammar of Color. New York Press.
Xiangyang, Z., 2004. Research of Color Design Method in
Information Device Modular Customization. South-
west University of Technology. (in Chinese)
Yunhe, P., Shouqian, S., Enwei, B., 1999. Development
and trend in computer aided industry design. In
Computer Aided Design and Graph Journal. CADG
Press. (in Chinese)
KNOWLEDGE REPRESENTATION AND REASONING FOR AIR-NAILER COLOR CONFIGURATION BASED ON
HSV SPACE
359