Autonomous driving is one of the hottest topics in recent years, receiving extensive attention from the automotive industry and research institutes. In order to ensure the safety of drivers and pedestrians, it is necessary to predict possible hazards during driving based on the information collected by sensors. The two most important sensors used on the vehicles are Lidar and cameras. They are used to measure the distance and detect objects on the front, respectively. However, Lidar is very expensive, which limits its use in autonomous driving. This paper presents a new framework, which uses the mono-camera to realize both object detection and relative distance estimation. The framework is tested on the benchmark of the KITTI dataset, its performance depends on the algorithms used in the framework.