The PSNR & MSE for tow imges?

조회 수: 2 (최근 30일)
Karbala'a Unvi. Science
Karbala'a Unvi. Science 2015년 5월 26일
댓글: Karbala'a Unvi. Science 2015년 5월 27일
Dear Users, I have a problem in finding the PSNR & MSE for tow images that I do a skin detection on the first one and see the PSNR & MSE for them and that is the code that I did; I need the answer for me research clc clear all close all %Find MSE and then you can go for PSNR & SNR. %For the gray image (0 to 255), convert both the image to double. im1 = imread(('D:\ziyad PHD\New Research\1234.jpg')); I = imresize (im1,[256 256] ); I = rgb2gray(I); %figure(1),imshow(I); im2 = imread('D:\ziyad PHD\New Research\12345.jpg'); I2 = imresize (im2,[256 256] ); I2 = rgb2gray(I2); %figure(2),imshow(I2);
[M, N] = size (I); squaredErrorImage = (double(I) - double(I2)) .^ 2; mse = sum(sum(squaredErrorImage)) / (M*N);
PSNR = 10*log(256*256/mse) / log(10); % Alert user of the answer. message = sprintf('The mean square error is %.2f.\nThe PSNR = %.2f', mse, PSNR); msgbox(message);

채택된 답변

Image Analyst
Image Analyst 2015년 5월 27일
What is a "tow" image?
Have you tried the functions psnr() and immse() in the Image Processing Toolbox?
  댓글 수: 1
Karbala'a Unvi. Science
Karbala'a Unvi. Science 2015년 5월 27일
Dear Image Analyst, I am so sorry for the miss spelling that happen due to the computer, I meant "two images" that is all of it thanks again

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

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by