-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_Calgary.asv
78 lines (50 loc) · 2.3 KB
/
run_Calgary.asv
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
75
76
77
78
close all
clear all
restoredefaultpath
fullPath = mfilename('fullpath');
repoPath = p(1:end-12)
basePath = 'D:\Dropbox\ResearchProjects\OpticFlowProject\Data';
addpath(genpath('D:\Dropbox\ResearchProjects\toolboxes')); %add necessary toolboxes to path
addpath(genpath(repoPath))
%%
%%
numSubs = 1;
numConds = 1;
for subNum = 1;%1:4
switch subNum
case 1
sessionID = '2019-05-29_CalgaryWorkshopData';
end
for condNum = 1;%1:numConds
switch condNum
case 1
takeID = 'Frisbee';
end
sessionPath = [basePath filesep sessionID];
useEye = [1;1]; %use both eyes [true; true;] or just one? [false; true] or [true; false]
sessionFunction = @loadSessionInfo_Calgary; %name of the loadSessionInfo file we're going to use
% process data
sesh = sessionFunction(sessionID,takeID); %'sesh' is a struct with a bunch of information needed for the rest of the code (i.e. what were the calibration/walk frames, etc)
processData(sessionID,takeID,sessionPath,useEye,sesh);
% walks and walk_names are necessary for splitWalks
walks = sesh.walks;
walk_names = repmat({takeID},size(walks,1),1);
% walk_names{end+1} = 'vor';
splitWalks(sessionPath,takeID,walks,walk_names);
%% LASER SKELETON!!!!
%%add paths to mexopencv
assert(exist('C:/dev/mexopencv', 'dir')==7, 'Laser skeletons require MexOpenCV to function :`(')
addpath('C:/dev/mexopencv')
addpath('C:/dev/mexopencv/opencv_contrib/')
%load camera parameters
camParamPath = [repoPath filesep 'laserSkeletonCode' filesep 'camParam1080_20180626.mat'];
load(camParamPath);
camParams = cameraParams1080_2;
%load allWalks cell array (from 'splitWalks.m')
allWalksPath =[sessionPath filesep 'OutputFiles' filesep takeID '_allWalks.mat'];
load(allWalksPath)
walkNum = 2; %which walk to play
w = allWalks{walkNum}; %'w' is a struct that contains all data relevant to walk#walkNum
playLaserSkeleton(w,camParams,basePath)
end%numConds
end%numSubs