This paper is dedicated to detecting and counting vehicles in dark (nighttime) environment by using headlight information. The basic idea is to use variation ratio in color space to detect the ground- illumination resulted from the head-lighting of vehicle. Then, headlight classification provides the headlight information for determining the moving-object region and compensating pixels, which are wrongly classified as ground-illumination, back to the object mask. Besides, shadow is possibly detected by prediction rules and then excluded for deriving better results of vehicle segmentation and counting. Experimental results show that the proposed algorithm can detect vehicles and reduce both effects of ground-illumination and shadow. In the normal condition (non-crowding), the average accuracy can be raised near to 90%.