1 opencv_trail_effect is an experiment about recreating the "trail effect"[1],
2 which can be seen in some cool music videos, automatically and in real-time,
3 and even without the use of a green-screen.
5 [1] http://dailypsychedelicvideo.com/tag/trail-effect/
7 Some examples of it are:
9 The Jacksons - Blame It On The Boogie - https://www.youtube.com/watch?v=mkBS4zUjJZo
10 OK Go - WTF? - https://www.youtube.com/watch?v=12zJw9varYE
11 Elisa - L'Anima Vola - https://www.youtube.com/watch?v=MqhxIQD16EA
13 opencv_trail_effect draws a trail after performing foreground segmentation
14 (using thresholding or background subtraction) using OpenCV.
16 The "sole" assumptions for a decent effect are that:
18 1. the camera does not move;
19 2. the background lighting in the scene is quite stable (when doing
20 background subtraction it is recommended to disable auto-gain in the
21 camera, and avoiding any artifact introduced by the power line
28 The effect in "Blame It On The Boogie" could be described as a short faded
29 trail and can be achieved with this command line:
31 $ ./opencv_trail_effect -l 12 -s background -d fadeaccumulate
34 The effect in "WTF?" is equivalent to an infinite trail in which the isolated
35 foreground is copied on the background and stays there, it can be achieved
36 with this command line:
38 $ ./opencv_trail_effect -l -1 -s background -d copy
41 The effect in "L'Anima Vola" seems to have a "catch-up" behavior; that one can
42 be done by drawing the trail in reverse, with this command line:
44 $ ./opencv_trail_effect -l 30 -s background -d copy -r
47 Another effect seen in movies can be obtained by doing the average of the
48 frames in the trail, possibly with the most recent frame drawn on top:
50 $ ./opencv_trail_effect -l 10 -s background -d average -B
56 These effects can bring to mind other cool effects in music videos, like the
57 frame shuffling effect in Peter Gabriel's Sledgehammer
58 (https://www.youtube.com/watch?v=OJWJE0x7T4Q), that one can be done with the
59 nervousTV plugin from effectv
60 (https://fukuchi.org/research/effectv/index.html.en) or frei0r filters
61 (https://www.dyne.org/software/frei0r/), for example with:
63 $ gst-launch-1.0 -v v4l2src ! videoconvert ! frei0r-filter-nervous ! videoconvert ! autovideosink