欧氏距离(Euclidian distance,欧几里得(德)距离)定义(转)
2013-11-16 15:56阅读:
欧氏距离定义: 欧氏距离( Euclidean
distance)也称欧几里得距离是一个通常采用的距离定义,它是在m维空间中两个点之间的真实距离。
欧氏距离:(∑(Xi-Yi)2)1/2,即两项间的差是每个变量值差的平方和再平方根,目的是计算其间的整体距离即不相似性。
在二维和三维空间中的欧式距离的就是两点之间的距离,二维的公式是
d = sqrt((x1-x2)^+(y1-y2)^)
三维的公式是
d=sqrt(x1-x2)^+(y1-y2)^+(z1-z2)^)
推广到n维空间,欧式距离的公式是
d=sqrt( ∑(xi1-xi2)^ ) 这里i=1,2..n
xi1表示第一个点的第i维坐标,xi2表示第二个点的第i维坐标
n维欧氏空间是一个点集,它的每个点可以表示为(x(1),x(2),...x(n)),其中x(i)(i=1,2...n)是实数,称为x的第i个坐标,两个点x和y=(y(1),y(2)...y(n))之间的距离d(x,y)定义为上面的公式.
欧氏距离看作信号的相似程度。 距离越近就越相似,就越容易相互干扰,误码率就越高。
========
所谓欧氏距离变换,是指对于一张二值图像(再次我们假定白色为前景色,黑色为背景色),将前景中的像素的值转化为该点到达最近的背景点的距离。
欧氏距离变换在数字图像处理中的应用范围很广泛,尤其对于图像的骨架提取,是一个很好的参照。
所谓欧氏距离变换,是指对于一张二值图像(再次我们假定白色为前景色,黑色为背景色),将前景中的像素的值转化为该点到
达最近的背景点的距离。
欧氏距离变换在数字图像处理中的应用范围很广泛,尤其对于图像的骨架提取,是一个很好的参照。
========
欧氏距离:(∑(Xi-Yi)2)1/2,即两项间的差是每个变量值差的平方和再平方根,目的是计算其间的整体距离即不相似性。
我们熟悉的欧氏距离虽然很有用,但也有明显的缺点。它将样品的不同属性(即各指标或各变量)之间的差别等同看待,这一点有时不能满足实际要求。例如,在教育研究中,经常遇到对人的分析和判别,个体的不同属性对于区分个体有着不同的重要性。因此,有时需要采用不同的距离函数。
如果用dij表示第i个样品和第j个样品之间的距离,那么对一切i,j和k,dij应该满足如下四个条件:
①当且仅当i=j时,dij=0
②dij>0
③dij=dji(对称性)
④dij≤dik+dkj(三角不等式)
显然,欧氏距离满足以上四个条件。满足以上条件的函数有多种,本节将要用到的马氏距离也是其中的一种。
第i个样品与第j个样品的马氏距离dij用下式计算:
dij=(xi一xj)'S-1(xi一xj)
其中,xi和xj分别为第i个和第j个样品的m个指标所组成的向量,S为样本协方差矩阵。
马氏距离有很多优点。它不受量纲的影响,两点之间的马氏距离与原始数据的测量单位无关;由标准化数据和中心化数据(即原始数据与均值之差)计算出的二点之间的马氏距离相同。马氏距离还可以排除变量之间的相关性的干扰。它的缺点是夸大了变化微小的变量的作用。
采用巴氏距离特征选择的迭代算法,可以获得最小错误率上界。当特征维数高时,为了减少巴氏距离特征选择计算时间,对样本先进行K-L变换,将特征降低到中间维数。然后进行巴氏距离特征选择,降低到结果的维数。用基于MNIST手写体数字库的试验表明,该文方法比单纯用巴氏距离特征选择计算时间大大减少,并比主分量方法(即单纯使用K-L变换)特征选择的错误率小得多
=========
In mathematics, the
Euclidean distance
or
Euclidean metric
is the 'ordinary' distance between two points
that one would measure with a ruler, and is given by the
Pythagorean formula. By using this formula as distance, Euclidean
space (or even any inner product space) becomes a metric space. The
associated norm is called the
Euclidean
norm. Older literature refers to the metric
as
Pythagorean metric.
Definition
The
Euclidean distance
between points
p
and
q
is the length of the line segment

. In
Cartesian coordinates, if
p =
(
p1,
p2,...,
pn) and
q =
(
q1,
q2,...,
qn) are two points in Euclidean
n-space, then the distance from
p to
q is given by:
-

|
|
(1)
|
The Euclidean norm measures the distance of a point to the origin
of Euclidean space:

where the last equation involves the dot product. This is the
length of
p, when regarded as a
Euclidean vector from the origin. The distance itself is given
by
-

|
|
(2)
|
[edit] Special
cases
In one dimension, the distance between two points on the real line
is the absolute value of their numerical difference. Thus if
x and
y are two points on
the real line, then the distance between them is computed as

In one dimension, there is a single homogeneous,
translation-invariant metric (in other words, a distance that is
induced by a norm), up to a scale factor of length, which is the
Euclidean distance. In higher dimensions there are other possible
norms.
In the Euclidean plane, if
p =
(
p1,
p2) and
q =
(
q1,
q2) then the distance is given by

Alternatively, it follows from (
2)
that if the polar coordinates of the point
p are
(
r1,
θ
1) and those of
q are
(
r2,
θ
2), then the distance
between the points is

In three-dimensional Euclidean space, the distance is

and so on.
From:http://en.wikipedia.org/wiki/Euclidean_distance