Color Edge Detection based on Bhattacharyya Distance
Yongsung Cheon and Chulhee Lee
Dept. of Electrical and Electronics Engineering, Yonsei University, Republic of Korea
Keywords: Bhattacharyya Distance, Colour Edge Detection, Multi-dimensional Edge Detection.
Abstract: In this paper, we propose to apply the multi-dimensional edge detection algorithm developed for hyperspectral
images to colour image edge detection. The multi-dimensional edge detection algorithm utilizes the
Bhattacharyya distance and considers the statistical difference between two neighbouring blocks. In order to
apply the algorithm to colour images, we need to take into account the singularity problem of the covariance
matrices. In the algorithm, we first apply the Wiener filter to supress noise and select four block pairs
including up-down, left-right, diagonal-left-down and diagonal-right-down. The experimental results show
that the colour edge detection method based on the Bhattacharyya distance shows promising results compared
to the results obtained by the Sobel and Canny-edge edge detection algorithms.
1 INTRODUCTION
Edge detection is a basic operation in pattern recogni-
tion and image processing. Although many researchers
have proposed numerous algorithms, edge detection is
still a challenging problem. Due to the complexity of
typical images, current edge detection algorithms fail
to produce satisfactory edges in some cases. Most
images are available in colour. In general, colour image
edge detection should provide better performance
compared to grey scale images, though the difference
may not be significant in some cases. Among various
edge detection algorithms, the Sobel and Canny edge
detection algorithms are still widely used.
Recently, the Bhattacharyya distance was used to
detect edges in multispectral images. By utilizing
second order statistics, it can better utilize the
information of multispectral images. In this paper, we
explore the edge detection algorithm based on the
Bhattacharyya distance for colour image edge
detection.
The rest of this paper is organized as follows: Section
2 summarizes the edge detection algorithm based on
the Bhattacharyya distance along with some
modifications to solve the singularity problem of
colour images. Section 3 presents experimental results
and conclusions are provided in section 4.
2 THE METHOD
Fig. 1 is a block diagram of edge detection using the
Bhattacharyya Distance. We used several colour
images to test the performance. First, we apply the
Wiener filter to RGB images to supress noise. Then,
four block pairs are selected and the Bhattacharyya
distances of the four pairs are computed. Finally, the
maximum value is selected as an edge value.
2.1 Pixel-wise Wiener Filter
Most images often contain artefacts that may
adversely affect edge detection. To avoid this
problem, a pixel-wise adaptive Wiener filter based on
statistical characteristic estimation from the local
neighbourhood of each pixel was used.
The Wiener filter is commonly used in image
processing applications to remove additive noise
from degraded images. The local mean ( μ ) and
variance (
) are computed as follows:
()
11
1
,
NM
ij
L
ij
NM
μ
==
=

(1)
368
Cheon, Y. and Lee, C.
Color Edge Detection based on Bhattacharyya Distance.
DOI: 10.5220/0006433903680371
In Proceedings of the 14th International Conference on Informatics in Control, Automation and Robotics (ICINCO 2017) - Volume 2, pages 368-371
ISBN: Not Available
Copyright © 2017 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
Figure 1: Block diagram of the proposed method.
()
222
11
1
,
NM
ij
Lij
NM
σ
μ
==
=−

(2)
where L(i,j) represents a block image in the N-by-M
local neighbourhood of each pixel. Then, the Wiener
filter is given as follows:
()
[]
22
2
,(,).Wij Lij
συ
μμ
σ
=+
(3)
2.2 Bhattacharyya Distance
For each pixel, four pairs of blocks were chosen: up-
down, left-right, diagonal-left-down and diagonal-
right-down pairs. Fig. 2 illustrates the four pairs of
blocks.
The Bhattacharyya distance takes into account the
mean and covariance differences. Therefore, it can
better utilize multispectral images, including colour
images. The Bhattacharyya distance can be defined as
follows:
()()
12 12
12
11det
ln
82
det det
T
d
μμ μμ

=− +



Σ
ΣΣ
   
(4)
where
and
are the mean vector and covariance
matrix of the

block, and ∑=
∑
.
The up-down blocks are used to find vertical edges
whereas the left-right blocks are used to find
horizontal edges. The diagonal-left-down blocks and
diagonal-right-down blocks are used to detect
diagonal edges. We compute four Bhattacharyya
distances and choose the maximum value, which
represents the edge strength as follows:
() () () () ()
()
,, , .
E
dgeimage i Max UD i LR i DLD i DRD i=
(5)
Figure 2: Four pairs of neighbourhood blocks. (a) Up-down
(UD), (b) Left-right (LR), (c) Diagonal-left-down, (d)
Diagonal-right-down.
2.3 Outliers and Singularity Problem
There is a possibility that a block may contain outlier
pixels, which cause a large variance. Such outlier
pixels may generate erroneous edge pixels. To
address this problem, outliers are removed before
computing the mean vector and covariance matrix.
Unlike multi-spectral images, a small block can be
very homogeneous in colour images. It is also
possible that a block may have the same RGB values
if it represents constant regions. In such cases, the
covariance matrix is singular and the Bhattacharyya
distance cannot be computed since the determinant is
zero. To solve this problem, we add a very small value
(ε) to the diagonal terms of the covariance matrix.
Table. 1 illustrates this procedure.
Table 1: Covariance Matrix.
+
+
+
Color Edge Detection based on Bhattacharyya Distance
369
3 EXPERIMENTAL RESULTS
In the experiments, we set the block size to 3x3 pixels
and the offset to one pixel to compute the
Bhattacharyya distance. Along with the colour edge
detection method based on the Bhattacharyya
distance (BD method), we tested the Sobel and Canny
edge detection algorithms.
Figs. 3-6 show performance comparisons of the three
methods. In Fig. 3, the Sobel and Canny edge
detection algorithms failed to detect the weak edges
between the top of the box and the white wall,
whereas the BD method successfully recovered the
edges. In Fig. 4, the Sobel and Canny edge detection
algorithms failed to detect the boundary between the
wheel and the shadow background, whereas the BD
method better recovered the missing edges. In Fig. 6,
the Sobel and Canny edge detection algorithms
completely failed to detect the dark building, whereas
the BD method detected the building structure.
4 CONCLUSIONS
In this paper, we applied the edge detection algorithm
based on the Bhattacharyya distance for colour image
edge detection. In order to solve the covariance
singularity problem, we added a very small value to
the diagonal terms of the covariance matrix.
Experimental results show that the edge detection
algorithm based on the Bhattacharyya distance can
detect some edges missed by the Sobel and Canny-
edge detection algorithms.
REFERENCES
Maini, R. and Aggarwal, H. (2009) ‘Study and comparison
of various image edge detection techniques’,
International journal of image processing, vol. 3, no. 1,
February, pp. 1-11.
Koschan, A. and Abidi, M. (2005) ‘Detection and
classification of edges in color images’, IEEE Signal
Processing Magazine, vol. 22, no.1, March, pp. 64-73.
Kutty, S. B., Saaidin, S., Yunus, P. N. A. M. and Hassan, S.
A. (2014) ‘Evaluation of canny and sobel operator for
logo edge detection’, Technology Management and
Emerging Technologies, 2014 International
Symposium on, October, pp. 153-156.
Hassanpour, H., Farahabadi, P. M. (2009) ‘Using Hidden
Markov Models for paper currency recognition’, Expert
Systems with Applications, vol. 36, no. 6, August, pp.
10105-10111.
Gonzalez, R. C. and Woods, R E. (2002) Digital image
processing, 2
nd
edition, Prentice Hall.
Youn, S. and Lee, C. (2013) ‘Edge Detection for
Hyperspectral Images Using the Bhattacharyya
Distance’, Parallel and Distributed Systems, 2013
International Conference on, December, pp. 716-719.
Youn, S. and Lee, C. (2014) ‘Multi-dimensional edge
detection operators’, SPIE Sensing Technology+
Applications, May, pp. 912407-912407-7.
(a) (b) (c) (d)
Figure 3: Performance comparison. (a) Original image, (b) Sobel filtering, (c) Canny edge detection, (d) the colour edge
detection based on the Bhattacharyya Distance.
ICINCO 2017 - 14th International Conference on Informatics in Control, Automation and Robotics
370
(a) (b) (c) (d)
Figure 4: Performance comparison. (a) Original image, (b) Sobel filtering, (c) Canny edge detection, (d) the colour edge
detection based on the Bhattacharyya Distance.
(a) (b) (c) (d)
Figure 5: Performance comparison. (a) Original image, (b) Sobel filtering, (c) Canny edge detection, (d) the colour edge
detection based on the Bhattacharyya Distance.
(a) (b) (c) (d)
Figure 6: Performance comparison. (a) Original image, (b) Sobel filtering, (c) Canny edge detection, (d) the colour edge
detection based on the Bhattacharyya Distance.
Color Edge Detection based on Bhattacharyya Distance
371