Measure the difference between frames in videos. The brightness changes is measured using the average change in each pixel and channel respectively for those brighter and darker. Visualization is applied using the length of green blocks. The red value stand for the absolute value of changes.
(Image captured from "Men's Long Jump Final | Rio 2016 Replay" on YouTube. Available at: https://www.youtube.com/watch?v=fXIbLmlUdOQ )
- Windows 10 x64
- Visual Studio 2019
- OpenCV >= 4.0 (recommended 4.1.2)
- (optional) OpenH264
For Linux users:
If you are using Ubuntu or other linux system, please use OpenCV of the same version. (I haven't tested on my own yet.) A possible tutorial could be found at:
https://www.learnopencv.com/install-opencv-4-on-ubuntu-18-04/
-
Download and install OpenCV at:
https://sourceforge.net/projects/opencvlibrary/files/4.1.2/opencv-4.1.2-vc14_vc15.exe/download
-
Add
opencv\build\x64\vc15\bin
to thePath
in yourEnvironment Variables
. -
Open VS2019 and configure the OpenCV include and library directories in the properties "x64 Release".
-
Copy the file
opencv_world412.dll
fromopencv\build\x64\vc15\bin
toC:\Windows\System32
path. Then add the additional depandencies. -
(optional) Download OpenH264 if you would like to employ Open Source H.264 Codec. Available at:
-
Build from
main.cpp
.
-
Input the filename of the video for testing, and the output result filename. "*.mp4" is recommended.
-
If you want to test a camera online, just modify line 10 to:
#define CAMERA_ONLINE 1
-
During running, press any key in video window to quit.
-
If you do not provide the filename of the input and output, they are respectively the default values "input.mp4" and "output.mp4".
-
Basic function of video frame difference
-
Enable optical flow estimation
-
Support GPU acceleration of GPU by default using OpenCL
-
Support video resolution downsample
-
Downsample only when optical flow estimation
-
Automantic down according to resolution
-
-
Check the file readable or camera available
-
Process with the arguments
-
Support multi version of OpenCV
-
OpenCV 4.2 (>=4.0)
-
Opencv 3.x (not installed)
-