A method for detecting image haze concentration based on hyperbolic tangent function

CN121527039BActive Publication Date: 2026-08-21CHANGAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511692198.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-18
Publication Date
2026-08-21
Estimated Expiration
2045-11-18

AI Technical Summary

Technical Problem

传统雾霾监测技术手段多样,但各有局限

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121527039B_ABST
    Figure CN121527039B_ABST
Patent Text Reader

Abstract

The application provides a kind of based on hyperbolic tangent function image haze concentration detection method, comprising the following steps: establishing standard image set, standard image set includes fog image and fog-free image;Fog image and fog-free image are grouped to establish scatter sample, by analyzing gray difference ratio, the S-type scatter diagram of scatter sample is established;Improved hyperbolic tangent model is constructed, and the model parameters of improved hyperbolic tangent model are estimated by using the best back sample point;Model parameters include exponential factor and phase angle factor;The improved hyperbolic tangent model is determined using the estimated model parameters, the S-type scatter diagram is refitted using the determined improved hyperbolic tangent model, and the field of view haze concentration is determined.The above-mentioned based on hyperbolic tangent function image haze concentration detection method is used, and the detection precision and detection speed of image haze concentration are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of haze monitoring technology, and in particular relates to a haze concentration detection method based on hyperbolic tangent function image. Background Technology

[0002] The main threat of smog to highway driving safety includes reduced visibility, which directly impairs drivers' visual perception. Traditional smog monitoring technologies are diverse, but each has its limitations.

[0003] Currently, many scholars are engaged in research on highway fog concentration detection, such as: a satellite-based fog concentration detection method that measures the optical thickness of aerosols and surface temperature using a Medium Resolution Imaging Spectroradiometer (MODIS) to retrieve visibility and relative humidity; a novel visibility recognition framework based on a convolutional neural network (CNN), comprising two sub-networks, C-FEM and F-FFM, which demonstrates high effectiveness and robustness in visibility assessment; and a review by Adhikari et al. on accurate pollutant monitoring and effective PM2.5 control. The study systematically explores how machine learning models can improve PM2.5 concentration monitoring capabilities, providing a possibility for developing fair and targeted control strategies in fields such as industry, transportation, energy, and urban planning. Finally, a multi-branch fog concentration detection model based on fog concentration classification and prior knowledge of dark and bright channels is proposed. This model uses defogging networks of varying complexity to process images with different fog concentrations, significantly improving computational efficiency while maintaining defogging accuracy. Summary of the Invention

[0004] The purpose of this invention is to provide a method for detecting haze concentration based on hyperbolic tangent function images. It proposes a prior method of gray scale difference ratio (GSDR), introduces a hyperbolic tangent model function and establishes a haze concentration lookup table, and uses the average probability method to search for the best back-fit sample points. The Firth distance between the standard image and the real image and the Pearson correlation coefficient between parameter estimates are used as criteria to measure haze concentration.

[0005] To achieve the above objectives, this invention provides a method for detecting haze concentration based on hyperbolic tangent function images, comprising the following steps:

[0006] Establish a standard image set, which includes both foggy and fog-free images;

[0007] Scattered samples were created by grouping foggy and fog-free images, and an S-shaped scatter plot of the scatter samples was constructed by analyzing the gray-level difference ratio.

[0008] A mean search algorithm is introduced to determine the optimal back-substitution sample set for the standard image set;

[0009] An improved hyperbolic tangent model is constructed, and the model parameters of the improved hyperbolic tangent model are estimated using the optimal back-substitution sample points; the model parameters include exponential factors and phase factors.

[0010] An improved hyperbolic tangent model is determined using the estimated model parameters. The S-shaped scatter plot is then refitted using the determined improved hyperbolic tangent model to determine the field-of-view fog concentration.

[0011] The preferred and improved hyperbolic tangent model is as follows:

[0012] (1);

[0013] In the formula, Indicates the exponential factor. Let x represent the phase factor, and let x represent the dependent variable of the hyperbolic tangent function. This is the improved hyperbolic tangent function.

[0014] Preferred, exponential factor The calculation method includes the following steps:

[0015] The sample size of the standard image set is , 2 Multiples of 3 divide the N standard image sets into odd and even numbers;

[0016] Substitute the odd and even array standard image sets into equation (1) respectively, and then subtract the corresponding even array from the odd array, as follows:

[0017] (2);

[0018] In the formula, This represents the sample sequence consisting of samples at even-numbered positions in the entire sample sequence. This represents a sample sequence consisting of samples at odd-numbered positions in the entire sample sequence;

[0019] Summing both sides of the above equation, we can calculate the exponential factor. :

[0020] (3);

[0021] Then we have:

[0022] (4).

[0023] Preferably, phase factor The calculation method includes the following steps:

[0024] Substitute the odd and even array standard image sets into equation (3) respectively, and then add the corresponding even array to the odd array to obtain:

[0025] (5);

[0026] Dividing the two equations in equation (5), we get:

[0027] (6);

[0028] make:

[0029] (7);

[0030] have to:

[0031] (8);

[0032] Preferably, a search algorithm is used to determine the optimal back-substitution sample set, including the following steps:

[0033] The search starts from gray level 0 within the range [0,225]. If the gray level difference ratio is 0 at this time, it means that there are no scattered points in the gray level, so the gray level is incremented by 1; and so on, the gray level is incremented automatically.

[0034] When a grayscale difference ratio is not zero for the first time, it indicates that this point is the lower edge of the thick S-shaped curve. The grayscale level corresponding to this lower edge point is denoted as [missing value]. And record the corresponding grayscale difference ratio, for example, denoted as ;

[0035] from Initially, the grayscale difference ratio was recorded every time a grayscale level was added. Until the point before the grayscale difference ratio is 0 is encountered again;

[0036] At this time, the corresponding grayscale level is This indicates that the upper edge point of the S-shaped thick curve has been counted;

[0037] Calculate the number of gray levels: Calculate the sum of all non-zero grayscale difference ratios:

[0038] (9);

[0039] In the formula, The number of non-zero values ​​for the grayscale difference ratio;

[0040] Calculate the mean and round it: mean This is recorded as the best back-substitution sample.

[0041] Preferred, based on defined parameters and Establish a system corresponding to the determined field-of-view fog concentration. and The parameter lookup table is used to determine the parameters. and The process for finding and establishing expressions is as follows:

[0042] A gray-level difference-ratio scatter plot was created by selecting samples from a standard image set. The horizontal axis represents gray levels [1, 255]. The vertical axis represents the corresponding grayscale difference-ratio, with each grayscale level... Establish a set based on the corresponding vertical grayscale difference-ratio ;

[0043] Calculate the optimal back-substitution sample value for each gray level using the search algorithm. Substitute the best sample for each gray level into formulas (4) and (8) to estimate the exponential factor. and estimated phase factor ;

[0044] Select standard image sets with different field-of-view concentrations, repeat the first two steps of the expression establishment process, fit hyperbolic tangent curves for different fog concentrations, and simultaneously calculate and record the parameter estimates for each concentration level. , ;

[0045] Parameters corresponding to all fog concentrations After all the estimates were made, with Create a concentration table using the primary key, and then set the table as follows: Arranged in ascending order, we get and Parameter lookup table.

[0046] Preferably, the parameters corresponding to all fog concentrations After all the estimates were made, with Create a concentration table using the primary key, and then set the table as follows: Arranged in ascending order, we get and The parameter lookup table includes the following steps:

[0047] Samples of fog images from real-world scenes were collected with reference to a standard image set to establish a real image set, and a corresponding scatter plot was created.

[0048] Referring to the first two steps of the lookup table creation process, the optimal back-substitution sample vector of the standard image is established respectively. (), ), ... ( )] and the best scatter-point back-substitution sample vector of the real image [( (), ), ... ( )];

[0049] Calculate the Firth distance between the standard image and the real image vectors. :

[0050] , ( (10);

[0051] In the formula, x i express y i x represents the corresponding grayscale difference ratio. i 、 y represents the grayscale level in the scatter plot of real image samples. i This corresponds to the grayscale difference ratio.

[0052] exist Find the largest , This indicates that the spatial distance between the true curve and the standard curve meets the condition. For the threshold;

[0053] The Freud distance only indicates that the sample points of the curves are close in spatial distance, but it cannot indicate that the curves are consistent in form or trend. Therefore, the Pearson correlation coefficient is introduced, and it is still calculated using the best back-substitute sample vector of the standard image and the best scatter point back-substitute sample vector of the real image:

[0054] (11);

[0055] In the formula, p represents the Pearson correlation coefficient. and These are standard and real image samples of the same concentration, respectively. , These are the mean values ​​of the standard and real images, respectively.

[0056] Refer to the process of establishing the expression to determine the estimated index factor. and estimated phase factor Methods, parameter estimation ;

[0057] Calculate standard image parameters ( ) and real image parameters The absolute error value is determined, and error criteria are established;

[0058] ;

[0059] (12);

[0060] In the formula, , The absolute value error of the exponential and phase factors of the curves in the standard and real atlases. , These are the threshold values ​​for the absolute value errors of the exponential and phase factors of the curves in the standard and real atlases, respectively.

[0061] Therefore, the present invention adopts the above-mentioned image haze concentration detection method based on hyperbolic tangent function, which greatly improves the detection accuracy and detection speed of image haze concentration. Attached Figure Description

[0062] Figure 1 PM2.5 = 32µg / m 3 The grayscale difference is a priori compared to the scatter plot; Figure 1 (a) PM2.5 = 32 µg / m³ under anisotropic lighting and medium conditions. 3 ; Figure 1 (b) PM2.5 = 32µg / m 3 Scatter plot;

[0063] Figure 2 PM2.5 = 61µg / m 3 The grayscale difference is a priori compared to the scatter plot; Figure 2 (a) PM2.5 = 61 µg / m³ under anisotropic lighting and medium conditions. 3 ; Figure 2 (b) PM2.5 = 61 µg / m³ 3 Scatter plot;

[0064] Figure 3 PM2.5 = 89µg / m 3 The grayscale difference is a priori compared to the scatter plot; Figure 3 (a) PM2.5 = 89 µg / m³ under anisotropic lighting and medium conditions 3 ; Figure 3 (b) PM2.5 = 89µg / m 3 Scatter plot;

[0065] Figure 4 PM2.5 = 141µg / m 3 The grayscale difference is a priori compared to the scatter plot; Figure 4 (a) PM2.5 = 141 µg / m³ under anisotropic lighting and medium conditions. 3 ; Figure 4 (b) PM2.5 = 141 µg / m³ 3 Scatter plot;

[0066] Figure 5To adjust the fitting waveform of the hyperbolic tangent function under different domains of different exponential factors; Figure 5 (a) is a graph of tanh with a domain of [-100, 100] and a threshold of [-1, 1]. Figure 5 (b) is a graph of tanh with its domain unchanged and a threshold of [0,1]. Figure 5 (c) is the curve of tanh when the threshold remains unchanged and the domain is [0, 255].

[0067] Figure 6 To adjust the fitted waveform of the hyperbolic tangent function for different exponential factors; Figure 6 (a) is Fitted waveform when = 0.02; Figure 6 (b) is Fitted waveform when = 0.05; Figure 6 (c) is Fitted waveform when = 0.07; Figure 6 (d) is Fitted waveform when = 0.09; Figure 6 (e) is Fitted waveform when = 0.11;

[0068] Figure 7 The interface is an S-shaped curve.

[0069] Figure 8 S-shaped curves under different exponential factors;

[0070] Figure 9 Flowchart for parameter estimation;

[0071] Figure 10 Flowchart for image processing acquired by drones; Figure 10 (a) Image acquisition by drone in a fog-free scene; Figure 10 (b) Image acquisition by drone in foggy scenes; Figure 10 (c) is the process for detecting and processing haze concentration in UAV images;

[0072] Figure 11 Different concentrations in standard image sample scenes;

[0073] Figure 12 Different concentrations were used in real image sample scenarios;

[0074] Figure 13 For Fraser distance error testing;

[0075] Figure 14 For testing related to real and standard samples;

[0076] Figure 15 These are test samples used for comparison and accuracy testing.

[0077] Figure 16 This is a comparison chart of error tests;

[0078] Figure 17 This is a comparison chart for execution efficiency tests. Detailed Implementation

[0079] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0080] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.

[0081] Example 1

[0082] A method for detecting haze concentration based on hyperbolic tangent function image includes the following steps:

[0083] I. Prior Principle of Regression Scatter Points

[0084] 1.1 Selection of Standard Image Set

[0085] In fog images, the parameters reflecting the fog density in the field of view are image information entropy and contrast. Generally, image information entropy and contrast decrease as the fog density in the field of view increases. The scene and acquisition conditions of the image acquisition also affect image information entropy and contrast. Therefore, to ensure the accuracy of field-of-view fog density detection based on regression analysis, it is necessary to select a suitable standard dataset. Currently, the more commonly used standard image libraries in the field of image processing include HazyDet, RTTS, and DAWN. DAWN contains vehicle images under various weather conditions such as fog, snow, rain, and sandstorms, but the data volume is too small, only over 1000 images, which cannot cover all traffic scenarios. The RTTS image library can cover traffic scenarios, but lacks direct fog density values. HazyDet is a comprehensive image resource with approximately 387,000 images. This dataset includes fog images of highways acquired by UAVs, covering different fog density levels. More importantly, the library contains complete fog density parameters, target locations, and scene types, including foggy and fog-free images, and different scenes of the same scene. This provides a reference dataset for realizing UAV-based fog density detection in highway scenes based on regression analysis. Furthermore, this image set can meet the requirements of different acquisition conditions, such as the requirements for the propagation medium: homogeneous or non-homogeneous medium, and whether the illumination conditions are isotropic or anisotropic. It has broad authority and representativeness and can meet the needs for image samples.

[0086] 1.2 Establishment of Scatter Samples

[0087] First, 51,200 images each of the same highway with and without fog were selected from the standard image library HazyDet. Then, the foggy and fog-free images were divided into four groups of 12,800 images each, and each group was further divided into 256 grayscale levels. Figures 1-4 As shown, the top row of images in each group are fog-free images, and the bottom row of images are foggy images. Figures 1-4 Arranged in ascending order of smog concentration (PM2.5 value). Figure 1 Both light and fog are anisotropic; Figure 2 Light is isotropic, while fog is anisotropic; Figure 3 Illumination is anisotropic, while fog is isotropic; Figure 4 Both light and fog are isotropic.

[0088] 1.3S-type scatter plot prior

[0089] Define grayscale difference ratio for:

[0090] (1);

[0091] In the formula, The maximum grayscale value. For fog-free grayscale, It has a hazy grayscale.

[0092] Experiments have shown that if a scatter plot is created with the image grayscale difference ratio (GSDR) on the vertical axis and grayscale levels on the horizontal axis, the image scatter plot will exhibit a certain pattern: grayscale difference - ratio They all exhibit an S-shape, with a convex upper part and a concave lower part. The middle section between the convex and concave sections is approximately a straight line, and the slope of this line increases with increasing fog concentration (e.g., ...). Figures 5-8 ).

[0093] Furthermore, experiments revealed that the shape of the scatter plot curve is related to the haze concentration in the field of view. As the haze intensifies, the slope of the approximately linear middle segment of the S-shaped curve changes, and the S-shaped curve corresponds one-to-one with the haze concentration. This means that if the shape of the scatter plot curve can be determined, the haze concentration in the field of view corresponding to that curve can also be assessed. For example, under certain conditions, the shape of the curve on a real highway and the standard image (PM2.5=89) can be compared. If the calculation error of the S-curve is less than a certain threshold, then the actual smog level on highways can be considered to be PM2.5 = 89. Therefore, this embodiment introduces a hyperbolic tangent function to fit an S-shaped curve using regression analysis, thereby assessing the concentration of haze.

[0094] II. Parameter Estimation Based on Improved Hyperbolic Tangent Model

[0095] 2.1 Fitting Function Based on Hyperbolic Tangent Statistics

[0096] The hyperbolic tangent (Tanh) function is introduced to fit the S-shaped curve for two reasons: first, the hyperbolic tangent model curve is S-shaped; second, the function satisfies the following conditions: the hyperbolic tangent function monotonically increases in an S-shape within the interval, which matches the appearance of a scatter plot; it is bounded within the gray-level interval, which matches the boundedness characteristic of a scatter plot; and there is a large approximate linear segment between the upper and lower inflection points, and the linear slope is adjustable, depending on only a finite number of parameters. This satisfies the adjustable parameter property of a scatter plot, laying the foundation for parameter estimation to achieve fog concentration detection. Therefore, the hyperbolic tangent (Tanh) function is used to fit the GSDR scatter plot of the standard atlas, and then to estimate the fog concentration in the field of view.

[0097] The hyperbolic tangent (Tanh) model function takes the form of:

[0098] (2);

[0099] In the formula, x The dependent variable is represented as the hyperbolic tangent.

[0100] The Tanh function has been reorganized.

[0101] (3);

[0102] From the analysis of equation (3), we can see that tanh can be obtained from... The waveform is generated by inverting and adding 1, but its domain is the entire real number domain of [-R, +R], and its range is in the interval [-1, 1]. From the transformation of the domain and range of formula (3) to formula (4), we know that the domain of the scatter plot curve waveform is [0-255], the range is [0, 255], and the range after normalization is [0, 1]. Therefore, the hyperbolic tangent function tanh needs to be improved (let tanh be denoted as tanh). ), in the form of:

[0103] (4);

[0104] In the formula, For the improved hyperbolic tangent function, As an exponential factor, This is the phase angle factor. Adjustment Exponential factors can adjust the shape and inflection points of curves to meet different fitting requirements. For example... Figure 6 As shown, these are the exponents, therefore The waveforms at values ​​of 0.02, 0.05, 0.07, 0.09, and 0.11 show that as the exponential factor increases, the upper inflection point becomes more convex and the lower inflection point becomes more concave, and the slope of the linear region increases. Adjusting the phase angle factor can adjust the phase of the curve. Different curve waveforms correspond to different fog concentrations in the field of view. Therefore, different fog concentrations can be fitted by adjusting the exponential factor and the phase angle factor. The key is how to determine the exponential factor and the phase angle factor in equation (4). In this embodiment, regression analysis is used to determine the exponential factor and the phase angle factor.

[0105] Transform equation (4) into

[0106] ;

[0107] Taking the natural logarithm of both sides of equation (5), we have:

[0108] (5);

[0109] To determine the exponential factor of the hyperbolic tangent model and phase factor Different standard image sets were used to input the data, and the first step was to calculate the exponential factor. Calculation method:

[0110] (1) First, select a standard image set (sample size is 10 ... , 2 (multiples of 3), Each sample was divided into 2 and Grouping ( ), that is, dividing the N standard image sets into odd and even arrays;

[0111] (2) Substitute the standard image sets of the odd and even arrays into equation (5) respectively, and then subtract the corresponding even array from the odd array, as follows:

[0112] (6);

[0113] In the formula, This represents the sample sequence consisting of samples at even-numbered positions in the entire sample sequence. This represents a sample sequence consisting of samples at odd-numbered positions in the entire sample sequence.

[0114] Summing both sides of the above equation yields the exponential factor. :

[0115] (7);

[0116] Then we have:

[0117] (8);

[0118] Phase factor Calculation method:

[0119] Substituting the odd and even array standard image sets into equation (7) respectively, and then adding the corresponding even array to the odd array, we get:

[0120] (9);

[0121] Dividing the two equations in equation (9), we get:

[0122] (10);

[0123] make:

[0124] (11);

[0125] We can obtain:

[0126] (12);

[0127] Different scatter plot S-shapes correspond to different concentrations. If the points in the scatter plot are used as samples and substituted into equation (12), the desired fitting parameters can be calculated. This determines the fitted hyperbolic tangent model function. If we can find the fitting parameter estimate ( By understanding the relationship between the fog concentration in the field of view and the fog concentration in the field of view, we can assess the fog concentration in the field of view.

[0128] 2.2 Search for Sample Points Based on Average Probability Distribution

[0129] like Figure 1 As shown, the scatter plots of all standard atlases exhibit an S-shape, and these S-shaped scatter plots are not a single line but rather form a thick line. This thick line indicates that there will be multiple fitted curves corresponding to the fog concentration of a certain field of view. However, different S-shaped fitted curves will assess fog concentration with varying accuracy. Therefore, it is necessary to find the one with the highest fitting accuracy, which also means finding the optimal sample point for each gray level and substituting it back into the regression equation to obtain the best curve. Examining the longitudinal section of the S-shaped scatter plots, there are numerous scatter plots with equal probability distribution for each gray level. Figure 7 It can be seen that the scatter points are sparsely distributed at the top and bottom edges, and become increasingly dense towards the center. Different scatter points result in different back-fitting accuracies, so it is necessary to find the optimal back-fitting sample point at each gray level. Based on the equal probability characteristics of the scatter points, the mean search algorithm is selected to determine the optimal sample point. The mean search algorithm is as follows:

[0130] (1) Start searching from gray level 0 in the range [0,225]. If the gray level difference ratio is 0 at this time, it means that there are no scattered points in the gray level, so the gray level is incremented by 1; and so on, the gray level is incremented.

[0131] (2) When a grayscale difference ratio is not zero for the first time, it indicates that this point is the lower edge of the coarse S-curve. The grayscale level corresponding to the lower edge point at this time is denoted as . And record the corresponding grayscale difference ratio, for example, denoted as ;

[0132] (3) From Initially, the grayscale difference ratio was recorded every time a grayscale level was added. Until the point before the grayscale difference ratio is 0 is encountered again;

[0133] (4) Assume that the corresponding gray level at this time is This indicates that the points of the upper edge of the cross-section of the S-shaped scatter plot have been counted.

[0134] Calculate the number of gray levels: Calculate the sum of all non-zero grayscale difference ratios:

[0135] (13);

[0136] In the formula, This represents the number of non-zero values ​​for the grayscale difference ratio.

[0137] (5) Calculate the mean and round it: mean This is recorded as the best back-substitution sample;

[0138] (6) Search for the best back-substitution sample points on each horizontal gray level according to the methods (1)-(5), and the best sample point set on all gray levels can be determined. Substitute the best sample point set into formula (8) and formula (12) to determine the best fitting curve.

[0139] 2.3 Parameter Optimization of Hyperbolic Tangent Curve

[0140] Depend on Figure 8 It can be seen that the S-shaped curve changes drastically with the exponential factor, which ranges from 0.01 to 0.11. Even a slight change in the exponential factor value will cause a dramatic change in the curve, meaning that the exponential factor... The low resolution makes it difficult to distinguish in applications, therefore the exponential factor is... Take the reciprocal, that is ,when If it varies between [0.01, 0.11], then It varies between [9, 100].

[0141] III. Fog Concentration Detection Process Based on Hyperbolic Tangent Function (tanh)

[0142] Based on the principle of fitting scatter plots using the hyperbolic tangent function, it can be known that if the exponential factor... and phase factor Once the hyperbolic tangent fitting function is determined, the corresponding field-of-view fog concentration level can also be determined. Therefore, the key to fitting the hyperbolic tangent function curve is determining the exponential factor. and phase factor From equations (8) and (12), we know the exponential factor. and phase factor It can be estimated using regression analysis; therefore, the field-of-view fog concentration can be determined by selecting appropriate sample points and fitting a curve, such as... Figure 9 As shown. The detection approach is based on defined parameters. and Given a specific field-of-view fog concentration, it can be established... and A parameter lookup table is used to determine the field-of-view fog concentration. The lookup table establishment process is as follows:

[0143] (1) Select samples from the standard image library HazyDet to create a gray-level difference-ratio scatter plot. t The horizontal axis represents gray levels [1, 255]. The vertical axis represents the corresponding grayscale difference-ratio, with each grayscale level... Establish a set based on the corresponding vertical grayscale difference-ratio ;

[0144] (2) Calculate the optimal back-substitution sample value for each gray level using the optimal back-substitution sample search algorithm. Substitute the best sample for each gray level into formulas (8) and (12) to estimate the exponential factor. and estimated phase factor ;

[0145] (3) Select a standard image set with different field-of-view concentrations, repeat steps (1) and (2), fit the hyperbolic tangent curves for different fog concentrations, and calculate and record the parameter estimates for each concentration level. , ;

[0146] (4) Parameters corresponding to all fog concentrations , After all the estimates were made, with Create a concentration table using the primary key, and then sort the table by... Arrange the concentrations in ascending order. Once the concentration table is established, it can be used as a benchmark to measure the actual fog concentration; the steps are as follows:

[0147] 1) Refer to step (1) to select samples from the fog images of the real scene collected by the UAV, establish a real image set, and establish a corresponding scatter plot;

[0148] 2) Refer to steps (1) and (2) of the expression establishment process to establish the optimal back-substitution sample vector of the standard image respectively [( (), ), ... ( )] and the best scatter-point back-substitution sample vector of the real image [( (), ), ... ( )];

[0149] 3) Calculate the Fréchet distance between the standard image and the real image vectors, by... Figure 5 (a)- Figure 5 (c) It can be seen that the range of the scatter plot after normalization is [0,1], and the scatter curve is monotonically increasing, satisfying the Freud distance. .

[0150] , ( (14);

[0151] In the formula, x i express y i x represents the corresponding grayscale difference ratio. i 、 y represents the grayscale level in the scatter plot of real image samples. i This represents the corresponding grayscale difference ratio.

[0152] 4) In Find the largest , This indicates that the spatial distance between the true curve and the standard curve meets the condition. The threshold value was determined experimentally. ;

[0153] 5) The Freund distance can only indicate that the curve sample points are close in spatial distance, but it cannot indicate that the two curves are consistent in form or trend. Therefore, the Pearson correlation coefficient needs to be introduced, and it is still calculated using the standard sample and real sample vectors listed in 2).

[0154] (15);

[0155] In the formula, p represents the Pearson correlation coefficient. and These are standard and real image samples of the same concentration, respectively. , These are the mean values ​​of the standard and real images, respectively. A value equal to or close to 1 indicates a positive correlation. A value equal to or close to -1 indicates a negative correlation. A value of 0 indicates no correlation.

[0156] 6) Refer to steps (2) and (3) to calculate The hyperbolic tangent model function is derived, and the parameters are estimated. ;

[0157] 7) Calculate standard image parameters ( ) and real image parameters The absolute error value is determined, and an error criterion is established;

[0158] ;

[0159] (16);

[0160] In the formula, , The absolute value error of the exponential and phase factors of the curves in the standard and real atlases. , These are the thresholds, which determine the algorithm's complexity and accuracy. Therefore, a balance needs to be struck between complexity and accuracy. Through experimental testing, the following was selected: , As a criterion.

[0161] 8) Determine the current fog concentration level by searching the concentration table 1 based on the criteria.

[0162] Table 1 ( Concentration correspondence table

[0163]

[0164] IV. Simulation Experiment

[0165] 4.1 Unmanned Aerial Vehicle (UAV) Image Acquisition and Monitoring of Haze on Highways

[0166] like Figure 10As shown, the process of detecting fog concentration on highways using drones involves the drone carrying image acquisition equipment (the drone uses a DJI Matrice M300 RTK, paired with a Zenmuse H30T camera, with an image resolution of 1920×1080). The drone cruises along a flight path, capturing real-time images of the fog concentration on the highway. The acquired image samples are cropped or scaled to unify the image size and predetermined resolution. Regression analysis is used to assess the fog concentration, and the assessment results are sent to the assessment center.

[0167] 4.2 Fréchet Distance Test

[0168] To verify whether hyperbolic function fitting can be used for assessing field-of-view fog concentration levels, this paper first checks whether the FD distance between the best back-substitute samples of the standard image set and the real image set is less than the initial threshold. Five hundred sample images of different fog concentrations from the same scene on a highway (to avoid the influence of different backgrounds on the test results) were selected. These 500 images were arranged in descending order of their labeled concentration (PM2.5 value) (from top left to bottom right), and each image was numbered from 1# to 20#. Figure 11 As shown.

[0169] The Fréchet distance error between the standard image and the real image is calculated using formula (14), and the test data is as follows: Figure 13 As shown, the x-axis represents grayscale level, the y-axis represents grayscale difference ratio, and the z-axis represents error. The Friesian distance error on a cross-section is plotted on slices with x-axis intervals of 50. From the error distribution, the error is smaller in areas with smaller grayscale levels because the grayscale difference ratio is smaller, and the error is larger in areas with larger grayscale levels because the grayscale difference ratio is larger. However, the overall error is less than 3%, indicating that under different fog concentration conditions in the same scene, the fitting values ​​of the real image and the standard image are not significantly different. From the perspective of spatial distance, this verifies that the algorithm in this paper can be used for field-of-view fog concentration assessment.

[0170] Information entropy is a measure of the uncertainty of information. In image processing, information entropy is used to represent the average amount of information in an image. The formula for calculating information entropy is as follows:

[0171] ;

[0172] In the formula, Indicates that it occurs at the gray level The probability of it happening.

[0173] Calculate separately Figure 11 Standard images and Figure 12 The information entropy of the real images is shown in Table 2. A curve is plotted with the information entropy of 20 standard images as the x-axis and the information entropy of 20 real images as the y-axis, as shown in Table 2. Figure 14 As shown, by Figure 14It can be seen that the points depicted by the 40 images are approximately a straight line, thus indicating that the real images and the standard images are linearly correlated. The calculated Pearson correlation coefficient is 0.9971.

[0174] Table 2 Entropy of RI and SI

[0175]

[0176] Estimated parameters:

[0177] against Figure 11 Standard images and Figure 12 The parameters calculated from the real image are shown in Table 3, arranged from top to bottom and left to right in order of gradually increasing field-of-view fog concentration level.

[0178] Table 3 Parameter estimates and correlation coefficients

[0179]

[0180] Comparison and accuracy testing

[0181] To verify the effectiveness of the haze concentration assessment algorithm based on hyperbolic tangent function fitting, representative methods were selected for comparative experiments. These methods included a haze concentration monitoring method based on convolutional neural networks using a feature core model; a haze concentration detection method based on remote sensing satellite images retrieved from MODIS data; a method for assessing haze concentration by calculating Mahalanobis distance between sample images using a multidimensional vector of image information entropy and contrast; and a method for haze concentration detection using parameter-free estimation. Test samples were used as follows... Figure 15 The 20 sets of highway images shown represent different scenarios, with smog concentrations ranging from clear to light smog to moderate smog to heavy smog.

[0182] First, compare the measurement accuracy of the test algorithms; the error curves are as follows: Figure 16 As shown, the magenta dashed line represents the labeled curve of haze concentration in the image sample; the green diamond curve represents the test curve of the optical thickness surrogate model algorithm; the red square curve represents the curve of the Gm-APD algorithm; the blue star represents the contrast recovery algorithm; the red cross represents the no-reference image evaluation algorithm; the black upper triangle represents the transmittance estimation method; and the blue lower triangle represents the curve of our proposed algorithm. The test results show that the overall detection error exhibits a trend from high to low, meaning the error decreases as the haze concentration increases. The optical thickness surrogate model algorithm, Gm-APD algorithm, contrast recovery algorithm, and reference image evaluation algorithm have relatively large errors, showing significant differences in detection performance compared to the transmittance estimation method and our proposed algorithm. The transmittance estimation method shows similar detection performance to our proposed algorithm, but their execution efficiency differs considerably. This paper selects sample images with file sizes of 100, 400, 600, and 1000 kB to test our proposed algorithm and the transmittance estimation method. Figure 17 As shown, with the increase of sample size, the transmittance estimation method can take up to 900 seconds, while the algorithm of this invention usually takes less than 1 second. Even for a 1MKB sample, it only takes 1.4 seconds to complete. Therefore, based on the test results, this invention is superior to other typical algorithms in the detection of haze concentration and can be used for the evaluation of haze concentration in the field of view.

[0183] Therefore, the present invention adopts the above-mentioned image haze concentration detection method based on hyperbolic tangent function, which greatly improves the detection accuracy and detection speed of image haze concentration.

[0184] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for detecting haze concentration based on hyperbolic tangent function image, characterized in that, Includes the following steps: Establish a standard image set, which includes both foggy and fog-free images; Scattered samples were created by grouping foggy and fog-free images, and an S-shaped scatter plot of the scatter samples was constructed by analyzing the gray-level difference ratio. A mean search algorithm is introduced to determine the optimal back-substitution sample set for the standard image set; An improved hyperbolic tangent model is constructed, and the model parameters of the improved hyperbolic tangent model are estimated using the optimal back-substitution sample points; the model parameters include the exponential factor and the phase factor. The estimated model parameters are used to determine the improved hyperbolic tangent model. The determined improved hyperbolic tangent model is then used to refit the S-shaped scatter plot to determine the field-of-view fog concentration. The improved hyperbolic tangent model is (1); In the formula, Indicates the exponential factor. Let x represent the phase angle factor, and let x represent the dependent variable of the hyperbolic tangent function. This is the improved hyperbolic tangent function; Exponential factor The calculation method includes the following steps: The sample size of the standard image set is , Divide the N standard image sets into odd and even arrays, where the result is a multiple of 2*3. Substitute the standard image sets of odd and even arrays into equation (1) respectively, and then subtract the corresponding even array from the odd array, as follows: (2); In the formula, This represents the sample sequence consisting of samples at even-numbered positions in the entire sample sequence. This represents a sample sequence consisting of samples at odd-numbered positions in the entire sample sequence; Summing both sides of the above equation, we can calculate the exponential factor. : (3); Then we have: (4); Phase factor The calculation method includes the following steps: Substitute the odd and even array standard image sets into equation (3) respectively, and then add the corresponding even array to the odd array to obtain: (5); Dividing the two equations in equation (5), we get: (6); make: (7); have to: (8)。 2. The method for detecting haze concentration based on hyperbolic tangent function image according to claim 1, characterized in that, The optimal back-substitution sample set is determined using a search algorithm, including the following steps: The search starts from gray level 0 within the range [0,225]. If the gray level difference ratio is 0 at this time, it means that there are no scattered points in the gray level, so the gray level is incremented by 1; and so on, the gray level is incremented automatically. When a grayscale difference ratio is not zero for the first time, it indicates that this point is the lower edge of the thick S-shaped curve. The grayscale level corresponding to this lower edge point is denoted as [missing value]. And record the corresponding grayscale difference ratio, denoted as ; from Initially, the grayscale difference ratio was recorded every time a grayscale level was added. Until the point before the grayscale difference ratio is 0 is encountered again; At this time, the corresponding grayscale level is This indicates that the upper edge point of the S-shaped thick curve has been counted; Calculate the number of gray levels: Calculate the sum of all non-zero grayscale difference ratios: (9); In the formula, The number of non-zero values ​​for the grayscale difference ratio; Calculate the mean and round it: mean This is recorded as the best back-substitution sample.

3. The method for detecting haze concentration based on hyperbolic tangent function image according to claim 2, characterized in that, Based on determined parameters and Establish a system corresponding to the determined field-of-view fog concentration. and The parameter lookup table is used to determine the parameters. and The process for creating a lookup table is as follows: A gray-level difference-ratio scatter plot was created by selecting samples from a standard image set. The horizontal axis represents gray levels [1, 255]. The vertical axis represents the corresponding grayscale difference-ratio, with each grayscale level... Establish a set based on the corresponding vertical grayscale difference-ratio ; Calculate the optimal back-substitution sample value for each gray level using the search algorithm. Substitute the best sample for each gray level into formulas (4) and (8) to estimate the exponential factor. and estimated phase factor ; Select standard image sets with different field-of-view concentrations, repeat the first two steps of the lookup table establishment process, fit hyperbolic tangent curves for different fog concentrations, and simultaneously calculate and record the parameter estimates for each concentration level. , ; Parameters corresponding to all fog concentrations After all the estimates were made, with Create a concentration table using the primary key, and then set the table as follows: Arranged in ascending order, we get and Parameter lookup table.

4. The method for detecting haze concentration based on hyperbolic tangent function image according to claim 3, characterized in that, Parameters corresponding to all fog concentrations After all the estimates were made, with Create a concentration table using the primary key, and then set the table as follows: Arranged in ascending order, we get and The parameter lookup table includes the following steps: Samples of fog images from real-world scenes were collected with reference to a standard image set to establish a real image set, and a corresponding scatter plot was created. Referring to the first two steps of the lookup table creation process, the optimal back-substitution sample vector of the standard image is established respectively. (), ), ... ( )] and the best scatter-point back-substitution sample vector of the real image [( (), ), ... ( )]; Calculate the Firth distance between the standard image and the real image vectors. : , (10); In the formula, x i x represents the grayscale level in the scatter plot of standard image samples. i 、 This represents the grayscale levels in a scatter plot of real image samples. and These are standard and real image samples of the same concentration, respectively. exist Find the largest , This indicates that the spatial distance between the true curve and the standard curve meets the condition. For threshold; The Freund distance can only indicate that the sample points of the curves are close in spatial distance, but it cannot indicate that the two curves are consistent in form or trend. Therefore, the Pearson correlation coefficient is further introduced, and it is still calculated using the best back-substitute sample vector of the standard image and the best scatter back-substitute sample vector of the real image. Determining the estimated index factor in the process of establishing a lookup table and estimated phase factor Methods, parameter estimation , ,when If it varies between [0.01, 0.11], then It varies between [9, 100]. Calculate standard image parameters ( ) and real image parameters The absolute error value is determined, and an error criterion is established; ; (11); In the formula, The absolute value error of the phase factor between the curves in the standard atlas and the real atlas. These are the threshold values ​​for the absolute error of the phase factor of the curves in the standard and real image sets, respectively.

Citation Information

Patent Citations

  • Haze degree evaluation method and device, electronic equipment and storage medium

    CN114445342A

  • Defogging method based on frequency information differential fusion

    CN120725904A