Similarity index beetween different size images
Show older comments
Hi there; I'm looking for a Similarity Index (possibily in [0,1] range) beetween two images of different sizes. I've lookex for corr2, but it wants same size images. Also I've looked for xcorr2, but I don't understand how I could use it to get a similarity index.
Any help?
Accepted Answer
More Answers (1)
Image Analyst
on 9 Oct 2016
You can use ssim(), psnr, or immse():
image2 = imresize(image2, size(image1));
ssimval = ssim(image1, image2);
3 Comments
Leox91
on 9 Oct 2016
nor azam
on 31 Oct 2019
Hi Image Analyst,
i got the same error when i used the given code which the size need to be same.
ref = imread('alif.jpg');
A = rgb2gray(ref);
BW1 = imbinarize(A);
figure
imshow(BW1)
image = imread('alif1.jpg');
B = rgb2gray(image);
BW2 = imbinarize(B);
figure
imshow(BW2)
%to calculate the percentage of similarity between ref and new image
BW2 = imresize(BW2, size(BW1));
ssimval = ssim(BW1, BW2);
This is my code. i already converted the images into binary and i want to find the percentage of similarity between two different size of image. please help me sir.
Mohammad Farhad Aryan
on 29 Jan 2020
Input arguments of ssim() are expected to be one of these types: uint8, uint16, single or double not logical.
Categories
Find more on Image Quality in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!