Road far-end area self-adaptive identification method based on road surface edge curve fitting
By using road semantic segmentation and edge detection, key points are selected for curve fitting, and the far-end area of the road is adaptively identified. This solves the problem that existing technologies cannot automatically identify far-end areas, and improves the detection accuracy and efficiency of small targets at a distance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-02
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies lack a method that can automatically and adaptively identify remote areas based on real-time road image features, resulting in a performance bottleneck for intelligent monitoring systems in remote small target detection tasks, making it impossible to simultaneously meet the requirements of accuracy and efficiency.
By performing road semantic segmentation on the input image, extracting road edges, filtering key points and performing curve fitting, determining the center point of the far region, constructing a high-resolution detection region, and achieving adaptive recognition.
It enables adaptive identification of distant road areas, improves the perception and detection efficiency of small targets at a distance, overcomes the limitations of traditional methods, and provides a reliable foundation for subsequent high-precision target detection.
Smart Images

Figure CN121811046A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent transportation technology, specifically an adaptive identification method for road far-end areas based on road edge curve fitting. Background Technology
[0002] In intelligent monitoring systems for scenarios such as highways, accurately detecting small targets such as pedestrians and roadblocks in the far-end areas of the road is crucial for traffic safety. Due to the high mounting positions and long viewing angles of cameras, these targets appear extremely small in the image. Downsampling the entire image to reduce processing load leads to loss of detail in these targets, making them difficult to detect; maintaining high resolution across the entire image incurs enormous computational costs, failing to meet real-time requirements. Therefore, an effective strategy is to accurately locate the far-end areas of the road and analyze only those areas at high resolution. Currently, common methods rely on fixed rules or manual annotation to define far-end areas. These methods lack flexibility, cannot adapt to changes in road alignment or camera perspective, require frequent manual intervention, and are difficult to deploy and apply on a large scale in real-world, ever-changing traffic scenarios. Therefore, there is a lack of an effective method that can automatically and adaptively identify far-end areas based on real-time road image features. Summary of the Invention
[0003] Therefore, it is necessary to provide an adaptive road far-end region identification method based on road edge curve fitting that can automatically and adaptively identify far-end regions according to real-time road image features, in order to address the above-mentioned technical problems.
[0004] This application provides an adaptive identification method for the far-end area of a road based on road surface edge curve fitting, comprising the following steps: Perform road semantic segmentation on the input image to obtain the road mask; Edge extraction is performed on the road mask to obtain the road edges; Select several key points located at the far end of the image from the road edge, and perform curve fitting on the key points to obtain a fitted curve; The center point of the distant region is determined based on the fitted curve. A remote road area is constructed with the center point of the remote area as the center.
[0005] In one embodiment, the step of performing road semantic segmentation on the input image to obtain a road mask includes: The input image is used to extract road regions at the pixel level using an image semantic segmentation model, and a binary road mask is output; where the pixels are... mask value Determined by the following formula: in, and These are pixel coordinates.
[0006] In one embodiment, the step of extracting the road edges from the road mask includes: The road mask is processed using the Canny edge detection algorithm to extract road edge information.
[0007] In one embodiment, processing the road mask using the Canny edge detection algorithm to extract road edge information includes: The road mask is subjected to Gaussian blurring. The Sobel operator is used to calculate the gradient magnitude and gradient direction of the processed image, where the Sobel convolution kernel used to calculate the horizontal gradient is... The Sobel convolution kernel used to calculate the gradient in the vertical direction is... The expression for the Sobel operator is: , Gradient magnitude With gradient direction The calculation formula is: ,in, , , The grayscale image matrix Indicates cross-correlation operation; Non-maximum suppression is applied to the gradient magnitude image; The road edge information is obtained by performing double-threshold boundary tracking on the image after non-maximum suppression.
[0008] In one embodiment, the step of filtering several key points located at the far end of the image from the road edge includes: Based on image height and preset hyperparameters Determine the number of key points ,in ; Select the road edge with the largest ordinate. These points are referred to as the aforementioned key points.
[0009] In one embodiment, the curve fitting of the plurality of key points includes: A polynomial fitting algorithm is used to fit the coordinates of the key points to obtain the fitted curve representing the direction of the far edge of the road.
[0010] In one embodiment, determining the center point of the distal region based on the fitted curve includes: Calculate the median of the x-coordinate values of the aforementioned key points, and use this median as the x-coordinate of the center point of the distant region. ; x-coordinate Substituting the values into the function corresponding to the fitted curve, the corresponding ordinate value is obtained, and this ordinate value is used as the ordinate of the center point of the distal region. .
[0011] In one embodiment, constructing the remote road region centered on the center point of the remote region includes: Draw a region with a width of [missing information] centered on the center point of the aforementioned distant region. Height is The rectangular area is designated as the far-end road area.
[0012] In one embodiment, constructing the remote road region centered on the center point of the remote region further includes: If the left boundary x-coordinate of the rectangular region If less than 0, then set And set the right boundary x-coordinate ; If the right boundary x-coordinate of the rectangular region Larger than the image width Then set And set the left boundary x-coordinate ; If the upper boundary ordinate of the rectangular region is If less than 0, then set And set the lower boundary ordinate ; If the lower boundary ordinate of the rectangular region is Greater than the image height Then set And set the upper boundary ordinate .
[0013] In one embodiment, the method further includes: using the distant road area as the region of interest for target detection, and performing target detection on the image data within the region of interest while maintaining the original resolution of the input image.
[0014] The aforementioned adaptive road edge curve fitting method for identifying distant road regions first performs road semantic segmentation on the input image to accurately extract road regions. Then, it extracts road edges and selects their distant key points for curve fitting, accurately depicting the direction and shape of the road's distant edges. Based on the fitted curve, it adaptively determines the center point of the distant region and constructs a detection area, ensuring that the final distant road region closely matches the geometric features of the actual road and automatically adjusts with changes in viewing angle and road shape. This method overcomes the limitations of traditional fixed-region or manually set methods, achieving robust and adaptive identification of distant road regions. It provides a reliable foundation for maintaining the original resolution for high-precision target detection within key areas, enhancing the intelligent monitoring system's ability to perceive small targets at a distance. Attached Figure Description
[0015] Figure 1 The flowchart illustrates an adaptive identification method for road far-end areas based on road surface edge curve fitting, as provided in this application embodiment. Detailed Implementation
[0016] To facilitate understanding of the technical solutions provided in the embodiments of this application, the background technology involved in the embodiments of this application will be described below.
[0017] In intelligent monitoring systems for structured roads such as highways, accurate and timely detection of small, distant targets (such as pedestrians, spilled objects, and disabled vehicles) is crucial for enhancing proactive safety capabilities. These scenarios typically employ high-mounted cameras for wide-area surveillance, resulting in distant targets occupying only a few pixels in the image and exhibiting weak visual features. Existing mainstream processing paradigms face a significant contradiction: if downsampling of the entire image is performed to control computational complexity, the limited pixel information of distant targets will be further lost, leading to missed detections; conversely, maintaining high resolution across the entire image to preserve detail results in excessive computational load, making it difficult to meet real-time requirements.
[0018] One intuitive approach to improvement is to maintain high-resolution analysis only on the far-end region of the road (i.e., the part of the road extending into the distance in the image), while appropriately downsampling the near-end region. This raises a core technical question: how to automatically, accurately, and robustly locate this far-end region from a single road image. Existing technologies commonly employ two main approaches: First, region setting based on fixed rules, such as pre-defining a fixed rectangular region (e.g., the upper center area) as the far-end detection zone. This method completely ignores the actual road's linear variations (e.g., straight sections, curves) and differences in camera installation angles and heights. When the scene changes, the pre-defined region easily deviates from the actual far end of the road, leading to inaccurate target search range. Second, an initialization method relying on manual annotation, where technicians manually select the far-end region in the video frame at each monitoring point. While this method can adapt to specific scenarios to some extent, it lacks universality, has low deployment efficiency, and cannot cope with changes in road appearance characteristics caused by seasonal, weather, and lighting variations for the same camera.
[0019] Therefore, existing technologies lack a means to adaptively and accurately define distant areas based on the actual geometry and spatial perspective of the road, starting from the image content itself. This deficiency leads to a performance bottleneck in intelligent monitoring systems for detecting small targets at a distance: either accuracy or efficiency is sacrificed. This embodiment aims to solve this core problem by implementing an automated image processing workflow to achieve intelligent identification of distant road areas, thereby laying the foundation for subsequent high-precision and high-efficiency target detection.
[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0021] This embodiment provides an adaptive identification method for the far-end area of a road based on road surface edge curve fitting, such as... Figure 1 As shown, the steps are as follows: S1 - Perform road semantic segmentation on the input image to obtain the road mask; S2 - Extract the edges of the road mask to obtain the road edges; S3 - Select several key points located at the far end of the image from the road edge, and perform curve fitting on several key points to obtain the fitted curve; S4 - Determine the center point of the distant region based on the fitted curve; S5 - Construct a remote road area centered on the remote area center point.
[0022] In the above steps, the input image refers to an RGB or grayscale image containing a road scene captured by a road surveillance camera. Road semantic segmentation refers to classifying each pixel in the image into either "road" or "non-road" using a computer vision model. The road mask is a binary image of the same size as the input image, where pixel values in road areas are 1 and pixel values in non-road areas are 0. Edge extraction refers to detecting the boundary lines between road and non-road areas on the road mask image. The far end of the image refers to the region with a large ordinate value in the image coordinate system (usually the origin is located at the top left corner, and the y-axis is positive downwards), i.e., the part of the road extending into the distance in the image. Several key points are multiple discrete pixels located at the bottom (farthest) part of the image from the extracted road edge lines. Curve fitting refers to using mathematical methods to find one or more smooth curves that best approximate the spatial distribution of these key points. Determining the center point of the far end region based on the fitted curve means calculating a coordinate point based on the fitted curve equation and the statistical characteristics of the key points; this point will serve as the center for subsequently constructing the detection region. Constructing the remote road region refers to generating a regular-shaped (such as rectangular) image sub-region based on the center point. This region is the region of interest that needs to be maintained at high resolution for subsequent analysis.
[0023] Based on the above, this method first accurately obtains the pixel range of the road through semantic segmentation, providing a reliable foundation for subsequent geometric analysis. Next, it extracts the road edges, transforming the segmentation results into continuous geometric lines. Then, it focuses on the edge where the road disappears into the distance, mathematically representing the direction and shape of the road's far end through curve fitting. Based on this curve and key point distribution, it adaptively calculates a point that represents the center position of the road's far end. Finally, it generates a detection region centered on this point. This process allows the final determined far-end region to closely follow the actual road's geometric shape and perspective changes, achieving adaptive recognition based on image content. Furthermore, it abandons the rigid patterns of traditional fixed regions or manual presets, and through an automated image processing chain, enables the system to dynamically and accurately locate the far-end region based on the actual appearance of the road in each frame. This creates the necessary conditions for subsequent high-precision target detection within key areas while maintaining the original resolution, thereby improving the overall perception and processing efficiency of small targets at a distance.
[0024] The accuracy of road semantic segmentation directly determines the accuracy of subsequent edge extraction and region recognition. If the segmentation result is coarse or contains a lot of noise, it will lead to distorted extracted edges, thus affecting the reliability of far-end region localization. To obtain a high-quality binarized road mask, in one embodiment, road semantic segmentation is performed on the input image to obtain a road mask, including: An image semantic segmentation model is used to extract pixel-level road regions from the input image, and a binary road mask is output; where pixels are... mask value Determined by the following formula: in, and These are pixel coordinates.
[0025] In the above implementation, the image semantic segmentation model is a trained deep learning network capable of understanding image content and classifying each pixel. In this embodiment, a semantic segmentation model based on an encoder-decoder structure can be used, such as DeepLabV3+, PSPNet, or UNet. During training, the model uses a large amount of labeled road image data to learn features that distinguish road surfaces from other objects (such as vehicles, guardrails, vegetation, and the sky). Before being fed into the model, the input image can undergo preprocessing such as normalization. The model outputs a probability map or classification map of the same size as the input image, which is then converted into a binary road mask by setting a threshold (e.g., 0.5). Formula It is the mathematical definition of the mask value; it is an indicator function: when the model determines the coordinates... When the pixel at that location belongs to the road category, Assign a value of 1; otherwise, assign a value of 0. Here are the pixel coordinates. , The coordinates represent the horizontal direction (width direction). The coordinates represent the vertical direction (height direction), and the origin of the coordinate system is usually located at the top left corner of the image.
[0026] Based on the above, leveraging the powerful feature extraction and classification capabilities of deep learning models, dense prediction is performed on the input image. This transforms the originally complex road scene image, with its intricate colors and textures, into a binary map containing only "road" and "background" information. This binary map (road mask) clearly delineates the range of all road pixels in the image, providing clean and accurate input for subsequent shape and edge-based analysis. This provides precise road region information, and the high-quality mask ensures that subsequent edge detection operations target accurate road boundaries, rather than the boundaries of noise or other objects. This is the fundamental premise for the entire method to correctly perceive road geometry. In practical applications, this image semantic segmentation model can choose any other model architecture capable of pixel-level road region segmentation; this application does not limit this approach.
[0027] After obtaining an accurate road mask, it is necessary to extract the geometric information representing the road contour, i.e., the road edges. An edge is a set of pixels in an image where grayscale or color changes drastically. For a binary mask, the road edge is the boundary between the road area (value 1) and the non-road area (value 0). To efficiently and accurately extract continuous, single-pixel-width edge lines from the road mask, in one embodiment, edge extraction is performed on the road mask to obtain the road edges, including: The Canny edge detection algorithm is used to process the road mask and extract road edge information.
[0028] The Canny edge detection algorithm is a multi-stage optimization algorithm designed to detect edges with low error rate, high localization accuracy, and a single edge response. Applying the Canny algorithm to a binary road mask can effectively transform contiguous road areas into their outer contours. In this embodiment, the road mask image is used as the input to the Canny algorithm. Since the road mask itself is a binary image, the pixel values at its edges jump from 0 to 1 or from 1 to 0, exhibiting significant gradient changes, making it very suitable for edge detection algorithms. The Canny algorithm outputs an edge image of the same size as the input mask, where detected edge pixels are marked with high intensity values (e.g., 255), and non-edge pixels are marked with 0, thus obtaining clear road edge information.
[0029] Based on the above, the Canny algorithm locates edges by finding local maxima in the gray-level intensity gradient of the image. In a binary mask, this gradient change occurs precisely at the boundaries of the road region, thus the algorithm can accurately delineate the overall shape and contour of the road, including the wide road surface edges in the foreground and the edges of the converging vanishing regions in the distance. This transforms the planar road region information into linear geometric features. The extracted road edges serve as the direct data source for subsequent curve fitting, and their accuracy and continuity directly affect whether the fitted curve can truly reflect the direction of the road at its far end. In practical applications, other edge detection operators such as Sobel and Laplacian can also be selected; this embodiment does not limit the choice.
[0030] The performance of the Canny edge detection algorithm depends on the fine implementation of its internal steps. To ensure that the road edge information extracted from the road mask has characteristics such as low noise, accurate positioning, and good continuity, in one embodiment, the Canny edge detection algorithm is used to process the road mask to extract road edge information, including: Apply Gaussian blur to the road mask; The Sobel operator is used to calculate the gradient magnitude and gradient direction of the processed image, where the Sobel convolution kernel used to calculate the horizontal gradient is... The Sobel convolution kernel used to calculate the gradient in the vertical direction is... The expression for the Sobel operator is: , Gradient magnitude With gradient direction The calculation formula is: ,in, , , The grayscale image matrix Indicates cross-correlation operation; Non-maximum suppression is applied to the gradient magnitude image; By performing double-threshold boundary tracking on the image after non-maximum suppression, road edge information is obtained.
[0031] The following is a detailed explanation of each sub-step: 1. Gaussian blur processing: Use a two-dimensional Gaussian kernel to apply a road mask image. Perform convolution operations to smooth the image and suppress any minor noise or jagged edges. The size and standard deviation of the Gaussian kernel can be set according to the specific situation, for example, using a kernel of size 5x5 with a standard deviation of 1.0.
[0032] 2. Calculate the gradient magnitude and direction: (1) The Sobel operator and Each with the smoothed grayscale image matrix Perform cross-correlation operations (often simply called convolution operations in the field of convolutional neural networks, and its mathematical essence is cross-correlation) to obtain the horizontal gradient image. and vertical gradient image . It reflects the rate of change of image intensity in the x-direction (horizontal). It reflects the rate of change of intensity in the y-direction (vertical).
[0033] (2) For each pixel in the image Its gradient magnitude From the formula The calculation shows that this represents the edge strength at that point.
[0034] (3) This pixel gradient direction From the formula The calculation shows that the range is within arrive The spaces between represent the direction of the normal to the edge (i.e., the direction perpendicular to the edge).
[0035] 3. Non-maximum suppression: Traversing the gradient magnitude image For each pixel in the gradient direction The gradient magnitude of the current pixel is compared with the gradient magnitudes of its two preceding and following pixels. If the gradient magnitude of the current pixel is not a local maximum, its magnitude is set to 0. This step can refine the edge to a single pixel width.
[0036] 4. Dual-threshold boundary tracking: Set two thresholds, with a higher threshold... and low threshold (generally In the image after non-maximum suppression, the gradient magnitude is greater than... Pixels with gradient magnitudes less than 0 are marked as strong edge points. Pixels with gradient values between the two are marked as non-edge points and suppressed; pixels with gradient magnitudes between the two are marked as weak edge points. Then, each weak edge point is examined. If at least one strong edge point exists in its 8-neighborhood, the weak edge point is also marked as a strong edge point; otherwise, it is suppressed. Finally, all strong edge points constitute continuous road edge information.
[0037] Based on the above, Gaussian filtering preprocessing is used to reduce noise interference; the Sobel operator is used to accurately calculate the edge strength and direction of each pixel; non-maximum suppression is used to remove false edges, obtaining precisely located edge lines; finally, a dual-threshold strategy is used to connect broken edges and suppress false responses, ultimately outputting high-quality, continuous single-pixel-width road edges. This process ensures that the extracted road edges have a high signal-to-noise ratio and geometric fidelity, and clear, continuous road edges are the cornerstone for successful subsequent key point selection and curve fitting, thus guaranteeing the stability and accuracy of the entire adaptive recognition process. In practical applications, the kernel parameters of Gaussian blur, variants of the Sobel operator (such as the Scharr operator), and the specific values of the dual thresholds can be adjusted according to image resolution and scene characteristics; this application embodiment does not limit these adjustments.
[0038] Not all points from the extracted complete road edge contribute to representing the "far" region. Nearby edge points are numerous and may contain complex local shapes (such as intersections), directly using them for fitting would increase computation and potentially introduce interference. Therefore, a mechanism is needed to intelligently filter out key points truly located at the far end of the road that represent the road's disappearance trend. To adaptively determine the number of key points and accurately locate them, in one embodiment, several key points located at the far end of the image are filtered from the road edge, including: Based on image height and preset hyperparameters Determine the number of key points ,in ; Select the road edge with the largest ordinate. Each point serves as a key point.
[0039] In the above implementation, It is the pixel height of the input image (or road mask / edge image). It is a preset positive integer hyperparameter used to control the ratio of the number of keypoints to the image size. (Formula) The number of key points is defined. Calculation method: First calculate This represents a base number inversely proportional to the image height; then it is maximized by the constant 10, which ensures that at least 10 keypoints are selected regardless of the image resolution, avoiding fitting failure due to too few points. For example, if Image height pixels, then During filtering, iterate through all pixels marked as road edges, and sort them according to their ordinates. Sort the values from largest to smallest and select the first few. The points with the largest ordinate values. In the image coordinate system (origin at the top left corner, y-axis downward), the larger the ordinate, the lower the point is in the image, that is, the farther away from the optical center of the camera. Therefore, these points represent the farthest part of the road edge in the image.
[0040] Based on the above, the number of sample points used for fitting is adaptively determined according to the image size, ensuring that there are enough points in high-resolution images to accurately describe the curvature changes of the distant edges, and that there are also a basic number of points in low-resolution images to ensure fitting stability. By selecting the points with the largest ordinates, the focus is directly on the edge segments in the direction of road disappearance, eliminating irrelevant geometric information from the near end. This process achieves adaptive and precise keypoint selection, and the adaptive number calculation makes the method compatible with input images of different resolutions; precise ordinate selection ensures that the data used for fitting comes purely from the distant ends of the road, providing a high-quality data foundation for subsequently fitting a curve that can truly reflect the distant direction of the road.
[0041] The selected key points are discrete pixel coordinates. To describe the overall direction and trend of the road's far edge using a continuous mathematical form and to facilitate subsequent center point calculation, curve fitting is required. The quality of the fitted curve directly affects the positioning of the center point in the far region and the rationality of the final region shape. To obtain a smooth curve that characterizes the geometric features of the road's far end, in one embodiment, curve fitting is performed on several key points, including: A polynomial fitting algorithm was used to fit the coordinates of several key points to obtain a fitted curve representing the direction of the far edge of the road.
[0042] In the above implementation, polynomial fitting is a mathematical method that finds a polynomial function such that the sum of squared errors between the function values at key points and the ordinate values of those key points is minimized. Let the selected... The set of coordinates of the key points is as follows Assume the order of the polynomial used for fitting is... Then the form of the fitted curve equation is: ,in, Indicates the horizontal coordinate position. This represents the ordinate value corresponding to that position. These are the polynomial coefficients to be determined. In this embodiment, the least squares method can be used to solve for these coefficients. Specifically, a polynomial coefficient set is constructed using... Solving a system of linear equations with unknowns using matrix operations results in a total error. Minimum, here Pixel coordinates of corresponding key points Polynomial order The choice of polynomial order requires a trade-off: too low an order may fail to capture curved road edges (such as bends), leading to underfitting; too high an order may be sensitive to noise, resulting in overfitting oscillations. In practice, for highway scenarios, choosing a 2nd-order (parabolic) or 3rd-order polynomial usually provides a good fit for the perspective convergence trend of the far-end road edges. The final polynomial function... This is the desired fitted curve, which provides a continuous mathematical relationship from the horizontal axis to the corresponding vertical axis.
[0043] Based on the above, leveraging the flexibility and smoothness of polynomial functions, a set of discrete key points, potentially containing some noise, is summarized into a concise, continuous, and differentiable mathematical curve. This curve abstracts and characterizes the projection shape of the road's far edge onto the image plane. Furthermore, the discrete edge point information is elevated to a continuous geometric model. The fitted curve not only smooths out small fluctuations in the data but, more importantly, provides a mathematical description of the road's far-end direction, enabling subsequent precise geometric calculations (such as determining the center point) based on this model. It is a core mathematical tool for achieving adaptive region construction. In practical applications, besides polynomial fitting, other curve fitting methods such as spline fitting and polynomial splines can also be used depending on the specific circumstances; this application does not limit this approach.
[0044] After obtaining the fitted curve, a representative point needs to be determined as the center of the far-end detection region. This center point should be located in the "middle" of the far-end region of the road, reflecting both the lateral position and the longitudinal depth of the road. Simply taking the geometric center of key points may be affected by uneven distribution of edge points or noise points. To robustly determine this center point, in one embodiment, the center point of the far-end region is determined based on the fitted curve, including: Calculate the median of the x-coordinates of several key points, and use this median as the x-coordinate of the center point of the distant region. ; x-coordinate Substitute the values into the function corresponding to the fitted curve to obtain the corresponding ordinate value, and use this ordinate value as the ordinate of the center point of the far region. .
[0045] In the above implementation, firstly, from the previously selected... Key points Extract all x-coordinate values to form a set. Calculate the median of this set. The median is the middle value of a set of data when arranged in ascending order. It is insensitive to extreme values (outliers) and is more robust than the mean. This median is determined as the x-coordinate of the center point of the far region, denoted as . Then, Substituting the obtained fitted curve function In the middle, the ordinate value is calculated. Thus, the complete coordinates of the center point of the distant region were obtained. .
[0046] Based on the above, the median of the horizontal axis is used to estimate the center position of the road's far end in the horizontal direction of the image. This method effectively resists biases caused by missing edge points on one side or noise. Then, by utilizing the functional relationship between the vertical and horizontal positions provided by the fitted curve, the vertical position corresponding to the horizontal center position is naturally determined, thus ensuring that the center point falls on the fitted trend line of the road's far end edge. This process provides a robust and accurate method for locating the center of the far-end region, combining the statistical robustness of the median and the geometric constraints of the fitted curve, ensuring that the determined center point... It can stably land at a reasonable location in the far end of the road, laying a precise anchor point foundation for the subsequent construction of a detection area of reasonable size and location.
[0047] After determining the center point of the remote region, a specific image region needs to be constructed around this point as the region of interest for subsequent object detection. The size and shape of this region need to balance covering the main remote road area with computational efficiency. To define a simple and easy-to-process initial detection region, in one embodiment, a remote road region is constructed centered on the center point of the remote region, including: Draw a region with a width of [missing information] centered on the center point of the distant region. Height is The rectangular area is designated as the far-end road area.
[0048] In the above implementation, the center point The coordinates of the center point are obtained from the previously determined coordinates. and These are the predefined width and height of a rectangular region, measured in pixels. These can be fixed empirical values or dynamically calculated based on image resolution or application requirements (e.g., set as a certain ratio of image width and height). When constructing the rectangular region, use... The center is defined as the point on which the rectangle's center coincides. Therefore, the coordinates of the left, right, top, and bottom boundaries of this rectangular region can be initially calculated as follows: Left boundary x-coordinate: Right boundary x-coordinate: Upper boundary ordinate: Lower boundary ordinate: This is by and The image sub-region within the defined rectangle is the initially constructed far-end road region.
[0049] Based on the above, a rectangular shape is used to approximate the far end of the road region. Using an adaptively calculated center point as the center ensures that the rectangular region follows the actual position of the far end of the road. Furthermore, the simplicity of the rectangular region facilitates subsequent image cropping and scaling, and also meets the input region requirements of most object detection algorithms. This process transforms the abstract concept of the far end region into a concrete and operable image sub-region. This rectangular region serves as a bridge connecting the adaptive recognition algorithm and the subsequent high-precision object detection module. Its position is adaptively determined by the aforementioned steps, ensuring that the detection focus remains always on the far end of the road.
[0050] Because of the center point It may be near the image boundary, or the size of the rectangular area. , If the initial rectangular region is set relatively large, the region calculated in the aforementioned manner may partially or completely extend beyond the boundaries of the original image. A region extending beyond the image boundaries cannot be effectively processed. To ensure that the generated far-end road region is always valid and completely located within the image, in one embodiment, constructing the far-end road region centered on its center point further includes: If the x-coordinate of the left boundary of the rectangular region If less than 0, then set And set the right boundary x-coordinate ; If the x-coordinate of the right boundary of the rectangular region Larger than the image width Then set And set the left boundary x-coordinate ; If the upper boundary ordinate of the rectangular region is... If less than 0, then set And set the lower boundary ordinate ; If the lower boundary ordinate of the rectangular region is Greater than the image height Then set And set the upper boundary ordinate .
[0051] In the above implementation, and These are the pixel width and height of the input image, respectively. This step uses the previously calculated initial boundary coordinates. Based on this, a series of condition judgments and adjustments are made: 1. Horizontal (width) adjustment: (1) If the left boundary This indicates that the left side of the rectangular area extends beyond the left boundary of the image. The adjustment strategy is to align the left boundary to the far left of the image. (and maintain the rectangle width) The right boundary remains unchanged, therefore it becomes .
[0052] (2) If the right boundary This indicates that the right side of the rectangular area extends beyond the right boundary of the image. The adjustment strategy is to align the right boundary to the far right of the image. ), and maintain width The left boundary remains unchanged, therefore it becomes (Note: This assumes...) This means the rectangle's width should not exceed the image width, which is a reasonable preset. 2. Vertical (height) adjustment: (1) If the upper boundary This indicates that the top of the rectangular area extends beyond the top boundary of the image. The adjustment strategy is to align the top boundary with the very top of the image. (and maintain the rectangle height) The lower boundary remains unchanged, therefore it becomes .
[0053] (2) If the lower boundary This indicates that the bottom of the rectangular area extends beyond the bottom boundary of the image. The adjustment strategy is to align the bottom boundary with the very bottom of the image. ), and maintain a high altitude The upper boundary remains unchanged, therefore it becomes (Note: This assumes...) This means the rectangle's height should not exceed the image's height, which is a reasonable preset. After the above adjustments, the new boundary coordinates are obtained. The defined rectangular region will be completely within the image area. Within.
[0054] Based on the above, boundary condition checks and translation operations ensure that the region used for detection is a valid sub-window in the image, regardless of the center point position and the initial rectangle. This is a post-processing mechanism that guarantees the robustness of the algorithm. This process enhances the practicality and robustness of the entire method, preventing program errors or invalid detections caused by region out-of-bounds access. This allows the method to be stably applied to various camera perspectives and mounting locations, effectively processing even when the far end of the road is very close to the image edge.
[0055] One of the core objectives of this method is to provide accurate regions of interest (ROIs) for subsequent object detection. If the identified remote road areas are not effectively utilized, the value of the entire process will be significantly reduced. To clarify the final application of this method in the complete monitoring process and highlight its core value in resolving the contradiction between accuracy and efficiency, in one embodiment, the method further includes: using the remote road areas as the ROI for object detection, and performing object detection on the image data within the ROI while maintaining the original resolution of the input image.
[0056] In the above implementation, the distant road region refers to a rectangular image sub-region that is completely located within the image after being finally determined and adjusted using the aforementioned method. The region of interest for object detection means cropping this rectangular region from the original input image, or at least limiting subsequent image analysis calculations to this region. Maintaining the original resolution of the input image means that when processing the cropped sub-region image, no downsampling operation to reduce the image size is performed; its original pixel size and resolution are used directly. Performing object detection means using an object detection algorithm to analyze this high-resolution sub-region image, identify and locate various traffic targets within it, such as vehicles, pedestrians, and obstacles. In this embodiment, mainstream object detection models such as YOLO (You Only Look Once), SSD (Single Shot MultiBoxDetector), and Faster R-CNN can be used. Since this region only occupies a small portion of the entire image and maintains high resolution, the object detection algorithm can focus on small, distant targets while avoiding the huge computational overhead of running at high resolution across the entire image.
[0057] Based on the above, the image regions containing key targets, adaptively identified, are input to a specialized target recognition module for detailed analysis at the highest quality (original resolution). This effectively focuses limited computing resources on the image portions that truly require high-precision processing. Through this process, an optimal balance between computing resources and detection accuracy is achieved at the system level. Front-end adaptive region recognition guides the powerful back-end detection model to perform precise calculations only within the most critical small regions, thereby achieving high accuracy and efficiency in detecting small targets at the far end of roads. This is the core technical problem that this embodiment aims to solve. In practical applications, the target detection model can choose any other algorithm capable of target recognition and localization; this embodiment does not limit this choice.
[0058] Finally, it should be noted that the road images processed by the method in this application embodiment all come from legally authorized traffic monitoring systems. All data collection, transmission, and processing processes comply with relevant privacy protection regulations and data security standards, and are used solely for the legitimate purpose of improving road traffic safety and efficiency.
[0059] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0060] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0061] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. An adaptive identification method for road far-end regions based on road surface edge curve fitting, characterized in that, Includes the following steps: Perform road semantic segmentation on the input image to obtain the road mask; Edge extraction is performed on the road mask to obtain the road edges; Select several key points located at the far end of the image from the road edge, and perform curve fitting on the key points to obtain a fitted curve; The center point of the distant region is determined based on the fitted curve. A remote road area is constructed with the center point of the remote area as the center.
2. The adaptive identification method for road far-end regions based on road surface edge curve fitting according to claim 1, characterized in that, The step of performing road semantic segmentation on the input image to obtain a road mask includes: The input image is used to extract road regions at the pixel level using an image semantic segmentation model, and a binary road mask is output; where the pixels are... mask value Determined by the following formula: in, and These are pixel coordinates.
3. The adaptive identification method for road far-end areas based on road surface edge curve fitting according to claim 2, characterized in that, The step of extracting the road edges from the road mask includes: The road mask is processed using the Canny edge detection algorithm to extract road edge information.
4. The adaptive identification method for road far-end areas based on road surface edge curve fitting according to claim 3, characterized in that, The process of using the Canny edge detection algorithm to process the road mask and extract road edge information includes: The road mask is subjected to Gaussian blurring. The Sobel operator is used to calculate the gradient magnitude and gradient direction of the processed image, where the Sobel convolution kernel used to calculate the horizontal gradient is... The Sobel convolution kernel used to calculate the gradient in the vertical direction is... The expression for the Sobel operator is: , Gradient magnitude With gradient direction The calculation formula is: ,in, , , The grayscale image matrix Indicates cross-correlation operation; Non-maximum suppression is applied to the gradient magnitude image; The road edge information is obtained by performing double-threshold boundary tracking on the image after non-maximum suppression.
5. The adaptive identification method for road far-end areas based on road surface edge curve fitting according to claim 1, characterized in that, The step of selecting several key points located at the far end of the image from the road edge includes: Based on image height and preset hyperparameters Determine the number of key points ,in ; Select the road edge with the largest ordinate. These points are referred to as the aforementioned key points.
6. The adaptive identification method for road far-end areas based on road surface edge curve fitting according to claim 1, characterized in that, The curve fitting of the aforementioned key points includes: A polynomial fitting algorithm is used to fit the coordinates of the key points to obtain the fitted curve representing the direction of the far edge of the road.
7. The adaptive identification method for road far-end areas based on road surface edge curve fitting according to claim 1, characterized in that, Determining the center point of the distal region based on the fitted curve includes: Calculate the median of the x-coordinate values of the aforementioned key points, and use this median as the x-coordinate of the center point of the distant region. ; x-coordinate Substituting the values into the function corresponding to the fitted curve, the corresponding ordinate value is obtained, and this ordinate value is used as the ordinate of the center point of the distal region. .
8. The adaptive identification method for road far-end areas based on road surface edge curve fitting according to claim 1, characterized in that, The construction of the remote road region, centered on the center point of the remote region, includes: Draw a region with a width of [missing information] centered on the center point of the aforementioned distant region. Height is The rectangular area is designated as the far-end road area.
9. The adaptive identification method for road far-end regions based on road surface edge curve fitting according to claim 8, characterized in that, The construction of the remote road region centered on the center point of the remote region also includes: If the left boundary x-coordinate of the rectangular region If less than 0, then set And set the right boundary x-coordinate ; If the right boundary x-coordinate of the rectangular region Larger than the image width Then set And set the left boundary x-coordinate ; If the upper boundary ordinate of the rectangular region is If less than 0, then set And set the lower boundary ordinate ; If the lower boundary ordinate of the rectangular region is Greater than the image height Then set And set the upper boundary ordinate .
10. The adaptive identification method for road far-end regions based on road surface edge curve fitting according to any one of claims 1 to 9, characterized in that, Also includes: The distant road area is taken as the region of interest for target detection, and target detection is performed on the image data within the region of interest while maintaining the original resolution of the input image.