-
Notifications
You must be signed in to change notification settings - Fork 0
/
getLabelEachFrame.m
28 lines (20 loc) · 923 Bytes
/
getLabelEachFrame.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
function [Lateral_allFrames, Bottom_allFrames] = getLabelEachFrame(fPath, mousename)
lateral_path = [fPath 'Lateral\'];
bottom_path = [fPath 'Bottom\'];
lateral_videos = dir([lateral_path mousename '_SpatialDisc_*.csv']);
num_lateral_videos = size(lateral_videos,1);
bottom_videos = dir([bottom_path mousename '_SpatialDisc_*.csv']);
num_bottom_videos = size(bottom_videos,1);
if num_lateral_videos ~= num_bottom_videos
fprintf(2, 'Lateral and bottom cameras have different video numbers!! \n');
return;
end
Lateral_allFrames = {};
Bottom_allFrames = {};
for a = 1 : num_lateral_videos
Lateral_allFrames.frames{a} = ImportDLC_Lateral([lateral_path lateral_videos(a).name], 4, inf);
Bottom_allFrames.frames{a} = ImportDLC_Bottom([bottom_path bottom_videos(a).name], 4, inf);
Lateral_allFrames.filename{a} = lateral_videos(a).name;
Bottom_allFrames.filename{a} = bottom_videos(a).name;
end
end