I am working on comparing multiple images. I have these image data as column vectors of a matrix called βimagesβ. I want to appreciate the similarity of the images by first calculating their Euclidean distance. Then I want to create a matrix on which I can perform several random walks. Right now, my code is as follows:
% clear % clc % close all % % load tea.mat; images = Input.X; M = zeros(size(images, 2), size (images, 2)); for i = 1:size(images, 2) for j = 1:size(images, 2) normImageTemp = sqrt((sum((images(:, i) - images(:, j))./256).^2)); %Need to accurately select the value of gamma_i gamma_i = 1/10; M(i, j) = exp(-gamma_i.*normImageTemp); end end
My matrix M, however, ends up having a value of 1 along its main diagonal and zeros elsewhere. I expect "large" values ββfor the first few elements of each row and "small" values ββfor elements with a column index> 4. Can someone explain what is wrong? Any advice is appreciated.
source share