Next Generation Tracking¶
The current hard-coded filter graph implementation could be superseded by an xml-based implementation.
Enables:
- Multi-camera support
- Better camera calibration (OpenCV)
- Easier configuration
Interface:
Single camera filter graph:¶
1<tracker>
2 <camera id="cam1" [...]/>
3 <imagine inputs="cam1">
4 <histogram id="hist" inputid="cam1" stride="3"/>
5 <mask id="mask" inputid="camera" href="camera_mask.png"/>
6 <distort id="distort" inputid="mask"
7 distortionparams="(0.69, 0)"
8 trapezoid="0.151537"
9 angle=""
10 [...]/>
11 <crop id="crop" inputid="distort"
12 displaydisplacement="(-174.966, -145.974)"
13 displayscale="(2.52, 2.55)"/>
14 <historysubtract id="nohistory" inputid="crop"
15 updateinterval="25"
16 brighterregions="True"/>
17 <bandpass id="bandpass" inputid="nohistory"
18 range="(1.6, 2.4)"
19 postmult="30.0"/>
20 </imagine>
21 <blobs id="touchblobs" inputid="bandpass"
22 threshold="148"
23 similarity="50"
24 areabounds="(16, 200000)"
25 eccentricitybounds="(1, 80)"/>
26 <blobs id="trackblobs" inputid="nohistory"
27 threshold="16"
28 similarity="100"
29 areabounds="(700, 200000)"
30 eccentricitybounds="(1, 80)"/>
31</tracker>
- Multi-camera filter graph:
- Need to refactor pos/scale logic: Use normalized intermediate coordinates (0,0)-(1,1).
- Graph stays mostly the same, is executed once per camera. Per-camera data:
- camera id
- distortion, position, crop params
- Idea for graph:
1<tracker>
2 <camera id="cam1" pos="(0,0)" size="(640, 480)"
3 distortionparams="(0.69, 0)"
4 trapezoid="..."
5 [...]/>
6 <camera id="cam2" [...]/>
7 <camera id="cam3" [...]/>
8 <imagine>
9 [... as above, variable params are empty ...]
10 </imagine>
11 <blobs
12 [...]
13 />
14</tracker>
Implementation:
- Filter graph (xml repr, but no python interface)
- Seamless cpu/gpu transition or
- Implementation of distort, crop, historysubtract, histogram as gpu filters.
- Single camera:
- Call filter graph in C++
- Adapt calibration to new filter graph
- Refactor TrackerConfig
- Multi-camera support:
- Refactor pos/scale logic
- Multi-Camera calibration
- Custom synchronous filter graph during calibration
- Logic for per-camera data.
- New blob correlation step after blob finding