Non-negativity for dictionary and codes is proposed to avoid features offsetting each other. Locality for sparse codes is added, which preserves local information for features. Laplacian regularization is used to preserve the consistency of codes with similar features. Our proposed method has better performance than previous algorithms.