-
Notifications
You must be signed in to change notification settings - Fork 11
7 ‐ The Effects of Filtering
Balint Laczko edited this page Sep 9, 2021
·
6 revisions
When working with the motion
method, there is an option to filter the video frames after calculating the absolute difference between subsequent frames. Finding the right thresh
old value is crucial for accurate motion extraction. Let's see a few examples.
Here is an example of extracting the motion without any threshold. This will result in a result in which much of the background noise will be visible, including traces of keyframes if the video file has been compressed.
source = musicalgestures.MgObject('/path/to/source/video.avi', starttime=5, endtime=10, skip=0, contrast=100, brightness=20)
motiongrams = source.motiongrams(thresh=0.0)
Vertical (upper) and horizontal (lower) motiongrams, no threshold filter |
Adding just a little bit of thresholding (0.02 here) will drastically improve the final result.
Vertical (upper) and horizontal (lower) motiongrams, 2% threshold filter |
A project from the fourMs Lab, RITMO Centre for Interdisciplinary Studies in Rhythm, Time and Motion, Department of Musicology, University of Oslo.