how can i calculate MSE and PSNR of RGB color image

22 ビュー (過去 30 日間)
shameen khan
shameen khan 2015 年 5 月 21 日
コメント済み: Walter Roberson 2020 年 7 月 17 日
i embeded a watermark in RGB color image now i want to calculate PSNR and MSE of original and watermarked images . how can i find PSNR and MSE of original and watermarked images
  2 件のコメント
Aniket Paranjpe
Aniket Paranjpe 2017 年 12 月 19 日
How to compute three PSNR Values , one for each channel?
siva shangari
siva shangari 2020 年 7 月 16 日
how to compute mean and variance for each channel?

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

採用された回答

B.k Sumedha
B.k Sumedha 2015 年 5 月 21 日
編集済み: B.k Sumedha 2015 年 6 月 16 日
clc;
[filename1,pathname]=uigetfile('*.*','Select the original image');
image1=imread(num2str(filename1));
[filename2,pathname]=uigetfile('*.*','Select the watermarked image');
image2=imread(num2str(filename2));
figure(1);
imshow(image1); title('Original image');
figure(2);
imshow(image2); title('Watermarked image');
[row,col] = size(image1)
size_host = row*col;
o_double = double(image1);
w_double = double(image2);
s=0;
for j = 1:size_host; % the size of the original image
s = s+(w_double(j) - o_double(j))^2 ;
end
mes=s/size_host;
psnr =10*log10((255)^2/mes);
display 'Value of',psnr
  12 件のコメント
siva shangari
siva shangari 2020 年 7 月 16 日
@Image Analyst... how to compute mean and variance for each channel?
Walter Roberson
Walter Roberson 2020 年 7 月 17 日
mean(YourSignal,2) %mean over columns
var(YourSignal, [], 2) %variance over columns
If "channel" means color pane in this case, then
mean(YourSignal, [1 2])
var(YourSignal, [], [1 2])

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by