HOW TO ADD MSE TO EXISTING TOOL (CODE)?

1 view (last 30 days)
rena m
rena m on 25 May 2022
Edited: DGM on 11 Jun 2022
I have discovered the PVD Steganography tool from Github. the code only provide psnr calculation but i want to add mse and only get error. How i do so and code is connected to GUI. Thank you.
-CODE LINK FOR PSNR-
-CODE FOR PVD TOOL-

Accepted Answer

DGM
DGM on 25 May 2022
Use immse()
A = imread('peppers.png'); % some reference image
B = imnoise(A,'gaussian',0.001); % a modified copy
immse(A,B) % the MSE
ans = 584.7149
  3 Comments
DGM
DGM on 11 Jun 2022
Edited: DGM on 11 Jun 2022
The MSE is the mean of the square of a difference. If both images have a nominal range of [0 k], then the MSE will have a nominal range of [0 k^2].
If you expect that the nominal range of MSE is [0 1], then that implies that you expect your images to both have the same nominal range of [0 1].
A = imread('peppers.png'); % some reference image
B = imnoise(A,'gaussian',0.001); % a modified copy
% these images are both in the range [0 255]
err1 = immse(A,B) % the MSE
err1 = 583.8506
% if the images were both in the range of [0 1]
% this is what you'd get:
err2 = immse(im2double(A),im2double(B))
err2 = 0.0090
% which is the same as
err1/(255^2)
ans = 0.0090

Sign in to comment.

More Answers (0)

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!