Skip to content
프로젝트

brycedrennan/eulerian-magnification

GitHub에서 보기

소개

영상에 숨겨진 변화를 찾아내는 도구입니다.

디자인 및 미디어

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
-1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Eulerian Video Magnification

Amplify tiny movements in video.

Based on the amazing research done at MIT: http://people.csail.mit.edu/mrub/vidmag/

Warning from the author: This code is not in a working state. I'm slowly adding testing to identify whats wrong, but this project is very low priority. Pull-requests welcome!

Installation

  • Install OpenCV
  • pip install eulerian-magnification

or

docker build -t eulerian .
docker run -it eulerian /bin/bash

Requirements

  • Python 3.5, untested on Python 2.7.
  • OpenCV 3+.
  • numpy, scipy, matplotlib

On windows you can download the needed python dependencies here. Make sure you install the MKL version of numpy as the scipy binary depends on it.

Usage

This technique works best with videos that have very little motion. Pre-processing a video through a stabilization algorithm may help. Some excellent videos sources can be found here: http://people.csail.mit.edu/mrub/vidmag/

Once you've downloaded the video simply run::

import eulerian_magnification as em

vid, fps = em.load_video_float(source_path)
em.eulerian_magnification(vid, fps, 
        freq_min=50.0 / 60.0,
        freq_max=1.0,
        amplification=50,
        pyramid_levels=3
)

freq_min and freq_max specify the frequency in hertz that will be amplified. amplification specifies how much that signal will be amplified.

It can take a while to find the best parameters for a specific video. To help with that there is the show_frequencies function::

import eulerian_magnification as em

vid, fps = em.load_video_float(source_path)
em.show_frequencies(vid, fps)

This will show a graph of the average value of the video as well as a graph of the signal strength at various frequencies.

Todo

  • Butterworth and IIR filters
  • Optimized memory usage to allow processing of larger files

Troubleshooting

When I process the video it looks all weird - alternating from bright to dark - what am I doing wrong?

Most likely the video you're trying to process just has too much movement. Try running it through a video stabilizer. Even with stabilization, it can be hard to find the correct frequency and amplification parameters that isolate the hidden motion you're trying to display.

Additionally, some videos are better suited to motion amplification using a laplacian pyramid.

Windows: IndexError: tuple index out of range

On windows with OpenCv2 it may be necessary to add C:\OpenCV2.3\build\x86\vc10\bin to the system path for videos to load properly. Make sure you adjust the path to the actual location of your opencv library.

Push to Pypi

git tag 0.22
git push --tags
python setup.py sdist
twine upload dist/*
rm dist -r

Author

Bryce Drennan [email protected]

관련 프로젝트 살펴보기

불러오는 중…