Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Similiarity of Columns in Images

1 vue (au cours des 30 derniers jours)
J Parker
J Parker le 21 Août 2017
Clôturé : MATLAB Answer Bot le 20 Août 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?

Réponses (1)

Walter Roberson
Walter Roberson le 21 Août 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 commentaires
Image Analyst
Image Analyst le 24 Août 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 le 25 Août 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))

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by