| TTC stands for Time to Collision,defined as the time it takes for an object to hit the camera plane when they are in the current state of motion.It’s the ratio of distance and relative velocity,which contains the movement information of the object.In this thesis,based on monocular camera,the precise TTC is obtained by locating the vehicle through deep learning model,then detecting feature and calculating affine transformation on the local image between continuous frames.This method obtains TTC by the size of object instead of distance measurement.In addition,this thesis proposes a feature point selecting algorithm named ”shrink to exclude” to improve the accuracy of the calculating TTC.This thesis mainly has the following three research aspects:Building the Swin Transformer target detection model,training it through the MS COCO dataset,makes it accurately detect the vehicles in the image and be the foundation for subsequent design.After training,this thesis builds a real-world vehicle dataset to evaluate the performance of the model.Evaluation results show that the model can detect vehicle objects in real scenes.Based on analyzing theory of TTC measurement,this algorithm uses feature point detection and feature matching to determine the object scaling between consecutive frames,then uses affine transformation to calculate the scaling value.Finally,TTC is obtained by calculating the matrix to obtain the scaling value in consecutive frames and verify the theory in the real world.In this experiment,one problem found is that local image feature points may be detected outside the object.To solve this problem,”shrink to exclude” algorithm for selecting feature points is proposed,which is used to exclude the feature points located outside the object in the local image and improve the accuracy of calculating TTC.For safety reasons,this thesis uses virtual simulation environment based on Airsim and UE4 to verify and test the robustness of the algorithm.In this virtual environment,establishing a vehicle dataset analyzes its substitutability for the real scene by the deep learning model.Finally this thesis verifies this method and analyzes the influence of the parameters on the results in the simulation environment.It shows that this method can accurately calculate TTC time at a certain distance with optimal parameters. |