验证BM3D算法效果(matlab)

来源:互联网 发布:c语言 外部接口 编辑:程序博客网 时间:2024/06/10 00:22

% author: zhangduokun

% 2012-12-18

clc;

clear;

clear all;

close all;

I = imread('house.png');

y = im2double(I);

randn('seed', 0);

sigma = 10;

z = y + (sigma/255)*randn(size(I));

% Denoise 'z'. The denoised image is 'y_est', and 'NA = 1' because

%  the true image was not provided

tic;

[NA, y_est] = BM3D(1, z, sigma);

elapsed_time = toc

% Compute the putput PSNR

PSNR = 10*log10(1/mean((y(:)-y_est(:)).^2))

% show the noisy image 'z' and the denoised 'y_est'

figure; imshow(z);  

figure; imshow(y_est);

% [PSNR,I2] = BM3D(1,im2double(I),10);

% imshow(I2);

imwrite(y_est,'housedenosed.png');

原创粉丝点击