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!