Write an m-file "distan.m" which does all the following operations:
(i) computes 10 dimensional histogram of an input image
h1=sum(hist(imn,10)');
(ii) computes negative image and its histogram
(iii) normalizes vectors h1, h2 such that the integral of each is 1
Why does it have to be normalized?
(iv) displays both histograms
(v) computes similarity between two histograms using
euclidean distance,
histogram intersection,
correlation,
chi-square
function distan(im)
imn=imnorm(im)/255.0;
h1=?
h1n=?
imnn=?
h2=?
h2n=?
%euclidean
he=sqrt(sum((h1-h2).^2))
%correlations
hc=?
%intersection, use min function
hh=?
%chi-square, use sum function
hch=?
How do the distances differ?