Prev: Reading a 2D array from a mat file in C++
Next: dct2
From: Aditya on 27 Apr 2010 20:29 Hello People! I am doing a project wherein I am comparing edge detector performance for a clean image and a noisy image case. Can anybody help me as to how the PSNR (or SNR) can be used to measure the performance of the edge detected map in the case of clean image and noisy image? Thanks, Aditya
From: hushi10000 on 27 Apr 2010 16:58 what is it [url=http://www.airdow.com/]Air Purifiers[/url] [url=http://www.airdow.com/]Ventilation Systems[/url]
From: ImageAnalyst on 27 Apr 2010 21:39 On Apr 27, 8:29 pm, Aditya <armun...(a)gmail.com> wrote: > Hello People! > > I am doing a project wherein I am comparing edge detector performance > for a clean image and a noisy image case. > Can anybody help me as to how the PSNR (or SNR) can be used to measure > the performance of the edge detected map in the case of clean image > and noisy image? > > Thanks, > Aditya ------------------------------------------------------------------------------------------ I guess you'd calculate your filtered images (two: one from the noise- free image and one from the noisy image), and then calculate PSNR between the two filtered images. Not sure where your confusion lies....seems rather straightforward.
From: Image Analyst on 30 Apr 2010 20:43 I ran across an old PSNR demo I had so I thought I'd post it: % Demo to calculate PSNR of a gray scale image. % http://en.wikipedia.org/wiki/PSNR % by ImageAnalyst clc; close all; clear all; workspace; % Read in standard MATLAB demo image. grayImage = imread('cameraman.tif'); [rows columns] = size(grayImage); subplot(2, 2, 1); imshow(grayImage, []); title('Original Grey Scale Image'); set(gcf, 'Position', get(0,'Screensize')); % Maximize figure. % Add noise to it. noisyImage = imnoise(grayImage, 'gaussian', 0, 0.003); subplot(2, 2, 2); imshow(noisyImage, []); title('Noisy Image'); % Calculate mean square error. mseImage = (double(grayImage) - double(noisyImage)) .^ 2; subplot(2, 2, 3); imshow(mseImage, []); title('MSE Image'); mse = sum(sum(mseImage)) / (rows * columns); % Calculate PSNR (Peak Signal to noise ratio). PSNR = 10 * log10( 256^2 / mse); message = sprintf('The mean square error is %.2f\nThe PSNR = %.2f', ... mse, PSNR); msgbox(message); % set(gcf, 'Position', get(0,'Screensize')); % Maximize figure.
From: Aditya on 7 May 2010 08:43
"Image Analyst" <imageanalyst(a)mailinator.com> wrote in message <hrftep$c58$1(a)fred.mathworks.com>... > I ran across an old PSNR demo I had so I thought I'd post it: > > > % Demo to calculate PSNR of a gray scale image. > % http://en.wikipedia.org/wiki/PSNR > % by ImageAnalyst > clc; > close all; > clear all; > workspace; > % Read in standard MATLAB demo image. > grayImage = imread('cameraman.tif'); > [rows columns] = size(grayImage); > subplot(2, 2, 1); > imshow(grayImage, []); > title('Original Grey Scale Image'); > set(gcf, 'Position', get(0,'Screensize')); % Maximize figure. > % Add noise to it. > noisyImage = imnoise(grayImage, 'gaussian', 0, 0.003); > subplot(2, 2, 2); > imshow(noisyImage, []); > title('Noisy Image'); > > % Calculate mean square error. > mseImage = (double(grayImage) - double(noisyImage)) .^ 2; > subplot(2, 2, 3); > imshow(mseImage, []); > title('MSE Image'); > mse = sum(sum(mseImage)) / (rows * columns); > % Calculate PSNR (Peak Signal to noise ratio). > PSNR = 10 * log10( 256^2 / mse); > message = sprintf('The mean square error is %.2f\nThe PSNR = %.2f', ... > mse, PSNR); > msgbox(message); > % set(gcf, 'Position', get(0,'Screensize')); % Maximize figure. Why have you used 256^2 in the PSNR computation. |