Sunteți pe pagina 1din 5

A QUATERNION GRADIENT OPERATOR FOR COLOR IMAGE EDGE DETECTION

Lianghai Jin, Enmin Song, Lei Li, and Xiang Li

School of Computer Science and Technology,


Huazhong University of Science and Technology, China

ABSTRACT The second kind of color gradient methods is based on


grayscale image gradient operators. The methods of this
Estimating gradients of color images is important to many type first use grayscale image gradient estimators to
color image processing tasks. However, the research on compute the gradient vectors for each color component and
color image gradients is limited. In this paper, a novel then combine them to get the final gradient vectors.
method of estimating color image gradients is presented. Obviously, the methods of such type do not consider the
The proposed gradient mechanism is based on measuring correlation between color channels.
the squared local contrast variation of a color image The third type of color gradient estimators is based on
function, in which the chromatic variation is evaluated by finding the maximum changes of image vectors. Di Zenzo
quaternion representation. As an application in color image [5] proposed a classical multichannel gradient operator,
processing, we apply the proposed gradient operator to the which is based on measuring the squared local contrast
traditional grayscale image Canny operator for color edge variations of multichannel images. However, there exists
detection. The edge detection results indicate that the indetermination in Di Zenzo’s gradient direction, which has
proposed color gradient operator is superior to other state- been not well solved until our recent work gives a clear
of-the-art color image gradient methods.  solution [6]. Scharcanski and Venetsanopoulos developed a
local vector statistics based gradient method for color edge
Index Terms— Gradient, quaternion, color image, edge detection [7], in which they used the differences between
detection the average color vectors of the samples inside the sub-
windows in horizontal and vertical directions to estimate the
1. INTRODUCTION maximum variation of a color image in each pixel position.
Recently, Nezhadarya and Ward proposed a new color
Gradient plays important role in image processing and image gradient operator [8]. This method first applies
computer vision. The gradient associated with a pixel is highpass and lowpass vector operators in an appropriate
usually defined as a 2-D column vector and can be manner in both horizontal and vertical directions and then
expressed by a complex number, in which the vector angle performs an aggregation operator in each direction to find
indicates the direction of the largest growth of the image the corresponding partial derivatives.
function. In this paper, we propose a new method to compute color
For grayscale images, numerous gradient estimators have image gradients, in which quaternion rotation mechanism is
been developed. However, for color images, which are used to measure the color contrast variations. As an
usually described as 3D vector fields, this issue has not application in image processing, we apply the new gradient
obtained the same sufficient attention [1,2]. In general, color operator to color image edge detection.
image gradient methods can be divided into three major
categories. The first type is characterized by a single 2. PROPOSED COLOR GRADIENT OPERATOR
estimate of the orientation and strength of an edge at a point
[3]. The first such method is proposed by Robinson [4], who The proposed gradient operator for color images is based on
computed 24 directional derivatives (8 neighbors per color measuring the squared local contrast variation of a color
channel) and chose the one with the largest magnitude as image function, which is similar to Di Zenzo’s gradient
the gradient. Later, Ruzon and Tomasi [3] utilized a color method. However, unlike Di Zenzo’s method that uses
distribution to represent a neighborhood and implemented Euclidean distance to measure the change rate of an image
edge, junction, and corner detection. function, the proposed gradient is computed according to
brightness change and chromaticity variation measured by
This work was supported by the National Natural Science quaternion rotation mechanism.
Foundation of China under Grant No. 60972098.
E-mail: Lianghaijin@gmail.com (Lianghai Jin).

978-1-4799-2341-0/13/$31.00 ©2013 IEEE 3040 ICIP 2013


2.1. Quaternion Representation of Color Distance It is well known that a color difference should include both
Quaternions, which were discovered by Hamilton in 1843 chromatic difference and luminance variation. However, Eq.
[9], are the generalization of the conventional complex (8) does not include the luminance variation. So, we
numbers. A quaternion consists of one real component and propose the following equation to compute the squared
three orthogonal imaginary components, and is usually color distance of q1 and q2 :
represented in the following algebraic form:
D  q1 , q 2   t Q (q1 , q 2 )  1  t  I (q1 , q 2 ) ,
2 2
(9)
q  abicj d k , (1)
where Q (q1 , q2 ) and I (q1 , q 2 ) denotes the differences of
where a, b, c, and d are real coefficients, and i, j, and k are
complex operators that satisfy the following rules: q1 and q2 in chromaticity and luminance, respectively, and
the weight t  [0,1] gives the importance of chromatic
 i 2  j 2  k 2  ijk   1 difference and luminance variation. I (q1 , q 2 ) can be

 ij  k , jk  i, ki  j . (2) normalized as
 ji   k , kj  i, ik   j
I (q1 , q2 )  k1  r2  r1   k2  g2  g1   k3  b2  b1  , (10)
The modulus and conjugate of quaternion q are defined,
respectively, as follows: where ki (i  1, 2,3) represent the contributions of red,
green, blue channels to image luminance. Typically, we can
q  a 2  b2  c2  d 2 , (3) set k1  k2  k3  1 3 or k1  0.299, k 2  0.587, k3  0.114 [1].
q  a  bi  cj  dk . (4)
2.2. Color Image Gradient Operator
When the real component is equal to zero, quaternion q is
Let a color image f ( x, y) be represented in quaternion form:
named pure quaternion. A quaternion with unit modulus is
called a unit quaternion. f ( x , y )  R ( x , y ) i  G ( x , y ) j  B ( x, y ) k , (11)
Using quaternion representation, a RGB color pixel
x  [r , g , b] T can be represented in quaternion form as a and consider the squared local color change of f ( x, y) at
pure quaternion in which the three imaginary parts represent position ( x, y ) in any direction  :
the red, green, and blue components of this pixel, D  f ( x, y), f ( x   cos , y   sin  ) 
respectively, i.e. 2
 t Q  f ( x, y), f ( x   cos , y   sin  )   . (12)
q  r i g jbk . (5) 1  t  I  f ( x, y), f ( x   cos , y   sin  ) 
2

Assume unit pure quaternion R  (i  j  k) 3 and two  t A1  1  t  A2


color pixels q1  r1 i  g1 j  b1 k and q2  r2 i  g 2 j  b2 k , and Using the first order partial differential approximation,
denote the sum of the expression of q2  Rq1R* as q3 : we can obtain

q3  q2  Rq1R*  r3 i  g3 j  b3 k , (6) A1   2  E1 cos 2   2F1 cos sin  H1 sin 2   , (13)


Then, the magnitude of the following quaternion A 2   2  E 2 cos 2   2F2 cos sin  H 2 sin 2   , (14)

Q (q1, q2 )   r3  (r3  g3  b3 ) 3 i  where

 3  (r3  g3  b3 ) 3 j  .
g (7) E  r 2  g 2  b 2
 1 x x x
 b3  (r3  g3  b3 ) 3 k F1  rx ry  g x g y  bxb y , (15)
H  r 2  g 2  b 2
denotes the chromatic difference of color pixels q1 and q2  1 y y y
[10].  2
 R( x, y) G( x, y) B( x, y) 
By a simple computation, Eq. (7) can be written as: E2   k1 x  k2 x  k3 x 
  
 1
3 
Q(q1,q2)   r2  r1     r2 r1   g2 g1   b2 b1   i  
F2 
 R( x, y) G( x, y) B( x, y) 
 k1 x  k2 x  k3 x   (16)
 
 
 g2  g1   13 r2 r1   g2 g1  b2 b1   j  . (8) 
  R( x, y) G( x, y) B( x, y) 
 k1 y  k2 y  k3 y 
 
 b2  b1   13 r2 r1   g2 g1  b2 b1  k


H 2 

 R( x, y) G( x, y)

B( x, y) 
 k1 y  k2 y  k3 y 
2

  

3041
In Eq. (15), Although some quaternion theories have been applied to
color image edge detection [11], we only consider gradient-
c z  C(xz, y)  13  R(xx, y)  G( xx, y)  B(xx, y)  , (17) based edge detection methods in this paper. We apply the
proposed gradient operator to traditional grayscale image
 
Canny operator for color edge detection. Some state-of-the-
z{x, y} , c{r, g , b} , and C {R, G, B} . art color image gradient methods are chosen for
performance comparison, including the original Di Zenzo’s
Based on the above analysis, we have the following
gradient operator [5] and its improved version [6],
conclusion:
Scharcanski and Venetsanopoulos’ gradient estimator [7],
Theorem: Let a RGB color image f (x, y) be represented the RCMG-Median-Mean operator [8], and Ruzon and
as  R( x, y ), G ( x, y ), B( x, y )  , then the squared color Tomasis’ Compass operator [3]. For all gradient operators,
distance function in direction  , which include the changes the edge maps are obtained by adjusting the high and low
in both chromaticity and luminance, can be written as thresholds of Canny edge detector until the best edge results
are obtained. In addition, parameter t is set to 0.65. The
g ( )  E cos2   2F cos sin   H sin 2  , (18) original test images are shown in Fig. 1 and the edge
where detection results by various color gradient methods are
shown in Figs. 2 and 3. It is easy to observe from the figures
 E  t E1  1  t  E 2 that the proposed method produces more continuous and

 F  t F1  1  t  F2 , (19) pleasing edges compared to other methods (observe the arc
 H  t H 1  1  t  H 2 line at the bottom of Fig. 2 and the beak of the right parrot
in Fig. 3).
E1 , F1 , H 1 , E 2 , F2 , H 2 are defined by Eqs. (15)–(17), and
weight t  [0,1] denotes the importance of the chromaticity
and luminance. Furthermore, the maximum value of
g ( ) , g max (gradient magnitude), and the direction that
maximizes g ( ) ,  max (gradient angle), are

2 
g max  1  E  H    E  H    2 F 
2 2
, (20)

  g max  E 
12
sgn  F  arcsin  Fig. 1. Original color test images: (a) Blocks, (b) Parrots.
  k ,
  2 g max  E  H  (21)
 max   2 To objectively evaluate the edge detectors, we use the
 E H  F2  0 ROC plot [12], in which the false positive detection rate
 2 (FPR) is the percentage of the false positive edges to the
Undefined ,  E  H   F  0
2
total true non-edges and the false negative detection rate
and at the same time,  max satisfies the following (FNR) is the percentage of the false negative examples to
constraints: the total true edges. A synthetic “Grids” color image and its
ground truth edge map are shown in Fig. 4. The edge maps
  0,  4  , F 0 & EH 0 produced by various gradient methods are shown in Fig. 5
   4 ,  2  , F  0 & EH 0 , and the corresponding FPR and FNR results are listed in
 max  k  (22)
   2 ,  4 , F  0 & EH 0 Table 1. It is seen that the proposed method performs best
since it produces the best edge maps and the lowest FPR
   4 , 0  , F  0 & EH 0
and FNR values.
1 , F 0
where sgn(  ) is a sign function: sgn  F    . 4. CONCLUSION
 1 , F 0

The proof of the theorem is in fact to solve the maximum A novel color image gradient method is proposed in this
value of Eq. (18), which has been solved by our recent work paper. The proposed method uses quaternion representation
[6]. Here we no more give the proof; the interested readers to measure the local contrast variations of color images. By
are referred to [6]. solving the maximum of the contrast variation equation, the
color image gradient is obtained. The experimental results
3. APPLICATION TO COLOR EDGE DETECTION show the effectiveness of the proposed gradient estimator.

3042
Fig. 2. Edge detection results by various gradient methods: Fig. 3. Edge detection results by various gradient methods
(a) Compass operator, (b) RCMG-Median-Mean operator, listed in the caption of Fig. 2.
(c) Scharcanski and Venetsanopoulos’ gradient, (d) Di
Zenzo’s gradient, (e) improved Di Zenzo gradient [6], (f)
Proposed gradient.

Fig. 4. Synthetic color image “Grids” and the ground-truth


edge map.

FPR, FNR d 1 d 3
Methods FPR FNR FPR FNR
Compass 0.000346 0.048996 0.000132 0.043851
RCMG-MM 0.000071 0.036257 0.000050 0.034542
Scharcanski 0.001983 0.017393 0.001800 0.012984
Di Zenzo 0.000722 0.433611 0.000509 0.428466
Method [6] 0.000632 0.014944 0.000480 0.011514
Proposed 0.000613 0.011299 0.000469 0.009907

Table 1. False positive detection rates (FPR) and false


negative detection rates (FNR) of the “Grids” image, with Fig. 5. Edge detection results by various gradient methods
different distance thresholds  d (in pixels). listed in the caption of Fig. 2.

3043
REFERENCES

[1] K. N. Plataniotis and A. N. Venetsanopoulos, Color Image


Processing and Applications, Springer-Verlag, Berlin, 2000.
[2] Koschan and M. Abidi, “Detection and classification of edges
in color images,” IEEE Signal Process. Mag., vol. 22, no. 1,
pp. 64–73, 2005.
[3] M. A. Ruzon and C. Tomasi, “Edge, junction, and corner
detection using color distributions,” IEEE PAMI, vol. 23, no.
11, pp. 1281–1295, 2001.
[4] G. Robinson, “Color edge detection,” Opt. Eng., vol. 16, no. 5,
pp. 479–484, 1977.
[5] S. Di Zenzo, “A note on the gradient of a multi-image,”
Comput. Vis. Graph. Image Process., vol. 33, no. 1, pp. 116–
125, 1986.
[6] L. Jin, H. Liu, X. Xu, and E. Song, “Improved direction
estimation for Di Zenzo's multichannel image gradient
operator,” Pattern Recognit., vol. 45, no. 12, pp. 4300–4311,
2012.
[7] J. Scharcanski and A. N. Venetsanopoulos, “Edge detection of
color images using directional operators,” IEEE Trans Circuits
Syst Video Technol., vol. 7, no. 2, pp. 397–401, 1997.
[8] E. Nezhadarya and R. K. Ward, “A new scheme for robust
gradient vector estimation in color images,” IEEE Trans Image
Process., vol. 20, no. 8, pp. 2211–2220, 2011.
[9] W. R. Hamilton, Elements of Quaternions, GINN &
COMPANY, Boston, 1887.
[10] L. Jin and D. Li, “An efficient color-impulse detector and its
application to color images,” IEEE Signal Process. Lett., vol.
14, no. 6, pp. 397–400, 2007.
[11] S.-C. Pei and Y.-Z. Hsiao, “Colour image edge detection
using quaternion quantized localized phase,” European Signal
Processing Conf. (EUSIPCO 2010), Aalborg, Denmark, pp.
1766–1770, 2010.
[12] K. Bowyer, C. Kranenburg, and S. Dougherty, “Edge detector
evaluation using empirical ROC curves,” Comput. Vis. Image
Underst., vol. 84, no. 1, pp. 77–103, 2001.

3044

S-ar putea să vă placă și