forked from simbamford/AedatTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestTrackPlanes.py
50 lines (40 loc) · 1.22 KB
/
testTrackPlanes.py
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
from PyAedatTools import ImportAedat
from PyAedatTools import OpticalFlowPlayback
from math import pi
# Create a dict with which to pass in the input parameters.
aedat = {}
aedat['importParams'] = {}
filename = "IMU_translBoxes.aedat"
aedat['importParams']['filePath'] = "./example_data/"+filename
# Invoke the function
aedat = ImportAedat.ImportAedat(aedat)
# create data structure to give to eventPlayback module
polarityData = aedat['data']['polarity']
eventData = {
'timeStamp': polarityData['timeStamp'], # time is in microseconds
'x': polarityData['x'],
'y': polarityData['y'],
'polarity': polarityData['polarity'],
'numEvents': polarityData['numEvents']
}
eventPlaybackArgs = {
'caption': "Optical Flow Analysis",
'width': 250,
'height': 190,
'playbackSpeed': 0.1,
'fadeRate': 10,
'frameStep': 30
}
flowGeneratorArgs = {
'projRes': 5,
'projAng': pi,
'maxConvergenceThreshold': 10000,
'eventAssociationThreshold': 1,
'numSuccessiveProjections': 2,
'projResTrackPlane': 3,
'projAngTrackPlane': pi/8,
'newCellThreshold': 100,
'pixelLifetime': 3
}
# playback the event data
OpticalFlowPlayback.playOpticalFlow(eventData, eventPlaybackArgs, flowGeneratorArgs)