i use the code below to calculate the Euclidean distance for two rgb images:
Im1 = imread(filename1);
Im1 = rgb2gray(Im1);
hn1 = imhist(Im1)./numel(Im1);
Im2 = imread(filename2);
Im2 = rgb2gray(Im2);
hn2 = imhist(Im2)./numel(Im2);
f = norm(hn1-hn2);
and it gives me the correct answer
but now i want to use the code for two images in hsv color mode but it wont work on it
cause all of the above code is in a 2d space while hsv is 1d
is there any specific code for calculating Euclidean distance of two image in hsv color space?
the images format are jpeg
You need to create a histogram for each channel seperatetly
Using this function you can compute the image to image distance in hsv space
Sneak a peek for a vectorized version of
im2hsvHist
: