forked from ShurenQi/FGPCET
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.m
36 lines (36 loc) · 836 Bytes
/
main.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
close all;
clear all;
clc;
warning('off');
addpath(genpath(pwd));
%% INPUT
I=imread('lena.tif');
%% MODE
K = input('Please enter the maximum order K (K>=0): ');
disp('Parameter Setting: s>0;');
disp('e.g.');
disp('- EFM: s=1;');
disp('- PCET: s=2;');
S = input('s=');
[SZ,~]=size(I);
M=10*SZ;
%% COMPUTE
if K>=0 && S>0
[I,It,L,DT,RT]=FGPCET(I,K,S,M);
else
disp('Error!');
return;
end
%% OUTPUT
figure;
subplot(121);
imshow(uint8(abs(I)));
title('Original');
subplot(122);
imshow(uint8(abs(It)));
different_a = (abs(abs( double(abs(It))-double(I)))).^2;
different_b = (double(I)).^2;
MSRE = sum(different_a(:))/sum(different_b(:));
clc;
disp(table([S;K;L;DT;RT;MSRE],'RowNames',{'S';'K';'L';'DT';'RT';'MSRE'},'VariableNames',{'Value'}));
title({'Reconstructed'; ['K=',num2str(K),' L=',num2str(L),' MSRE=',num2str(MSRE)]});