huanyuwu / video-condensation

Sliding-window ribbon carving for video condensation
0 stars 0 forks source link

Sliding-window ribbon carving for video condensation

This project is to shorten the length of surveillance video while preserving motion activities in the video. Video ribbon carving is an algorithm based on image seam carving which removes unimportant parts. We adopt a sliding-window approach to process very long video sequences, in principle infinite-length ones.

Prerequisites

  1. MATLAB environment

  2. GIT LFS is recommended to download test videos

  3. Enough storage to store output videos (Estimation: if storage for current input videos is X and max flex parameter is flexmax, then (flexmax + 1) * X extra space should be enough to store output videos.)

Running the tests

  1. Compile ribboncarvemainC.c in MATLAB:
mex ribboncarvemainC.c

If it is successfully compiled, it should generate a MATLAB MEX file with same filename.

If it cannot be compiled successfully, you may try rolling back to an earlier commit. The first commit should work fine if it compiles. The original MATLAB code is for reference and could be used for testing as well.

  1. Have 'whole_video.avi' and 'whole_cost.avi' files in the same directory. ’whole_video.avi' is the original video and 'whole_cost.avi' is its background subtraction result (cost video). The avi files may require certain format, depending on if aviread() function can decode them properly in MATLAB. You may use sample videos in the repo by downloading via Git LFS.

  2. Run scriptC.m in MATLAB.

scriptC

If it runs successfully, the program will generate output videos (given flexmax = 3): 'flex0_video.avi','flex0_cost.avi', 'flex1_video.avi','flex1_cost.avi', 'flex2_video.avi','flex2_cost.avi', 'flex3_video.avi','flex3_cost.avi'

where 'flex3_video.avi' is our final condensation result.

Future Improvements

Reference

For more details, please refer to my technical report: http://iss.bu.edu/data/jkonrad/reports/Wu09-03buece.pdf

Author