In this work, we study the problems of anomaly detection and activity perception through the trajectories of objects in crowded scenes. For this purpose, we propose a novel representation for trajectories via covariance features. Representing trajectories via feature covariance matrices enables us to calculate the distance between the trajectories of different lengths. After setting this proposed representation and calculation of distances between trajectories, anomaly detection is achieved by sparse representations on nearest neighbors and activity perception is achieved by extracting the dominant motion patterns in the scene through the use of spectral clustering. Conducted experiments show that the proposed method yields results which are outperforming or comparable with state of the art.