Lane high-precision extraction and structured generation method for automatic driving test
By combining physical imaging models and geometric transformation methods, the inconsistency and incompleteness of lane area labeling in autonomous driving testing are solved, generating high-precision structured masks that support performance evaluation and simulation testing of autonomous driving algorithms.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-04-07
AI Technical Summary
Existing lane area labeling methods in autonomous driving testing suffer from problems such as blurred boundaries, geometric distortion, and topological breaks, making it difficult to meet the requirements for centimeter-level positioning error assessment. Furthermore, they ignore the influence of the physical constraints of the imaging system, resulting in inconsistent and incomplete outputs.
By employing methods such as camera distortion pre-compensation based on physical imaging models, multimodal response fusion, perspective transformation, robust fitting, and morphological operations, and by using mathematical constraints to ensure the topological integrity and geometric accuracy of the lane region, a high-precision structured mask is generated.
It achieves accurate mapping of lane areas between image space and bird's-eye view space, enhances the system's adaptability to complex scenes, and the output mask has good boundary continuity and topological closure, providing reliable ground truth data support.
Smart Images

Figure CN121304719B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of automatic driving simulation test, in particular to a lane high-precision extraction and structured generation method for automatic driving test. BACKGROUND
[0002] In the development and verification system of the automatic driving system, the completeness of the test link and the precision of the true value data directly determine the evaluation effectiveness of the perception module. The current industry mainstream lane region labeling method is still mainly manual or semi-automatic tool, and the output mask has problems such as boundary blur, geometric distortion, and topological fracture, which is difficult to meet the needs of higher-level automatic driving systems for centimeter-level positioning error evaluation. Although some researches try to introduce deep learning semantic segmentation model to automatically generate lane regions, the output is limited by the training data deviation and the model induction ability, and the boundary sawtooth, region hole or shape distortion may occur in the curved road section and shadow shielding area, and there is a lack of geometric consistency between different models, which cannot be used as an authoritative evaluation benchmark.
[0003] More importantly, the existing automatic method generally ignores the influence of the physical constraints of the imaging system on the region geometric shape. The radial distortion of the camera lens will cause the lane line in the edge region of the image to be nonlinearly curved, and the perspective projection of the front-view camera will cause the far-end lane region to be compressed in the pixel space. If the region segmentation is directly performed in the original image space, the mask obtained will be distorted in scale and curvature in the physical world coordinate system, resulting in invalid evaluation of the lateral offset error or curvature consistency. In addition, most methods lack a mathematical guarantee mechanism for the integrity of the region boundary, and in the scene of local missing marking line or vehicle shielding, the topologically unclosed fragmented output is easy to produce, which reduces its usability as a test true value.
[0004] Therefore, there is an urgent need for a lane high-precision extraction method that is based on rigorous geometric optics model, has a mathematically provable boundary continuity guarantee mechanism, and outputs structured and quantifiable lane regions, to provide physical consistent, topologically complete, and parameter traceable true value data support for performance evaluation of automatic driving algorithms. SUMMARY
[0005] To solve the above problems, the application provides a lane high-precision extraction and structured generation method for automatic driving test, which models the image processing process as a series of reversible geometric space transformations and parameterized curve fitting processes, and guarantees the topological integrity of the output region through mathematical constraints.
[0006] The technical scheme of the application is explained as follows in combination with the drawings:
[0007] The application provides a lane high-precision extraction and structured generation method for automatic driving test, comprising:
[0008] Step one, camera distortion pre-compensation method based on physical imaging model to eliminate lens distortion and improve running efficiency;
[0009] Step two, initial segmentation of lane area based on multi-modal response fusion and adaptive enhancement;
[0010] Step three, perspective transformation based on installation parameter physical derivation and space normalization;
[0011] Step four, lane boundary parameterization method based on statistical peak search and robust fitting to avoid trajectory jitter or loss;
[0012] Step five, region integrity guarantee based on morphological closing operation and topological analysis;
[0013] 51) Fill the initial region based on the parameterized boundary;
[0014] According to the fitted curve , fill all pixels in the interval [ , ] for each row y in the bird's eye view to generate the initial mask; wherein is the left boundary curve; is the right boundary curve; is the left boundary fitting coefficient; is the right boundary fitting coefficient;
[0015] 52) Broken repair based on morphological closing operation of circular structure element;
[0016] Connect the broken region and apply morphological closing operation:
[0017] ;
[0018] In the formula, is the initial mask; is the circular structure element with a radius of 5 pixels; is the dilation operation, which expands the foreground pixels outward; is the erosion operation, which shrinks the background pixels inward;
[0019] 53) Extract the main region based on the maximum area criterion of connected domain;
[0020] Perform connected component analysis on , calculate the area of each connected component, and keep the one with the largest area:
[0021] ;
[0022] In the formula, is the connected domain with the largest area; is the first The number of pixels in each connected component;
[0023] Step 6: Output structured parameters based on differential geometry and numerical integration.
[0024] Furthermore, the specific method for step one is as follows:
[0025] 11) A high-precision distortion parameter calibration method based on the Brown-Conrady model is used to eliminate lens distortion, specifically:
[0026] The Brown-Conrady distortion model is used to eliminate the effects of lens distortion, and its mathematical expression is as follows:
[0027] ;
[0028] In the formula, The square of the distance from the pixel to the center of the image; The radial distortion coefficient controls the overall expansion or contraction effect of the image. =1, 2, 3; This is the tangential distortion coefficient, caused by the lens not being parallel to the imaging plane. =1, 2; The x-coordinate of the corner pixel; The y-coordinate of the corner pixel; and The pixel coordinates are those under ideal, distortion-free conditions. To solve for the parameters, at least 15 checkerboard calibration images covering the field of view are collected, and the set of corner pixel coordinates is extracted. With corresponding world coordinates Construct a nonlinear least squares problem:
[0029] ;
[0030] In the formula, This is the camera intrinsic parameter matrix, which includes focal length and principal point; This is the distortion coefficient vector; For the rotation of the i-th image; For the translation of the i-th image;
[0031] Then, the Levenberg-Marquardt algorithm is used iteratively to ensure that the parameter convergence accuracy is < 0.1 pixels; the calibration results are stored in binary format.
[0032] 12) A real-time distortion inverse mapping method based on a bilinear interpolation lookup table improves operational efficiency, specifically as follows:
[0033] The pre-computed distortion correction mapping tables mapx(u,v) and mapy(u,v) physically mean: the pixel value at coordinates (u,v) in the output image is sampled from coordinates (mapx(u,v), mapy(u,v)) in the input image; the mapping tables are generated through the following inverse process:
[0034] ;
[0035] In the formula, and This outputs the pixel coordinates in the image. and These are the pixel coordinates under ideal, distortion-free conditions, i.e., the predicted values from the pinhole camera model. Here is the camera intrinsic parameter matrix; the formula states that, under ideal, distortion-free conditions, a point in the world coordinate system, after projection, falls on... Then through the intrinsic parameter matrix Transform to image coordinates Since distortion correction is an inverse process, it requires a reverse solution, given the output coordinates. Find the corresponding input coordinates. ;
[0036] Bilinear interpolation is used to ensure subpixel accuracy. For any non-integer coordinate (mapx(u,v), mapy(u,v)), the weighted average of four neighboring integer pixels is calculated. Finally, efficient image remapping is achieved through OpenCV remap operation.
[0037] Furthermore, the specific method for step two is as follows:
[0038] 21) A robust segmentation method based on gradient-color dual-channel response improves the robustness of lane region extraction, specifically:
[0039] First, calculate the Sobel gradient in the x-direction for the grayscale image:
[0040] ;
[0041] In the formula, The grayscale image is the input image. This is a two-dimensional convolution operation; It is a first-order difference convolution kernel in the x-direction, used for detecting horizontal edges; This is the output gradient magnitude map;
[0042] To generate a binary edge mask, a dynamic threshold range is set. The physical meaning of the dynamic threshold range is: only pixels with gradient strength between 40 and 100 are retained;
[0043] To capture the color attributes of the lane lines, the image was converted to the HLS color space, the saturation component was extracted, a threshold of 150 was set, and a color mask was generated; the final fusion response is:
[0044] ;
[0045] In the formula, For gradient masking; For color masking; This is a logical OR operation, meaning that the pixel is retained as long as either modal response is valid;
[0046] 22) Noise suppression based on adaptive histogram equalization and morphological preprocessing, specifically:
[0047] Adaptive histogram equalization is introduced in the grayscale image preprocessing stage. The operation is as follows:
[0048] ;
[0049] The image is divided into 8×8 local blocks, each block is independently equalized, and then bilinear interpolation is used to eliminate block artifacts.
[0050] Apply a 3×3 median filter to the mask after fusion:
[0051] ;
[0052] In the formula, It is the set of coordinates of a 3×3 neighborhood window, representing the offsets of the 8 neighboring points centered at the current pixel and the pixel itself. Input response graph At position ( , The pixel value at () , ) is relative to the center point ( , Spatial offset.
[0053] Furthermore, the specific method for step three is as follows:
[0054] 31) Physical modeling is performed based on the source point coordinates of the camera installation geometry, specifically as follows:
[0055] Let the lateral position of the left boundary of the lane in the ground coordinate system be... The right boundary is = +3.75m, then the x-coordinate of the source point in the image is:
[0056] ;
[0057] In the formula, The x-coordinate of the principal point; and These are the x-coordinates of the source points on the left and right sides of the image, respectively. The focal length of the camera; and These represent the lateral positions of the left and right boundaries of the lane in the ground coordinate system; This refers to the height of the camera above the ground. The camera's tilt angle; The horizontal expansion rate of the field of view, in physical terms, is defined as follows: A right triangle is formed by drawing a perpendicular line from the center of the camera to the ground, with a base length of... Gao Wei Then the horizontal projection angle is Because the camera has a tilt angle The actual observation angle is The image coordinates are derived using trigonometric functions;
[0058] 32) A method for generating bird's-eye views and scaling based on rectangular target grids simplifies modeling, specifically as follows:
[0059] Map the front view image to a virtual bird's-eye view using perspective transformation; set the target points as a rectangle: [200,720],[200,0],[1080,0],[1080,720], and solve for the homography matrix using direct linear transformation:
[0060] ;
[0061] In the formula, The coordinates of the source point; The coordinates of the target point; This is the scaling factor; It is a homography matrix.
[0062] Furthermore, the specific method for step four is as follows:
[0063] 41) Boundary initialization is performed based on vertical hierarchical histogram and median filtering, specifically as follows:
[0064] First, the boundary is initialized using statistical methods, and the bird's-eye view is drawn along... The axis is divided into N=6 equal-height strips. The division strategy is based on the assumption of the vertical continuity of lane lines, ensuring that each strip contains a sufficient number of lane pixels; for the ... Each stripe, calculate Directional pixel accumulation histogram:
[0065] ;
[0066] In the formula, This is the fused response image after median filtering; For the first individual stripes Coordinate set; For the first Each band in Cumulative pixel value in the direction;
[0067] Applying 51-point median filtering for smoothing:
[0068] ;
[0069] In the formula, For the first Each band in Cumulative pixel value in the direction; Smoothed after median filtering This is used for subsequent lane boundary detection; This indicates that the median of all values within the window is taken, suppressing impulse noise, and the window size is 51 points;
[0070] 42) Robust fitting based on second-order polynomials optimized by RANSAC;
[0071] Define a 200-pixel wide search window centered on the seed point, collect all foreground pixels within the window, and perform a second-order polynomial least squares fit:
[0072] ;
[0073] In the formula, and The coordinates of the foreground pixels within the search window; The coefficients to be determined; This represents the total number of foreground pixels.
[0074] Introducing the RANSAC concept: Iterate 50 times, randomly sample 3 points each time to fit the curve, and retain the model with the most interior points as the final solution.
[0075] Furthermore, the specific method for step six is as follows:
[0076] 61) The lane curvature is quantified based on the curvature formula, specifically as follows:
[0077] At the assessment height Calculate the instantaneous radius of curvature at 0.9H:
[0078] ;
[0079] In the formula, and These are the boundary fitting coefficients; For evaluating height; H is the image height; For instantaneous curvature, The instantaneous radius of curvature;
[0080] Output the minimum and average curvature of the left and right lanes for road safety level assessment;
[0081] 62) The area of the region is calculated based on the trapezoidal rule for numerical integration, specifically as follows:
[0082] Calculate the width of each lane, and then calculate the total area of the region using numerical integration via the trapezoidal rule.
[0083] ;
[0084] In the formula, For the first The width of the lane; This is the line spacing; This represents the total number of rows.
[0085] The output area value is used for mask integrity assessment;
[0086] 63) Outputting a truth mask based on inverse perspective transformation, specifically:
[0087] Applying the inverse transformation matrix Map the bird's-eye view mask back to the original image coordinate system to generate a pixel-level ground truth mask that is strictly aligned with the input image;
[0088] in, The homography matrix is obtained by solving for the original image and is used to map it to the bird's-eye view. for The inverse matrix of the image maps the points in the bird's-eye view back to the original image space;
[0089] Synchronously output geometric parameters in JSON format.
[0090] The beneficial effects of this invention are as follows:
[0091] 1) This invention achieves accurate mapping of lane areas between image space and bird's-eye view space by combining physical modeling and geometric transformation, avoiding geometric distortion caused by manual calibration or ideal assumptions in traditional methods, and improving the spatial consistency and structural rationality of the output mask.
[0092] 2) This invention employs a multimodal response fusion and morphological post-processing strategy, which effectively enhances the system's adaptability to complex scenarios such as lighting changes, local occlusion, and line wear without relying on deep learning, ensuring that the output area has good boundary continuity and topological closure.
[0093] 3) The lane area mask and structured geometric parameters output by this invention can be directly used for performance evaluation and simulation testing of autonomous driving perception modules. Their lightweight and highly repeatable characteristics make them easy to integrate into automated testing frameworks, providing stable and reliable truth support for algorithm iteration and system verification. Attached Figure Description
[0094] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0095] Figure 1 This is a schematic diagram of the process of the present invention;
[0096] Figure 2 This is a schematic diagram of the image processing flow;
[0097] Figure 3 A diagram illustrating the comparison of camera calibration results;
[0098] Figure 4 This is a diagram illustrating the comparison of image processing effects;
[0099] Figure 5 This is a graph showing the accuracy of the polynomial fitting for the left and right lane lines.
[0100] Figure 6 This is a diagram showing how lane width changes from the top to the bottom of the image.
[0101] Figure 7 This is a schematic diagram illustrating the changing trend of the curvature radius of the left and right lanes along the longitudinal direction.
[0102] Figure 8 This is a schematic diagram for visually marking the lane widths at multiple locations on a bird's-eye view. Detailed Implementation
[0103] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0104] See Figures 1-8 A method for high-precision lane extraction and structure generation for autonomous driving testing includes the following steps:
[0105] Step 1: A camera distortion pre-compensation method based on a physical imaging model eliminates lens distortion and improves operating efficiency. The specific method is as follows:
[0106] 11) A high-precision distortion parameter calibration method based on the Brown-Conrady model is used to eliminate lens distortion, specifically:
[0107] In automotive vision systems, lens distortion is the primary factor causing lane geometry distortion. To eliminate this effect, the Brown-Conrady distortion model is used, mathematically expressed as:
[0108] ;
[0109] In the formula, The square of the distance from the pixel to the center of the image; The radial distortion coefficient controls the overall expansion or contraction effect of the image; This is the tangential distortion coefficient, caused by the lens not being parallel to the imaging plane; The x-coordinate of the corner pixel; The y-coordinate of the corner pixel; and The pixel coordinates are those under ideal, distortion-free conditions. To solve for the parameters, this invention acquires no fewer than 15 checkerboard calibration images covering the field of view and extracts the set of corner pixel coordinates. , (lowercase indicates a two-dimensional point), and corresponding world coordinates (Uppercase letters represent points in space), construct a nonlinear least squares problem:
[0110] ;
[0111] In the formula, This is the camera intrinsic parameter matrix, which includes focal length and principal point; This is the distortion coefficient vector; Let be the extrinsic parameters (rotation and translation) of the i-th image;
[0112] Then, the Levenberg-Marquardt algorithm is used iteratively to ensure that the parameter convergence accuracy is < 0.1 pixels. The calibration results are stored in binary format to avoid repeated online calculations and meet the real-time requirements of embedded platforms.
[0113] 12) A real-time distortion inverse mapping method based on a bilinear interpolation lookup table improves operational efficiency, specifically as follows:
[0114] To improve operational efficiency, the physical meaning of the pre-calculated distortion correction mapping tables mapx(u,v) and mapy(u,v) in this invention is as follows: the pixel value at coordinates (u,v) in the output image is sampled from (mapx(u,v), mapy(u,v)) in the input image; the mapping table is generated through the following inverse process:
[0115] ;
[0116] In the formula, and This outputs the pixel coordinates in the image. and These are the pixel coordinates under ideal, distortion-free conditions, i.e., the predicted values from the pinhole camera model. Here is the camera intrinsic parameter matrix; the formula states that, under ideal, distortion-free conditions, a point in the world coordinate system, after projection, falls on... Then through the intrinsic parameter matrix Transform to image coordinates Since distortion correction is an inverse process, it requires a reverse solution, given the output coordinates. Find the corresponding input coordinates. ;
[0117] Bilinear interpolation is used to ensure subpixel accuracy. For any non-integer coordinate (mapx(u,v), mapy(u,v)), the weighted average of four neighboring integer pixels is calculated. Finally, efficient image remapping is achieved through OpenCV remap operation.
[0118] Step 2: Perform initial segmentation of the lane region based on multimodal response fusion and adaptive enhancement. The specific method is as follows:
[0119] 21) A robust segmentation method based on gradient-color dual-channel response improves the robustness of lane region extraction, specifically:
[0120] To address the problem of single-characteristic failure under complex lighting conditions, this invention designs a dual-modal response fusion strategy.
[0121] First, calculate the Sobel gradient in the x-direction for the grayscale image:
[0122] ;
[0123] In the formula, The grayscale image is the input image. This is a two-dimensional convolution operation; It is a first-order difference convolution kernel in the x-direction, used for detecting horizontal edges; This is the output gradient magnitude map;
[0124] To generate a binary edge mask, a dynamic threshold range is set. The physical meaning of the dynamic threshold range is: only retain pixels with gradient strength between 40 and 100 to avoid interference from excessive noise (such as vehicle edges) and weak signals (such as low-contrast lines).
[0125] To capture the color attributes of lane lines, the image was converted to the HLS color space, and the saturation component was extracted. A threshold of 150 was set to generate a color mask. This threshold was chosen because standard white lane lines typically have a saturation greater than 150 in the HLS space, while gray pavement has a saturation less than 100, effectively distinguishing lane lines from the background. The final fused response is as follows:
[0126] ;
[0127] In the formula, For gradient masking; For color masking; The logical OR operation means that the pixel is retained as long as any modal response is valid, thus significantly improving the robustness of the system under complex lighting conditions.
[0128] 22) Noise suppression based on adaptive histogram equalization and morphological preprocessing, specifically:
[0129] To enhance the response in low-contrast regions, this invention introduces adaptive histogram equalization (CLAHE) in the grayscale image preprocessing stage. Its core operation is as follows:
[0130] ;
[0131] This operation divides the image into 8×8 local blocks, equalizes each block independently, and then eliminates block artifacts through bilinear interpolation;
[0132] To eliminate isolated noise, this invention applies a 3×3 median filter to the fused mask:
[0133] ;
[0134] In the formula, It is a set of coordinates for a 3×3 neighborhood window, representing the offsets of the 8 neighboring points centered at the current pixel and the pixel itself. Input response graph At position ( , The pixel value at position () , ) is relative to the center point ( , Spatial offset.
[0135] This effectively eliminates isolated noise while preserving edge continuity, providing clean input for subsequent histogram analysis.
[0136] Step 3: Perform perspective transformation based on the physical derivation and spatial normalization of installation parameters. The specific method is as follows:
[0137] 31) Physical modeling is performed based on the source point coordinates of the camera installation geometry, specifically as follows:
[0138] Let the lateral position of the left boundary of the lane in the ground coordinate system be... The right boundary is = +3.75m, then the x-coordinate of the source point in the image is:
[0139] ;
[0140] In the formula, The x-coordinate of the main point (in pixels); and These are the x-coordinates of the source points on the left and right sides of the image, respectively. The camera focal length (in pixels); and These are the lateral positions (in meters) of the left and right boundaries of the lane in the ground coordinate system. The height of the camera above the ground (in meters); The camera's tilt angle (in radians); This refers to the horizontal expansion rate of the viewing angle. Physically, it means that a right triangle is formed by drawing a perpendicular line from the center of the camera to the ground, with a base length of... Gao Wei Then its horizontal projection angle is Because the camera has a tilt angle The actual observation angle is The image coordinates can be derived using trigonometric functions.
[0141] 32) A method for generating bird's-eye views and scaling based on rectangular target grids simplifies modeling, specifically as follows:
[0142] To simplify subsequent lane line modeling, this invention maps the front view image to a virtual bird's-eye view through perspective transformation; the target points are set as a rectangle: [200,720],[200,0],[1080,0],[1080,720], and the homography matrix is solved through direct linear transformation:
[0143] ;
[0144] In the formula, The coordinates of the source point; The coordinates of the target point; This is the scaling factor; It is a homography matrix.
[0145] After applying perspective transformation, the lane lines are approximately parallel in the bird's-eye view, and the area width remains constant, greatly simplifying subsequent modeling.
[0146] Step 4: A lane boundary parameterization method based on statistical peak search and robust fitting is used to avoid trajectory jitter or loss. The specific method is as follows:
[0147] 41) Boundary initialization is performed based on vertical hierarchical histogram and median filtering, specifically as follows:
[0148] First, to avoid relying on the previous frame state, this invention uses a statistical method to initialize the boundary, and moves the bird's-eye view along... The axis is divided into N=6 equal-height strips. The division strategy is based on the assumption of the vertical continuity of lane lines, ensuring that each strip contains a sufficient number of lane pixels; for the ... Each stripe, calculate Directional pixel accumulation histogram:
[0149] ;
[0150] In the formula, This is the fused response image after median filtering; For the first individual stripes Coordinate set; For the first Each band in Cumulative pixel value in the direction;
[0151] To suppress noise and outliers (such as vehicles and road signs), a 51-point median filter is applied for smoothing.
[0152] ;
[0153] In the formula, For the first Each band in Cumulative pixel value in the direction; Smoothed after median filtering This is used for subsequent lane boundary detection; To obtain the median of all values within the window and suppress impulse noise, the window size is 51 points.
[0154] This operation preserves the main peak values while eliminating local noise fluctuations. The positions of the left and right peak values, xL,k∗ and xR,k∗, are detected as boundary seed points.
[0155] 42) Robust fitting based on second-order polynomials optimized by RANSAC;
[0156] Define a 200-pixel wide search window centered on the seed point, collect all foreground pixels within the window, and perform a second-order polynomial least squares fit:
[0157] ;
[0158] In the formula, and The coordinates of the foreground pixels within the search window; The coefficients to be determined; This represents the total number of foreground pixels.
[0159] To suppress outliers (such as vehicles and road signs), the RANSAC concept is introduced: iterate 50 times, randomly sample 3 points each time to fit the curve, and retain the model with the most interior points (distance < 20 pixels) as the final solution.
[0160] Step 5: Ensure region integrity based on morphological closing operations and topological analysis. The specific method is as follows:
[0161] To ensure the continuity and integrity of the lane area in the physical world, this invention proposes a multi-stage region repair and main region extraction strategy. This method generates an initial mask through parameterized boundaries, applies morphological closing operations to connect broken regions, and extracts the main region based on the maximum area criterion of connected components, effectively eliminating interfering regions such as vehicles and guardrails.
[0162] 51) Fill the initial region based on the parameterized boundary, specifically as follows:
[0163] According to the fitted curve For each row y in the bird's-eye view, fill the interval [ , This method generates an initial mask from all pixels within the region. While ensuring continuity in the y-direction, local breaks may exist in the x-direction. The left boundary curve; The right boundary curve; The left boundary fitting coefficient; The right boundary fitting coefficients are given.
[0164] 52) Fracture repair based on morphological closing operations of circular structural elements, specifically:
[0165] Connect the fractured regions and apply morphological closing operations:
[0166] ;
[0167] In the formula, This serves as the initial mask; It is a circular structural element with a radius of 5 pixels; For dilation operations, the foreground pixels are expanded outwards; For the erosion operation, the background pixels are shrunk inward; this operation can connect gaps up to 10 pixels wide.
[0168] 53) The main region is extracted based on the criterion of maximizing the area of connected components, specifically as follows:
[0169] right Perform connected component analysis, calculate the area of each connected component, and retain the component with the largest area:
[0170] ;
[0171] In the formula, The connected region with the largest area is the one selected as the "main lane area". For the first The number of pixels in each connected component.
[0172] This strategy effectively eliminates interfering areas such as vehicles and guardrails.
[0173] Step 6: Output structured parameters based on differential geometry and numerical integration. The specific method is as follows:
[0174] To provide quantifiable road geometry information, this invention proposes a structured parameter output strategy based on differential geometry and numerical integration. This method generates high-precision, structured ground truth masks and geometric parameters for lane regions through curvature calculation, area integration, and inverse perspective transformation, supporting autonomous driving systems in road safety level assessment and perception module performance evaluation.
[0175] 61) The lane curvature is quantified based on the curvature formula, specifically as follows:
[0176] At the assessment height Calculate the instantaneous radius of curvature at 0.9H:
[0177] ;
[0178] In the formula, and These are the boundary fitting coefficients; For evaluating height; H is the image height; For instantaneous curvature, The instantaneous radius of curvature is denoted as .
[0179] Output the minimum and average curvature of the left and right lanes for road safety level assessment.
[0180] 62) The area of the region is calculated based on the trapezoidal rule for numerical integration, specifically as follows:
[0181] Calculate the width of each lane, and then calculate the total area of the region using numerical integration via the trapezoidal rule.
[0182] ;
[0183] In the formula, For the first The width of the lane; This is the line spacing; This represents the total number of rows; this method ensures the accuracy of area calculation, and the output area value is used for mask integrity assessment.
[0184] 63) Outputting a truth mask based on inverse perspective transformation, specifically:
[0185] Applying the inverse transformation matrix Map the bird's-eye view mask back to the original image coordinate system to generate a pixel-level ground truth mask that is strictly aligned with the input image;
[0186] in, The homography matrix is obtained by solving for the original image and is used to map it to the bird's-eye view. for The inverse matrix of the image maps the points in the bird's-eye view back to the original image space;
[0187] Synchronously output the geometric parameters in JSON format, as follows:
[0188] {
[0189] "left_coeffs": [a_L, b_L, c_L],
[0190] "right_coeffs": [a_R, b_R, c_R],
[0191] "curvature": R_avg,
[0192] "area": A,
[0193] "width_profile": [W(y_1), ..., W(y_N)]
[0194] }
[0195] In summary, this invention provides physically consistent, topologically complete, and parameter-traceable truth data support for the performance evaluation of autonomous driving algorithms.
[0196] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for high-precision lane extraction and structured generation for autonomous driving testing. Its characteristics are The process includes the following steps: Step 1: A camera distortion pre-compensation method based on a physical imaging model eliminates lens distortion and improves operating efficiency; Step 2: Perform initial segmentation of the lane region based on multimodal response fusion and adaptive enhancement; Step 3: Perform perspective transformation based on the physical derivation and spatial normalization of installation parameters; Step 4: A lane boundary parameterization method based on statistical peak search and robust fitting avoids trajectory jitter or loss; Step 5: Ensure region integrity based on morphological closing operations and topological analysis; 51) Fill the initial region based on the parameterized boundary; According to the fitted curve For each row y in the bird's-eye view, fill the interval [ , Generate an initial mask from all pixels within the range; where, The left boundary curve; The right boundary curve; The left boundary fitting coefficient; The fitting coefficients for the right boundary; 52) Fracture repair based on morphological closing operations of circular structural elements; Connect the fractured regions and apply morphological closing operations: ; In the formula, This serves as the initial mask; It is a circular structural element with a radius of 5 pixels; For dilation operations, the foreground pixels are expanded outwards; The erosion operation shrinks the background pixels inward. 53) Extract the main region based on the criterion of maximizing the area of the connected components; right Perform connected component analysis, calculate the area of each connected component, and retain the component with the largest area: ; In the formula, It is the connected component with the largest area; For the first The number of pixels in each connected component; Step 6: Output structured parameters based on differential geometry and numerical integration.
2. The method for high-precision lane extraction and structured generation for autonomous driving testing according to claim 1, characterized in that, The specific method for step one is as follows: 11) A high-precision distortion parameter calibration method based on the Brown-Conrady model is used to eliminate lens distortion, specifically: The Brown-Conrady distortion model is used to eliminate the effects of lens distortion, and its mathematical expression is as follows: ; In the formula, The square of the distance from the pixel to the center of the image; The radial distortion coefficient controls the overall expansion or contraction effect of the image. =1, 2, 3; This is the tangential distortion coefficient, caused by the lens not being parallel to the imaging plane. =1, 2; The x-coordinate of the corner pixel; The y-coordinate of the corner pixel; and The pixel coordinates are those under ideal, distortion-free conditions. To solve for the parameters, at least 15 checkerboard calibration images covering the field of view are collected, and the set of corner pixel coordinates is extracted. With corresponding world coordinates Construct a nonlinear least squares problem: ; In the formula, This is the camera intrinsic parameter matrix, which includes focal length and principal point; This is the distortion coefficient vector; For the rotation of the i-th image; ; Then, the Levenberg-Marquardt algorithm is used iteratively to ensure that the parameter convergence accuracy is < 0.1 pixels; the calibration results are stored in binary format. 12) A real-time distortion inverse mapping method based on a bilinear interpolation lookup table improves operational efficiency, specifically as follows: The pre-computed distortion correction mapping tables mapx(u,v) and mapy(u,v) physically mean: the pixel value at coordinates (u,v) in the output image is sampled from mapx(u,v) and mapy(u,v) in the input image; the mapping tables are generated through the following inverse process: ; In the formula, and This outputs the pixel coordinates in the image. and These are the pixel coordinates under ideal, distortion-free conditions, i.e., the predicted values from the pinhole camera model. Here is the camera intrinsic parameter matrix; the formula states that, under ideal, distortion-free conditions, a point in the world coordinate system, after projection, falls on... Then through the intrinsic parameter matrix Transform to image coordinates Since distortion correction is an inverse process, it requires a reverse solution, given the output coordinates. Find the corresponding input coordinates. ; Bilinear interpolation is used to ensure subpixel accuracy. For any non-integer coordinate (mapx(u,v), mapy(u,v)), the weighted average of four neighboring integer pixels is calculated. Finally, efficient image remapping is achieved through OpenCV remap operation.
3. The method for high-precision lane extraction and structured generation for autonomous driving testing according to claim 1, characterized in that, The specific method for step two is as follows: 21) A robust segmentation method based on gradient-color dual-channel response improves the robustness of lane region extraction, specifically: First, calculate the Sobel gradient in the x-direction for the grayscale image: ; In the formula, The grayscale image is the input image. This is a two-dimensional convolution operation; It is a first-order difference convolution kernel in the x-direction, used for detecting horizontal edges; This is the output gradient magnitude map; To generate a binary edge mask, a dynamic threshold range is set. The physical meaning of the dynamic threshold range is: only pixels with gradient strength between 40 and 100 are retained; To capture the color attributes of the lane lines, the image was converted to the HLS color space, the saturation component was extracted, a threshold of 150 was set, and a color mask was generated; the final fusion response is: ; In the formula, For gradient masking; For color masking; This is a logical OR operation, meaning that the pixel is retained as long as either modal response is valid; 22) Noise suppression based on adaptive histogram equalization and morphological preprocessing, specifically: Adaptive histogram equalization is introduced in the grayscale image preprocessing stage. The operation is as follows: ; The image is divided into 8×8 local blocks, each block is independently equalized, and then bilinear interpolation is used to eliminate block artifacts. Apply a 3×3 median filter to the mask after fusion: ; In the formula, It is the set of coordinates of a 3×3 neighborhood window, representing the offsets of the 8 neighboring points centered at the current pixel and the pixel itself. Input response graph At position ( , The pixel value at () , ) is relative to the center point ( , Spatial offset.
4. The method for high-precision lane extraction and structured generation for autonomous driving testing according to claim 1, characterized in that, The specific method for step three is as follows: 31) Physical modeling is performed based on the source point coordinates of the camera installation geometry, specifically as follows: Let the lateral position of the left boundary of the lane in the ground coordinate system be... The right boundary is = +3.75m, then the x-coordinate of the source point in the image is: ; In the formula, The x-coordinate of the principal point; and These are the x-coordinates of the source points on the left and right sides of the image, respectively. The focal length of the camera; and These represent the lateral positions of the left and right boundaries of the lane in the ground coordinate system; This refers to the height of the camera above the ground. The camera's tilt angle; The horizontal expansion rate of the field of view, in physical terms, is defined as follows: A right triangle is formed by drawing a perpendicular line from the center of the camera to the ground, with a base length of... Gao Wei Then the horizontal projection angle is Because the camera has a tilt angle The actual observation angle is The image coordinates are derived using trigonometric functions; 32) A method for generating bird's-eye views and scaling based on rectangular target grids simplifies modeling, specifically as follows: Map the front view image to a virtual bird's-eye view using perspective transformation; set the target points as a rectangle: [200,720],[200,0],[1080,0],[1080,720], and solve for the homography matrix using direct linear transformation: ; In the formula, The coordinates of the source point; The coordinates of the target point; This is the scaling factor; It is a homography matrix.
5. The method for high-precision lane extraction and structured generation for autonomous driving testing according to claim 1, characterized in that, The specific method for step four is as follows: 41) Boundary initialization is performed based on vertical hierarchical histogram and median filtering, specifically as follows: First, the boundary is initialized using statistical methods, and the bird's-eye view is drawn along... The axis is divided into N=6 equal-height strips, and the division strategy is based on the assumption that the lane lines are continuous in the vertical direction; for the th Each stripe, calculate Directional pixel accumulation histogram: ; In the formula, This is the fused response image after median filtering; For the first individual stripes Coordinate set; For the first Each band in Cumulative pixel value in the direction; Applying 51-point median filtering for smoothing: ; In the formula, For the first Each band in Cumulative pixel value in direction Smoothed after median filtering This is used for subsequent lane boundary detection; This indicates that the median of all values within the window is taken, suppressing impulse noise, and the window size is 51 points; 42) Robust fitting based on second-order polynomials optimized by RANSAC; Define a 200-pixel wide search window centered on the seed point, collect all foreground pixels within the window, and perform a second-order polynomial least squares fit: ; In the formula, and The coordinates of the foreground pixels within the search window; The coefficients to be determined; This represents the total number of foreground pixels. Introducing the RANSAC concept: Iterate 50 times, randomly sample 3 points each time to fit the curve, and retain the model with the most interior points as the final solution.
6. The method for high-precision lane extraction and structured generation for autonomous driving testing according to claim 1, characterized in that, The specific method for step six is as follows: 61) The lane curvature is quantified based on the curvature formula, specifically as follows: At the assessment height Calculate the instantaneous radius of curvature at 0.9H: ; In the formula, and These are the boundary fitting coefficients; For evaluating height; H is the image height; For instantaneous curvature, The instantaneous radius of curvature; Output the minimum and average curvature of the left and right lanes for road safety level assessment; 62) The area of the region is calculated based on the trapezoidal rule for numerical integration, specifically as follows: Calculate the width of each lane, and then calculate the total area of the region using numerical integration via the trapezoidal rule. ; In the formula, For the first The width of the lane; This is the line spacing; This represents the total number of rows. The output area value is used for mask integrity assessment; 63) Outputting a truth mask based on inverse perspective transformation, specifically: Applying the inverse transformation matrix Map the bird's-eye view mask back to the original image coordinate system to generate a pixel-level ground truth mask that is strictly aligned with the input image; In the formula, The homography matrix is obtained by solving for the original image and is used to map it to the bird's-eye view. for The inverse matrix of the image maps the points in the bird's-eye view back to the original image space; Synchronously output geometric parameters in JSON format.
Citation Information
Patent Citations
Road marking line extracting method based on forward camera head in automatic driving
CN105718870A
Lane line detection and fitting method based on visual features and mathematical model
CN117893987A