In recent years, the rise of industrial societies and the Internet of Things (IoT) has encouraged the growth of vehicular transportation, which, in turn, has led to intelligent transportation systems (ITSs) becoming an important field of research. In view of this, nighttime vehicle detection and the counting technique that will facilitate future research on energy saving are presented. In this work, the Hough transform was first performed to detect lane lines in an image, and subsequently, all images underwent feature enhancement processing. Next, the light source data from the detected line of each lane was obtained, and at the same time, the aspect ratio and spacing of light source pairs were computed in order to determine if they matched the set values and to perform vehicle counting. Furthermore, since driving habits differ and some vehicles would straddle the lane line, an approach to recognizing and counting lane-straddling vehicles in order to avoid misjudgments is proposed in this study. Lastly, LED lights were used to simulate street lights and controlled on the basis of the traffic volume data obtained in the manner described earlier. The experimental results show that the proposed technique could be effectively utilized to perform nighttime vehicle detection and counting since it achieved a high average correction rate of 94%, as well as a computing time of 44 frames per second.