Skip to main content
. Author manuscript; available in PMC: 2016 Jun 23.
Published in final edited form as: IEEE Int Conf Autom Face Gesture Recognit Workshops. 2015 May;1:10.1109/FG.2015.7163082. doi: 10.1109/FG.2015.7163082

Algorithm 1.

Dyadic Temporal Commonality Discovery

input : A synchronized video pair A, B; minimal discovery length ℓ; commonality period T
output: Optimal intervals r* = [b1, e1, b2, e2]
1 LT + ℓ; // The largest possible searching period
2 Q ← empty priority queue; // Initialize priority queue Q
3 for t ← 0 to (nL) do
4     R ← [1 + t, L + t, 1 + t, L + t]; // Diagonal regions
5     Q.push(bound(R), R); // Fill in Q
6 end
7 R ← Q.pop(); // Initialize R
8 while |R| ≠ 1 do
9     R → R′ U R″; // Split into 2 disjoint sets
10     Q.push(bound(R′), R′); // Push R′ and its bound
11     Q.push(bound(R″), R″); // Push R″ and its bound
12     R ← Q.pop(); // Pop top state from Q
13 end
14 r* ← R; // Retrieve the optimal rectangle