Similarity index beetween different size images
10 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
Massimo Zanetti
2016-10-9
One idea can be appying a transform that reduce the bigger image into an image of the same size of the smaller one. Then apply any similarity index that works with same sized images.
3 个评论
Massimo Zanetti
2016-10-9
编辑:Massimo Zanetti
2016-10-9
No! There is a very appropriate function to resize images: http://it.mathworks.com/help/images/ref/imresize.html
By default it uses bicubic interpolation, but you have also other options.
If this answer helped you, please accept it.
更多回答(1 个)
Image Analyst
2016-10-9
You can use ssim(), psnr, or immse():
image2 = imresize(image2, size(image1));
ssimval = ssim(image1, image2);
3 个评论
nor azam
2019-10-31
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
2020-1-29
Input arguments of ssim() are expected to be one of these types: uint8, uint16, single or double not logical.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computer Vision with Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!