MetricMeasurement calculates Peak Signal-to-Noise Ratio
function [M_SE PSNR] = MetricsMeasurement(Orig_Image,Esti_Image)
% This function MetricMeasurement calculates Peak Signal-to-Noise Ratio and
% Mean-Square Error
%
% INPUTS: Orig_Image = Original Image
% Esti_Image = Estimation of the original image obtained from a
% noisy image after filtering it.
% OUTPUT:
% Mean-Square Error (M_SE)
% Peak Signal-to-Noise Ratio (PSNR)
%---Checking Input Arguments
if nargin<1||isempty(Esti_Image), error('Input Argument: Estiamted Image Missing');end
%---Implentation starts here
if (size(Orig_Image)~= size(Esti_Image)) %---Check images size
error('Input images should be of same size');
else
%---Mean-Square Error(MSE) Calculation
Orig_Image = im2double(Orig_Image);%---Convert image to double class
Esti_Image = im2double(Esti_Image);%---Convert image to double class
[M N] = size(Orig_Image);%---Size of Original Image
diff = Orig_Image - Esti_Image;%---Difference between two images
M_SE = (sum(sum(diff .* diff)))/(M * N);
%---Peak Signal-to-Noise Ratio(PSNR) Calculation
if(M_SE > 0)
PSNR = 10*log10(255*255/M_SE);
else
PSNR = 99;
end
end
相關文章
- Cursor Cache Hit Ratio超過100%
- 162. Find Peak Element
- [LeetCode] 852. Peak Index in a Mountain ArrayLeetCodeIndexAI
- 《Toon Blast》發行商Peak Games總收入突破10億美元ASTGAM
- 廣域網之爭:思科捲土重來,Silver Peak被收購
- 3peak思瑞浦主要產品類別以及技術特點
- 3peak最新物料交期和選型彙總表(2024年12月)
- R plot 柵格地圖時 設定 asp引數代表"寬高比"(Aspect Ratio) 畫素大小地圖
- 雲遊戲+ AI +直播,《Rival Peak》是否會成為未來遊戲的雛形?遊戲AI
- SAP UI5 Responsive Grid Layout 裡的 Label-Field Ratio 在螢幕型別 S 下的表現UI型別
- 價值18億美元的“翻身仗”,Zynga確認收購擁有千萬日活的Peak
- CHIP-seq流程學習筆記(8)-使用MACS2 bdgdiff提取差異peak進行註釋筆記Mac
- 基於3peak 17串AFE晶片TPB76016-QP3R的電池BMS控制板方案晶片
- ICEE-Power-SCR-OptoisolaterDriver-MOC Series-MOC3081/2/3: 6-Pin DIP Zero-Cross TriacDriver Optocoupler (800 V Peak)ROS