VideoMagnification - Magnify motions and detect heartbeats
This application allows you to magnify motion and detect heartbeats from videos and webcam video streams. It is an implementation of Hao-Yu Wu, Michael Rubinstein, Eugene Shih, John Guttag, Frédo Durand, William T. Freeman: Eulerian Video Magnification for Revealing Subtle Changes in the World in C++11. It utilizes OpenCV 3.1 and QT 5.
The application supports video input from either a live webcam stream or a video file in any format OpenCV supports on your machine:
It allows you to magnify the video while adjusting all parameters described in the paper:
Furthermore, it can display time and frequency plots of the current signal and extract a heartbeat value:
You need a compiler that supports both C++11 and OpenMP. CMake version 3.1 or higher is also required.
Furthermore, this application depends on the following libraries:
Some additional notes if you are using Ubuntu:
sudo sed -i "s/<QtPrintSupport>/<QtPrintSupport\/QtPrintSupport>/" /usr/include/qcustomplot.h
after you installed the package from universe.This application was developed on Arch Linux and tested on Arch Linux as well as Ubuntu 15.10 (However, as this project does not use any Linux-exclusive libraries, it should also work on Windows and Mac OSX)
/opt/opencv
(or any other path, but be sure to set this path in the project’s CMakeLists.txt):
git clone https://github.com/itseez/opencv
cd opencv
git checkout 3.1.0
mkdir build && cd build
sed -i "s/\(OCV_OPTION(WITH_GTK .*$\)/OCV_OPTION(WITH_GTK \"Include GTK support\" OFF)/" ../CMakeLists.txt
cmake ..
make -j8
sudo make install DESTDIR=/opt/opencv
Install QT5: sudo apt install qt5-default
on Ubuntu or sudo pacman -S qt5-base
on Arch Linux
Install QCustomPlot: sudo apt install libqcustomplot-dev
on Ubuntu from universe or qcustomplot-qt5
from the AUR on Arch Linux
Install FFTW3: sudo apt install libfftw3-dev
on Ubuntu or sudo pacman -S fftw
on Arch Linux
Set this line in CMakeLists.txt to the path you installed OpenCV to (/opt/opencv/usr/local
if you used DESTDIR=/opt/opencv
before)
set(CUSTOM_OPENCV_PATH "/opt/opencv/usr/local")
If you are on Linux and want to try the experimental V4L2 interface which allows you to edit available camera parameters from within the application, set the option USE_V4L2
to ON
in CMakeLists.txt.
Then you should be able to compile and run the application:
mkdir build && cd build
cmake ..
make
./VideoMagnification
This application is licensed under GPLv3.