Automatic detection method and system for fire equipment faults based on image processing
By collecting and gray-scaling images in the fire water pipe area, analyzing the fluctuations in pixel grayscale values, and distinguishing between rust and leakage, the false alarm problem caused by condensation water interference in the existing technology is solved, and accurate detection of fire equipment failures is achieved.
Patent Information
- Application Number
- CN202510897713.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-07-01
AI Technical Summary
The existing fire water pipe corrosion and leakage detection method based on image processing cannot effectively distinguish between environmental condensation water interference and real leakage, resulting in low leakage fault identification accuracy and high false alarm rate.
The camera is moved sequentially in each area to collect and grayscale images. The pixels are divided into two categories by analyzing the gradient distribution of the grayscale values of the pixels. The corrosion probability and leakage probability parameters are calculated, and the threshold is set to judge the corrosion and leakage conditions.
It achieves accurate identification of rust and water leakage, avoids interference from condensed water and noise, and improves the accuracy and reliability of detection.
Smart Images

Figure CN120411080B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to an automatic detection method and system for fire-fighting equipment faults based on image processing. Background Art
[0002] In the operation and maintenance of firefighting equipment systems, automatic and accurate fault detection is a core requirement for ensuring their reliability. Fire hoses, as key water supply components of firefighting equipment, face typical, high-risk equipment failures caused by corrosion. Traditional inspection methods that rely on manual inspections are inefficient, have limited coverage, and are labor-intensive, making them difficult to meet the requirements of large and complex facilities for real-time, comprehensive monitoring of firefighting equipment status. Image processing-based machine vision technology, with its non-contact, automated, and efficient analysis advantages, provides a promising solution for intelligently identifying firefighting equipment failures (such as pipe corrosion), significantly improving the operational efficiency and reliability of the overall firefighting system.
[0003] However, direct application of image processing-based machine vision methods to the specific problem of detecting fire hose corrosion and leaks presents significant shortcomings. Existing methods primarily focus on identifying rust, but struggle to accurately determine whether the rust has developed into an actual leak. Rust is a necessary but not sufficient condition for leaks, and many rusted areas may not penetrate the pipe wall to form leaks. Crucially, temperature fluctuations in environments such as garages and basements where fire hoses reside can easily cause water vapor to condense on the surface of rusted pipes, forming droplets or stains. The visual signature of this condensed water is highly similar to that of actual, minor leaks. Traditional analysis algorithms that rely on static image features are unable to effectively detect this environmental interference, resulting in a significant increase in false alarms for leaks. This not only wastes maintenance resources but also reduces the reliability of alarms generated by the entire automatic fire equipment fault detection system. Therefore, developing a novel image processing method that can overcome condensed water interference and accurately identify fire hose corrosion and leaks is urgently needed to improve the practicality and effectiveness of image processing-based automatic fire equipment fault detection technology. Summary of the Invention
[0004] The present invention provides a method and system for automatic detection of fire equipment faults based on image processing to solve the existing problem: the existing method for detecting rust and leakage of fire water pipes based on image processing cannot effectively distinguish between environmental condensation water interference and real leakage, resulting in low leakage fault identification accuracy and high false alarm rate.
[0005] The present invention provides a method and system for automatically detecting fire equipment faults based on image processing, which adopts the following technical solutions:
[0006] In a first aspect, the present invention provides a method for automatically detecting fire equipment failures based on image processing, the method comprising the following steps:
[0007] Move the camera in sequence according to the area, collect n images in each area at a fixed time interval, grayscale the collected images, and obtain a series of grayscale images traversed in the order of the areas and the acquisition time sequence;
[0008] Based on the gradient distribution of the grayscale values of the pixels in each grayscale image of each region, the pixels of each grayscale image are divided into two categories. The fluctuation of the grayscale values of the two categories of pixels is analyzed, and the general level of the grayscale value fluctuation of all classified pixels in each region is calculated to obtain the rust probability parameter of each region. Based on the degree of fluctuation of the grayscale values of the pixels in the suspected rust area of each grayscale image in the same region, the leakage probability parameter of each region is obtained. Based on the leakage probability parameter of each region and the degree of fluctuation of the grayscale values of the pixels in the non-suspected rust area over time, the leakage correction parameter of each region is obtained. Based on the rust probability parameter, leakage probability parameter and leakage correction parameter of each region, the fault warning coefficient of each region is obtained.
[0009] Set a threshold and compare it with the warning coefficient to determine whether the fire-fighting pipes are rusted or leaking, and complete automatic detection of fire-fighting equipment failures.
[0010] Furthermore, the method of moving the camera in sequence according to the regions, capturing n images at fixed time intervals in each region, gray-scaling the captured images, and obtaining a series of gray-scale images traversed in sequence according to the regions and the acquisition time sequence includes the following specific methods:
[0011] The camera is fixed to a bracket, ensuring that the camera and the pipe wall are relatively stationary and the shooting distance is constant. Fire water pipe images are sequentially captured in multiple areas. In each area, n images are captured at a fixed time interval. After completing image capture in one area, the camera is moved to the next area and the above capture process is repeated. After the capture is completed, all fire water pipe images are grayscaled to obtain a series of grayscale images. The grayscale images are traversed in the order of the capture areas and the capture time of the fire water pipe images corresponding to the grayscale images to obtain a series of traversed grayscale images.
[0012] Furthermore, the pixels of each grayscale image are divided into two categories according to the gradient distribution of the grayscale values of the pixels of each grayscale image in each region, the fluctuation of the grayscale values of the two categories of pixels is analyzed, and the general level of the grayscale value fluctuation of all classified pixels in each region is calculated to obtain the corrosion probability parameter of each region, including the specific method:
[0013] For each grayscale image, different grayscale values are selected as thresholds for testing: for each threshold to be tested, pixels in the image with grayscale values greater than the threshold are classified as first-category pixels, and pixels with grayscale values less than or equal to the threshold are classified as second-category pixels; the standard deviation of the pixel values of the first-category pixels and the standard deviation of the pixel values of the second-category pixels are calculated respectively; the absolute value of the difference between the two standard deviations is divided by the sum of the two standard deviations, and the quotient obtained is the classification threshold parameter corresponding to the current threshold; after traversing possible grayscale thresholds, the grayscale value corresponding to the maximum value of the classification threshold parameter is selected as the optimal threshold of the grayscale image; based on this optimal threshold, the grayscale image pixels are finally divided into first-category pixels and second-category pixels; this process is applied independently to all grayscale images, and all image pixels are divided into two categories;
[0014] Calculate the general level of grayscale value fluctuation of all classified pixels in each area and obtain the corrosion probability parameter of each area. The specific method is as follows:
[0015]
[0016] Where, represents the corrosion probability parameter of the fire protection pipe in the qth area, n represents the number of grayscale images in each area, represents the set of grayscale values of the first type of pixels in the Ith grayscale image of the qth fire pipe area, represents the set of grayscale values of the second type of pixels in the Jth grayscale image of the qth fire pipe area, represents the standard deviation of the grayscale values of the first type of pixels in the I-th grayscale image of the q-th fire pipe area, It represents the standard deviation of the grayscale values of the second type of pixels in the Jth grayscale image of the qth fire pipe area. The corrosion probability parameter is used to determine the relative probability of pipe corrosion in the area.
[0017] Furthermore, the method of obtaining the water leakage probability parameter of each area according to the degree of change fluctuation of the grayscale value of the pixel point in the suspected rust area of each grayscale image in the same area includes the following specific methods:
[0018] For the qth region, first traverse all suspected rust pixels in its first grayscale image and completely record the position coordinate set. Based on this coordinate set, traverse the pixels with exactly the same coordinates in subsequent grayscale images of the region one by one, and define the pixel set obtained through this mapping traversal for each image as the rust template data for that image.
[0019]
[0020] Where, represents the leakage probability parameter of the qth area, Indicates the number of elements in the extracted collection. represents the rust template data of the first grayscale image in the qth region, n represents the number of grayscale images in each region, Indicates the grayscale value of the x-th pixel in the X-th grayscale image rust template data in the q-th region, It represents the mean gray value of the x-th pixel in all the rust templates in the q-th area, and further obtains the water leakage probability parameter of each area.
[0021] Furthermore, the water leakage correction parameter of each area is obtained based on the water leakage probability parameter of each area and the fluctuation degree of the grayscale value of the pixel point in the non-suspected rust area with time series, including the specific method as follows:
[0022] For the qth region, first traverse all non-suspected rust pixels in its first grayscale image and completely record the position coordinate set. Based on this coordinate set, traverse the pixels in subsequent grayscale images of the region with exactly the same coordinates one by one, and define the pixel set obtained through this mapping traversal for each image as the normal region template data of the image.
[0023] For the qth region, calculate the standard deviation of the grayscale value of each pixel in the normal region template data, accumulate all standard deviations and divide them by the number of elements in the normal region template data, and record the quotient as the surface fluctuation coefficient of the qth region. Further obtain the surface fluctuation coefficient of each region, and obtain the leakage correction parameter of each region based on the leakage probability parameter and surface fluctuation coefficient of each region. The specific method is as follows:
[0024]
[0025] Where, represents the water leakage correction parameter of the qth area, represents the leakage probability parameter of the qth area, represents the surface fluctuation coefficient of the qth region, e represents the natural base, and T represents the hyperparameter.
[0026] Furthermore, the specific method for obtaining the fault warning coefficient of each area according to the corrosion probability parameter, the water leakage probability parameter and the water leakage correction parameter of each area is as follows:
[0027]
[0028] Where, represents the fault warning coefficient of the qth area, represents the corrosion probability parameter of the fire protection pipe in the qth area, represents the leakage probability parameter of the qth area, Represents the water leakage correction parameter of the qth area.
[0029] Furthermore, the threshold is set and compared with the warning coefficient to determine whether the fire-fighting pipe is corroded and leaking, thereby completing the automatic detection of fire-fighting equipment failure, including the specific method of:
[0030] A threshold value K is set and the fault warning coefficient is compared with the threshold value K. When the fault warning coefficient is greater than or equal to the threshold value, there is a rust and water leakage fault in the area. The relevant personnel are reminded through the speaker to perform maintenance, thus completing the automatic detection method of fire equipment faults.
[0031] A second aspect of the present invention provides an automatic firefighting equipment fault detection system based on image processing, the system comprising a data packet acquisition module, a data analysis module, and an alarm module, wherein:
[0032] The data acquisition module moves the camera in the order of regions, collects n images at a fixed time interval in each region, converts the collected images into grayscale, and obtains a series of grayscale images traversed in the order of regions and acquisition time sequence;
[0033] The data analysis module is used to classify the pixels of each grayscale image into two categories based on the gradient distribution of the grayscale values of the pixels in each grayscale image of each region, analyze the fluctuation of the grayscale values of the two categories of pixels, calculate the general level of fluctuation of the grayscale values of all classified pixels in each region, and obtain the rust probability parameter of each region; obtain the water leakage probability parameter of each region based on the degree of fluctuation of the grayscale values of the pixels in the suspected rust area of each grayscale image in the same region; obtain the water leakage correction parameter of each region based on the water leakage probability parameter of each region and the degree of fluctuation of the grayscale values of the pixels in the non-suspected rust area over time; and obtain the fault warning coefficient of each region based on the rust probability parameter, water leakage probability parameter, and water leakage correction parameter of each region;
[0034] The alarm module is used to set the threshold and compare it with the warning coefficient to determine whether the fire-fighting pipes are rusted and leaking, and complete automatic detection of fire-fighting equipment failures.
[0035] A third aspect of the present invention is a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-mentioned method for automatic detection of fire equipment faults based on image processing.
[0036] In a fourth aspect of the present invention, a computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for automatic detection of fire equipment faults based on image processing when executing the computer program.
[0037] The beneficial effects of the technical solution of the present invention are as follows: this embodiment moves the camera sequentially according to the area, captures n images at fixed time intervals in each area, and grayscales the captured images to obtain a series of grayscale images traversed in the area order and acquisition time sequence; this facilitates analysis and differentiation of the effects of dynamic water leakage and condensation water based on the time series changes of the grayscale images;
[0038] Based on the gradient distribution of the grayscale values of the pixels in each grayscale image of each area, the pixels in each grayscale image are divided into two categories. The fluctuations in the grayscale values of the two categories of pixels are analyzed, and the general level of grayscale value fluctuations of all classified pixels in each area is calculated to obtain the corrosion probability parameter for each area. The pixels are adaptively classified, and based on the differences in the grayscale values of the classified pixels, a clearer and more accurate analysis of whether the fire protection pipes are corroded can be achieved.
[0039] Based on the fluctuation in the grayscale values of pixels in suspected rusted areas of each grayscale image in the same region, the leakage probability parameter for each area is obtained. By considering the fluctuation characteristics of pixels in suspected rusted areas over time, it is possible to better analyze the difference between pipeline corrosion leakage and condensation water, avoiding false alarms of pipeline corrosion without leakage.
[0040] Based on the water leakage probability parameter of each area and the degree of fluctuation of the grayscale value of the pixels in the non-suspected rust area over time, the water leakage correction parameter of each area is obtained. This prevents the image from being affected by severe noise, resulting in the suspected rust area being dry but being mistakenly judged as a water leak due to excessive pixel fluctuation.
[0041] Obtain the fault warning coefficient for each area based on the corrosion probability parameter, water leakage probability parameter, and water leakage correction parameter of each area. Obtaining the fault warning parameters of the area by combining the above parameters can provide more accurate data analysis for subsequent judgment.
[0042] A threshold is set and compared with the warning coefficient to determine whether the fire-fighting pipe is rusted and leaking, completing the automatic detection of fire-fighting equipment failures. Using this method for fire-fighting equipment failure detection can accurately distinguish rusted areas and more accurately identify rust and leakage situations, avoiding environmental interference factors such as condensed water, and having high noise resistance. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0044] Figure 1 This is a flowchart of the steps of an automatic detection method for fire-fighting equipment failure based on image processing of the present invention;
[0045] Figure 2 This is a structural block diagram of an automatic fire equipment fault detection system based on image processing according to the present invention. DETAILED DESCRIPTION
[0046] To further illustrate the technical means and effectiveness of the present invention in achieving its intended objectives, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the specific implementation, structure, features, and effectiveness of a method and system for automatic firefighting equipment fault detection based on image processing proposed by the present invention. In the following description, references to different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0047] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0048] The following describes in detail a method and system for automatically detecting fire equipment faults based on image processing provided by the present invention with reference to the accompanying drawings.
[0049] See also Figure 1 , which shows the first object of the present invention, a flowchart of a method for automatically detecting fire equipment faults based on image processing, the method comprising the following steps:
[0050] Step S001: Move the camera in the order of regions, capture n images in each region at a fixed time interval, convert the captured images into grayscale, and obtain a series of grayscale images traversed in the order of regions and capture time sequence.
[0051] When existing image processing-based machine vision methods are used to detect specific equipment faults such as corrosion and leakage of fire water pipes, conventional methods can only detect water pipe corrosion, but leakage problems caused by corrosion are difficult to identify because the visual characteristics of condensed water are highly similar to real minor leakage faults. Therefore, this method continuously collects water pipe images in the same area to determine the image characteristics of suspected leakage areas in different images. Because the water stains at minor leakage points are dynamic compared to the condensed water condensation points, the dynamic water stains will present different image characteristics during the shooting process. The real minor leakage fault area is determined based on the image characteristics.
[0052] Specifically, the camera is moved in sequence according to the regions, and n images are collected at fixed time intervals in each region. The collected images are grayscaled to obtain a series of grayscale images traversed in the order of regions and acquisition time. The specific method is as follows:
[0053] The camera is fixed to a bracket, ensuring that the camera and the pipe wall are relatively stationary and the shooting distance is constant. Fire water pipe images are sequentially captured in multiple areas. In each area, n images are captured at a fixed time interval. After completing image capture in one area, the camera is moved to the next area and the above capture process is repeated. After the capture is completed, all fire water pipe images are grayscaled to obtain a series of grayscale images. The grayscale images are traversed in the order of the capture areas and the capture time of the fire water pipe images corresponding to the grayscale images to obtain a series of traversed grayscale images.
[0054] It should be noted that the present invention does not limit the camera image acquisition specifications and shooting distance. The camera image acquisition specifications and shooting distance must ensure that the texture and color features of the fire water pipe image can be clearly observed and only the pipe wall exists in the image. In this embodiment, the camera image acquisition specifications are a rectangle with a side length of m = 250 pixels, the shooting distance is 0.2m, the fire water pipe image acquisition area is m = 30, the acquisition time interval is 0.05 seconds, and the number of images collected in each area n = 20. The present invention does not specifically limit the number of fire water pipe image acquisition areas, the image acquisition time interval, and the number of images collected n. In other embodiments, the number of fire water pipe image acquisition areas, the image acquisition time interval, and the number of images collected n depend on the specific implementation.
[0055] Step S002: According to the gradient distribution of the grayscale values of the pixels in each grayscale image of each area, the pixels of each grayscale image are divided into two categories, the fluctuation of the grayscale values of the two categories of pixels are analyzed, and the general level of the grayscale value fluctuation of all classified pixels in each area is calculated to obtain the rust probability parameter of each area; according to the degree of fluctuation of the grayscale values of the pixels in the suspected rust area of each grayscale image in the same area, the water leakage probability parameter of each area is obtained; according to the water leakage probability parameter of each area and the degree of fluctuation of the grayscale values of the pixels in the non-suspected rust area with time series, the water leakage correction parameter of each area is obtained; according to the rust probability parameter, water leakage probability parameter and water leakage correction parameter of each area, the fault warning coefficient of each area is obtained.
[0056] It should be noted that automatic fault detection is relatively important in the operation and maintenance of fire protection equipment systems. First, it is necessary to determine the relative probability of rust in fire protection pipes. Then, based on the pipe images with relatively high probability of rust in fire protection pipes and the leakage characteristics of pixel points, the influence of noise can be eliminated and the corrosion and leakage of the pipes can be finally determined.
[0057] Specifically, based on the grayscale value gradient distribution of the pixels in each grayscale image of each region, the pixels in each grayscale image are divided into two categories. The fluctuation of the grayscale values of the two categories of pixels is analyzed, and the general level of the grayscale value fluctuation of all classified pixels in each region is calculated to obtain the corrosion probability parameter of each region. The specific method is as follows:
[0058] For each grayscale image, different grayscale values are selected as thresholds for testing: for each threshold to be tested, pixels in the image with grayscale values greater than the threshold are classified as first-category pixels, and pixels with grayscale values less than or equal to the threshold are classified as second-category pixels; the standard deviation of the pixel values of the first-category pixels and the standard deviation of the pixel values of the second-category pixels are calculated respectively; the absolute value of the difference between the two standard deviations is divided by the sum of the two standard deviations, and the quotient obtained is the classification threshold parameter corresponding to the current threshold; after traversing possible grayscale thresholds, the grayscale value corresponding to the maximum value of the classification threshold parameter is selected as the optimal threshold of the grayscale image; based on this optimal threshold, the grayscale image pixels are finally divided into first-category pixels and second-category pixels; this process is applied independently to all grayscale images, and all image pixels are divided into two categories;
[0059] Calculate the general level of grayscale value fluctuation of all classified pixels in each area and obtain the corrosion probability parameter of each area. The specific method is as follows:
[0060]
[0061] Where, represents the corrosion probability parameter of the fire protection pipe in the qth area, n represents the number of grayscale images in each area, represents the set of grayscale values of the first type of pixels in the Ith grayscale image of the qth fire pipe area, represents the set of grayscale values of the second type of pixels in the Jth grayscale image of the qth fire pipe area, represents the standard deviation of the grayscale values of the first type of pixels in the I-th grayscale image of the q-th fire pipe area, It represents the standard deviation of the grayscale values of the second type of pixels in the Jth grayscale image of the qth fire pipe area. The corrosion probability parameter is used to determine the relative probability of pipe corrosion in the area.
[0062] It should be noted that the core of the grayscale image pixel classification method is adaptive classification, which ensures that the first-category pixels (suspected rusted areas of fire pipes) and the second-category pixels (suspected normal areas of fire pipes) after classification simultaneously meet two optimization conditions: one is to minimize the standard deviation of pixel values within the class (ensuring high consistency in the grayscale values of pixels of the same class), and the other is to maximize the difference in standard deviation between classes (enhancing the separation between rusted and normal areas). This dual requirement can effectively distinguish the statistical feature differences between the two types of pixels, thereby improving the accuracy of rusted area detection. and The purpose of the size judgment is to prevent the suspected normal area and suspected rust area from being mistakenly classified as abnormal area pixels based on grayscale values. The paint color of the normal area of the pipeline may be darker than that of the rust area, that is, the grayscale value is smaller. Based on the judgment of multiple images of the same area to prevent sampling errors, in grayscale image analysis, the larger the standard deviation of the pixel values in the suspected rust area, the closer its grayscale fluctuation characteristics are to the typical distribution of real rust. On the other hand, the smaller the standard deviation of the pixel values in the suspected normal area, the more consistent it is with the stable distribution characteristics of intact pipe wall areas. Therefore, the larger the ratio of the pixel value standard deviations of the two types of areas (standard deviation of the suspected rust area / standard deviation of the suspected normal area), the greater the probability of corrosion failure in the corresponding pipe wall location in the image.
[0063] It should be further explained that the above method determines the relative probability of rust in each region by determining the distribution and gradient characteristics of the grayscale values in the grayscale image. Subsequent considerations will determine whether rust indicates leakage. Rust is a necessary but not sufficient condition for leakage (the presence of rust does not necessarily indicate leakage, but leakage is inevitably accompanied by rust). In continuous image acquisition, the dynamic flow of water in leaking areas scatters light, causing the grayscale values of pixels there to fluctuate significantly over time. In dry areas or smooth, non-rusted areas, the fluctuation in pixel grayscale values over time is significantly smaller due to the lack of water flow interference or stable surface reflection. Therefore, this step determines whether a leak is present in the rusted area by calculating the similarity in the fluctuation characteristics of the grayscale values of pixels in the suspected rusted area.
[0064] Specifically, the water leakage probability parameter of each area is obtained based on the fluctuation degree of the grayscale value of the pixel points in the suspected rust area of each grayscale image in the same area. The specific method is as follows:
[0065] For the qth region, first traverse all suspected rust pixels in its first grayscale image and completely record the position coordinate set. Based on this coordinate set, traverse the pixels with exactly the same coordinates in subsequent grayscale images of the region one by one, and define the pixel set obtained through this mapping traversal for each image as the rust template data for that image.
[0066]
[0067] Where, represents the leakage probability parameter of the qth area, Indicates the number of elements in the extracted collection. represents the rust template data of the first grayscale image in the qth region, n represents the number of grayscale images in each region, Indicates the grayscale value of the x-th pixel in the X-th grayscale image rust template data in the q-th region, It represents the mean gray value of the x-th pixel in all the rust templates in the q-th area, and further obtains the water leakage probability parameter of each area.
[0068] It should be further explained that the above method obtains the leakage probability parameters of each area. The purpose of obtaining the rust template data is to ensure that subsequent operations can compare the pixel points of each suspected rust area. The mapping principle is adopted to track the changes in the grayscale value of each pixel point in the suspected leakage area to the greatest extent; the leakage probability parameter compares the changes of each pixel point in the suspected leakage area in all grayscale images in each area with time series. When the grayscale value of each pixel point in the suspected leakage area fluctuates more with time series, it means that the water flow speed may be faster, resulting in a larger change in the grayscale value of the pixel point in the suspected leakage area.
[0069] It should be further explained that the above steps are all analyzed based on the time-series changes in the grayscale values of pixels in the suspected rust area. There may be cases where the image is severely affected by noise, resulting in the suspected rust area being dry but the grayscale value changes more dramatically. Therefore, this step needs to compare the degree of fluctuation of the grayscale values of pixels in the suspected rust area with the degree of fluctuation of the grayscale values of pixels in other areas. If the degree of fluctuation of the grayscale values of pixels in the two areas over time is close, the probability that the image is affected by noise may be greater, and the probability of water leakage in the rust area may be smaller. It should be explained that the underlying logic of the water leakage probability parameter is the degree of fluctuation of the grayscale values of pixels in the rust area, so it is only necessary to compare the degree of fluctuation of the water leakage probability parameter with the grayscale values of pixels in other areas over time.
[0070] Specifically, based on the water leakage probability parameter of each area and the fluctuation degree of the grayscale value of the pixel point in the non-suspected rust area over time, the water leakage correction parameter of each area is obtained. The specific method is as follows:
[0071] For the qth region, first traverse all non-suspected rust pixels in its first grayscale image and completely record the position coordinate set. Based on this coordinate set, traverse the pixels in subsequent grayscale images of the region with exactly the same coordinates one by one, and define the pixel set obtained through this mapping traversal for each image as the normal region template data of the image.
[0072] For the qth region, calculate the standard deviation of the grayscale value of each pixel in the normal region template data, accumulate all standard deviations and divide them by the number of elements in the normal region template data, and record the quotient as the surface fluctuation coefficient of the qth region. Further obtain the surface fluctuation coefficient of each region, and obtain the leakage correction parameter of each region based on the leakage probability parameter and surface fluctuation coefficient of each region. The specific method is as follows:
[0073]
[0074] Where, represents the water leakage correction parameter of the qth area, represents the leakage probability parameter of the qth area, represents the surface fluctuation coefficient of the qth region, e represents the natural base, and T represents the hyperparameter.
[0075] It should be noted that the greater the difference between the water leakage probability parameter and the surface fluctuation coefficient, the less the image is affected by noise, the higher the credibility of the calculated water leakage probability parameter, and the lower the probability of misjudging a water leakage phenomenon. T is used to adjust the increase and decrease speed of the curve. In this embodiment, the hyperparameter T is 4.6. In other embodiments, the value of the hyperparameter T depends on the implementation situation.
[0076] It should be further explained that the above process obtains the corrosion probability parameters, leakage probability parameters and leakage correction parameters of each area, and can comprehensively obtain the corrosion and leakage warning parameters of each area, set the warning threshold, compare the size relationship between the warning threshold and the warning parameter, and complete the entire process of automatic detection of fire equipment failures.
[0077] Specifically, the fault warning coefficient of each area is obtained according to the corrosion probability parameter, water leakage probability parameter and water leakage correction parameter of each area. The specific method is as follows:
[0078]
[0079] Where, represents the fault warning coefficient of the qth area, represents the corrosion probability parameter of the fire protection pipe in the qth area, represents the leakage probability parameter of the qth area, Represents the water leakage correction parameter of the qth area.
[0080] It should be noted that when the rust probability parameter of a certain area is larger, the probability of rust occurring in the area is greater, the preconditions for rust and water leakage occurring in the area are more satisfied, and the probability of rust and water leakage occurring in the area is greater; when the leakage probability parameter of a certain area is larger, the probability of rust and water leakage occurring in the area is greater, and when the leakage correction parameter is larger, it means that the data is relatively less affected by noise and the data authenticity is higher. Therefore, when the rust probability parameter is larger, the leakage probability parameter is larger, and the leakage correction parameter is larger, the probability of rust and water leakage occurring in the area is greater.
[0081] Step S003: Set a threshold and compare it with the warning coefficient to determine whether the fire-fighting pipe is rusted or leaking, and complete the automatic detection of fire-fighting equipment failure.
[0082] Set a threshold and compare it with the warning coefficient to determine whether the fire protection pipe is corroded or leaking, and complete automatic detection of fire protection equipment failures. The specific method is as follows:
[0083] Set the threshold K, the K value is based on the water leakage fault samples in the historical data The distribution is determined, and the fault warning coefficient is compared with the threshold K. When the fault warning coefficient is greater than or equal to the threshold K, there is a rust and water leakage fault in the area. The relevant personnel are reminded through the speaker to perform maintenance, completing the automatic detection method of fire equipment faults.
[0084] It should be noted that this embodiment does not limit the threshold K. In this embodiment, K=36. The value of K in other embodiments depends on the specific implementation situation.
[0085] See also Figure 2 , which shows the second object of the present invention, a structural block diagram of an automatic detection system for fire equipment failure based on image processing, the system includes the following modules:
[0086] The data acquisition module is used to move the camera in sequence according to the area, collect n images in each area at a fixed time interval, grayscale the collected images, and obtain a series of grayscale images traversed in the order of the areas and the acquisition time sequence;
[0087] The data analysis module is used to classify the pixels of each grayscale image into two categories based on the gradient distribution of the grayscale values of the pixels in each grayscale image of each region, analyze the fluctuation of the grayscale values of the two categories of pixels, calculate the general level of fluctuation of the grayscale values of all classified pixels in each region, and obtain the rust probability parameter of each region; obtain the water leakage probability parameter of each region based on the degree of fluctuation of the grayscale values of the pixels in the suspected rust area of each grayscale image in the same region; obtain the water leakage correction parameter of each region based on the water leakage probability parameter of each region and the degree of fluctuation of the grayscale values of the pixels in the non-suspected rust area over time; and obtain the fault warning coefficient of each region based on the rust probability parameter, water leakage probability parameter, and water leakage correction parameter of each region;
[0088] The alarm module is used to set the threshold and compare it with the warning coefficient to determine whether the fire-fighting pipes are rusted and leaking, and complete automatic detection of fire-fighting equipment failures.
[0089] The third object of an embodiment of the present invention is to provide a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the above-mentioned method for automatic detection of fire equipment faults based on image processing are implemented.
[0090] The fourth object of an embodiment of the present invention is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for automatic detection of fire equipment faults based on image processing are implemented.
[0091] This embodiment moves the camera sequentially by region, captures n images at fixed time intervals in each region, and grayscales the captured images to obtain a series of grayscale images traversed in the region sequence and acquisition time sequence. This facilitates analysis and differentiation of the effects of dynamic water leakage and condensation based on the temporal changes in the grayscale images.
[0092] Based on the gradient distribution of the grayscale values of the pixels in each grayscale image of each area, the pixels in each grayscale image are divided into two categories. The fluctuations in the grayscale values of the two categories of pixels are analyzed, and the general level of grayscale value fluctuations of all classified pixels in each area is calculated to obtain the corrosion probability parameter for each area. The pixels are adaptively classified, and based on the differences in the grayscale values of the classified pixels, a clearer and more accurate analysis of whether the fire protection pipes are corroded can be achieved.
[0093] Based on the fluctuation in the grayscale values of pixels in suspected rusted areas of each grayscale image in the same region, the leakage probability parameter for each area is obtained. By considering the fluctuation characteristics of pixels in suspected rusted areas over time, it is possible to better analyze the difference between pipeline corrosion leakage and condensation water, avoiding false alarms of pipeline corrosion without leakage.
[0094] Based on the water leakage probability parameter of each area and the degree of fluctuation of the grayscale value of the pixels in the non-suspected rust area over time, the water leakage correction parameter of each area is obtained. This prevents the image from being affected by severe noise, resulting in the suspected rust area being dry but being mistakenly judged as a water leak due to excessive pixel fluctuation.
[0095] Obtain the fault warning coefficient for each area based on the corrosion probability parameter, water leakage probability parameter, and water leakage correction parameter of each area. Obtaining the fault warning parameters of the area by combining the above parameters can provide more accurate data analysis for subsequent judgment.
[0096] A threshold is set and compared with the warning coefficient to determine whether the fire-fighting pipe is rusted and leaking, completing the automatic detection of fire-fighting equipment failures. Using this method for fire-fighting equipment failure detection can accurately distinguish rusted areas and more accurately identify rust and leakage situations, avoiding environmental interference factors such as condensed water, and having high noise resistance.
[0097] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0098] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0099] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0100] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.
[0101] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. A method for automatic detection of fire equipment faults based on image processing, characterized in that: The method comprises the following steps: Move the camera in sequence according to the area, collect n images in each area at a fixed time interval, grayscale the collected images, and obtain a series of grayscale images traversed in the order of the areas and the acquisition time sequence; According to the grayscale value gradient distribution of each pixel in each grayscale image of each region, the pixels of each grayscale image are divided into the first type of pixels and the second type of pixels, and the corrosion probability parameter of each region is obtained. The specific method is as follows: Where, represents the corrosion probability parameter of the fire protection pipe in the qth area, n represents the number of grayscale images in each area, represents the set of grayscale values of the first type of pixels in the Ith grayscale image of the qth fire pipe area, represents the set of grayscale values of the second type of pixels in the Jth grayscale image of the qth fire pipe area, represents the standard deviation of the grayscale values of the first type of pixels in the I-th grayscale image of the q-th fire pipe area, represents the standard deviation of the grayscale values of the second type of pixels in the Jth grayscale image of the qth fire pipe area; According to the fluctuation degree of the grayscale value of the pixel points in the suspected rust area of each grayscale image in the same area, the water leakage probability parameter of each area is obtained. The specific method includes: For the qth region, first traverse all suspected rust pixels in its first grayscale image and completely record the position coordinate set. Then traverse the pixels in subsequent grayscale images of the region that have exactly the same coordinates as those in the coordinate set one by one, and define the set of pixels in each grayscale image in the region that have exactly the same coordinates as those in the coordinate set as the rust template data for the image. Where, represents the leakage probability parameter of the qth area, Indicates the number of elements in the extracted collection. represents the rust template data of the first grayscale image in the qth region, n represents the number of grayscale images in each region, Indicates the grayscale value of the x-th pixel in the X-th grayscale image rust template data in the q-th region, represents the mean grayscale value of the xth pixel in all rust templates in the qth region; According to the water leakage probability parameter of each area and the fluctuation degree of the gray value of the pixel point in the non-suspected rust area over time, the water leakage correction parameter of each area is obtained. The specific methods include: For the qth region, first traverse all non-suspected rust pixels in its first grayscale image and completely record the position coordinate set. Then, traverse the pixels in subsequent grayscale images of the region that have the same coordinates as those in the coordinate set one by one, and define the set of pixels in each grayscale image of the region that have the same coordinates as those in the coordinate set as the normal region template data of the image. For the qth region, calculate the standard deviation of the grayscale value of each pixel in the normal region template data, accumulate all standard deviations and divide them by the number of elements in the normal region template data, and record the quotient as the surface fluctuation coefficient of the qth region. According to the water leakage probability parameter and surface fluctuation coefficient of each region, obtain the water leakage correction parameter of each region. The specific method is as follows: Where, represents the water leakage correction parameter of the qth area, represents the leakage probability parameter of the qth area, represents the surface fluctuation coefficient of the qth region, e represents the natural base, and T represents the hyperparameter; Obtain the fault warning coefficient of each area based on the corrosion probability parameter, water leakage probability parameter and water leakage correction parameter of each area; Set a threshold and compare it with the fault warning coefficient to determine whether the fire-fighting pipes are rusted or leaking, and complete automatic detection of fire-fighting equipment failures.
2. The method for automatic detection of fire equipment failure based on image processing according to claim 1, characterized in that: The method of moving the camera in sequence according to the regions, capturing n images at fixed time intervals in each region, gray-scaling the captured images, and obtaining a series of gray-scale images traversed in sequence according to the regions and the acquisition time sequence includes the following specific methods: The camera is fixed to a bracket, ensuring that the camera and the pipe wall are relatively stationary and the shooting distance is constant, and fire water pipe images are sequentially collected in multiple areas. In each area, n images are collected at a fixed time interval. After completing image collection in one area, the camera is moved to the next area and the process of collecting n images at a fixed time interval is repeated. After the collection is completed, all fire water pipe images are grayscaled to obtain a series of grayscale images. The grayscale images are traversed in the order of the collection areas and the collection time of the fire water pipe images corresponding to the grayscale images to obtain a series of traversed grayscale images.
3. The method for automatic detection of fire equipment failure based on image processing according to claim 1, characterized in that: The method of classifying the pixels of each grayscale image into the first category of pixels and the second category of pixels according to the grayscale value gradient distribution of the pixels of each grayscale image in each region includes the following specific methods: For each grayscale image, different grayscale values are selected as thresholds for testing: for each threshold to be tested, the pixels in the image with grayscale values greater than the threshold are classified as first-category pixels, and the pixels with grayscale values less than or equal to the threshold are classified as second-category pixels; the standard deviation of the pixel values of the first-category pixels and the standard deviation of the pixel values of the second-category pixels are calculated respectively; the absolute value of the difference between the two standard deviations is divided by the sum of the two standard deviations, and the quotient obtained is the classification threshold parameter corresponding to the current threshold; after traversing the possible grayscale thresholds, the grayscale value corresponding to the maximum value of the classification threshold parameter is selected as the optimal threshold of the grayscale image; based on this optimal threshold, the grayscale image pixels are finally divided into first-category pixels and second-category pixels.
4. The method for automatic detection of fire equipment failure based on image processing according to claim 1, characterized in that: The specific method for obtaining the fault warning coefficient of each area according to the corrosion probability parameter, water leakage probability parameter and water leakage correction parameter of each area is as follows: Where, represents the fault warning coefficient of the qth area, represents the corrosion probability parameter of the fire protection pipe in the qth area, represents the leakage probability parameter of the qth area, Represents the water leakage correction parameter of the qth area.
5. The method for automatic detection of fire equipment failure based on image processing according to claim 1, characterized in that: The threshold is set and compared with the fault warning coefficient to determine whether the fire protection pipe is corroded and leaking, and the automatic detection of fire protection equipment faults is completed, including the specific method of: Set the threshold K, the K value is based on the water leakage fault samples in the historical data The distribution is determined, the default value K=36, and the fault warning coefficient is compared with the threshold K. When the fault warning coefficient is greater than or equal to the threshold K, there is a rust and water leakage fault in the area. The relevant personnel are reminded through the speaker to perform maintenance, completing the automatic detection method of fire equipment faults.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for automatic detection of fire equipment failure based on image processing as described in any one of claims 1 to 5 are implemented.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method for automatic detection of fire equipment failure based on image processing as described in any one of claims 1 to 5 are implemented.
8. An automatic fire equipment fault detection system based on image processing, characterized in that: The system includes the following modules: The data acquisition module is used to move the camera in sequence according to the area, collect n images in each area at a fixed time interval, grayscale the collected images, and obtain a series of grayscale images traversed in the order of the areas and the acquisition time sequence; The data analysis module is used to classify the pixels of each grayscale image into first-class pixels and second-class pixels according to the gradient distribution of the grayscale values of the pixels of each grayscale image in each area, and obtain the corrosion probability parameter of each area. The specific method is as follows: Where, represents the corrosion probability parameter of the fire protection pipe in the qth area, n represents the number of grayscale images in each area, represents the set of grayscale values of the first type of pixels in the Ith grayscale image of the qth fire pipe area, represents the set of grayscale values of the second type of pixels in the Jth grayscale image of the qth fire pipe area, represents the standard deviation of the grayscale values of the first type of pixels in the I-th grayscale image of the q-th fire pipe area, represents the standard deviation of the grayscale values of the second type of pixels in the Jth grayscale image of the qth fire pipe area; According to the fluctuation degree of the grayscale value of the pixel points in the suspected rust area of each grayscale image in the same area, the water leakage probability parameter of each area is obtained. The specific method includes: For the qth region, first traverse all suspected rust pixels in its first grayscale image and completely record the position coordinate set. Then traverse the pixels in subsequent grayscale images of the region that have exactly the same coordinates as those in the coordinate set one by one, and define the set of pixels in each grayscale image in the region that have exactly the same coordinates as those in the coordinate set as the rust template data for the image. Where, represents the leakage probability parameter of the qth area, Indicates the number of elements in the extracted collection. represents the rust template data of the first grayscale image in the qth region, n represents the number of grayscale images in each region, Indicates the grayscale value of the x-th pixel in the X-th grayscale image rust template data in the q-th region, represents the mean grayscale value of the xth pixel in all rust templates in the qth region; According to the water leakage probability parameter of each area and the fluctuation degree of the gray value of the pixel point in the non-suspected rust area over time, the water leakage correction parameter of each area is obtained. The specific methods include: For the qth region, first traverse all non-suspected rust pixels in its first grayscale image and completely record the position coordinate set. Then, traverse the pixels in subsequent grayscale images of the region that have the same coordinates as those in the coordinate set one by one, and define the set of pixels in each grayscale image of the region that have the same coordinates as those in the coordinate set as the normal region template data of the image. For the qth region, calculate the standard deviation of the grayscale value of each pixel in the normal region template data, accumulate all standard deviations and divide them by the number of elements in the normal region template data, and record the quotient as the surface fluctuation coefficient of the qth region. According to the water leakage probability parameter and surface fluctuation coefficient of each region, obtain the water leakage correction parameter of each region. The specific method is as follows: Where, represents the water leakage correction parameter of the qth area, represents the leakage probability parameter of the qth area, represents the surface fluctuation coefficient of the qth region, e represents the natural base, and T represents the hyperparameter; Obtain the fault warning coefficient of each area based on the corrosion probability parameter, water leakage probability parameter and water leakage correction parameter of each area; The alarm module is used to set the threshold and compare it with the fault warning coefficient to determine whether the fire protection pipes are rusted and leaking, and complete the automatic detection of fire protection equipment failures.
Citation Information
Patent Citations
Water supply pipe surface leakage detection method based on image processing
CN116993745A
Valve anomaly detection system based on image recognition and detection method thereof
CN119023242A