-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_variation_clustering.m
75 lines (54 loc) · 1.49 KB
/
test_variation_clustering.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
clear all
close
clc
%%
load('cluster_new_62_exp_4.mat')
%%
epsilon=linspace(0.001, 0.15,15);%0.1; % min distance between points in meters
MinPts=[3:7];%5 %min size of the cluster
x_index= 16;
y_index=17;
for x_index = 1:26
for y_index = 1:26
clusterdata=clustering(x_index, y_index);
clusters = [clusterdata.clusters(:)];
% .smallest.error]
smallest=[clusters(:).smallest];
error=[smallest(:).error];
error=reshape(error,numel(epsilon),numel(MinPts));
% %
% % surf(MinPts,epsilon,error)
% % colorbar
error_data(x_index,y_index).clustering = min(min(error));
error_data(x_index,y_index).rms = clusterdata.rmsError;
end
end
%% plot ground
figure
subplot(1,2,1)
surf(1:26, 1:26, reshape([error_data.clustering],26,26))
title(['Clustering error ->' num2str(mean([error_data.clustering]))]);
axis square
colorbar
caxis([0 0.15])
% hold on
subplot(1,2,2)
surf(1:26, 1:26, reshape([error_data.rms],26,26))
title(['RMS error ->' num2str(mean([error_data.rms]))])
axis square
colorbar
caxis([0 0.15])
%% plot single spot variation
figure
clusterdata=clustering( 20,20);
clusters = [clusterdata.clusters(:)];
% .smallest.error]
smallest=[clusters(:).smallest];
error=[smallest(:).error];
error=reshape(error,numel(epsilon),numel(MinPts));
surf(MinPts,epsilon,error)
xlabel('minPts')
ylabel('\epsilon (m)')
zlabel('Error(m)')
title('Error variation with \epsilon and \it{minPts} on x=3.36m, y=3.36m')
colorbar