Overview
Robust Principle Component analysis or RPCA is an elegant way of separating out low rank from sparse components. It uses convex optimization method to minimize the low rank component and sparse component of the signal simultaneously. Nuclear norm is used for minimizing low rank whereas L1 norm for the sparse component. Here, we use this method to remove the background from the moving objects in the surveillance videos.
Problem Formulation
Given a video consisting of J number of frames. Let xj ∈ Rn be a vector formed from pixels of frame j of the sequence, for j = 1,2,……J and n is the total number of pixels in a frame. In general X = [x1, x2, …., xJ] ∈ Rn is a video volume obtained from the video sequence. The total number of entries in X is N = nJ. The data X can now be decomposed into background L and sparse foreground object S by the following convex optimization.
The parameter λ is tunable which provides a trade-off between the acceptable error variance between the low rank and the sparse components. Low value of λ results in a good background reconstruction but erroneous sparse reconstruction. Opposite results are obtained for a high value of λ. Since, we require a high quality sparse component to detect the anomalies, we keep the parameter value towards a higher side.
Results
The separated low rank background and sparse foreground is shown along with the video. The leftmost segment is the raw video, the middle one is the low rank background and the rightmost is the sparse component. We can see that although the background reconstruction has some artifacts, the sparse components obtained are nearly perfect which is good for the further processing for anomaly detection.