Lightning channel complexity assessment method and device, electronic equipment and storage medium

By acquiring lightning grayscale images for edge detection and contour screening, and calculating fractal dimensions with the box counting method, the problems of inefficiency and high cost in traditional methods are solved, and efficient and accurate extraction and evaluation of lightning channels are achieved.

CN120298443APending Publication Date: 2025-07-11WUHAN NARI LIABILITY OF STATE GRID ELECTRIC POWER RES INST +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510370312.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

Traditional lightning channel extraction methods rely on manual observation and complex RF array equipment, resulting in inefficiency and high cost, making it difficult to achieve large-scale applications.

Method used

By acquiring lightning grayscale images, performing edge detection and contour screening, using box counting method to calculate fractal dimensions to evaluate the geometric complexity of the lightning channel, and using image processing technology to achieve full automatic processing.

Benefits of technology

It improves the accuracy and efficiency of lightning channel extraction, reduces the error caused by manual intervention, reduces equipment costs, and is suitable for large-scale applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120298443A_ABST
    Figure CN120298443A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of lightning disaster monitoring and protection, in particular to a lightning channel complexity assessment method and device, electronic equipment and a storage medium. Comprising the following steps: acquiring a lightning grayscale image; carrying out edge detection on the lightning grayscale image, and extracting an edge image; searching contours of the edge images, and performing screening to obtain a screened contour set; performing closing processing on the screening contour set through expansion operation to obtain a candidate contour set; screening the candidate contour set based on preset parameters to obtain a final contour set; the fractal dimension of the final contour is calculated through a box counting method, the geometric complexity of the lightning channel is evaluated according to the fractal dimension value, and the fractal dimension and the geometric complexity are in positive correlation. The method can achieve the precise and efficient extraction of the lightning channel, carries out the fractal dimension calculation based on the extracted lightning channel, achieves the evaluation of the complexity of the lightning channel, does not need the support of complex equipment, and is easy for large-scale application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of lightning disaster monitoring and protection, and specifically relates to a method, device, electronic device and storage medium for evaluating the complexity of a lightning channel. Background Art

[0002] The extraction and analysis of the lightning development channel are of great significance for lightning protection research in the energy industry, transportation industry, communication industry, etc.

[0003] Traditional lightning channel extraction methods mainly rely on manual observation and recording. This method is not only inefficient, but also limited by observation conditions and human factors, making it difficult to ensure the accuracy and real-time nature of data.

[0004] Traditional lightning channel analysis methods, such as calculating the fractal dimension of the lightning channel analysis, can evaluate the complexity of the lightning channel. However, existing lightning channel analysis dimension methods mainly rely on antenna arrays to capture lightning radiation signals and reconstruct the three-dimensional channel morphology, and then calculate the fractal dimension. This method requires the deployment of complex radio frequency array equipment, and the three-dimensional data processing involves a large amount of spatial coordinate calculations, resulting in high implementation costs and high algorithm complexity, making it difficult to achieve large-scale applications.

[0005] Therefore, how to achieve accurate and efficient extraction and analysis of lightning channels is a problem that needs to be solved. Summary of the Invention

[0006] In view of this, embodiments of the present application provide a method, device, electronic device and storage medium for evaluating the complexity of a lightning channel, which can achieve accurate and efficient extraction of the lightning channel, and calculate the fractal dimension based on the extracted lightning channel, thereby realizing the evaluation of the complexity of the lightning channel. It does not require the support of complex equipment and is easy to be applied on a large scale.

[0007] The first aspect of the embodiments of the present application provides a method for evaluating the complexity of a lightning channel, including:

[0008] Obtain a lightning grayscale image;

[0009] Perform edge detection on the lightning grayscale image to extract an edge image;

[0010] Find the contours of the edge image and perform screening to obtain a set of screened contours;

[0011] Perform a closing process on the set of screened contours through a dilation operation to obtain a set of candidate contours;

[0012] Screen the set of candidate contours based on preset parameters to obtain a set of final contours;

[0013] Calculate the fractal dimension of the final contour using the box-counting method, and evaluate the geometric complexity of the lightning channel based on the fractal dimension value, where the fractal dimension is positively correlated with the geometric complexity.

[0014] The second aspect of the embodiments of the present application provides a lightning channel complexity evaluation device, including:

[0015] An image acquisition module, configured to acquire a lightning grayscale image;

[0016] An edge detection module, configured to perform edge detection on the lightning grayscale image to extract an edge image;

[0017] A contour search module, configured to search for the contours of the edge image and perform screening to obtain a set of screened contours;

[0018] A contour closing module, configured to perform a closing process on the set of screened contours through a dilation operation to obtain a set of candidate contours;

[0019] A screening module, configured to screen the set of candidate contours based on preset parameters to obtain a set of final contours;

[0020] A calculation and evaluation module, configured to calculate the fractal dimension of the final contour using the box-counting method, and evaluate the geometric complexity of the lightning channel based on the fractal dimension value, where the fractal dimension is positively correlated with the geometric complexity.

[0021] The third aspect of the embodiments of the present application provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device implements the lightning channel complexity evaluation method provided in the first aspect of the embodiments of the present application.

[0022] The fourth aspect of the embodiments of the present application provides a computer program product, including a computer program. When the computer program is run, the method described in the first aspect of the embodiments of the present application is executed.

[0023] The lightning channel complexity evaluation method provided in the first aspect of the embodiments of the present application includes obtaining a lightning grayscale image; performing edge detection on the lightning grayscale image to extract an edge image; finding the contours of the edge image and performing screening to obtain a set of screened contours; performing a closing process on the set of screened contours through a dilation operation to obtain a set of candidate contours; screening the set of candidate contours based on preset parameters to obtain a set of final contours; calculating the fractal dimension of the final contour using the box counting method, and evaluating the geometric complexity of the lightning channel according to the fractal dimension value, where the fractal dimension is positively correlated with the geometric complexity. Through the complete steps from image preprocessing to fractal dimension calculation, a quantitative index, i.e., the fractal dimension, is provided to evaluate the geometric complexity of the lightning channel, solving the problem of low efficiency caused by relying on manual observation and radio frequency equipment in traditional methods. Introducing the box counting method into the evaluation of lightning channel complexity, replacing subjective qualitative analysis with a mathematical index (fractal dimension) to improve the objectivity of the evaluation. Achieving fully automatic processing through algorithms such as edge detection and contour screening, overcoming the errors caused by manual intervention. The present invention can be widely applied in fields such as meteorological research, lightning warning, aerospace, and power systems, providing strong support for research and applications in related fields.

[0024] It can be understood that the beneficial effects of the above second aspect to the fourth aspect can be referred to the relevant descriptions in the above first aspect, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0026] Figure 1 is a schematic flowchart of a lightning channel complexity evaluation method provided by an embodiment of the present application;

[0027] Figure 2 is a schematic diagram of a lightning grayscale image;

[0028] Figure 3 is a schematic flowchart of a lightning channel complexity evaluation method provided by another embodiment of the present application;

[0029] Figure 4 is a schematic flowchart of a lightning channel complexity evaluation method provided by another embodiment of the present application;

[0030] Figure 5 is a schematic diagram of the lightning channel extracted by the present application;

[0031] Figure 6 It is a schematic structural diagram of a lightning channel complexity evaluation device provided by an embodiment of the present application;

[0032] Figure 7 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0033] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system architectures, technologies, etc. are presented to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.

[0034] It should be understood that when used in the specification and appended claims of the present application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0035] In addition, in the description of the specification and appended claims of the present application, the terms "first", "second", "third", etc. are only used for descriptive distinction and cannot be understood as indicating or implying relative importance.

[0036] The reference to "one embodiment" or "some embodiments" etc. described in the specification of the present application means that a specific feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0037] The lightning channel complexity evaluation method provided by the embodiments of this application can be executed by the processor of an electronic device when running a computer program with corresponding functions. By acquiring a lightning grayscale image, performing edge detection on the lightning grayscale image to extract an edge image, finding the contours of the edge image and filtering them to obtain a filtered contour set, performing a closing operation on the filtered contour set through dilation to obtain a candidate contour set, filtering the candidate contour set based on preset parameters to obtain a final contour set, calculating the fractal dimension of the final contour using the box-counting method, and evaluating the geometric complexity of the lightning channel according to the fractal dimension value, where the fractal dimension is positively correlated with the geometric complexity. Through the complete steps from image preprocessing to fractal dimension calculation, the problem of low efficiency caused by relying on manual observation and radio frequency equipment in traditional methods is solved. The box-counting method is introduced into the lightning channel complexity evaluation, replacing subjective qualitative analysis with a mathematical index (fractal dimension) to improve the objectivity of the evaluation. Through algorithms such as edge detection and contour filtering, full-automatic processing is achieved, overcoming the errors brought by manual intervention. The present invention can be widely applied in fields such as meteorological research, lightning warning, aerospace, and power systems, providing strong support for research and applications in related fields.

[0038] As Figure 1 shown, the lightning channel complexity evaluation method provided by the embodiments of this application includes the following steps S101 to S106:

[0039] Step S101, acquire a lightning grayscale image.

[0040] In the application, the original image I (i.e., the lightning grayscale image) is acquired through high-speed photography, and the coordinates of each pixel point are (x, y), and the grayscale value is I(x, y).

[0041] Step S102, perform edge detection on the lightning grayscale image to extract an edge image.

[0042] Step S103, find the contours of the edge image and filter them to obtain a filtered contour set.

[0043] Step S104, perform a closing operation on the filtered contour set through dilation to obtain a candidate contour set.

[0044] Step S105, filter the candidate contour set based on preset parameters to obtain a final contour set.

[0045] Step S106, calculate the fractal dimension of the final contour using the box-counting method, and evaluate the geometric complexity of the lightning channel according to the fractal dimension value, where the fractal dimension is positively correlated with the geometric complexity.

[0046] The embodiments of the present application provide a quantization index of fractal dimension, which can evaluate the geometric complexity of lightning channels; it has a high degree of automation, can automatically extract lightning channels from high-speed camera images without manual intervention, improves the extraction efficiency, and has a high extraction accuracy: by combining image processing technologies, the present invention can accurately extract lightning channels, reducing errors and omissions; by using efficient algorithms and optimized data structures, it can complete the processing and analysis of a large number of images in a short time; the present invention has strong noise suppression ability and can work stably in complex environments. The present invention can be widely applied in the fields of meteorological research, lightning warning, aerospace, power systems, etc., providing strong support for the research and application in related fields.

[0047] In one embodiment, after step S101, steps S201 and S202 are further included:

[0048] Step S201: Smooth the lightning grayscale image by using the Gaussian blur algorithm.

[0049] In application, perform Gaussian smoothing operation on the original image I to obtain I blurred , let the Gaussian function be G(x, y, σ), where σ is the standard deviation, then I blurred (x, y) = ∑ i ∑ j I(x + i, y + j) × G(i, j, σ).

[0050] The noise interference in the image can be reduced through the Gaussian smoothing operation.

[0051] Step S202: Perform morphological opening operation and morphological closing operation on the smoothed image in sequence.

[0052] In application, the morphological opening operation is used to remove small noise points in I blurred . The opening operation means first performing an erosion operation and then a dilation operation to obtain I opened . The steps are as follows:

[0053] Let the structuring element be S (a small matrix template). The erosion operation Erode(I blurred , S) slides the structuring element S on the image I blureed . If all pixel values within S are greater than or equal to the pixel values at the corresponding positions of I blureed , the central pixel value remains unchanged; otherwise, it becomes the minimum value.

[0054] The dilation operation Dilate(Erode(I blureed , S), S). If there is at least one pixel value within S that is greater than or equal to the pixel value at the corresponding position of I blurred , the central pixel value becomes the maximum value.

[0055] In the application, the closing operation is used to fill the small holes in I blurred First, perform the dilation operation, and then the erosion operation to obtain I closed .

[0056] In the application, steps S201 and S202 are in the image preprocessing stage. First, read the high-speed camera grayscale image. The original image is as Figure 2 shown (the image size is 1280 pixels × 1024 pixels). Then, use the Gaussian blur algorithm to smooth the grayscale image to reduce the influence of noise on subsequent processing. Next, perform morphological operations, including the opening operation and the closing operation. The opening operation can remove small noise points in the image, while the closing operation can fill the small holes in the image, thereby obtaining a clearer and smoother image.

[0057] The Gaussian smoothing in the embodiments of the present application reduces high-frequency noise through weighted averaging. Its standard deviation parameter σ can be dynamically adjusted to adapt to different noise intensities, avoiding the edge blurring caused by traditional mean filtering. The morphological opening operation (erosion first and then dilation) removes isolated noise points, and the closing operation (dilation first and then erosion) fills holes. The combined use can retain the structural integrity of the main lightning channel.

[0058] In the application, in step S102, edge detection is performed on the lightning grayscale image to extract the edge image, specifically as follows:

[0059] Adopt the Canny edge detection method. Let the image obtained after the morphological operation be I closed , calculate the gradient magnitude M(x, y) and direction θ(x, y) of the image through the following formulas:

[0060]

[0061] G x (x, y) = Iclosed(x + 1, y) - Iclosed(x - 1, y)

[0062] G y (x, y) = Iclosed(x, y + 1) - Iclosed(x, y - 1)

[0063]

[0064] Then perform non-maximum suppression to obtain the preliminary edge E1, and then determine the final edge image I edges according to the double thresholds (set as T1 and T2, T1 < T2). The edge points satisfy T1 < M(x, y) < T2 and are in E1.

[0065] In an application, during the edge detection stage, the Canny edge detection algorithm is used to calculate the edges of an image. The Canny edge detection algorithm is a classic edge detection algorithm that can detect weak edges and strong edges in an image and has good anti-noise performance. Through the Canny edge detection algorithm, the edge information of the lightning channel in the image can be obtained.

[0066] In one embodiment, as Figure 3 shown, step S103 includes steps S301 to S303:

[0067] Step S301, find all the contours in the edge image to obtain an initial contour set.

[0068] In an application, traverse each pixel point of the edge image I edges . When a jump from non-edge to edge is encountered, start tracking along the edge and record the set of contour points C. All such sets of contour points form the initial contour set Contours.

[0069] Step S302, calculate the arc length and area of each contour in the initial contour set.

[0070] In an application, for each contour c ∈ Contours, calculate its arc length L c and area A c . The arc length can be obtained by sequentially calculating the distances between adjacent points along the contour points and summing them up; the area can be calculated by numerical integration methods such as the trapezoidal rule.

[0071] Step S303, add the contours with arc length greater than the preset arc length and area greater than the first preset area to the filtered contour set.

[0072] In an application, retain the contours that satisfy Lc > Lmin and Ac > Amin to obtain the filtered contour set FilteredContours.

[0073] In an application, during the contour finding and filtering stage, use the findContours function in the OpenCV library to find all the contours in the edge image. Then, filter each contour, retain the contours with length greater than the preset minimum value, and exclude the contours with too small area at the same time. This can effectively remove the interfering contours in the image and retain the possible lightning channel contours.

[0074] The lightning channel in the embodiment of this application appears as a continuous and slender structure in the image. Its true contour has significant arc length (Lc) and area (Ac) characteristics. Short noise or fragmented interfering contours can be excluded through the preset thresholds (Lmin, Amin). The arc length is calculated by cumulative summation of Euclidean distances, and the area is integrated by the trapezoidal rule, with better numerical stability than the traditional pixel counting method.

[0075] In one embodiment, as Figure 4 shown, step S104 includes steps S401 to S403:

[0076] Step S401: Process the contours in each filtered contour set through multiple iterations of dilation to obtain a dilated region.

[0077] In an application, let the dilation structuring element be Sd. For each contour c in FilteredContours, mark all the pixel points inside its contour as a new temporary region Rc. Then slide Sd on Rc. If at least one pixel in Sd belongs to Rc, expand the center pixel of the slide to the adjacent pixels outside Rc, and repeat this process a certain number of times (set as iter) to obtain the dilated region R. c_dilated .

[0078] Step S402: Re-extract contours based on the dilated region to obtain a set of closed contours.

[0079] In an application, re-extract contours from R c_dilated to obtain a set of closed contours ClosedContours.

[0080] Step S403: Add the largest contour in each set of closed contours to the candidate contour set.

[0081] In an application, a lightning grayscale image can obtain multiple sets of closed contours. Select the largest contour (which can be done by comparing areas, etc.) from the set of closed contours ClosedContours as the candidate contour of the lightning channel.

[0082] In an application, in the contour closing process stage, perform closing processing on the filtered contours. First, create a temporary mask for processing a single contour. Then, use the dilation operation to try to close the contour. The dilation operation can expand the range of the contour, so that the non-closed contour can be closed. Then, convert the closed contour back to the contour format and select the largest closed contour as the candidate contour of the lightning channel.

[0083] The iterative dilation of the embodiment of the present application fills the non-closed area caused by edge breakage by gradually expanding the contour boundary. Selecting the contour with the largest area after closing conforms to the physical characteristic that the main lightning channel occupies the largest area in the image and avoids interference from branch channels.

[0084] In one embodiment, step S105 includes steps S501 and S502:

[0085] Step S501: Calculate the area of each contour in the candidate contour set.

[0086] In the application, calculate the area Ac′ of each contour in ClosedContours.

[0087] Step S502: Add the contours with an area greater than the second preset area to the final contour set.

[0088] In the application, retain the contours that satisfy Ac′ > A final to obtain the final contour set FinalContours.

[0089] In the application, during the contour screening and drawing stage, re-screen the closed contours. The screening conditions can be adjusted according to the actual situation, such as setting area thresholds, length thresholds, etc. Then, draw the screened lightning channels onto the mask image and display and save the results. By adjusting the screening conditions and drawing parameters, lightning channel images with different effects and precisions can be obtained.

[0090] In the embodiment of the present application, after the closing process, the secondary area screening can remove the invalid areas (such as adjacent object adhesions) that may be introduced by the dilation operation, ensuring that the final contour set only contains significant lightning channels. The second area threshold can be dynamically adjusted according to the image resolution to adapt to different scenario requirements.

[0091] In one embodiment, a blank mask image I mask can also be created. For each contour c in FinalContours, mark the pixel points inside the contour on Imask with a specific color (such as green), which can be achieved by traversing the contour points and filling their internal pixels. Finally, output I mask as the result image for extracting the lightning channels, or convert the contour point coordinates and other information in FinalContours into a data form for subsequent analysis.

[0092] In the output result stage, output the extracted lightning channels in the form of an image (as Figure 5 shown). The output results can be used for subsequent analysis and use. For example, they can be used for calculating and analyzing parameters such as the length, width, and shape of the lightning channels, and can also be used for analyzing the fractal dimension of the lightning channels.

[0093] In one embodiment, step S106 includes steps S601 and S602:

[0094] Step S601: Cover the final contour with grids of different scales and calculate the minimum number of grids required to cover the contour at each scale.

[0095] In applications, the box-counting method is used to estimate the fractal dimension. The basic idea of this method is to cover a complex geometric shape with a grid and calculate how many boxes (or cells) are needed to cover all parts of the shape. By changing the grid size and repeating this process, a series of different numbers of boxes can be obtained.

[0096] Step S602: Based on the logarithmic relationship between the grid scale and the corresponding minimum number of grids, perform linear fitting, and take the slope of the fitting line as the fractal dimension.

[0097] In applications, the steps of the box-counting method are as follows:

[0098] 1) Select the initial box size: At the beginning, a relatively large box size r can be selected to ensure that the entire shape is covered by a few large boxes.

[0099] 2) Decrease the box size: Gradually reduce the size of the boxes, and use smaller boxes to cover the same shape in each iteration.

[0100] 3) Count the number of boxes: For each box size, count the number N(r) of non-empty boxes that contain at least a part of the shape.

[0101] 4) Record the results: Record the data pairs of different box sizes r and the corresponding number of non-empty boxes N(r).

[0102] 5) Plot the graph: Use the logarithm of the reciprocal of the box size r (i.e., log(1 / r)) as the x-axis and the logarithm of the number of non-empty boxes N(r) (log(N(r))) as the y-axis to plot these data points.

[0103] 6) Linear fitting: Find the best-fitting line on the double-logarithm graph, and the slope of this line is the fractal dimension Df.

[0104] The fractal dimension Df is usually expressed by the following formula:

[0105]

[0106] where Df is the fractal dimension, N(r) is the minimum number of boxes required to cover the shape when the box size is r, and r is the side length of the box, which represents the measurement scale.

[0107] Finally, the fractal dimension is used to evaluate the complexity of the lightning channel. The larger the fractal dimension, the more complex the lightning channel is.

[0108] The box-counting method in the embodiments of this application fits the fractal dimension through the logarithmic relationship between the grid scale and the coverage quantity, avoiding the three-dimensional reconstruction calculation complexity of the traditional antenna array method, and the result is not affected by subjective interpretation. The linear fitting in double logarithmic coordinates (such as the least squares method) conforms to the scale invariance hypothesis in fractal theory, and the slope calculation has a clear mathematical meaning.

[0109] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application.

[0110] The embodiments of this application also provide a lightning channel complexity evaluation device for executing the steps in the embodiments of the above lightning channel complexity evaluation method. The lightning channel complexity evaluation device can be a virtual appliance in an electronic device, run by the processor of the electronic device, or the electronic device itself.

[0111] As Figure 6 shown, a lightning channel complexity evaluation device 100 provided by this application includes:

[0112] An image acquisition module 101, configured to acquire a lightning grayscale image;

[0113] An edge detection module 102, configured to perform edge detection on the lightning grayscale image and extract an edge image;

[0114] A contour search module 103, configured to search for the contours of the edge image and perform screening to obtain a screened contour set;

[0115] A contour closing module 104, configured to perform a closing process on the screened contour set through a dilation operation to obtain a candidate contour set;

[0116] A screening module 105, configured to screen the candidate contour set based on preset parameters to obtain a final contour set;

[0117] A calculation and evaluation module 106, configured to calculate the fractal dimension of the final contour by using the box-counting method and evaluate the geometric complexity of the lightning channel according to the fractal dimension value, where the fractal dimension is positively correlated with the geometric complexity.

[0118] In one embodiment, it further includes a preprocessing module, configured to:

[0119] Perform smoothing processing on the lightning grayscale image by using a Gaussian blur algorithm;

[0120] Perform a morphological opening operation and a morphological closing operation on the smoothed image in sequence.

[0121] In one embodiment, the contour finding module is further configured to:

[0122] Find all the contours in the edge image to obtain an initial contour set;

[0123] Calculate the arc length and area of each contour in the initial contour set;

[0124] Add the contours whose arc length is greater than a preset arc length and area is greater than a first preset area to the filtered contour set.

[0125] In one embodiment, the contour closing module is further configured to:

[0126] Process each contour in the filtered contour set through multiple iterations of dilation to obtain a dilated region; re-extract the contours based on the dilated region to obtain a closed contour set;

[0127] Add the largest contour in each closed contour set to the candidate contour set.

[0128] In one embodiment, the filtering module is further configured to:

[0129] Calculate the area of each contour in the candidate contour set;

[0130] Add the contours whose area is greater than a second preset area to the final contour set.

[0131] In one embodiment, the calculation and evaluation module is further configured to:

[0132] Cover the final contour with grids of different scales and calculate the minimum number of grids required to cover the contour at each scale;

[0133] Perform linear fitting according to the logarithmic relationship between the grid scale and the corresponding minimum number of grids, and use the slope of the fitted straight line as the fractal dimension.

[0134] In applications, each module in the lightning channel complexity evaluation device can be a software program module, can also be implemented by different logic circuits integrated in a processor, or can be implemented by multiple distributed processors.

[0135] As Figure 7 shown, an embodiment of the present application further provides an electronic device 200, including: at least one processor 201 ( Figure 7 only one processor is shown herein), a memory 202, and a computer program 203 stored in the memory 202 and executable on at least one processor 201. When the processor 201 executes the computer program 203, the steps in the above-mentioned method embodiments are implemented.

[0136] In applications, the electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that Figure 7The examples of the electronic device are merely for illustration and do not constitute a limitation to the electronic device. It may include more or fewer components than those shown in the figures, or combine certain components, or have different components.

[0137] In an application, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0138] In an application, the memory may be an internal storage unit of the electronic device in some embodiments, such as the hard disk or memory of the electronic device. The memory may also be an external storage device of the electronic device in other embodiments. For example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the memory may also include both the internal storage unit and the external storage device of the electronic device. The memory is used to store an operating system, application programs, a boot loader, data, and other programs, such as the program code of a computer program. The memory may also be used to temporarily store data that has been output or will be output.

[0139] It should be noted that for the content such as information interaction and execution process between the above-mentioned devices / units, since it is based on the same concept as the method embodiment of the present application, for its specific functions and the technical effects brought, reference may be specifically made to the method embodiment part, and details will not be elaborated here.

[0140] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.

[0141] An embodiment of this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.

[0142] An embodiment of this application provides a computer program product, including a computer program. When the computer program product runs on an electronic device, the electronic device is enabled to execute the steps in the foregoing method embodiments.

[0143] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above method embodiments of this application, a computer program can be used to instruct the relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the device / electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.

[0144] In the above embodiments, the descriptions of the respective embodiments each have their own emphasis. For parts not detailed or recorded in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0145] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.

[0146] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.

[0147] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0148] The above embodiments are only used to illustrate the technical solutions of this application, rather than to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included in the protection scope of this application.

Claims

1. A method for evaluating the complexity of a lightning channel, characterized in that Comprising: Obtain a lightning grayscale image; Perform edge detection on the lightning grayscale image to extract an edge image; Find the contours of the edge image and perform screening to obtain a set of screened contours; Perform a closing process on the set of screened contours through a dilation operation to obtain a set of candidate contours; Screen the set of candidate contours based on preset parameters to obtain a final set of contours; Calculate the fractal dimension of the final contour using the box-counting method and evaluate the geometric complexity of the lightning channel according to the fractal dimension value, where the fractal dimension is positively correlated with the geometric complexity.

2. The method for evaluating the complexity of a lightning channel according to claim 1, wherein After obtaining the lightning grayscale image, it further includes: Perform smoothing processing on the lightning grayscale image using a Gaussian blur algorithm; Perform a morphological opening operation and a morphological closing operation on the smoothed image in sequence.

3. The method for evaluating the complexity of a lightning channel according to claim 1, characterized in that The step of finding the contours of the edge image and performing screening to obtain a screened contour includes: Find all the contours in the edge image to obtain an initial set of contours; Calculate the arc length and area of each contour in the initial set of contours; Add the contours with an arc length greater than a preset arc length and an area greater than a first preset area to the set of screened contours.

4. The method for evaluating the complexity of a lightning channel according to claim 1, wherein The step of performing a closing process on the set of screened contours through a dilation operation to obtain a set of candidate contours includes: Perform multiple iterative dilation processes on the contours in each set of screened contours to obtain a dilated region; Re-extract the contours based on the dilated region to obtain a set of closed contours; Add the largest contour in each set of closed contours to the set of candidate contours.

5. The method for evaluating the complexity of a lightning channel according to claim 1, wherein, The step of screening the set of candidate contours based on preset parameters to obtain a final set of contours includes: Calculate the area of each contour in the set of candidate contours; Add the contours with an area greater than a second preset area to the final set of contours.

6. The method for evaluating the complexity of a lightning channel according to claim 1, characterized in that The step of calculating the fractal dimension of the final contour using the box-counting method includes: Cover the final contour with grids of different scales and calculate the minimum number of grids required to cover the contour at each scale; Based on the logarithmic relationship between the grid scale and the corresponding minimum number of grids, perform linear fitting and use the slope of the fitting line as the fractal dimension.

7. An apparatus for evaluating the complexity of a lightning channel, characterized in that, Comprising: An image acquisition module for obtaining a lightning grayscale image; An edge detection module for performing edge detection on the lightning grayscale image to extract an edge image; A contour search module for finding the contours of the edge image and performing screening to obtain a set of screened contours; A contour closing module for performing a closing process on the set of screened contours through a dilation operation to obtain a set of candidate contours; A screening module for screening the set of candidate contours based on preset parameters to obtain a final set of contours; A calculation and evaluation module for calculating the fractal dimension of the final contour using the box-counting method and evaluating the geometric complexity of the lightning channel according to the fractal dimension value, where the fractal dimension is positively correlated with the geometric complexity.

8. The lightning channel complexity evaluation system according to claim 7, characterized in that, It further includes a preprocessing module for: Performing smoothing processing on the lightning grayscale image using a Gaussian blur algorithm; Performing a morphological opening operation and a morphological closing operation on the smoothed image in sequence.

9. The lightning channel complexity evaluation system according to claim 7, wherein The contour search module is further used for: Finding all the contours in the edge image to obtain an initial set of contours; Calculating the arc length and area of each contour in the initial set of contours; Add the contours with arc length greater than the preset arc length and area greater than the first preset area to the filtered contour set.

10. The lightning channel complexity evaluation system according to claim 7, characterized in that, The contour closing module is further configured to: Process each contour in the filtered contour set through multiple iterations of dilation to obtain the dilated region; Re-extract the contours based on the dilated region to obtain a set of closed contours; Add the largest contour in each set of closed contours to the candidate contour set.

11. The lightning channel complexity evaluation system according to claim 7, wherein The filtering module is further configured to: Calculate the area of each contour in the candidate contour set; Add the contours with area greater than the second preset area to the final contour set.

12. The lightning channel complexity evaluation system according to claim 7, characterized in that, The calculation and evaluation module is further configured to: Cover the final contour with grids of different scales and calculate the minimum number of grids required to cover the contour at each scale; Perform linear fitting based on the logarithmic relationship between the grid scale and the corresponding minimum number of grids, and use the slope of the fitted straight line as the fractal dimension.

13. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor. It is characterized in that when the processor executes the computer program, the electronic device implements the method according to any one of claims 1-6.

14. A computer-readable storage medium storing a computer program, characterized in that, A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.