Search

CN-115311634-B - Lane line tracking method, medium and equipment based on template matching

CN115311634BCN 115311634 BCN115311634 BCN 115311634BCN-115311634-B

Abstract

The embodiment of the invention discloses a lane line tracking method, medium and equipment based on template matching, wherein the method comprises the following steps of S1, acquiring each frame of image output by a vehicle-mounted forward camera, and initializing a lane line template according to the current vehicle speed; and S2, matching a plurality of lane lines detected according to the current frame image with a pre-constructed lane line template, and S3, classifying the matching result and carrying out corresponding processing. The invention can improve the robustness of the whole lane line detection when the lane line detection result is unstable, namely, the lane line is interrupted, shielded, bent at a large angle and the lane line is complicated.

Inventors

  • XU CHENG
  • LI DAN
  • GUO RUI
  • YU HE

Assignees

  • 北京电子工程总体研究所

Dates

Publication Date
20260508
Application Date
20220624

Claims (5)

  1. 1. The lane line tracking method based on template matching is characterized by comprising the following steps of: S1, acquiring each frame of image output by a vehicle-mounted forward camera, and initializing a lane line template according to the current vehicle speed; s2, matching a plurality of lane lines detected according to the current frame image with a pre-constructed lane line template; S3, classifying the matching result and carrying out corresponding processing; The initializing the lane line template according to the current vehicle speed comprises the following steps: Judging whether the current vehicle speed exceeds a preset vehicle speed threshold value, if not, clearing a lane line template, otherwise, processing each frame of image output by the vehicle-mounted forward camera to obtain a plurality of lane lines detected according to the current frame of image; judging whether the pre-constructed lane line template is zero, if so, establishing the lane line template, otherwise, matching a plurality of lane lines detected according to the current frame image with the pre-constructed lane line template; the matching of the plurality of lane lines detected according to the current frame image with the pre-constructed lane line template comprises the following steps: Matching each lane line with the sub-templates in the pre-constructed lane line templates in pairs to obtain a sub-template with the highest score corresponding to each lane line; judging whether the score of the sub-template exceeds a matching score threshold, if so, considering that the matching is successful, otherwise, the matching is failed; The matching result is divided into lane lines which are successfully matched and sub-templates thereof, and the sub-templates which are not matched with the lane lines of the sub-templates; When the matching result is a successfully matched lane line and a sub-template thereof, setting the tracking time corresponding to the sub-template to be time=time+1, and updating the content of other corresponding sub-templates; Obtaining a line with the longest template tracking time and the highest probability value score of the lane line points, which are successfully matched, and adding the line into a candidate lane line list; Calculating the tracking time difference between the lane lines in the candidate lane line list and the lane lines which are successfully matched, and comparing the lane lines in the candidate lane line list with the lane lines which are successfully matched according to the tracking time difference to determine which lane line is added or reserved to the candidate lane line; and when the matching result is that the lane lines of the sub-templates are not matched, calculating the distances between the lane lines which are not matched successfully and all the sub-templates, if the distances are larger than a preset distance threshold, considering the lane lines as newly detected lane lines and adding the newly detected lane lines into the candidate lane lines, otherwise, judging the lane lines as false detection lane lines according to whether the tracking time corresponding to the sub-template which is closest to the lane lines which are not matched successfully is larger than a preset time threshold, if so, judging that the lane lines are false detection lane lines, otherwise, judging that the sub-templates are wrong.
  2. 2. The method of claim 1, wherein when the matching result is a sub-template that is not matched to a lane line, if the probability value of the semantic segmentation result in the current frame sub-template exceeds a preset score threshold value and a lane line appears at the position in the past period of time, the lane line of the current frame is considered to be missed, and a lane line is supplemented into the candidate lane lines.
  3. 3. The method of claim 1, wherein processing each frame of image output by the onboard forward-facing camera comprises: Performing two-class classification on each pixel point of each frame of image output by the vehicle-mounted forward camera, wherein each pixel point gives out the probability of whether the pixel point is a point on a lane line or not; Clustering or fitting the points yields a parameterized representation of the lane lines.
  4. 4. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-3.
  5. 5. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1-3 when the program is executed by the processor.

Description

Lane line tracking method, medium and equipment based on template matching Technical Field The present invention relates to the field of image processing. And more particularly, to a lane tracking method, medium and apparatus based on template matching. Background Lane line tracking is one of important functions of a sensing module in the unmanned technology, plays an important role in the running process of an unmanned vehicle, and functional modules such as LDW (lane departure early warning), LKA (lane keeping assist) and the like depend on continuous and stable lane line detection and tracking. The lane line tracking is to predict the lane line of the current frame according to the lane lines detected in the previous frames of images by utilizing the continuity of the image acquisition time, then fuse the detection result of the lane line of the current frame, and finally output the most likely lane line of the current frame. At present, the usual methods for tracking the lane line include methods based on Kalman filtering and deformation thereof, wherein the methods firstly utilize the traditional image processing algorithm to extract the lane line obtained by image characteristics, then match the lane line of the previous frame with the lane line of the current frame, then start the Kalman filter and the like to track the parameters of the lane line, and finally output the tracked new lane line parameters. However, the direct tracking of the lane line parameters has problems, the Kalman filtering is based on the assumption that noise obeys Gaussian distribution, however, the noise distribution of the lane line parameters is generally not consistent, so that the conventional lane line tracking algorithm has some defects, particularly under the non-ideal condition, such as the condition that the lane line image is interrupted, blocked and blurred, and the condition that the lane lines such as large-angle curves, entrances and exits are complicated, the conventional lane line algorithm has poor robustness, the good lane line tracking result is difficult to continuously give, the conditions of lane line missing detection, false detection and the like appear, and the danger is brought to the subsequent unmanned driving function. Disclosure of Invention In view of this, a first embodiment of the present invention provides a lane tracking method based on template matching, including: S1, acquiring each frame of image output by a vehicle-mounted forward camera, and initializing a lane line template according to the current vehicle speed; s2, matching a plurality of lane lines detected according to the current frame image with a pre-constructed lane line template; and S3, classifying the matching result and carrying out corresponding processing. In one embodiment, initializing the lane line template according to the current vehicle speed includes: Judging whether the current vehicle speed exceeds a preset vehicle speed threshold value, if not, clearing a lane line template, otherwise, processing each frame of image output by the vehicle-mounted forward camera to obtain a plurality of lane lines detected according to the current frame of image; Judging whether the pre-constructed lane line template is zero, if so, establishing the lane line template, otherwise, matching a plurality of lane lines detected according to the current frame image with the pre-constructed lane line template. In one embodiment, matching the plurality of lane lines detected from the current frame image with the pre-constructed lane line template includes: Matching each lane line with the sub-templates in the pre-constructed lane line templates in pairs to obtain a sub-template with the highest score corresponding to each lane line; Judging whether the score of the sub-template exceeds a matching score threshold, if so, considering that the matching is successful, otherwise, the matching is failed. In a specific embodiment, the matching result is divided into a lane line which is successfully matched and a sub-template thereof, and the sub-template which is not matched with the lane line of the sub-template. In a specific embodiment, when the matching result is a lane line and its sub-template that are successfully matched, setting the tracking time corresponding to the sub-template to be time=time+1, and updating the content of other sub-templates corresponding to the tracking time; Obtaining a line with the longest template tracking time and the highest probability value score of the lane line points, which are successfully matched, and adding the line into a candidate lane line list; And if the distance is larger than a preset distance threshold value, adding the lane lines which are successfully matched into the candidate lane line list, otherwise, calculating the tracking time difference between the lane lines which are successfully matched and the lane lines which are successfully matched, and comparing the lane lines which are succ