Similarity index beetween different size images

9 ビュー (過去 30 日間)
Leox91
Leox91 2016 年 10 月 9 日
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?

採用された回答

Massimo Zanetti
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
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.
Leox91
Leox91 2016 年 10 月 9 日
Thank you for your help :)

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2016 年 10 月 9 日
You can use ssim(), psnr, or immse():
image2 = imresize(image2, size(image1));
ssimval = ssim(image1, image2);
  3 件のコメント
nor azam
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
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 ExchangeComputer Vision with Simulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by