-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDemo_TV.m
39 lines (35 loc) · 931 Bytes
/
Demo_TV.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
clear all
% close all
clc
noisy1 = 255 * im2double(imread('245.tif')) ;
noisy1 = noisy1(:,:,1);
% noisy1 = imresize(noisy1,[452,452]);
addpath(genpath('TVGP.v2.0'))
%%
verbose = 0;
GapTol = 10.^-3;
NIT = 1000;
lbd = 0.05;
[M,N] = size(noisy1);
[u, w1, w2, Energy, Dgap, TimeCost, itr] = ...
TV_PDHG(zeros(M,N),zeros(M,N),double(noisy1),lbd,NIT,GapTol,verbose);
figure;
subplot(221); imshow(noisy1,[]);
subplot(222);imshow(u,[]);
% title('denoising using TV-PDHG');
noisy1 = 255 * im2double(imread('Picture3.tif')) ;
noisy1 = noisy1(:,:,1);
% noisy1 = imresize(noisy1,[452,452]);
addpath(genpath('TVGP.v2.0'))
%%
verbose = 0;
GapTol = 10.^-3;
NIT = 1000;
lbd = 0.05;
[M,N] = size(noisy1);
[u, w1, w2, Energy, Dgap, TimeCost, itr] = ...
TV_PDHG(zeros(M,N),zeros(M,N),double(noisy1),lbd,NIT,GapTol,verbose);
% figure;
subplot(223); imshow(noisy1,[]);
subplot(224);imshow(u,[]);
% title('denoising using TV-PDHG');