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
16 Segmentation can done using either thresholding or background subtraction.
18 The "sole" assumptions for a decent effect are that:
20 1. the camera does not move;
21 2. the background lighting in the scene is quite stable (when doing
22 background subtraction it is recommended to disable auto-gain in the
23 camera, and avoiding any artifact introduced by the power line
30 The effect in "Blame It On The Boogie" could be described as a short faded
31 trail and can be achieved with this command line:
33 $ ./opencv_trail_effect -l 12 -s background -d fadeaccumulate
36 The effect in "WTF?" is equivalent to an infinite trail in which the isolated
37 foreground is copied on the background and stays there, it can be achieved
38 with this command line:
40 $ ./opencv_trail_effect -l -1 -s background -d copy
43 The effect in "L'Anima Vola" seems to have a "catch-up" behavior; that one can
44 be done by drawing the trail in reverse, with this command line:
46 $ ./opencv_trail_effect -l 30 -s background -d copy -r
49 Another effect seen in movies can be obtained by doing the average of the
50 frames in the trail, possibly with the most recent frame drawn on top:
52 $ ./opencv_trail_effect -l 10 -s background -d average -B
58 These effects can bring to mind other cool effects in music videos, like the
59 frame shuffling effect in Peter Gabriel's Sledgehammer
60 (https://www.youtube.com/watch?v=OJWJE0x7T4Q), that one can be done with the
61 nervousTV plugin from effectv
62 (https://fukuchi.org/research/effectv/index.html.en) or frei0r filters
63 (https://www.dyne.org/software/frei0r/), for example with:
65 $ gst-launch-1.0 -v v4l2src ! videoconvert ! frei0r-filter-nervous ! videoconvert ! autovideosink