CODE
JCaS (Joint Categorization and Segmentation)

Joint Categorization and Segmentation (JCaS) is a framework for image segmentation that combines bottom-up and top-down cues in a principled manner using Conditional Random Fields (CRFs). For more information, please visit the corresponding Object Categorization and Segmentation research page.

We provide a Matlab implementation of the research contributions made in this field by members in the VisionLab here. For any questions, comments or bugs, please contact msid [at] cis [dot] jhu [dot] edu.

Download Code for JCaS (Stable Version).

Download Code for JCaS (Git repository).

GPCA (Generalized Principal Component Analysis)

GPCA (Generalized Principal Component Analysis) is an algebraic, non-iterative algorithm for segmenting points lying in an union of subspaces. For more information, please visit the corresponding GPCA research page.

We provide a MATLAB implementation of GPCA with Polynomial Differentiation and spectral clustering for subspace classification.

Download Code for GPCA PDA with Spectral Clustering.

Sparse Subspace Clustering
Sparce Subspace Clustering (SSC) is a sparse representation and spectral clustering based method for clustering a set of data points lying in a union of low-dimensional subspaces into their respective subspaces. Please visit the corresponding SSC research page for more information. Depending on how sparse representation is computed, there are two variances of SSC.
SSC-Basis Pursuit (SSC-BP). SSC-BP computes sparse representation via solving the basis pursuit (i.e., L1 minimization) problem. There are two implementations of SSC-BP, one based on the CVX package (http://cvxr.com/cvx), and the other based on ADMM, which can be downloaded from the following links below.

Download Code for SSC using CVX.

Download Code for SSC using ADMM


SSC-Orthogonal Matching Pursuit (SSC-OMP). SSC-OMP uses the orthogonal matching pursuit algorithm for computing sparse representations. SSC-OMP can effectively handle 100,000 to 1,000,000 data points.

Download MATLAB Code for SSC-OMP

GitHub for Python SSC-OMP


There are several extensions of SSC for dealing with the issues of over-segmentation, data corruption, imbalanced data distribution, and so on.
Elastic net Subspace Clustering (EnSC). EnSC uses a mixture of the L1 regularization (which is used in SSC-BP) and the L2 regularizations for subspace clustering. The L2 regularization is introduced to address the connectivity issue in SSC-BP. This implementation uses an active support algorithm for solving the elastic net optimization problem. The algorithm can effectively handle datasests with 100,000 to 1,000,000 data points.

Download MATLAB Code for EnSC

GitHub for Python EnSC


Self-Representation Graph based Outlier Detection. The following package contains the code for detecting outliers in a union of subspaces.

Download Code for R-graph


Exemplar based subspace clustering. This package contains the implementation of an exemplar-based subspace clustering method that is able to efficiently cluster imbalanced data in a union of subspaces.

Download Code for exemplar subspace clustering


Sparse Manifold Clustering and Embedding (SMCE). SMCE is an algorithm based on sparse representation theory for clustering and dimensionality reduction of data lying in a union of nonlinear manifolds. The MATLAB code can be downloaded using the following link:

Download Code for SMCE.

Low-Rank Subspace Clustering (LRSC)
The code below is the low-rank subspace clustering code used in our experiments for our CVPR 2011 publication [5]. We note that if your objective is subspace clustering, then you will also need some clustering algorithm. We found that spectral clustering from Ng, Jordan et. al. performed the best.

Download Code for Low-Rank Subspace Clustering

Other subspace clustering algorithms

We provide a MATLAB implementation of Local Subspace Analysis and RANSAC for for subspace classification.

Download Code for Local Subspace Analysis (LSA)

Download Code for RANSAC for Subspace Clustering

Download Code for Structured Subspace Clustering from ICML14

Sparse Representation Theory

Sparse Modeling Representative Selection (SMRS) is an algorithm based on sparse multiple-measurement-vector recovery theory for selecting a subset of data points as the representatives.

Download Code for SMRS.

Structured-Sparse Subspace Classification is an algorithm based on block-sparse representation techniques (also known as Block Sparse Subspace Clustering (BSSC)) for classifying multi-subspace data, where the training data in each class lie in a union of subspaces.

Download Code for BSSC.

Please contact Ehsan Elhamifar ( ehsan [at] cis [dot] jhu [dot] edu ) for questions and comments regarding the code. For more information please visit Ehsan's research page .

Motion segmentation algorithms

The problem of segmenting features tracked in a video with multiple objects can be viewed as the problem of segmenting points lying in an union of subspaces. Many machine learning algorithms can therefore be used to solve this problem (see the Motion Segmentation research page for more information on this topic).

We provide MATLAB implementation of three subspace separation and motion segmentation algorithms:


Download Code for motion segmentation with GPCA, RANSAC and LSA

These algorithms can be tested on the Hopkins 155 dataset, which can be downloaded from the Data page.

Additional code for the Hopkins 155 dataset
The sequences contained in the Hopkins 155 dataset are outlier-free. In order to test the robustness to outliers of segmentation algorithms, one can add synthetically generated outliers to the trajectories in each sequence of the Hopkins 155 dataset. We provide MATLAB code that generates these outlying trajectories for any sequence of the Hopkins 155 datasets.

Download Code for generating synthetic outliers

Histograms of Oriented Optical Flow (HOOF) and Binet-Cauchy Kernels for Non-Linear Dynamical Systems (NLDS)
We provide code for computing Histograms of Oriented Optical Flow (HOOF) - which are features computed at each time instant from a frame of optical-flow vectors to model dynamic phenomena such as human activities. Once a time-series of HOOF is extracted from a video sequence, these can be modeled as Non-Linear Dynamical Systems (NLDS). Kernel PCA is used to learn the parameters of these NLDS and the Binet-Cauchy kernels for NLDS can be used to compute a distance between pairs of such NLDS. This code was applied to the problem of human activity recognition and published in [1]. Please contact rizwanch [at] cis [dot] jhu [dot] edu for questions and comments regarding the code.

Code HOOF and BC kernels for NLDS

Dynamic Texture Toolbox
The dynamic texture toolbox contains implementation of methods for identifying and comparing video sequences by representing them as Linear Dynamical Systems (LDSs). All code is currently implemented in MATLAB with some code depending on the MATLAB control systems toolbox. A set of tutorials on how to use the toolbox can be found here and the complete documentation can be found here. The code is licensed under the Lesser GPL and is provided for academic purposes. If you use this toolbox for a publication we would be grateful if you cite this toolbox as [2]. In case of questions, comments, bugs or errors, please contact Avinash Ravichandran (avinash at cis dot jhu dot edu) or Rizwan Chaudhry (rizwanch at cis dot jhu dot edu).

Download Dynamic Texture Toolbox

Distances Between Linear Dynamical Systems

This is the code for computing the alignment distances between linear dynamical systems as described in reference [3]. The code is implemented in MATLAB but also uses compiled MATLAB executed files (.mex files). Instructions for compiling .mex files from C++ source code is provided in README.odt. Note that the computation of f1 corresponds to the computation of the distance squared as described in reference [4]. The stochastic alignment distances f2 and f3 are described in reference [3].


In case of questions, comments, bugs or errors, please contact Nicolas D. Jimenez at nicodjimenez (at) gmail (dot) com

Download Code for Dynamical Systems Distances
Moving Poselets
This code implements the Moving Poselet model described in [6].

Download Code for Moving Poselets

CAMI method for assessing motor imitation performance
This code implements a method to perform assessment of motor imitation performance based on dynamic time warping (DTW). This method is described in detail in [8].

Download Code for CAMI

References
[1]
R. Chaudhry, A. Ravichandran, G. Hager and R. Vidal.
IEEE Conference on Computer Vision and Pattern Recognition, June 2009.
[2]
A. Ravichandran, R. Chaudhry and R. Vidal.
Dynamic Texture Toolbox
http://www.vision.jhu.edu 2011
[3]
N. Jimenez, B. Afsari, R. Vidal.
European Control Conference, 2013.
[4]
B. Afsari, R. Chaudhry, A. Ravichandran, and R. Vidal.
IEEE Conference on Computer Vision and Pattern Recognition, 2012.
[5]
P. Favaro, R. Vidal, and A. Ravichandran.
IEEE Conference on Computer Vision and Pattern Recognition, 2011.
[6]
L. Tao and R. Vidal.
ChaLearn Looking at People Workshop, 2015.
[7]
C. You, C. Li, D. Robinson and R. Vidal.
European Conference in Computer Vision (ECCV), 2018.
[8]
B. Tuncgenc, C. Pacheco, R. Rochowiak, R. Nicholas, S. Rengarajan, E. Zou, B. Messenger, R. Vidal and S. Mostofsky.
Biological Psychiatry: Cognitive Neuroscience and Neuroimaging, 6(3), 2021.