% Cacluate the color distance between two pixels

function  color_dis = color_distance(x1, y1, x, y)
global clusterId label im2 eps minpts hr vr cr

h0 = im2(x, y, 1);
v0 = im2(x, y, 2);
c0 = im2(x, y, 3);

h1 = im2(x1, y1, 1);
v1 = im2(x1, y1, 2);
c1 = im2(x1, y1, 3);

% The color distance
color_dis = ((h1 - h0)^2/(hr^2))+((v1 - v0)^2/(vr^2))+((c1 - c0)^2/(cr^2));

