-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathresult_display.m
43 lines (40 loc) · 1015 Bytes
/
result_display.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
40
41
42
43
clear;clc;close all;
addpath(genpath('src'));
%% pick dataset type
dataset='samson';
display_if=true;
switch dataset
case 'samson'
load samson_cycunet_result.mat
col=95;p=3;L=156;N=col*col;
case 'jasper'
load jasper_cycunet_result.mat
col=100;p=4;L=198;N=col*col;
end
%%
A=reshape(double(A),p,col*col);
abu_est=reshape(double(abu_est),p,col*col);
Y=reshape(double(Y),L,col*col);
M_est=EndmemberEst(Y,abu_est,300); % estimate endmembers by ||X-MA||, when A is given.
%% Evalution metrics
rmse=sqrt(sum(sum((A-abu_est).^2))/(p*col*col))
[SAD,SADerr] = SadEval(M_est,M)
%% Estimate Abundance
if display_if
figure
abu_cube=reshape(abu_est',col,col,p);
for i=1:p
subplot(2,p,i)
imagesc(abu_cube(:,:,i)');axis off;
end
colormap(jet);
end
%% GT
if display_if
gt=reshape(A',col,col,p);
for i=1:p
subplot(2,p,i+p)
imagesc(gt(:,:,i)');axis off
end
colormap(jet);
end