Is it possible perform RMSE and SSIM in different size image?

조회 수: 3 (최근 30일)
Diah Junaidi
Diah Junaidi 2019년 7월 31일
댓글: Diah Junaidi 2019년 8월 1일
Hi, I wanna obtain RMSE and SSIM in different size image cause the images I used cannot be equalized in size. I attached those images.

채택된 답변

Walter Roberson
Walter Roberson 2019년 7월 31일
No, those measurements cannot be computed for images that are different sizes.
You would want to trim out the irrelevant borders and then imresize to have them match sizes. It might make sense to resize to a consistent size rather than to the larger or smaller size.
  댓글 수: 12
Walter Roberson
Walter Roberson 2019년 8월 1일
pix_used = any(YourImage,3);
col_used = any(pix_used,1);
row_used = any(pix_used,2);
first_col = find(col_used,1);
last_col = find(col_used,1,'last');
first_row = find(row_used,1);
last_row = find(row_used,1,'last');
cropped_image = YourImage(first_row:last_row, first_col:last_col,:);
Diah Junaidi
Diah Junaidi 2019년 8월 1일
Got this problem:
Index exceeds matrix dimensions.
Error in cobaRMSE (line 26)
cropped_imageB = A(first_rowB:last_rowB, first_colB:last_colB,:);
close
A=imread('D:\DIAH\[MATLAB]cv1-fingerspelling-recognition-master\cv1-fingerspelling-recognition-master\Hasil Percobaan Standard\1.jpg');
B=imread('D:\DIAH\[MATLAB]cv1-fingerspelling-recognition-master\cv1-fingerspelling-recognition-master\Hasil Percobaan HSV\1\Hasil Citra HSV_1a.jpg');
pix_used = any(A,3);
col_used = any(pix_used,1);
row_used = any(pix_used,2);
first_col = find(col_used,1);
last_col = find(col_used,1,'last');
first_row = find(row_used,1);
last_row = find(row_used,1,'last');
cropped_image = A(first_row:last_row, first_col:last_col,:);
pix_usedB = any(B,3);
col_usedB = any(pix_usedB,1);
row_usedB = any(pix_usedB,2);
first_colB = find(col_usedB,1);
last_colB = find(col_usedB,1,'last');
first_rowB = find(row_usedB,1);
last_rowB = find(row_usedB,1,'last');
cropped_imageB = B(first_rowB:last_rowB, first_colB:last_colB,:);
figure,
imshowpair(cropped_image,cropped_imageB)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by