Lane line fitting method and device, electronic equipment and storage medium
Through the method of multiple lane line fitting and filtering discard points, the problems of unstable fitting effect and weak anti-interference ability in the existing technology are solved, and more accurate and stable lane line fitting is achieved.
Patent Information
- Application Number
- CN202410755318.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-09-10
AI Technical Summary
Existing lane line fitting methods are unstable in different road environments, have weak anti-interference capabilities, and are prone to misjudgment.
Through multiple lane line fittings, discarded points are screened and reused, and coordinate calculation, noise filtering, preprocessing and multiple fittings are used to improve the fitting stability and anti-interference ability, including coordinate calculation, noise filtering, preprocessing and Handling and optimal lane line matching.
The stability and anti-interference ability of lane line fitting are improved, misjudgments are reduced, and accurate lane line fitting is achieved.
Smart Images

Figure CN118628996A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a lane line fitting method, device, electronic equipment and storage medium. Background Art
[0002] Lane fitting is a key step in the post-processing of visual lane detection. Its main purpose is to transform the lane line image coordinate point data detected by vision into world coordinates through perspective coordinates, and then fit and filter the noise points to obtain the final lane line data. In the field of autonomous driving, it directly affects the vehicle's perception and decision-making of key information such as lane curvature and vehicle position. Therefore, the accuracy and stability of lane fitting are crucial to the performance of the autonomous driving system.
[0003] Traditional lane line fitting methods generally use polynomial fitting or straight line fitting, which can achieve certain results in internal test scenarios. However, in actual autonomous driving scenarios, the road environment is diverse, and the existing fitting methods are unstable in different road environments. At the same time, for some environmental factors, the single fitting method has weak anti-interference ability and is prone to misjudgment.
[0004] Therefore, the existing lane fitting method has technical problems such as unstable fitting effect, weak anti-interference ability, and easy misjudgment, which need to be improved. Summary of the invention
[0005] In view of this, it is necessary to provide a lane line fitting method, device, electronic device and storage medium to solve the technical problems in the prior art, such as unstable fitting effect, weak anti-interference ability and easy misjudgment.
[0006] In order to solve the above problems, on the one hand, the present invention provides a lane line fitting method, comprising: The obtained lane line detection scatter plot is used to calculate the coordinates to obtain the ground coordinates of each detection scatter point; Perform noise filtering on the detected scattered points according to the ground coordinates to obtain filtered scattered points and first pre-discarded points; Preprocessing the filtered scattered points to obtain a preprocessed lane line list and a second pre-discarded point; Performing a first lane line fitting on the preprocessed lane line list to obtain a first lane line list; Performing a second lane line fitting on the first lane line list, the first pre-discarded point, and the second pre-discarded point to obtain a second lane line list; The best lane line matching is performed on the second lane line list to obtain a lane line list after fitting.
[0007] In a possible implementation, coordinate calculation is performed on the acquired lane line detection scatter plot to obtain the ground coordinates of each detection scatter point, including: Determine the image size, intrinsic parameter matrix, rotation matrix and translation matrix according to the acquired lane line detection scatter plot; The rear axle of the vehicle is taken as the coordinate origin, the front of the vehicle is the positive direction of the x-axis, and the left direction perpendicular to the x-axis is the positive direction of the y-axis. The ground coordinates of each detection scatter point are obtained by performing inverse perspective transformation on the detection scatter points according to the image size, intrinsic parameter matrix, rotation matrix and translation matrix.
[0008] In a possible implementation, performing noise filtering on the detected scattered points according to the ground coordinates to obtain filtered scattered points and first pre-discarded points includes: The detection scattered points whose absolute values of the y-axis coordinates are greater than the preset first filtering threshold and the detection scattered points whose absolute values of the x-axis coordinates are greater than the preset second filtering threshold are eliminated to obtain filtered scattered points, and the detection scattered points whose absolute values of the x-axis coordinates are greater than the preset second filtering threshold are taken as the first pre-discarded points.
[0009] In a possible implementation, preprocessing the filtered scattered points to obtain a preprocessed lane line list and a second pre-discarded point includes: Calculate the straight-line distance between each filtered scattered point and the absolute value of the y-axis coordinate difference; Divide the filtered scattered points whose straight-line distance is less than a preset first preprocessing threshold and whose y-axis coordinate difference absolute value is less than a preset second preprocessing threshold into the same lane line, to obtain a plurality of lane lines; Delete the lane lines whose number of filtered scattered points is lower than the preset scattered point number threshold, form the remaining lane lines into a pre-processed lane line list, and use the filtered scattered points contained in the deleted lane lines as the second pre-discarded points.
[0010] In a possible implementation, performing a first lane line fitting on the preprocessed lane line list to obtain a first lane line list includes: Determine the slope and intercept of each lane line according to the preprocessed lane line list; Calculate the absolute value of the slope difference and the absolute value of the intercept difference between each lane; The lanes whose slope difference absolute value is less than a preset slope threshold and whose intercept difference absolute value is less than a preset intercept threshold are merged into the same lane line, and the pre-processed lane line list is updated to obtain a first lane line list.
[0011] In a possible implementation, performing a second lane line fitting on the first lane line list, the first pre-discarded point, and the second pre-discarded point to obtain a second lane line list includes: Determine the slope and intercept of each lane line according to the first lane line list; Calculate the discarded point slope and the discarded point intercept between each pre-discarded point and the minimum x-axis coordinate point of each lane line, and determine the absolute value of the difference between the discarded point slope and the slope of each lane line and the absolute value of the difference between the discarded point intercept and the intercept of each lane line according to the discarded point slope, the discarded point intercept and the slope and intercept of each lane line; The discarded points whose slope difference absolute value is less than the preset discarded point slope threshold and whose intercept difference absolute value is less than the preset discarded point intercept threshold are added to the corresponding first lane line to obtain a second lane line list.
[0012] In a possible implementation, performing optimal lane line matching on the second lane line list to obtain a lane line list after fitting includes: Traverse all the filtered scattered points in each lane line to obtain the slope and intercept of each adjacent filtered scattered point; In each lane line, the slope and intercept of each adjacent filtered scattered point are used as the straight line reference of the lane line to be selected, and the number of the filtered scattered points to be selected whose distance to the straight line reference in the lane line is less than a preset judgment threshold is determined; The candidate lane line with the largest number of candidate filtered scattered points is taken as the best lane, and the candidate filtered scattered points that meet the preset judgment threshold are added to the best lane to obtain a list of lane lines after fitting.
[0013] On the other hand, the present invention also provides a lane line fitting device, comprising: A coordinate calculation unit, used to calculate the coordinates of the acquired lane line detection scatter diagram to obtain the ground coordinates of each detection scatter point; A noise filtering unit, used for filtering the detected scattered points according to the ground coordinates to obtain filtered scattered points and first pre-discarded points; A preprocessing unit, used for preprocessing the filtered scattered points to obtain a preprocessed lane line list and a second pre-discarded point; A first fitting unit, used for performing a first lane line fitting on the preprocessed lane line list to obtain a first lane line list; A second fitting unit is used to perform a second lane line fitting on the first lane line list, the first pre-discarded point and the second pre-discarded point to obtain a second lane line list; The best lane line matching unit is used to perform best lane line matching on the second lane line list to obtain a lane line list after fitting.
[0014] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein: Memory for storing computer programs; The processor is coupled to the memory and is used to execute a computer program to implement the steps in the lane line fitting method described above.
[0015] On the other hand, the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above lane line fitting method are implemented.
[0016] The beneficial effect of adopting the above implementation method is: in the lane line fitting method provided by the present invention, the stability of the lane line fitting is improved by multiple lane line fittings, and the anti-interference ability of the lane line fitting is improved by screening the discarded points and re-fitting the pre-discarded points, thereby reducing misjudgment and achieving accurate fitting of the lane line. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 A schematic diagram of a process flow of an embodiment of the lane line fitting method provided by the present invention; Figure 2 A schematic diagram of a coordinate solution process of an embodiment of the present invention; Figure 3 A schematic diagram of the coordinates of the detection scattered points; Figure 4 Schematic diagram of noise filtering for detecting scattered points; Figure 5 A schematic diagram of the preprocessing process of an embodiment of the present invention; Figure 6 This is a schematic diagram of the process of first lane line fitting in an embodiment of the present invention; Figure 7 A schematic diagram of the process of the second lane line fitting according to an embodiment of the present invention; Figure 8 A schematic diagram of the process of optimal lane line matching according to an embodiment of the present invention; Fig. 9 A schematic diagram of the structure of an embodiment of the lane line fitting device provided by the present invention; Fig.10 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0020] It should be understood that the drawings of the schematic diagrams are not drawn to scale. The flowcharts used in the present invention illustrate the operations implemented according to some embodiments of the present invention. It should be understood that the operations of the flowcharts may be implemented out of order, and steps without logical contextual relationships may be reversed in order or implemented simultaneously. In addition, those skilled in the art may add one or more other operations to the flowcharts, or may remove one or more operations from the flowcharts, under the guidance of the content of the present invention.
[0021] Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor systems and / or microcontroller systems.
[0022] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0023] Figure 1 A schematic diagram of a process flow of an embodiment of the lane line fitting method provided by the present invention is shown in FIG. Figure 1 As shown, the lane line fitting method includes: S101, performing coordinate calculation on the acquired lane line detection scatter diagram to obtain the ground coordinates of each detection scatter point; S102, filtering the detected scattered points according to the ground coordinates to obtain filtered scattered points and first pre-discarded points; S103, pre-processing the filtered scattered points to obtain a pre-processed lane line list and a second pre-discarded point; S104, performing a first lane line fitting on the pre-processed lane line list to obtain a first lane line list; S105, performing a second lane line fitting on the first lane line list, the first pre-discarded point, and the second pre-discarded point to obtain a second lane line list; S106: Perform optimal lane line matching on the second lane line list to obtain a lane line list after fitting.
[0024] Compared with the prior art, the present invention improves the stability of lane line fitting through multiple lane line fitting, and improves the anti-interference ability of lane line fitting by screening discarded points and re-fitting the pre-discarded points, thereby reducing misjudgment and achieving accurate fitting of lane lines.
[0025] In some embodiments of the present invention, Figure 2 Schematic diagram of the coordinate solution process of an embodiment of the present invention, such as Figure 2 As shown, coordinate calculation is performed on the obtained lane line detection scatter plot to obtain the ground coordinates of each detection scatter point, including: S201, determining the image size, the intrinsic parameter matrix, the rotation matrix and the translation matrix according to the acquired lane line detection scatter plot; S202, taking the rear axle of the vehicle body as the coordinate origin, the front of the vehicle head as the positive direction of the x-axis, and the left direction perpendicular to the x-axis as the positive direction of the y-axis, the detection scattered points are subjected to inverse perspective transformation according to the image size, the intrinsic parameter matrix, the rotation matrix and the translation matrix to obtain the ground coordinates of each detection scattered point.
[0026] Specifically, the embodiment obtains scattered points on the lane line in a certain frame image through perception, and then converts them into three-dimensional ground coordinate points using the center point of the rear axle of the vehicle as the coordinate origin through the IPM (Inverse Perspective Mapping) method.
[0027] During the coordinate conversion process, a two-dimensional array (rows and columns in the image) is first used to describe the detection scatter points in the lane detection scatter plot, and the image size, internal parameter matrix, rotation matrix and translation matrix are determined. The embodiment uses the rear axle of the front of the vehicle as the coordinate origin, the front of the front of the vehicle as the positive direction of the x-axis, and the left direction of the vehicle body perpendicular to the coordinate axis as the positive direction of the y-axis. Then the coordinates of the pixel point are converted into homogeneous coordinate form, and then the homogeneous coordinates are multiplied by the inverse internal parameter matrix, and then multiplied by the rotation matrix to obtain the corresponding vector tempVec, and then the proportional relationship between the point on the ground plane and the point in the image is determined to obtain the scale factor scale, and finally the first two components of the vector tempVec are divided by the scale factor scale to obtain the coordinates of the corresponding point on the ground plane, and finally the coordinates are added to the translation vector to obtain the ground coordinates of the detection scatter points after the final mapping.
[0028] In some embodiments of the present invention, performing noise filtering on the detected scattered points according to the ground coordinates to obtain the filtered scattered points and the first pre-discarded points includes: The detection scattered points whose y-axis coordinate absolute value is greater than the preset first filtering threshold and the detection scattered points whose x-axis coordinate absolute value is greater than the preset second filtering threshold are eliminated to obtain filtered scattered points, and the detection scattered points whose x-axis coordinate absolute value is greater than the preset second filtering threshold are used as the first pre-discarded points.
[0029] Specifically, in order to reduce the influence of noise on the lane line fitting effect, the noise needs to be filtered before the lane line fitting. Figure 3 This is a schematic diagram of the coordinates of the detection scattered points, such as Figure 3 As shown, the embodiment first arranges the obtained detection scatter points according to the y-axis coordinates from large to small, with the lane where the vehicle is located being numbered 0, the first lane on the left being 1, the first lane on the right being -1, and so on. Figure 4 A schematic diagram of noise filtering for detecting scattered points, such as Figure 4 As shown, for camera detection, considering that the closer the lane line is to the vehicle, the more accurate the detection is. Considering that the lane lines of the two adjacent lanes need to be detected most in practical applications, the embodiment uses 10 meters as the first filtering threshold and deletes the detection points (dashed line part) that are more than 10 meters away. In addition, for the detection points that are far away in the x-axis direction, considering that these detection points are not accurate, but the lane line they are in also needs to be fitted, the embodiment uses 22 meters as the second filtering threshold, and the detection points that are more than 22 meters in the x-axis square are used as the first pre-discarded points and stored in the pre-delete pre-discarded container.
[0030] In some embodiments of the present invention, Figure 5 Schematic diagram of the preprocessing process of an embodiment of the present invention, such as Figure 5 As shown, the filtered scattered points are preprocessed to obtain a preprocessed lane line list and a second pre-discarded point, including: S501, calculating the straight-line distance between each filtered scattered point and the absolute value of the y-axis coordinate difference; S502, dividing the filtered scattered points whose straight-line distance is less than a preset first preprocessing threshold and whose y-axis coordinate difference absolute value is less than a preset second preprocessing threshold into the same lane line, to obtain a plurality of lane lines; S503, delete the lane lines whose number of filtered scattered points is lower than the preset scattered point number threshold, form the remaining lane lines into a pre-processed lane line list, and use the filtered scattered points included in the deleted lane lines as second pre-discarded points.
[0031] Specifically, in order to improve the accuracy and stability of lane line fitting, the filtered scattered points need to be preprocessed before fitting to remove some filtered scattered points that may interfere with the fitting accuracy.
[0032] First, the embodiment calculates the absolute value of the straight-line distance and the y-axis coordinate difference between each filtered scattered point, and uses 3.5 meters as the preset first preprocessing threshold (the general length of the lane), and 0.9 meters as the preset second preprocessing threshold (setting the maximum difference). When the straight-line distance between two points is less than 3.5 meters and the y-axis coordinate difference is less than 0.9 meters, the two points are judged to be the same lane line, and a number of lane lines are obtained by judging all the filtered scattered points, and each filtered scattered point is added to the lane to which it belongs to form a lane line list.
[0033] Then the obtained lane lines are traversed again, and the preset scatter point number threshold is set to 5. When the number of points in a lane line is less than 5, it is considered that the lane has no reference value, and the filtered scatter points of the lane line are used as the second pre-discarded points, and the lane line is deleted.
[0034] In some embodiments of the present invention, Figure 6 FIG. 1 is a schematic diagram of the process of the first lane line fitting of an embodiment of the present invention. Figure 6 As shown, the first lane line list is obtained by performing the first lane line fitting on the pre-processed lane line list, including: S601, determining the slope and intercept of each lane line according to the pre-processed lane line list; S602, calculating the absolute value of the slope difference and the absolute value of the intercept difference between the lanes; S603: merge lanes whose slope difference absolute value is less than a preset slope threshold and whose intercept difference absolute value is less than a preset intercept threshold into the same lane line, and update the pre-processed lane line list to obtain a first lane line list.
[0035] Specifically, during the lane line fitting process, the slope and intercept of each lane line are first obtained by fitting the lane line list after preprocessing through the fitLine straight line fitting function, and stored in the lane line list, arranged in ascending order of the x-axis coordinate.
[0036] Then, considering that there may be a situation where the lanes are repeatedly fitted and then two similar lane lines are generated, it is necessary to splice the similar lane lines. By traversing the lane line list, the absolute value of the slope difference and the absolute value of the intercept difference between each lane line are calculated. If the absolute value of the slope difference is less than the preset slope threshold of 0.15, and the absolute value of the intercept difference is less than the preset intercept threshold of 1 meter, then it is considered to be the same lane line, merged and the empty lane line is deleted, and the lane line list is updated to obtain the first lane line list.
[0037] In some embodiments of the present invention, Figure 7 FIG. 1 is a flow chart of the second lane line fitting process of an embodiment of the present invention. Figure 7As shown, performing a second lane line fitting on the first lane line list, the first pre-discarded point, and the second pre-discarded point to obtain a second lane line list includes: S701, determining the slope and intercept of each lane line according to the first lane line list; S702, calculating the discarded point slope and the discarded point intercept between each pre-discarded point and the minimum x-axis coordinate point of each lane line, and determining the absolute value of the discarded point slope difference between the discarded point slope and the slope of each lane line and the absolute value of the discarded point intercept difference between the discarded point intercept and the intercept of each lane line according to the discarded point slope, the discarded point intercept and the slope and intercept of each lane line; S703: Add the discarded points whose slope difference absolute value is less than the preset discarded point slope threshold and whose intercept difference absolute value is less than the preset discarded point intercept threshold to the corresponding first lane line to obtain a second lane line list.
[0038] Specifically, considering that there are still some pre-discarded points among the pre-discarded points obtained in the previous step that can be used to play a positive role in the accuracy of lane line fitting, it is necessary to screen out these pre-discarded points and re-add them to the lane line.
[0039] First, based on the first lane line list obtained, the fitLine straight line fitting function is used again to fit the slope and intercept of each lane line. Then the pre-discarded points are arranged in descending order by x-coordinate, and the slope and intercept of the discarded point between each pre-discarded point and the minimum x-axis coordinate point in each lane are calculated, and the absolute value of the difference between the slope and intercept of the corresponding lane line is calculated. If the absolute value of the slope difference of the discarded point is less than the preset discarded point slope threshold of 0.05, and the absolute value of the intercept difference is less than the preset discarded point intercept threshold of 0.15 meters, then the pre-discarded point is considered to be a point on this lane line. This method is used to filter out the pre-discarded points that meet the conditions and then add them to each lane line to obtain the second lane line list.
[0040] In some embodiments of the present invention, Figure 8 FIG. 4 is a schematic diagram of the process of optimal lane line matching according to an embodiment of the present invention. Figure 8 As shown, the best lane line matching is performed on the second lane line list to obtain a lane line list after fitting, including: S801, traverse all the filtered scattered points in each lane line to obtain the slope and intercept of each adjacent filtered scattered point; S802: In each lane line, the slope and intercept of each adjacent filtered scattered point are used as the straight line reference of the lane line to be selected, and the number of the filtered scattered points to be selected whose distance from the lane line to the straight line reference is less than a preset judgment threshold is determined; S803: The candidate lane line with the largest number of candidate filtered scattered points is selected as the best lane, and the candidate filtered scattered points that meet the preset judgment threshold are added to the best lane to obtain a list of lane lines after fitting.
[0041] Specifically, after completing the addition of pre-discarded points to obtain the filtered scattered points corresponding to each lane line, lane line matching is required to select the best lane line and delete abnormal points.
[0042] For each lane line, first traverse all the filtered scattered points on the lane line, calculate the slope and intercept between two adjacent points, obtain multiple sets of slopes and intercepts, and determine several candidate lane lines based on each set of slopes and intercepts as the straight line benchmark. Then calculate the distance between the filtered scattered points corresponding to the lane line and the straight line, count the points whose distance is less than the preset judgment threshold of 0.8 meters, and use them as candidate filtered scattered points. Find the candidate lane line with the most candidate filtered scattered points as the best lane line, and add the candidate filtered scattered points corresponding to the best lane line to the lane line to obtain the final lane line list.
[0043] In summary, the present invention improves the stability of lane line fitting through multiple lane line fitting, and improves the anti-interference ability of lane line fitting by screening discarded points and re-fitting the pre-discarded points, thereby reducing misjudgment and achieving accurate fitting of lane lines.
[0044] Based on the lane line fitting method provided by the present invention, the present invention also provides a lane line fitting device, such as Fig. 9 As shown, including: A coordinate calculation unit 901 is used to perform coordinate calculation on the acquired lane line detection scatter diagram to obtain the ground coordinates of each detection scatter point; A noise filtering unit 902, configured to filter the detected scattered points according to the ground coordinates to obtain filtered scattered points and first pre-discarded points; A preprocessing unit 903, used for preprocessing the filtered scattered points to obtain a preprocessed lane line list and a second pre-discarded point; A first fitting unit 904, configured to perform a first lane line fitting on the preprocessed lane line list to obtain a first lane line list; A second fitting unit 905 is used to perform a second lane line fitting on the first lane line list, the first pre-discarded point and the second pre-discarded point to obtain a second lane line list; The best lane line matching unit 906 is used to perform best lane line matching on the second lane line list to obtain a lane line list after fitting.
[0045] The lane line fitting device 900 provided in the above embodiment can implement the technical solution described in the above lane line fitting method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above lane line fitting method embodiment, which will not be repeated here.
[0046] The present invention also provides an electronic device 1000, such as Fig.10 As shown, Fig.10 This is a structural diagram of an embodiment of an electronic device provided by the present invention. The electronic device 1000 includes a processor 1001, a memory 1002, and a computer program stored in the memory 1002 and executable on the processor 1001. When the processor 1001 executes the program, the above-mentioned lane line fitting method is implemented.
[0047] As a preferred embodiment, the electronic device further includes a display 1003 for displaying the process of the processor 1001 executing the lane line fitting method.
[0048] Among them, the processor 1001 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 1001 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC). It can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may also be a microprocessor or the processor may also be any conventional processor, etc.
[0049] The memory 1002 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a secure digital (SD card), a flash card, etc. The memory 1002 is used to store programs, and the processor 1001 executes the program after receiving the execution instruction. The process definition method disclosed in any of the embodiments of the present invention may be applied to the processor 1001 or implemented by the processor 1001.
[0050] The display 1003 may be an LED display screen, a liquid crystal display, or a touch-sensitive display, etc. The display 1003 is used to display various information of the electronic device 1000 .
[0051] Understandably, Fig.10 The structure shown is only a schematic diagram of the structure of the electronic device 1000. The electronic device 1000 may also include Fig.10 More or fewer components as shown. Fig.10 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0052] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned lane line fitting method is implemented.
[0053] Generally speaking, the computer instructions for implementing the method of the present invention can be carried by any combination of one or more computer-readable storage media. Non-transitory computer-readable storage media can include any computer-readable media except for the signal itself that is temporarily propagating.
[0054] Computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.
[0055] The above are only preferred specific implementations of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A lane line fitting method, It is characterized in that include: The obtained lane line detection scatter plot is used to calculate the coordinates to obtain the ground coordinates of each detection scatter point; Performing noise filtering on the detected scattered points according to the ground coordinates to obtain filtered scattered points and first pre-discarded points; Preprocessing the filtered scattered points to obtain a preprocessed lane line list and a second pre-discarded point; Performing a first lane line fitting on the preprocessed lane line list to obtain a first lane line list; Performing a second lane line fitting on the first lane line list, the first pre-discarded point, and the second pre-discarded point to obtain a second lane line list; The best lane line matching is performed on the second lane line list to obtain a lane line list after fitting.
2. The lane line fitting method according to claim 1, It is characterized in that The coordinate calculation of the acquired lane line detection scatter plot to obtain the ground coordinates of each detection scatter point includes: Determine the image size, intrinsic parameter matrix, rotation matrix and translation matrix according to the acquired lane line detection scatter plot; The rear axle of the vehicle body is taken as the coordinate origin, the front of the vehicle head is the positive direction of the x-axis, the left direction perpendicular to the x-axis is the positive direction of the y-axis, and the detection scatter points are inversely transformed according to the image size, the intrinsic parameter matrix, the rotation matrix and the translation matrix to obtain the ground coordinates of each detection scatter point.
3. The lane line fitting method according to claim 1, It is characterized in that The filtering of the detected scattered points according to the ground coordinates to obtain filtered scattered points and first pre-discarded points includes: The detection scattered points whose y-axis coordinate absolute value is greater than the preset first filtering threshold and the detection scattered points whose x-axis coordinate absolute value is greater than the preset second filtering threshold are eliminated to obtain filtered scattered points, and the detection scattered points whose x-axis coordinate absolute value is greater than the preset second filtering threshold are used as first pre-discarded points.
4. The lane line fitting method according to claim 1, It is characterized in that The preprocessing of the filtered scattered points to obtain a preprocessed lane line list and a second pre-discarded point includes: Calculate the straight-line distance between the filtered scattered points and the absolute value of the y-axis coordinate difference; Divide the filtered scattered points whose straight-line distance is less than a preset first preprocessing threshold and whose y-axis coordinate difference absolute value is less than a preset second preprocessing threshold into the same lane line, to obtain a plurality of lane lines; Delete the lane lines whose number of filtered scattered points is lower than the preset scattered point number threshold, form the remaining lane lines into a pre-processed lane line list, and use the filtered scattered points included in the deleted lane lines as the second pre-discarded points.
5. The lane line fitting method according to claim 1, It is characterized in that The performing a first lane line fitting on the pre-processed lane line list to obtain a first lane line list includes: Determine the slope and intercept of each lane line according to the pre-processed lane line list; Calculate the absolute value of the slope difference and the absolute value of the intercept difference between each lane; The lanes whose absolute value of the slope difference is less than a preset slope threshold and whose absolute value of the intercept difference is less than a preset intercept threshold are merged into the same lane line, and the pre-processed lane line list is updated to obtain a first lane line list.
6. The lane line fitting method according to claim 1, It is characterized in that The performing a second lane line fitting on the first lane line list, the first pre-discarded point, and the second pre-discarded point to obtain a second lane line list includes: Determine the slope and intercept of each lane line according to the first lane line list; Calculate the discarded point slope and the discarded point intercept between each pre-discarded point and the minimum point of the x-axis coordinate in each lane line, and determine the absolute value of the discarded point slope difference between the discarded point slope and the slope of each lane line and the absolute value of the discarded point intercept difference between the discarded point intercept and the intercept of each lane line according to the discarded point slope, the discarded point intercept and the slope and intercept of each lane line; The discarded points whose slope difference absolute value is less than the preset discarded point slope threshold and whose intercept difference absolute value is less than the preset discarded point intercept threshold are added to the corresponding first lane line to obtain a second lane line list.
7. The lane line fitting method according to claim 1, It is characterized in that The performing the best lane line matching on the second lane line list to obtain a lane line list after fitting includes: Traverse all the filtered scattered points in each lane line to obtain the slope and intercept of each adjacent filtered scattered point; In each of the lane lines, the slope and intercept of each of the adjacent filtered scattered points are used as the straight line reference of the lane line to be selected, and the number of the filtered scattered points to be selected in the lane line whose distance to the straight line reference is less than a preset judgment threshold is determined; The lane line with the largest number of the candidate filtered scattered points is taken as the best lane, and the candidate filtered scattered points that meet the preset judgment threshold are added to the best lane to obtain a lane line list after fitting.
8. A lane line fitting device, It is characterized in that include: A coordinate calculation unit, used to calculate the coordinates of the acquired lane line detection scatter diagram to obtain the ground coordinates of each detection scatter point; A noise filtering unit, configured to filter the detected scattered points according to the ground coordinates to obtain filtered scattered points and first pre-discarded points; A preprocessing unit, used for preprocessing the filtered scattered points to obtain a preprocessed lane line list and a second pre-discarded point; A first fitting unit, configured to perform a first lane line fitting on the preprocessed lane line list to obtain a first lane line list; a second fitting unit, configured to perform a second lane line fitting on the first lane line list, the first pre-discarded point, and the second pre-discarded point to obtain a second lane line list; The best lane line matching unit is used to perform best lane line matching on the second lane line list to obtain a lane line list after fitting.
9. An electronic device, It is characterized in that comprising a memory and a processor, wherein: The memory is used to store computer programs; The processor, coupled to the memory, is used to execute a computer program to implement the steps in the lane fitting method described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps in the lane line fitting method according to any one of claims 1 to 7 are implemented.
