A bag of words approach for 3D object categorization