Free space detection method and system, and computer-readable medium
Through the combination of the vanishing point detection network and the lightweight semantic segmentation network, combined with the block dynamic threshold method, the problems of low accuracy and poor real-time performance in drivable area detection in the existing technology are solved, achieving more efficient detection results and lower cost. The missed detection rate.
Patent Information
- Application Number
- PCT/CN2023/141731
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-03
- Filing Date
- 2023-12-26
- Publication Date
- 2024-09-12
AI Technical Summary
When the existing drivable area detection method is run on the vehicle side, it is affected by factors such as weather, lighting, and road topography, resulting in low accuracy of detection results and difficulty in real-time calculation. Moreover, the fixed threshold method is difficult to determine the appropriate threshold, leading to errors. Detection and missed detection.
The vanishing point detection network is used to map the front view of the road image into a bird's-eye view, and a lightweight semantic segmentation network is used to generate a probability map of the drivable area. The probability map is processed using the block dynamic threshold method, and the threshold is automatically adjusted to improve the accuracy of the detection results. Spend.
It improves the accuracy and real-time performance of drivable area detection results, meets the requirements of autonomous vehicles, and reduces the missed detection rate and false detection rate.
Smart Images

Figure CN2023141731_12092024_PF_FP_ABST
Abstract
Description
Drivable area detection method, system and computer readable medium Technical Field
[0001] The present invention relates primarily to the field of autonomous driving technology, and more particularly to a method and system for detecting a drivable area, and a computer-readable medium. Background Art
[0002] Drivable area detection is a key component of the autonomous vehicle system. The drivable area detection method detects the areas in the acquired road images where the vehicle is allowed to drive, thereby providing information basis for the vehicle's autonomous decision-making planning.
[0003] Existing drivable area detection methods mainly operate on the vehicle side. For example, the vision-based drivable area detection method takes as input a road image captured by a camera, and outputs a drivable area mask or drivable area edge points in the road image. Detection methods operating on the vehicle side require high detection accuracy and the ability to calculate outputs in real time, but due to the large amount of computation, it is usually difficult to obtain calculation results in real time. Affected by many factors such as weather, lighting, and road topography, the road image captured by the camera may be of poor quality, and the farther the object in the road image is from the camera, the smaller the image in the road image. These factors may lead to low accuracy and prone to false detection of drivable area detection results at a distance.
[0004] In the post-processing step of drivable area detection, it is common practice to set a fixed threshold, determine that pixels in the drivable area probability map that are greater than or equal to the fixed threshold are drivable area pixels, and then determine the drivable area based on these drivable area pixels. The use of this fixed threshold method may result in that when a higher threshold is set, the confidence of the detected pixels can be increased, and when a lower threshold is set, the missed detection rate of drivable area pixels can be reduced, so it is impossible to determine a suitable fixed threshold. In addition, if the same threshold is used for all pixel points in the drivable area probability map, the closer the position is to the center of the drivable area, the greater the probability that it is a drivable area, and the closer the position is to the edge of the drivable area, the lower the probability that it is a drivable area. It is easy for drivable area pixels to be missed in the edge area. The existing technology has low accuracy in drivable area detection results and cannot meet the requirements of autonomous driving vehicles.
[0005] Summary of the Invention
[0006] The technical problem to be solved by the present application is to provide a drivable area detection method, system and computer-readable medium, which can improve the accuracy of drivable area detection results.
[0007] The technical solution adopted by the present application to solve the above-mentioned technical problems is a drivable area detection method, comprising: inputting a front view of a road image into a vanishing point detection network, which outputs predicted vanishing point coordinates; calculating a yaw angle and a pitch angle based on the predicted vanishing point coordinates, obtaining an inverse perspective transformation matrix and a perspective transformation matrix based on the yaw angle and the pitch angle, and mapping the front view of the road image into a bird's-eye view according to the inverse perspective transformation matrix; inputting the bird's-eye view into a semantic segmentation network, which outputs a drivable area probability map; processing the drivable area probability map according to a block dynamic threshold method to obtain a drivable area binary map; and mapping the drivable area binary map into a front view including drivable area information according to the perspective transformation matrix.
[0008] In one embodiment of the present application, a vanishing point detection network includes a first convolutional neural network, the first convolutional neural network includes any of a convolutional layer, an activation layer, a batch normalization layer, a pooling layer, a random inactivation layer, and a permutation layer, and the drivable area detection method further includes training the vanishing point detection network using a front view of a road image marked with vanishing point position coordinates and / or a drivable area.
[0009] In one embodiment of the present application, the steps of training a vanishing point detection network include: obtaining a permutation feature map based on a permutation layer in the last layer of the vanishing point detection network; dividing the vanishing point position coordinates by 2 and rounding down to obtain the annotated coordinates of the vanishing point position coordinates corresponding to the permutation feature map; substituting the annotated coordinates into a two-dimensional Gaussian distribution formula centered on the annotated coordinates to generate a heat map; and calculating the value v of a pixel point on the heat map using the following formula:
[0010] Among them, (x, y) represents the coordinates of a pixel point on the heat map, (new_vp_x, new_vp_y) represents the labeled coordinates, σ 2 Represents variance; constructs a loss function based on the mean square error between the rearranged feature map and the heat map; updates the parameters of the vanishing point detection network based on the loss function and the gradient descent algorithm.
[0011] In one embodiment of the present application, the following formula is used to calculate the yaw angle and the pitch angle:
[0012] Among them, θ represents the pitch angle, γ represents the yaw angle, and α v Indicates the upper and lower field of view angle range of the camera, α u represents the horizontal field of view angle range of the camera, (vp_x, vp_y) represents the predicted vanishing point coordinates, N represents the height of the front view of the road image, and M represents the width of the front view of the road image.
[0013] In one embodiment of the present application, the semantic segmentation network includes a second convolutional neural network, the second convolutional neural network includes a low-order spatial information extraction module for generating a spatial information feature map and a high-order semantic information extraction module for generating a semantic information feature map, and the high-order semantic information extraction module includes a classification residual network ResNet18.
[0014] In one embodiment of the present application, after the step of inputting the bird's-eye view into the semantic segmentation network, it also includes: the bird's-eye view enters the low-order spatial information extraction module and the high-order semantic information extraction module respectively, the low-order spatial information extraction module performs multiple convolution operations on the bird's-eye view and generates a spatial information feature map, the high-order semantic information extraction module generates a semantic information feature map based on the bird's-eye view and the classification residual network ResNet18, and the semantic segmentation network fuses the spatial information feature map and the semantic information feature map to generate a drivable area probability map.
[0015] In one embodiment of the present application, the loss function L of the semantic segmentation network is calculated using the following formula:
[0016] Among them, M represents the number of categories, y c is a one-hot encoding vector whose values include 0 and 1, p c It represents the probability that the predicted sample belongs to category C, where C is any integer greater than 0.
[0017] In one embodiment of the present application, the steps of processing the drivable area probability map according to the block dynamic threshold method include: step S1: binarizing the drivable area probability map according to the first initial threshold to obtain a first binary map, and binarizing the drivable area probability map according to the second initial threshold to obtain a second binary map; step S2: subtracting the second binary map from the first binary map to obtain a difference image; step S3: setting a fixed size sliding window of w*h, the sliding window is used to traverse the difference image, where w represents the width of the sliding window and h represents the height of the sliding window; step S4: the sliding window traverses the difference image in sequence When the sliding window traverses to a position where the pixel value is 1 on the difference image, the center position of the sliding window is matched with the drivable area probability map to obtain an adjustment area corresponding to the sliding window on the drivable area probability map, an adjustment threshold is obtained according to the adjustment area, and the pixel values in the adjustment area are binarized using the adjustment threshold; step S5: the area not covered by the sliding window on the difference image is matched with the drivable area probability map to obtain a to-be-processed area on the drivable area probability map, and the pixel values in the to-be-processed area are binarized according to the global threshold.
[0018] In one embodiment of the present application, in step S4, the step of obtaining the adjustment threshold according to the adjustment area includes: statistically calculating a probability histogram within the adjustment area, and taking the grayscale value between two peaks in the probability histogram as the adjustment threshold.
[0019] In one embodiment of the present application, in step S4, if there are no two peaks in the probability histogram within the adjustment area, the first initial threshold and the second initial threshold are changed, and steps S1 to S4 are repeated until there are two peaks in the probability histogram within the adjustment area.
[0020] In one embodiment of the present application, the first initial threshold is less than the second initial threshold, the first initial threshold and the second initial threshold are any values between 0 and 1, and the step size in the sliding window traversal process includes: 1 / 2w to the right and 1 / 2h downward.
[0021] In order to solve the above technical problems, the present application also proposes a drivable area detection system, comprising: a memory for storing instructions executable by a processor; a processor for executing the instructions to implement the above drivable area detection method.
[0022] In order to solve the above technical problems, the present application also proposes a computer-readable medium storing computer program code, which implements the above drivable area detection method when executed by a processor.
[0023] The technical solution of the present application uses a vanishing point detection network to predict the vanishing point coordinates based on the front view of the road image, and maps the front view of the road image into a bird's-eye view based on the predicted vanishing point coordinates. Subsequently, the drivable area detection is performed based on the bird's-eye view. Compared with the conventional method of directly performing drivable area detection on the front view of the road image, the detection results of distant areas in the road image can be improved; the present application uses a lightweight semantic segmentation network to generate a drivable area probability map based on the bird's-eye view, which can improve the computing speed of the network model while ensuring accurate calculations and meet real-time requirements; the drivable area probability map is processed by a block dynamic threshold method, which can automatically and more accurately segment the edge pixels of the drivable area according to the appropriate threshold, thereby improving the confidence of the detected pixels and reducing the missed detection rate of the drivable area pixels. This drivable area detection method based on vanishing point estimation and semantic segmentation of the present application can improve the accuracy of the drivable area detection results and meet the requirements of autonomous driving vehicles.
[0024] Summary of the Figures
[0025] In order to make the above-mentioned objects, features and advantages of the present application more clearly understood, the specific embodiments of the present application are described in detail below with reference to the accompanying drawings, wherein:
[0026] FIG1 is an exemplary flow chart of a method for detecting a drivable area according to an embodiment of the present application;
[0027] FIG2 is an example diagram of a front view of a road image with the coordinates of the vanishing point and the drivable area marked in accordance with an embodiment of the present application;
[0028] FIG3 is an exemplary structural diagram of a vanishing point detection network in an embodiment of the present application;
[0029] FIG4 is an exemplary structural diagram of a semantic segmentation network in an embodiment of the present application;
[0030] FIG5 is a system block diagram of a drivable area detection system according to an embodiment of the present application.
[0031] Preferred embodiments of the present invention
[0032] In order to make the above-mentioned objectives, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are described in detail below with reference to the accompanying drawings.
[0033] In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the present application may also be implemented in other ways different from those described herein. Therefore, the present application is not limited to the specific embodiments disclosed below.
[0034] As used in this application and the claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not intended to refer to the singular but may include the plural. Generally speaking, the terms "comprises" and "include" only indicate the inclusion of the steps and elements specifically identified, and these steps and elements do not constitute an exclusive list. A method or apparatus may also include other steps or elements.
[0035] Flowcharts are used in this application to illustrate the operations performed by systems according to embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the various steps may be processed in reverse order or simultaneously. Furthermore, other operations may be added to these processes, or one or more operations may be removed from these processes.
[0036] The present application proposes a method for detecting a drivable area, which can be applied to an autonomous driving vehicle system to provide information for the vehicle's autonomous decision-making planning. The drivable area detection method of the present application can be run on the vehicle side, for example, in the vehicle's controller, and can also be run on a cloud platform. When the drivable area detection method is run on a cloud platform, the vehicle-side data and the cloud platform data interact through a wireless network. Exemplarily, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an interconnected cloud, multiple clouds, etc., or any combination thereof. The present application does not impose any restrictions on the operating environment of the drivable area detection method.
[0037] FIG1 is an exemplary flow chart of a drivable area detection method according to an embodiment of the present application. Referring to FIG1 , the drivable area detection method according to this embodiment includes the following steps: Step S110: Inputting a front view of a road image into a vanishing point detection network, which outputs predicted vanishing point coordinates; Step S120: Calculating a yaw angle and a pitch angle based on the predicted vanishing point coordinates, obtaining an inverse perspective transformation matrix and a perspective transformation matrix based on the yaw angle and the pitch angle, and mapping the front view of the road image into a bird's-eye view according to the inverse perspective transformation matrix; Step S130: Inputting the bird's-eye view into a semantic segmentation network, which outputs a drivable area probability map; Step S140: Processing the drivable area probability map according to a block dynamic threshold method to obtain a drivable area binary map; Step S150: Mapping the drivable area binary map into a front view including drivable area information according to the perspective transformation matrix.
[0038] Here, we first introduce the method for constructing a dataset for training a vanishing point detection network in this application. This dataset includes multiple frontal views of road images. Steps S110 to S150 described above will be described in detail below. Figure 2 illustrates an example of a frontal view of a road image annotated with vanishing point coordinates and drivable areas in one embodiment of this application. Referring to Figure 2, in some embodiments, the drivable area detection method includes training a vanishing point detection network using a frontal view 200 of a road image annotated with vanishing point coordinates 210 and / or a drivable area 220.
[0039] In the process of collecting the front view of the road image, a camera device installed on a vehicle or other vehicle can be used to capture road images in different scenes, including but not limited to daytime, nighttime, rainy days, foggy days, snowy days, tunnels, urban roads, rural roads, highways, straight roads and curves; roads may include structured roads and unstructured roads. Structured roads are usually highways and urban main roads with better structure. Such roads have clear road marking lines, a relatively simple background environment, and obvious geometric features of the roads. Unstructured roads are usually urban non-main roads and rural streets with lower degree of structure. Such roads have no lane lines and clear road boundaries. In addition, they are affected by shadows and water marks, making it difficult to distinguish between road areas and non-road areas.
[0040] As shown in FIG2 , after collecting multiple road images 200 from different scenes, the vanishing point coordinates 210 are annotated in each road image 200 , or both the vanishing point coordinates 210 and the drivable area 220 are annotated. For example, a dot can be drawn at the location where the road disappears in the road image 200 to represent the vanishing point coordinates 210, and the drivable area 220 can be represented by a closed polygon framing the edge of the drivable area. This application uses all annotated road images to form a training dataset. The dataset used in this application for training the semantic segmentation network can also be constructed using a similar method, which is not a limitation of this application.
[0041] The following describes the steps S110 to S150 in detail:
[0042] In step S110, the front view of the road image is input into the vanishing point detection network, which then outputs the predicted vanishing point coordinates. For example, while a vehicle is driving, a camera captures front views of the road ahead of and around the vehicle in real time. The trained vanishing point detection network processes these real-time front views and outputs the predicted vanishing point coordinates for each road image.
[0043] In some embodiments, the vanishing point detection network includes a first convolutional neural network, which includes any of a convolutional layer, an activation layer, a batch normalization layer, a pooling layer, a random dropout layer, and a permutation layer. Figure 3 is an exemplary structural diagram of a vanishing point detection network in one embodiment of the present application. Referring to Figure 3 , the vanishing point detection network exemplarily comprises nine layers, namely, the first layer L301 through the ninth layer L309. The input of the vanishing point detection network is a front view 310 of a road image captured in real time by a camera, and the output is predicted vanishing point coordinates 320. When the vanishing point detection network is in the training phase, the road image 200, as shown in Figure 2 , which is labeled with at least the vanishing point position coordinates 210, is used.
[0044] Continuing to refer to FIG3 , for example, the front view 310 of the road image has a size of 1280*720*3. The first layer L301 of the vanishing point detection network includes a convolutional layer (Conv), an activation layer (Rectified Linear Unit, ReLU), a batch normalization layer (BN), and a pooling layer. The convolutional layer Conv includes 96 convolution kernels of size 11*11, a stride of 4, and a padding of 0. The feature map generated by the first layer L301 has a size of 318*178*96. The second layer L302 of the vanishing point detection network includes a convolutional layer Conv, an activation layer ReLU, a batch normalization layer BN, and a pooling layer. The convolutional layer Conv includes 256 The convolution kernel of size 5*5, the convolution step stride is 1, the convolution padding is 2, and the feature map size generated by the second layer L302 is 159*89*256; the third layer L303 of the vanishing point detection network includes a convolution layer Conv and an activation layer ReLU, where the convolution layer Conv includes 384 convolution kernels of size 3*3, the convolution step stride is 1, the convolution padding is 1, and the feature map size generated by the third layer L303 is 159*89*384.
[0045] Continuing to refer to Figure 3, the fourth layer L304 of the vanishing point detection network includes a convolution layer Conv and an activation layer ReLU, where the convolution layer Conv includes 384 convolution kernels of size 3*3, the convolution step stride is 1, the convolution padding is 1, and the feature map size generated by the fourth layer L304 is 159*89*384; the fifth layer L305 of the vanishing point detection network includes a convolution layer Conv, an activation layer ReLU and a pooling layer Pooling, where the convolution layer Conv includes 384 convolution kernels of size 3*3, the convolution step stride is 1, and the convolution padding is 1. e is 1, the convolution padding is 1, and the feature map size generated by the fifth layer L305 is 79*44*384; the sixth layer L306 of the vanishing point detection network includes the convolution layer Conv, the activation layer ReLU and the random inactivation layer Dropout, where the convolution layer Conv includes 1024 convolution kernels of size 6*6, the convolution step stride is 1, the convolution padding is 3, and the random inactivation layer Dropout is used to prevent the network model from overfitting to improve the generalization performance. The feature map size generated by the sixth layer L306 is 80*45*1024.
[0046] Continuing to refer to Figure 3, the seventh layer L307 of the vanishing point detection network includes a convolution layer Conv, an activation layer ReLU, and a random inactivation layer Dropout. The convolution layer Conv includes 1024 convolution kernels of size 1*1, the convolution step stride is 1, and the convolution padding is 0. The feature map size generated by the seventh layer L307 is 80*45*1024; the eighth layer L308 of the vanishing point detection network includes a convolution layer Conv and an activation layer Sigmoid. The convolution layer Conv includes 64 convolution kernels of size 1*1, and the convolution step stride is 1, the convolution padding is 0, and the feature map size generated by the eighth layer L308 is 80*45*64; the ninth layer L309 of the vanishing point detection network includes a rearrangement layer Reshape, which is used to rearrange data without changing the data value. The feature map generated by the ninth layer L309 is a rearranged feature map with a size of 640*360*1. The feature map of size 80*45*64 generated by the eighth layer L308 is rearranged into 640*360*1 through the rearrangement layer Reshape to facilitate the calculation of the loss function of the vanishing point detection network model.
[0047] This application uses a lightweight vanishing point detection network to quickly obtain predicted vanishing point coordinates, thereby improving the overall efficiency of the drivable area detection method. This application does not limit the number of layers in the vanishing point detection network or the structure of each layer.
[0048] In some embodiments, the step of training the vanishing point detection network includes: obtaining a rearranged feature map according to the rearrangement layer in the last layer of the vanishing point detection network; dividing the vanishing point position coordinates by 2 and rounding down to obtain the annotated coordinates of the vanishing point position coordinates corresponding to the rearranged feature map, substituting the annotated coordinates into a two-dimensional Gaussian distribution formula with the annotated coordinates as the center to generate a heat map, and using the following formula (1) to calculate the value v of the pixel point on the heat map:
[0049] Among them, (x, y) represents the coordinates of a pixel point on the heat map, (new_vp_x, new_vp_y) represents the labeled coordinates, σ 2 Represents variance; constructs a loss function based on the mean square error between the rearranged feature map and the heat map; updates the parameters of the vanishing point detection network based on the loss function and the gradient descent algorithm.
[0050] For example, during training of the vanishing point detection network, a front view of a road image, annotated with at least the vanishing point coordinates, is used as a label. The annotated vanishing point coordinates are denoted by (t_vp_x, t_vp_y). Since the size of the rearranged feature map is half that of the front view of the road image, the vanishing point coordinates (t_vp_x, t_vp_y) are divided by 2 and rounded down to obtain the annotated coordinates (new_vp_x, new_vp_y) corresponding to the rearranged feature map. The obtained annotated coordinates and the vanishing point coordinates satisfy the following relationship: new_vp_x ≈ (t_vp_x) / 2 and new_vp_y ≈ (t_vp_y) / 2. With the marked coordinates (new_vp_x, new_vp_y) as the center, the two-dimensional Gaussian distribution formula is introduced to generate a heat map of size 640*360*1. The value v of the pixel on the heat map is calculated using the formula (1) mentioned above. It can be seen that the characteristics of the heat map include that the pixel values close to the vanishing point coordinates (new_vp_x, new_vp_y) on the heat map are large, while the pixel values far from the vanishing point coordinates (new_vp_x, new_vp_y) are small.
[0051] For example, during training of the vanishing point detection network, the permuted feature map and the generated heat map output by the network's forward computation are both sized 640*360*1. Therefore, the network's training loss function can be constructed based on the mean squared error between the permuted feature map and the heat map, and the parameters of the vanishing point detection network are updated using the loss function and a gradient descent algorithm. During the prediction phase of the vanishing point detection network, the predicted feature map output by the network is traversed, and the coordinates of the point with the maximum value on the predicted feature map are found and recorded as the predicted vanishing point coordinate a. Since the width and height of the front view of the road image input to the vanishing point detection network are twice the width and height of the predicted feature map, the coordinate value of the predicted vanishing point coordinate a is multiplied by 2 to obtain the predicted vanishing point coordinate b mapped on the front view. The predicted vanishing point coordinate b is the final output of the vanishing point detection network. Compared to traditional neural network methods based on direct regression of vanishing point positions, this application utilizes a vanishing point detection method based on a heat map, resulting in a more stable neural network training process and more accurate predicted vanishing point positions.
[0052] In step S120, the yaw and pitch angles are calculated based on the predicted vanishing point coordinates, and an inverse perspective transformation matrix and a perspective transformation matrix are obtained based on the yaw and pitch angles. Furthermore, the front view of the road image is mapped to a bird's-eye view based on the inverse perspective transformation matrix. For example, during vehicle travel, the yaw and pitch angles will change as the vehicle bumps and the road undulates. If the internal and external parameters of the camera are fixed, this will affect the effect of converting the image from the front view to the bird's-eye view, and thus affect the subsequent segmentation results of the drivable area. Because the pitch angle of the camera will cause a certain offset to the vertical coordinate of the vanishing point, and the yaw angle of the camera will cause a certain offset to the horizontal coordinate of the vanishing point, the yaw and pitch angles can be estimated based on the predicted vanishing point coordinates, and the inverse perspective transformation matrix is then calculated based on the yaw and pitch angles. Based on the inverse perspective transformation matrix, the front view of the road image can be more accurately mapped to a bird's-eye view.
[0053] In some embodiments, the yaw angle and pitch angle are calculated using the following formula (2):
[0054] Among them, θ represents the pitch angle, γ represents the yaw angle, and α v Indicates the upper and lower field of view angle range of the camera, α u represents the horizontal field of view angle range of the camera, (vp_x, vp_y) represents the predicted vanishing point coordinates, N represents the height of the front view of the road image, and M represents the width of the front view of the road image.
[0055] In step S130, the bird's-eye view image is input into the semantic segmentation network, and the semantic segmentation network outputs a drivable area probability map. Exemplarily, the drivable area probability map is the same size as the bird's-eye view image, its image channel is 1, and its pixel value is between 0 and 1. The size of the pixel value represents the probability that the pixel belongs to the drivable area. The larger the pixel value, the greater the probability of belonging to the drivable area. The present application performs drivable area detection on the bird's-eye view image. Compared with the method of directly performing drivable area detection on the front view image, the present application can improve the accuracy of the detection results of distant areas in the front view image of the road image.
[0056] In some embodiments, the semantic segmentation network includes a second convolutional neural network, which includes a low-order spatial information extraction module for generating a spatial information feature map and a high-order semantic information extraction module for generating a semantic information feature map, and the high-order semantic information extraction module includes a classification residual network ResNet18. Figure 4 is an exemplary structural diagram of a semantic segmentation network in an embodiment of the present application. Referring to Figure 4, exemplarily, the semantic segmentation network of the present application includes a low-order spatial information extraction module 420, a high-order semantic information extraction module 430 and a fusion module 440. The semantic segmentation network adopts a dual-path network structure. One path uses the low-order spatial information extraction module 420 to extract low-order spatial information, and the other path uses the high-order semantic information extraction module 430 to extract high-order semantic information. Finally, the information of the low-order spatial information extraction module 420 and the high-order semantic information extraction module 430 is fused in the fusion module 440.
[0057] In some embodiments, as shown in reference Figure 4, after the step of inputting the bird's-eye view into the semantic segmentation network, it also includes: the bird's-eye view 410 enters the low-order spatial information extraction module 420 and the high-order semantic information extraction module 430 respectively, the low-order spatial information extraction module 420 performs multiple convolution operations on the bird's-eye view 410 and generates a spatial information feature map, the high-order semantic information extraction module 430 generates a semantic information feature map based on the bird's-eye view 410 and the classification residual network ResNet18, and the semantic segmentation network fuses the spatial information feature map and the semantic information feature map to generate a drivable area probability map 450.
[0058] For example, referring to FIG4 , the size of the bird's-eye view image 410 input to the semantic segmentation network is 1280*720*1. In the low-order spatial information extraction module 420 of the semantic segmentation network, the first layer L421 includes a convolution layer Conv, an activation layer ReLU, and a batch normalization layer BN, wherein the convolution layer Conv includes 64 convolution kernels of size 3*3, the convolution step stride is 2, the convolution padding is 1, and the feature map size generated by the first layer L421 is 640*360*64; the second layer L422 includes a convolution layer Conv, an activation layer ReLU, and a batch normalization layer BN, wherein the convolution layer Conv includes 1 The second layer L422 has 28 3*3 convolution kernels, a stride of 2, and a padding of 1. The feature map generated by the second layer L422 is 320*180*128 in size. The third layer L423 includes a convolution layer (Conv), an activation layer (ReLU), and a batch normalization layer (BN). The convolution layer Conv includes 256 3*3 convolution kernels, a stride of 2, and a padding of 1. The feature map generated by the third layer L423 is 160*90*256 in size. The low-order spatial information extraction module 420 performs three convolution operations on the bird's-eye view image 410, with a small number of downsampling operations, to extract low-order spatial information and capture spatial details.
[0059] Continuing to refer to Figure 4, in the high-order semantic information extraction module 430 of the semantic segmentation network, the feature map size generated by the first layer L431 of the classification residual network ResNet18 is 320*180*64; the feature map size generated by the third layer L432 of the classification residual network ResNet18 is 160*90*128; the feature map size generated by the fourth layer L433 of the classification residual network ResNet18 is 80*45*256; the feature map size generated by the fifth layer L434 of the classification residual network ResNet18 is 40*23*512. The fifth layer L435 of the high-order semantic information extraction module 430 includes an upsampling layer UpSampling, a channel connection layer Concate, a convolution layer Conv, and an activation layer ReLU, wherein the channel connection layer Concate is used to connect two or more feature maps with the same width and height but different number of channels in the channel direction, and the fifth layer L435 upsamples the feature map output by the fifth layer L434 of the classification residual network ResNet18 by 2 times and then performs convolution on the feature map output by the fourth layer L433 of the classification residual network ResNet18. The feature map generated by the fifth layer L435 is 80*45*512 in size. The sixth layer L436 of the high-level semantic information extraction module 430 includes an upsampling layer UpSampling, a channel connection layer Concate, a convolution layer Conv, and an activation layer ReLU. The sixth layer L436 upsamples the feature map generated by the fifth layer L435 by a factor of 2 and then connects it with the feature map output by the third layer L432 of the classification residual network ResNet18. The feature map generated by the sixth layer L436 is 160*90*256 in size. The high-level semantic information extraction module 430 has a deep number of layers, a high number of downsampling times, and a low computational load, which can capture rich contextual semantic information.
[0060] Continuing to refer to Figure 4, in the fusion module 440, the first layer L441 of the fusion module 440 includes a channel connection layer Concate, a convolution layer Conv and an activation layer ReLU. The first layer L441 connects the feature map output by the third layer L423 in the low-order spatial information extraction module 420 with the feature map output by the sixth layer L436 in the high-order semantic information extraction module 430. The feature map size generated by the first layer L441 is 160*90*256; the second layer L442 of the fusion module 440 includes an upsampling layer UpSampling and an activation layer Sigmoid, wherein the activation layer Sigmoid is used to map the range of output values to between 0 and 1 to facilitate post-processing of the drivable area probability map. After the second layer L442 performs convolution, nonlinear activation, and 8-fold upsampling on the feature map generated by the first layer L441, the second layer L442 outputs a drivable area probability map 450 of the same size as the bird's-eye view 410.
[0061] Compared with traditional semantic segmentation algorithms, this application uses a semantic segmentation network structure including dual paths, which can achieve high-precision semantic segmentation of the drivable area and significantly reduce the overall computational complexity. It can process data in real time and meet the real-time requirements in autonomous driving vehicle scenarios.
[0062] In some embodiments, the loss function L of the semantic segmentation network is calculated using the following formula (3):
[0063] Among them, M represents the number of categories, y c is a one-hot encoding vector whose values include 0 and 1, p c It represents the probability that the predicted sample belongs to category C, where C is any integer greater than 0.
[0064] In step S140, the drivable area probability map is processed according to the block dynamic threshold method to obtain a drivable area binary map. In some embodiments, the step of processing the drivable area probability map according to the block dynamic threshold method includes:
[0065] Step S1: Binarize the drivable area probability map according to a first initial threshold value to obtain a first binary map, and binarize the drivable area probability map according to a second initial threshold value to obtain a second binary map. The first initial threshold value and the second initial threshold value must be different. In some embodiments, the first initial threshold value is less than the second initial threshold value. The first initial threshold value and the second initial threshold value are any values between 0 and 1. For example, the first initial threshold value is 0.4 and the second initial threshold value is 0.5.
[0066] Step S2: Subtract the second binary image from the first binary image to obtain a difference image. For example, the pixel values in the difference image are either 0 or 1. The pixels in the difference image are usually at the edge of the drivable area or in areas with large local differences in probability values.
[0067] Step S3: A fixed-size sliding window of w*h is set. The sliding window is used to traverse the difference image, where w represents the width of the sliding window and h represents the height of the sliding window. In some embodiments, the sliding window traverses the difference image from the upper left corner to the right and downward. The step size during the traversal process includes: 1 / 2w to the right and 1 / 2h to the downward.
[0068] Step S4: The sliding window sequentially traverses the pixels of the difference image. When the sliding window traverses to a position on the difference image where the pixel value is 1, the center position of the sliding window is aligned with the drivable area probability map, and an adjustment region corresponding to the sliding window on the drivable area probability map is obtained. An adjustment threshold is obtained based on the adjustment region, and the pixel values within the adjustment region are binarized using the adjustment threshold. In some embodiments, in step S4, the step of obtaining the adjustment threshold based on the adjustment region includes: calculating a probability histogram within the adjustment region, using the grayscale value between two peaks in the probability histogram as the adjustment threshold, and if there are no two peaks in the probability histogram within the adjustment region, changing the first initial threshold and the second initial threshold, for example, setting the first initial threshold to 0.3 and the second initial threshold to 0.6, and repeating steps S1 to S4 until two peaks are found in the probability histogram within the adjustment region.
[0069] Step S5: Align the area not covered by the sliding window on the difference image with the drivable area probability map to obtain a pending area on the drivable area probability map, and binarize the pixel values in the pending area according to a global threshold. For example, the global threshold is set to 0.7.
[0070] This application uses a block dynamic threshold method and binarizes the drivable area probability map according to the aforementioned steps S1 to S5. Compared with the method of directly using global threshold segmentation, this application can more accurately segment the edge pixels of the drivable area, thereby obtaining more accurate and robust segmentation results in the boundary area of the drivable area, thereby improving the detection accuracy of the drivable area.
[0071] In step S150, the binary image of the drivable area is mapped into a front view including the drivable area information according to the perspective transformation matrix. For example, the present application maps the drivable area segmentation result on the bird's-eye view back to the front view according to the perspective transformation matrix, so that the detection result of the drivable area is displayed on the front view.
[0072] The technical solution of the present application uses a vanishing point detection network to predict the vanishing point coordinates based on the front view of the road image, and maps the front view of the road image into a bird's-eye view based on the predicted vanishing point coordinates. Subsequently, the drivable area detection is performed based on the bird's-eye view. Compared with the conventional method of directly performing drivable area detection on the front view of the road image, the detection results of distant areas in the road image can be improved; the present application uses a lightweight semantic segmentation network to generate a drivable area probability map based on the bird's-eye view, which can improve the computing speed of the network model while ensuring accurate calculations and meet real-time requirements; the drivable area probability map is processed by a block dynamic threshold method, which can automatically and more accurately segment the edge pixels of the drivable area according to the appropriate threshold, thereby improving the confidence of the detected pixels and reducing the missed detection rate of the drivable area pixels. This drivable area detection method based on vanishing point estimation and semantic segmentation of the present application can improve the accuracy of the drivable area detection results and meet the requirements of autonomous driving vehicles.
[0073] The present application also includes a drivable area detection system, comprising a memory and a processor, wherein the memory is used to store instructions executable by the processor; and the processor is used to execute the instructions to implement the drivable area detection method described above.
[0074] FIG5 is a system block diagram of a drivable area detection system according to an embodiment of the present application. Referring to FIG5 , the drivable area detection system 500 may include a vehicle system 510 and a server computer 520. The vehicle system 510 wirelessly exchanges data with the server computer 520 via a communication network 530. The vehicle system 510 includes a vehicle communication port 511, a vehicle processor 512, a read-only memory (ROM) 513, and a random access memory (RAM) 514. In some embodiments, the vehicle processor 512 may be composed of one or more processors. The vehicle communication port 511 enables data communication between the vehicle system 510 and the outside world. The vehicle system 510 may also include various forms of program storage units and data storage units, such as the read-only memory (ROM) 513 and the random access memory (RAM) 514, capable of storing various data files used for processing and / or communication by the vehicle system 510, as well as possible program instructions executed by the vehicle processor 512. The vehicle processor 512 executes these instructions to implement the main part of the method. The results processed by the vehicle processor 512 are transmitted to the user device through the vehicle communication port 511 and displayed on the user interface.
[0075] The above-mentioned drivable area detection method can be implemented as a processor program, stored in the program storage unit of the vehicle system 510, and can be loaded into the vehicle processor 512 for execution to implement the drivable area detection method of the present application.
[0076] The present application also includes a computer-readable medium storing computer program code, which, when executed by a processor, implements the aforementioned drivable area detection method.
[0077] When the drivable area detection method is implemented as a computer program, it can also be stored in a computer-readable storage medium as a product. For example, a computer-readable storage medium may include, but is not limited to, magnetic storage devices (e.g., hard disks, floppy disks, magnetic strips), optical disks (e.g., compact disks (CDs), digital versatile disks (DVDs)), smart cards, and flash memory devices (e.g., electrically erasable programmable read-only memories (EPROMs), cards, sticks, key drives). In addition, the various storage media described herein can represent one or more devices and / or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media (and / or storage media) that can store, contain, and / or carry code and / or instructions and / or data.
[0078] It should be understood that the embodiments described above are merely illustrative. The embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For hardware implementation, the processor may be implemented within one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, and / or other electronic units designed to perform the functions described herein, or a combination thereof.
[0079] Some aspects of the present application can be performed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The above hardware or software can be referred to as "data blocks", "modules", "engines", "units", "components" or "systems". The processor can be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors or combinations thereof. In addition, various aspects of the present application may be expressed as computer products located in one or more computer-readable media, which include computer-readable program code. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, tapes...), optical disks (e.g., compact disks CDs, digital versatile disks DVDs...), smart cards, and flash memory devices (e.g., cards, sticks, key drives...).
[0080] A computer-readable medium may include a propagated data signal embodying computer program code, for example, in baseband or as part of a carrier wave. The propagated signal may be in a variety of forms, including electromagnetic, optical, etc., or a suitable combination thereof. A computer-readable medium may be any computer-readable medium other than a computer-readable storage medium that can be connected to an instruction execution system, apparatus, or device to communicate, propagate, or transmit the program for use. The program code on the computer-readable medium may be transmitted via any suitable medium, including radio, cable, fiber optic cable, radio frequency signal, or similar medium, or any combination of the above.
[0081] The basic concepts have been described above. It will be apparent to those skilled in the art that the above disclosures are merely examples and do not limit the present application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements, and revisions to the present application. Such modifications, improvements, and revisions are suggested in the present application and remain within the spirit and scope of the exemplary embodiments of the present application.
[0082] At the same time, this application uses specific terms to describe the embodiments of this application. For example, "one embodiment," "an embodiment," and / or "some embodiments" refer to a certain feature, structure, or characteristic related to at least one embodiment of this application. Therefore, it should be emphasized and noted that "one embodiment," "an embodiment," or "an alternative embodiment" mentioned twice or multiple times in different locations in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of this application may be appropriately combined.
[0083] In some embodiments, numbers are used to describe the quantity of components and attributes. It should be understood that such numbers used in the description of the embodiments are modified by the modifiers "about", "approximately" or "substantially" in some examples. Unless otherwise stated, "about", "approximately" or "substantially" indicate that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the description and claims are approximate values, which may change according to the required features of individual embodiments. In some embodiments, the numerical parameters should take into account the specified significant digits and adopt the general method of retaining digits. Although the numerical domains and parameters used to confirm the breadth of their range in some embodiments of the present application are approximate values, in specific embodiments, the settings of such numerical values are as accurate as possible within the feasible range.
Claims
1. A method for detecting a drivable area, characterized in that: include: Inputting a front view of the road image into a vanishing point detection network, the vanishing point detection network outputting predicted vanishing point coordinates; Calculating a yaw angle and a pitch angle according to the predicted vanishing point coordinates, obtaining an inverse perspective transformation matrix and a perspective transformation matrix according to the yaw angle and the pitch angle, and mapping a front view of the road image into a bird's-eye view according to the inverse perspective transformation matrix; Inputting the bird's-eye view image into a semantic segmentation network, and the semantic segmentation network outputs a drivable area probability map; Processing the drivable area probability map according to a block dynamic threshold method to obtain a drivable area binary map; as well as The drivable area binary image is mapped into a front view image including drivable area information according to the perspective transformation matrix.
2. The drivable area detection method according to claim 1, characterized in that: The vanishing point detection network includes a first convolutional neural network, which includes any of a convolutional layer, an activation layer, a batch normalization layer, a pooling layer, a random inactivation layer, and a permutation layer, and the drivable area detection method also includes training the vanishing point detection network using a front view of a road image marked with vanishing point position coordinates and / or a drivable area.
3. The drivable area detection method according to claim 2, characterized in that: The steps of training the vanishing point detection network include: Obtaining a rearranged feature map according to the rearrangement layer at the last layer of the vanishing point detection network; The vanishing point position coordinates are divided by 2 and rounded down to obtain the annotated coordinates of the vanishing point position coordinates corresponding to the rearranged feature map. The annotated coordinates are used as the center to generate a heat map by substituting the two-dimensional Gaussian distribution formula. The value v of the pixel point on the heat map is calculated using the following formula: Where (x, y) represents the coordinates of a pixel point on the heat map, (new_vp_x, new_vp_y) represents the labeled coordinates, σ 2 represents variance; Constructing a loss function according to the mean square error between the rearranged feature map and the heat map; The parameters of the vanishing point detection network are updated according to the loss function and the gradient descent algorithm.
4. The drivable area detection method according to claim 1, characterized in that: Use the following formula to calculate the yaw angle and the pitch angle: Wherein, θ represents the pitch angle, γ represents the yaw angle, α v Indicates the upper and lower field of view angle range of the camera, α u represents the horizontal field of view angle range of the camera, (vp_x, vp_y) represents the predicted vanishing point coordinates, N represents the height of the front view of the road image, and M represents the width of the front view of the road image.
5. The drivable area detection method according to claim 1, characterized in that: The semantic segmentation network includes a second convolutional neural network, which includes a low-order spatial information extraction module for generating a spatial information feature map and a high-order semantic information extraction module for generating a semantic information feature map, and the high-order semantic information extraction module includes a classification residual network ResNet18.
6. The drivable area detection method according to claim 5, characterized in that: After the step of inputting the bird's-eye view into the semantic segmentation network, the method also includes: the bird's-eye view enters the low-order spatial information extraction module and the high-order semantic information extraction module respectively, the low-order spatial information extraction module performs multiple convolution operations on the bird's-eye view and generates the spatial information feature map, the high-order semantic information extraction module generates the semantic information feature map according to the bird's-eye view and the classification residual network ResNet18, and the semantic segmentation network fuses the spatial information feature map and the semantic information feature map to generate the drivable area probability map.
7. The drivable area detection method according to claim 5, characterized in that: The loss function L of the semantic segmentation network is calculated using the following formula: Among them, M represents the number of categories, y c is a one-hot encoding vector whose values include 0 and 1, p c It indicates the probability that the predicted sample belongs to category C, where C is any integer greater than 0.
8. The drivable area detection method according to claim 1, characterized in that: The step of processing the drivable area probability map according to the block dynamic threshold method comprises: Step S1: binarizing the drivable area probability map according to a first initial threshold value to obtain a first binary map, and binarizing the drivable area probability map according to a second initial threshold value to obtain a second binary map; Step S2: subtracting the second binary image from the first binary image to obtain a difference image; Step S3: setting a sliding window of a fixed size of w*h, the sliding window being used to traverse the difference image, wherein w represents the width of the sliding window, and h represents the height of the sliding window; Step S4: the sliding window traverses the pixels of the difference image in sequence. When the sliding window traverses to a position on the difference image where the pixel value is 1, the center position of the sliding window is made to correspond to the drivable area probability map, and an adjustment area corresponding to the sliding window on the drivable area probability map is obtained. An adjustment threshold is obtained according to the adjustment area, and the pixel values in the adjustment area are binarized using the adjustment threshold. Step S5: The area not covered by the sliding window on the difference image is matched with the drivable area probability map to obtain the area to be processed on the drivable area probability map, and the pixel values in the area to be processed are binarized according to the global threshold.
9. The drivable area detection method according to claim 8, characterized in that: In the step S4, the step of obtaining the adjustment threshold according to the adjustment area includes: statistically analyzing the probability histogram in the adjustment area, and taking the gray value between two peaks in the probability histogram as the adjustment threshold.
10. The drivable area detection method according to claim 9, characterized in that: In step S4, if there are no two peaks in the probability histogram within the adjustment area, the first initial threshold and the second initial threshold are changed, and steps S1 to S4 are repeated until two peaks exist in the probability histogram within the adjustment area.
11. The drivable area detection method according to claim 8, characterized in that: The first initial threshold is smaller than the second initial threshold, the first initial threshold and the second initial threshold are any values between 0 and 1, and the step sizes in the sliding window traversal process include: 1 / 2w to the right and 1 / 2h downward.
12. A drivable area detection system, characterized in that: include: a memory for storing instructions executable by a processor; A processor, configured to execute the instructions to implement the drivable area detection method as described in any one of claims 1 to 11.
13. A computer readable medium storing computer program code, characterized in that: When the computer program code is executed by a processor, the computer program code implements the drivable area detection method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Lane departure automatic measurement method based on inverse perspective principle
CN110647850A
Lane line detection method based on vanishing point estimation and semantic segmentation
CN111582083A
Lane line identification method and device
CN112699825A
Image processing method and device, information processing method and device
CN112862666A
Line line fitting and tracking method, device and equipment of road and storage medium
CN115471522A
Cited By
Full-automatic orchard carrying operation method
CN120932111A
Fully autonomous orchard transport operation methods
CN120932111B
Distance determination method and device using the same
US20250124588A1
