A method for lightning channel image recognition

By using nonlinear diffusion filters, adaptive gradient threshold algorithms, threshold segmentation combined with Tsallis entropy and Otsu method, contour detection of curvature estimation and DBSCAN clustering in lightning image processing, the problem of lightning channel recognition is solved, and higher recognition accuracy and stability are achieved.

CN116797823BActive Publication Date: 2025-06-24NANTONG UNIV

Patent Information

Application Number
CN202310655429.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-05
Publication Date
2025-06-24
Estimated Expiration
2043-06-05

AI Technical Summary

Technical Problem

The prior art is affected by image brightness and blurring in lightning image processing, which makes it difficult to recognize lightning channels and numerical analysis, and the intelligent algorithm has low recognition accuracy when processing complex backgrounds.

Method used

Image preprocessing is performed using a nonlinear diffusion filter, edge detection uses an adaptive gradient threshold algorithm, threshold segmentation combines Tsallis entropy and Otsu methods, and lightning candidate regions are extracted using contour detection based on curvature estimation, and outlier points and incoherent regions are eliminated using DBSCAN clustering based on density variables.

Benefits of technology

It improves the accuracy and stability of lightning channel image recognition, which can better highlight the lightning channel, eliminate background noise, and adapt to complex and changeable scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116797823B_ABST
    Figure CN116797823B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of meteorological monitoring and detection, and particularly to a method for identifying lightning channel images. It solves the problem that lightning channels cannot be recognized; its technical solution is as follows: It includes the following steps: Step 1, image preprocessing; Step 2, edge detection; Step 3, threshold segmentation; Step 4, extracting lightning candidate regions; Step 5: Removing abnormal points and discontinuous regions; Step 6: Merging and outputting lightning channels. The beneficial effect of the present invention is that the present invention can improve the accuracy and stability of lightning channel image recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of meteorological monitoring and detection, and particularly to a method for identifying lightning channel images. Background Art

[0002] Lightning is one of the major natural disasters, which can cause forest and oil depot fires, and result in failures or damages to power supply and communication information systems. It poses a significant threat to aerospace, mines, and some important and sensitive high-tech equipment. After the 1980s, the hazards caused by lightning have increased significantly. Especially in fields closely related to high-tech, such as aerospace, national defense, communication, power, computer, and electronics industries, due to the widespread application of large-scale and very large-scale integrated circuits that are extremely sensitive to lightning electromagnetic interference, the probability of being struck by lightning has increased greatly.

[0003] Lightning can generate intense light radiation, and optical detection has become one of the important means to study lightning. Through the optical information of the lightning channel, the development morphological characteristics of lightning, the development characteristics of positive and negative leaders, transmission speed, changes in light intensity, etc. can be obtained (Numerical Analysis of Lightning Optical Images Based on High-Speed Video Observation (Electronic Design Engineering (2022))). Through this information, the physical processes of different stages of lightning development can also be inferred (Continuous Current Process and Component Characteristics of Artificially Triggered Lightning (Journal of Applied Meteorology (2014))). However, at present, the processing effect of lightning image is affected by image brightness and blur degree, which causes great difficulties in lightning channel recognition, extraction, and numerical analysis.

[0004] In the early stage, most research teams used the method of manually setting thresholds to segment images, with low processing efficiency. With the progress of technology, many researchers have combined intelligent algorithms with image recognition to find the optimal threshold of the target image and improve image quality. For example, in the literature "Multi-Threshold Color Image Segmentation Based on Improved Dragonfly Algorithm" (Computer Applications and Software (2020)), but when dealing with images with poor original quality or complex backgrounds, the recognition accuracy is less than satisfactory. And the method in the literature "Research on Particle Swarm Optimization Algorithm in Image Fusion and Segmentation" (Laser Journal (2019)) has improved the image recognition effect to a certain extent, but it is easy to fall into local optimum, and the optimization depends on the setting of initial values. Therefore, it is necessary to develop a set of lightning channel image recognition methods and systems.

[0005] How to solve the above technical problems is the topic faced by the present invention. Summary of the Invention

[0006] The purpose of the present invention is to provide a method for identifying lightning channel images, which solves the problem that the lightning channel cannot be recognized and can improve the accuracy and stability of lightning channel image recognition.

[0007] To achieve the above-mentioned invention objectives, the technical solutions adopted in the present invention are specifically as follows:

[0008] A lightning channel image recognition method, the method comprising the following steps:

[0009] Step 1, image preprocessing; due to the influence of ambient light conditions when collecting lightning images, the signal-to-noise ratio of the images is often low, so it is necessary to perform certain filtering processing on the images before lightning channel image recognition.

[0010] Step 2, edge detection; use an edge detection algorithm to extract the edge information in the binary image; the binary image after edge detection will contain the contours of the lightning channel and the image background;

[0011] Step 3, threshold segmentation: Since Tsallis entropy can measure the uncertainty in an image, it can be used to optimize the threshold so that under this threshold, the uncertainty of the image is minimized. Such a threshold helps to remove background noise and better highlight the lightning channel. Determine an optimal threshold according to Tsallis entropy, and segment the binary image after edge detection; retain the pixels with gray values higher than the threshold and filter out other pixels; this will help us remove the low-intensity background regions in the image and better highlight the lightning channel. The optimal threshold refers to the threshold that best segments the lightning channel from the background in the binary image. It is the gray value corresponding to the minimum of Tsallis entropy. Tsallis entropy is a measure of entropy that measures the uncertainty or degree of chaos of an image. By minimizing Tsallis entropy, the optimal threshold can be found, so that the binary image contains the least amount of uncertainty, that is, the distinguishability between the lightning channel and the background is the highest.

[0012] Step 4, extract lightning candidate regions: perform morphological processing on the segmented binary image to eliminate noise and connect the broken parts of the lightning; extract all connected regions through contour detection, and calculate the area and length of each connected region; screen the candidate regions according to the thresholds of the area and length, and eliminate the non-lightning connected regions;

[0013] Step 5: Eliminate abnormal points and discontinuous regions; use a clustering method to further extract and delete abnormal points and discontinuous regions.

[0014] Step 6: Merge and output the lightning channel; add or multiply the screened lightning regions and the original image pixel by pixel to generate the final lightning channel recognition result.

[0015] Step 1 specifically includes:

[0016] Gaussian filtering can achieve a good effect of removing high-frequency noise, but Gaussian filtering will cause blurring of the image boundary while filtering out high-frequency noise. Therefore, in the present invention

[0017] Diffusion filtering as a step of image preprocessing;

[0018] Diffusion filtering is given in the form of partial differential equations:

[0019]

[0020] The left side of the above equation represents the differential of the image with respect to the virtual time variable. The symbol D represents the diffusion tensor. When D takes different forms, the resulting diffusion filters will have different characteristics; is the gradient operator, which is used to calculate the total differential of u in all spatial directions.

[0021] A non-linear diffusion filter with edge enhancement effect. The diffusion tensor D of this diffusion filter has the following form:

[0022]

[0023] where λ is a constant;

[0024] For the understanding of the diffusion filter, the diffusion process can be regarded as the diffusion of image gray values to adjacent pixels. The stronger the diffusion effect, the stronger the smoothing effect on the image. For the areas with good consistency of gray distribution in the image, the gradient is small and the smoothing effect is strong. While the gray values at the edges of the lightning channels in the image often change rapidly, the gradient is large and the smoothing effect is weak, and the edges are well preserved.

[0025] Step 2 specifically includes:

[0026] Traditional edge detection operators include Canny, Sobel or Laplacian operators. The goal of the Canny edge operator is to find the edge positions in the image and determine the width and position of the edges as accurately as possible; The Sobel operator is a discrete difference operator for edge detection. It measures the local change of image brightness by calculating the spatial derivative of the image gray value; The Laplacian operator is a second-order derivative operator, which is used to measure the second-order change of image brightness. Since it measures the "curvature" of the image brightness, it can capture finer edges in the image.

[0027] However, lightning channel recognition needs to deal with complex and variable scenes, such as images of lightning in rainy nights. At this time, using a global threshold similar to the Canny operator is not conducive to effective edge detection.

[0028] Adopt an edge detection operator based on adaptive gradient threshold, which dynamically adjusts the gradient threshold according to local image characteristics; The specific implementation is as follows:

[0029] S21: Calculate the gradient magnitude G and gradient direction θ of the image, using the Sobel operator to calculate:

[0030]

[0031] θ = arctan(G y / G x )

[0032] G x and G y are the gradient magnitudes along the x and y directions respectively.

[0033] S22: Calculate the average gradient magnitude within the local neighborhood of each pixel in the image;

[0034] For the pixel (x, y) in the image matrix, set a neighborhood window W (e.g., 3x3 or 5x5), and calculate the mean mean G (x, y);

[0035] S23: Calculate the adaptive gradient threshold based on the local average gradient magnitude of each pixel; Use the following formula:

[0036] T(x, y) = k · mean G (x, y)

[0037] where k is the weight coefficient of the adaptive threshold and needs to be adjusted through experiments.

[0038] S24: For each pixel (x, y), if G(x, y) > T(x, y), then mark this pixel as an edge pixel; otherwise, mark it as a non-edge pixel.

[0039] Step three specifically includes:

[0040] In the threshold segmentation stage, adopt the method of combining Tsallis entropy and Otsu method, which not only makes full use of the characteristics of Tsallis entropy but also takes into account the global optimality of the Otsu method. The method process is as follows:

[0041] S31: Calculate the probability distribution of each gray level in the image;

[0042] S32: For the threshold t (0 < t < 255), divide the image into two parts: foreground (0 to t) and background (t + 1 to 255);

[0043] S33: For the foreground and background parts, calculate their Tsallis entropy respectively:

[0044]

[0045]

[0046] where Sq (f) and S q (b) represent the Tsallis entropy of the lightning foreground and background respectively, q is a non - negative real number, p i and p j are the probabilities of the i - th and j - th gray levels in the foreground and background respectively;

[0047] S34: For each threshold t, calculate the weight coefficients of the foreground and background:

[0048] W f = ∑p i

[0049] W b = ∑p j

[0050] S35: Calculate the weighted Tsallis entropy at each threshold t:

[0051] ST q (t) = W f ·S q (f) + W b ·S q (b)

[0052] S36: Select the threshold t that minimizes the weighted Tsallis entropy ST q (t); * ;

[0053] S37: Segment the edge binary image with t * .

[0054] Step four specifically includes:

[0055] The morphological processing adopts dilation and erosion operations;

[0056] Adopt a contour detection method based on curvature estimation, and the specific implementation steps are as follows:

[0057] S41: Skeletonize the edge binary image to obtain a skeleton image;

[0058] S42: For each pixel point in the skeleton image, calculate the curvature K in its neighborhood; the curvature K represents the degree of bending of the local image structure; use the following formula to calculate the curvature:

[0059]

[0060] where G xx 、G yy and G xyare the second-order partial derivatives of the gradient image in the x and y directions, respectively, and ε is a positive number used to avoid the error of division by zero. The curvature calculation formula here is based on the Hessian matrix of the image, which can estimate the curvature characteristics of local pixels.

[0061] S43: Set a threshold for the calculated curvature image to retain the pixels with partial rate values;

[0062] The threshold is set to a certain percentile of the curvature value, such as the top 10% or top 20% of the pixels. In this way, we can only focus on the curved parts of the lightning contour.

[0063] S44: Perform connected component analysis on the retained pixels and filter them based on features such as the area and length of the connected components to eliminate non-lightning areas. This step can be completed in combination with morphological operations.

[0064] Step five specifically includes:

[0065] Considering the uncertainty characteristics of the lightning structure shape, it is difficult for traditional clustering methods to obtain stable and reliable candidate region screening results. The present invention proposes

[0066] A DBSCAN algorithm based on variable density adjusts the neighborhood radius dynamically according to the local density, enabling the algorithm to better adapt to clustering in different density regions; the specific implementation is as follows:

[0067] S51: Extract the features of each pixel in the candidate region, such as gradient magnitude, gradient direction, and local curvature. Combine these features into a multi-dimensional feature vector; let P S represent the set of feature vectors, where each element p i represents a pixel;

[0068] S52: For each pixel in P S , calculate the feature space distance between it and all other pixels:

[0069]

[0070] where k represents the dimension of the feature vector; i, j represent the serial numbers of the pixels.

[0071] S53: Calculate the k-distance D k of each pixel, that is, the distance to its k-th nearest neighbor; k here is a preset parameter;

[0072] S54: For each pixel, calculate its local density ρ; the local density is calculated using the following formula:

[0073]

[0074] S55: Dynamically adjust the neighborhood radius Eps of each pixel point according to the local density ρ:

[0075]

[0076] where α is a preset scaling coefficient;

[0077] S56: Perform DBSCAN clustering using the dynamic neighborhood radius Eps; for each pixel point p i , find all points within the neighborhood of Eps(p i ); if the number of points within the neighborhood is greater than or equal to the preset minimum number of points MinPts, then consider these points as a cluster; otherwise, consider them as noise points and eliminate them;

[0078] After eliminating the outliers and discontinuous regions, the remaining clusters are the finally segmented lightning regions.

[0079] Compared with the prior art, the beneficial effects of the present invention are as follows: The advantages of this invention include the following aspects:

[0080] 1) The image preprocessing uses a non - linear diffusion filter with edge enhancement effect for filtering, which can better retain edge information compared with the traditional Gaussian filter.

[0081] 2) The edge detection uses an operator based on an adaptive gradient threshold, which can dynamically adjust the gradient threshold according to the local image characteristics and adapt to complex and variable scenarios.

[0082] 3) The threshold segmentation uses an algorithm that combines Tsallis entropy and the Otsu method. It not only fully utilizes the characteristics of Tsallis entropy but also takes into account the global optimality of the Otsu method, and can better highlight the lightning channel.

[0083] 4) The method for extracting lightning candidate regions uses a contour detection method based on curvature estimation, which can more accurately extract the lightning contour.

[0084] 5) The method for eliminating outliers and discontinuous regions uses a DBSCAN clustering algorithm with variable density, which can better adapt to the clustering of different density regions and improve the accuracy of screening.

[0085] In summary, compared with the traditional method, the present invention has new improvements and innovations in aspects such as image preprocessing, edge detection, threshold segmentation, extracting lightning candidate regions, and eliminating outliers and discontinuous regions, and can improve the accuracy and stability of lightning channel image recognition. Description of the Drawings

[0086] The accompanying drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention.

[0087] Figure 1 It is a flowchart of the method steps of the present invention.

[0088] Figure 2 It is the original image of the lightning channel captured by high-speed photography.

[0089] Figure 3 It is the effect diagram of identifying the lightning channel of the present invention.

[0090] Figure 4 It is the effect diagram of the optimized processing of the lightning channel of the present invention. Detailed implementation manners

[0091] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Of course, the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0092] Embodiment 1

[0093] Refer to Figure 1 , a method for identifying lightning channel images, the method comprising the following steps:

[0094] Step 1, image preprocessing; due to the influence of the ambient light conditions when collecting lightning images, the signal-to-noise ratio of the images is often low. It is necessary to perform a certain filtering process on the images before identifying the lightning channel images.

[0095] Step 2, edge detection; use an edge detection algorithm to extract the edge information in the binary image; the binary image after edge detection will contain the contours of the lightning channel and the image background;

[0096] Step 3, Threshold Segmentation: Since Tsallis entropy can measure the uncertainty in an image, it can be used to optimize the threshold such that the uncertainty of the image is minimized under this threshold. Such a threshold helps to eliminate background noise and better highlight the lightning channel. Determine an optimal threshold according to Tsallis entropy and segment the binary image after edge detection; retain the pixels with gray values higher than the threshold and filter out other pixels; this will help us eliminate the low-intensity background regions in the image and better highlight the lightning channel. The optimal threshold refers to the threshold that best segments the lightning channel from the background in the binary image. It is the gray value corresponding to the minimum of Tsallis entropy. Tsallis entropy is a measure of entropy that measures the uncertainty or degree of chaos of an image. By minimizing Tsallis entropy, the optimal threshold can be found, such that the binary image contains the least amount of uncertainty, that is, the lightning channel and the background have the highest degree of distinguishability.

[0097] Step 4, Extract Lightning Candidate Regions: Perform morphological processing on the segmented binary image to eliminate noise and connect broken parts of the lightning; extract all connected regions through contour detection, and calculate the area and length of each connected region; screen the candidate regions according to the thresholds of the area and length, and eliminate the non-lightning connected regions;

[0098] Step 5: Eliminate abnormal points and discontinuous regions; further extract and delete abnormal points and discontinuous regions using a clustering method.

[0099] Step 6: Merge and Output the Lightning Channel; Add or multiply the screened lightning regions pixel by pixel with the original image to generate the final lightning channel recognition result.

[0100] Step 1 specifically includes:

[0101] Gaussian filtering can achieve a good effect of removing high-frequency noise, but Gaussian filtering will cause blurring of the image boundary while filtering out high-frequency noise. Therefore, in the present invention

[0102] Diffusion filtering is used as a step of image preprocessing;

[0103] Diffusion filtering is given in the form of a partial differential equation:

[0104]

[0105] The left side of the above formula represents the differential of the image with respect to the virtual time variable, and the symbol D represents the diffusion tensor. When D takes different forms, the obtained diffusion filters will have different characteristics; is the gradient operator, which is used to calculate the total differential of u in all spatial directions.

[0106] A non - linear diffusion filter with edge enhancement effect. The diffusion tensor D of this diffusion filter has the following form:

[0107]

[0108] where λ is a constant;

[0109] For the understanding of the diffusion filter, the diffusion process can be regarded as the diffusion of image gray values to adjacent pixels. The stronger the diffusion effect, the stronger the smoothing effect on the image. For the areas with good consistency in gray distribution in the image, the gradient is small and the smoothing effect is strong. While the gray values at the edges of the lightning channel in the image often change rapidly, the gradient is large and the smoothing effect is weak, so the edges are well preserved.

[0110] Step 2 specifically includes:

[0111] Traditional edge detection operators include Canny, Sobel or Laplacian operators. The goal of the Canny edge operator is to find the edge positions in the image and determine the width and position of the edges as accurately as possible; the Sobel operator is a discrete difference operator for edge detection, which measures the local change of image brightness by calculating the spatial derivative of the image gray value; the Laplacian operator is a second - order derivative operator used to measure the second - order change of image brightness. Since it measures the "curvature" of the image brightness, it can capture finer edges in the image.

[0112] However, lightning channel recognition needs to deal with complex and variable scenarios, such as images of lightning in rainy nights. At this time, using a global threshold similar to the Canny operator is not conducive to effective edge detection.

[0113] Adopt an edge detection operator based on an adaptive gradient threshold, which dynamically adjusts the gradient threshold according to local image characteristics; the specific implementation is as follows:

[0114] S21: Calculate the gradient magnitude G and gradient direction θ of the image, using the Sobel operator to calculate:

[0115]

[0116] θ = arctan(G y / G x )

[0117] G x and G y are the gradient magnitudes along the x and y directions respectively.

[0118] S22: Calculate the average gradient magnitude within the local neighborhood of each pixel point in the image;

[0119] For a pixel point (x, y) in the image matrix, a neighborhood window W (such as 3x3 or 5x5) is set, and the mean value mean of the gradient magnitudes within its neighborhood is calculated G (x, y);

[0120] S23: Calculate the adaptive gradient threshold based on the local average gradient magnitude of each pixel point; use the following formula:

[0121] T(x, y) = k·mean G (x, y)

[0122] where k is the weight coefficient of the adaptive threshold and needs to be adjusted through experiments.

[0123] S24: For each pixel point (x, y), if G(x, y) > T(x, y), then mark this pixel point as an edge pixel; otherwise, mark it as a non-edge pixel.

[0124] Step three specifically includes:

[0125] In the threshold segmentation stage, a method that combines Tsallis entropy and the Otsu method is adopted. It not only makes full use of the characteristics of Tsallis entropy but also takes into account the global optimality of the Otsu method. The method process is as follows:

[0126] S31: Calculate the probability distribution of each gray level in the image;

[0127] S32: For the threshold t (0 < t < 255), divide the image into two parts: foreground (0 to t) and background (t + 1 to 255);

[0128] S33: For the foreground and background parts, calculate their Tsallis entropies respectively:

[0129]

[0130]

[0131] where, S q (f) and S q (b) represent the Tsallis entropies of the lightning foreground and background respectively, q is a non-negative real number, p i and p j are the probabilities of the i-th and j-th gray levels in the foreground and background respectively;

[0132] S34: For each threshold t, calculate the weight coefficients of the foreground and background:

[0133] W f = ∑p i

[0134] Wb = ∑p j

[0135] S35: Calculate the weighted Tsallis entropy at each threshold t:

[0136] ST q (t) = W f ·S q (f) + W b ·S q (b)

[0137] S36: Select the threshold t that minimizes the weighted Tsallis entropy ST q (t); * ;

[0138] S37: Segment the edge binary image using t * .

[0139] Step four specifically includes:

[0140] The morphological processing uses dilation and erosion operations;

[0141] Adopt a contour detection method based on curvature estimation. The specific implementation steps are as follows:

[0142] S41: Skeletonize the edge binary image to obtain a skeleton image;

[0143] S42: For each pixel point in the skeleton image, calculate the curvature K in its neighborhood; the curvature K represents the degree of bending of the local image structure; use the following formula to calculate the curvature:

[0144]

[0145] where G xx , G yy and G xy are the second-order partial derivatives of the gradient image in the x and y directions respectively, and ε is a positive number used to avoid division by zero errors. The curvature calculation formula here is based on the Hessian matrix of the image, which can estimate the curvature characteristics of local pixel points.

[0146] S43: Set a threshold for the calculated curvature image and retain the pixel points with partial rate values;

[0147] The threshold is set to a certain percentile of the curvature value, such as the first 10% or the first 20% of the pixel points. In this way, we can only focus on the curved parts of the lightning contour.

[0148] S44: Perform connected component analysis on the remaining pixel points, and filter them based on features such as the area and length of the connected components to eliminate non-lightning regions. This step can be completed in combination with morphological operations.

[0149] Step five specifically includes:

[0150] Considering the uncertainty characteristics of the lightning structure shape, it is difficult for traditional clustering methods to obtain stable and reliable candidate region screening results. The present invention proposes

[0151] A DBSCAN algorithm based on variable density, which dynamically adjusts the neighborhood radius according to the local density, enabling the algorithm to better adapt to clustering in different density regions; the specific implementation is as follows:

[0152] S51: Extract the features of each pixel point in the candidate region, such as gradient magnitude, gradient direction, and local curvature. Combine these features into a multi-dimensional feature vector; let P S represent the set of feature vectors, where each element p i represents a pixel point;

[0153] S52: For each pixel point in P S , calculate the feature space distance between it and all other pixel points:

[0154]

[0155] where k represents the dimension of the feature vector; i, j represent the serial numbers of the pixel points.

[0156] S53: Calculate the k-distance D k of each pixel point, that is, the distance to its k-th nearest neighbor; here k is a preset parameter;

[0157] S54: For each pixel point, calculate its local density ρ; the local density is calculated using the following formula:

[0158]

[0159] S55: Dynamically adjust the neighborhood radius Eps of each pixel point according to the local density ρ:

[0160]

[0161] where α is a preset scaling coefficient;

[0162] S56: Perform DBSCAN clustering using the dynamic neighborhood radius Eps; for each pixel point p i , find those within Eps(p iAll points within the neighborhood; if the number of points within the neighborhood is greater than or equal to the pre-set minimum number of points MinPts, then these points are regarded as a cluster; otherwise, they are regarded as noise points and eliminated;

[0163] After eliminating the outliers and discontinuous regions, the remaining clusters are the finally segmented lightning regions.

[0164] Embodiment 2

[0165] Based on Embodiment 1, Figure 2 shows the original image of the lightning channel captured by high-speed photography, Figure 3 shows the recognition of the lightning channel by the image through edge detection and threshold segmentation steps. Figure 4 Shows the optimization process of the recognized lightning channel by the lightning candidate region extraction and outlier elimination steps.

[0166] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for lightning channel image recognition, characterized in that, The method includes the following steps: Step 1, image preprocessing; Step 2, edge detection; using an edge detection algorithm to extract the edge information in the binary image; The binary image after edge detection will contain the contours of the lightning channel and the image background; Step 2 specifically includes: Adopt an edge detection operator based on an adaptive gradient threshold, which dynamically adjusts the gradient threshold according to local image characteristics; the specific implementation is as follows: S21: Calculate the gradient magnitude G and gradient direction θ of the image, using the Sobel operator to calculate: θ = arctan(G y / G x ) G x and G y are the gradient magnitudes along the x- and y-directions, respectively. S22: Calculate the average gradient magnitude within the local neighborhood of each pixel point in the image; For a pixel point (x, y) in the image matrix, set a neighborhood window W and calculate the mean value mean of the gradient magnitudes within its neighborhood G (x, y); S23: Calculate the adaptive gradient threshold according to the local average gradient magnitude of each pixel point; use the following formula: T(x,y) = k·mean G (x,y) where k is the weight coefficient of the adaptive threshold; S24: For each pixel point (x, y), if G(x, y) > T(x, y), then mark this pixel point as an edge pixel; otherwise, mark it as a non-edge pixel; Step 3, threshold segmentation: Determine an optimal threshold according to Tsallis entropy, and segment the binary image after edge detection; retain the pixels with gray values higher than the threshold and filter out other pixels; Step 3 specifically includes: In the threshold segmentation stage, adopt a method that combines Tsallis entropy and the Otsu method, and the method process is as follows: S31: Calculate the probability distribution of each gray level in the image; S32: For the threshold t, divide the image into a foreground part and a background part; S33: For the foreground and background parts, calculate their Tsallis entropy respectively: Among them, S q (f) and S q (b) represent the Tsallis entropy of the lightning foreground and background respectively, q is a non - negative real number, p i and p j are the probabilities of the i - th and j - th gray levels in the foreground and background respectively; S34: For each threshold t, calculate the weight coefficients of the foreground and background: W f = ∑p i W b = ∑p j S35: Calculate the weighted Tsallis entropy at each threshold t: ST q (t) = W f ·S q (f) + W b ·S q (b) S36: Select the threshold t that minimizes the weighted Tsallis entropy ST q (t). * ; S37: Segment the edge binary image using t * ; Step 4, extract lightning candidate regions: Perform morphological processing on the segmented binary image to eliminate noise and connect the broken parts of the lightning; extract all connected regions through contour detection, and calculate the area and length of each connected region; screen the candidate regions according to the thresholds of the area and length, and eliminate the connected regions that are not lightning; Step 5: Eliminate abnormal points and discontinuous regions; adopt a clustering method to further extract and delete abnormal points and discontinuous regions; Step 6: Merge and output the lightning channel; Add or multiply the screened lightning region and the original image pixel by pixel to generate the final lightning channel recognition result.

2. The lightning channel image recognition method according to claim 1, wherein Step 1 specifically includes: The diffusion filter is given in the form of a partial differential equation: The left side of the above formula represents the differential of the image with respect to the virtual time variable. The symbol D represents the diffusion tensor. When D takes different forms, the obtained diffusion filter will have different characteristics; ▽ is the gradient operator, which is used to calculate the total differential of u in all spatial directions; A non-linear diffusion filter with an edge enhancement effect, and the diffusion tensor D of this diffusion filter has the following form: where λ is a constant.

3. The lightning channel image recognition method according to claim 2, wherein, Step 4 specifically includes: The morphological processing adopts dilation and erosion operations; Adopt a contour detection method based on curvature estimation, and the specific implementation steps are as follows: S41: Perform skeletonization processing on the edge binary image to obtain a skeleton image; S42: For each pixel point in the skeleton image, calculate the curvature K within its neighborhood; the curvature K represents the degree of bending of the local image structure; use the following formula to calculate the curvature: Among them, G xx , G yy and G xy are the second-order partial derivatives of the gradient image in the x and y directions respectively, and ε is a positive number; S43: Set a threshold for the calculated curvature image and retain the pixel points with partial rate values; The threshold is set to a certain percentile of the curvature value, S44: Perform connected region analysis on the retained pixel points and filter based on the area and length characteristics of the connected regions to eliminate non-lightning regions.

4. The lightning channel image recognition method according to claim 3, characterized in that, Step five specifically includes: A DBSCAN algorithm based on variable density dynamically adjusts the neighborhood radius according to the local density, and the specific implementation is as follows: S51: Extract the features of each pixel in the candidate region, and combine these features into a multi-dimensional feature vector; Let P S represent the set of feature vectors, where each element p i represents a pixel point; S52: For each pixel point in P S calculate the feature space distance between it and all other pixel points: where k represents the dimension of the feature vector; i and j represent the serial numbers of pixel points; S53: Calculate the k-distance D of each pixel point k , that is, the distance to its k-th nearest neighbor; k here is a pre-set parameter; S54: For each pixel point, calculate its local density ρ; the local density is calculated using the following formula: S55: Dynamically adjust the neighborhood radius Eps of each pixel point according to the local density ρ: where α is a preset scaling coefficient; S56: Perform DBSCAN clustering using the dynamic neighborhood radius Eps; for each pixel point p i , find all points within the neighborhood of Eps(p i ); if the number of points in the neighborhood is greater than or equal to the pre-set minimum number of points MinPts, then consider these points as a cluster; otherwise, consider them as noise points and remove them; After eliminating outliers and discontinuous regions, the retained clusters are the finally segmented lightning regions.

Citation Information

Patent Citations

  • Improved edge enhancement detection method based on high-resolution fourth satellite image

    CN108537807A

  • Power transmission device image edge detection method, device and system

    CN109360217A

Cited By

  • Lightning drop point identification method and system suitable for complex scene

    CN122313023A