Liquid leakage detection method and device
By using grayscale image processing and fitting function model enhancement in liquid-cooled cooling technology, efficient and accurate detection of liquid leakage in liquid-cooled cooling system is achieved, and the problems of high detection cost and low accuracy in the prior art are solved. .
Patent Information
- Application Number
- CN202411596991.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-18
AI Technical Summary
The existing liquid-cooled and heat dissipation technology has high cost and low accuracy in liquid leakage detection, and relies on manual inspection or special equipment to capture the changes in the coolant.
By obtaining the grayscale image of the area to be tested, comparing the images at any two adjacent moments, constructing the quantity difference sequence, constructing a fit function model based on the quantity difference sequence, pixel enhancement of the image, and dividing it into the first area and the first area In the second area, obtain the image enhancement score value and output the alarm signal based on the score value and area proportion.
It reduces the cost of leak detection, improves the accuracy of detection, reduces the workload of manual detection, and can capture changes in heat-dissipating liquid flow or water droplets in real time.
Smart Images

Figure CN119477865A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of liquid cooling and heat dissipation, and in particular to a liquid leakage detection method and device. Background Art
[0002] High-voltage cascade energy storage systems have the advantages of high conversion efficiency, large single-machine capacity, no circulation, and fast dispatch response. They are widely used in the energy field. Among them, high-voltage cascade energy storage systems contain multiple energy storage battery clusters. Liquid cooling technology is needed to cool and reduce the energy of each energy storage battery cluster to maintain the temperature inside the energy storage battery cluster and better provide a temperature environment for the operation of the high-voltage cascade energy storage system. However, there are a large number of energy storage battery clusters in the high-voltage cascade energy storage system, and the heat dissipation demand is large, and there is a risk of liquid leakage.
[0003] In existing liquid cooling technology, leakage detection usually relies on manual inspections or the use of specialized detection equipment to capture changes in the coolant, relying on changes in pixels in the image to confirm whether there is a cooling liquid leak in the current location. This results in high detection costs and low detection accuracy. Summary of the invention
[0004] Based on this, it is necessary to provide a leakage detection method and device that can reduce detection costs and improve detection accuracy in response to the above technical problems.
[0005] In a first aspect, the present application provides a liquid leakage detection method, the method comprising:
[0006] Obtain a grayscale image corresponding to the area to be measured, compare the pixels of any two images obtained at adjacent moments in the grayscale image, obtain the pixel difference corresponding to each grayscale image, and construct a quantity difference sequence based on the pixel difference;
[0007] A fitting function model is constructed according to the sequence of quantity difference values, and the fitting function model is used to perform pixel enhancement on the grayscale image to obtain an enhanced image;
[0008] Dividing the enhanced image into a first area and a second area based on a grayscale threshold;
[0009] Obtaining a first grayscale value corresponding to each pixel in the first area and a second grayscale value corresponding to each pixel in the second area, and obtaining an image enhancement score value corresponding to the enhanced image according to the first grayscale value and the second grayscale value;
[0010] If the image enhancement score value is less than the preset standard value, the fitting function model is adjusted, and the step of using the fitting function model to perform pixel enhancement on the grayscale image is returned to be executed; if the image enhancement score value is greater than or equal to the preset standard value, the enhanced image is determined as the target image;
[0011] The proportion of the first area in the target image is obtained, and when the proportion is greater than a preset ratio, an alarm signal is output.
[0012] In one embodiment, comparing pixels of any two grayscale images acquired at adjacent moments to obtain pixel differences corresponding to the grayscale images includes:
[0013] Extract the pixel value corresponding to each color channel in the grayscale image, and perform weighted processing on the pixel value to obtain the weighted pixel value corresponding to each pixel point in the grayscale image;
[0014] Obtain the difference between the weighted pixel values corresponding to any two images acquired at adjacent moments in the grayscale image, and use the absolute value of the difference as the pixel difference;
[0015] The quantity difference sequence is constructed based on the pixel difference, including:
[0016] The pixel differences are sorted from small to large, and the sorted pixel differences are used as the quantity difference value sequence.
[0017] In one embodiment, constructing a fitting function model according to the quantity difference sequence includes:
[0018] The quantity difference sequence is divided into a first sub-category sequence and a second sub-category sequence according to the sequence number value; wherein the number of the sequence number values is multiple, and the number of the sequence number values is determined by the number of each pixel point in the grayscale image;
[0019] Subtract the standard deviation corresponding to each pixel difference in the first subclass sequence from the standard deviation corresponding to each pixel difference in the second subclass sequence to obtain the subclass difference corresponding to the sequence number value;
[0020] Repeat the above steps of dividing the quantity difference sequence into the first subclass sequence and the second subclass sequence according to the sequence number value until the subclass differences corresponding to all sequence number values are obtained, and construct the subclass difference sequence based on the subclass differences corresponding to the sequence number values;
[0021] Select the maximum value in the subclass difference sequence and build a fitting function model based on the maximum value.
[0022] In one embodiment, the pixel enhancement of the grayscale image is performed using a fitting function model to obtain an enhanced image, including:
[0023] The pixel difference corresponding to the grayscale image is input into the fitting function model to perform pixel enhancement to obtain an enhanced image.
[0024] In one embodiment, the enhanced image is divided into a first area and a second area based on a grayscale threshold, including:
[0025] Obtaining an enhanced pixel value corresponding to each pixel point in the enhanced image, comparing the enhanced pixel value with a grayscale threshold, and dividing each pixel point in the enhanced image into a first area or a second area according to a result of the comparison;
[0026] The pixel value corresponding to each pixel point in the first area is set to a first value, and the pixel value corresponding to each pixel point in the second area is set to a second value.
[0027] In one embodiment, the method further comprises:
[0028] Based on the maximization of the between-class variance method, the first region and the second region, a grayscale threshold is obtained.
[0029] In one embodiment, obtaining an image enhancement score value corresponding to the enhanced image according to the first grayscale value and the second grayscale value includes:
[0030] Using a triple standard deviation method to perform data elimination on each first grayscale value and each second grayscale value, and obtaining a first average value and a first standard deviation of each first grayscale value after the data elimination, and a second average value and a second standard deviation of each second grayscale value after the data elimination;
[0031] An image enhancement score value is determined based on the first mean, the first standard deviation, the second mean, and the second standard deviation.
[0032] In one embodiment, adjusting the fitting function model includes:
[0033] Adjust the constant term of the fitted function model according to the increment constant.
[0034] In a second aspect, the present application also provides a liquid leakage detection device, the device comprising:
[0035] An acquisition module is used to acquire a grayscale image corresponding to the area to be measured, compare the pixels of any two images acquired at adjacent moments in the grayscale image, obtain the pixel difference corresponding to each grayscale image, and construct a quantity difference sequence based on the pixel difference;
[0036] The enhancement module is used to construct a fitting function model according to the quantity difference sequence, and use the fitting function model to perform pixel enhancement on the grayscale image to obtain an enhanced image;
[0037] A region division module, used for dividing the enhanced image into a first region and a second region based on a grayscale threshold;
[0038] A scoring module, used to obtain a first grayscale value corresponding to each pixel in the first area and a second grayscale value corresponding to each pixel in the second area, and obtain an image enhancement scoring value corresponding to the enhanced image according to the first grayscale value and the second grayscale value;
[0039] A comparison module, for adjusting the fitting function model if the image enhancement score value is less than a preset standard value, and returning to execute the step of using the fitting function model to perform pixel enhancement on the grayscale image; if the image enhancement score value is greater than or equal to the preset standard value, determining the enhanced image as the target image;
[0040] The output module is used to obtain the proportion of the first area in the target image, and output an alarm signal when the proportion is greater than a preset ratio.
[0041] In a third aspect, the present application further 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.
[0042] The above-mentioned leakage detection method and device compare the grayscale images and the retrograde pixels obtained at any two adjacent moments to obtain the pixel difference corresponding to each grayscale image and construct a quantity difference value sequence, construct a fitting function model based on the quantity difference value sequence, and use the fitting function model to perform pixel enhancement on the grayscale image to obtain an enhanced image, divide the enhanced image into a first area and a second area based on a grayscale threshold, obtain the image enhancement score value corresponding to the enhanced image according to the first grayscale value corresponding to each pixel point in the first area and the second grayscale value corresponding to each pixel point in the second area, and when the image enhancement score value is greater than or equal to the preset standard value and the proportion of the first area in the image is greater than the preset ratio, output Alarm signal; the present application compares the pixels of images acquired at any two adjacent moments in the grayscale image to capture the changes in the flow of heat dissipating liquid or water droplets in the test area, enhances the grayscale image using a fitting function model, and divides the enhanced image into a first area and a second area according to the grayscale threshold, so as to facilitate subsequent leakage detection. By obtaining the image enhancement score value corresponding to the enhanced image, when it is confirmed that the distinction between the first area and the second area is more obvious, that is, when the image enhancement score value is greater than or equal to the preset standard value, the leakage is detected according to the proportion of the first area in the target image, which reduces the workload of manual detection, reduces the detection cost and improves the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments of the present application or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0044] FIG1 is a schematic flow chart of a method for detecting a liquid leakage in one embodiment;
[0045] FIG2 is a structural block diagram of a liquid leakage detection device in one embodiment;
[0046] FIG. 3 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0049] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first grayscale value may be referred to as a second grayscale value, and similarly, a second grayscale value may be referred to as a first grayscale value. Both the first grayscale value and the second grayscale value are grayscale values, but they are not grayscale values of the same image.
[0050] It can be understood that the “connection” in the following embodiments should be understood as “electrical connection”, “communication connection”, etc. if the connected circuits, modules, units, etc. have electrical signals or data transmission between each other.
[0051] It can be understood that “at least one” means one or more, “plurality” means two or more, and “at least a portion of an element” means a part or all of an element.
[0052] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.
[0053] With the development of energy storage systems, liquid-cooled energy storage systems have become an emerging technology. Liquid-cooled energy storage systems contain more batteries, have large heat dissipation requirements, and have the risk of liquid leakage. The leakage monitoring system can realize detection and early warning functions, thereby improving equipment safety and operational reliability.
[0054] However, traditional leakage detection methods rely on manual inspections, which consumes a lot of manpower and material resources. On the other hand, special detection equipment is needed to capture changes in the coolant. The detection equipment must be maintained and repaired in the later stage. With the upgrading of image and video technology, the existing leakage monitoring system uses images to capture changes in the coolant. When liquid flows through a certain point in the orientation, the pixel points of the image will also change. The change of pixel points in the image is relied on to confirm whether there is a cooling liquid leak in the current orientation. However, relying solely on the change of pixel points is not enough to distinguish whether there is a cooling liquid leak in the current orientation, and there are problems of high detection cost and low detection accuracy.
[0055] The leakage detection method provided in the embodiment of the present application compares the pixels of images acquired at any two adjacent moments in the grayscale image to capture the changes in the flow of heat dissipating liquid or water droplets in the test area, enhances the grayscale image using a fitting function model, and divides the enhanced image into a first area and a second area according to a grayscale threshold, so as to facilitate subsequent leakage detection. By obtaining the image enhancement score value corresponding to the enhanced image, when it is confirmed that the distinction between the first area and the second area is relatively obvious, that is, when the image enhancement score value is greater than or equal to the preset standard value, the leakage is detected according to the proportion of the first area in the target image, thereby reducing the workload of manual detection, reducing the detection cost and improving the detection accuracy.
[0056] In an exemplary embodiment, as shown in FIG1 , a liquid leakage detection method is provided, and the method is described by taking the application of the method to a computer device as an example. The method includes:
[0057] S102, obtaining a grayscale image corresponding to the area to be measured, performing pixel comparison on any two images obtained at adjacent moments in the grayscale image, obtaining pixel differences corresponding to the grayscale images, and constructing a quantity difference sequence based on the pixel differences.
[0058] The area to be tested may be set according to actual conditions. In the embodiment of the present application, the condition of the heat dissipation liquid in the energy storage battery cluster in the high-voltage cascade energy storage system is taken as an example for explanation.
[0059] Specifically, a high-voltage cascade energy storage system includes a plurality of energy storage battery clusters, and the energy storage battery clusters are cooled and de-energized by liquid cooling technology. An image acquisition device, such as a camera, a drone, etc., is arranged in the high-voltage cascade energy storage system to take real-time video of the area to be tested, so as to facilitate the subsequent timely analysis of the detection of the heat dissipation liquid leakage through regular interval collection. The computer device acquires the real-time video output by the image acquisition device, and acquires a slice image in the real-time video according to a predetermined interception frequency and a fixed interval of the interception slice image, that is, an image of the heat dissipation liquid at a certain position (the area to be tested) in the battery pack of the high-voltage cascade energy storage system. The computer device converts the intercepted slice image into a grayscale image. Since the grayscale image is sorted according to the time of acquisition, the computer device calculates the pixel difference corresponding to each pixel point in two adjacent grayscale images, and constructs a quantity difference sequence based on the pixel difference. Among them, by using real-time video for dynamic detection, leakage events can be captured in real time, the workload of manual detection is reduced, and the detection efficiency and accuracy are improved. The interception frequency and the interval of the interception slice image can be adjusted according to different environments and needs.
[0060] Exemplarily, the interception frequency and the fixed interval period of intercepting the slice images can be set according to actual conditions. In the embodiment of the present application, the predetermined interception frequency is 20 seconds, two slice images are intercepted each time, and the fixed interval period is 2 seconds. Specifically, two slice images are intercepted every 20 seconds, and the interval between the two slice images is 2 seconds. Taking 12 o'clock as an example, the first image is intercepted at 12 o'clock, and the second image is intercepted 2 seconds later. The third image is intercepted after an interval of 20 seconds, and the fourth image is intercepted 2 seconds later. And so on. The slice images extracted in sequence are images acquired at adjacent moments.
[0061] It should be noted that when the RGB image captured from the real-time video is converted into a grayscale image, an 8-bit grayscale image is usually generated, and the value range of each pixel of the grayscale image finally generated is usually 0 to 255 (8 bits). At the same time, the size of the slice image captured each time is consistent, which is convenient for subsequent comparison. The way to convert the slice image into a grayscale image in the computer device can be set according to the actual situation. In the embodiment of this application, the use of the OpenCV library to read the slice image and convert it into a grayscale image is used as an example to illustrate, and other language codes can also be used to implement it, which is not limited in the embodiment of this application.
[0062] S104, constructing a fitting function model according to the quantity difference value sequence, and using the fitting function model to perform pixel enhancement on the grayscale image to obtain an enhanced image.
[0063] Specifically, the computer device constructs a fitting function model based on the sequence of quantity difference values. The fitting function model can be used to enhance key areas in image recognition. When detecting whether liquid is leaking, the grayscale image is enhanced by using the fitting function model to facilitate subsequent more accurate judgment of whether liquid is leaking, thereby improving the accuracy of leakage detection.
[0064] S106, dividing the enhanced image into a first area and a second area based on the grayscale threshold.
[0065] Among them, the grayscale threshold can be set according to actual conditions and is not limited in the embodiments of the present application.
[0066] Specifically, by enhancing the grayscale value of each pixel in the image, changes in the flow of heat dissipation liquid or water droplets, that is, areas with large changes in grayscale values, can be captured. These areas may correspond to the locations of water droplets or water flows, that is, leakage areas. The computer device binarizes the enhanced image through the grayscale threshold and divides it into the area through which the heat dissipation liquid flows (the first area) and the area through which the heat dissipation liquid does not flow (the second area).
[0067] S108, obtaining a first grayscale value corresponding to each pixel in the first area and a second grayscale value corresponding to each pixel in the second area, and obtaining an image enhancement score value corresponding to the enhanced image according to the first grayscale value and the second grayscale value.
[0068] Specifically, the image enhancement score value is used to quantify the effect of image enhancement and evaluate whether the pixel value distributions of the first area and the second area are clearly distinguished. The computer device obtains the image enhancement score value corresponding to the enhanced image based on the first grayscale value and the second grayscale value.
[0069] It should be noted that under the condition of grayscale (single channel), the grayscale value is equal to the pixel value. Therefore, when the two adjacent slice images captured in the embodiment of the present application are converted into grayscale images, the pixel, pixel value, and grayscale value of the pixel point are all numerical values, which will be expressed according to different situations.
[0070] S110, if the image enhancement score value is less than the preset standard value, adjust the fitting function model and return to the step of performing pixel enhancement on the grayscale image using the fitting function model; if the image enhancement score value is greater than or equal to the preset standard value, determine the enhanced image as the target image.
[0071] Among them, the preset standard value can be set according to actual conditions. In the embodiment of the present application, the preset standard value is taken as an example of any value within the range of 0.75 to 1.
[0072] Specifically, the result value range of the image enhancement score is 0 to 1. When the image enhancement score is close to 1, the more significant the image enhancement result is, which means that the grayscale value distribution range of the pixels in the current first area and the grayscale value distribution range of the inner pixels in the second area almost do not overlap; conversely, the closer the image enhancement score is to 0, the weaker the image enhancement result is, which means that the grayscale value distribution range of the pixels in the current first area and the grayscale value distribution range of the inner pixels in the second area highly overlap, and it is necessary to optimize the grayscale value distribution of the first area and the second area by adjusting the fitting function model, so as to improve the image enhancement effect.
[0073] The computer device compares the image enhancement score value with the preset standard value. If the image enhancement score value is greater than or equal to the preset standard value, it means that the image enhancement effect has met the requirements and there is no need to update the fitting function model. The enhanced image is determined as the target image. If the image enhancement score value is less than the preset standard value, it means that the image enhancement effect has not met the requirements and the fitting function model needs to be updated.
[0074] S112, obtaining a proportion of the first area in the target image, and outputting an alarm signal when the proportion is greater than a preset ratio.
[0075] Among them, the preset ratio can be set according to actual conditions. In the embodiment of the present application, the preset ratio is taken as an arbitrary value within a range of 2.5% to 3% as an example for explanation.
[0076] Specifically, the computer device obtains the proportion of the first area in the target image. When the proportion of the first area in the entire target image exceeds a pre-set area ratio (preset ratio), it is considered that there is leakage, an alarm is triggered, and an alarm signal is output. The alarm signal can indicate that the user is notified in time through the alarm buzzer set in the high-voltage cascade energy storage system, or the display screen of the high-voltage cascade energy storage system plays a conspicuous micro video in a loop to prompt the user to respond quickly, or it is sent to the user terminal, which is not limited in the embodiments of the present application.
[0077] In the above leakage detection method, by comparing the pixels of the images acquired at any two adjacent moments in the grayscale image, the changes in the flow of the heat dissipating liquid or the water droplets in the test area are captured, the grayscale image is enhanced by a fitting function model, and the enhanced image is divided into a first area and a second area according to the grayscale threshold, so as to facilitate the subsequent leakage detection. By obtaining the image enhancement score value corresponding to the enhanced image, when it is confirmed that the distinction between the first area and the second area is more obvious, that is, when the image enhancement score value is greater than or equal to the preset standard value, the leakage detection is realized according to the proportion of the first area in the target image, which reduces the workload of manual detection, reduces the detection cost and improves the detection accuracy.
[0078] In one embodiment, comparing pixels of any two grayscale images acquired at adjacent moments to obtain pixel differences corresponding to the grayscale images includes:
[0079] Extract the pixel value corresponding to each color channel in the grayscale image, and perform weighted processing on the pixel value to obtain the weighted pixel value corresponding to each pixel point in the grayscale image;
[0080] Obtain the difference between the weighted pixel values corresponding to any two images acquired at adjacent moments in the grayscale image, and use the absolute value of the difference as the pixel difference;
[0081] The quantity difference sequence is constructed based on the pixel difference, including:
[0082] The pixel differences are sorted from small to large, and the sorted pixel differences are used as the quantity difference value sequence.
[0083] Specifically, the computer device extracts the pixel value corresponding to each color channel in the grayscale image, wherein the method of extracting the pixel value corresponding to each color channel in the image can be set according to actual conditions, and is not limited in the embodiment of the present application. For example, the computer device extracts the pixel value R of the red channel, the pixel value G of the green channel, and the pixel value B of the blue channel in the grayscale image, and performs weighted processing on each pixel value according to the following formula (1):
[0084] I gray = 0.2989×R+0.5870×G+0.1140×B(1);
[0085] Among them, I gray is the weighted pixel value; the computer device calculates the weighted pixel value corresponding to each pixel in the grayscale image according to the above formula (1), and calculates the difference between any two adjacent grayscale images I1 and any pixel t in the grayscale image I2, and takes the absolute value of the difference as the pixel difference, and arranges the pixel differences in ascending order from small to large, so as to obtain the quantity difference sequence V; the pixel difference is obtained as shown in the following formula (2):
[0086] D t = |I 1t – I 2t |(2);
[0087] Among them, D t is the pixel difference; I 1t is the weighted pixel value corresponding to any pixel point t in the grayscale image I1; 2t is the weighted pixel value corresponding to any pixel point t in the grayscale image I2.
[0088] It should be noted that the purpose of calculating the pixel difference is to capture the changes in the flow of cooling liquid or water droplets by comparing the grayscale values of each pixel in two adjacent slice images, and to identify areas with large changes in pixel values based on the sequence of the quantity difference values. These areas may correspond to the locations of water droplets or water flows, that is, leakage areas.
[0089] In an embodiment of the present application, the difference between the weighted pixel values corresponding to the images acquired at any two adjacent moments in the grayscale image is obtained, the absolute value of the difference is used as the pixel difference, and the pixel differences are sorted from small to large, and the sorted pixel differences are used as the quantity difference value sequence, so as to facilitate the subsequent construction of a fitting function model based on the quantity difference value sequence, thereby achieving image enhancement and improving the accuracy of subsequent leakage detection.
[0090] In one embodiment, constructing a fitting function model according to the quantity difference sequence includes:
[0091] The quantity difference sequence is divided into a first sub-category sequence and a second sub-category sequence according to the sequence number value; wherein the number of the sequence number values is multiple, and the number of the sequence number values is determined by the number of each pixel point in the grayscale image;
[0092] Subtract the standard deviation corresponding to each pixel difference in the first subclass sequence from the standard deviation corresponding to each pixel difference in the second subclass sequence to obtain the subclass difference corresponding to the sequence number value;
[0093] Repeat the above steps of dividing the quantity difference sequence into the first subclass sequence and the second subclass sequence according to the sequence number value until the subclass differences corresponding to all sequence number values are obtained, and construct the subclass difference sequence based on the subclass differences corresponding to the sequence number values;
[0094] Select the maximum value in the subclass difference sequence and build a fitting function model based on the maximum value.
[0095] The serial number value is a positive integer between 1 and n, and n is the sum of the number of pixels in the grayscale image.
[0096] Specifically, the fitting function model is shown in the following formula (3):
[0097] W t =(V t -1) α +1; (3);
[0098] Among them, W t is the enhancement result of the t-th pixel value, W t The value range is 1 to 2, V t is the pixel difference of the t-th pixel in the difference sequence in the two adjacent slice images, α is the hyperparameter coefficient, which indicates the enhancement ratio and is used to adjust the flexibility and fitting effect of the model; 1 is a constant term.
[0099] Exemplarily, the confirmation operation of the hyperparameter coefficient α specifically includes: assuming that the quantity difference sequence V is {V1, V2, ..., V t , …, V n}, where V t is the pixel difference of the t-th pixel in the quantity difference sequence in the two adjacent grayscale images, and n is the sum of the number of pixels in the grayscale image; since the quantity difference sequence V is arranged in ascending order from small to large, the quantity difference sequence V is dynamically divided into two sub-class sequences, a sub-class sequence with a small absolute difference (the first sub-class sequence) and a sub-class sequence with a large absolute difference (the second sub-class sequence), recorded as the small difference sub-class sequence and the large difference sub-class sequence, the small difference sub-class sequence V small For {V1, V2, …, V t}; Large difference subclass sequence V large = {V t , …, V n}; where V1 is the pixel difference between the first pixel in the quantity difference sequence and the two adjacent grayscale images, V n It is the pixel difference between the last pixel in the difference sequence and the two adjacent grayscale images.
[0100] The difference between the sub-categories of the analysis operator is shown in the following formula (4):
[0101] h t =σ{V t , …, V n}-σ{V1,…,V t}(4);
[0102] Among them, h t is the subclass difference of the subclass sequence where the t-th pixel is located; σ is the standard deviation operation; σ{V t , …, V n} represents the calculation of the standard deviation of all pixel differences in the large difference subclass sequence, as shown in the following equations (5) and (6):
[0103] (5);
[0104] (6);
[0105] Wherein, n is the number of pixels of the captured grayscale image.
[0106] σ{V1,…,V t} represents the calculation of the standard deviation of all pixel differences in the small difference subclass sequence, as shown in the following equations (7) and (8):
[0107] (7);
[0108] (8);
[0109] Repeat the above steps of dividing the quantity difference sequence into the first subclass sequence and the second subclass sequence according to the sequence number value until all subclass differences are calculated and the subclass difference sequence is obtained. The subclass difference sequence H is shown in the following formula (9):
[0110] H = {h2,…,h n-1}(9);
[0111] h2 is the subclass difference that ranks first in the subclass difference sequence, h n-1 It is the subclass sequence difference that is at the end of the subclass sequence.
[0112] Further explanation: the small difference subclass order and the large difference subclass order are not fixedly divided. When calculating the subclass difference h2 of the subclass order where the second (serial value) pixel point is located, the pixel difference V2 corresponding to the pixel point in the quantity difference order V is used as the dividing point to divide the small difference subclass order V into small {V1, V2}; large difference subclass sequence V large is {V2,…,V n}; At this time, the subclass difference of the subclass sequence where the second pixel is located can be obtained by the above formula (4), and the subclass difference h2 located in the first subclass difference sequence H is obtained. Similarly, when calculating the subclass difference h of the subclass sequence where the n-1th pixel is located n-1 , the absolute difference V corresponding to this pixel in the quantity difference sequence V n-1 As the dividing point, the small difference subclass order is: V small For {V1, V2, …, V n-1}; Large difference subclass sequence V large =V n-1 , V n}; At this time, the subclass difference of the subclass sequence where the n-1th pixel point is located can be obtained by the above formula (4), and the subclass difference h of the last one in the subclass difference sequence H is obtained. n-1 The computer equipment can determine the degree of discreteness of different sub-class sequences by calculating the standard deviation between different sub-class sequences, which can then be used for subsequent anomaly detection tasks.
[0113] The fitting function model is derivatized twice to obtain the second-order derivative function as shown in the following formula (10):
[0114] (10);
[0115] W t "Assign a value of 0, and then substitute the maximum subclass difference in the subclass difference sequence into the second-order derivative function formula V t At this point, the value of the hyperparameter coefficient α is solved to complete the construction of the fitting function model.
[0116] It should be noted that the value of the hyperparameter coefficient α controls the curve shape of the fitting function model. If the hyperparameter coefficient α is small, the curve under the fitting function model will be flatter; if the hyperparameter coefficient α is large, the change of the curve under the fitting function model will be more obvious, which is suitable for capturing larger pixel differences.
[0117] In an embodiment of the present application, a subclass difference sequence is constructed based on the quantity difference value sequence, and a fitting function model is constructed based on the maximum value in the subclass difference sequence. The fitting function model is used to enhance the image, thereby improving the accuracy of subsequent leakage detection.
[0118] In one embodiment, the pixel enhancement of the grayscale image is performed using a fitting function model to obtain an enhanced image, including:
[0119] The pixel difference corresponding to the grayscale image is input into the fitting function model to perform pixel enhancement to obtain an enhanced image.
[0120] Specifically, for each pixel in the grayscale image, the pixel difference between the corresponding pixel in the two adjacent grayscale images is input into the fitting function model for enhancement, and the enhancement result of the pixel value corresponding to the pixel is obtained. In the curve change diagram constructed by the fitting function model, the enhancement result is dynamically adjusted according to the pixel difference between the pixel in the two adjacent grayscale images. t The smaller the value, the enhanced result W is obtained. t The smaller the pixel difference V t The larger the value, the enhanced result W is obtained. t The larger it is, the greater the pixel difference between the two adjacent grayscale images, and the higher the probability that the part is the area where the heat dissipation fluid flows. The pixel has more enhancement value, so the enhancement result of the pixel should be set higher.
[0121] In the embodiment of the present application, the pixel difference corresponding to the grayscale image is input into the fitting function model to perform pixel enhancement, thereby improving the accuracy of subsequent leakage detection.
[0122] In one embodiment, the enhanced image is divided into a first area and a second area based on a grayscale threshold, including:
[0123] Obtaining an enhanced pixel value corresponding to each pixel point in the enhanced image, comparing the enhanced pixel value with a grayscale threshold, and dividing each pixel point in the enhanced image into a first area or a second area according to a result of the comparison;
[0124] The pixel value corresponding to each pixel point in the first area is set to a first value, and the pixel value corresponding to each pixel point in the second area is set to a second value.
[0125] Among them, the grayscale threshold can be set according to actual conditions and is not limited in the embodiments of the present application; the first value and the second value can both be set according to actual conditions. In the embodiments of the present application, the first value is 255 and the second value is 0 as an example for explanation; the enhanced pixel value is expressed as the pixel value corresponding to each pixel point in the enhanced image.
[0126] Specifically, if the enhanced pixel value corresponding to the pixel point is greater than the grayscale threshold, the pixel point is divided into the first area and the pixel value of the pixel point is set to 255; if the enhanced pixel value corresponding to the pixel point is less than or equal to the grayscale threshold, the pixel point is divided into the second area and the pixel value of the pixel point is set to 0.
[0127] It should be noted that the first area corresponds to the area with larger grayscale value changes, which may correspond to the location of water droplets or water flow, that is, leakage area, and the second area corresponds to the area with smaller grayscale value changes, which may correspond to non-leakage area.
[0128] In an embodiment of the present application, by dividing the enhanced image into an area with a larger change in grayscale value, i.e., a first area, and an area with a smaller change in grayscale value, i.e., a second area, according to a grayscale threshold, it is convenient for subsequent leakage detection and the key areas that need to be detected are distinguished in advance, thereby improving the accuracy of detection.
[0129] In one embodiment, the method further comprises:
[0130] Based on the maximization of the between-class variance method, the first region and the second region, a grayscale threshold is obtained.
[0131] Specifically, the specific workflow of the optimal grayscale threshold selection algorithm is as follows: based on the enhanced image, the Otsu's method is used to automatically calculate the optimal grayscale threshold q*, the enhanced image is divided into a first area and a second area, and the optimal grayscale threshold q* is determined by maximizing the inter-class variance (i.e., the brightness difference between the first area and the second area).
[0132] Get the number of pixels of each grayscale value of the enhanced image, record the total number of pixels n in the enhanced image, and calculate the inter-class variance of all possible grayscale thresholds q , as shown in the following formula (11):
[0133] (11);
[0134] Wherein, W1(q) is the weight of the first region; W2(q) is the weight of the second region; is the average grayscale value of the first area; is the average grayscale value of the second area; traverse all possible grayscale thresholds q, and for each possible grayscale threshold q, calculate the weights of the first area and the second area, as shown in the following equations (12) and (13):
[0135] (12);
[0136] (13);
[0137] And the average grayscale values of the first area and the second area are calculated as shown in the following equations (14) and (15):
[0138] (14);
[0139] (15);
[0140] in, is the pixel probability of grayscale value i, which can be obtained according to the existing method and is not limited in the embodiment of the present application. Traverse all possible thresholds q and select the grayscale threshold q* that maximizes the inter-class variance, as shown in the following formula (16):
[0141] (16);
[0142] Among them, argmax is used to find The input value q* reaches the maximum value, that is, the grayscale threshold.
[0143] In one embodiment, obtaining an image enhancement score value corresponding to the enhanced image according to the first grayscale value and the second grayscale value includes:
[0144] Using a triple standard deviation method to perform data elimination on each first grayscale value and each second grayscale value, and obtaining a first average value and a first standard deviation of each first grayscale value after the data elimination, and a second average value and a second standard deviation of each second grayscale value after the data elimination;
[0145] An image enhancement score value is determined based on the first mean, the first standard deviation, the second mean, and the second standard deviation.
[0146] Specifically, the corresponding normal distribution models are established according to the first grayscale value and the second grayscale value. In the normal distribution model, the standard deviation is a statistic that measures the dispersion of the data set. It represents the average distance between the grayscale value point and the grayscale mean and is used in data analysis and outlier detection. The corresponding normal distribution model is subjected to data elimination by adopting the triple standard deviation method to delete the abnormal data in the normal distribution model, and the first mean value and the first standard deviation of each first grayscale value after data elimination, as well as the second mean value and the second standard deviation of each second grayscale value after data elimination, are obtained. The image enhancement score Z is obtained by the following formula (17):
[0147] (17);
[0148] in, is the first average value; is the second average value; is the first standard deviation; is the second standard deviation; ∩ is the intersection, ∪ is the union; it should be noted that the method for obtaining the mean value and the standard deviation can be set according to actual conditions and is not limited in the embodiments of the present application.
[0149] It should be noted that in the normal distribution model, the distribution of data grayscale value points presents a symmetrical bell-shaped curve, with a mean The 68-95-99.7 rule is used, which describes the proportion of data falling within a certain range around the mean under normal distribution. 68% of the data falls within the mean plus or minus 1 standard deviation. Within the range, 95% of the data fall within the mean plus or minus 2 standard deviations In the range of , 99.73% of the data fall within the mean plus or minus 3 standard deviations The 99.73% mean plus or minus 3 times the standard deviation rule selected in the present application embodiment indicates that when the value of a grayscale point exceeds When it is within the range of , it is considered an abnormal value or outlier and is removed.
[0150] In an embodiment of the present application, the triple standard deviation method is used to perform data elimination on each first grayscale value and each second grayscale value, and based on the first average value and the first standard deviation of each first grayscale value after data elimination, as well as the second average value and the second standard deviation of each second grayscale value after data elimination, an image enhancement score value is determined to quantify the effect of image enhancement and evaluate whether the pixel value distribution of the first area and the second area is obviously distinguished, so as to facilitate subsequent leakage detection and improve the accuracy of detection.
[0151] In one embodiment, adjusting the fitting function model includes:
[0152] Adjust the constant term of the fitted function model according to the increment constant.
[0153] Among them, the value-added constant can be set according to actual conditions and is not limited in the embodiments of the present application.
[0154] Specifically, the method of maximizing inter-class variance mainly focuses on determining the threshold, but does not directly evaluate the effect of image enhancement. Through the evaluation of the enhancement effect, we can understand the quality of the image after processing and ensure that the enhancement process is effective. We can adjust the enhancement parameters appropriately according to the specific image characteristics to improve the segmentation effect and more accurately determine the location and extent of the leakage.
[0155] It can be seen from the above image enhancement score formula (17) that by adjusting the parameters in the normal distribution model (for example, the average grayscale value and the grayscale value standard deviation), the grayscale value distribution of the first area and the second area can be optimized, thereby improving the enhancement effect evaluation value; if the image enhancement score Z is less than the preset standard value, it means that the image enhancement effect does not meet the requirements, and the fitting function model needs to be updated. The workflow for updating the fitting function model is:
[0156] According to the pre-adjusted value-added constant, the constant term of the fitting function model is modified, and the value range of the fitting function model will be updated accordingly. It can be adjusted from the original range to the new range, increasing the pixel value enhancement result W t , which can enhance the target subdomain area in the image.
[0157] For example, the unupdated fitting function model is shown in the above formula (3). The image enhancement score value calculated under this fitting function model is less than the enhancement standard value. Then, by modifying the constant term of the fitting function model from 1 to 2 according to the previously adjusted value-added constant, the updated fitting function model is obtained as shown in the following formula (18):
[0158] (18);
[0159] The image enhancement score Z is calculated to determine its relationship with the preset standard value, and the fitting function model is adjusted iteratively until the image enhancement score Z is greater than or equal to the preset standard value. The image enhancement is completed and the enhanced image is determined as the target image.
[0160] In an embodiment of the present application, the fitting function model is continuously iteratively adjusted based on the size relationship between the image enhancement score value and the preset standard value until the image enhancement score value is greater than or equal to the preset standard value, thereby completing image enhancement, facilitating subsequent leakage detection and improving detection accuracy.
[0161] 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.
[0162] Based on the same inventive concept, the embodiment of the present application also provides a liquid leakage detection device for implementing the above-mentioned liquid leakage detection 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 embodiments of the liquid leakage detection device provided below can refer to the limitations of the liquid leakage detection method above, and will not be repeated here.
[0163] In an exemplary embodiment, as shown in FIG2 , a liquid leakage detection device 200 is provided, and the device 200 includes:
[0164] The acquisition module 201 is used to acquire the grayscale image corresponding to the area to be measured, compare the pixels of any two images acquired at adjacent moments in the grayscale image, obtain the pixel difference corresponding to each grayscale image, and construct a quantity difference sequence based on the pixel difference;
[0165] An enhancement module 202 is used to construct a fitting function model according to the quantity difference sequence, and use the fitting function model to perform pixel enhancement on the grayscale image to obtain an enhanced image;
[0166] A region division module 203, used to divide the enhanced image into a first region and a second region based on a grayscale threshold;
[0167] Scoring module 204, used to obtain a first grayscale value corresponding to each pixel in the first area, and a second grayscale value corresponding to each pixel in the second area, and obtain an image enhancement scoring value corresponding to the enhanced image according to the first grayscale value and the second grayscale value;
[0168] Comparison module 205, used for adjusting the fitting function model if the image enhancement score value is less than the preset standard value, and returning to the step of performing pixel enhancement on the grayscale image using the fitting function model; if the image enhancement score value is greater than or equal to the preset standard value, determining the enhanced image as the target image;
[0169] The output module 206 is used to obtain the proportion of the first area in the target image, and output an alarm signal when the proportion is greater than a preset ratio.
[0170] In one embodiment, the acquisition module 201 is further used to extract the pixel values corresponding to each color channel in the grayscale image, and perform weighted processing on the pixel values to obtain the weighted pixel values corresponding to each pixel point in the grayscale image;
[0171] Obtain the difference between the weighted pixel values corresponding to any two images acquired at adjacent moments in the grayscale image, and use the absolute value of the difference as the pixel difference;
[0172] The acquisition module 201 is further used to sort the pixel differences from small to large, and use the sorted pixel differences as the quantity difference value sequence.
[0173] In one embodiment, the enhancement module 202 is further configured to divide the quantity difference value sequence into a first sub-category sequence and a second sub-category sequence according to the sequence number value; wherein the number of the sequence number values is multiple, and the number of the sequence number values is determined by the number of each pixel point in the grayscale image;
[0174] Subtract the standard deviation corresponding to each pixel difference in the first subclass sequence from the standard deviation corresponding to each pixel difference in the second subclass sequence to obtain the subclass difference corresponding to the sequence number value;
[0175] Repeat the above steps of dividing the quantity difference sequence into the first subclass sequence and the second subclass sequence according to the sequence number value until the subclass differences corresponding to all sequence number values are obtained, and construct the subclass difference sequence based on the subclass differences corresponding to the sequence number values;
[0176] Select the maximum value in the subclass difference sequence and build a fitting function model based on the maximum value.
[0177] In one embodiment, the enhancement module 202 is further configured to input the pixel difference corresponding to the grayscale image into the fitting function model to perform pixel enhancement to obtain an enhanced image.
[0178] In one embodiment, the region division module 203 is further used to obtain an enhanced pixel value corresponding to each pixel point in the enhanced image, compare the enhanced pixel value with the grayscale threshold, and divide each pixel point in the enhanced image into the first region or the second region according to the comparison result;
[0179] The pixel value corresponding to each pixel point in the first area is set to a first value, and the pixel value corresponding to each pixel point in the second area is set to a second value.
[0180] In one embodiment, the region division module 203 is further configured to obtain a grayscale threshold based on a maximum inter-class variance method, the first region, and the second region.
[0181] In one embodiment, the scoring module 204 is further used to use a triple standard deviation method to perform data elimination on each first grayscale value and each second grayscale value, and obtain a first average value and a first standard deviation of each first grayscale value after the data elimination, and a second average value and a second standard deviation of each second grayscale value after the data elimination;
[0182] An image enhancement score value is determined based on the first mean, the first standard deviation, the second mean, and the second standard deviation.
[0183] In one embodiment, the comparison module 205 is further configured to adjust a constant term of the fitting function model according to the value-added constant.
[0184] Each module in the above leakage detection device can be implemented in whole or in part by software, hardware and their combination. Each module 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 module above.
[0185] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG3. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. 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 input / output interface of the computer device is used to exchange information between the processor and an external device. 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 may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a liquid leakage detection method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen 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 shell, or an external keyboard, touchpad or mouse.
[0186] Those skilled in the art will understand that the structure shown in FIG. 3 is merely a block diagram of a partial 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 shown in the figure, or combine certain components, or have a different arrangement of components.
[0187] In an exemplary 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 liquid leakage detection method when executing the computer program.
[0188] 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 liquid leakage detection method is implemented.
[0189] In one embodiment, a computer program product is provided, including a computer program, which implements the above-mentioned liquid leakage detection method when executed by a processor.
[0190] 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, and the collection, use and processing of relevant data must comply with relevant regulations.
[0191] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method 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 memory 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), magnetic 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, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0192] 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 application.
[0193] 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 detecting a liquid leakage, characterized in that: The method comprises: Obtain a grayscale image corresponding to the area to be measured, compare pixels of any two images obtained at adjacent moments in the grayscale image to obtain pixel differences corresponding to the grayscale images, and construct a quantity difference sequence based on the pixel differences; Constructing a fitting function model according to the quantity difference sequence, and using the fitting function model to perform pixel enhancement on the grayscale image to obtain an enhanced image; Dividing the enhanced image into a first area and a second area based on a grayscale threshold; Obtaining a first grayscale value corresponding to each pixel in the first area and a second grayscale value corresponding to each pixel in the second area, and obtaining an image enhancement score value corresponding to the enhanced image according to the first grayscale value and the second grayscale value; If the image enhancement score value is less than the preset standard value, the fitting function model is adjusted, and the step of using the fitting function model to perform pixel enhancement on the grayscale image is returned to be executed; if the image enhancement score value is greater than or equal to the preset standard value, the enhanced image is determined as the target image; The proportion of the first area in the target image is obtained, and when the proportion is greater than a preset ratio, an alarm signal is output.
2. The method according to claim 1, characterized in that The step of comparing pixels of any two images acquired at adjacent moments in the grayscale images to obtain pixel differences corresponding to the grayscale images includes: Extracting pixel values corresponding to each color channel in the grayscale image, and performing weighted processing on the pixel values to obtain weighted pixel values corresponding to each pixel point in the grayscale image; Obtaining a difference between the weighted pixel values corresponding to any two images acquired at adjacent moments in the grayscale image, and taking an absolute value of the difference as the pixel difference; The constructing a quantity difference sequence based on the pixel difference comprises: The pixel differences are sorted from small to large, and the sorted pixel differences are used as the quantity difference value sequence.
3. The method according to claim 1, characterized in that The step of constructing a fitting function model according to the quantity difference sequence comprises: Dividing the quantity difference value sequence into a first sub-category sequence and a second sub-category sequence according to the sequence number value; wherein the number of the sequence number values is multiple, and the number of the sequence number values is determined by the number of each pixel point in the grayscale image; Subtract the standard deviation corresponding to each pixel difference in the first subclass sequence from the standard deviation corresponding to each pixel difference in the second subclass sequence to obtain a subclass difference corresponding to the sequence number value; Repeat the above step of dividing the quantity difference value sequence into a first subclass sequence and a second subclass sequence according to the sequence number value until the subclass differences corresponding to all the sequence number values are obtained, and construct a subclass difference sequence based on the subclass differences corresponding to the sequence number values; The maximum value in the subclass difference sequence is selected, and the fitting function model is constructed based on the maximum value.
4. The method according to claim 1, characterized in that The step of using the fitting function model to perform pixel enhancement on the grayscale image to obtain an enhanced image includes: The pixel difference corresponding to the grayscale image is input into the fitting function model to perform the pixel enhancement to obtain the enhanced image.
5. The method according to claim 1, characterized in that The step of dividing the enhanced image into a first area and a second area based on a grayscale threshold comprises: Obtaining an enhanced pixel value corresponding to each pixel point in the enhanced image, comparing the enhanced pixel value with the grayscale threshold, and dividing each pixel point in the enhanced image into the first area or the second area according to a result of the comparison; The pixel value corresponding to each pixel point in the first area is set to a first value, and the pixel value corresponding to each pixel point in the second area is set to a second value.
6. The method according to claim 5, characterized in that The method further comprises: The grayscale threshold is obtained based on the maximum inter-class variance method, the first area and the second area.
7. The method according to claim 1, characterized in that The obtaining, according to the first grayscale value and the second grayscale value, an image enhancement score value corresponding to the enhanced image includes: Using a triple standard deviation method to perform data elimination on each of the first grayscale values and each of the second grayscale values, and obtaining a first average value and a first standard deviation of each of the first grayscale values after the data elimination, and a second average value and a second standard deviation of each of the second grayscale values after the data elimination; The image enhancement score value is determined based on the first mean value, the first standard deviation, the second mean value, and the second standard deviation.
8. The method according to claim 1, characterized in that The adjusting the fitting function model comprises: The constant term of the fitting function model is adjusted according to the increment constant.
9. A liquid leakage detection device, characterized in that: The device comprises: An acquisition module is used to acquire a grayscale image corresponding to the area to be measured, compare the pixels of any two images acquired at adjacent moments in the grayscale image to obtain the pixel difference corresponding to each grayscale image, and construct a quantity difference sequence based on the pixel difference; An enhancement module, used for constructing a fitting function model according to the quantity difference sequence, and using the fitting function model to perform pixel enhancement on the grayscale image to obtain an enhanced image; A region division module, used for dividing the enhanced image into a first region and a second region based on a grayscale threshold; A scoring module, used to obtain a first grayscale value corresponding to each pixel point in the first area, and a second grayscale value corresponding to each pixel point in the second area, and obtain an image enhancement scoring value corresponding to the enhanced image according to the first grayscale value and the second grayscale value; A comparison module, configured to adjust the fitting function model if the image enhancement score value is less than a preset standard value, and return to execute the step of performing pixel enhancement on the grayscale image using the fitting function model; and determine the enhanced image as a target image if the image enhancement score value is greater than or equal to the preset standard value; The output module is used to obtain the proportion of the first area in the target image, and output an alarm signal when the proportion is greater than a preset ratio.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Visual inspection method for circumferential pit of cylindrical lithium battery
CN109191421A
Storage battery liquid leakage detection method based on neural network and thermogram
CN111445462A
Lithium battery weld defect detection method and system and storage medium
CN116309576A
Pipeline lining leakage visual detection method and system based on image enhancement
CN117036347A
Liquid leakage detection method and system
CN118071735A
Cited By
Battery cell liquid level detection method, device, equipment, storage medium and program product
CN121482055A