The companies operating subways are very much concerned with counting the passengers traveling through their transport systems. One of the most widely used systems for counting passengers consists of a mechanical gate equipped with a counter. However, such simple systems are not able to count passengers jumping above the gates. Moreover, passengers carrying large luggage or bags may meet some difficulties when going through such gates. The ideal solution is a contact-free counting system that would bring more comfort of use for the passengers. For these reasons, we propose to use a video processing system instead of these mechanical gates. The optical sensors discussed in this paper offer several advantages including well defined detection areas, fast response time and reliable counting capability. A new technology has been developed and tested, based on linear cameras. Preliminary results show that this system is very efficient when the passengers crossing the optical gate are well separated. In other cases, such as in compact crowd conditions, reasonable accuracy has been demonstrated. These results are illustrated by means of a number of sequences shot in field conditions. It is our belief that more precise measurements could be achieved, in the case of compact crowd, by other algorithms and acquisition techniques of the line images that we are presently developing.