0% found this document useful (0 votes)
9 views4 pages

Choice of Distance Metrics For RGB Color Image Analysis

The document discusses the use of various distance metrics for RGB color image analysis, particularly in the context of image segmentation using the k-mean clustering algorithm. It compares the effectiveness of these metrics in RGB color space versus the L*a*b* color space, concluding that appropriate distance metrics in RGB can yield better segmentation results. The study evaluates multiple distance measures, including Euclidean, Minkowski, and colorimetric distances, and presents experimental results demonstrating their performance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

Choice of Distance Metrics For RGB Color Image Analysis

The document discusses the use of various distance metrics for RGB color image analysis, particularly in the context of image segmentation using the k-mean clustering algorithm. It compares the effectiveness of these metrics in RGB color space versus the L*a*b* color space, concluding that appropriate distance metrics in RGB can yield better segmentation results. The study evaluates multiple distance measures, including Euclidean, Minkowski, and colorimetric distances, and presents experimental results demonstrating their performance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

©2016 Society for Imaging Science and Technology

Choice of distance metrics for RGB color image analysis


Amadou T. SANDA MAHAMA1,2, Augustin S. DOSSA1, Pierre GOUTON2
1
Université d’Abomey-Calavi, Institut de Mathématiques et de Sciences Physiques, Porto-Novo, Benin, BP 613
2
University of Burgundy, Laboratoire Le2i, Dijon, France, BP 47870

Abstract
Many image clustering algorithms use distance metric in the Distance metrics
process of taking decision. When dealing with color images, a A distance is a [3] function d with nonnegative real values, defined
distance metric will be used to decide whether two pixels or on the Cartesian product E x E of a set E. It is called a metric on E
regions are closed. Colorimetric distances proposed by if for every x,y,z ϵ E:
CIE(Commission Internationale de l’Eclairage) are often used in - d (x,y)=0 if x=y (the identity axiom);
Lab color space because it is a uniform chromaticity space. - d (x,y) + d (y,z) ≥ d (x,z) (the triangle inequality);
However, RGB color space is useful to image processing and - d (x,y)= d (y,x) (the symmetry axiom).
instead of converting color image from RGB to another color
space before processing, it might be interesting to have the same Minkowsky distance
or better results without changing the color space. In our work, we Minkowsky distance is a general form of many other distance
implement different distance metrics and compare the result of k- measures.
mean clustering algorithm in RGB color space to the one in
∑ |x /
L*a*b* with the colorimetric distance. Two evaluation criteria , y| (1)
have been used and we conclude that being in RGB color space
and choosing adequately the distance metric, we obtain better
Euclidian distance
This distance is a Minkowsky distance for p=2. It measures
segmentation results.
straight-line distance between two points.
Keywords: distance metric, color image, color space.
, ∑ (2)
Introduction
In many color image segmentations algorithms the metric distance Canberra distance
is used to compare two color vectors or two regions. In most of Introduced in 1966 [4] and modified in 1967, this distance is useful
cases, the color space used is the ones considered as perceptually for data scattered around an origin.
| |
uniform. These color spaces was proposed in 1976 by CIE [1]. , ∑ (3)
| |
So the color image segmentation algorithms often convert color Each term of the summation has value between zero and one. In
images from RGB space to L*a*b* or L*u*v* color space and then the particular case of the numerator and the denominator equal to
apply the Euclidian distance metric for colors comparison. In our zero, the term is defined equals to zero.
work, we maintain the image in RGB space and then use various
distance metrics to determine the one that gives the best results for Squared chords distance
image segmentation. We present the color spaces and distance Squared chords distance measure de dissimilarity between two
metrics. K-mean algorithm will enable us to conclude. vectors.
d x, y ∑ √x y (4)
Color spaces
In color image classification or segmentation, one of the frequently Chi-Square Distance
encountered problems is to find the color space so that distance is This distance is mainly used when dealing with qualitative
proportional to one’s ability to perceive changes in color. variables.
RGB color space results from the transformation of the spectral
, ∑ (5)
power distribution in a three-dimension vector. This color space is | |
device-dependant and gives sometimes negative values. CIE has
proposed XYZ color space to overcome these drawbacks. Many Chebychev distance or Queen-wise distance
other color spaces have been adopted in industries. Chebychev distance is a particular case of Minkowsky distance
MacAdam has demonstrate that CIE chromaticity diagram presents where p=∞. It is a measure of dissimilarity.
limitations: this representation is non-uniform[2]. He’s deduced
, | | (6)
from the former a uniform representation. Later in 1976 there was
1
a large industry agreement on two standards CIELAB (L*a*b*)
and CIELUV (L*u*v*). The uniformity in these color spaces
permit to define the colorimetric distance which is proportional to
color difference.
.

IS&T International Symposium on Electronic Imaging 2016


Color Imaging XXI: Displaying, Processing, Hardcopy, and Applications COLOR-349.1
©2016 Society for Imaging Science and Technology

Manhattan or city-block distance ∗


Manhattan distance is a particular case of Minkowski distance ∆E ∗ R (11)
where p = 1. Manhattan distance is the distance between two points
when a grid-like path is followed. See details on steps to have the final result in [5].

, ∑ | | (7) Experiments and results


Despite the drawbacks of RGB color space, we’ve decided to
Mahalanobis distance
maintain images in RGB color space and then vary the distance
Mahalanobis distance is based on the correlation between two
metrics for image segmentation using K-mean algorithm. We
variables.
compare the results obtained with the ones in Lab color space. In
, (8) Lab space, the metrics used are colorimetric distances.
Where C is the covariance matrix. We’ve used matlab 7 and twenty images picked from Berkeley
database [6]. For evaluation of the segmentation results we’ve used
Cosine distance
Levine and Nassif intra-region uniformity and inter-region contrast
It measures the degree of similarity of two vectors. His absolute
criteria.
value ranges from 0 to 1. When this value approaches 1, it means
that the two vectors are getting closer. Commonly used in high- The intra-region uniformity is inversely proportional to the
variance of a considered feature values of the pixels belonging to a
dimensional vector spaces for information retrieval and text
mining. region.
The inter-region contrast is computed between adjacent regions. It
. is assumed that a uniform feature value of two adjacent regions is
cos ‖ ‖‖ ‖
(9) the average of the feature values of these regions. See detail of the
computation in [7].
CIE colorimetric color difference The following tables give the segmentation evaluation results. The
After creation of CIELAB, CIE 1976 ∆E*ab color-deference first three tables give the results the segmentation evaluation using
formulas have been defined based on Euclidian distance. In 1994 K-mean and different distance metrics. The last table shows
and 2001 the CIE94 ∆E*94 and CIEDE ∆E*00 formulas were segmentation evaluation results when the colorimetric color
published respectively to improve the first one [5]. difference CIE94 and CIEDE00 are used.
In our work we focus our analysis on the two last color-difference For each image, the distance metric that provided the best
metrics. segmentation score is boldfaced.
CIE94 ∆E*94 Recall that the smaller Levine and Nassif intra-region uniformity
The philosophy results from the fact that Lab color space is not criterion score is, the better the segmentation result is. The higher
totally uniform. So some weighting functions and parametric Levine and Nassif inter-region contrast criterion score is, the better
factors have been added to improve the first formula. the segmentation result is.

∗ ∗ ∗ Table 1: Segmentation score in RGB space


∆E ∗ (10)
Where Euclidean C i t yb l o c k Cos ine
ΔL∗ L∗ L∗ intra inter Intra inter intra inter
Δa∗ a∗ a∗ 3096 2.45 0.05 1.58 0.05 4.09 0.09
Δb∗ b∗ b∗ 8023 4.29 0.04 3.90 0.04 14.42 0.02
12084 5.68 0.08 10.38 0.08 14.52 0.05
∗ ∗ ∗
1,2 14037 5.02 0.12 3.12 0.12 7.42 0.18
∆ ∗ ∗ ∗ 16077 8.43 0.08 7.17 0.08 29.11 0.03
19021 5.84 0.11 5.88 0.11 22.64 0.08
∗ ∗ ∗ ∗
∆ ∆ ∆ ∆ 21077 7.69 0.06 7.29 0.06 25.51 0.06
SL = 1, 24077 7.23 0.08 8.30 0.09 24.20 0.09
1 ∗ 33039 6.76 0.10 6.04 0.11 10.82 0.11
1 ∗ 37073 9.34 0.05 3.79 0.05 19.68 0.05
KC = KH = 1 use to be unit. 38082 1.85 0.10 1.82 0.10 6.23 0.08
The value of the weighting factors KL, K1, K2 depend of the 38092 4.99 0.07 5.71 0.08 52.46 0.04
application 41033 3.26 0.06 7.07 0.07 17.84 0.07
For graphic arts KL = 1, K1 = 0.045, K2=0.015 41069 3.44 0.07 5.89 0.07 21.30 0.05
For textiles KL = 2, K1 = 0.048, K2=0.014 42012 3.45 0.09 5.86 0.10 8.41 0.13
CIEDE ∆E*00 42049 4.71 0.04 4.84 0.04 20.16 0.08
Given two colors in Lab color space (L1, a*1, b*1) and (L2, a*2 , 43074 2.23 0.07 3.14 0.08 10.01 0.03
b*2), we get the CIEDE ∆E*00 color difference by: 45096 9.39 0.14 5.79 0.13 19.17 0.16
54082 4.02 0.07 3.70 0.07 8.44 0.08
55073 5.40 0.13 6.75 0.13 19.82 0.15

IS&T International Symposium on Electronic Imaging 2016


Color Imaging XXI: Displaying, Processing, Hardcopy, and Applications COLOR-349.2
©2016 Society for Imaging Science and Technology

Table 4: Segmentation score in Lab space

Table 2: Segmentation score in RGB space Euclidean ∆ E * 9 4 ∆ E * 0 0


Intra I n t e r intra inter intra inter
Chi-Square Minkowski_5 Mahalanobis
3096 1.52 0 . 0 5 1.91 0.05 1.55 0.05
intra inter intra inter intra inter
8023 4.30 0 . 0 4 3.36 0.04 3.35 0.04
3096 1.64 0.05 1.57 0.05 2.94 0.05
12084 5.63 0 . 0 8 7.37 0.09 9.01 0.09
8023 4.05 0.04 4.03 0.04 8.51 0.03
14037 3.6 0 . 1 4 4.25 0.12 5.94 0.16
12084 11.06 0 . 0 8 4.92 0.08 10.67 0 . 0 9
16077 5.50 0 . 0 6 7.69 0.07 5.15 0.06
14037 3.07 0.14 5.00 0.11 8.06 0.13
19021 7.56 0 . 1 0 6.88 0.11 11.42 0.11
16077 7.96 0.09 9.34 0.09 12.47 0 . 0 7
21077 5.15 0 . 0 6 6.98 0.06 5.32 0.06
19021 10.84 0 . 1 1 13.15 0 . 1 2 14.17 0 . 1 1
24077 6.41 0 . 0 7 10.00 0.09 11.03 0.08
21077 7.93 0.06 4.61 0.07 11.10 0 . 0 4
33039 6.59 0 . 1 0 6.54 0.10 5.74 0.10
24077 7.84 0.08 6.61 0.08 23.66 0 . 0 9
37073 9.63 0 . 0 5 4.65 0.05 3.71 0.06
33039 7.12 0.11 6.66 0.11 9.83 0.10
38082 1.60 0 . 1 0 1.48 0.10 2.00 0.10
37073 5.24 0.06 3.58 0.08 14.04 0 . 0 5
38092 5.00 0 . 0 6 4.35 0.06 4.41 0.07
38082 2.39 0.10 1.98 0.10 4.53 0.07
41033 3.94 0 . 0 7 3.88 0.07 5.46 0.07
38092 7.48 0.08 7.68 0.08 22.44 0 . 0 4
41069 3.48 0 . 0 7 3.58 0.06 3.56 0.06
41033 5.78 0.06 5.96 0.07 14.18 0 . 0 5
42012 3.22 0 . 0 8 5.16 0.09 3.74 0.10
41069 5.98 0.07 6.35 0.07 12.72 0 . 0 5
42049 4.41 0 . 0 4 4.20 0.04 4.36 0.04
42012 4.76 0.10 6.00 0.10 11.52 0 . 0 9
43074 3.63 0 . 0 7 3.32 0.07 2.28 0.07
42049 4.41 0.04 5.84 0.04 11.21 0 . 0 5
45096 8.60 0 . 1 4 8.87 0.12 11.84 0.14
43074 2.51 0.07 2.01 0.07 7.08 0.07
54082 2.83 0 . 0 8 3.73 0.06 2.53 0.08
45096 8.60 0.12 8.45 0.10 24.95 0 . 2 2
55073 6.55 0 . 1 3 8.27 0.12 8.64 0.13
54082 4.49 0.08 4.60 0.05 3.85 0.05
55073 6.60 0.13 5.50 0.12 13.80 0 . 0 9

Table 3: Segmentation score in RGB space


Queenwise Squarredchords Canberra
Discussion and conclusion
Only 7/20 of scores are better when we use the colorimetric
intra inter i n t r a inter i n t r a inter
difference metric in L*a*b* space.
3096 1.61 0 . 5 1 . 3 9 0.05 1 . 8 7 0.05
The distance metrics squared chords, Canberra, Queenwise and
8023 4.25 0.04 4 . 5 3 0.04 3 . 6 5 0.04 Minskowsky 5 (p=5) give better results in RGB space.
12084 5.23 0.07 5 . 8 5 0.08 10.15 0.08 Considering the sample of images on wish we work, Lab color
14037 4.38 0.11 3 . 4 2 0.15 2 . 9 5 0.12 space is not always the better color space for image segmentation.
16077 6.33 0.08 5 . 0 8 0.08 9 . 0 0 0.08 Better results are obtained in RGB color space with some distance
19021 4.36 0.10 6 . 4 3 0.11 9 . 1 1 0.11 metrics different from Euclidian distance. Depending to the image
21077 5.18 0.07 7 . 9 7 0.06 7 . 6 5 0.06 and the processing, we have to choose the more suitable color
24077 7.58 0.09 7 . 3 9 0.08 7 . 5 5 0.08 space and distance metric. Further experiments could be done to
33039 6.56 0.10 5 . 9 4 0.11 5 . 8 5 0.11 map image categories to most suitable distance metrics.
37073 3.80 0.07 9 . 6 7 0.06 2 . 8 7 0.06
38082 2.11 0.11 1 . 6 0 0.10 1 . 8 2 0.10 References
38092 5.93 0.08 5 . 0 8 0.07 5 . 3 5 0.07 [1] Charles Poynton, A Guided Tour of Color Space, New Foundations
41033 3.14 0.06 5 . 5 2 0.06 4 . 4 2 0.06 for Video Technology Proceedings of the SMTPE Advanced
41069 3.60 0.07 3 . 6 8 0.07 3 . 6 1 0.07 Television and Electronic Imaging Conference), 1995, pages 167-
42012 3.03 0.09 9 . 2 4 0.12 5 . 1 5 0.10 180.
42049 6 . 5 0.04 4 . 7 1 0.04 4 . 5 8 0.04 [2] D. Pascale, A review of RGB color spaces, 2003.
43074 2.68 0.07 2 . 7 0 0.07 2 . 1 5 0.07
45096 14.67 0 . 1 0 12.27 0 . 1 2 8 . 7 5 0.12 [3] Peter Grabusts, The choice of metrics for clustering algorithms,
54082 7.60 0.04 4 . 2 5 0.08 3 . 0 4 0.08 Proceedings of the 8th International Scientific and Practical
55073 5.47 0.11 6 . 1 3 0.13 5 . 9 3 0.13 Conference. Volume I1, 2011.

[4] Lance, G. N., Williams, W. T. , Computer programs for hierarchical


polythetic classification ("similarity analysis"),. Computer Journal
pp 60–64, 1966

[5] Gaurav Sharma, Whencheng Wu, E. N. Daalal, The CIEDE2000


Color-Difference formula: implementation notes, supplementary test

IS&T International Symposium on Electronic Imaging 2016


Color Imaging XXI: Displaying, Processing, Hardcopy, and Applications COLOR-349.3
©2016 Society for Imaging Science and Technology

data and mathemetical observations, color Research and Applications,


vol. 30, no.1, pp. 21-30, 2000.

[6] https://www.eecs.berkeley.edu/, the Berkeley Segmentation Dataset


and Benchmark.

[7] Levine, M.D.; Nazif, Ahmed M., "Dynamic Measurement of


Computer Generated Image Segmentations," in Pattern Analysis and
Machine Intelligence, IEEE Transactions on , vol.PAMI-7, no.2,
pp.155-164, March 1985.

Author Biography
Augustin S. DOSSA received his MS degree in physics from the Université
d’Abomey-Calavi (2005) and then is pursuing his MS in Computer Science.

Amadou T. SANDA MAHAMA, received his MS degree in Computer


Science at Université d’Abomey-Calavi (2009), he is PhD student at
Université d’Abomey-Calavi and University of Burgundy (France).

Professor, Pierre GOUTON. has obtained a PhD in Components, Signals


and Systems at the University of Montpellier 2 (France), 1991. He has
integrated the Department of Image Processing in the Laboratory of
Electronics, Data-processing and Images. Since his main topic research
carries on the segmentation of Images by Linear methods or None-linear
(mathematical morphology, classification), Color Science, Multispectral
Images, Micro and Nano Sensor.

IS&T International Symposium on Electronic Imaging 2016


Color Imaging XXI: Displaying, Processing, Hardcopy, and Applications COLOR-349.4

You might also like