Transmission line wildfire monitoring method, device, computer equipment and storage medium
By acquiring images of transmission line sensors and using inter-class variance and RGB color space analysis to identify and monitor wildfire areas, it solves the problem of low wildfire identification efficiency caused by the low frequency of drone line patrols and achieves real-time monitoring and Early warning improves the safety of transmission lines.
Patent Information
- Application Number
- CN202210005458.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-04
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-01-04
AI Technical Summary
The existing method of monitoring wildfires on transmission lines has low efficiency in identifying wildfires due to the low frequency of drone patrols, and cannot achieve real-time monitoring and early warning.
By obtaining the image to be identified sent by the sensor of the transmission line, the inter-class variance of the gray value is used to determine the binarization threshold, the binarized image is obtained, and the color mean and proportion of the RGB color space are combined to identify and monitor the wildfire area. , improve monitoring efficiency.
It improves the efficiency and accuracy of wildfire monitoring on transmission lines, enables real-time identification and early warning of wildfires, and enhances the safety of transmission lines.
Smart Images

Figure CN114494902B
Abstract
Description
Technical Field
[0001] The present application relates to the field of power monitoring technology, and in particular to a method, device, computer equipment, storage medium and computer program product for monitoring wildfires on power transmission lines. Background Art
[0002] With the development of my country's power industry and the implementation of the West-to-East Power Transmission Strategy, the safe operation of transmission lines is one of the important links to ensure the stability of the power grid. In recent years, affected by climate change, wildfires have occurred frequently in autumn and winter, seriously threatening the safe operation of transmission lines. Therefore, it is necessary to monitor the environment around the transmission lines, achieve effective early warning in the early stage of wildfires, and take measures to prevent the spread of wildfires.
[0003] At present, the main method for monitoring wildfires on power transmission lines is to use drones to take photos of the conditions around the power transmission lines and identify wildfires based on the photos taken by the drones. However, the method of identifying wildfires by drones cannot identify wildfires in real time due to the low frequency of drone patrols, resulting in a decrease in the efficiency of wildfire identification.
[0004] Therefore, the current method for monitoring wildfires on power transmission lines has the defect of low monitoring efficiency. Summary of the invention
[0005] Based on this, it is necessary to provide a power transmission line wildfire monitoring method, device, computer equipment, computer-readable storage medium and computer program product that can improve monitoring efficiency in response to the above-mentioned technical problems.
[0006] In a first aspect, the present application provides a method for monitoring wildfires on power transmission lines, the method comprising:
[0007] Acquire an image to be identified sent by a sensor arranged on a power transmission line;
[0008] Obtaining the grayscale value of the image to be identified, and determining a binarization threshold according to the inter-class variance corresponding to the grayscale value;
[0009] According to the binarization threshold, a binarized image corresponding to the image to be identified is obtained, and a wildfire area to be identified is determined from the binarized image;
[0010] Obtain color means and color ratios of pixels in the wildfire area to be identified in each channel of the RGB color space, and monitor the wildfire in the image to be identified based on a first similarity between the color mean and a target color mean, and based on a second similarity between a size relationship between a plurality of the color ratios and a size relationship between a plurality of target color ratios; the target color mean and the target color ratio are calculated based on a sample image containing a wildfire area.
[0011] In one embodiment, the sensor is connected to a plurality of visible light collection devices; the plurality of visible light collection devices are respectively used to collect images to be identified in different directions of the transmission line;
[0012] The step of acquiring an image to be identified sent by a sensor disposed on a power transmission line comprises:
[0013] Acquire a first sub-image to be identified sent by a first visible light acquisition device; the first visible light acquisition device is used to acquire an image above the power transmission line;
[0014] Acquire a second sub-image to be identified sent by a second visible light acquisition device; the second visible light acquisition device is used to acquire images on both sides of the transmission line;
[0015] The image to be recognized is obtained according to the first sub-image to be recognized and the second sub-image to be recognized.
[0016] In one embodiment, the step of obtaining the grayscale value of the image to be identified and determining a binarization threshold value according to the inter-class variance corresponding to the grayscale value includes:
[0017] For each sub-image to be identified in the image to be identified, obtaining a first average grayscale corresponding to a first pixel in the sub-image to be identified whose grayscale value is less than a binarization threshold to be determined, and obtaining a first ratio of the first pixel to the total pixels in the sub-image to be identified;
[0018] Obtaining a second average grayscale corresponding to a second pixel whose grayscale value is greater than or equal to the to-be-determined binarization threshold in the sub-image to be identified, and obtaining a second ratio of the second pixel to the total pixels in the sub-image to be identified;
[0019] Obtaining a square of a difference between the first average grayscale and the second average grayscale, obtaining a first product of the square and the second ratio, and constructing an inter-class variance function corresponding to the to-be-determined binarization threshold according to the first product and the second product of the first ratio;
[0020] Obtaining the maximum value of the inter-class variance function as the binarization threshold;
[0021] Also includes:
[0022] If the image to be identified includes a first sub-image to be identified, when it is detected that the binarization threshold corresponding to the first sub-image to be identified is less than a preset visible light threshold, the binarization threshold of the second sub-image to be identified is used as the binarization threshold of the first sub-image to be identified.
[0023] In one embodiment, obtaining a binary image corresponding to the image to be identified according to the binary threshold, and determining the wildfire area to be identified from the binary image includes:
[0024] Converting pixels in the image to be identified whose grayscale values are greater than or equal to the binarization threshold into a first value, and converting pixels in the image to be identified whose grayscale values are less than the binarization threshold into a second value, to obtain a binarized image; the first value is different from the second value;
[0025] Traversing the binary image based on a stack of a preset size to obtain a plurality of regions consisting of pixels corresponding to the first value in the image to be identified;
[0026] For each of the areas, detect whether the number of pixels in the area is greater than or equal to a preset pixel threshold; if so, use the area as the wildfire area to be identified.
[0027] In one embodiment, obtaining the color mean and color ratio of each channel of the pixels in the to-be-identified wildfire area in the RGB color space includes:
[0028] For each color channel in the RGB color space, obtain the color value of the pixel in the to-be-identified wildfire area under the color channel, and obtain the color mean corresponding to the color channel according to the ratio of the color values of multiple pixels to the total number of pixels in the to-be-identified wildfire area;
[0029] For each pixel in the wildfire area to be identified, the color values of multiple color channels corresponding to the pixel are obtained, and the color ratio of each color channel corresponding to the pixel is determined according to the ratio of each color value to the color values of the multiple color channels.
[0030] In one embodiment, monitoring the wildfire in the image to be identified based on a first similarity between the color mean and the target color mean, and based on a second similarity between a size relationship between a plurality of the color ratios and a size relationship between a plurality of target color ratios, includes:
[0031] For each color channel in the RGB color space, obtaining a first similarity between a color mean corresponding to the color channel and a target color mean corresponding to the color channel in the wildfire area to be identified;
[0032] Determine a corresponding linear coefficient according to a target size relationship corresponding to a plurality of target color ratios;
[0033] Determine, according to the plurality of color ratios and the linear coefficients, size relationships corresponding to the plurality of color ratios, and obtain a second similarity between the size relationships and the target size relationship;
[0034] If, in the to-be-identified wildfire area, the number of pixels whose first similarity is greater than a first similarity threshold and whose second similarity is greater than a second similarity threshold is greater than a preset value, it is determined that a wildfire has occurred in the to-be-identified wildfire area.
[0035] In a second aspect, the present application provides a transmission line wildfire monitoring device, the device comprising:
[0036] A first acquisition module, used to acquire an image to be identified sent by a sensor arranged on a power transmission line;
[0037] A second acquisition module is used to acquire the grayscale value of the image to be identified, and determine a binarization threshold according to the inter-class variance corresponding to the grayscale value;
[0038] A determination module, used to obtain a binary image corresponding to the image to be identified according to the binary threshold, and determine the wildfire area to be identified from the binary image;
[0039] A monitoring module is used to obtain the color mean and color ratio of each channel of the pixels in the wildfire area to be identified in the RGB color space, and monitor the wildfire in the image to be identified based on a first similarity between the color mean and a target color mean, and based on a second similarity between a size relationship between multiple color ratios and a size relationship between multiple target color ratios; the target color mean and the target color ratio are calculated based on a sample image containing a wildfire area.
[0040] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0041] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0042] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.
[0043] The above-mentioned power transmission line wildfire monitoring method, device, computer equipment, storage medium and computer program product obtain the grayscale value of the image to be identified sent by the sensor of the power transmission line, determine the binarization threshold according to the inter-class variance corresponding to the grayscale value, obtain the binarized image corresponding to the image to be identified based on the binarization threshold, determine the wildfire area to be identified from the binarized image, and monitor the wildfire in the image to be identified based on the first similarity between the color mean of each channel of the pixels in the wildfire area to be identified in the RGB color space and the target color mean, and the second similarity between the size relationship between multiple color ratios and the size relationship between multiple target color ratios. Compared with the traditional method of inspecting power transmission lines based on drones, this scheme determines the wildfire area in the image through the binarized image obtained based on the inter-class variance, and determines whether the wildfire area is a wildfire based on the RGB color, thereby improving the efficiency of power transmission line wildfire monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A diagram showing an application environment of a method for monitoring wildfires on power transmission lines in one embodiment;
[0045] Figure 2 A schematic diagram of a process of a method for monitoring wildfires on a power transmission line in one embodiment;
[0046] Figure 3 A schematic diagram of a process for obtaining a binarization threshold value in one embodiment;
[0047] Figure 4 A schematic diagram of a flow chart of steps for monitoring a wildfire area in one embodiment;
[0048] Figure 5 A structural block diagram of a power transmission line wildfire monitoring device in one embodiment;
[0049] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] The transmission line wildfire monitoring method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the transmission line integrated sensor 104 through the network. The sensor integrated on the transmission line can be connected to three visible light acquisition devices, and the three visible light acquisition devices can be respectively arranged at the bottom of the transmission line, and on the left and right sides, for respectively collecting image information of different directions of the transmission line. After the above-mentioned integrated sensor 104 receives the image information to be identified sent by the visible light acquisition device, the image information to be identified can be sent to the terminal 102, and the terminal 102 can identify the wildfire based on the acquired image to be identified through the inter-class variance and the RGB color space. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0052] In one embodiment, Figure 2 As shown, a method for monitoring wildfires on power transmission lines is provided, and the method is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0053] Step S202: acquiring an image to be identified sent by a sensor installed on a power transmission line.
[0054] Among them, the transmission line can be a line set up in an area where a wildfire may occur. A sensor is integrated in the transmission line, and a plurality of visible light acquisition devices are also arranged on the sensor, each of which can acquire images of the transmission line in different directions. The sensor can receive images of the transmission line in different directions acquired by different transmission lines, and send these images to the terminal 102. The terminal 102 can obtain the transmission line image sent by the above sensor as an image to be identified. That is, the occurrence of a wildfire may be detected in the above image to be identified.
[0055] Step S204, obtaining the grayscale value of the image to be identified, and determining a binarization threshold according to the inter-class variance corresponding to the grayscale value.
[0056] The image to be identified may be an image of the area where the power transmission line is located. The terminal 102 may obtain the gray value of the image to be identified and determine the corresponding inter-class variance based on the gray value. For example, the terminal 102 constructs an inter-class variance function based on the gray value and determines a binarization threshold based on the inter-class variance function. The binarization threshold may be used to classify the image to be identified based on the gray value. Since the brightness of wildfires is relatively high, the accuracy of wildfire area identification is improved by determining a suitable binarization threshold and screening the image to be identified based on the gray value based on the binarization threshold.
[0057] Step S206, obtaining a binarized image corresponding to the image to be identified according to the binarization threshold, and determining the wildfire area to be identified from the binarized image.
[0058] Among them, the binarization threshold can be a threshold determined based on the inter-class variance of the grayscale value of the image to be identified. The terminal 102 can determine the binarized image corresponding to the image to be identified according to the binarization threshold, and determine the suspected wildfire area in the binarized image as the wildfire area to be identified. Among them, after the terminal 102 converts the image to be identified into a binary image, each pixel therein is a value, for example, a pixel with a grayscale value less than the binarization threshold is 0, and a pixel with a grayscale value greater than or equal to the binarization threshold is 1. Therefore, the terminal 102 can convert the image to be identified into a binary image composed of 0 and 1, so that the terminal 102 can determine the wildfire area to be identified from the area formed by the value "1" in the image.
[0059] Step S208, obtaining the color mean and color ratio of each channel of the pixels in the wildfire area to be identified in the RGB color space, and monitoring the wildfire in the image to be identified based on a first similarity between the color mean and the target color mean, and based on a second similarity between a size relationship between multiple color ratios and a size relationship between multiple target color ratios; the target color mean and target color ratio are calculated based on a sample image containing the wildfire area.
[0060] After the terminal 102 determines the wildfire area to be identified, it can determine whether the wildfire area to be identified is actually a wildfire through detection based on the RGB color space. The terminal 102 can obtain the color mean and color ratio of each channel of the pixels in the wildfire area to be identified in the RGB color space. The RGB color space is based on the three basic colors of R (Red), G (Green), and B (Blue), and the three basic colors are three channels. The three basic colors are superimposed to different degrees to produce rich and wide colors, so it is commonly known as the three-primary color mode. The color mean may be the average value of the color value of each color channel in the RGB color space in the wildfire area to be identified; the color ratio may be the ratio of the color value of each pixel in each color channel in the RGB color space to all the color values of the pixel in the wildfire area to be identified. The terminal 102 may obtain the first similarity between the color mean and the target color mean. The terminal 102 may also obtain the second similarity between the size relationship between multiple color ratios and the size relationship between multiple target color ratios, so that the terminal 102 may monitor the wildfire in the image to be identified based on the first similarity and the second similarity. For example, the terminal 102 may analyze the first similarity and the second similarity based on the pixel color values in the wildfire area to be identified, and determine the area that meets the requirements, that is, the area where the wildfire occurs. The target color mean and the target color ratio may be obtained by training multiple sample images containing known wildfire areas.
[0061] In the above-mentioned method for monitoring wildfires on power transmission lines, the grayscale value of the image to be identified sent by the sensor of the power transmission line is obtained, the binarization threshold is determined according to the inter-class variance corresponding to the grayscale value, the binarized image corresponding to the image to be identified is obtained based on the binarized threshold, the wildfire area to be identified is determined from the binarized image, and the wildfire in the image to be identified is monitored according to the first similarity between the color mean of each channel of the pixels in the wildfire area to be identified in the RGB color space and the target color mean, and the second similarity between the size relationship between multiple color ratios and the size relationship between multiple target color ratios. Compared with the traditional method of inspecting power transmission lines based on drones, this scheme determines the wildfire area in the image through the binarized image obtained based on the inter-class variance, and determines whether the wildfire area is a wildfire based on the RGB color, thereby improving the efficiency of wildfire monitoring on power transmission lines.
[0062] In one embodiment, obtaining an image to be identified sent by a sensor arranged on a transmission line includes: obtaining a first sub-image to be identified sent by a first visible light acquisition device; the first visible light acquisition device is used to acquire images above the transmission line; obtaining a second sub-image to be identified sent by a second visible light acquisition device; the second visible light acquisition device is used to acquire images on both sides of the transmission line; and obtaining an image to be identified based on the first sub-image to be identified and the second sub-image to be identified.
[0063] In this embodiment, the sensor is connected to a plurality of visible light acquisition devices; the plurality of visible light acquisition devices are respectively used to acquire images to be identified in different directions in the power transmission line. Then the image to be identified received by the terminal 102 may include a plurality of sub-images to be identified, and each sub-image to be identified is captured by a different visible light acquisition device. The terminal 102 may obtain a first sub-image to be identified sent by a first visible light acquisition device, the first visible light acquisition device may be a device for acquiring images above the power transmission line, and the first visible light acquisition device may be arranged at the bottom of the above-mentioned sensor 104. The terminal 102 may also obtain a second sub-image to be identified sent by a second visible light acquisition device, the second visible light acquisition device may be a device for acquiring images on both sides of the power transmission line, wherein the second visible light image consists of a plurality of sub-images to be identified, which are respectively arranged on the left and right sides of the sensor 104, so that the two second visible light acquisition devices respectively acquire images to be identified in different directions.
[0064] The terminal 102 can receive the sub-images to be identified collected by the above-mentioned different visible light collection devices, so that the terminal 102 can obtain the image to be identified based on the first sub-image to be identified and the second sub-image to be identified. Specifically, the above-mentioned transmission line can be integrated with a sensor 104, and the sensor 104 can include three visible light modules and a microcontroller unit (MCU). Based on the advantage that the three visible light modules can take images in different directions, the terminal 102 can use the photos taken by the bottom visible light camera to calculate the binarization threshold based on the maximum inter-class variance method. If the binarization threshold is less than the minimum daytime threshold, the left and right visible light cameras are used to calculate the binarization threshold based on the maximum inter-class variance method. After calculating the binarization threshold, the photos taken by all visible light cameras are binarized, the connected areas of the binarized images are calculated, and the connected areas with small pixel proportions are filtered out. The images of the remaining connected areas are identified as wildfires based on the RGB color feature method.
[0065] Through this embodiment, the terminal 102 can use the sub-images to be identified collected by the visible light collection device based on multiple different shooting angles as the images to be identified, and perform wildfire identification, thereby improving the accuracy and efficiency of wildfire identification.
[0066] In one embodiment, the grayscale value of the image to be identified is obtained, and a binarization threshold is determined according to the inter-class variance corresponding to the grayscale value, including: for each sub-image to be identified in the image to be identified, obtaining a first average grayscale corresponding to a first pixel in the sub-image to be identified whose grayscale value is less than the binarization threshold to be determined, and obtaining a first ratio of the first pixel to the total pixels in the sub-image to be identified; obtaining a second average grayscale corresponding to a second pixel in the sub-image to be identified whose grayscale value is greater than or equal to the binarization threshold to be determined, and obtaining a second ratio of the second pixel to the total pixels in the sub-image to be identified; obtaining the square of the difference between the first average grayscale and the second average grayscale, obtaining a first product of the square and the second ratio, and constructing an inter-class variance function corresponding to the binarization threshold to be determined according to the first product and the second product of the first ratio; obtaining the maximum value of the inter-class variance function as the binarization threshold.
[0067] In this embodiment, the terminal 102 can construct an inter-class variance function based on relevant parameters in the image to be identified, and determine a binarization threshold. Since there can be multiple images to be identified, the terminal 102 can calculate the binarization threshold for each sub-image to be identified. The terminal 102 can assume a binarization threshold to be determined. For each sub-image to be identified, the terminal 102 can obtain the first average grayscale corresponding to the grayscale value of the sub-image to be identified that is less than the first pixel to be determined, and obtain the first ratio of the first pixel to the total pixels in the sub-image to be identified. The terminal 102 can also obtain the second average grayscale corresponding to the second pixel in the sub-image to be identified whose grayscale value is greater than or equal to the binarization threshold to be determined, and obtain the second ratio of the second pixel to the total pixels in the sub-image to be identified. Then, for each sub-image to be identified, the terminal 102 can obtain the above four variables based on the binarization threshold to be determined, that is, the binarization threshold to be determined is unknown, and the terminal 102 can construct an inter-class variance function based on the above four variables. For example, the terminal 102 can obtain the square of the difference between the first average grayscale and the second average grayscale, and obtain the first product of the square of the difference between the first average grayscale and the second average grayscale and the second ratio, and then construct the inter-class variance function corresponding to the binarization threshold to be determined based on the first product and the second product of the first ratio. After the terminal 102 constructs the inter-class variance function of the binarization threshold to be determined, the maximum value of the inter-class variance function can be used as the binarization threshold.
[0068] Specifically, Figure 3 As shown, Figure 3The figure is a flowchart of the step of obtaining the binarization threshold in one embodiment. The terminal 102 can calculate the binarization threshold based on the maximum inter-class variance method. The terminal 102 can set the size of the image to be identified to M*N, the binarization threshold to T, and the terminal 102 can set the number of pixels in the image with a grayscale value less than T to N0, and their average grayscale μ0, the number of pixels in the image with a grayscale value greater than T to N1, and their average grayscale μ1, and set the ratio of N0 to the total number of pixels The proportion of N1 to the total number of pixels Total average gray level μ = w0 × μ0 + w1 × μ1, inter-class variance g = w0 (μ0-μ) 2 +w1(μ1-μ) 2 After simplification, the inter-class variance is g = w0×w1(μ0-μ1) 2 , traverse in the range of [0, 255], and obtain the threshold T that maximizes the inter-class variance g as the binarization threshold.
[0069] The above-mentioned binarization threshold value may also be different based on different visible light acquisition devices. For example, in one embodiment, it further includes: if the image to be identified includes a first sub-image to be identified, when it is detected that the binarization threshold value corresponding to the first sub-image to be identified is less than the preset visible light threshold value, the binarization threshold value of the second sub-image to be identified is used as the binarization threshold value of the first sub-image to be identified. In this embodiment, Figure 3 As shown, the terminal 102 can compare the binarization threshold obtained based on the sub-image to be identified collected by the bottom camera, that is, the first visible light acquisition device, with the minimum daytime threshold. If the binarization threshold is less than the minimum daytime threshold, the terminal 102 can use the average value of the binarization threshold of the sub-image to be identified collected by the second visible light acquisition device as the binarization threshold of the first sub-image to be identified; if it is greater than or equal to, the terminal 102 uses the binarization threshold obtained based on the first sub-image to be identified as the binarization threshold of the first sub-image to be identified. Among them, the minimum daytime threshold can be the minimum value of the daytime light intensity that does not affect wildfire monitoring, and the value is set according to actual conditions; that is, the above-mentioned bottom camera can capture the sky, so as to determine whether the binarization threshold is less than the minimum daytime threshold based on the brightness of the sky. The above-mentioned second visible light acquisition device can have two left and right acquisition devices, and the terminal 102 can use the average value of the binarization thresholds obtained based on the sub-image to be identified collected by the two acquisition devices as the final binarization threshold.
[0070] Through the above embodiment, the terminal 102 can obtain the binarization threshold of each sub-image to be identified based on the maximum inter-class variance method, so that the terminal 102 can perform wildfire identification monitoring based on the binarization threshold, thereby improving the monitoring efficiency of wildfire monitoring.
[0071] In one embodiment, according to a binarization threshold, a binarized image corresponding to the image to be identified is obtained, and a wildfire area to be identified is determined from the binarized image, including: converting pixels in the image to be identified whose grayscale values are greater than or equal to the binarization threshold into a first value, and converting pixels in the image to be identified whose grayscale values are less than the binarization threshold into a second value, to obtain a binarized image; the first value is different from the second value; traversing the binarized image based on a stack of a preset size, to obtain a plurality of areas in the image to be identified composed of pixels corresponding to the first value; for each area, detecting whether the number of pixels in the area is greater than or equal to a preset pixel threshold; if so, treating the area as a wildfire area to be identified.
[0072] In this embodiment, the terminal 102 can obtain a binary image of the image to be identified based on the binarization threshold. For the image to be identified, the terminal 102 can obtain the gray value of each pixel in the image to be identified, and set the pixels whose gray value is greater than or equal to the binarization threshold as the first value, and convert the pixels whose gray value in the image to be identified is less than the binarization threshold into the second value, so that the terminal 102 can obtain the converted binary image, wherein the first value can be 1 and the second value can be 0. In addition, the terminal 102 can also traverse the binary image based on a stack of a preset size, so as to obtain multiple regions composed of pixels corresponding to the first value in the image to be identified based on the traversal results. For each region, the terminal 102 can detect whether the number of pixels in the region is greater than the preset pixel threshold. If so, the terminal 102 can use the region as a wildfire region to be identified.
[0073] Among them, since the above-mentioned image to be identified includes multiple sub-images to be identified, the terminal 102 can perform binarization processing on each sub-image to be identified and determine the wildfire area to be identified. For example, the terminal 102 can perform binarization processing on the grayscale images output by the three cameras after obtaining the binarization threshold, and the formula is as follows:
[0074]
[0075] Among them, F(i, j) is the pixel value after binarization, Gray(i, j) is the original grayscale value of the image, and Gray this the binarization threshold. After the terminal 102 performs binarization processing on the image to be identified, it can also calculate the connected area, that is, the terminal 102 needs to identify the connected area composed of continuous values 1 in the binary image. The terminal 102 can first find the first pixel with a value of "1" in the binary image, push it into the stack and mark it as visited; take the stack being empty as the end condition, find the pixel with a value of "1" in the four neighborhoods adjacent to the top element of the stack, and push them into the stack, and delete the top element of the stack after the end; when the stack is empty, it indicates that a connected area has been traversed, and the terminal 102 needs to continue to find the next pixel with a value of "1" and has not been visited as the starting point and push it into the stack. The terminal 102 can repeat the above steps until all the pixels with a value of "1" are visited. After the terminal 102 completes the marking of the above connected areas, the connected areas in which the total number of pixels is less than p can be filtered out. The p value can be determined according to the actual situation. The remaining connected areas after filtering can be used as the wildfire areas to be identified.
[0076] Through this embodiment, the terminal 102 can binarize the image to be identified based on the binarization threshold, and traverse the binarized image to determine the area where the wildfire may occur, thereby improving the accuracy and efficiency of wildfire monitoring in the power transmission line.
[0077] In one embodiment, the color means and color ratios of the pixels in the to-be-identified wildfire area in each channel of the RGB color space are obtained, including: for each color channel in the RGB color space, the color value of the pixel in the to-be-identified wildfire area under the color channel is obtained, and the color mean corresponding to the color channel is obtained according to the ratio of the color values of multiple pixels to the total number of pixels in the to-be-identified wildfire area; for each pixel in the to-be-identified wildfire area, the color values of multiple color channels corresponding to the pixel are obtained, and the color ratio of each color channel corresponding to the pixel is determined according to the ratio of each color value to the color values of multiple color channels.
[0078] In this embodiment, terminal 102 can obtain the color value of the pixel in the wildfire area to be identified under the color channel based on each color channel in the RGB color space, and obtain the color mean corresponding to the color channel based on the ratio of the color values of multiple pixels to the total number of pixels in the wildfire area to be identified.
[0079] Specifically, Figure 4 As shown, Figure 4The figure is a flowchart of the steps for monitoring a wildfire area in an embodiment. Since the RGB color space has three color channels, R, G, and B, the terminal 102 can obtain the color means corresponding to the three color channels respectively. The terminal 102 can first obtain the target color mean as a reference object by feature training. The terminal 102 may first need to perform feature processing on the images of the flame part in a large number of wildfire pictures to find the mean of each channel of R, G, and B. The formula is as follows:
[0080]
[0081]
[0082]
[0083] Among them, R(x i ,y i )、G(x i ,y i )、B(x i ,y i ) is the pixel at (x i ,y i ) at the R, G, and B channels, R m , G m , B m is the mean value of each channel, k is the total number of pixels in the flame part, that is, the total number of pixels in the above-mentioned wildfire area to be identified. Then the terminal 102 can obtain the target color mean value and the color mean value corresponding to the above-mentioned wildfire area to be identified based on the above formula.
[0084] The terminal 102 may also obtain the color ratio of each color channel in the wildfire area to be identified. For each pixel in the wildfire area to be identified, the terminal 102 may obtain the color values of multiple color channels corresponding to the pixel, and determine the color ratio of each color channel corresponding to the pixel based on the ratio of each color value to the color values of the multiple color channels.
[0085] Specifically, since the RGB color space has three color channels, R, G, and B, the terminal 102 can obtain the corresponding color ratios under the three color channels respectively. For example, the terminal 102 can first determine the target color ratio between the target colors by means of feature training using the parameters for obtaining the target color mean as described above. The formula is as follows:
[0086]
[0087]
[0088]
[0089] r≥k1g+m1,r≤k2g+m2
[0090] r≥k3b+m3,r≤k4b+m4
[0091] g ≥ k5b + m5, r ≤ k6b + m6
[0092] Among them, k * With m * (*∈[1,6]) is the linear coefficient of the fitting, that is, the terminal 102 can use the above formula to first calculate the ratio of the color value of each color channel to the color value of the sample wildfire area to be identified using the sample image to be identified, and construct a size relationship based on the target color ratio between the color values, and present it in the form of a fitting function. The terminal 102 can calculate the target color ratio of the sample image to be identified through the above formula, and can also calculate the color ratio of the image to be identified, so that the terminal 102 can determine whether a wildfire has occurred in the wildfire area to be identified through the similarity between the target color ratio and the color ratio of the wildfire area to be identified.
[0093] Through this embodiment, the terminal 102 can obtain the color mean and color ratio of the wildfire area to be identified by calculating the color value based on the RGB color space, so that the terminal 102 can identify the wildfire in the image to be identified based on the color mean and color ratio, thereby improving the accuracy and efficiency of wildfire monitoring time.
[0094] In one embodiment, wildfires in an image to be identified are monitored based on a first similarity between a color mean and a target color mean, and based on a second similarity between a size relationship between a plurality of color ratios and a size relationship between a plurality of target color ratios, including: for each color channel in an RGB color space, obtaining a first similarity between a color mean corresponding to the color channel and a target color mean corresponding to the color channel in a wildfire area to be identified; determining corresponding linear coefficients based on target size relationships corresponding to a plurality of target color ratios; determining size relationships corresponding to a plurality of color ratios based on a plurality of color ratios and linear coefficients, and obtaining a second similarity between the size relationships and the target size relationships; if in a wildfire area to be identified, the number of pixels whose first similarity is greater than a first similarity threshold and whose second similarity is greater than a second similarity threshold is greater than a preset value, it is determined that a wildfire has occurred in the wildfire area to be identified.
[0095] In this embodiment, for each color channel in the RGB color space, the terminal 102 can obtain the first similarity of the mean value corresponding to the color channel and the target color mean value corresponding to the color channel in the above-mentioned wildfire area to be identified, determine the corresponding linear function, and the terminal 102 can determine the size relationship corresponding to multiple color ratios according to the above-mentioned color ratio and linear coefficient, and obtain the second similarity of the size relationship and the target size relationship. Among them, the target size relationship can be the size relationship between the target color ratios. The terminal 102 can detect the wildfire area to be identified in multiple wildfire areas to be identified, where the first similarity is greater than the first similarity threshold, and the number of pixels whose second similarity is greater than the second similarity threshold is greater than the preset value, so that the terminal 102 can determine these wildfire areas to be identified as areas where wildfires occur. Specifically, after obtaining the mean and ratio relationship of each RGB channel, the terminal 102 can traverse the pixel points in the above-mentioned connected area to determine whether it is a flame image. If more than q percent of the areas in the connected area meet the above-mentioned judgment conditions for the first similarity and the second similarity, it is determined that a wildfire occurs in the area, and q is determined by the actual situation.
[0096] Through this embodiment, the terminal 102 can determine the area where the wildfire occurs in the image to be identified based on the color mean and color ratio of the RGB color channels, thereby improving the efficiency and accuracy of wildfire monitoring.
[0097] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0098] Based on the same inventive concept, the embodiment of the present application also provides a transmission line wildfire monitoring device for implementing the above-mentioned transmission line wildfire monitoring method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more transmission line wildfire monitoring device embodiments provided below can refer to the limitations of the transmission line wildfire monitoring method above, and will not be repeated here.
[0099] In one embodiment, Figure 5As shown, a transmission line wildfire monitoring device is provided, comprising: a first acquisition module 500, a second acquisition module 502, a determination module 504 and a monitoring module 506, wherein:
[0100] The first acquisition module 500 is used to acquire the image to be identified sent by the sensor arranged on the power transmission line.
[0101] The second acquisition module 502 is used to acquire the gray value of the image to be identified, and determine the binarization threshold according to the inter-class variance corresponding to the gray value.
[0102] The determination module 504 is used to obtain a binary image corresponding to the image to be identified according to a binary threshold value, and determine the wildfire area to be identified from the binary image.
[0103] Monitoring module 506 is used to obtain the color mean and color ratio of each channel of the pixels in the wildfire area to be identified in the RGB color space, and monitor the wildfire in the image to be identified based on a first similarity between the color mean and the target color mean, and based on a second similarity between the size relationship between multiple color ratios and the size relationship between multiple target color ratios; the target color mean and target color ratio are calculated based on a sample image containing the wildfire area.
[0104] In one embodiment, the above-mentioned first acquisition module 500 is specifically used to acquire a first sub-image to be identified sent by a first visible light acquisition device; the first visible light acquisition device is used to acquire images above the transmission line; acquire a second sub-image to be identified sent by a second visible light acquisition device; the second visible light acquisition device is used to acquire images on both sides of the transmission line; and obtain an image to be identified based on the first sub-image to be identified and the second sub-image to be identified.
[0105] In one embodiment, the second acquisition module 502 is specifically used to obtain, for each sub-image to be identified in the image to be identified, a first average grayscale corresponding to a first pixel in the sub-image to be identified whose grayscale value is less than a binarization threshold to be determined, and a first ratio of the first pixel to the total pixels in the sub-image to be identified; obtain a second average grayscale corresponding to a second pixel in the sub-image to be identified whose grayscale value is greater than or equal to the binarization threshold to be determined, and obtain a second ratio of the second pixel to the total pixels in the sub-image to be identified; obtain the square of the difference between the first average grayscale and the second average grayscale, obtain a first product of the square and the second ratio, and construct an inter-class variance function corresponding to the binarization threshold to be determined based on the first product and the second product of the first ratio.
[0106] In one embodiment, the above-mentioned device also includes: a judgment module, which is used to use the binarization threshold of the second sub-image to be identified as the binarization threshold of the first sub-image to be identified if the image to be identified includes a first sub-image to be identified, when it is detected that the binarization threshold corresponding to the first sub-image to be identified is less than a preset visible light threshold.
[0107] In one embodiment, the above-mentioned determination module 504 is specifically used to convert pixels in the image to be identified whose grayscale values are greater than or equal to the binarization threshold into a first value, and convert pixels in the image to be identified whose grayscale values are less than the binarization threshold into a second value, to obtain a binary image; the first value is different from the second value; the binary image is traversed based on a stack of a preset size to obtain multiple areas in the image to be identified that are composed of pixels corresponding to the first value; for each area, detect whether the number of pixels in the area is greater than or equal to the preset pixel threshold; if so, use the area as a wildfire area to be identified.
[0108] In one embodiment, the above-mentioned monitoring module 506 is specifically used to obtain, for each color channel in the RGB color space, the color value of the pixel in the wildfire area to be identified under the color channel, and obtain the color mean corresponding to the color channel according to the ratio of the color values of multiple pixels to the total number of pixels in the wildfire area to be identified; for each pixel in the wildfire area to be identified, obtain the color values of multiple color channels corresponding to the pixel, and determine the color ratio of each color channel corresponding to the pixel according to the ratio of each color value to the color values of multiple color channels.
[0109] In one embodiment, the above-mentioned monitoring module 506 is specifically used to obtain, for each color channel in the RGB color space, a first similarity between the color mean corresponding to the color channel and the target color mean corresponding to the color channel in the wildfire area to be identified; determine the corresponding linear coefficient according to the target size relationship corresponding to multiple target color ratios; determine the size relationship corresponding to multiple color ratios according to multiple color ratios and linear coefficients, and obtain a second similarity between the size relationship and the target size relationship; if in the wildfire area to be identified, the number of pixels whose first similarity is greater than the first similarity threshold and whose second similarity is greater than the second similarity threshold is greater than a preset value, it is determined that a wildfire has occurred in the wildfire area to be identified.
[0110] Each module in the above-mentioned power transmission line wildfire monitoring device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0111] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for monitoring forest fires on a power transmission line is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0112] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0113] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above-mentioned power transmission line wildfire monitoring method when executing the computer program.
[0114] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned power transmission line wildfire monitoring method is implemented.
[0115] In one embodiment, a computer program product is provided, including a computer program, which implements the above-mentioned power transmission line wildfire monitoring method when executed by a processor.
[0116] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0117] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0118] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0119] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for monitoring wildfires on power transmission lines, characterized in that: The method comprises: Acquire an image to be identified sent by a sensor arranged on a power transmission line; Obtaining the grayscale value of the image to be identified, and determining a binarization threshold according to the inter-class variance corresponding to the grayscale value; According to the binarization threshold, a binarized image corresponding to the image to be identified is obtained, and a wildfire area to be identified is determined from the binarized image; Obtaining color means and color ratios of pixels in the wildfire area to be identified in each channel of the RGB color space, and monitoring the wildfire in the image to be identified based on a first similarity between the color mean and a target color mean, and based on a second similarity between a size relationship between a plurality of the color ratios and a size relationship between a plurality of target color ratios; the target color mean and the target color ratio are calculated based on a sample image containing a wildfire area; The obtaining of the color mean and color ratio of each channel of the pixels in the to-be-identified wildfire area in the RGB color space includes: for each color channel in the RGB color space, obtaining the color value of the pixel in the to-be-identified wildfire area under the color channel, and obtaining the color mean corresponding to the color channel according to the ratio of the sum of the color values of multiple pixels to the total number of pixels in the to-be-identified wildfire area; for each pixel in the to-be-identified wildfire area, obtaining the color values of multiple color channels corresponding to the pixel, and determining the color ratio of each color channel corresponding to the pixel according to the ratio of each color value to the sum of the color values of the multiple color channels; The method of monitoring the wildfire in the image to be identified based on the first similarity between the color mean and the target color mean, and based on the second similarity between the size relationship between the multiple color ratios and the size relationship between the multiple target color ratios, includes: for each color channel in the RGB color space, obtaining the first similarity between the color mean corresponding to the color channel and the target color mean corresponding to the color channel in the wildfire area to be identified; determining the corresponding linear coefficient based on the target size relationship corresponding to the multiple target color ratios; determining the size relationship corresponding to the multiple color ratios based on the multiple color ratios and the linear coefficients, and obtaining the second similarity between the size relationship and the target size relationship; if in the wildfire area to be identified, the number of pixels whose first similarity is greater than the first similarity threshold and whose second similarity is greater than the second similarity threshold is greater than a preset value, it is determined that a wildfire has occurred in the wildfire area to be identified.
2. The method according to claim 1, characterized in that The sensor is connected to a plurality of visible light collection devices; the plurality of visible light collection devices are respectively used to collect images to be identified in different directions of the transmission line; The step of acquiring an image to be identified sent by a sensor disposed on a power transmission line comprises: Acquire a first sub-image to be identified sent by a first visible light acquisition device; the first visible light acquisition device is used to acquire an image above the power transmission line; Acquire a second sub-image to be identified sent by a second visible light acquisition device; the second visible light acquisition device is used to acquire images on both sides of the transmission line; The image to be recognized is obtained according to the first sub-image to be recognized and the second sub-image to be recognized.
3. The method according to claim 2, characterized in that The step of obtaining the grayscale value of the image to be identified and determining a binarization threshold value according to the inter-class variance corresponding to the grayscale value includes: For each sub-image to be identified in the image to be identified, obtaining a first average grayscale corresponding to a first pixel in the sub-image to be identified whose grayscale value is less than a binarization threshold to be determined, and obtaining a first ratio of the first pixel to the total pixels in the sub-image to be identified; Obtaining a second average grayscale corresponding to a second pixel whose grayscale value is greater than or equal to the to-be-determined binarization threshold in the sub-image to be identified, and obtaining a second ratio of the second pixel to the total pixels in the sub-image to be identified; Obtaining a square of a difference between the first average grayscale and the second average grayscale, obtaining a first product of the square and the second ratio, and constructing an inter-class variance function corresponding to the to-be-determined binarization threshold according to the first product and the second product of the first ratio; Obtaining the maximum value of the inter-class variance function as the binarization threshold; Also includes: If the image to be identified includes a first sub-image to be identified, when it is detected that the binarization threshold corresponding to the first sub-image to be identified is less than a preset visible light threshold, the binarization threshold of the second sub-image to be identified is used as the binarization threshold of the first sub-image to be identified.
4. The method according to claim 1, characterized in that: The step of obtaining a binary image corresponding to the image to be identified according to the binary threshold, and determining a wildfire area to be identified from the binary image includes: Converting pixels in the image to be identified whose grayscale values are greater than or equal to the binarization threshold into a first value, and converting pixels in the image to be identified whose grayscale values are less than the binarization threshold into a second value, to obtain a binarized image; the first value is different from the second value; Traversing the binary image based on a stack of a preset size to obtain a plurality of regions consisting of pixels corresponding to the first value in the image to be identified; For each of the areas, detect whether the number of pixels in the area is greater than or equal to a preset pixel threshold; if so, use the area as the wildfire area to be identified.
5. A transmission line forest fire monitoring device, characterized in that: The device comprises: A first acquisition module, used to acquire an image to be identified sent by a sensor arranged on a power transmission line; A second acquisition module is used to acquire the grayscale value of the image to be identified, and determine a binarization threshold according to the inter-class variance corresponding to the grayscale value; A determination module, used to obtain a binary image corresponding to the image to be identified according to the binary threshold, and determine the wildfire area to be identified from the binary image; A monitoring module, for obtaining the color mean and color ratio of the pixels in the wildfire area to be identified in each channel of the RGB color space, and monitoring the wildfire in the image to be identified based on a first similarity between the color mean and the target color mean, and a second similarity between the size relationship between multiple color ratios and the size relationship between multiple target color ratios; the target color mean and the target color ratio are calculated based on a sample image containing a wildfire area; specifically for: for each color channel in the RGB color space, obtaining the color value of the pixel in the wildfire area to be identified under the color channel, and obtaining the color mean corresponding to the color channel based on the ratio of the sum of the color values of multiple pixels to the total number of pixels in the wildfire area to be identified; for each pixel in the wildfire area to be identified, obtaining the color value of the pixel corresponding to the pixel The color values of multiple color channels are determined, and the color ratio of each color channel corresponding to the pixel is determined according to the ratio of each color value to the sum of the color values of the multiple color channels; for each color channel in the RGB color space, a first similarity between the color mean corresponding to the color channel and the target color mean corresponding to the color channel in the wildfire area to be identified is obtained; according to the target size relationship corresponding to the multiple target color ratios, a corresponding linear coefficient is determined; according to the multiple color ratios and the linear coefficients, a size relationship corresponding to the multiple color ratios is determined, and a second similarity between the size relationship and the target size relationship is obtained; if in the wildfire area to be identified, the number of pixels whose first similarity is greater than the first similarity threshold and whose second similarity is greater than the second similarity threshold is greater than a preset value, it is determined that a wildfire has occurred in the wildfire area to be identified.
6. The device according to claim 5, characterized in that The sensor is connected to a plurality of visible light collection devices; the plurality of visible light collection devices are respectively used to collect images to be identified in different directions of the transmission line; The first acquisition module is specifically used to: Acquire a first sub-image to be identified sent by a first visible light acquisition device; the first visible light acquisition device is used to acquire an image above the power transmission line; Acquire a second sub-image to be identified sent by a second visible light acquisition device; the second visible light acquisition device is used to acquire images on both sides of the transmission line; The image to be recognized is obtained according to the first sub-image to be recognized and the second sub-image to be recognized.
7. The device according to claim 6, characterized in that The second acquisition module is specifically used for: For each sub-image to be identified in the image to be identified, obtaining a first average grayscale corresponding to a first pixel in the sub-image to be identified whose grayscale value is less than a binarization threshold to be determined, and obtaining a first ratio of the first pixel to the total pixels in the sub-image to be identified; Obtaining a second average grayscale corresponding to a second pixel whose grayscale value is greater than or equal to the to-be-determined binarization threshold in the sub-image to be identified, and obtaining a second ratio of the second pixel to the total pixels in the sub-image to be identified; Obtaining a square of a difference between the first average grayscale and the second average grayscale, obtaining a first product of the square and the second ratio, and constructing an inter-class variance function corresponding to the to-be-determined binarization threshold according to the first product and the second product of the first ratio; The maximum value of the inter-class variance function is obtained as the binarization threshold.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
