As an application of smart cameras, this paper presents an algorithm and its real-time implementation for detecting and tracking multiple people moving in a surveillance scene. The algorithm is devised to work for low resolution image frames and any camera angle. First an adaptive background subtraction module is used to obtain potential moving target areas. Second a human body detection module is activated to locate the heads. Third a multitarget tracking module is deployed to resolve ambiguities associated with crosspaths and merged targets. The algorithm is implemented on the Texas Instruments TMS320C6201 fixed-point DSP processor for real-time processing of video signals. This real-time capability allows field deployment for the purpose of collecting surveillance data such as the number of people and their crossing frequency in a certain area.