The distance to stop sign and traffic light is measured by using a single Pi camera, camera calibration is needed.
For more detail in camera calibration, please refer to OpenCv-Python Tutorial
For more detail in calculating distance using monocular vision, please refer to Vehicle Distance Measurement based on Monocular Vision - Xu Guoyan, Wang Chuanrong, Gao feng, & Wang Jiangfeng (September, 2009)