I wanna perform RMSE & SSIM but I cannot set same size of 2 image. Need your help :(
2 ビュー (過去 30 日間)
古いコメントを表示
I wanna calculate RMSE and SSIM in these 2 images (I attached them):
I have no idea what should I do again to force them into same size.... I already perform imresize, size, and even row col set condition.... PLEASE HELP ME :(
A=imread('D:\DIAH\[MATLAB]cv1-fingerspelling-recognition-master\cv1-fingerspelling-recognition-master\Hasil Percobaan Standard\Hasil Citra Ground Truth_1_1.jpg');
% resize1= imresize(citraReferensi,[256 360], 'bilinear');
B=imread('D:\DIAH\[MATLAB]cv1-fingerspelling-recognition-master\cv1-fingerspelling-recognition-master\Hasil Percobaan HSV\png2jpg\Hasil Citra HSV_1a.jpg');
% resize2= imresize(citraEnhance,[256 360], 'bilinear');
% rmse = sqrt(immse(B, A));
% [ssimval, ssimmap] = ssim(resize2,resize1);
% fprintf('The SSIM value is %0.4f.\n',ssimval);
% fprintf('The RMSE value is %0.4f.\n',rmse);
figure,
imshowpair(A,B)
dimensi1=size(resize1);
dimensi2=size(resize2);
% fprintf('Dimension1 value is %0.4f.\n',dimensi1);
% fprintf('Dimension2 value is %0.4f.\n',dimensi2)B;
% Get size of existing image A.
[rowsA, colsA, numberOfColorChannelsA] = size(A);
% Get size of existing image B.
[rowsB, colsB, numberOfColorChannelsB] = size(B);
% See if lateral sizes match.
if rowsB ~= rowsA || colsA ~= colsB
% Size of B does not match A, so resize B to match A's size.
B = imresize(B, [rowsA colsA]);
end
Below is the result of the code:
3 件のコメント
回答 (1 件)
KSSV
2019 年 7 月 29 日
A=imread('Hasil Citra Ground Truth_1_1.jpg');
% resize1= imresize(citraReferensi,[256 360], 'bilinear');
B=imread('Hasil Citra HSV_1a.jpg');
B = rgb2gray(B) ;
% resize2= imresize(citraEnhance,[256 360], 'bilinear');
% rmse = sqrt(immse(B, A));
% [ssimval, ssimmap] = ssim(resize2,resize1);
% fprintf('The SSIM value is %0.4f.\n',ssimval);
% fprintf('The RMSE value is %0.4f.\n',rmse);
figure,
imshowpair(A,B)
[nx1,ny1] = size(A) ;
[nx2,ny2] = size(B) ;
nx = max(nx1,nx2) ; ny = max(ny1,ny2) ;
A = imresize(A,[nx,ny]) ;
B = imresize(B,[nx,ny]) ;
figure
imshowpair(A,B)
3 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!