-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunc_plot_dogs.m
44 lines (40 loc) · 1.39 KB
/
func_plot_dogs.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
function [fig] = func_plot_dogs(base_sigma, s, dogs)
%NOT PART OF SIFT
fig = figure('position', [0, 0, 1700, 1000]);
hold on;
colormap("gray");
[n_octaves, n_dogs] = size(dogs);
n_scales = n_dogs + 1;
for j = 1:n_octaves
subplot(1, n_octaves, j);
H = [];
for i = 1:n_dogs
% normalize the DoG value range.
curr_img = dogs{j, i};
curr_img = curr_img - min(curr_img, [], "all");
curr_img = curr_img / max(curr_img, [], "all");
cmax = max(curr_img, [], "all");
cmin = min(curr_img, [], "all");
H(i) = slice(repmat(curr_img, [1 1 (i+1)*5]),[],[], i*5);
set(H(i), 'EdgeColor', 'none');
hold on;
end
hold off;
axis ij
zticks(linspace(5, n_scales*5, n_scales));
scale_lables = [];
for i = 1:n_scales
if i==1
curr_octave_scale = 2^(j-1);
scale_lables = [(string(curr_octave_scale) + '\sigma_{base} = ' + string(base_sigma*curr_octave_scale))];
else
effective_scale = round((curr_octave_scale)*base_sigma*2^((i-1)/s), 2);
scale_lables = [scale_lables (string(effective_scale))];
end
end
zticklabels(scale_lables);
zlabel("\sigma");
title("DoG " + j);
view(45, 20);
end
end