forked from DeNardoLab/BehaviorDEPOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotPointTracking.m
28 lines (22 loc) · 912 Bytes
/
plotPointTracking.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
%plotPointTracking
%INPUT: Tracking, Params, frame, frame index
%OUTPUT: Behavior.Freezing structure
%FUNCTION: calculate the freezing frames via transformation of data from
%the Metrics structure and save into Behavior structure
% Future: Calculate average velocity of body; test in place of
% RearBackVelocity
function pointValidation = plotPointTracking(Tracking, Params, frame, frame_idx)
% visual verification of point tracking and body part indexing
part_names = Params.part_names;
leg = {};
figure('Name','Example point alignment and body part indexing');
imshow(frame);
hold on;
for i = 1:length(part_names)
i_part = string(part_names{i});
plot(Tracking.Smooth.(i_part)(1,frame_idx), Tracking.Smooth.(i_part)(2,frame_idx),'o', 'MarkerSize', 5, 'LineWidth', 2);
leg{i} = i_part;
end
legend(string(leg));
pointValidation = gcf;
end