A water meter freeze crack detection method based on a camera remote water meter

By combining deep learning based on camera-based remote water meters with traditional image detection methods, and integrating neural networks and image analysis techniques, the problems of accuracy and timeliness in water meter freezing and crack detection have been solved, realizing automated water meter freezing and crack detection and early warning, and reducing computing costs.

CN115375970BActive Publication Date: 2026-01-16ANHUI EMI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211020171.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-24
Publication Date
2026-01-16
Estimated Expiration
2042-08-24

AI Technical Summary

Technical Problem

Existing technology cannot effectively detect water meter freezing and cracking, leading to the discovery of water meter freezing and cracking only after the meters have frozen in cold weather, resulting in water loss, affecting users' water use, and having a significant negative impact on society.

Method used

A camera-based remote water meter method is adopted, which combines deep learning and traditional image detection techniques. The neural network model performs initial detection on the dial image and uses image lines, gradients and brightness analysis to determine whether the water meter has cracks. This includes ResNet-18 network training, Sobel operator gradient calculation, double thresholding method to reduce false edges and grayscale histogram analysis.

Benefits of technology

It enables automatic detection of water meter freezing and cracking without human intervention, improving detection accuracy, reducing computing costs, providing timely warnings of water meter freezing and cracking, and reducing water loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115375970B_ABST
    Figure CN115375970B_ABST
Patent Text Reader

Abstract

The present application relates to water meter freeze crack detection, in particular to a kind of water meter freeze crack detection method based on camera remote water meter, camera remote water meter gathers dial image, utilize neural network model to carry out initial detection to dial image;Image line detection: the total gradient of each pixel point in the corresponding gray image of dial image is calculated, the non-maximum suppression of gradient amplitude is used to delete most non-edge points, and a double-threshold method is used to reduce the number of false edges, whether crack appears in dial image is judged by line analysis to edge image;Image gradient detection: whether crack appears in dial image is judged by the number analysis of the total gradient of all pixel points in gradient diagram;Image brightness detection: whether crack appears in dial image is judged by image brightness distribution rule analysis to gray histogram;The technical scheme provided by the present application can effectively overcome the defects that water meter freeze crack cannot be accurately detected in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to water meter freeze detection, in particular to a water meter freeze detection method based on a camera remote water meter. BACKGROUND

[0002] It is well known that water is the source of life, and the daily life of the people is inseparable from water. As a device for measuring the total amount of one-way water flow through the pipeline, water meters can be seen everywhere in daily life, but water meters are often susceptible to extreme weather, which is particularly common in the north.

[0003] Due to the frequent occurrence of cold weather in the north, water meters may freeze and crack. In the case of low temperature, the water inside the water meter will freeze and stop flowing, or the water flow will be very thin; when the temperature is very low, the glass cover on the water meter will break due to thermal expansion and contraction, and then water leakage will occur, affecting normal water use by users, and also causing a large amount of water loss, which will have a serious negative impact on users and society.

[0004] In order to solve the above problems, many northern families will wrap the water meter and pipeline with a thermal insulation layer before the arrival of cold weather to reduce the impact of harsh weather, and also artificially observe whether the water meter has frozen and cracked. However, the water meter is often not discovered until it has frozen and cracked, resulting in some water loss, so it is particularly important to detect and warn the water meter in advance. SUMMARY

[0005] (I) Technical problems solved

[0006] In view of the above shortcomings of the prior art, the present application provides a water meter freeze detection method based on a camera remote water meter, which can effectively overcome the defect that the prior art cannot accurately detect water meter freeze.

[0007] (II) Technical solutions

[0008] To achieve the above purpose, the present application is realized by the following technical solutions:

[0009] A water meter freeze detection method based on a camera remote water meter, comprising the following steps:

[0010] S1, the camera remote water meter collects the dial image, and uses a neural network model to perform initial detection on the dial image;

[0011] S2, image line detection: calculate the total gradient of each pixel point in the gray image corresponding to the dial image, delete most non-edge points by using non-maximum suppression of gradient amplitude, reduce the number of false edges by using a double threshold method, and determine whether cracks appear in the dial image by performing line analysis on the edge image;

[0012] S3, image gradient detection: draw the gradient image corresponding to the dial image, and determine whether cracks appear in the dial image by performing number analysis on the total gradient of all pixel points in the gradient image;

[0013] S4, image brightness detection: draw the gray histogram corresponding to the dial image, and determine whether cracks appear in the dial image by performing image brightness distribution rule analysis on the gray histogram.

[0014] Preferably, the dial image is initially detected in S1 using a neural network model, including:

[0015] An image training set is constructed, and the ResNet-18 network is iteratively trained using the image training set;

[0016] The trained ResNet-18 network is used to classify the input dial image, and whether cracks appear in the dial image is determined according to the classification result;

[0017] The last layer of the ResNet-18 network is a single neuron fully connected layer.

[0018] Preferably, the total gradient of each pixel point in the gray image corresponding to the dial image is calculated in S2, including:

[0019] The horizontal direction gradient G X and the vertical direction gradient G Y of each pixel point in the gray image are calculated using a sobel operator, and the total gradient G of each pixel point is calculated:

[0020] G X =M X *A (1)

[0021] G Y =M Y *A (2)

[0022]

[0023] Wherein, M X is the horizontal direction gradient operator in the sobel operator, M Y is the vertical direction gradient operator in the sobel operator, and A represents the gray image.

[0024] Preferably, before the total gradient of each pixel point in the dial image is calculated in S2, the following steps are included:

[0025] The dial image is subjected to a grayscale operation to become a single-channel image, and the single-channel image is subjected to image filtering by using a Gaussian filter to obtain a relatively smooth grayscale image.

[0026] Preferably, in S2, the non-maximum suppression of the gradient amplitude is used to delete most of the non-edge points, including:

[0027] A gradient amplitude matrix of the image is constructed, the local maximum value of the pixel point is found, and the gray value corresponding to the non-maximum value point is set to 0.

[0028] Preferably, in S2, a double-threshold method is used to reduce the number of false edges, including:

[0029] A high threshold and a low threshold are set, an intermediate edge image is obtained based on the high threshold, and the edges in the intermediate edge image are connected into a contour;

[0030] In the 8-neighborhood of the contour endpoint, a point satisfying the low threshold is found, the point is used as a new starting point, new edges are collected again, and the edges of the entire image are closed to obtain an edge image.

[0031] Preferably, in S2, whether a crack appears in the dial image is determined by analyzing the lines in the edge image, including:

[0032] The horizontal length and the vertical length of each line in the edge image are analyzed, and if the horizontal length and the vertical length of the line both exceed a set pixel number threshold, the line is determined as a crack.

[0033] Preferably, in S3, a gradient graph corresponding to the dial image is drawn, and whether a crack appears in the dial image is determined by analyzing the total gradient of all pixel points in the gradient graph, including:

[0034] The total gradient G' of each pixel point in the gradient graph is calculated by formulas (1)-(3), and the sum T of the total gradients of all pixel points is calculated.

[0035] If the sum T of the total gradients satisfies the following formula, it is determined that a crack appears in the dial image:

[0036] T≥2*H*W (4)

[0037] Wherein, H and W represent the height and width of the gradient graph, respectively.

[0038] Preferably, in S4, a grayscale histogram corresponding to the dial image is drawn, and whether a crack appears in the dial image is determined by analyzing the image brightness distribution rule of the grayscale histogram, including:

[0039] The number of white pixel points with pixel value above 250 in the statistical gray scale histogram is counted, and if the number of white pixel points accounts for more than 40% of the total number of pixel points, it is determined that cracks appear in the dial image.

[0040] Preferably, the horizontal coordinate of the gray scale histogram is 256 points ranging from 0 to 255, and the vertical coordinate represents the number of pixel points with the pixel value corresponding to the current horizontal coordinate value in the image.

[0041] (III) Beneficial Effects

[0042] Compared with the prior art, the water meter freeze crack detection method based on camera remote transmission of the application has the following beneficial effects:

[0043] 1) The method can automatically detect and warn water meter freeze cracks without human intervention, effectively ensure the accuracy of water meter freeze crack detection, and greatly reduce the negative impact of water meter freeze cracks.

[0044] 2) Applying deep learning methods and traditional image detection methods to water meter crack judgment can simultaneously use multiple methods to determine whether the current water meter has cracks, ensuring high water meter freeze crack detection accuracy.

[0045] 3) Picture acquisition and detection are performed at regular intervals to maximize timely warning of water meter freeze cracks and reduce redundant computing overhead (generally, the possibility of water meter freeze cracks developing rapidly within a short time interval is very low), effectively saving computing costs and having high practicality. BRIEF DESCRIPTION OF DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0047] Figure 1 The flowchart of the application;

[0048] Figure 2 The schematic diagram of the sobel operator in the application;

[0049] Figure 3 The dial image and its corresponding edge image in the application;

[0050] Figure 4 The dial image and its corresponding gradient image in the application;

[0051] Figure 5A gray scale histogram corresponding to the dial image. DETAILED DESCRIPTION

[0052] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some embodiments but not all embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0053] A water meter freeze crack detection method based on a camera remote water meter, as shown in Figure 1 The camera remote water meter collects dial images (collects dial images at certain time intervals), and a neural network model is used for initial detection of the dial images.

[0054] The initial detection of the dial images by the neural network model includes:

[0055] An image training set is constructed, and the ResNet-18 network is iteratively trained using the image training set;

[0056] The trained ResNet-18 network is used to classify the input dial images, and whether cracks appear in the dial images is determined according to the classification results.

[0057] The last layer of the ResNet-18 network is a single neuron full connection layer.

[0058] The neural network has been maturely applied in the field of image detection, so the deep learning method is used in the present application to detect cracks in the dial images. When the neural network model is used to detect cracks, the labeled data must be prepared. Firstly, 20,000 dial images are collected, including 10,000 dial images without freeze cracks and 10,000 dial images containing different freeze cracks (1-10 freeze cracks in each image).

[0059] The classic ResNet-18 network is used as the detection model in the present application, and the last layer of the neural network model is a single neuron full connection layer. After the data is prepared, the ResNet-18 network is iteratively trained 1000 times using the above 20,000 dial images, and after the training is completed, the trained neural network model can be used to classify the input dial images, and whether cracks appear in the dial images is determined according to the classification results.

[0060] Since the last layer of the neural network model is a fully connected layer of a single neuron, the output result of the layer is a probability value between 0 and 1, and the possibility of the occurrence of a crack in the current input dial image can be judged based on the output probability value (the probability value is greater than 0.5, indicating that the current input dial image has a crack).

[0061] In the above technical solution, the deep learning method has been used for crack detection of the dial image, but since the collected dial images have diversity, the neural network detection may have the possibility of missing detection. In order to avoid the occurrence of the missing detection phenomenon as much as possible, after the neural network detection, the traditional image detection method is used for crack detection in the present application, further improving the accuracy of crack detection.

[0062] In the traditional image detection method, three sub-methods are mainly included: image line detection, image gradient detection, and image brightness detection, each of which is independent of each other.

[0063] ② Image line detection: calculate the total gradient of each pixel point in the gray image corresponding to the dial image, delete most of the non-edge points by using the non-maximum suppression of the gradient amplitude, and reduce the number of false edges by using a double-threshold method, and judge whether a crack occurs in the dial image by performing line analysis on the edge image (such as the right image in FIG. 8). Figure 3

[0064] For a water meter, if a crack occurs, a line trace will appear in the collected dial image, and the line often presents a certain inclination angle (very few are vertical or horizontal lines). Therefore, in the image line detection, whether a crack occurs in the dial image can be judged by detecting whether there is an inclined angle line in the dial image, and the method of Canny edge detection is used in this part of the present application.

[0065] 1) Before calculating the total gradient of each pixel point in the gray image corresponding to the dial image, it includes:

[0066] The dial image is subjected to a gray-scale operation to become a single-channel image, and a Gaussian filter is used to filter the single-channel image to obtain a relatively smooth gray image.

[0067] Since there may be noise in the image, and the noise is mainly distributed in the high frequency, the existence of the noise will affect the result of the edge detection (the noise will be regarded as part of the edge). Therefore, the present application uses a Gaussian smoothing filter to filter the image.

[0068] 2) Calculate the total gradient of each pixel point in the gray image corresponding to the dial image, including:

[0069] The horizontal direction gradient Gx of each pixel point in the gray image is calculated by using a sobel operator. X ​and vertical gradient G Y And calculate the total gradient G for each pixel:

[0070] G X =M X *A (1)

[0071] G Y =M Y *A (2)

[0072]

[0073] Among them, M X The horizontal gradient operator in the Sobel operator (e.g.) Figure 2 (As shown in the left image), M Y The vertical gradient operator in the Sobel operator (e.g.) Figure 2 (As shown in the image on the right), where A represents a grayscale image.

[0074] 3) Utilize non-maximum suppression of gradient magnitude to remove the vast majority of non-edge points, including:

[0075] Construct an image gradient magnitude matrix, find the local maximum values ​​of pixels, and set the gray values ​​corresponding to non-maximum points to 0.

[0076] For an image gradient magnitude matrix, a larger value at a certain point indicates a larger gradient value at that point. However, this does not necessarily guarantee that the point is on an image edge. Therefore, this application utilizes non-maximum suppression of gradient magnitude to remove most non-edge points by finding the local maximum value of a pixel and then setting the gray value corresponding to the non-maximum point to 0.

[0077] 4) Employ a dual-threshold method to reduce the number of false edges, including:

[0078] Set a high threshold and a low threshold, obtain the intermediate edge image based on the high threshold, and connect the edges in the intermediate edge image to form a contour.

[0079] Find points that meet the low threshold in the 8-neighborhood of the contour endpoints, use these points as new starting points, and collect new edges again until the edges of the entire image are closed, thus obtaining the edge image.

[0080] In the Canny edge detection algorithm, a dual-threshold method is used to reduce the number of false edges to minimize information interference. First, a high threshold is set to obtain the intermediate edge image. Because the threshold is set too high, although the image will contain few false edges, the edges may not be closed. Therefore, a low threshold is then set.

[0081] For the intermediate edge image, its edges are connected into a contour, and a point satisfying a low threshold value is found in the 8-neighborhood of the contour endpoint, which is taken as a new starting point, and a new edge is collected again until the edges of the whole image are closed, and finally an edge image is obtained (as shown in the left image of FIG. 3, which records the line information contained in the image). Figure 3

[0082] 5) Determine whether a crack appears in the dial image by performing line analysis on the edge image, including:

[0083] Analyze the horizontal length and vertical length of each line in the edge image, and if the horizontal length and vertical length of the line both exceed a set pixel quantity threshold value (6 pixels), the line is determined to be a crack.

[0084] III. Image gradient detection: draw a gradient map corresponding to the dial image (as shown in the right image of FIG. 3), and determine whether a crack appears in the dial image by performing quantity analysis on the total gradient of all pixel points in the gradient map, including: Figure 4

[0085] Calculate the total gradient G' of each pixel point in the gradient map by formulas (1)-(3), and calculate the sum T of the total gradients of all pixel points.

[0086] If the sum T of the total gradients satisfies the following formula (which indicates that the total gradient value of the current dial image is very large), it is determined that a crack appears in the dial image:

[0087] T≥2*H*W (4)

[0088] Where H and W represent the height and width of the gradient map, respectively.

[0089] If a line appears in an image, the gradient value at the position corresponding to the line must be very large. Therefore, in the image gradient detection, the gradient map corresponding to the dial image can be drawn, and then it is determined whether a crack appears in the dial image by determining whether the sum of the total gradients of all pixel points in the gradient map exceeds a set gradient threshold value. If the sum of the total gradients is not less than the set gradient threshold value, it is determined that a crack appears in the dial image.

[0090] IV. Image brightness detection: draw a gray scale histogram corresponding to the dial image (as shown in FIG. 4), and determine whether a crack appears in the dial image by performing image brightness distribution rule analysis on the gray scale histogram, including: Figure 5

[0091] Count the number of white pixel points with a pixel value above 250 in the gray scale histogram, and if the number of white pixel points accounts for more than 40% of the total number of pixel points, it is determined that a crack appears in the dial image.

[0092] ​​​The grayscale histogram has 256 points on the horizontal axis, ranging from 0 to 255, and the vertical axis represents the number of pixels in the image whose pixel value corresponds to the current horizontal axis value.

[0093] When capturing watch face images, if cracks are present, the reflected light from the crack's cross-section will cause the overall image to appear relatively white (compared to when there are no cracks). Therefore, in image brightness detection, color component analysis of the watch face image can be used to determine whether cracks exist.

[0094] The specific method involves converting the acquired dial image to grayscale and then plotting its grayscale histogram (e.g., ...). Figure 5 (As shown). The grayscale histogram has 256 points on the horizontal axis, ranging from 0 to 255, and the vertical axis represents the number of pixels in the image whose pixel value corresponds to the current horizontal axis value. This histogram describes the distribution of pixel values ​​in the dial image. Since the pixel value of white pixels tends to be close to 255, only the number of "white pixels" with a pixel value of 250 or higher is counted.

[0095] Since image brightness detection is performed after all the aforementioned detection methods, it indicates that there is a high probability that the current dial image shows few or no cracks on the water meter. Therefore, the proportion of "white pixels" in the entire image is usually not too large. Related experimental statistics show that when at least one crack appears on the water meter, the proportion of "white pixels" can generally reach over 40%. Therefore, in image brightness detection, a threshold of 40% is set; when the proportion of "white pixels" reaches 40%, a crack is considered to have appeared in the dial image.

[0096] In the technical solution of this application, deep learning methods and traditional image detection methods are applied to the judgment of water meter cracks. Multiple methods can be used simultaneously to determine whether there are cracks in the current water meter, which can ensure a high accuracy of water meter freezing crack detection.

[0097] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A water meter freeze crack detection method based on camera remote water meter, characterized in that: The method comprises the following steps: S1, a camera remote water meter collects a dial image, and a neural network model is used for initial detection of the dial image; S2, image line detection: the total gradient of each pixel point in the gray image corresponding to the dial image is calculated, and most of the non-edge points are deleted by using non-maximum suppression of the gradient amplitude, and a double-threshold method is used to reduce the number of false edges, and whether a crack appears in the dial image is judged by line analysis of the edge image; S3, image gradient detection: a gradient image corresponding to the dial image is drawn, and whether a crack appears in the dial image is judged by number analysis of the total gradient of all pixel points in the gradient image; S4, image brightness detection: a gray histogram corresponding to the dial image is drawn, and whether a crack appears in the dial image is judged by analyzing the image brightness distribution rule of the gray histogram; In S2, the total gradient of each pixel point in the gray image corresponding to the dial image is calculated, including: The sobel operator is used to calculate the horizontal gradient G of each pixel point in the gray image X and the vertical gradient G Y , and the total gradient G of each pixel point is calculated: G X = M X * A (1) G Y = M Y * A (2) wherein M X is a horizontal gradient operator in the Sobel operator, M Y is a vertical gradient operator in the Sobel operator, and A represents a grayscale image. In S2, most of the non-edge points are deleted by using non-maximum suppression of the gradient amplitude, including: An image gradient amplitude matrix is constructed, the local maximum value of the pixel point is found, and the gray value corresponding to the non-maximum value point is set to 0; In S2, the double-threshold method is used to reduce the number of false edges, including: A high threshold and a low threshold are set, an intermediate edge image is obtained based on the high threshold, and the edges in the intermediate edge image are connected into a contour; In the 8-neighborhood of the contour endpoint, a point satisfying the low threshold is found, which is used as a new starting point, and new edges are collected again until the edges of the whole image are closed to obtain an edge image; In S2, whether a crack appears in the dial image is judged by line analysis of the edge image, including: The horizontal length and vertical length of each line in the edge image are analyzed, and if the horizontal length and vertical length of the line both exceed a set pixel number threshold, the line is determined as a crack.

2. The camera-based remote water meter based water meter freeze crack detection method according to claim 1, characterized in that: In S1, the neural network model is used for initial detection of the dial image, including: An image training set is constructed, and the ResNet-18 network is iteratively trained using the image training set; The trained ResNet-18 network is used for classification of the input dial image, and whether a crack appears in the dial image is judged according to the classification result; The last layer of the ResNet-18 network is a single neuron full connection layer.

3. The camera-based remote water meter based water meter freeze crack detection method according to claim 1, characterized in that: Before S2, the total gradient of each pixel point in the gray image corresponding to the dial image is calculated, including: The dial image is subjected to a grayscale operation to become a single-channel image, and a Gaussian filter is used for image filtering of the single-channel image to obtain a relatively smooth gray image.

4. The camera-based remote water meter based water meter freeze crack detection method according to claim 1, characterized in that: In S3, the gradient image corresponding to the dial image is drawn, and whether a crack appears in the dial image is judged by number analysis of the total gradient of all pixel points in the gradient image, including: The total gradient G' of each pixel point in the gradient image is calculated by formulas (1)-(3), and the sum T of the total gradients of all pixel points is calculated; If the sum T of the total gradients satisfies the following formula, it is determined that a crack appears in the dial image: T≥2*H*W (4) Wherein, H and W represent the height and width of the gradient image, respectively.

5. The camera-based remote water meter based water meter freeze crack detection method according to claim 1, characterized in that: In S4, a gray scale histogram corresponding to the dial image is drawn, and whether a crack appears in the dial image is determined by analyzing the image brightness distribution rule of the gray scale histogram, including: The number of white pixel points with pixel values above 250 in the gray scale histogram is counted, and if the number of white pixel points accounts for more than 40% of the total number of pixel points, it is determined that a crack appears in the dial image.

6. The camera-based remote water meter based water meter freeze crack detection method according to claim 5, characterized in that: The abscissa of the gray scale histogram is 256 points, ranging from 0 to 255, and the ordinate represents the number of pixel points with pixel values corresponding to the current abscissa value in the image.

Citation Information

Patent Citations

  • Surface crack texture extraction method based on fusion of seepage algorithm and adaptive Canny algorithm

    CN106446905A