Counting moving persons in crowded scenes