Colorspace distance
d = colordistance(im, rg) is the Euclidean distance on the rg-chromaticity plane from coordinate rg=[r,g] to every pixel in the color image im. d is an image with the same dimensions as im and the value of each pixel is the color space distance of the corresponding pixel in im.
Machine Vision Toolbox for MATLAB © 1990-2014 Peter Corke.