Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Similiarity of Columns in Images

1 Ansicht (letzte 30 Tage)
J Parker
J Parker am 21 Aug. 2017
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I have two images, and I am interested in determining the Gaussian similarly (not equal) of columns in each image. Can someone assist me on how to accomplish it?

Antworten (1)

Walter Roberson
Walter Roberson am 21 Aug. 2017
Assuming a grayscale image YourImage,
[r, c] = size(YourImage);
gsim = zeros(c, c);
for c1 = 1 : c - 1;
for c2 = c1 + 1 : c
[h, p] = kstest2(YourImage(:,c1), YourImage(:,c2));
gsim(c1, c2) = p;
gsim(c2, c1) = p;
end
end
imagesc(gsim)
  8 Kommentare
Image Analyst
Image Analyst am 24 Aug. 2017
J, why don't you simply subtract the images? Or use built-in functions like immse() or psnr()? Or compute the mean (or median) absolute deviation?
Walter Roberson
Walter Roberson am 25 Aug. 2017
[r1, c1, p1] = size(FirstImage);
[r2, c2, p2] = size(SecondImage);
if c1 ~= c2
error('Images must have the same number of columns');
end
if p1 ~= 1 || p2 ~= 1
error('This code is for grayscale images only');
end
gsim = zeros(1, c1);
for c = 1 : c1
[h, p] = kstest2(FirstImage(:,c), SecondImage(:,c));
gsim(1, c) = p;
end
end
figure(2)
image(gsim); %I do not recommend imshow for this purpose
colormap(parula(256))

Diese Frage ist geschlossen.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by