Scene Graph Construction
Algorithm: Scene graph construction
Input: A pre-processed video scene (objects are identified,
object positions, pointsets and projections
are available for each frame)
Output: A scene graph S(M,R) representing the scene
begin
(1) M = { }; R = { };
(2) for each frame F do
(3) t = time of frame F relative to start of scene
(4) for each object X in F do
(5) if X is not already in M then
(6) include new object descriptor (X,[]) in M
(7) else
(8) compute (d,r,I) from current and previous positions
(9) append (d,r,I) to track for X
(10) endif
(11) save current position as previous
(12) for each object Y greater than X in F do
(13) compute current Rst(X,Y)
(14) if there is no edge for (X,Y) in R then
(15) include new edge (X,Y,[]) in R
(16) save current Rst(X,Y) as existing Rst(X,Y)
(17) set time for startOfRst(X,Y) to t
(18) else
(19) if F is the last frame or
current Rst(X,Y) is different to existing Rst(X,Y) then
(20) compute (t,xp,yp,I) based on existing Rst(X,Y)
and interval from startOfRst(X,Y) until t
(21) append (t,xp,yp,I) to TS-2D-PIR for edge (X,Y)
(22) save current Rst(X,Y) as existing Rst(X,Y)
(23) set time for startOfRst(X,Y) to t
(24) endif
(25) endif
(26) endfor
(27) endfor
(28) endfor
end.
|