The invention discloses a vehicle tracking method based on machine learning and optical flow. A vehicle model is obtained through one-off off-line training and used for detecting vehicle block mass Blobs in a video flow in real time, bidirectional pyramid optical flow tracking is performed on calculation characteristic point sets of all the vehicle mass block Blobs, and results of optical flow tracking in the forward direction and the backward direction are analyzed and filtered, so that multiple targets are stably and accurately tracked to form vehicle tracks. According to the complete vehicle tracking solution, the vehicle tracking method based on machine learning and optical flow can be widely applied to the fields of intelligent traffic, electronic polices, video monitoring, unmanned driving and others; by the utilization of the tracking method, a user can solve the classic problems in an existing tracking algorithm well, the multiple targets, such as long-period vehicle staying, size scale changing, shadowing, local shielding and touching, can be stably and accurately tracked; particularly, the vehicle tracking method has the good effects under the conditions of severe weather, a low illumination level and a high noisy point.