The prediction of the surrounding pedestrians' walking paths is a vital part for autonomous driving systems in the aspect of traffic safety. In this paper, we propose a pipeline which tracks pedestrians captured by a stereo camera system onboard a mobile vehicle, composes the pedestrian tracklets, clusters the tracklets to form trajectories, and matches the trajectories. The output 3D pedestrian trajectories can be used for further applications such as pedestrian trajectory prediction for driverless vehicles. Our algorithm has been compared with various state-of-art pedestrian tracking methods. Our experimental results show that the visual temporal features computed by our algorithm are effective for trajectory representation and that, by incorporating tracklet clustering into the pipeline, the pedestrian tracking performance is improved.