Highway sunshade tilt recognition method based on deep semantic segmentation network and image correction
Through deep semantic segmentation network and image correction technology, residual neural network and least squares method are used to identify the tilt of highway sunshades, solving the problem of missing or tilted highway sunshades, improving the accuracy and efficiency of detection, and ensuring road safety.
Patent Information
- Application Number
- CN202111312548.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-08
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-11-08
AI Technical Summary
The lack or tilt of highway visors leads to potential road safety hazards. Existing technologies are difficult to quickly and effectively identify and locate them, affecting driving safety.
Using a method based on deep semantic segmentation network and image correction, the residual neural network model is used to perform pixel-level segmentation of the highway sunshade image, and the least squares method is used to estimate the posture direction of the sunshade to realize the identification and positioning of the tilted sunshade.
It improves the segmentation quality of sunshade target details and enhances the robustness to background interference. It is suitable for regional shape estimation in dynamic scenes, verifies the effectiveness and superiority of the method, and improves the accuracy of highway sunshade tilt detection. and efficiency.
Smart Images

Figure CN114155518B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and relates to image recognition and detection, and in particular to a method for identifying the tilt of a highway sunshade based on deep semantic segmentation and image correction. Background Art
[0002] The highway sunshade is located between the two opposite driving lanes on the highway. It can block the direct light from the headlights on the opposite lane to prevent glare and ensure that the driver's eyes are not exposed to strong light. At the same time, it can also help guide the wind flow to prevent crosswind (wind flow perpendicular to the direction of the highway) from blowing down and damaging the sunshade. The installation and deployment of highway sunshades and the monitoring of defect status play a great role in ensuring the driving safety of highways. In practice, due to force majeure such as car accidents and wind damage, highway sunshades are inevitably missing or tilted, posing a great hidden danger to road safety protection. Therefore, it is crucial to detect and locate highway sunshades in order to quickly repair the sunshades for the driving safety environment of highways. Summary of the invention
[0003] In view of the abnormal problem of missing or tilted highway sunshades in the above-mentioned prior art, the purpose of the present invention is to provide a method for identifying the tilt of highway sunshades based on deep semantic segmentation and image correction.
[0004] In order to achieve the above tasks, the present invention adopts the following technical solutions:
[0005] A method for identifying tilted sunshades on highways based on a deep semantic segmentation network and image correction is characterized in that the method inputs the sunshade image on the highway collected by a high-resolution camera into a residual neural network model to achieve pixel-level fine segmentation of the sunshade area, and then for multiple sunshade areas in the same image, the maximum circumscribed polygon is estimated, the optimal circumscribed quadrilateral is determined according to the distance between the vertices, and then the sunshade area is corrected through affine transformation; finally, the attitude direction of each sunshade is estimated using least squares to achieve recognition and positioning of tilted sunshades.
[0006] The specific steps include:
[0007] Step 1, constructing a residual neural network model, wherein the residual neural network model includes a backbone feature extraction network, a void space pooling pyramid module, a post-processing module, and a secondary point prediction module;
[0008] The image of the sunshade on the highway captured by the high-resolution camera is input into the residual neural network model, and the neural network model outputs a feature map, which is then bilinearly interpolated twice to obtain a rough prediction map. N points with the highest uncertainty are selected on the rough prediction map, and a representation vector is obtained for each point with the highest uncertainty. The representation vector consists of a low-level feature vector and a high-level feature vector. The low-level feature vector is obtained by bilinearly interpolating the feature vector map of the rough prediction map, and the high-level feature vector is the feature vector of the uncertain point on the rough prediction map. A small neural network is then used to calculate the representation vector to obtain an updated rough prediction map. The prediction result replaces the unstable value in the rough prediction result, and the above steps are repeated until the output result size is consistent with the original image size.
[0009] Step 2: Calculate the convex hull of the shading plate area. The specific calculation method is as follows:
[0010] 1) Assume that each shading plate edge area is composed of n pixels, forming a set E, and E = {P k |k=1,2,...,n}, first take the lower left corner pixel P1 of set E as the starting point, and then add other edge pixels P k , k=2, 3, ..., n are connected with P1, the angle between the connecting line and the horizontal direction is calculated, and they are sorted according to the angle;
[0011] 2) Sorted pixels Collection against Medium Pixels like Clockwise direction illustrate is the convex hull vertex, retaining the pixel Otherwise, from Delete pixels from until All pixels in the image are traversed and judged, and what is finally retained are the vertices of the two-dimensional convex hull;
[0012] 3) Pixel set All pixels in the occluder area are obtained by the two-dimensional convex hull;
[0013] Step 3: Identify the tilt of the sunshade based on least squares attitude estimation. The specific identification method is as follows:
[0014] 1) Assume that there are m shading plates in an image, where the center line of the jth shading plate is a straight line in two-dimensional space, and construct the error objective function based on the mean square error
[0015]
[0016] in, is the jth straight line intercept, is the slope of the jth line, j∈{1, 2, ..., m}, x k and k are the horizontal and vertical coordinates of the kth edge pixel respectively;
[0017] 2) Use the least squares method to determine The optimal solution parameter with the minimum value Calculate the shading plate direction θ j ; Traverse the m shading plates in the image and generate a shading plate posture direction set Ω = {θ1, θ2, ..., θ j};
[0018] 3) When the set Ω has θ j When the following conditions are met, the jth shading plate is determined to be tilted, and a position index set U corresponding to the tilted shading plate is constructed:
[0019]
[0020] Where τ is the threshold,
[0021] Compared with the traditional image segmentation method, the highway sunshade tilt recognition method based on deep semantic segmentation and image correction of the present invention uses a residual neural network model to achieve better target detail segmentation quality and is very robust to background interference. The method of quickly determining the circumscribed quadrilateral by vertex distance is simple and efficient, and is suitable for estimating the shape of the area in dynamic scenes. The effectiveness and superiority of this method have been verified by testing with measured data. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is the basic framework of residual neural network;
[0023] Figure 2 These are pictures of the visors on the highway in their complete, missing, and tilted states. From left to right, they are complete, missing, and tilted.
[0024] Figure 3 It is the feature extraction backbone network;
[0025] Figure 4 It is a schematic diagram of the hollow space pooling pyramid;
[0026] Figure 5 is a schematic diagram of the post-processing module;
[0027] Figure 6 This is the shading plate segmentation result image based on the residual neural network model;
[0028] Figure 7 is the two-dimensional convex hull map of the area such as the shading plate;
[0029] Figure 8 This is the correction result image of the light-blocking edge area;
[0030] Fig. 9 It is the straight line graph of edge detection and least squares estimation of the occluder area;
[0031] Fig.10 This is an example of visor tilt recognition based on least squares posture estimation.
[0032] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. DETAILED DESCRIPTION
[0033] The design idea of the present invention is to collect the image data of the sunshade on the highway with a high-resolution camera, and use computer vision and deep learning methods to identify and detect the tilt of the sunshade on the highway. The main processing steps include sunshade target detection, morphology correction and tilt recognition.
[0034] This embodiment provides a method for identifying the tilt of highway sunshades based on a deep semantic segmentation network and image correction. The image of the sunshades on the highway captured by a high-resolution camera is input into a deep residual neural network model to achieve pixel-level fine segmentation of the sunshade area, and then for multiple sunshade areas in the same image, the maximum circumscribed polygon is estimated, and the optimal circumscribed quadrilateral is determined according to the distance between the vertices, and then the sunshade area correction is completed through affine transformation; finally, the least squares method is used to estimate the posture direction of each sunshade to achieve the identification and positioning of the tilted sunshades.
[0035] The basic framework of the constructed residual neural network is as follows Figure 1 As shown in the figure, it mainly includes the backbone feature extraction network, the void space pooling pyramid module, the post-processing module, and the secondary point prediction module.
[0036] The specific steps include:
[0037] (1) Constructing a dataset of collected images
[0038] High-resolution cameras are used to collect image data of sunshades on highways. In order to collect rich sunshade target content, the angle between the camera and the road direction is less than π / 2 when collecting sunshade images, so that multiple sunshade target images can be collected in one image. Figure 2 Pictures of the sunshades on the highway in their complete, missing, and tilted states are given, from left to right: complete, missing, and tilted.
[0039] (2) Constructing a feature extraction backbone network
[0040] For the collected shading board images, a residual neural network is constructed to extract image features. The overall structure is as follows: Figure 3 shown.
[0041] The input image is passed through the initial module, which consists of three 3×3 convolutions and a maximum pooling layer. The output size after the initial module is reduced by four times, and the number of output channels is 128.
[0042] After stage 1, stage 1 consists of three residual units, all of which are small convolutions of 1×1 and 3×3, and the step size is 1. The output size after stage 1 is reduced by four times compared with the original image (the same as the output size of the initial module), and the output of stage 1 is 256 channels.
[0043] After stage 2, stage 2 consists of four residual units, of which the 3×3 convolution kernel stride of the first residual unit is 2. The output size after stage 2 is reduced by eight times compared with the original image, and the output of stage 2 is 512 channels.
[0044] After stage 3, stage 3 consists of six residual units, among which the 3×3 convolutions of the second to the sixth residual units use dilated convolutions with a dilation rate of 2. After stage 3, the output size is reduced by eight times compared to the original image, and the output of stage 3 is 1024 channels.
[0045] After stage 4, stage 4 consists of three residual units. The hole rate of the 3×3 convolution in the first residual unit is 2, and the hole rate of the 3×3 convolution in the second and third residual units is 4. The output size after stage 4 is reduced by eight times compared with the original image, and the output of stage 4 is 2048 channels.
[0046] (3) Constructing a dilated spatial convolutional pooling pyramid module
[0047] Considering the multi-scale problem, the applicant constructed a dilated spatial pooling pyramid module. The traditional way to process multi-scale is to scale the original image to different scales and then pass it into the model, which requires a lot of calculations. Therefore, a module composed of multiple parallel dilated convolutional layers with different expansion rates is used to extract features of different receptive fields at different expansion rates in each branch, and then fuse them to generate the final result. This module can extract contextual information from images at multiple scales. The structure of the dilated spatial pooling pyramid module is as follows: Figure 4 shown.
[0048] In the figure, the input is the output of stage 4 of the backbone feature extraction network, and the first branch is a normal 1×1 convolutional layer.
[0049] The second, third, and fourth branches are 3×3 dilated convolutional layers with dilation rates of 12, 24, and 36, respectively. When the output size is 1 / 16 of the original, the dilation rates should be set to 6, 12, and 18, respectively.
[0050] The fifth branch is average pooling plus a 1×1 convolution layer. The pooling layer cannot adjust the number of channels, and the 1×1 convolution plays a role in adjusting the number of channels.
[0051] The outputs of the five branches are all 256-dimensional (a total of 1280 dimensions). The atrous spatial convolution pooling pyramid module uses 1×1 convolution to fuse the output results of the five branches and finally outputs a new 256-dimensional feature.
[0052] (4) Construction of post-processing module
[0053] The post-processing module is the last module for preliminary image segmentation. The structure of the post-processing module is as follows: Figure 5 shown.
[0054] The input of the post-processing module is the output of the fused dilated spatial convolution pooling pyramid module. The final output of the post-processing module is the number of classification segmentation mask result images. The post-processing module contains two convolution layers. The input first passes through a 3×3 convolution and then a 1×1 convolution. The 3×3 convolution is a transitional function, and the 1×1 convolution is to change the number of output channels to the number of classifications.
[0055] (5) Constructing a secondary prediction network for the point
[0056] To solve the problem of insufficiently refined edges caused by image segmentation, we consider re-predicting inaccurately predicted points such as edges, replacing the original rough prediction results with the newly obtained prediction point results, and obtaining the final result as the final result of segmentation through multiple upsampling and iterative replacement.
[0057] 1) Upsampling to extract uncertain points on rough features
[0058] According to the previous rough prediction results, use bilinear interpolation to upsample the rough results, sort them by category prediction scores, select the masks of the top two categories with high scores, and calculate the pixels with higher scores on the two category masks as uncertain points. Generally speaking, a pixel can only correspond to one category. If a pixel has high scores for both categories, it means that it is likely to be a boundary point, that is, an uncertain point.
[0059] 2) Fusion of fine features and coarse features of uncertain points
[0060] Through the operation of step 1, we get the uncertain points, and also get their point coordinates and positions. Therefore, we can get the coarse features and fine features of these uncertain points. The fine features are the output of stage 2 of our feature extraction network. The features of the uncertain points in the fine feature map and the coarse feature map are fused to get new features.
[0061] 3) Use multi-layer perceptron network to re-predict uncertain points
[0062] The new features of the uncertain points obtained in the above steps are sent again to a multi-layer perceptron network composed of 1×1 convolution to obtain new prediction values for each uncertainty.
[0063] 4) Iteratively replace uncertain points
[0064] The prediction result replaces the uncertain value in the rough prediction result, and the above steps are repeated until the output result size is consistent with the original image size.
[0065] (6) Calculate the convex hull of the shading plate area. The calculation method is as follows:
[0066] 1) Assume that each shading plate edge area is composed of n pixels, forming a set E, and E = {P k |k=1,2,...,n}, first take the lower left corner pixel P1 of set E as the starting point, and then add other edge pixels P k , k=2, 3, ..., n are connected with P1, the angle between the connecting line and the horizontal direction is calculated, and they are sorted according to the angle;
[0067] 2) Sorted pixels Collection against Medium Pixels like Clockwise direction illustrate is the convex hull vertex, retaining the pixel Otherwise, from Delete pixels from until All pixels in the image are traversed and judged, and what is finally retained are the vertices of the two-dimensional convex hull;
[0068] 3) For the pixel set P k All pixels in the occluder area are obtained by the two-dimensional convex hull;
[0069] (7) Shade tilt recognition based on least squares attitude estimation
[0070] 1) Assume that there are m shading plates in an image, where the center line of the jth shading plate is a straight line in two-dimensional space, and construct the error objective function based on the mean square error
[0071]
[0072] in, is the jth straight line intercept, is the slope of the jth line, j∈{1, 2, ..., m}, x k and k are the horizontal and vertical coordinates of the kth edge pixel respectively;
[0073] 2) Use the least squares method to determine The optimal solution parameter with the minimum value The shading plate direction θ can be calculated j Traverse the m shading plates in the image and generate a shading plate posture direction set Ω = {θ1, θ2, ..., θ j};
[0074] 3) When the set Ω has θ j When the following conditions are met, the jth shading plate is determined to be tilted, and a position index set U corresponding to the tilted shading plate is constructed:
[0075]
[0076] Where τ is the threshold,
[0077] The optimal value of the angle between the camera and the road direction in the image data set constructed in step (1) above is π / 3.
[0078] The optimal number of sampling points in the secondary prediction network of the construction point in the above step (5) is 8096.
[0079] The optimal value of the threshold τ in the visor tilt recognition based on least squares posture estimation in the above step (7) is π / 12.
[0080] The following are specific embodiments given by the applicant, but the present invention is not limited to the following embodiments.
[0081] Embodiment 1:
[0082] (1) Constructing a dataset of collected images
[0083] A high-resolution camera is used to collect image data of sunshades on highways. In order to collect rich sunshade target content, this example sets the angle between the camera and the road direction to π / 3 when collecting sunshade images, so that multiple sunshade target images can be collected in one image.
[0084] (2) Constructing a feature extraction backbone network
[0085] For the collected shading board images, a deep residual network is constructed to extract image features. The overall structure is as follows: Figure 3 shown.
[0086] The input image is passed through the initial module, which consists of three 3×3 convolutions and a maximum pooling layer. The output size after the initial module is reduced by four times, and the number of output channels is 128.
[0087] After stage 1, stage 1 consists of three residual units, all of which are small convolutions of 1×1 and 3×3, and the step size is 1. The output size after stage 1 is reduced by four times compared with the original image (the same as the output size of the initial module), and the output of stage 1 is 256 channels.
[0088] After stage 2, stage 2 consists of four residual units, of which the 3×3 convolution kernel stride of the first residual unit is 2. The output size after stage 2 is reduced by eight times compared with the original image, and the output of stage 2 is 512 channels.
[0089] After stage 3, stage 3 consists of six residual units, among which the 3×3 convolutions of the second to the sixth residual units use dilated convolutions with a dilation rate of 2. After stage 3, the output size is reduced by eight times compared to the original image, and the output of stage 3 is 1024 channels.
[0090] After stage 4, stage 4 consists of three residual units. The hole rate of the 3×3 convolution in the first residual unit is 2, and the hole rate of the 3×3 convolution in the second and third residual units is 4. The output size after stage 4 is reduced by eight times compared with the original image, and the output of stage 4 is 2048 channels.
[0091] (3) Constructing a dilated spatial convolutional pooling pyramid module
[0092] Considering the multi-scale problem, the applicant constructed a dilated spatial pooling pyramid module. The traditional way to process multi-scale is to scale the original image to different scales and then pass it into the model, which requires a lot of calculations. Therefore, a module composed of multiple parallel dilated convolutional layers with different expansion rates is used to extract features of different receptive fields at different expansion rates in each branch, and then fuse them to generate the final result. This module can extract contextual information from images at multiple scales. The structure of the dilated spatial pooling pyramid module is as follows: Figure 4 shown.
[0093] In the figure, the input is the output of stage 4 of the backbone feature extraction network, and the first branch is a normal 1×1 convolutional layer.
[0094] The second, third, and fourth branches are 3×3 dilated convolutional layers with dilation rates of 12, 24, and 36, respectively. When the output size is 1 / 16 of the original, the dilation rates should be set to 6, 12, and 18, respectively.
[0095] The fifth branch is average pooling plus a 1×1 convolution layer. The pooling layer cannot adjust the number of channels, and the 1×1 convolution plays a role in adjusting the number of channels.
[0096] The outputs of the five branches are all 256-dimensional (a total of 1280 dimensions). The atrous spatial convolution pooling pyramid module uses 1×1 convolution to fuse the output results of the five branches and finally outputs a new 256-dimensional feature.
[0097] (4) Construction of post-processing module
[0098] The post-processing module is the last module for preliminary image segmentation. The structure of the post-processing module is as follows: Figure 5 shown.
[0099] The input of the post-processing module is the output of the fused dilated spatial convolution pooling pyramid module. The final output of the post-processing module is the number of classification segmentation mask result images. The post-processing module contains two convolution layers. The input first passes through a 3×3 convolution and then a 1×1 convolution. The 3×3 convolution is a transitional function, and the 1×1 convolution is to change the number of output channels to the number of classifications.
[0100] (5) Constructing a secondary prediction network for the point
[0101] To solve the problem of insufficiently refined edges caused by image segmentation, we consider re-predicting inaccurately predicted points such as edges, replacing the original rough prediction results with the newly obtained prediction point results, and obtaining the final result as the final result of segmentation through multiple upsampling and iterative replacement.
[0102] 1) Upsampling to extract uncertain points on rough features
[0103] According to the rough prediction results, the rough results are upsampled using bilinear interpolation, sorted by category prediction scores, and the masks of the first two categories with high scores are selected. The pixels with higher scores on the two category masks are calculated as uncertain points. Generally speaking, a pixel can only correspond to one category. If a pixel has high scores for both categories, it means that it is likely to be a boundary point, that is, uncertain. In this embodiment, the number of sampling points is set to 8096.
[0104] 2) Fusion of fine features and coarse features of uncertain points
[0105] Through the operation of step 1), we get the uncertain points, and also get their point coordinates and positions. Therefore, we can get the coarse features and fine features of these uncertain points. The fine features are the output of stage 2 of our feature extraction network. The features of the uncertain points in the fine feature map and the coarse feature map are fused to get new features.
[0106] 3) Use multi-layer perceptron network to re-predict uncertain points
[0107] The new features of the uncertain points obtained in the above steps are sent again to a multi-layer perceptron network composed of 1×1 convolution to obtain new prediction values for each uncertainty.
[0108] 4) Iteratively replace uncertain points
[0109] The prediction result replaces the uncertain value in the rough prediction result, and the above steps are repeated until the output result size is consistent with the original image size.
[0110] (6) Calculate the convex hull of the shading plate area
[0111] 1) Assume that each shading plate edge area is composed of n pixels, forming a set E, and E = {P k |k=1,2,...,n}, first take the lower left corner pixel P1 of set E as the starting point, and then add other edge pixels P k , k=2,3,...,n are connected with P1, the angle between the connecting line and the horizontal direction is calculated, and they are sorted according to the angle;
[0112] 2) Sorted pixels Collection against Medium Pixels like Clockwise direction illustrate is the convex hull vertex, retaining the pixel Otherwise, from Delete pixels from until All pixels in the image are traversed and judged, and what is finally retained are the vertices of the two-dimensional convex hull;
[0113] 3) For the pixel set P k All pixels in the occluder area are obtained by the two-dimensional convex hull;
[0114] (7) Shade tilt recognition based on least squares attitude estimation
[0115] 1) Assume that there are m shading plates in an image, where the center line of the jth shading plate is a straight line in two-dimensional space, and construct the error objective function based on the mean square error
[0116]
[0117] in, is the jth straight line intercept, is the slope of the jth line, j∈{1, 2, ..., m}, x k and k are the horizontal and vertical coordinates of the kth edge pixel respectively;
[0118] 2) Use the least squares method to determine The optimal solution parameter with the minimum value The shading plate direction θ can be calculated j Traverse the m shading plates in the image and generate a shading plate posture direction set Ω = {θ1, θ2, ..., θ j};
[0119] 3) When the set Ω has θ j When the following conditions are met, the jth shading plate is determined to be tilted, and a position index set U corresponding to the tilted shading plate is constructed:
[0120]
[0121] Where τ is the threshold, In this embodiment, the value of τ is π / 12.
[0122] Embodiment 2:
[0123] The highway sunshade tilt recognition method based on deep semantic segmentation and image correction in this embodiment is composed of the following steps:
[0124] (1) Constructing a dataset of collected images
[0125] A high-resolution camera is used to collect image data of sunshades on highways. In order to collect rich sunshade target content, this example sets the angle between the camera and the road direction to π / 4 when collecting sunshade images.
[0126] (2) Constructing a feature extraction backbone network
[0127] Same as Example 1.
[0128] (3) Constructing a dilated spatial convolutional pooling pyramid module
[0129] Same as Example 1.
[0130] (4) Construction of post-processing module
[0131] Same as Example 1.
[0132] (5) Constructing a secondary prediction network for the point
[0133] 1) Upsampling to extract uncertain points on rough features
[0134] According to the rough prediction results, the rough results are upsampled using bilinear interpolation, sorted by category prediction scores, and the masks of the first two categories with high scores are selected. The pixels with higher scores on the two category masks are calculated as uncertain points. Generally speaking, a pixel can only correspond to one category. If a pixel has high scores for both categories, it means that it is likely to be a boundary point, that is, uncertain. In this embodiment, the number of sampling points is set to 6048.
[0135] 2) Fusion of fine features and coarse features of uncertain points
[0136] Same as Example 1.
[0137] 3) Use multi-layer perceptron network to re-predict uncertain points
[0138] Same as Example 1.
[0139] 4) Iteratively replace uncertain points
[0140] Same as Example 1.
[0141] (6) Calculate the convex hull of the shading plate area
[0142] All calculation methods in this step are the same as those in Example 1.
[0143] (7) Shade tilt recognition based on least squares attitude estimation
[0144] 1) Same as Example 1.
[0145] 2) Same as Example 1.
[0146] 3) When the set Ω has θ j When the following conditions are met, the jth shading plate is determined to be tilted, and a position index set U corresponding to the tilted shading plate is constructed:
[0147]
[0148] Where τ is the threshold, In this embodiment, the value of τ is π / 6.
[0149] Embodiment 3:
[0150] The highway sunshade tilt recognition method based on deep semantic segmentation and image correction in this embodiment is composed of the following steps:
[0151] (1) Constructing a dataset of collected images
[0152] A high-resolution camera is used to collect image data of sunshades on highways. In order to collect rich sunshade target content, the angle between the camera and the road direction is set to π / 5 when collecting sunshade images in this example.
[0153] (2) Constructing a feature extraction backbone network
[0154] Same as Example 1.
[0155] (3) Constructing a dilated spatial convolutional pooling pyramid module
[0156] Same as Example 1.
[0157] (4) Construction of post-processing module
[0158] Same as Example 1.
[0159] (5) Constructing a secondary prediction network for the point
[0160] 1) Upsampling to extract uncertain points on rough features
[0161] According to the rough prediction results, the rough results are upsampled using bilinear interpolation, sorted by category prediction scores, and the masks of the first two categories with high scores are selected. The pixels with higher scores on the two category masks are calculated as uncertain points. Generally speaking, a pixel can only correspond to one category. If a pixel has high scores for both categories, it means that it is likely to be a boundary point, that is, uncertain. In this embodiment, the number of sampling points is set to 7200.
[0162] 2) Fusion of fine features and coarse features of uncertain points
[0163] Same as Example 1.
[0164] 3) Use multi-layer perceptron network to re-predict uncertain points
[0165] Same as Example 1.
[0166] 4) Iteratively replace uncertain points
[0167] Same as Example 1.
[0168] (6) Calculate the convex hull of the shading plate area
[0169] All calculation methods in this step are the same as those in Example 1.
[0170] (7) Shade tilt recognition based on least squares attitude estimation
[0171] 1) Same as Example 1.
[0172] 2) Same as Example 1.
[0173] 3) When the set Ω has θj When the following conditions are met, the jth shading plate is determined to be tilted, and a position index set U corresponding to the tilted shading plate is constructed:
[0174]
[0175] Where τ is the threshold, In this embodiment, the value of τ is π / 4.
[0176] In order to verify the beneficial effect of the highway sunshade tilt recognition method based on deep semantic segmentation and image correction given in this embodiment, the highway sunshade data collected in real conditions is tested using Example 1, and the test steps are as follows:
[0177] 1. Experimental conditions
[0178] The data collection device is a vehicle-mounted high-definition camera. The experimental test environment is a Dell computer with Windows 10 (64) as the operating system, which is configured with an Intel Core i5-8400 processor, a six-core CPU and 6GB of memory. The experimental operations are performed on the PyCharm platform.
[0179] 2. Test data
[0180] 500 photos randomly taken on the highway were used, of which 34 contained tilted shading plates, and the shading plates in the remaining photos were all normal. 12 of the 34 photos contained two tilted shading plates, and the number of tilted shading plates in the other 22 photos was 1.
[0181] 3. Experimental results
[0182] (1) The residual neural network model is used to detect the data set. The experimental results are shown in Table 1. Figure 6-Figure 10 Table 1 gives the experimental results. Figure 6-Figure 10 Figure 2 is a partial graph of experimental results.
[0183] Table 1: Experimental results
[0184]
[0185] 4. Experimental conclusion
[0186] It can be seen from Table 1 that under the conditions of Example 1, the highway sunshade tilt recognition method based on deep semantic segmentation and image correction has a high detection rate. Among the 466 pictures of normal data, only two were misdetected, and no tilted sunshades were found in the remaining 464 pictures. Among the 22 pictures containing one tilted sunshade data, all 22 pictures were detected to have tilted sunshades. Among the 12 pictures containing two tilted sunshades, all 12 pictures were detected to have tilted sunshades. It is proved that the highway sunshade tilt recognition method based on deep semantic segmentation and image correction of this embodiment has a high detection rate and can be applied to real scenes.
Claims
1. A method for identifying the tilt of highway sunshade based on deep semantic segmentation network and image correction, characterized in that: The specific steps include: Step 1: construct a deep residual neural network model, which includes a backbone feature extraction network, a void space pooling pyramid module, a post-processing module, and a secondary point prediction module; The image of the sunshade on the highway captured by the high-resolution camera is input into the residual neural network model, and the neural network model outputs a feature map, which is then bilinearly interpolated twice to obtain a rough prediction map. N points with the highest uncertainty are selected on the rough prediction map, and a representation vector is obtained for each point with the highest uncertainty. The representation vector consists of a low-level feature vector and a high-level feature vector. The low-level feature vector is obtained by bilinearly interpolating the feature vector map of the rough prediction map, and the high-level feature vector is the feature vector of the uncertain point on the rough prediction map. A small neural network is then used to calculate the representation vector to obtain an updated rough prediction map. The prediction result replaces the unstable value in the rough prediction result, and the above steps are repeated until the output result size is consistent with the original image size. Step 2: Calculate the convex hull of the shading plate area. The specific calculation method is as follows: 1) Assume that each shading plate edge area is composed of n pixels, forming a set E, and E = {P k |k=1,2,…,n}, first take the lower left corner pixel P1 of set E as the starting point, and then add other edge pixels P k , k=2, 3, …, n are connected with P1, the angle between the connecting line and the horizontal direction is calculated, and they are sorted according to the angle; 2) Sorted pixels Collection against Medium Pixels like Clockwise direction illustrate is the convex hull vertex, retaining the pixel Otherwise, from Delete pixels from until All pixels in the image are traversed and judged, and what is finally retained are the vertices of the two-dimensional convex hull; 3) Pixel set All pixels in the occluder area are obtained by the two-dimensional convex hull; Step 3: Identify the tilt of the sunshade based on least squares attitude estimation. The specific identification method is as follows: 1) Assume that there are m shading plates in an image, where the center line of the jth shading plate is a straight line in two-dimensional space, and construct the error objective function based on the mean square error in, is the jth straight line intercept, is the slope of the jth straight line, j∈{1,2,...,m}, x k and k are the horizontal and vertical coordinates of the kth edge pixel respectively; 2) Use the least squares method to determine The optimal solution parameter with the minimum value Calculate the shading plate direction θ j ; Traverse the m shading plates in the image and generate a shading plate posture direction set Ω = {θ1, θ2, ..., θ j }; 3) When the set Ω has θ j When the following conditions are met, the jth shading plate is determined to be tilted, and a position index set U corresponding to the tilted shading plate is constructed: Where τ is the threshold,
