Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

May 12, 2010 15:42 RPS : Trim Size: 8.50in x 11.

00in (IEEE) icfcc2010-lineup˙vol-2: F384

The application of improved HSV color space model in image processing

Li Shuhua Guo Gaizhi


College of Electronic and Information Engineering College of Computer and Information Technology
Inner Mongolia university Inner Mongolia Normal University
Hohhot, China Hohhot, China
lsh8120@imu.edu.cn ciecggz@imnu.edu.cn

Abstract—General HSV color space is another expression of


RGB color space. As it expresses the perception color contacts
clearer than RGB, and the calculation is very simple, it is ⎧
adopted widely in the image processing. But because of the ⎪00 if max = min
mathematical definition limitation , it may be inaccuracy to the ⎪ (1.1)
color classification in some conditions and influences the ⎪600 × g − b 0
+0 , if max = r and g ≥ b
stability of the algorithm. In this paper, some modification is ⎪ max − min

proposed to the HSV mathematical definition, the instability is ⎪ 0 g−b
eliminated from formula, object tracking algorithm such as h = ⎨60 × + 3600 , if max = r and g 〈 b
⎪ max − min
MEANSHIFT is tested for this improvement. In the real
⎪ 0 b−r
projects, the improved model should be widely used.
⎪60 × max − min + 1200 , if max = g
Keywordst; color space, color space transformation, moving ⎪
object detection, MEANSHIFT ⎪ 0 r−g
⎪⎩60 × max − min + 2400 , if max = b
I. INTRODUCTION
⎧0, if max = 0
⎪ (1.2)
Color is an important vision property of image. And it s = ⎨ max − min min
is one of the perceptual features for the human to recognize ⎪ max = 1− , otherwise
⎩ max
an image. In the moving object detection, the color is more
v = max (1.3)
stable than the others features, such as local feature points. It
is not sensitive to rotate, shift and scale. And the calculation H regularly is normalized between 0 and 360 , s and v
is simple compared to the calculation of other invariant between 0 and 1.
features, such as SIFT, SURF. So the color space model is Carefully analyze the definition above, if the main color
adopted widely in the image processing, such as CBIR, is red (max = r), h will be between (0, 60) and (300, 360).
object tracking. But as it’s initial mathematical definition While other two main colors max = g max = b varied
no more consideration about reliability requirements of between the range of 60 to 120 ,and 180 to 300, which peak
pattern recognition and machine learning that within–class is 120 and 240 respectively.
distribution should be close and between-class distribution So it can be assumed that if the other two colors are not
should be scattered, which inevitably leads to some non- the main color (that is, color shift influenced by ambient),
robust factors. which the normalized difference obey Gaussian distribution.
In the (0, 360) , we expend the distribution of h in color band
II. TRADITIONAL HSV COLOR MODEL[1] as followed Figure 1
HSV color model is a kind of method to define color
according to the three basic features of the color: hue,
saturation and luminance.
Hue(H) is the basic feature of color, and is just the color
name, such as: red, yellow. According to the position in the
standard color wheel, it ranges from 0 to 360.
Saturation(S) is the color purity. Higher the value is,
purer the color is . And it ranges between 0 and 100%.
Luminance (V) is also named brightness, it ranges from
0 to 100%.
This model is promoted by Alvy Ray Smith in 1978. It
is a nonlinear transformation of RGB model. The Figure 1. color band expended
mathematical definition is as followed formula 1.1 1.2 1.3:

c
978-1-4244-5824-0/$26.00 2010 IEEE V2-10
May 12, 2010 15:42 RPS : Trim Size: 8.50in x 11.00in (IEEE) icfcc2010-lineup˙vol-2: F384

⎧0o , if max = min || h < 0



⎪600 × g − b + 600 , if max = r
⎪ max − min
It is obvious that if some color is the main color, the H ⎪
mean can be used to express the basic feature. If the main ⎪ 0 b−r
h = ⎨60 × + 1200 , if max = g (3.1)
color is g or b, there is no any problem to use the H mean. ⎪ max − min
The mean changes around the peak of the Gaussian ⎪ 0 r−g 0
distribution. But if the main color is r, it can not be used. ⎪60 × max − min + 240 , if max = b
This can cause the instability of the algorithm in the real ⎪
⎪⎩360o , if h > 360
image processing project, such as: color-based image
retrieval, color-based clustering, color-based segmentation
which caused insurmountable error in theory for improving ⎧0, if max = 0
the accuracy and robust of the system.. ⎪
s = ⎨ max − min min (3.2)
while more than 50 percent of pixels in detection area ⎪ max = 1− , otherwise
⎩ max
the color g>b then the mean value is near at 0 60
while more than 50 percent g<b, the mean value is near at
v = max (3.3)
300 360 . While pixels’ distribution of the two extremes
is balanced , the average will occur in 180!, Obviously, this
is not consistent with our intuitive understanding, when the h = 0/360, boundary condition set for abnormal occurs.
main color is not changed (for red), its H mean do not
represent their identity, because the reasons for the results of In this formula, s,v are unchanged.
the formula defined unstable! Some scholars have already
made improvements in [2], a solution to this problem is to In this defintion, each peak of r/g/b color is single
establish H2SV space model of the h coordinates from radial modal distribution, at the boundary of degree 0 and 360, the
coordinates to Cartesian coordinates, which thereby color is belonged to red and blue color septurately. The main
eliminating the space in polar coordinates in the bimodal color of each peack will not shifted dramaticlly by ambient.
distribution. and in practical applications achieved good
results. Although such an approach achieve the desired
result, but did not eliminate the problem from the principle. IV. EXPERIMENT RESULT AND CONCLUSION
In order to validate the model, the test is taken to a
III. SHSV (SHIFT-HSV) COLOR SPACE group of video frames with the instability feature based on
In data mining or pattern recognition, it is not cared the color histogram’s meanshift algorithm[3].
whether it fits the human’s vision feature that RGB is The tested video frames is the public CAVIAR data
transformed to another space. The most importance is set[4] “ThreePastShop2cor.mpg “ sequences.
whether within-class distribution of the data in the new space Figure3-5 is the color histogram and the relative back
is quite close and between-class distribution is very projection of the ROI scale with the original color HSV
scattered. So if we shift band 60 degrees, then the formula. Ideally, ROI scale should be the one with the
distribution is turned as followed Figure 2 and H formula is highest projection value. But from the figure, except for the
3.1, 3.2, 3.2: selected scale, the other scale’s projection value is high too
(highlight scale). The histogram with two peak can not
express the selected scale clearly, the background with the
similar is highlighted.
Figure4-5 is the color histogram and the relative back
projection of the ROI scale based on SHSV formula. It can
be concluded that the projection effect has been improved
greatly. Except for the ROI scale, the other one expresses the
normal color spread, that is only several scale is highlighted.
In the video, the tracked person changes the position
with another, the meanshift algorithm fails. After they make
a change, the manual selected action is taken.

Figure 2. color band shifted

[Volume 2] 2010 2nd International Conference on Future Computer and Communication V2-11
May 12, 2010 15:42 RPS : Trim Size: 8.50in x 11.00in (IEEE) icfcc2010-lineup˙vol-2: F384

Figure 3. back projection Figure 4. H Histogram(bimodal distribution Figure 5. frame 387

Figure 6. back projection Figure 7. H Histogram (unimodal distribution) Figure 8. frame 387

From the meanshift experiment, it can be concluded


Figure 9 The trace is started in Frame 523. And in that the SHSV is more effective compared with the original
Frame 722, the trace is lost, and is dragged to the up-right HSV. It expresses the object’s color feature robustly. As the
scale with the similar color..Figure 10 The trace is started in principle is obvious, large number of testes are not taken to
Frame 523, And in the Frame 751, the trace is lost, and is the other algorithm such as color-based segmentation
dragged to the up scale with the similar color..Figure 9 is color-based aggregation. From the test in menshift, it can be
based on original HSV. And Figure 10 is based on SHSV. predicted that SHVS should be more robust than original
From above, it can be concluded that the SHSV is more HSV in the other color-based algorithm.
effective.

V2-12 2010 2nd International Conference on Future Computer and Communication [Volume 2]
May 12, 2010 15:42 RPS : Trim Size: 8.50in x 11.00in (IEEE) icfcc2010-lineup˙vol-2: F384

Figure 9 tracking started from frame 523 at Frame 722 tracking failed dragged to right-up area of same color

Figure 10 tracking started from frame 523 at Frame 751 tracking failed dragged to up area of same color

REFERENCES

[1] Raphael Gonzalez, Richard E. Woods “Digital Image Processing”, [3] Comaniciu D, Ramesh V, and Meer P. ,”Kernel-based
2nd ed. Prentice Hall Press, ISBN 0-201-18075-8, p. 295. 2002 objecttracking”. IEEE Trans. on Pattern Analysis and Intelligence,
[2] T N Mundhenk, J Everist, C Landauer, L Itti, K Bellman, 25(5): 564-577,2003
”Distributed biologically-based real-time tracking in the absence of [4] Fisher R, et al. CAVIAR test case scenarios. 2003.
prior target information”, Proc. SPIE International Conference on http://homepages.inf.ed.ac.uk/rbf/CAVIAR
Intelligent Robots and Computer Vision XXIII: Algorithms,
Techniques, and Active Vision, (D P Casasent, E L Hall, J Roning
Ed.), 6006:142-153., (2005)

[Volume 2] 2010 2nd International Conference on Future Computer and Communication V2-13

You might also like