Lane line detection method and device, electronic equipment and storage medium

By acquiring and clustering reference point data of lane line location points in lane line detection, and fitting the curve data of lane lines, the problem of low detection accuracy in existing systems is solved, and the accuracy of lane line detection and vehicle deviation detection is improved.

CN114092904BActive Publication Date: 2025-12-12SF TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010787417.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-07
Publication Date
2025-12-12
Estimated Expiration
2040-08-07

AI Technical Summary

Technical Problem

Existing lane line detection methods have low detection accuracy, resulting in low accuracy in detecting vehicles deviating from their lanes.

Method used

By acquiring the set of lane line location points in the state image, the data of the first reference point and the second reference point are extracted, and these points are clustered to fit the first curve data and the second curve data of the lane line to be detected.

Benefits of technology

It improves the accuracy of lane line detection, ensures the accuracy of vehicle lane departure detection, and reduces the occurrence of traffic accidents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114092904B_ABST
    Figure CN114092904B_ABST
Patent Text Reader

Abstract

The application provides a lane line detection method and device, electronic equipment and a computer readable storage medium. The lane line detection method comprises: acquiring a state image containing a lane line to be detected; performing lane line detection processing on the state image to obtain a set of lane line position points of the state image; acquiring data of a first reference point and data of a second reference point of the lane line to be detected from the set of lane line position points; performing clustering processing on each point in the set of lane line position points to obtain a first set of clustered points of the first reference point and a second set of clustered points of the second reference point; and performing curve fitting processing on the first set of clustered points and the second set of clustered points respectively to obtain first curve data and second curve data of the lane line to be detected. The application can improve the detection accuracy of the lane line.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent transportation, in particular to a lane line detection method and device, electronic equipment and a computer readable storage medium. BACKGROUND

[0002] In recent years, artificial intelligence related technologies have developed rapidly, and safe driving, as a major application scenario in the field of artificial intelligence, has been paid more attention and concern by relevant personnel in the industry. Among them, the accurate detection of lane lines is of great guiding significance for safe driving.

[0003] In the prior art, lane line edge information is extracted through edge detection technology based on images, and then Hough transform and other processing are performed to fit the lane line.

[0004] However, in actual application, it is found that the detection accuracy of the existing lane line detection method is relatively low. SUMMARY

[0005] The present application provides a lane line detection method, device, electronic equipment and computer readable storage medium, aiming to solve the problem of low detection accuracy of the existing lane line detection algorithm.

[0006] In a first aspect, the present application provides a lane line detection method, which comprises:

[0007] obtaining a state image containing a lane line to be detected;

[0008] performing lane line detection processing on the state image to obtain a set of lane line position points of the state image, wherein the lane line position point refers to a pixel point of the lane line in the state image;

[0009] obtaining data of a first reference point and data of a second reference point of the lane line to be detected from the set of lane line position points; wherein the first reference point refers to a pixel point with the smallest coordinate value on a second coordinate axis among lane line position points with a coordinate value on a first coordinate axis less than a first preset threshold; the second reference point refers to a pixel point with the smallest coordinate value on the second coordinate axis among lane line position points with a coordinate value on the first coordinate axis greater than the first preset threshold; and the first coordinate axis is perpendicular to the second coordinate axis;

[0010] performing clustering processing on each point in the set of lane line position points to obtain a first set of clustered points of the first reference point and a second set of clustered points of the second reference point;

[0011] The first curve data and the second curve data are used for indicating the to-be-detected lane line.

[0012] In a second aspect, the present application provides a lane line detection device, which comprises:

[0013] A first acquisition unit is configured to acquire a state image containing a to-be-detected lane line.

[0014] A detection unit is configured to perform lane line detection processing on the state image to obtain a set of lane line position points of the state image, wherein the lane line position points refer to pixel points where lane lines in the state image are located.

[0015] A second acquisition unit is configured to acquire data of a first reference point and data of a second reference point of the to-be-detected lane line from the set of lane line position points, wherein the first reference point refers to a pixel point with the smallest coordinate value on a second coordinate axis among lane line position points with a coordinate value on a first coordinate axis less than a first preset threshold, the second reference point refers to a pixel point with the smallest coordinate value on the second coordinate axis among lane line position points with a coordinate value on the first coordinate axis greater than the first preset threshold, and the first coordinate axis is perpendicular to the second coordinate axis.

[0016] A clustering unit is configured to perform clustering processing on each point in the set of lane line position points to obtain a first set of clustered points of the first reference point and a second set of clustered points of the second reference point.

[0017] A fitting unit is configured to perform curve fitting processing on the first set of clustered points and the second set of clustered points respectively to obtain first curve data and second curve data of the to-be-detected lane line, wherein the first curve data and the second curve data are used for indicating the to-be-detected lane line.

[0018] In a possible implementation manner of the present application, the clustering unit is specifically further configured to:

[0019] acquire a first Hamming distance between the lane line position points and the first reference point and a second Hamming distance between the lane line position points and the second reference point;

[0020] perform clustering processing on each point in the set of lane line position points according to the first Hamming distance and the second Hamming distance to obtain the first set of clustered points of the first reference point and the second set of clustered points of the second reference point.

[0021] In a possible implementation of the present application, the second obtaining unit is specifically configured to:

[0022] From the set of lane line position points, a set of target position points with a coordinate value of the second coordinate axis less than a second preset threshold is obtained.

[0023] From the set of target position points, data of a first reference point and data of a second reference point of the lane line to be detected are obtained.

[0024] In a possible implementation of the present application, the second obtaining unit is specifically configured to:

[0025] From the set of target position points, lane line position point data with a coordinate value of the first coordinate axis less than a first preset threshold is obtained to obtain a first set of initial points, and lane line position point data with a coordinate value of the first coordinate axis greater than the first preset threshold is obtained from the set of target position points to obtain a second set of initial points.

[0026] From the first set of initial points, pixel point data with a minimum coordinate value of the second coordinate axis is obtained as data of a first reference point of the lane line to be detected, and from the second set of initial points, pixel point data with a minimum coordinate value of the second coordinate axis is obtained as data of a second reference point of the lane line to be detected.

[0027] In a possible implementation of the present application, the clustering unit is specifically configured to:

[0028] The third Hamming distance between the target position point and the first reference point and the fourth Hamming distance between the target position point and the second reference point are obtained.

[0029] According to the third Hamming distance and the fourth Hamming distance, each point in the set of target position points is subjected to clustering processing to obtain a first set of clustered points of the first reference point and a second set of clustered points of the second reference point.

[0030] In a possible implementation of the present application, the lane line detection apparatus further includes a discrimination unit, which is specifically configured to:

[0031] At least two state images containing the lane line to be detected in a vehicle driving state are obtained as a reference state image and a comparison state image, respectively, wherein the generation time of the comparison state image lags behind the generation time of the reference state image.

[0032] acquire first curve data corresponding to the reference state image and second curve data corresponding to the reference state image; and acquire first curve data corresponding to the comparison state image and second curve data corresponding to the comparison state image;

[0033] determine whether the vehicle is in the lane deviation state according to the first curve data corresponding to the reference state image, the second curve data corresponding to the reference state image, the first curve data corresponding to the comparison state image, and the second curve data corresponding to the comparison state image.

[0034] In a possible implementation of the present application, the determination unit is specifically configured to:

[0035] determine first reference point data and second reference point data corresponding to the reference state image according to the first curve data corresponding to the reference state image and the second curve data corresponding to the reference state image, respectively;

[0036] determine first comparison point data and second comparison point data corresponding to the comparison state image according to the first curve data corresponding to the comparison state image and the second curve data corresponding to the comparison state image, respectively;

[0037] detect first difference data between the first reference point data and the first comparison point data, and second difference data between the second reference point data and the second comparison point data;

[0038] determine whether the vehicle is in the lane deviation state according to the first difference data and the second difference data.

[0039] In a third aspect, the present application also provides an electronic device, which comprises a processor and a memory, and the memory stores a computer program, and the processor invokes the computer program in the memory to execute the steps in any of the lane line detection methods provided by the present application.

[0040] In a fourth aspect, the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is loaded by a processor to execute the steps in the lane line detection method.

[0041] The application obtains a set of lane line position points of a state image by performing lane line detection processing on the state image containing a lane line to be detected; obtains, from the set of lane line position points, a pixel point with the minimum coordinate value on a second coordinate axis among lane line position points with a coordinate value on a first coordinate axis less than a first preset threshold, as data of a first reference point of the lane line to be detected; and obtains, from the set of lane line position points, a pixel point with the minimum coordinate value on the second coordinate axis among lane line position points with the coordinate value on the first coordinate axis greater than the first preset threshold, as data of a second reference point of the lane line to be detected; and performs clustering processing on each point in the set of lane line position points based on the first reference point and the second reference point, to obtain a first set of clustered points and a second set of clustered points corresponding to the lane line to be detected, and then the first curve data and the second curve data of the lane line to be detected can be fitted based on the first set of clustered points and the second set of clustered points respectively. Since the position characteristics of the target lane in the state image are targeted, the pixel points on the two lane lines of the target lane are accurately obtained as the first reference point and the second reference point based on the data of the first reference point and the data of the second reference point, and then it is ensured that each point in the first set of clustered points and the second set of clustered points used for fitting the lane line to be detected is a pixel point of the two lane lines of the target lane, thereby improving the detection accuracy of the lane line. BRIEF DESCRIPTION OF DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without any creative effort based on these drawings.

[0043] Figure 1 is a flowchart of a lane line detection method provided by an embodiment of the present application;

[0044] Figure 2 is a schematic diagram of a state image containing multiple lane lines provided in an embodiment of the present application;

[0045] Figure 3 is a schematic diagram of a state image taken from a driving perspective provided in an embodiment of the present application;

[0046] Figure 4 is a scene diagram of a reference coordinate system corresponding to each pixel point in a state image provided in an embodiment of the present application;

[0047] Figure 5 is a scene diagram of a first reference point and a second reference point provided in an embodiment of the present application;

[0048] Figure 6 is another scenario diagram of a reference coordinate system corresponding to each pixel point in a state image provided in an embodiment of the present application;

[0049] Figure 7 is an embodiment structure diagram of a lane line detection device provided in an embodiment of the present application;

[0050] Figure 8 is an embodiment structure diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, any person skilled in the art can obtain all other embodiments without creative work.

[0052] In the description of the embodiments of the present application, it should be understood that the terms “first”, “second” are used only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with “first”, “second” can explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of “multiple” is two or more, unless otherwise specifically limited.

[0053] The following description is presented to enable any person skilled in the art to practice the present application. In the following description, for purposes of explanation, specific details are set forth. It will be apparent to those skilled in the art that the present application can be practiced without using these specific details. In other instances, well-known processes have not been described in detail in order to avoid obscuring the description of the embodiments of the present application. Therefore, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.

[0054] The embodiments of the present application provide a lane line detection method, device, electronic device and computer readable storage medium. The lane line detection device can be integrated in an electronic device, which can be a server, a terminal or other device.

[0055] First, before introducing the embodiments of the present application, the related content about the application background of the embodiments of the present application is introduced.

[0056] At present, when the driver drives on the highway, it is easy to cause traffic accidents due to fatigue caused by long-time driving. According to the statistics of the Ministry of Communications, about 50% of the automobile traffic accidents are caused by the deviation of the automobile from the normal lane. Such a shocking proportion is enough to prove the importance of timely detecting whether the vehicle deviates from the lane and timely reminding the lane deviation to prevent the lane deviation.

[0057] Since the detection accuracy of the existing lane line detection method is relatively low, when the traditional processing method is used to detect whether the normal vehicle deviates from the lane, the accuracy is relatively low.

[0058] Based on the above defects existing in the prior art, the embodiment of the present application provides a lane line detection method, which at least partially overcomes the defects existing in the prior art.

[0059] The execution subject of the lane line detection method of the embodiment of the present application can be a lane line detection device provided by the embodiment of the present application, or a server device, a physical host or a user equipment (User Equipment, UE) and other different types of electronic devices integrated with the lane line detection device, wherein the lane line detection device can be realized in the form of hardware or software, and the UE can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a palm computer, a desktop computer or a personal digital assistant (Personal Digital Assistant, PDA).

[0060] The electronic device can run in a separate mode or in a device cluster mode. By applying the lane line detection method provided by the embodiment of the present application, the detection accuracy of the lane line can be improved.

[0061] Next, the lane line detection method provided by the embodiment of the present application will be introduced. In the embodiment of the present application, an electronic device is taken as the execution subject. In order to simplify and facilitate the description, the execution subject will be omitted in the subsequent method embodiments. The lane line detection method comprises: acquiring a state image containing a lane line to be detected; performing lane line detection processing on the state image to obtain a set of lane line position points of the state image; acquiring data of a first reference point and data of a second reference point of the lane line to be detected from the set of lane line position points; performing clustering processing on each point in the set of lane line position points to obtain a first set of clustering points of the first reference point and a second set of clustering points of the second reference point; and performing curve fitting processing on the first set of clustering points and the second set of clustering points respectively to obtain first curve data and second curve data of the lane line to be detected.

[0062] Reference Figure 1 , Figure 1A flowchart of a lane line detection method provided by an embodiment of the present application is shown. It should be noted that although a logical sequence is shown in the flowchart, in some cases, the steps shown or described can be performed in an order different from that shown. The lane line detection method includes steps S10-S50, in which:

[0063] S10, obtaining a state image containing a lane line to be detected.

[0064] To better understand the embodiments of the present application, the following will first introduce the concepts of "acquisition of a state image", "coordinate values of each pixel point in a state image", and "reference coordinate system of a state image".

[0065] First, acquisition of a state image.

[0066] The lane line to be detected refers to two lane lines used to divide a target lane, and the target lane can be defined according to a specific scene. For example, in order to detect the lane in which the vehicle is currently located, the target lane refers to the lane in which the vehicle is located, and the lane line to be detected refers to the two lane lines used to divide the lane in which the vehicle is located. In the embodiments of the present application, the lane line to be detected mainly refers to two dividing lines of a lane, and the lane line to be detected is described by taking two lines as an example. The embodiments of the present application are mainly applied to accurately detecting two lane lines of a target lane at the same time.

[0067] The state image refers to an image containing lane lines, and the lane lines contained in the state image can be one or more. In the embodiments of the present application, generally, there are multiple lane lines contained in the state image, and among the multiple lane lines contained in the state image, two are lane lines to be detected. Please refer to Figure 2 , Figure 2 is a schematic diagram of a state image containing multiple lane lines provided in the embodiments of the present application. If not specified, the state image referred to hereinafter refers to an image containing lane lines to be detected.

[0068] There are various ways to obtain a state image containing lane lines to be detected. For example, a lane image captured at a driving angle can be obtained as a state image containing lane lines to be detected.

[0069] Specifically, in actual applications, an electronic device applying the lane line detection method provided by the embodiments of the present application can directly include a camera of a vehicle in hardware, and store the image captured by the camera locally, which can be directly read in the electronic device; or the electronic device can establish a network connection with the camera of the vehicle, and obtain the image captured by the camera online according to the network connection; or the electronic device can read the image captured by the camera from a related storage medium storing the image captured by the camera of the vehicle, and the specific acquisition manner is not limited here.

[0070] The camera can capture images according to a preset shooting mode, for example, a shooting height, a shooting direction, or a shooting distance can be set, and the specific shooting mode can be adjusted according to the camera itself, which is not limited here. The image captured by the camera is composed of multiple pictures, and can form a video through a time line.

[0071] In a second aspect, the coordinate values of the pixels in the state image.

[0072] In this embodiment of the present application, the coordinate values of each pixel in the state image in the camera coordinate form (the coordinate values in the camera coordinate form are hereinafter referred to as camera coordinate values) can be obtained at the same time as the state image is obtained, that is, each pixel in the state image can be represented by a camera coordinate. It can be understood that the camera coordinate values of the pixels in the state image can also be further converted according to specific requirements.

[0073] Further, the camera coordinate values (of the pixels in the state image) can be two-dimensional coordinate values (i.e., coordinate values in a planar coordinate system) or three-dimensional coordinate values (i.e., coordinate values in a three-dimensional coordinate system); the two-dimensional camera coordinate values (of the pixels in the state image) can be converted into two-dimensional coordinate values or three-dimensional coordinate values; the three-dimensional camera coordinate values (of the pixels in the state image) can be converted into two-dimensional coordinate values or three-dimensional coordinate values.

[0074] In a third aspect, a reference coordinate system of the state image.

[0075] The reference coordinate system of the state image (hereinafter referred to as the reference coordinate system) refers to the coordinate system based on which the coordinate values of the pixels in the state image are determined. The reference coordinate system can be a two-dimensional coordinate system (i.e., a planar coordinate system, including an x-axis and a y-axis) or a three-dimensional coordinate system (including an x-axis, a y-axis, and a z-axis).

[0076] When the pixels in the state image are represented by camera coordinate values, the reference coordinate system of the state image is the camera coordinate system of the camera that captures the state image.

[0077] Please refer to Figure 3 , Figure 3 is a schematic diagram of a state image captured in a driving perspective provided in an embodiment of the present application. Figure 3 In the state image, w represents the width of the state image, and h represents the height of the state image. In order to make the pixels in the state image have certain regularity for subsequent data processing, in this embodiment of the present application, a coordinate system in which one coordinate axis is parallel to the straight line where the width of the state image is located and the other coordinate axis is parallel to the straight line where the height of the state image is located is taken as the reference coordinate system of the state image.

[0078] Please refer to Figure 4 , Figure 4 is a scene diagram of a reference coordinate system corresponding to each pixel point in a state image provided in an embodiment of the present application.

[0079] For example, taking the shape of the state image as a rectangle, in the embodiment of the present application, the lower left corner pixel point of the state image can be taken as the origin of the coordinate system, the straight line where the lower left corner pixel point and the lower right corner pixel point of the state image are located (i.e. the straight line parallel to the width of the state image) can be taken as the x-axis, the straight line where the lower left corner pixel point and the upper left corner pixel point of the state image are located (i.e. the straight line parallel to the height of the state image) can be taken as the y-axis, the direction of the lower left corner pixel point along the direction of the lower right corner pixel point can be taken as the x-axis direction, and the direction of the lower left corner pixel point along the direction of the upper left corner pixel point can be taken as the y-axis direction, to establish the reference coordinate system, as shown in Figure 4 .

[0080] According to the coordinate conversion relationship between the reference coordinate system and the camera coordinate system shown in Figure 4 , the camera coordinate value of the lower left corner pixel point of the state image can be converted to (0, 0), the camera coordinate value of the lower right corner pixel point can be converted to (n, 0), the camera coordinate value of the upper left corner pixel point can be converted to (0, m), and the camera coordinate value of the upper right corner pixel point can be converted to (n, m), where n represents the coordinate difference value (denoted as n) of the lower left corner pixel point and the lower right corner pixel point in the x-axis direction, and m represents the coordinate difference value (denoted as m) of the lower left corner pixel point and the upper left corner pixel point in the y-axis direction.

[0081] It can be understood that Figure 4 the relationship between the reference coordinate system and the state image shown in may be adjusted according to actual conditions. For example, the upper left corner pixel point of the state image can be taken as the origin of the coordinate system, the direction of the lower left corner pixel point along the direction of the lower right corner pixel point can be taken as the y-axis direction, the straight line where the lower left corner pixel point and the lower right corner pixel point of the state image are located can be taken as the y-axis, or the straight line where the lower left corner pixel point and the upper left corner pixel point of the state image are located can be taken as the z-axis, and so on to establish the reference coordinate system in any form.

[0082] That is, according to the actual conditions, the camera coordinate values of the pixel points in the state image can be further converted to represent the pixel points in different forms, to facilitate subsequent calculations. In addition, in the subsequent calculations, the camera coordinate values of the pixel points can also not be converted, but the camera coordinate values can be directly used to represent the coordinate positions of the pixel points.

[0083] For the convenience of understanding, in the subsequent text of the embodiment of the present application, the camera coordinate values of the pixel points in the state image are converted to the coordinate values in the reference coordinate system as shown in Figure 4 , and the pixel points in the state image are represented in the reference coordinate system as shown in Figure 2The coordinate values in the reference coordinate system shown are described as an example.

[0084] S20, performing lane line detection processing on the state image to obtain a set of lane line position points of the state image.

[0085] The lane line position point refers to a pixel point where a lane line in the state image is located. The set of lane line position points refers to a set of pixel points where lane lines in the state image are located. For example, Figure 2 Figure 4 Each pixel point where the lane lines A, B and C are located is a lane line position point of the state image, and the set of each pixel point where the lane lines A, B and C are located constitutes the set of lane line position points.

[0086] In some embodiments, the state image can be subjected to lane line detection processing based on an existing lane line detection algorithm, and all pixel points of lane lines contained in the state image are preliminarily detected, so as to obtain the set of lane line position points of the state image.

[0087] In some embodiments, all lane lines in the state image can be detected by a lane line detection network based on deep learning.

[0088] For example, first, based on a training data set (including multiple images containing lane lines), a preset lane line detection network is trained, so that the trained lane line detection network learns the features of the lane lines, thereby obtaining (which is suitable for detecting all pixel points where lane lines in an image are located according to an image).

[0089] Then, the state image is input into the trained lane line detection network, so that the trained lane line detection network performs lane line detection processing on the state image, and predicts all pixel points of lane lines contained in the state image, thereby obtaining the set of lane line position points of the state image.

[0090] Since the network based on deep learning has good prediction performance for high noise conditions, by using the lane line detection network based on deep learning to perform lane line detection processing on the state image, the lane line position points in the state image can be more efficiently and accurately fitted.

[0091] S30, obtaining data of a first reference point and data of a second reference point of the to-be-detected lane line from the set of lane line position points.

[0092] ​The first reference point refers to a pixel point with the minimum coordinate value of the second coordinate axis among the lane line position points with the coordinate value of the first coordinate axis less than the first preset threshold. The second reference point refers to a pixel point with the minimum coordinate value of the second coordinate axis among the lane line position points with the coordinate value of the first coordinate axis greater than the first preset threshold. The first coordinate axis and the second coordinate axis are coordinate axes in a reference coordinate system of the state image, and the first coordinate axis and the second coordinate axis are in a perpendicular relationship.

[0093] The first coordinate axis and the second coordinate axis are names defined for distinction. It can be understood that the first coordinate axis and the second coordinate axis can be an x axis or a y axis in a plane coordinate system, or an x axis, a y axis, or a z axis in a three-dimensional coordinate system. In the embodiments of the present application, the first coordinate axis refers to a coordinate axis parallel to a straight line on which the width of the state image is located, and the second coordinate axis refers to a coordinate axis parallel to a straight line on which the height of the state image is located.

[0094] The directions of the first coordinate axis and the second coordinate axis can be set according to specific conditions, and the directions of the first coordinate axis and the second coordinate axis are not limited herein. For example, as shown in FIG. 1, the direction of the first coordinate axis can be a direction of a lower-left pixel point along a lower-right pixel point. Alternatively, the direction of the first coordinate axis can be a direction of a lower-right pixel point along a lower-left pixel point. Figure 4

[0095] The data of the first reference point and the data of the second reference point can be represented by coordinate values.

[0096] Specifically, first, on the one hand, lane line position point data with the coordinate value of the first coordinate axis less than the first preset threshold is obtained from the set of lane line position points, to obtain a set of first pixel points. On the other hand, lane line position point data with the coordinate value of the first coordinate axis greater than the first preset threshold is obtained from the set of lane line position points, to obtain a set of second pixel points.

[0097] Then, on the one hand, pixel point data with the minimum coordinate value of the second coordinate axis is obtained from the set of first pixel points, as data of the first reference point of the lane line to be detected. On the other hand, pixel point data with the minimum coordinate value of the second coordinate axis is obtained from the set of second pixel points, as data of the second reference point of the lane line to be detected.

[0098] Please continue to refer to Figure 5 and Figure 5 wherein, Figure 5 is a scene schematic diagram of the first reference point and the second reference point provided in the embodiments of the present application. For example, the first coordinate axis is an x axis, the second coordinate axis is a y axis, and the first preset threshold takes a value of 0. ​The lane line position points with coordinate values of the first coordinate axis (i.e., the x-axis) less than the first preset threshold value are pixel points where the lane line 1 and the lane line 2 are located; the pixel point with the minimum coordinate value of the second coordinate axis (i.e., the y-axis) among the pixel points where the lane line 1 and the lane line 2 are located is point A (a pixel point on the lane line 2), as shown in FIG. 4. Figure 5 The lane line position points with coordinate values of the first coordinate axis (i.e., the x-axis) greater than the first preset threshold value are pixel points where the lane line 3 and the lane line 4 are located; the pixel point with the minimum coordinate value of the second coordinate axis (i.e., the y-axis) among the pixel points where the lane line 3 and the lane line 4 are located is point B (a pixel point on the lane line 3), as shown in FIG. 5. Figure 4

[0099] The first preset threshold value can be set according to experience, and the first preset threshold value is merely an example and can be set according to actual conditions, without being limited thereto. As long as part of the pixel points of one of the two lane lines to be detected have coordinate values of the first coordinate axis less than the first preset threshold value, and part of the pixel points of the other lane line have coordinate values of the first coordinate axis greater than the first preset threshold value.

[0100] It can be understood that, Figure 5 and Figure 4 The coordinates shown in FIGS. 4 and 5 and the coordinates exemplified in the embodiments of the present application are merely for illustration, and after reference to the coordinate system transformation, the modification of the corresponding coordinate data in order to achieve the detection of the lane line is an equivalent scheme. For example, Figure 4 In the coordinate system shown in FIG. 6, if the x-axis and the y-axis are exchanged, the first coordinate axis is the y-axis and the second coordinate axis is the x-axis.

[0101] S40, clustering each point in the set of lane line position points to obtain a first clustering point set of the first reference point and a second clustering point set of the second reference point.

[0102] Specifically, step S40 can specifically include: obtaining a first Hamming distance of the lane line position point from the first reference point and a second Hamming distance of the lane line position point from the second reference point; clustering each point in the set of lane line position points according to the first Hamming distance and the second Hamming distance to obtain a first clustering point set of the first reference point and a second clustering point set of the second reference point.

[0103] The first Hamming distance refers to a Hamming distance of the lane line position point from the first reference point in the state image; specifically, a position difference of the lane line position point from the first reference point. The second Hamming distance refers to a Hamming distance of the lane line position point from the second reference point in the state image; specifically, a position difference of the lane line position point from the second reference point.

[0104] ​For example, if the coordinate position of the lane line position point is (0, 1) and the coordinate position of the first reference point is (0, 3), the position difference (i.e., the first Hamming distance) between the lane line position point (0, 1) and the first reference point (0, 3) can be determined as 2 units of coordinate distance.

[0105] For another example, if the coordinate position of the lane line position point is (1, 1) and the coordinate position of the second reference point is (0, 3), the position difference (i.e., the second Hamming distance) between the lane line position point (0, 1) and the second reference point (0, 3) can be determined as: 3 units of coordinate distance.

[0106] In some embodiments, a clustering process is performed on each point in the set of lane line position points, including the following steps (1) to (4), wherein:

[0107] (1) The first reference point is clustered into a first cluster point set (denoted as k1), and the second reference point is clustered into a second cluster point set (denoted as k2).

[0108] (2) Each point in the set of lane line position points (denoted as K) is traversed. On the one hand, from K, the lane line position points with a first Hamming distance less than a preset position difference (such as 2 units of coordinate distance) are obtained and clustered into k1. On the other hand, from K, the lane line position points with a second Hamming distance less than a preset position difference (such as 3 units of coordinate distance) are obtained and clustered into k2.

[0109] (3) Each point remaining in K is traversed. When a target pixel point (denoted as pos1) with a position difference less than a preset position difference from any pixel point in k1 is detected, pos1 is clustered into k1. When a target pixel point (denoted as pos2) with a position difference less than a preset position difference from any pixel point in k2 is detected, pos2 is clustered into k2.

[0110] (4) The above step (3) is iterated until the number of pixel points in k1 and k2 both satisfy a preset number, obtaining the first cluster point set of the first reference point and the second cluster point set of the second reference point. So that a lane line can be fitted based on each point in the first cluster point set (k1), and a lane line can be fitted based on each point in the k2 set.

[0111] The first cluster point set refers to a pixel point set containing the first reference point and the lane line position point, and the pixel points contained therein satisfy a preset distance difference condition. The pixel points satisfy the preset distance difference condition, which means that for each pixel point in the first cluster point set, there is always a pixel point with a position difference less than the preset position difference.

[0112] The second clustering point set refers to a pixel point set containing the second reference point and the lane line position point and satisfying a preset distance difference condition. The pixel point satisfying the preset distance difference condition refers to that for each pixel point in the second clustering point set, there is always a pixel point with a position difference less than a preset position difference.

[0113] The specific value of the preset position difference can be set according to experience or actual demand. The preset position difference is only an example, and can be set according to actual conditions, without being limited thereto.

[0114] From the above, it can be seen that the pixel points in the lane line position point set are clustered into the first clustering point set and the second clustering point set according to the first Hamming distance of the lane line position point from the first reference point, the second Hamming distance of the lane line position point from the second reference point, and the preset position difference. Since the position difference between the pixel points on the same lane line is relatively small, the pixel points on the same lane line are clustered by comparing the size relationship between the first Hamming distance and the second Hamming distance and the preset position difference, thereby improving the detection accuracy of the lane line.

[0115] S50, respectively, the first clustering point set, the second clustering point set is subjected to curve fitting processing, obtains the first curve data of the lane line to be detected, and the second curve data.

[0116] The first curve data and the second curve data are used to indicate the lane line to be detected. Specifically, the first curve data and the second curve data are respectively used to indicate two different lane lines of the same lane.

[0117] In some embodiments, specifically, according to a preset polynomial, the points in the first clustering point set are subjected to fitting processing to obtain the first curve data of the lane line to be detected. According to the preset polynomial, the points in the second clustering point set are subjected to fitting processing to obtain the second curve data of the lane line to be detected.

[0118] The preset polynomial can be any order polynomial, such as a first-order polynomial, a second-order polynomial, a third-order polynomial, etc., which can be preset according to actual demand. For example, when the lane line to be detected is a straight line, the preset polynomial can adopt a first-order polynomial, which can be represented as shown in the following formula (1):

[0119] f(x)=bx+c Formula (1)

[0120] wherein f(x) represents the vertical coordinate value of each point in the first clustering point set (or the second clustering point set); x represents the horizontal coordinate value of each point in the first clustering point set (or the second clustering point set); b and c are constants, which are determined by the curve feature of the curve formed by each point in the first clustering point set (or the second clustering point set). Each parameter in the preset polynomial is an unknown number.

[0121] For example, when the to-be-detected lane line is a straight line or a curve, the preset polynomial can also be a second-order polynomial, which is shown in the following formula (2), and the preset polynomial can be represented as:

[0122] f(x) = ax 2 + bx + c formula (2)

[0123] wherein f k (x) represents the vertical coordinate value of each point in the first clustering point set (or the second clustering point set); x represents the horizontal coordinate value of each point in the first clustering point set (or the second clustering point set); a, b, and c are constants, which are determined by the curve feature of the curve formed by each point in the first clustering point set (or the second clustering point set). Each parameter in the preset polynomial is an unknown number.

[0124] For example, according to the above formula (2), the fitting processing is performed on each point in the first clustering point set, and the first curve data of the to-be-detected lane line (represented as f1(x) = a1x 2 + b1x + c1, wherein a1, b1, and c1 are constants) is obtained. According to the formula (2), the fitting processing is performed on each point in the second clustering point set, and the second curve data of the to-be-detected lane line (represented as f2(x) = a2x 2 + b2x + c2, wherein a2, b2, and c2 are constants) is obtained.

[0125] As can be seen from the above, by considering the positional characteristics of the target lane in the state image, the pixel with the smallest coordinate value on the second coordinate axis among the lane line position points whose coordinate value on the first coordinate axis is less than a first preset threshold is obtained from the set of lane line position points, and this pixel is used as the first reference point data for the lane line to be detected. Similarly, the pixel with the smallest coordinate value on the second coordinate axis among the lane line position points whose coordinate value on the first coordinate axis is greater than the first preset threshold is obtained from the set of lane line position points, and this pixel is used as the second reference point data for the lane line to be detected. Based on the data from the first and second reference points, pixel clustering is performed to obtain the first cluster point set and the second cluster point set corresponding to the lane line to be detected. Then, the first curve data and the second curve data of the lane line to be detected can be fitted based on the first and second cluster point sets, respectively. This allows for the accurate acquisition of pixels on both lane lines of the target lane as the first and second reference points, ensuring that each point in the first and second cluster point sets used to fit the lane line to be detected represents a pixel on one of the two lane lines of the target lane, thereby improving the lane line detection accuracy.

[0126] From a driving perspective, lane lines at points far from the vehicle in the status image often intersect, and the clarity of distant lane lines is relatively poor. Therefore, to improve lane line detection accuracy, these pixels that negatively impact detection accuracy can be filtered out.

[0127] Therefore, in some embodiments of this application, step S30 may specifically include: obtaining a set of target position points whose coordinate values ​​on the second coordinate axis are less than a second preset threshold from the set of lane line position points; and obtaining data of the first reference point and the second reference point of the lane line to be detected from the set of target position points.

[0128] For example, such as Figure 6 As shown, when the coordinate value of the top left pixel of the state image on the second coordinate axis is greater than the coordinate value of the bottom left pixel of the state image on the second coordinate axis, the pixel whose coordinate value on the second coordinate axis is less than the second preset threshold (e.g., the second preset threshold is 32m) is obtained from the set of lane line position points and used as the target position point, thus obtaining the set of target position points.

[0129] Correspondingly, at this time, the set of target location points refers to the pixel points in the set of lane line location points whose coordinate values ​​on the second coordinate axis are less than the second preset threshold.

[0130] Please refer to Figure 6 , Figure 6is another scenario diagram of the reference coordinate system corresponding to each pixel point in the state image provided in the embodiments of the present application. In some embodiments, step S30 can specifically include: obtaining, from the set of lane line position points, a set of target position points with a coordinate value of the second coordinate axis greater than a second preset threshold; and obtaining data of the first reference point and data of the second reference point of the to-be-detected lane line from the set of target position points.

[0131] Figure 6 In the middle, the upper right corner pixel point of the state image is taken as the origin of the coordinate system, the straight line (i.e., the straight line parallel to the width of the state image) where the upper left corner pixel point and the upper right corner pixel point of the state image are located is taken as the x-axis, the straight line (i.e., the straight line parallel to the height of the state image) where the lower left corner pixel point and the upper left corner pixel point of the state image are located is taken as the y-axis, the direction of the upper left corner pixel point along the direction of the upper right corner pixel point is taken as the x-axis direction, and the direction of the upper left corner pixel point along the direction of the lower left corner pixel point is taken as the y-axis direction, to establish the reference coordinate system.

[0132] For example, as shown in Figure 3 When the coordinate value of the upper left corner pixel point of the state image on the second coordinate axis is less than the coordinate value of the lower left corner pixel point of the state image on the second coordinate axis, the pixel point with a coordinate value of the second coordinate axis greater than a second preset threshold (for example, the second preset threshold is ) is obtained from the set of lane line position points as a target position point, so as to obtain the set of target position points.

[0133] Correspondingly, at this time, the set of target position points refers to the pixel point with a coordinate value of the second coordinate axis greater than the second preset threshold in the set of lane line position points.

[0134] The second preset threshold can be set according to experience, and the above second preset threshold is only an example, and can be set according to actual conditions, without being limited thereto.

[0135] Please continue to refer to Figure 4 , Figure 6 , Figure 4 It can be seen that the purposes of the above two embodiments of step S30 are both to filter out the pixel points in the upper half of the height of the state image, and only the coordinate values of the pixel points are transformed in the coordinate form, so the filtering conditions of the coordinate values are adjusted correspondingly.

[0136] As can be seen from the above, by obtaining the set of target position points with a coordinate value of the second coordinate axis less than a second preset threshold (or obtaining the set of target position points with a coordinate value of the second coordinate axis greater than a second preset threshold) from the set of lane line position points, and then obtaining the data of the first reference point and the data of the second reference point of the to-be-detected lane line from the set of target position points, the pixel points affecting the detection accuracy of the lane line can be filtered out, so as to improve the detection accuracy of the lane line.

[0137] After filtering the upper half of the height of the state image, a set of target position points is obtained. At this time, "obtaining the data of the first reference point and the data of the second reference point of the lane line to be detected from the set of target position points" can include: obtaining lane line position point data with a coordinate value of the first coordinate axis less than a first preset threshold from the set of target position points to obtain a first initial point set; and obtaining lane line position point data with a coordinate value of the first coordinate axis greater than the first preset threshold from the set of target position points to obtain a second initial point set; obtaining pixel point data with the smallest coordinate value of the second coordinate axis from the first initial point set as the data of the first reference point of the lane line to be detected; and obtaining pixel point data with the smallest coordinate value of the second coordinate axis from the second initial point set as the second reference point data of the lane line to be detected.

[0138] The first initial point set refers to a set of lane line position points in the set of target position points with a coordinate value of the first coordinate axis less than a first preset threshold. The second initial point set refers to a set of lane line position points in the set of target position points with a coordinate value of the first coordinate axis greater than the first preset threshold.

[0139] Specifically, since "obtaining the data of the first reference point and the data of the second reference point of the lane line to be detected from the set of target position points" is different from "obtaining the data of the first reference point and the data of the second reference point of the lane line to be detected from the set of lane line position points" in step S30 in that it is obtained from the "set of target position points" or from the "set of lane line position points". The specific implementation of "obtaining the data of the first reference point and the data of the second reference point of the lane line to be detected from the set of target position points" can refer to the above description and examples in step S30, and will not be repeated here.

[0140] It can be seen from the above that, by classifying the lane line position points according to the size relationship between the coordinate value of the target position point on the first coordinate axis and the first preset threshold, the first initial point set and the second initial point set are obtained; the pixel points in the state image are divided into two parts, that is, the pixel points of the two lane lines of the target lane are classified into two different pixel point sets. Then, the data of the first reference point and the data of the second reference point are obtained from the first initial point set and the second initial point set respectively. On the one hand, it is ensured that the obtained data of the first reference point is the pixel point of one lane line of the target lane, and the data of the second reference point is the pixel point of the other lane line of the target lane. On the other hand, since the position characteristics of the target lane in the state image are considered, the pixel point data with the minimum coordinate value on the second coordinate axis is obtained, so that the pixel points on the two lane lines of the target lane can be accurately obtained as the first reference point and the second reference point.

[0141] At this time, step S40 can specifically include: obtaining a third Hamming distance between the target position point and the first reference point, and a fourth Hamming distance between the target position point and the second reference point; and performing clustering processing on each point in the set of target position points according to the third Hamming distance and the fourth Hamming distance, to obtain a first clustering point set of the first reference point and a second clustering point set of the second reference point.

[0142] The third Hamming distance refers to the Hamming distance between the target position point and the first reference point in the state image, and specifically refers to the position difference between the target position point and the first reference point. The fourth Hamming distance refers to the Hamming distance between the target position point and the second reference point in the state image, and specifically refers to the position difference between the target position point and the second reference point.

[0143] Specifically, since the clustering processing is performed on each point in the set of target position points to obtain the first clustering point set of the first reference point and the second clustering point set of the second reference point, and the clustering processing is performed on each point in the set of lane line position points to obtain the first clustering point set of the first reference point and the second clustering point set of the second reference point in step S40, the difference between the two lies in that the clustering processing is performed on each point in the set of target position points or the set of lane line position points. Therefore, the specific implementation of the clustering processing performed on each point in the set of target position points to obtain the first clustering point set of the first reference point and the second clustering point set of the second reference point can refer to the description and examples in step S40 above, and will not be described here.

[0144] It can be seen from the above that the pixel points in the set of target position points are clustered into the first set of clustering points and the second set of clustering points by the third Hamming distance between the target position points and the first reference point, the fourth Hamming distance between the target position points and the second reference point, and the preset position difference. Since the position difference between the pixel points on the same lane line is relatively small, the pixel points on the same lane line are clustered by comparing the size relationship between the third Hamming distance and the fourth Hamming distance and the preset position difference, thereby improving the detection accuracy of the lane line.

[0145] On the basis of detecting two different lane lines of the same lane by the lane line detection method, the vehicle whether deviates from the straight lane can be further detected in the embodiment of the application. That is, the lane line detection method of the embodiment of the application further includes the following steps A1-A3.

[0146] A1, at least two state images containing the lane line to be detected in the vehicle driving state are acquired to be used as the reference state image and the comparison state image respectively.

[0147] The generation time of the comparison state image lags behind the generation time of the reference state image.

[0148] In order to improve the accuracy of detecting whether the vehicle deviates from the straight lane, the lane image captured at the driving angle can be acquired as the state image containing the lane line to be detected. The camera for capturing the state image can be installed at the middle field of view in front of the vehicle.

[0149] A2, the first curve data corresponding to the reference state image and the second curve data corresponding to the reference state image are acquired; and the first curve data corresponding to the comparison state image and the second curve data corresponding to the comparison state image are acquired.

[0150] According to the lane line detection method, the first curve data corresponding to the reference state image and the second curve data corresponding to the reference state image are acquired; and the first curve data corresponding to the comparison state image and the second curve data corresponding to the comparison state image are acquired.

[0151] The first curve data corresponding to the reference state image and the second curve data corresponding to the reference state image indicate the positions of the two (straight) lane lines of the straight lane where the vehicle is located in the image at the previous time.

[0152] The first curve data corresponding to the comparison state image and the second curve data corresponding to the comparison state image indicate the positions of the two (straight) lane lines of the straight lane where the vehicle is located in the image at the later time.

[0153] The pixel points in the reference state image and the pixel points in the comparison state image can be represented by coordinate values, and the reference coordinate system of the reference state image and the reference coordinate system of the comparison state image should be the same, so as to facilitate subsequent comparison of the curve data between the reference state image and the comparison state image to determine whether the vehicle is in a lane deviation state.

[0154] A3, determining whether the vehicle is in a lane deviation state according to the first curve data corresponding to the reference state image, the second curve data corresponding to the reference state image, the first curve data corresponding to the comparison state image, and the second curve data corresponding to the comparison state image.

[0155] In some embodiments, in one aspect, it is detected whether the first curve data corresponding to the reference state image is the same as the first curve data corresponding to the comparison state image. In another aspect, it is detected whether the second curve data corresponding to the reference state image is the same as the second curve data corresponding to the comparison state image.

[0156] When it is detected that the first curve data corresponding to the reference state image is the same as the first curve data corresponding to the comparison state image, and it is detected that the second curve data corresponding to the reference state image is the same as the second curve data corresponding to the comparison state image, it is determined that the vehicle is not in a lane deviation state. Otherwise, it is determined that the vehicle is in a lane deviation state.

[0157] Further, when it is detected that the vehicle does not turn on the left or right turn signal, and it is detected that the vehicle is in a deviation state, a lane deviation warning can be output. For example, a warning prompt sound, information such as "You have deviated from the lane, please pay attention to safe driving", etc. can be output.

[0158] As can be seen from the above, by comparing the curve data of the lane lines determined by the state images (i.e. the reference state image and the comparison state image) at the previous and subsequent moments, it is determined whether the vehicle is in a lane deviation state, and a prompt can be timely output when the vehicle is in a lane deviation state, so as to ensure that the vehicle can normally travel on the same lane, and the safety of the vehicle traveling is improved.

[0159] In some embodiments, step A3 can specifically include steps A31-A34.

[0160] A31, determining the first reference point data and the second reference point data corresponding to the reference state image, respectively, according to the first curve data corresponding to the reference state image and the second curve data corresponding to the reference state image.

[0161] For the convenience of understanding, please continue to refer to Figure 7 .

[0162] In some embodiments, the first curve data corresponding to the reference state image corresponds to a lane line (denoted as A1), and the pixel points of the lane line A1 have a value range on the second coordinate axis yi, 1≤i≤m1, where m1 is an integer greater than or equal to 1. The first reference point data refers to the coordinate value yi of the ith pixel point on the second coordinate axis in the n1 pixel points where the lane line A1 is located in the reference state image, where 1≤n1≤m1, and n1 is a positive integer.

[0163] The second curve data corresponding to the reference state image corresponds to a lane line (denoted as A2), and the pixel points of the lane line A2 have a value range on the second coordinate axis yi, 1≤i≤m2, where m2 is an integer greater than or equal to 1. The second reference point data refers to the coordinate value yi of the ith pixel point on the second coordinate axis in the n2 pixel points where the lane line A2 is located in the reference state image, where 1≤n2≤m2, and n2 is a positive integer.

[0164] A32, respectively determine the first comparison point data and the second comparison point data corresponding to the comparison state image according to the first curve data corresponding to the comparison state image and the second curve data corresponding to the comparison state image.

[0165] In some embodiments, corresponding to the first reference point data and the second reference point data in A31, the first curve data corresponding to the comparison state image corresponds to a lane line (denoted as B1), and the pixel points of the lane line B1 have a value range on the second coordinate axis yi, 1≤i≤m1, where m1 is an integer greater than or equal to 1. The first comparison point data refers to the coordinate value yi of the ith pixel point on the second coordinate axis in the n1 pixel points where the lane line B1 is located in the comparison state image, where 1≤n1≤m1, and n1 is a positive integer.

[0166] The second curve data corresponding to the comparison state image corresponds to a lane line (denoted as B2), and the pixel points of the lane line B2 have a value range on the second coordinate axis yi, 1≤i≤m2, where m2 is an integer greater than or equal to 1. The second reference point data refers to the coordinate value yi of the ith pixel point on the second coordinate axis in the n2 pixel points where the lane line B2 is located in the comparison state image, where 1≤n2≤m2, and n2 is a positive integer.

[0167] A33, detect the first difference data between the first reference point data and the first comparison point data, and the second difference data between the second reference point data and the second comparison point data.

[0168] In some embodiments, the first difference data refers to a difference between a coordinate value yi of the i-th pixel on the second coordinate axis in n1 pixels where the lane line A1 is located and a coordinate value yi of the i-th pixel on the second coordinate axis in n1 pixels where the lane line B1 is located.

[0169] The second difference data refers to a difference between a coordinate value yi of the i-th pixel on the second coordinate axis in n2 pixels where the lane line A2 is located and a coordinate value yi of the i-th pixel on the second coordinate axis in n2 pixels where the lane line B2 is located.

[0170] A34, according to the first difference data and the second difference data, determining whether the vehicle is in a lane deviation state.

[0171] In some embodiments, specifically, it is detected whether the first difference data is greater than a third preset threshold value and whether the second difference data is greater than the third preset threshold value. When it is detected that both the first difference data and the second difference data are greater than the third preset threshold value, it is determined that the vehicle is not in the lane deviation state. Otherwise, it is determined that the vehicle is in the lane deviation state.

[0172] The value of the third preset threshold value can be set according to experience or actual demand, and the specific value of the third preset threshold value is not limited herein.

[0173] Further, after it is detected that the vehicle is not in the lane deviation state, it is detected a size relationship between the first difference data and the second difference data. When it is detected that the first difference data is greater than the second difference data, it is determined that the vehicle deviates to the left lane, and when it is detected that the first difference data is less than the second difference data, it is determined that the vehicle deviates to the right lane.

[0174] Or when it is detected that the first difference data is greater than the second difference data, it is determined that the vehicle deviates to the right lane, and when it is detected that the first difference data is less than the second difference data, it is determined that the vehicle deviates to the left lane.

[0175] As can be seen from the above, by determining the first difference data and the second difference data corresponding to the lane line positions (the positions of the two lane lines of the same lane in the image) at the previous and subsequent time according to the first reference point data and the second reference point data corresponding to the reference state image and the first comparison point data and the second comparison point data corresponding to the comparison state image, the pixel position transformation of the same lane in the image when driving in the lane can be detected, and then it can be accurately determined whether the vehicle deviates from the lane.

[0176] In order to better implement the lane line detection method in the embodiments of the present application, on the basis of the lane line detection method, a lane line detection device is further provided in the embodiments of the present application, such as Figures 1 to 6As shown, it is an embodiment structure schematic diagram of a lane line detection device in the present application, the lane line detection device 700 comprises:

[0177] A first acquisition unit 701 is configured to acquire a state image containing a lane line to be detected;

[0178] A detection unit 702 is configured to perform lane line detection processing on the state image to obtain a set of lane line position points of the state image, wherein the lane line position point refers to a pixel point where a lane line in the state image is located;

[0179] A second acquisition unit 703 is configured to acquire data of a first reference point and data of a second reference point of the lane line to be detected from the set of lane line position points, wherein the first reference point refers to a pixel point with the minimum coordinate value on a second coordinate axis among lane line position points with a coordinate value on a first coordinate axis less than a first preset threshold, the second reference point refers to a pixel point with the minimum coordinate value on the second coordinate axis among lane line position points with a coordinate value on the first coordinate axis greater than the first preset threshold, and the first coordinate axis is perpendicular to the second coordinate axis;

[0180] A clustering unit 704 is configured to perform clustering processing on each point in the set of lane line position points to obtain a first set of clustered points of the first reference point and a second set of clustered points of the second reference point;

[0181] A fitting unit 705 is configured to perform curve fitting processing on the first set of clustered points and the second set of clustered points respectively to obtain first curve data and second curve data of the lane line to be detected, wherein the first curve data and the second curve data are used to indicate the lane line to be detected.

[0182] In some embodiments of the present application, the clustering unit 704 is specifically further configured to:

[0183] acquire a first Hamming distance of the lane line position point from the first reference point and a second Hamming distance of the lane line position point from the second reference point;

[0184] perform clustering processing on each point in the set of lane line position points according to the first Hamming distance and the second Hamming distance to obtain the first set of clustered points of the first reference point and the second set of clustered points of the second reference point.

[0185] In some embodiments of the present application, the second acquisition unit 703 is specifically further configured to:

[0186] acquire a set of target position points with a coordinate value on the second coordinate axis less than a second preset threshold from the set of lane line position points;

[0187] From the set of target position points, data of a first reference point and data of a second reference point of the lane line to be detected are acquired.

[0188] In some embodiments of the present application, the second acquisition unit 703 is specifically further configured to:

[0189] From the set of target position points, lane line position point data with a coordinate value of the first coordinate axis less than a first preset threshold is acquired to obtain a first initial point set, and lane line position point data with a coordinate value of the first coordinate axis greater than the first preset threshold is acquired from the set of target position points to obtain a second initial point set.

[0190] From the first initial point set, pixel point data with the smallest coordinate value of the second coordinate axis is acquired as data of a first reference point of the lane line to be detected, and from the second initial point set, pixel point data with the smallest coordinate value of the second coordinate axis is acquired as data of a second reference point of the lane line to be detected.

[0191] In some embodiments of the present application, the clustering unit 704 is specifically further configured to:

[0192] A third Hamming distance of the target position point from the first reference point and a fourth Hamming distance of the target position point from the second reference point are acquired.

[0193] According to the third Hamming distance and the fourth Hamming distance, each point in the set of target position points is subjected to clustering processing to obtain a first clustering point set of the first reference point and a second clustering point set of the second reference point.

[0194] In some embodiments of the present application, the lane line detection apparatus further comprises a discrimination unit (not shown in the figure), which is specifically configured to:

[0195] At least two state images containing the lane line to be detected in a vehicle driving state are acquired as a reference state image and a comparison state image, respectively, wherein the generation time of the comparison state image lags behind the generation time of the reference state image.

[0196] First curve data corresponding to the reference state image and second curve data corresponding to the reference state image are acquired, and first curve data corresponding to the comparison state image and second curve data corresponding to the comparison state image are acquired.

[0197] According to the first curve data corresponding to the reference state image, the second curve data corresponding to the reference state image, the first curve data corresponding to the comparison state image, and the second curve data corresponding to the comparison state image, it is determined whether the vehicle is in a lane deviation state.

[0198] In some embodiments of the present application, the determining unit is specifically configured to:

[0199] According to the first curve data corresponding to the reference state image and the second curve data corresponding to the reference state image, first reference point data and second reference point data corresponding to the reference state image are respectively determined.

[0200] According to the first curve data corresponding to the comparison state image and the second curve data corresponding to the comparison state image, first comparison point data and second comparison point data corresponding to the comparison state image are respectively determined.

[0201] The first difference value data between the first reference point data and the first comparison point data, and the second difference value data between the second reference point data and the second comparison point data are detected.

[0202] According to the first difference value data and the second difference value data, it is determined whether the vehicle is in a lane deviation state.

[0203] In implementation, each of the above units can be implemented as an independent entity, or can be combined as the same or several entities, and the implementation of each of the above units can refer to the method embodiments above, which will not be repeated here.

[0204] Since the lane line detection device can perform the method of the present application as described above Figures 1 to 6 According to the steps in the lane line detection method of any embodiment, the method of the present application as described above Figure 8 According to the beneficial effects of the lane line detection method of any embodiment, which are described above, and will not be repeated here.

[0205] In addition, in order to better implement the lane line detection method of the embodiments of the present application, based on the lane line detection method, the embodiments of the present application also provide an electronic device, which is described in detail with reference to Figure 8 , Figures 1 to 6 A structural schematic diagram of an electronic device according to an embodiment of the present application is shown, and specifically, the electronic device provided by the embodiments of the present application includes a processor 801, which is configured to implement the steps of the lane line detection method of any embodiment of the present application when executing a computer program stored in a memory 802. Figure 7 According to the steps of the lane line detection method of any embodiment of the present application; or the processor 801 is configured to implement the steps of the lane line detection method of any embodiment of the present application when executing a computer program stored in the memory 802. Figures 1 to 6The functions of the units in the corresponding embodiments.

[0206] For example, the computer program can be divided into one or more modules / units, one or more modules / units are stored in the memory 802 and executed by the processor 801 to complete the embodiments of the present application. One or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the computer device.

[0207] The electronic device can include, but is not limited to, the processor 801, the memory 802. Those skilled in the art can understand that the schematic diagram is only an example of the electronic device and does not constitute a limitation on the electronic device, and can include more or fewer components than the schematic diagram, or combine certain components, or different components, for example, the electronic device can also include an input / output device, a network access device, a bus, etc. The processor 801, the memory 802, the input / output device, and the network access device are connected through the bus.

[0208] The processor 801 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor and the like. The processor is the control center of the electronic device, and connects all parts of the electronic device through various interfaces and lines.

[0209] The memory 802 can be used to store computer programs and / or modules, and the processor 801 implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory 802, and calling data stored in the memory 802. The memory 802 can mainly include a program storage area and a data storage area, wherein the program storage area can store operating systems, application programs required by at least one function (such as a sound playing function, an image playing function, etc.), etc.; and the data storage area can store data created according to the use of the electronic device (such as audio data, video data, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory devices.

[0210] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the lane line detection device, the electronic device and the corresponding units described above can be referred to as Figures 1 to 6 Corresponding to the description of the lane line detection method in any embodiment, the specific operations are not described here.

[0211] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by related hardware controlled by the instructions, which can be stored in a computer readable storage medium and loaded and executed by a processor.

[0212] Therefore, the embodiments of the present application provide a computer readable storage medium, which stores a plurality of instructions. The instructions can be loaded by a processor to execute the embodiments of the present application, such as Figures 1 to 6 Corresponding to the steps in the lane line detection method in any embodiment, the specific operations can be referred to as Figures 1 to 6 Corresponding to the description of the lane line detection method in any embodiment, the specific operations are not described here.

[0213] The computer readable storage medium can include a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0214] Due to the instructions stored in the computer readable storage medium, the embodiments of the present application, such as Figures 1 to 6 Corresponding to the steps in the lane line detection method in any embodiment, the specific operations can be referred to as ​Corresponding to the beneficial effects that can be achieved by the lane line detection method in any embodiment, the details are described above, and will not be repeated here.

[0215] The lane line detection method, device, electronic equipment and computer readable storage medium provided by the embodiments of the present application are described in detail above, and the principles and implementation modes of the present application are described by applying specific examples. The above embodiment description is only used to help understand the method and its core idea of the present application. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed. In summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A lane line detection method characterized by, The method comprises: acquiring a state image containing a lane line to be detected; performing lane line detection processing on the state image to obtain a set of lane line position points of the state image, wherein the lane line position point refers to a pixel point of a lane line in the state image; from the set of lane line position points, acquiring data of a first reference point and data of a second reference point of the lane line to be detected; wherein the first reference point refers to a pixel point with the smallest coordinate value on a second coordinate axis among lane line position points with a coordinate value on a first coordinate axis less than a first preset threshold; the second reference point refers to a pixel point with the smallest coordinate value on the second coordinate axis among lane line position points with a coordinate value on the first coordinate axis greater than the first preset threshold; the first coordinate axis is perpendicular to the second coordinate axis; performing clustering processing on each point in the set of lane line position points to obtain a first set of clustered points of the first reference point and a second set of clustered points of the second reference point; respectively performing curve fitting processing on the first set of clustered points and the second set of clustered points to obtain first curve data and second curve data of the lane line to be detected, wherein the first curve data and the second curve data are used to indicate the lane line to be detected; wherein the clustering processing on each point in the set of lane line position points to obtain the first set of clustered points of the first reference point and the second set of clustered points of the second reference point comprises: acquiring a first Hamming distance of the lane line position point from the first reference point and a second Hamming distance of the lane line position point from the second reference point; performing clustering processing on each point in the set of lane line position points according to the first Hamming distance and the second Hamming distance to obtain the first set of clustered points of the first reference point and the second set of clustered points of the second reference point.

2. The lane line detection method according to claim 1, characterized by, The acquisition of the data of the first reference point and the data of the second reference point of the lane line to be detected from the set of lane line position points comprises: from the set of lane line position points, acquiring a set of target position points with a coordinate value on the second coordinate axis less than a second preset threshold; from the set of target position points, acquiring the data of the first reference point and the data of the second reference point of the lane line to be detected.

3. The lane line detection method according to claim 2, characterized by, The acquisition of the data of the first reference point and the data of the second reference point of the lane line to be detected from the set of target position points comprises: from the set of target position points, acquiring lane line position point data with a coordinate value on the first coordinate axis less than a first preset threshold to obtain a first set of initial points; and from the set of target position points, acquiring lane line position point data with a coordinate value on the first coordinate axis greater than the first preset threshold to obtain a second set of initial points; From the first initial point set, the pixel point data with the minimum coordinate value on the second coordinate axis is obtained as the data of the first reference point of the lane line to be detected; and from the second initial point set, the pixel point data with the minimum coordinate value on the second coordinate axis is obtained as the second reference point data of the lane line to be detected.

4. The lane line detection method according to claim 3, characterized by, The clustering processing of each point in the lane line position point set comprises: obtaining the third Hamming distance of the target position point and the first reference point, and the fourth Hamming distance of the target position point and the second reference point; According to the third Hamming distance and the fourth Hamming distance, the clustering processing of each point in the target position point set is performed to obtain the first clustering point set of the first reference point and the second clustering point set of the second reference point.

5. The lane line detection method according to any one of claims 1 to 4, characterized by, The method further comprises: obtaining at least two state images containing the lane line to be detected in the vehicle driving state as the reference state image and the comparison state image respectively, wherein the generation time of the comparison state image lags behind the generation time of the reference state image; obtaining the first curve data corresponding to the reference state image and the second curve data corresponding to the reference state image; and obtaining the first curve data corresponding to the comparison state image and the second curve data corresponding to the comparison state image; determining whether the vehicle is in the lane deviation state according to the first curve data corresponding to the reference state image, the second curve data corresponding to the reference state image, the first curve data corresponding to the comparison state image, and the second curve data corresponding to the comparison state image.

6. The lane line detection method according to claim 5, characterized by, The determination of whether the vehicle is in the lane deviation state according to the first curve data corresponding to the reference state image, the second curve data corresponding to the reference state image, the first curve data corresponding to the comparison state image, and the second curve data corresponding to the comparison state image comprises: determining the first reference point data and the second reference point data corresponding to the reference state image respectively according to the first curve data corresponding to the reference state image and the second curve data corresponding to the reference state image; determining the first comparison point data and the second comparison point data corresponding to the comparison state image respectively according to the first curve data corresponding to the comparison state image and the second curve data corresponding to the comparison state image; detecting the first difference data between the first reference point data and the first comparison point data, and the second difference data between the second reference point data and the second comparison point data; determining whether the vehicle is in the lane deviation state according to the first difference data and the second difference data.

7. A lane line detection device characterized by comprising: The lane line detection device comprises: a first acquisition unit configured to acquire a state image containing a lane line to be detected; The detection unit is configured to perform lane line detection processing on the state image to obtain a set of lane line position points of the state image, wherein the lane line position point refers to a pixel point where a lane line in the state image is located. The second acquisition unit is configured to acquire data of a first reference point and data of a second reference point of the to-be-detected lane line from the set of lane line position points, wherein the first reference point refers to a pixel point with the minimum coordinate value on a second coordinate axis among lane line position points with a coordinate value on a first coordinate axis less than a first preset threshold, and the second reference point refers to a pixel point with the minimum coordinate value on the second coordinate axis among lane line position points with the coordinate value on the first coordinate axis greater than the first preset threshold, and the first coordinate axis is perpendicular to the second coordinate axis. The clustering unit is configured to perform clustering processing on each point in the set of lane line position points to obtain a first set of clustered points of the first reference point and a second set of clustered points of the second reference point. The fitting unit is configured to perform curve fitting processing on the first set of clustered points and the second set of clustered points respectively to obtain first curve data and second curve data of the to-be-detected lane line, wherein the first curve data and the second curve data are used to indicate the to-be-detected lane line. The clustering unit is specifically configured to: acquire a first Hamming distance of the lane line position point from the first reference point and a second Hamming distance of the lane line position point from the second reference point. According to the first Hamming distance and the second Hamming distance, each point in the set of lane line position points is clustered to obtain the first set of clustered points of the first reference point and the second set of clustered points of the second reference point.

8. An electronic device, comprising: The processor and the memory, wherein the memory stores a computer program, and the processor invokes the computer program in the memory to execute the lane line detection method in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer program is stored on the memory and is loaded by the processor to execute the steps in the lane line detection method in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Lane line detection method and device, electronic equipment and storage medium

    CN111126182A

  • Lane line detection method, device and computer readale storage medium

    CN111433780A