Info
此问题已关闭。 请重新打开它进行编辑或回答。
Similiarity of Columns in Images
1 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
Walter Roberson
2017-8-21
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 个评论
Image Analyst
2017-8-24
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
2017-8-25
[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))
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!