Unmanned aerial vehicle intelligent cruise detection method based on adaptive image defogging
By improving the YOLOv5 network and the adaptive dark channel defogging algorithm, the problem of blurred target recognition in foggy weather during UAV inspection was solved, achieving effective identification and positioning of traffic targets in foggy weather and reducing hardware costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2026-03-17
AI Technical Summary
During drone inspections, foggy weather can cause blurred aerial images, leading to missed or false detections of small traffic targets. Existing technologies struggle to achieve accurate target identification and positioning without increasing hardware computing power requirements.
An adaptive image dehazing method is adopted, which uses an improved YOLOv5 network model for feature extraction and recognition, combined with an adaptive dark channel prior dehazing algorithm and three-color channel correction, to dynamically adjust the transmittance and atmospheric light source value, thereby achieving dehazing and target recognition of foggy images.
Effectively recovers traffic target details in foggy weather, improves target recognition accuracy, reduces missed detections and false detections, lowers cost input, and achieves fast and accurate traffic target recognition and positioning.
Smart Images

Figure CN116883868B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for intelligent cruise detection of unmanned aerial vehicles based on adaptive image dehazing, belonging to the fields of target recognition and computer vision. Background Technology
[0002] Target detection technology based on drone inspection is one of the core technologies for smart city development. Drone inspection can quickly and accurately locate traffic congestion areas and accident scenes, providing accurate prior information for subsequent road planning and emergency rescue. However, traffic congestion and accidents often occur in inclement weather such as rain and fog. Because aerial images taken in rainy or foggy weather are generally blurry, the details of the captured targets are severely lost, making it easy to miss or misdetect small targets in traffic, thus failing to achieve accurate target identification and positioning.
[0003] In summary, achieving relatively accurate aerial target detection in foggy weather using existing target recognition technologies while avoiding excessive increases in hardware computing power requirements has become an urgent problem to be solved in drone traffic inspection scenarios. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide an intelligent cruise detection method for UAVs based on adaptive image defogging, which solves the problem of missed detection and false detection of small traffic targets caused by the overall blurriness of aerial images and the serious loss of target details during UAV inspection due to foggy weather.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0006] A method for intelligent cruise detection of unmanned aerial vehicles (UAVs) based on adaptive image dehazing includes the following steps:
[0007] Step 1: Obtain traffic target images by drone aerial photography, and annotate the obtained traffic target images to construct an aerial traffic target dataset;
[0008] Step 2: Train the YOLOv5 network model using the dataset constructed in Step 1 to obtain the trained recognition model;
[0009] Step 3: Perform fog detection on the aerial traffic images obtained by the drone in real time to determine whether the aerial traffic images obtained in real time are foggy images; if the aerial traffic images obtained in real time are foggy images, proceed to step 4; otherwise, input the aerial traffic images obtained in real time into the trained recognition model for recognition and output the final recognition result.
[0010] Step 4: Use the adaptive dark channel prior dehazing algorithm to perform dehazing on the aerial traffic images obtained by real-time aerial photography;
[0011] Step 5: Input the dehazed image obtained in Step 4 into the trained recognition model for recognition, and annotate the recognition result at the corresponding position in the aerial traffic image obtained in real time to obtain the final recognition result.
[0012] Furthermore, in step 2, an improved YOLOv5 network is used, and the YOLOv5 network is improved as follows:
[0013] 1) Construct a hierarchical weighted spatial pyramid pooling module to replace the original fast pyramid pooling module in the YOLOv5 network for feature extraction;
[0014] 2) Use the CARAFE upsampling operator to replace the nearest neighbor interpolation extraction method in the FPN structure of the YOLOv5 network to perform upsampling operations;
[0015] 3) Use Soft-NMS to replace the NMS algorithm in the YOLOv5 network to remove duplicate and redundant prediction boxes.
[0016] Furthermore, the specific construction process of the hierarchical weighted spatial pyramid pooling module is as follows:
[0017] First, three different 3×3 dilated convolutions with dilation rates of k1, k2, and k3 are used to extract features from the input feature map f1, and the extracted features are concatenated to obtain feature map f2. Then, the SimAM attention mechanism is used to apply new weights to feature map f2 to obtain feature map f3. Next, feature map f3 is residually connected to the input feature map f1 to obtain feature map f4. Finally, feature map f4 is input into the improved FPN structure.
[0018] Furthermore, the specific process for fog content detection in step 3 is as follows:
[0019] Step 3.1: Convert the aerial traffic image I(x) obtained from real-time aerial photography into a grayscale image I. gray (x);
[0020] Step 3.2: Calculate grayscale image I gray The mean and variance of (x);
[0021] Step 3.3: Based on the mean and variance of the grayscale image and pixel x, construct the haze index factor K(μ,δ,x), which is calculated as follows:
[0022]
[0023] Where μ and σ are the grayscale values of I, respectively. gray The mean and variance of (x), and Grayscale image I gray The maximum and minimum pixel values of (x), where k is the scale adjustment factor;
[0024] Step 3.3: For aerial traffic images obtained from real-time aerial photography, if the corresponding fog image discrimination function value is less than a set threshold, then it is determined to be a fog image; otherwise, it is determined not to be a fog image.
[0025] Furthermore, in step 4, a dual-correction adaptive dark channel prior dehazing algorithm is used to perform dehazing on the aerial traffic images obtained from real-time aerial photography. The specific process is as follows:
[0026] Step 4.1: Use the multi-segment iterative atmospheric light value localization method to locate the atmospheric light source value A in the aerial traffic image I(x) obtained by real-time aerial photography;
[0027] Step 4.2: Based on the fog content detection results of the aerial traffic image I(x) obtained by real-time aerial photography, the transmittance is corrected to obtain the corrected transmittance t'(x);
[0028] Step 4.3: Using the atmospheric light source value A and the corrected transmittance t'(x), dehaze the aerial traffic image I(x) obtained from real-time aerial photography:
[0029]
[0030] Where t0 is the transmittance bias factor, J(x) is the dehazed image, and max(·) is the maximum value function.
[0031] Furthermore, the specific process of the multi-segment iterative atmospheric light value localization method in step 4.1 is as follows;
[0032] Step 4.1.1: Convert the grayscale image I of the aerial traffic image obtained from real-time aerial photography. gray (x) is divided by width and height lines. The four sub-regions formed by the division are denoted as follows: from top to bottom and from left to right: The corresponding width and height are denoted as follows:
[0033] Step 4.1.2: Calculate the regional gradient for each sub-region:
[0034]
[0035] In the formula, For index value, For the first The average gradient value within each subregion, x c x v Let x represent the x-coordinate and y-coordinate of the pixel, respectively. They represent the first The set of width, height, and pixel x-coordinates of each sub-image region, and the set of pixel y-coordinates, Φ(x c ) and Φ(x v The Sobel operator in x c and x v Convolution template in the direction;
[0036] Step 4.1.3: Calculate the average pixel value within each sub-region.
[0037]
[0038] Step 4.1.4, according to and Constructing a regional evaluation function
[0039]
[0040] Step 4.1.5: For the four sub-regions, select the sub-region with the largest regional evaluation function value as the candidate region, return to step 4.1.1, until the preset iteration termination condition is met, locate the pixel position of the brightest point in the current candidate region, and use this brightest point as the atmospheric light source value A.
[0041] Furthermore, in step 4.2, the transmittance is adaptively corrected, and the specific process is as follows:
[0042] For the first frame of aerial traffic image I1(x) obtained by real-time aerial photography from the UAV, perform the following steps 4.2.1 and 4.2.2 to correct the transmittance:
[0043] Step 4.2.1, Preset Minimum Pixel Scale Filtering Window Calculate from largest to smallest to obtain Transmittance values at different scales And thus obtain Different dehazing images
[0044]
[0045] Where t0 is the transmittance bias factor, z = 1, 2, ..., Z, max(·) is the maximum value function, and A1 is the atmospheric source value of I1(x);
[0046] Step 4.2.2, to The similarity between I1(x) and different dehazed images is judged. The transmittance value corresponding to the dehazed image with the highest similarity is selected as t'(x), and the corresponding minimum value filtering window is denoted as Ω'(x).
[0047] Aerial traffic images obtained from the first frame of real-time drone aerial photography (I) i (x), i≠1, perform steps 4.2.3 to 4.2.5 to correct the transmittance:
[0048] Step 4.2.3: Using I1(x) as the reference image, I... i The similarity between image I1(x) and the baseline image I1(x) is determined. If the similarity is greater than the set threshold η, the similarity is determined. MR Then, use A1 from step 4.2.1 and t'(x) from step 4.2.2 to evaluate I. i (x) Perform dehazing; if the similarity is not greater than η MR The minimum value filtering window selection and transmittance correction are performed as follows:
[0049] Step 4.2.4, for I i When the fog content of I1(x) and I1(x) is measured, if the fog content of I1(x) is greater than that of I... i If (x), then the preset minimum value filtering window size is increased based on Ω'(x); otherwise, the preset minimum value filtering window size is decreased based on Ω'(x).
[0050] Step 4.2.5, the correction direction of Ω'(x) in step 4.2.4, repeating steps 4.2.1 to 4.2.2 for I. i (x) is used to correct the transmittance, and I is used as the base. i (x) serves as the new baseline image.
[0051] Furthermore, the MG-SSIM similarity is calculated between the dehazed image M and the original image N before dehazing. The calculation process is as follows:
[0052]
[0053] Where MG-SSIM(M,N) is the MG-SSIM similarity between M and N, δ m δ n Ω represents the pixel variances of M and N, respectively. mn Let δ be the pixel covariance of M and N, C2 and C3 be constant factors to avoid the denominator being zero, and δ be the pixel covariance of M and N. gm and δ gn Let M and N be the variances of their gradient values. and Let μ be the gradient value of pixel a on M and N. gm and μgn Let M and N be the gradient mean, Q be the total number of pixels, and α, β, and γ be the exponential correction factors.
[0054] Furthermore, the calculation process for the MG-SSIM similarity between the first frame image M and subsequent images N is as follows:
[0055]
[0056] Where MG-SSIM(M,N) is the MG-SSIM similarity between M and N, b is the index value, ξ is the total number of segmented regions, and μ m μ n The pixel mean values of M and N are respectively, δ m δ n The pixel variances of M and N are respectively. Let M and N be the cross-correlation coefficients of the pixels within the corresponding sub-regions b. Let M and N be the variances of the pixels within the corresponding sub-regions b. C1 is the covariance of pixels within sub-regions b corresponding to M and N, and a constant factor.
[0057] Furthermore, in step 5, before inputting the dehazed image obtained in step 4 into the trained recognition model for recognition, the RGB three-color channel correction of the dehazed image obtained in step 4 is performed first. The specific process is as follows:
[0058] Step 5.1: Convert the dehazed image obtained in Step 4 to the HSV color space;
[0059] Step 5.2: Perform contrast-limited histogram equalization on the luminance component V to equalize the luminance.
[0060] Step 5.3: Convert the result after brightness equalization from HSV color space back to RGB color space to complete the RGB three-color channel correction.
[0061] The UAV intelligent cruise detection method based on adaptive image dehazing described in this invention has the following technical advantages compared with existing technologies:
[0062] 1. The image dehazing method proposed in this invention can dynamically select the transmittance and locate the atmospheric light source value according to the fog concentration in the current image. It has a good dehazing effect under different foggy weather conditions and uses the three-color correction method to restore the details of traffic targets to the greatest extent.
[0063] 2. The method of the present invention enhances the feature extraction capability of aerial targets without increasing the computing power requirement through the constructed hierarchical weighted spatial pyramid pooling module and a series of YOLOv5 adjustment strategies, and has better detection effect.
[0064] 3. The method of the present invention can effectively identify traffic targets in foggy images without the use of infrared and ultrasonic radar in foggy traffic inspection scenarios, which greatly reduces the cost of traffic inspection in foggy weather. Attached Figure Description
[0065] Figure 1 It is an improved overall structure of YOLOv5s;
[0066] Figure 2 It is a hierarchical weighted spatial pyramid pooling module;
[0067] Figure 3 This is a flowchart of the overall algorithm for traffic target detection in drone aerial photography based on foggy weather. Detailed Implementation
[0068] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0069] This invention proposes an intelligent drone navigation detection method based on adaptive image dehazing, comprising: acquiring aerial images of traffic targets, constructing an aerial traffic target dataset, training an improved YOLOv5 network model based on the dataset to obtain a trained recognition model; determining the fog content of the current input image; performing adaptive dehazing and three-color channel correction on the foggy image; and inputting the dehazed image into the trained model to obtain the final traffic target recognition. In intelligent transportation scenarios, this method effectively solves the problem of missed and false detections of traffic targets caused by the overall blurriness of aerial images and significant loss of target details in rainy or foggy weather. It enables rapid and accurate location of traffic congestion areas and accident scenes, providing accurate prior information for subsequent road planning and emergency rescue.
[0070] The above-mentioned UAV intelligent cruise detection method based on adaptive image defogging mainly consists of two parts: one is the improvement and training of the YOLOv5 detection model; the other is target detection in foggy weather based on adaptive image defogging.
[0071] I. Improvement and Training of the YOLOv5 Detection Model
[0072] First, there's the model improvement section; the improved overall structure is as follows: Figure 1 As shown:
[0073] 1) Construct a hierarchical weighted spatial pyramid pooling module to replace the original fast pyramid pooling module for feature extraction, such as... Figure 2 As shown, the specific construction process is as follows:
[0074] First, three different 3×3 dilated convolutions with dilation rates of k1, k2, and k3 are used to extract features from the input feature map f1, and the extracted features are concatenated to obtain feature map f2. Then, the SimAM attention mechanism is used to redistribute the features of feature map f2 after dilated convolution extraction and concatenation, increasing the weight of important feature channels and weakening the influence of irrelevant channels on the feature map. The feature map after weight redistribution is denoted as f3. Further, feature map f3 is residually connected to the input feature map f1 to compensate for the local information lost after dilated convolution. The feature map after residual connection is denoted as f4. Finally, the obtained feature map f4 is input into the FPN structure in step 2.2 for subsequent multi-scale feature fusion processing.
[0075] 2) Construct an FPN feature fusion network based on the CARAFE upsampling operator. This network uses the CARAFE upsampling operator to replace the nearest neighbor interpolation extraction method in the FPN network for upsampling operations, so that the upsampled feature map has more effective semantic information.
[0076] 3) Soft-NMS is used instead of NMS to remove duplicate and redundant predicted boxes, thereby reducing the problem of missed detections when dense targets overlap. Compared with NMS, Soft-NMS modifies the score reset function by applying a penalty function to adjacent detection boxes that exceed a threshold, instead of directly setting them to zero. The Soft-NMS algorithm is as follows:
[0077]
[0078] In the formula, b q Represents q detection boxes, s q It is the score of q detection boxes, δ t denoted by Gaussian variance, and P is the highest-scoring detection box. By using Soft-NMS, the problem of missed detections in overlapping regions is effectively mitigated, improving the model's robustness to dense vehicle targets.
[0079] The second part concerns model training. First, the model was selected from the Visdrone public dataset and the UAVDT dataset. The selected aerial vehicle dataset includes two traffic scenes: foggy weather and normal daytime weather, totaling 8980 images across four categories: trucks, cars, motorcycles, and buses. The dataset was partitioned using a 6:2:2 ratio, resulting in a training set of 5388 images, a validation set of 1796 images, and a test set of 1796 images. The training and validation sets were then fed into an improved YOLOv5 dataset for detection.
[0080] II. Foggy Target Detection Based on Adaptive Image Dehazing
[0081] The overall process of the drone aerial photography traffic target detection method based on foggy weather is as follows: Figure 3 As shown, it mainly includes four parts: fog content detection, adaptive image dehazing, three-color channel correction, and dehazed image detection.
[0082] (I) Regarding the fog content detection section, the specific steps are as follows:
[0083] First, convert the input RGB hazy image I(x) into a grayscale image I. gray (x), the conversion formula for RGB to grayscale image is as follows:
[0084] GRAY=0.299*R+0.587*G+0.114*B.
[0085] Secondly, calculate the grayscale image I. gray The mean and variance of (x) are calculated as follows:
[0086]
[0087] Where N is the grayscale image I gray (x) Total number of pixels, x i Let μ be the current pixel value, and σ be the grayscale value of I. gray The mean and variance of (x).
[0088] Finally, based on the mean and variance of the grayscale image and pixel x, the fog content index factor K(μ,δ,x) is constructed, and the specific calculation is as follows:
[0089]
[0090] in, and Grayscale image I gray The maximum and minimum pixel values of (x) are given, where k is the scale adjustment factor. According to the formula above, the more foggy the image, the smaller the pixel differences, and the smaller the mean and variance. and The closer the value is to the mean, the smaller the value of K(μ,δ,x). Conversely, the less foggy the image, the greater the pixel difference, and the larger the mean and variance. with Vietnam The greater the difference, the larger K(μ,δ,x) becomes, and the range of K(μ,δ,x) is limited to (0,1). Therefore, by setting an appropriate threshold, it is possible to determine whether the input image is a foggy image. Generally, the threshold is set to 0.8. A threshold above 0.8 generally indicates very low fog content or no fog at all, a threshold between 0.5 and 0.8 indicates a light fog image, and a threshold below 0.5 indicates a dense fog image.
[0091] (II) Regarding the adaptive image dehazing part, the specific steps are as follows:
[0092] First, the atmospheric light source value A of the input image is located using a multi-segment iterative atmospheric light value localization method. The specific steps are as follows:
[0093] 1) Convert the grayscale image I gray (x) Divide the region into four sub-regions from top to bottom and from left to right, based on the width and height lines. These represent the width and height of the segmented sub-regions, respectively.
[0094] 2) Calculate the regional gradient for each sub-region. The general calculation process is as follows:
[0095]
[0096] In the formula, For index value, For the first The average gradient value within each subplot region, x c x v Let x represent the x-coordinate and y-coordinate of the pixel, respectively. They represent the first The set of width, height, and pixel x and y coordinates within a sub-image region, Φ(x c ) and Φ(x v The Sobel operator in x c and x v Convolution template in the direction.
[0097] 3) Calculate the average pixel value within each sub-region. The relevant calculations are as follows:
[0098]
[0099] 4) Based on the results and Constructing a regional evaluation function The specific calculations are as follows:
[0100]
[0101] 5) Compare the Γ values of the four regions, select the region with the largest regional evaluation function value as the candidate region, and then repeat the iterative process of steps 1-4.
[0102] 6) After each four-segmentation, the candidate regions are subjected to iteration termination judgment. In order to ensure sufficient region convolution and not lose edge details, the threshold of the final iteration value is set to λ times the Sobel operator convolution template used in step 4.1.2, where λ is the interval adjustment coefficient. Let the final iteration termination region be d×d. In the experiment, the Sobel operator template is generally selected as 3*3 operator, and the iteration termination region is set to 9×9.
[0103] 7) In the final selected 9×9 candidate area, locate the pixel position of the highest brightness point and take this point as atmospheric light source point A.
[0104] (III) Based on the judgment of image haze concentration using K(μ,δ,x), adaptive transmittance correction is performed, and the corrected transmittance is denoted as t'(x). The specific implementation steps are as follows:
[0105] 1) Using the proposed multi-segment iterative atmospheric light value localization method, the atmospheric light source position of the first frame input image I1(x) is located, and the atmospheric light source A value is obtained.
[0106] 2) Set the preset Minimum Pixel Scale Filtering Window Calculate from largest to smallest to obtain Transmittance values at different scales The specific calculation process is as follows:
[0107]
[0108] Among them, I c (x) represents the smallest monochrome channel of the foggy image, and ω represents the fog retention coefficient, which generally ranges from [0.95, 1].
[0109] 3) The obtained atmospheric light source value A and Transmittance values at different scales Substituting into the defogging formula, we get Different dehazing images The calculation for the defogging formula is as follows:
[0110]
[0111] Where t0 is the transmittance bias factor, which is mainly to avoid the estimated transmittance being too small and causing serious distortion of the final restored image, J(x) is the image after dehazing, and max(·) is the maximum value function.
[0112] 4) Regarding the results The MG-SSIM similarity of the dehazed image and the original image I1(x) (image before dehazing) is judged. The transmittance of the dehazed image with the highest degree of restoration (highest MG-SSIM similarity) is selected, and the current minimum filter window Ω'(x) and transmittance t'(x) are recorded.
[0113] The calculation process of MG-SSIM between the dehazed image M and the original image N before dehazing is as follows:
[0114]
[0115] Where c(M,N) is the contrast similarity between M and N, s(M,N) is the structural similarity between M and N, g(M,N) is the mean gradient similarity, and δ m δ n δ represents the pixel variances of M and N, respectively. mn Let δ be the pixel covariance of M and N, C2 and C3 be constant factors to avoid the denominator being zero, and δ be the pixel covariance of M and N. gm and δ gn Let M and N be the variances of their gradient values. and Let μ be the gradient value of pixel a on M and N. gm and μ gn Let M and N be the gradient mean, Q be the total number of pixels, and α, β, and γ be the exponential correction factors.
[0116] 5) Perform MR-SSIM similarity analysis between subsequent aerial images and the first frame image. If the similarity exceeds the set threshold η, the result is considered similar. MR If the fogging condition of the currently captured image does not change significantly, the A value in step 4.2.1 and the transmittance t'(x) in step 4.2.4 are used directly for defogging.
[0117] The MR-SSIM calculation method for the first frame image M and the current image N is as follows:
[0118]
[0119] Where l(M,N) represents the brightness similarity between M and N, s b (M,N) represents the structured similarity of subregion b corresponding to M and N, where b is the index value and ζ is the total number of subregions in M and N. Let be the cross-correlation coefficient of pixels within corresponding sub-regions b of the two input images. Let be the variance of the pixels within the corresponding sub-region b. It represents the covariance of the pixels within the corresponding sub-region b.
[0120] 6) If the similarity between the currently captured image and the first frame image is lower than the set threshold η MR The minimum filtering window selection and transmittance update are performed as follows:
[0121] 6.1) When the MR-SSIM of two images is not greater than the threshold η MR When the fog content changes, the K(μ,δ,x) fog content index factor described in step 3.3 is used to judge the fog content change. If the fog content of the image increases, that is, the K(μ,δ,x) value of the first frame image is higher than the K(μ,δ,x) value of the currently captured image, then the minimum value filter window scale needs to be increased based on the current minimum filter window Ω'(x) to enhance its defogging ability. Conversely, the minimum value filter window scale needs to be reduced based on the minimum filter window Ω'(x) to refine the transmittance and retain the original image details as much as possible.
[0122] 6.2) Based on the Ω'(x) scale change correction direction mentioned above, repeat steps 1 to 4 to update the atmospheric light value and transmittance value, and use the current captured image as the reference comparison image for subsequent input images (otherwise, always keep the first frame image as the reference comparison image).
[0123] Finally, using the obtained atmospheric light source value A and the adaptively adjusted transmittance t'(x), the current hazy image is dehazed using the same dehazing formula to obtain the corresponding dehazed image J(x), as calculated below:
[0124]
[0125] Where t0 is the transmittance bias factor, which is mainly to avoid the estimated transmittance being too small and causing serious distortion of the final restored image, J(x) is the image after dehazing, and max(·) is the maximum value function.
[0126] (iv) Regarding the three-color channel correction: First, J(x) after adaptive image dehazing is converted to the HSV color space. Then, in the HSV space, the luminance component V is subjected to contrast-limited histogram equalization to perform luminance equalization. The contrast limit is set to 0.01, and the local equalization scale is consistent with the minimum value filtering window size Ω'(x) of this image. Finally, the luminance-equalized HSV space is converted back to the RGB space, thereby realizing the RGB three-color channel correction.
[0127] Finally, the foggy image detection process is as follows: Images with low fog content or no fog are directly input into the trained improved YOLOv5 model for detection. Images with high fog content undergo adaptive defogging and brightness correction, and the corrected images are then input into the trained model for detection. Finally, the identified target location information and category information are labeled at the corresponding positions in the original image to obtain the final recognition result image.
[0128] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A method for intelligent cruise detection of unmanned aerial vehicles based on adaptive image dehazing, characterized in that, Includes the following steps: Step 1: Obtain traffic target images by drone aerial photography, and annotate the obtained traffic target images to construct an aerial traffic target dataset; Step 2: Train the YOLOv5 network model using the dataset constructed in Step 1 to obtain the trained recognition model; Step 3: Perform fog detection on the aerial traffic images obtained by the drone in real time to determine whether the aerial traffic images obtained in real time are foggy images; if the aerial traffic images obtained in real time are foggy images, proceed to step 4; otherwise, input the aerial traffic images obtained in real time into the trained recognition model for recognition and output the final recognition result. Step 4: Use the dual-correction adaptive dark channel prior dehazing algorithm to perform dehazing operation on the aerial traffic images obtained by real-time aerial photography; Step 5: Input the dehazed image obtained in Step 4 into the trained recognition model for recognition, and annotate the recognition result at the corresponding position in the aerial traffic image obtained in real time to obtain the final recognition result; The specific process of step 4 is as follows: Step 4.1: Use the multi-segment iterative atmospheric light value localization method to locate the atmospheric light source value A in the aerial traffic image I(x) obtained by real-time aerial photography; Step 4.2: Based on the fog content detection results of the aerial traffic image I(x) obtained by real-time aerial photography, the transmittance is corrected to obtain the corrected transmittance t′(x); Step 4.3: Using the atmospheric light source value A and the corrected transmittance t′(x), perform dehazing on the aerial traffic image I(x) obtained from real-time aerial photography: Where t0 is the transmittance bias factor, J(x) is the dehazed image, and max(·) is the maximum value function; The specific process of the multi-segment iterative atmospheric light value localization method in step 4.1 is as follows; Step 4.1.1: Convert the grayscale image I of the aerial traffic image obtained from real-time aerial photography. gray (x) is divided by width and height lines. The four sub-regions formed by the division are denoted as follows: from top to bottom and from left to right: The corresponding width and height are denoted as follows: Step 4.1.2: Calculate the regional gradient for each sub-region: In the formula, For index value, For the first The average gradient value within each subregion, x c x v Let x represent the x-coordinate and y-coordinate of the pixel, respectively. They represent the first The set of width, height, and pixel x-coordinates of each sub-image region, and the set of pixel y-coordinates, Φ(x c ) and Φ(x v The Sobel operator in x c and x v Convolution template in the direction; Step 4.1.3: Calculate the average pixel value within each sub-region. Step 4.1.4, according to and Constructing a regional evaluation function Step 4.1.5: For the four sub-regions, select the sub-region with the largest regional evaluation function value as the candidate region, return to step 4.1.1, until the preset iteration termination condition is met, locate the pixel position of the brightest point in the current candidate region, and use this brightest point as the atmospheric light source value A.
2. The UAV intelligent cruise detection method based on adaptive image dehazing according to claim 1, characterized in that, In step 2, an improved YOLOv5 network is used, and the YOLOv5 network is improved as follows: 1) Construct a hierarchical weighted spatial pyramid pooling module to replace the original fast pyramid pooling module in the YOLOv5 network for feature extraction; 2) Use the CARAFE upsampling operator to replace the nearest neighbor interpolation extraction method in the FPN structure of the YOLOv5 network to perform upsampling operations; 3) Use Soft-NMS to replace the NMS algorithm in the YOLOv5 network to remove duplicate and redundant prediction boxes.
3. The UAV intelligent cruise detection method based on adaptive image dehazing according to claim 2, characterized in that, The specific construction process of the hierarchical weighted spatial pyramid pooling module is as follows: First, three different 3×3 dilated convolutions with dilation rates of k1, k2, and k3 are used to extract features from the input feature map f1, and the extracted features are concatenated to obtain feature map f2. Then, the SimAM attention mechanism is used to apply new weights to feature map f2 to obtain feature map f3. Next, feature map f3 is residually connected to the input feature map f1 to obtain feature map f4. Finally, feature map f4 is input into the improved FPN structure.
4. The UAV intelligent cruise detection method based on adaptive image dehazing according to claim 1, characterized in that, The specific process for fog content detection in step 3 is as follows: Step 3.1: Convert the aerial traffic image I(x) obtained from real-time aerial photography into a grayscale image I. gray (x); Step 3.2: Calculate grayscale image I gray The mean and variance of (x); Step 3.3: Based on the mean and variance of the grayscale image and pixel x, construct the haze index factor K(μ,δ,x), which is calculated as follows: Where μ and σ are the grayscale values of I, respectively. gray The mean and variance of (x), and Grayscale image I gray The maximum and minimum pixel values of (x), where k is the scale adjustment factor; Step 3.4: For aerial traffic images obtained from real-time aerial photography, if the corresponding fog image discrimination function value is less than a set threshold, then it is determined to be a fog image; otherwise, it is determined not to be a fog image.
5. The UAV intelligent cruise detection method based on adaptive image dehazing according to claim 1, characterized in that, In step 4.2, the transmittance is adaptively corrected. The specific process is as follows: For the first frame of aerial traffic image I1(x) obtained by real-time aerial photography from the UAV, perform the following steps 4.2.1 and 4.2.2 to correct the transmittance: Step 4.2.1, Preset Minimum Pixel Scale Filtering Window Calculate from largest to smallest to obtain Transmittance values at different scales And thus obtain Different dehazing images Where t0 is the transmittance bias factor, z = 1, 2, ..., Z, max(·) is the maximum value function, and A1 is the atmospheric source value of I1(x); Step 4.2.2, to The similarity between I1(x) and different dehazed images is judged. The transmittance value corresponding to the dehazed image with the highest similarity is selected as t′(x), and the corresponding minimum value filtering window is denoted as Ω′(x). Aerial traffic images obtained from the first frame of real-time drone aerial photography (I) i (x), i≠1, perform steps 4.2.3 to 4.2.5 to correct the transmittance: Step 4.2.3: Using I1(x) as the reference image, I... i The similarity between I1(x) and I2(x) is determined. If the similarity is greater than the set threshold η, the similarity is determined. MR Then, use A1 from step 4.2.1 and t′(x) from step 4.2.2 to evaluate I. i (x) Perform dehazing; if the similarity is not greater than η MR The minimum value filtering window selection and transmittance correction are performed as follows: Step 4.2.4, for I i When the fog content of I1(x) and I1(x) is measured, if the fog content of I1(x) is greater than that of I... i If (x), then the preset minimum value filtering window size is increased based on Ω′(x); otherwise, the preset minimum value filtering window size is decreased based on Ω′(x). Step 4.2.5, the correction direction of Ω′(x) in step 4.2.4, repeating steps 4.2.1 to 4.2.2 for I. i (x) is used to correct the transmittance, and I is used as the base. i (x) serves as the new baseline image.
6. The UAV intelligent cruise detection method based on adaptive image dehazing according to claim 5, characterized in that, The MG-SSIM similarity between the dehazed image M and the original image N before dehazing is calculated as follows: Where MG-SSIM(M,N) is the MG-SSIM similarity between M and N, δ m δ n δ represents the pixel variances of M and N, respectively. mn Let δ be the pixel covariance of M and N, C2 and C3 be constant factors to avoid the denominator being zero, and δ be the pixel covariance of M and N. gm and δ gn Let M and N be the variances of their gradient values. and Let μ be the gradient value of pixel a on M and N. gm and μ gn Let M and N be the gradient mean, Q be the total number of pixels, and α, β, and γ be the exponential correction factors.
7. The UAV intelligent cruise detection method based on adaptive image dehazing according to claim 5, characterized in that, The calculation process for the MR-SSIM similarity between the first frame image M and subsequent images N is as follows: Where MR-SSIM(M,N) is the MR-SSIM similarity between M and N, b is the index value, ξ is the total number of segmented regions, and μ m μ n The pixel mean values of M and N are respectively, δ m δ n The pixel variances of M and N are respectively. Let M and N be the cross-correlation coefficients of the pixels within the corresponding sub-regions b. and Let M and N be the variances of the pixels within the corresponding sub-regions b. C1 is the covariance of pixels within sub-regions b corresponding to M and N, and a constant factor.
8. The UAV intelligent cruise detection method based on adaptive image dehazing according to claim 1, characterized in that, In step 5, before inputting the dehazed image obtained in step 4 into the trained recognition model for recognition, the RGB three-color channel correction of the dehazed image obtained in step 4 is performed first. The specific process is as follows: Step 5.1: Convert the dehazed image obtained in Step 4 to the HSV color space; Step 5.2: Perform contrast-limited histogram equalization on the luminance component V to equalize the luminance. Step 5.3: Convert the result after brightness equalization from HSV color space back to RGB color space to complete the RGB three-color channel correction.
Citation Information
Patent Citations
Sky region segmentation-based single image defogging method
CN108596849A
Image defogging method based on dark and bright channel priori and adaptive parameter optimization
CN108765336A
Small target identification method and system for complex scene of power transmission line
CN115294483A