Locally Adaptive Sparse Representation for Detection, Classification, and Recognition