MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / Track

Class Track

src/main/java/trace/util/PersonDetector.kt:19–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17 }
18
19 inner class Track {
20 val x0 = TCB3()
21 val y0 = TCB3()
22 val x1 = TCB3()
23 val y1 = TCB3()
24
25 val frames = mutableListOf<Frame>()
26
27 var lostFor = 0;
28 var seen = false;
29
30 var name = "";
31
32 fun startTime(): Double {
33 return x0.n[0].x / duration()
34 }
35
36 fun endTime(): Double {
37 return x0.n.last().x / duration()
38 }
39
40 fun rectAtTime(t: Double): Rect {
41 val ax0 = x0.evaluate(t * duration(), Vec3()).x
42 val ax1 = x1.evaluate(t * duration(), Vec3()).x
43 val ay0 = y0.evaluate(t * duration(), Vec3()).x
44 val ay1 = y1.evaluate(t * duration(), Vec3()).x
45
46 return Rect(100 * Math.min(ax0, ax1),
47 100 * Math.min(ay0, ay1),
48 100 * (Math.max(ax0, ax1) - Math.min(ax0, ax1)),
49 100 * (Math.max(ay0, ay1) - Math.min(ay0, ay1)))
50 }
51 }
52
53 val frames = mutableListOf<Frame>()
54 val tracks = mutableListOf<Track>()

Callers 1

PersonDetectorClass · 0.70

Calls 1

TCB3Class · 0.85

Tested by

no test coverage detected