-
Notifications
You must be signed in to change notification settings - Fork 0
/
run1.m
70 lines (55 loc) · 1.34 KB
/
run1.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
clc
clear
n_frame=32;
points=cell(n_frame,1);
%hold on
ex=[15,18];
for i=1:n_frame
if i<100
if i<10
a=['00' num2str(i)];
else
a=['0' num2str(i)];
end
else
a=num2str(i);
end
filename=['images2\t' a '.tif'];
I=imread(filename);
centroids=Extract_centroid2(I);
i=i
disp(size(centroids))
plot(centroids(:,1), centroids(:,2), '.')
set(gca, 'YDir','reverse')
axis([0 1024 0 1024])
points{i}=centroids;
end
%hold off
debug = false;
[ tracks, adjacency_tracks ] = Tracking(points,...
'Debug', debug);
%plot points
figure(21)
clf
hold on
for i_frame = 1 : n_frame
str = num2str(i_frame);
for j_point = 1 : size(points{i_frame}, 1)
pos = points{i_frame}(j_point, :);
plot(pos(1), pos(2), 'o')
set(gca, 'YDir','reverse')
text('Position', pos, 'String', str)
end
end
%plot track
n_tracks = numel(tracks);
colors = hsv(n_tracks);
all_points = vertcat(points{:});
for i_track = 1 : n_tracks
% We use the adjacency tracks to retrieve the points coordinates. It
% saves us a loop.
track = adjacency_tracks{i_track};
track_points = all_points(track, :);
plot(track_points(:,1), track_points(:, 2), 'Color', colors(i_track, :))
set(gca, 'YDir','reverse')
end