/lrslibrary

Low-Rank and Sparse Tools for Background Modeling and Subtraction in Videos

Primary LanguageMATLAB

Last update: 10/11/2014

Library Version: 1.0.0

LRSLibrary

Low-Rank and Sparse tools for Background Modeling and Subtraction in Videos.

The LRSLibrary provides a collection of low-rank and sparse decomposition algorithms in MATLAB. The library was designed for motion segmentation in videos, but it can be also used or adapted for other computer vision problems, please see this page. Currently the LRSLibrary contains a total of 64 matrix-based and tensor-based algorithms. The LRSLibrary was tested successfully in MATLAB R2013b both x86 and x64 versions.

See also:

Presentation about Matrix and Tensor Tools for Computer Vision 
http://www.slideshare.net/andrewssobral/matrix-and-tensor-tools-for-computer-vision

MTT: Matlab Tensor Tools for Computer Vision
https://github.com/andrewssobral/mtt

IMTSL: Incremental and Multi-feature Tensor Subspace Learning
https://github.com/andrewssobral/imtsl

Citation

A paper about the LRSLibrary will be published in a journal, but if you use this code for your publications, please cite it currently as:

@inproceedings{asobral2014,
    author       = "Sobral, A. and Baker, C. G. and Bouwmans, T. and Zahzah, E.",
    title        = "Incremental and Multi-feature Tensor Subspace Learning applied for Background Modeling and Subtraction",
    booktitle    = "International Conference on Image Analysis and Recognition (ICIAR'14)",
    year         = "2014",
    month        = "October",
    publisher    = "Lecture Notes in Computer Science (Springer LNCS)",
    url          = "https://github.com/andrewssobral/imtsl"
}
@article{bouwmans2014,
  author         = "Thierry Bouwmans and El Hadi Zahzah",
  title          = "Robust \{PCA\} via Principal Component Pursuit: A review for a comparative evaluation in video surveillance",
  journal        = "Computer Vision and Image Understanding (CVIU)",
  volume         = "122",
  pages          = "22--34",
  year           = "2014"
}

GUI

The LRSLibrary provides an easy-to-use graphical user interface (GUI) for background modeling and subtraction in videos. Just execute run.m and enjoy it ;)

Each algorithm is classified by its cpu time consumption with the following icons:

List of the algorithms available in LRSLibrary

Usage example

For complete details and examples, please see the demo.m file.

%% Processing videos
%
% Robust PCA
process_video('RPCA', 'FPCP', 'dataset/demo.avi', 'output/demo_FPCP.avi');
% Low Rank Recovery
process_video('LRR', 'FastLADMAP', 'dataset/demo.avi', 'output/demo_LRR-FastLADMAP.avi');
% Non-Negative Matrix Factorization
process_video('NMF', 'ManhNMF', 'dataset/demo.avi', 'output/demo_ManhNMF.avi');
% Non-Negative Tensor Factorization
process_video('NTF', 'bcuNCP', 'dataset/demo.avi', 'output/demo_bcuNCP.avi');
% Tensor Decomposition
process_video('TD', 'Tucker-ALS', 'dataset/demo.avi', 'output/demo_Tucker-ALS.avi');

%% Processing matrices and tensors
%
load('dataset/trafficdb/traffic_patches.mat');
V = im2double(imgdb{100});
show_3dvideo(V);

%% Matrix-based algorithms
%
[M, m, n, p] = convert_video3d_to_2d(V);
show_2dvideo(M,m,n);
% Robust PCA
results = process_matrix('RPCA', 'FPCP', M, []);
show_results(M,results.L,results.S,results.O,p,m,n);
% Low Rank Recovery
results = process_matrix('LRR', 'FastLADMAP', M, []);
show_results(M,results.L,results.S,results.O,p,m,n);
% Non-Negative Matrix Factorization
results = process_matrix('NMF', 'ManhNMF', M, []);
show_results(M,results.L,results.S,results.O,p,m,n);

%% Tensor-based algorithms
%
add_tensor_libs;
T = tensor(V);
% Non-Negative Tensor Factorization
results = process_tensor('NTF', 'bcuNCP', T);
show_3dtensors(T,results.L,results.S,results.O);
% Tensor Decomposition
results = process_tensor('TD', 'Tucker-ALS', T);
show_3dtensors(T,results.L,results.S,results.O);
rem_tensor_libs;

CPU time consumption

The figure below shows the average CPU time consumption and the speed classification of each algorithm to decompose a 2304x51 matrix or 48x48x51 tensor data. Both matrix and tensor data were built from dataset/demo.avi file. The experiments were performed in a Intel Core i7-3740QM CPU 2.70GHz with 16Gb of RAM running MATLAB R2013b and Windows 7 Professional SP1 64 bits.

About LRSLibrary

The LRSLibrary has been developed by Andrews Sobral thanks especially to Thierry Bouwmans for his continued support and for collaborating on this important initiative. I'm grateful to all authors who have contributed in some way to the success of the LRSLibrary.

How to contribute with LRSLibrary project

Everyone is invited to cooperate with the LRSLibrary project by sending to us any implementation of low-rank and sparse decomposition algorithms.

License

The source code is available only for academic/research purposes (non-commercial).

Problems or Questions

If you have any problems or questions, please contact the author: Andrews Sobral (andrewssobral@gmail.com)

Release Notes:

  • Version 1.0.0: First version with 64 algorithms.