Rapid image recognition method for water quality condition in water supply pipeline

Through image processing technology and super-resolution method, real-time monitoring of water quality turbidity in water supply pipelines is solved, and the problem of low turbidity detection in water supply pipelines is achieved, rapid and accurate identification of water quality conditions is achieved, ensuring the safety and reliability of the water supply system.

CN120279420APending Publication Date: 2025-07-08TONGJI UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510415134.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and accurately detect water quality conditions under low turbidity in urban water supply pipelines, especially affected by light and sediment types. The traditional methods are not effective in a closed pipeline environment.

Method used

Image processing methods are adopted, including image acquisition, grayscale processing, high-resolution image generation, turbidity parameter segmentation and feature enhancement, and region detection and binary processing are performed using the average signal-to-noise ratio and Sauvola method. Combined with super-resolution technology and denoising algorithms, real-time monitoring is achieved through pipeline detection robots and intelligent image data acquisition and analysis workstations.

Benefits of technology

It realizes rapid and accurate monitoring of the turbidity of water in the water supply pipeline, improves detection efficiency and accuracy, reduces interference to the water supply system, and ensures the sustainability and safety of water supply.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279420A_ABST
    Figure CN120279420A_ABST
Patent Text Reader

Abstract

The invention provides a quick image recognition method for the water quality condition in a water supply pipeline, and the method is characterized in that a high-definition camera with a light source is used for obtaining a color image in the underground water supply pipeline, the color image is converted into a gray image through an OpenCV method, the gray image is converted into a high-resolution image through a super-resolution method, and the high-resolution image is used for recognizing the water quality condition in the underground water supply pipeline. Carrying out segmentation and feature enhancement on a distribution region of suspended particulate matters in the high-resolution image by applying an average signal-to-noise ratio, a local self-adaptive thresholding algorithm and a denoising algorithm, extracting a region related to a water quality turbidity parameter, comparing a feature region containing the water quality turbidity parameter with a standard water quality turbidity grade image database, and obtaining a water quality turbidity grade image; and judging the turbidity grade of water in the in-service water supply pipeline. According to the invention, rapid identification and real-time monitoring of the pipeline water quality turbidity grade in the water supply network are effectively realized, and a new method is provided for rapid identification and condition monitoring of the water quality of the water supply network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of urban water supply network pipeline detection, and in particular proposes a rapid image recognition method for water quality conditions in a water supply pipeline. Background Art

[0002] Water supply networks are often laid underground. Due to external and internal influences, the pipes are prone to aging or damage, which can cause water quality to deteriorate and water to become turbid. The current national standard of the People's Republic of China, "Sanitary Standard for Drinking Water (GB 5749-2022)", clearly states that water turbidity is one of the water quality testing indicators. The turbidity parameter is an important indicator for measuring the concentration of suspended particles in water and a key parameter for evaluating the cleanliness and safety of water quality. Water quality testing is an important part of water supply security and is directly related to human drinking water safety and the sustainable use of water resources.

[0003] Traditional water quality turbidity detection that relies on manual sampling and laboratory analysis has limitations in sampling preservation, laboratory test efficiency, green testing, and comprehensive testing costs. With the development of artificial intelligence technology and sensor technology, the use of computer image processing technology for online water quality detection has gradually emerged. Chinese patent CN116168026 "Water quality detection method and system based on computer vision" mainly solves the technical problem of threshold denoising in open water water quality detection, thereby improving the accuracy of water quality turbidity detection. Chinese patent CN116934636 "A smart management system for real-time water quality monitoring data" mainly solves the problem of poor enhancement effect of suspended matter areas in water body images, resulting in poor management effect of real-time water quality monitoring data. At present, some artificial intelligence methods in image processing have limited applicability. For example, the coupling method of red, green and blue color modes with various clustering models has been widely used in the identification of high turbidity in lakes, fish ponds and other water bodies. Urban water supply pipelines are relatively closed, and external damage and pipeline aging have become the main reasons affecting the water quality in the water supply pipelines. However, the results of the detection of low turbidity (<30NTU) in urban water supply pipelines are greatly affected by environmental factors such as light and sediment types. The existing red, green and blue color mode coupled with various clustering models cannot be applied to the turbidity detection of water quality in urban water supply networks. At present, the rapid online detection of water quality in water supply pipelines has also become a technical problem that needs to be solved in the industry. Summary of the invention

[0004] The purpose of the present invention is to provide a method for rapid image recognition of water quality conditions in a water supply pipeline, thereby achieving real-time monitoring of water turbidity while the water supply pipeline is running.

[0005] The image processing method provided by the present invention includes image acquisition, arrangement, grayscale processing of the image, generation of a high-resolution image, segmentation of turbidity parameters, and feature enhancement. The grayscale conversion means converting a color image into a grayscale image. The high-resolution image first converts the grayscale image into a low-resolution image and then into a high-resolution image. The segmentation and feature enhancement of the water quality turbidity parameters extract turbidity parameter features: first, the mean signal-to-noise ratio (MSNR) method is used for region detection, then the Sauvola method is used for binarization processing, and finally, a denoising algorithm is used for target feature enhancement.

[0006] To achieve the above object, the technical solution of the present invention is a rapid image recognition method for the water quality condition in a water supply pipeline, characterized in that: the method includes the following steps,

[0007] S1. Prepare a water supply pipeline inspection robot, an intelligent image data acquisition, processing, analysis workstation, and a standard water quality turbidity grade image dataset;

[0008] S2. Deploy the inspection robot and connect the inspection robot to the intelligent image data acquisition, processing, analysis workstation by signal;

[0009] S3. The pipeline inspection robot collects real-time information of the color image in the water supply pipeline, and the intelligent image data acquisition, processing, analysis workstation generates a water quality sampled static color image group of the water supply pipeline;

[0010] S4. The intelligent image data acquisition, processing, analysis workstation uses the processing algorithm OpenCV to convert the water quality sampled static color image of the water supply pipeline into a grayscale image containing water quality turbidity parameters;

[0011] S5. The intelligent image data acquisition, processing, analysis workstation uses super-resolution technology to convert the grayscale image with water quality turbidity parameters into a high-resolution image;

[0012] S6. The intelligent image data acquisition, processing, analysis workstation segments and enhances the distribution area of suspended particles in the high-resolution image containing water quality turbidity parameters, and extracts a feature area image containing water quality turbidity parameters;

[0013] S7. The intelligent image data acquisition, processing, analysis workstation compares the feature area image containing water quality turbidity parameters with the standard water quality turbidity grade image dataset to find the closest turbidity grade image, so as to determine the water quality turbidity grade of the water body to be measured in the in-service water supply pipeline.

[0014] In step S1 of the above rapid image recognition method for the water quality condition in a water supply pipeline:

[0015] The pipeline inspection robot has the waterproof ability to operate normally in the pressurized water supply pipeline, and is equipped with sensors such as a cluster light source, a high-sensitivity photosensor, a high-definition camera unit, and a storage unit. It can safely collect water quality images in the pressurized water supply pipeline and detect the water supply pipeline to be detected;

[0016] The intelligent image data acquisition, processing and analysis workstation collects continuous image data from the pipeline inspection robot, obtains a continuous cross-sectional static image group in the water supply pipeline and stores it, and through the Visual Studio Code software, realizes the rapid image processing and recognition of the water quality status in the water supply pipeline; it can compare the processed water quality turbidity parameter image with the standard turbidity image set to determine and display the turbidity level of the water quality to be detected;

[0017] The standard water quality turbidity level image data set is obtained through indoor experiments. A spectrophotometer is used to measure the standard turbidity solution prepared in the laboratory, and the turbidity parameter values of different turbidity levels are extracted. At the same time, image recognition technology is used to identify and read the number of suspended particles in the standard turbidity solution, and the characteristics of the suspended particles are mapped to the turbidity parameter values. Taking NTU as the unit, a standard data set of water quality turbidity at different levels is established.

[0018] In step S2 of the rapid image recognition method for the water quality status in the above-mentioned water supply pipeline:

[0019] A signal connection is established between the in-pipeline inspection robot and the intelligent image data acquisition, processing and analysis workstation. The pipeline inspection robot is placed at the detection positions such as the valve well of the water supply pipe network to be detected, and the placement point is located at the starting point or a position close to the starting point of the main pipeline of this section.

[0020] In step S3 of the rapid image recognition method for the water quality status in the above-mentioned water supply pipeline:

[0021] While flowing with the water in the water supply pipeline, the pipeline inspection robot takes color images of the water body to be detected. The color image information collected by the pipeline inspection robot includes but is not limited to continuous videos and images, and has a set high frame rate. These color image information contains the real-time information of the water quality in the water supply pipeline;

[0022] The intelligent image data acquisition, processing and analysis workstation receives and stores the color image information collected by the pipeline inspection robot, extracts single-frame images from continuous images and videos at a set frame rate interval, constructs a Python 3.11.5 ('torch') environment through Anaconda, and creates an OpenCV program based on the Python programming language. Using the OpenCV program, single-frame images are extracted from continuous images and videos at a set frame rate interval as water quality image samples and saved to a specified folder. Then, different angles of the local and overall parts of the water quality image samples are intercepted and classified to obtain a continuous cross-sectional static color image group of the water body sample to be measured in the water supply pipeline.

[0023] In step S4 of the above method for rapid image recognition of water quality conditions in the water supply pipeline:

[0024] The intelligent image data acquisition, processing and analysis workstation directly reads the grayscale values of the static water quality sample images through OpenCV code, normalizes the image grayscale values, and then adjusts the brightness of the grayscale images to enhance the signal reflecting the water turbidity characteristics in the grayscale images, obtaining the processed grayscale images.

[0025] In step S5 of the above method for rapid image recognition of water quality conditions in the water supply pipeline:

[0026] The intelligent image data acquisition, processing and analysis workstation uses the fast direct super-resolution (FDSR) technology to convert the grayscale images into high-resolution images. Specifically, the method is to split the grayscale image space with water turbidity parameters into multiple subspaces, and learn simple mapping functions from the training image patches in each subspace; at the same time, an adaptive mechanism for high-resolution image generation is adopted. This adaptive mechanism is given a set of original underwater image original resolution training images (I o ), and a low-resolution (L R ) image I L is generated through formula ①,

[0027]

[0028] In the formula, is the convolution operator of the Gaussian kernel G, ↓s is the downsampling operator,

[0029] A set of original resolution images and low-resolution (L R ) image I L patches are generated from the underwater images, and then the parameters of the high-resolution images are trained using the ORs and LRs datasets, and their mapping function is denoted as F(x). Finally, the parameters of the high-resolution images are transferred from ORs-LRs to generate the high-resolution image I H , as shown in formula ②:

[0030] IH = F(I O ) ②

[0031] where I o is a set of original underwater image training images at the original resolution.

[0032] In step S6 of the above method for rapid image recognition of water quality conditions in a water supply pipeline:

[0033] The method for segmenting the distribution area of suspended particles in a high-resolution image containing water quality turbidity characteristics by the intelligent image data acquisition, processing, and analysis workstation is to introduce the mean signal-to-noise ratio (MSNR) to describe the contrast of the high-resolution image. This ratio is defined by Equation ③ and Equation ④, and this ratio is used as a parameter for automatically optimizing the MSNR and Sauvola methods.

[0034]

[0035] MSNR = max(M - x i ) 2 , i = 1, 2, …, n ④

[0036] where n represents the number of pixels, M represents the average value of pixels in the entire image, x i represents the i-th pixel, and max is the maximum pixel value;

[0037] The intelligent image data acquisition, processing, and analysis workstation extracts preliminary water quality turbidity parameters from the distribution area of suspended particles in a high-resolution image containing water quality turbidity characteristics by using the Sauvola method of local threshold segmentation, that is, extracts water quality turbidity parameters based on the distribution characteristics of particles or suspended substances in the image. The specific method steps are as follows: The MSNR method requires manually specifying the maximum area change between extreme value regions and the step size between intensity threshold levels, and then performing Sauvola local binarization processing on the water quality turbidity parameters extracted by MSNR. This Sauvola local binarization processing requires manually specifying an appropriate window size and the fixed coefficient k in Equation ⑤ to obtain a complete target area; Each pixel is regarded as a center, and a sliding window slides pixel by pixel on the image with a step size of 1 pixel. The length and width of the sliding window are 1 - 3% of the size of the entire image. In each sliding window, first, the Sauvola method is used to obtain the local threshold within the sliding window. The specific algorithm is shown in Equation ⑤:

[0038]

[0039] Among them, T(x, y) represents the threshold at the sliding window (x, y) calculated according to the local contrast. R represents the maximum standard deviation of all possible pixels in the image. For a grayscale image, it is set to 128. k is a fixed coefficient, and its value is usually 0.34. m(x, y) is the average pixel value of all pixels in the sliding window, and δ(x, y) is the standard deviation of all pixels in the sliding window. When the pixel values in the region change greatly, the contrast is large, and the regional standard deviation δ(x, y) will approach the maximum standard deviation R.

[0040] The method for the intelligent image data acquisition, processing and analysis workstation to enhance the characteristics of the distribution area of suspended particles in a high-resolution image containing water turbidity characteristics is to use a denoising algorithm based on breakpoint connection in the spatial domain to achieve water turbidity characteristic enhancement. Centered on each pixel, it is divided into many small units using a small rectangular window that accounts for 1-3% of the complete water turbidity parameters. Subsequently, the threshold of each small unit is calculated using Equation ⑥, and the total number of all pixels is obtained, where white pixels are regarded as valid pixels. The number of valid pixels (marked as N rect ) in the rectangular area is compared with the threshold to determine whether the central pixel is a biological boundary feature point.

[0041]

[0042] Where T value represents the adaptive threshold. N rectangle is the number of all pixels in the custom-set rectangular window. The floor equation represents rounding down. The valid pixels in 0.75N must be located within one of the rectangular windows or between two adjacent rectangular windows, otherwise the area will be regarded as background or noise.

[0043] Main advantages and technical effects of the present invention:

[0044] The present invention uses computer vision combined with image processing methods to achieve rapid identification and real-time monitoring of water turbidity parameters in the water supply pipeline to be inspected, so as to replace traditional manual sampling and laboratory analysis.

[0045] The present invention applies video detection technology to obtain clear video and picture parameters of the water body in the pipeline. By combining with computer vision and image processing methods, it can monitor the water turbidity in real time while the water supply pipeline is operating, which is an efficient and economical means. With the development of new artificial intelligence technology and acquisition sensor technology, using new methods to monitor the internal water quality parameters of the water supply pipeline to be inspected will be more efficient and accurate, and also reduce the interference to the water supply system, ensuring the continuity and safety of water supply, providing a scientific basis for the maintenance and management of the water supply pipeline, and helping to ensure the safety and reliability of urban water supply.

[0046] The present invention adopts an integrated pipeline inspection robot, which is equipped with a variety of sensors (such as a cluster light source, a high-sensitivity photosensor, etc.), greatly improving the efficiency of real-time capturing of color images in the water supply pipeline, and at the same time significantly enhancing the imaging quality, laying a solid foundation for subsequent operations.

[0047] The present invention applies a super-resolution method to split the image subspace and learn the mapping function, and realizes the efficient generation of high-resolution images by training parameters, enhancing the visibility of image details. And by using the average signal-to-noise ratio and local adaptive thresholding (Sauvola method), precise segmentation and feature extraction of suspended particulate matter are carried out, and local analysis is assisted by a small rectangular window, improving the accuracy of distinguishing noise from key feature points and the recognition accuracy of the suspended particle region. Comparing and calibrating the identified image features with the existing laboratory standard water quality standard image set in the computer improves the efficiency and accuracy of quickly determining the water quality level, and improves the reliability and comparability of water quality detection in the pipeline. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a schematic diagram of the fast image recognition system, the fast image recognition steps and the method for the water quality condition in the water supply pipeline of the present invention.

[0049] Figure 2 It is a logic block diagram of the water quality image processing method in the water supply pipeline of the present invention.

[0050] Figure 3 It is a schematic diagram of the self-mechanism for generating high-resolution images of the present invention.

[0051] Figure 4 It is a binarization schematic diagram of using the local threshold algorithm of the present invention.

[0052] In the above drawings, 1 is the soil around the buried pipeline, 2 is the water supply pipeline, 3 is the pipeline inspection robot, 4 is the intelligent image data acquisition, processing and analysis workstation, 5 is the static color image of the detection sample in the water supply pipeline, 6 is the process of reading, normalizing and brightening the gray value of the static color image, 7 is the gray image, 8 is the process of converting the resolution of the gray image, 9 is the high-resolution image, 10 is the process of performing the average signal-to-noise ratio, local adaptive threshold algorithm and denoising algorithm on the high-resolution image, 11 is the characteristic region containing the water quality turbidity parameter. 21 is the gray image, 22 is the low-resolution image, 23 is the high-resolution image, 24 is the water body impurities, 25 is the image of the water quality turbidity parameter after segmentation and feature enhancement. DETAILED DESCRIPTION OF THE INVENTION

[0053] The following will describe in more detail a technology for evaluating the water quality in a water supply pipeline based on the in-pipeline detection data of the present invention with reference to the accompanying drawings, in which the preferred embodiments of the present invention are shown. It should be understood that those skilled in the art can modify the present invention described herein while still achieving the advantageous effects of the present invention. Therefore, the following description should be understood as a broad guidance for those skilled in the art and not as a limitation to the present invention.

[0054] Embodiment:

[0055] This embodiment provides a rapid image recognition system and method for the turbidity of water quality in a water supply pipeline. As shown in the attached Figure 1 figure, the system consists of a water supply pipeline water body detection robot (3) and an intelligent image data acquisition, processing, and analysis workstation (4). A control signal and data are transmitted between the water supply pipeline water body detection robot (3) and the intelligent image data acquisition, processing, and analysis workstation (4) through a wired cable. The water supply pipeline water body detection robot (3) selects the Snake60 robot. The water supply pipeline water body detection robot (3) acquires the color image information of the water body in the pipeline. The intelligent image data acquisition, processing, and analysis workstation (4) receives the color image information taken by the water supply pipeline water body detection robot (3), organizes the water body color image information into a sampled static color image group, and stores it. The intelligent image data acquisition, processing, and analysis workstation (4) processes the static color image group of the water sample to be measured, generates a grayscale image, a high-resolution image, and a feature region image containing the water body turbidity parameter respectively, and compares the feature region image with the standard turbidity parameter image set. The turbidity level result of the water sample to be measured is displayed on the intelligent image data acquisition, processing, and analysis workstation (4).

[0056] This embodiment provides the steps and methods for processing the water quality image in the water supply pipeline, as shown in the attached Figure 2 figure.

[0057] Step S1: Prepare a water supply pipeline detection robot (3), an intelligent image data acquisition, processing, and analysis workstation (4), and a standard water quality turbidity level image data set.

[0058] The pipeline detection robot (3) selects the Snake60 robot, which has the waterproof ability to operate normally in a pressurized water supply pipeline and is equipped with sensors such as a cluster light source, a high-sensitivity photosensor, a high-definition camera unit (50 million pixels), and a storage unit. It can safely collect water quality images in a pressurized water supply pipeline and detect the water supply pipeline to be monitored;

[0059] The intelligent image data acquisition, processing and analysis workstation (4) can control the pipeline inspection robot (3), collect and store continuous image data from the pipeline inspection robot, pre-store a standard turbidity image set, and through the Visual StudioCode software, realize the rapid image processing and recognition of the water quality status in the water supply pipeline; it can compare the processed water quality turbidity parameter image with the standard turbidity image set to determine and display the turbidity level of the water quality to be measured.

[0060] The intelligent image data acquisition, processing and analysis workstation (4) extracts single-frame images from continuous images and videos at a set frame rate interval, constructs a Python3.11.5 ('torch') environment through Anaconda, and creates an OpenCV program based on the Python programming language. The OpenCV program extracts single-frame images from continuous images and videos at a set frame rate interval as water quality image samples and saves them to a specified folder, and then intercepts different angles of the local and overall water quality image samples for classification to obtain a static color image data set of the water sample to be measured.

[0061] The standard water quality turbidity level image data set is obtained through indoor experiments. A spectrophotometer is used to measure the standard turbidity solution prepared in the laboratory, and the turbidity parameter values of different turbidity levels are extracted. At the same time, image recognition technology is used to identify and read the number of suspended particles in the standard turbidity solution, and the characteristics of the suspended particles are mapped to the turbidity parameter values. Taking NTU as the unit, a standard data set of water quality turbidity standards at different levels is established.

[0062] Step S2: Deploy the water supply pipeline inspection robot (3) and connect the inspection robot to the intelligent image data acquisition, processing and analysis workstation (4) for signal connection.

[0063] One Snake60 water supply pipeline internal inspection robot is selected as the pipeline inspection robot and is deployed at inspection sites such as the valve wells of the water supply pipe network to be monitored. The deployment point is at the starting point or a position close to the starting point of the main pipeline of this section.

[0064] Step S3: While the pipeline inspection robot is flowing with the water in the water supply pipeline, it captures real-time color image information, and the intelligent image data acquisition, processing and analysis workstation generates a water supply pipeline water quality sampled static color image group;

[0065] The color image information collected by the pipeline inspection robot includes images and videos, but is not limited to continuous videos and images, and has a set high frame rate. The video frame rate is 30 frames per second. These color image information contain the real-time information of the water quality in the water supply pipeline.

[0066] The intelligent image data acquisition, processing, and analysis workstation receives, stores, and analyzes the color continuous image information collected by the pipeline inspection robot. It uses PotPlayer to set the frame rate and extracts single-frame images from the continuous cross-sectional images and videos at intervals. Through Anaconda, a Python 3.11.5 ('torch') environment is constructed, and an OpenCV program is created based on the Python programming language. Using the OpenCV program, single-frame images from the continuous images and videos are extracted at the set frame rate interval (extracting 1 image every 10 frames) as water quality image samples and saved to a specified folder. Then, different angles of the local and overall parts of the water quality image samples are intercepted and classified to obtain a static color image data set of the water body sample to be measured.

[0067] Step S4: The intelligent image data acquisition, processing, and analysis workstation uses the processing algorithm OpenCV to convert the water quality sampled static color image of the water supply pipeline into a grayscale image (6) containing water quality turbidity parameters.

[0068] The intelligent image data acquisition, processing, and analysis workstation directly reads the grayscale values of the water quality sample static images through OpenCV code, normalizes the image grayscale values, and then adjusts the brightness of the grayscale image to enhance the signal reflecting the water quality turbidity characteristics in the grayscale image, obtaining the processed grayscale image.

[0069] Step S5: The intelligent image data acquisition, processing, and analysis workstation uses super-resolution technology to convert the grayscale image with water quality turbidity parameters into a high-resolution image (8).

[0070] The intelligent image data acquisition, processing, and analysis workstation uses the fast direct super-resolution (FDSR) technology to convert the grayscale image (7) into a high-resolution image (9). Specifically, by splitting the space of the grayscale image with water quality turbidity characteristics into multiple subspaces, a simple mapping function is learned from the training image patches in each subspace; at the same time, an adaptive mechanism for high-resolution image generation is adopted. This adaptive mechanism is given a set of original underwater image original resolution training images (I o ), and a low-resolution (L R ) image I L ,

[0071]

[0072] In the formula, is the convolution operator of the Gaussian kernel G, ↓s is the downsampling operator,

[0073] Generate a set of original resolution images and low-resolution (L R ) images I LPatch pairs are then used to train the parameters of high-resolution images with ORs and LRs datasets, and its mapping function is denoted as F(x). Finally, the parameters of high-resolution images are transferred from ORs-LRs to generate high-resolution image I H , as shown in Equation ②:

[0074] I H = F(I O ) ②

[0075] where I o is a set of original underwater image training images at the original resolution.

[0076] Appendix Figure 3 shows a schematic diagram of the self-mechanism from a grayscale image (21) to a low-resolution image (22), and then to generate a high-resolution image (23).

[0077] Step S6: The intelligent image data acquisition, processing and analysis workstation uses the mean signal-to-noise ratio (MSNR) and the local adaptive thresholding algorithm to segment and enhance the features of the distribution area of suspended particles in the high-resolution image containing water quality turbidity parameters (10). After implementing the fully connected layer in the network through image convolution, a feature region image (11) containing water quality turbidity parameters is extracted.

[0078] The intelligent image data acquisition, processing and analysis workstation segments the distribution area of suspended particles in the high-resolution image containing water quality turbidity parameters, aiming to separate the water quality turbidity parameters from the complex and high-noise background and reduce the interference of background noise. This segmentation method is to introduce the mean signal-to-noise ratio (MSNR) to describe the contrast of this high-resolution image. This ratio is defined by Equation ③ and Equation ④, and this ratio is used as a parameter for automatically optimizing the MSNR and Sauvola methods.

[0079]

[0080] MSNR = max(M - x i ) 2 , i = 1, 2, …, n ④

[0081] where n represents the number of pixels, M represents the average value of pixels in the entire image, x i represents the i-th pixel, and max is the maximum pixel value.

[0082] The intelligent image data acquisition, processing and analysis workstation takes the distribution area of suspended particles in a high-resolution image containing water quality turbidity characteristics as the target object, and preliminarily extracts water quality turbidity parameters for the distribution area of suspended particles in the target object. Using the Sauvola method of local threshold segmentation, in each sliding window, first obtain the local threshold within the sliding window by the Sauvola method, that is, extract water quality turbidity parameters based on the distribution characteristics of particles or suspended substances in the image. The specific method steps are as follows. This MSNR method requires manually specifying the maximum area change between extreme value regions and the step size between intensity threshold levels, and then perform Sauvola local binarization processing on the water quality turbidity parameters extracted by MSNR. This Sauvola local binarization processing requires manually specifying an appropriate window size and the fixed coefficient k in Equation ⑤ to obtain a complete target area; regard each pixel as a center, and use a sliding window to slide pixel by pixel on the image with a step size of 1 pixel. The length and width of the sliding window are 1-3% of the entire image size. In each sliding window, first obtain the local threshold within the sliding window by the Sauvola method. The specific algorithm is shown in Equation ⑤:

[0083]

[0084] Among them, T(x, y) represents the threshold at the sliding window (x, y) calculated according to the local contrast, R represents the maximum standard deviation of all pixels that may appear in the image, the grayscale image is set to 128, k is a fixed coefficient, and its value is usually 0.34. m(x, y) is the average pixel value of all pixels in the sliding window, and δ(x, y) is the standard deviation of all pixels in the sliding window. When the pixel values in the region change greatly, the contrast is large, and the regional standard deviation δ(x, y) will approach the maximum standard deviation R.

[0085] The method for the intelligent image data acquisition, processing and analysis workstation to enhance the characteristics of the distribution area of suspended particles in a high-resolution image containing water quality turbidity characteristics is to use a denoising algorithm based on breakpoint connection in the spatial domain to achieve water quality turbidity characteristic enhancement. The specific method is as follows. Taking each pixel as the center, use a small rectangular window accounting for 1-3% of the complete water quality turbidity parameters to divide it into many small units; subsequently, calculate the threshold of each small unit using Equation ⑥ and obtain the total number of all pixels, where white pixels are regarded as valid pixels. Compare the number of valid pixels (marked as N rect ) within the rectangular area with the threshold to determine whether the central pixel is a biological boundary feature point:

[0086]

[0087] Among them, T valueIt is indicated that the adaptive threshold N rectangle is the number of all pixels in the custom - set rectangular window. The floor equation represents rounding down. The valid pixels in 0.75N must be within one of the rectangular windows or between two adjacent rectangular windows. Otherwise, this area will be regarded as background or noise.

[0088] See the appendix Figure 4 After segmenting and enhancing the features of the distribution area of suspended particulate matter (24) in the high - resolution image (23), the water quality turbidity parameter extraction is carried out again to form a characteristic area image (25) containing water quality turbidity parameters.

[0089] Step S7: The intelligent image data acquisition, processing and analysis workstation compares the characteristic area image (25) containing water quality turbidity parameters with the standard water quality turbidity grade image data set, finds the closest turbidity grade image, and thus determines and displays the water quality turbidity grade of the water body to be measured in the in - service water supply pipeline.

[0090] The national standard "Standard Test Methods for Drinking Water (GB5750.1~5750.13 - 2023)" stipulates that the standard grades of water quality turbidity parameters are Grade I, Grade II, Grade III, and Grade IV respectively. The standard for the water quality turbidity NTU should be < 1 to be qualified, and the turbidity level reaching this value is defined as Grade I. The standard only clarifies the qualified and unqualified standards. Within the unqualified range, it is custom - divided into Grade II, Grade III, and Grade IV, and the grades are delimited in the way of increasing by an order of magnitude.

[0091] If the characteristic area image containing water quality turbidity parameters is highly similar to the parameter set of the Grade IV standard grade image, the water quality turbidity grade of the water supply pipeline to be detected will be displayed as Grade IV on the intelligent image data acquisition, processing and analysis workstation.

[0092] The above is only the preferred embodiment of the present invention and does not impose any limitation on the present invention. Any person skilled in the art, without departing from the scope of the technical solution of the present invention, makes any form of equivalent replacement or modification and other changes to the technical solution and technical content disclosed by the present invention, which still belong to the content within the scope of the technical solution of the present invention and are still within the protection scope of the present invention.

Claims

1. A rapid image recognition method for the water quality condition in a water supply pipeline, characterized in that: The method includes the following steps: S1. Prepare a water supply pipeline detection robot, an intelligent image data acquisition, processing, analysis workstation, and a standard water quality turbidity level image dataset; S2. Deploy the detection robot and connect the detection robot to the intelligent image data acquisition, processing, analysis workstation via signals; S3. The pipeline detection robot collects real-time information of the color images inside the water supply pipeline, and the intelligent image data acquisition, processing, analysis workstation generates a static color image group of the water quality samples of the water supply pipeline; S4. The intelligent image data acquisition, processing, analysis workstation uses the processing algorithm OpenCV to convert the static color image of the water quality samples of the water supply pipeline into a grayscale image containing water quality turbidity parameters; S5. The intelligent image data acquisition, processing, analysis workstation uses super-resolution technology to convert the grayscale image with water quality turbidity parameters into a high-resolution image; S6. The intelligent image data acquisition, processing, analysis workstation segments and enhances the feature of the distribution area of suspended particles in the high-resolution image containing water quality turbidity parameters, and extracts the feature area image containing water quality turbidity parameters; S7. The intelligent image data acquisition, processing, analysis workstation compares the feature area image containing water quality turbidity parameters with the standard water quality turbidity level image dataset, finds the closest turbidity level image, and thus determines the water quality turbidity level of the water body to be measured in the in-service water supply pipeline.

2. The rapid image recognition method for the water quality condition in a water supply pipeline according to claim 1, wherein: In step S1, the pipeline detection robot has the waterproof ability to operate normally in the pressurized water supply pipeline, and is equipped with sensors such as a cluster light source, a high-sensitivity photosensor, a high-definition camera unit, and a storage unit, and can safely collect water quality images in the pressurized water supply pipeline to detect the water supply pipeline to be detected; the intelligent image data acquisition, processing, analysis workstation can control the pipeline detection robot, can collect and store continuous image data from the pipeline detection robot, can pre-store the standard turbidity image set, and through the Visual Studio Code software, realize the rapid image processing and recognition of the water quality condition in the water supply pipeline; can compare the processed water quality turbidity parameter image with the standard turbidity image set to determine and display the turbidity level of the water quality to be measured; the standard water quality turbidity level image dataset is obtained through indoor experiments. Use a spectrophotometer to measure the standard turbidity solution prepared in the laboratory, extract the turbidity parameter values of different turbidity levels, and at the same time use image recognition technology to identify and read the number of suspended particles in the standard turbidity solution, and map the characteristics of the suspended particles to the turbidity parameter values, and establish a standard dataset of water quality turbidity of different levels in NTU.

3. The rapid image recognition method for water quality status in a water supply pipeline according to claim 1, wherein: In step S2, the in-pipeline detection robot establishes a signal connection with the intelligent image data acquisition, processing, analysis workstation. The pipeline detection robot is deployed at the detection parts such as the valve well of the water supply pipe network to be detected, and the deployment point is at the starting point or near the starting point of the main pipeline of this section.

4. The rapid image recognition method for water quality condition in a water supply pipeline according to claim 1, wherein: In step S3, While flowing with water in the water supply pipeline, the pipeline inspection robot captures color images of the water body to be inspected. The color image information collected by the pipeline inspection robot includes, but is not limited to, continuous videos and images, and has a set high frame rate. These color image information contain the real-time information of the water quality in the water supply pipeline; The intelligent image data acquisition, processing and analysis workstation receives and stores the color image information collected by the pipeline inspection robot, extracts single-frame images from continuous images and videos at a set frame rate interval, constructs a Python 3.11.5 ('torch') environment through Anaconda, and creates an OpenCV program based on the Python programming language. The OpenCV program is used to extract single-frame images from continuous images and videos at a set frame rate interval as water quality image samples and save them to a specified folder. Then, different angles of the local and overall parts of the water quality image samples are intercepted and classified to obtain a continuous sectional static color image group of the water body samples to be tested in the water supply pipeline.

5. The rapid image recognition method for the water quality condition in a water supply pipeline according to claim 1, characterized in that: In step S4, The intelligent image data acquisition, processing and analysis workstation directly reads the gray values of the static water quality sample images through OpenCV code, normalizes the image gray values, and then adjusts the brightness of the gray images to enhance the signal reflecting the water quality turbidity characteristics in the gray images, obtaining the processed gray images.

6. The rapid image recognition method for the water quality condition in a water supply pipeline according to claim 1, characterized in that: In step S5, The intelligent image data acquisition, processing and analysis workstation uses the fast direct super-resolution (FDSR) technology to convert grayscale images into high-resolution images. Specifically, the spatial domain of the grayscale image with water turbidity parameters is split into multiple sub-domains, and simple mapping functions are learned from the training image patches in each sub-domain. At the same time, an adaptive mechanism for high-resolution image generation is adopted. This adaptive mechanism is given a set of original underwater image original resolution training images (I o ), and a low-resolution (L R ) image I L is generated through formula ①. wherein, is the convolution operator of the Gaussian kernel G, ↓s is the downsampling operator, Generate a set of original-resolution images and low-resolution (L R ) images I L patch pairs, then use the ORs and LRs datasets to train the parameters of the high-resolution images, and denote its mapping function as F(x). Finally, transfer the parameters of the high-resolution images from ORs-LRs to generate the high-resolution image I H , as shown in Equation ②: I H = F(I O ) ② where I o is a set of original underwater image training images at the original resolution.

7. The rapid image recognition method for water quality condition in a water supply pipeline according to claim 1, characterized in that: In step S6, The method for the intelligent image data acquisition, processing and analysis workstation to segment the distribution area of suspended particles in the high-resolution image containing water quality turbidity characteristics is to introduce the mean signal-to-noise ratio (MSNR) to describe the contrast of the high-resolution image. This ratio is defined by Equation ③ and Equation ④, and this ratio is used as a parameter for automatically optimizing the MSNR and Sauvola methods. MSNR = max(M - x i ) 2 , i = 1, 2, …, n ④ where n represents the number of pixels, M represents the average value of pixels in the entire image, x i represents the i-th pixel, and max is the maximum pixel value; The method for the intelligent image data acquisition, processing and analysis workstation to preliminarily extract water quality turbidity parameters from the distribution area of suspended particles in the high-resolution image containing water quality turbidity characteristics is to use the local threshold segmentation Sauvola method, that is, to extract water quality turbidity parameters based on the distribution characteristics of particles or suspended substances in the image. The specific method steps are as follows: The MSNR method requires manually specifying the maximum area change between the extreme value regions and the step size between the intensity threshold levels, and then performing Sauvola local binarization processing on the water quality turbidity parameters extracted by MSNR. The Sauvola local binarization processing requires manually specifying an appropriate window size and the fixed coefficient k in Equation ⑤ to obtain a complete target area; each pixel is regarded as a center, and a sliding window slides pixel by pixel on the image with a step size of 1 pixel. The length and width of the sliding window are 1-3% of the entire image size. In each sliding window, first, the Sauvola method is used to obtain the local threshold within the sliding window. The specific algorithm is shown in Formula ⑤: Where T(x, y) represents the threshold at the sliding window (x, y) calculated according to the local contrast, R represents the maximum standard deviation of all possible pixels in the image, the grayscale image is set to 128, k is a fixed coefficient, whose value is usually 0.34, m(x, y) is the average pixel value of all pixels in the sliding window, and δ(x, y) is the standard deviation of all pixels in the sliding window. When the pixel values in the region change greatly, the contrast is large, and the regional standard deviation δ(x, y) will approach the maximum standard deviation R; The method for the intelligent image data acquisition, processing, and analysis workstation to perform feature enhancement on the distribution area of suspended particles in a high-resolution image containing water turbidity characteristics is to use a denoising algorithm based on breakpoint connection in the spatial domain to achieve water turbidity feature enhancement. Taking each pixel as the center, it is divided into many small units using a small rectangular window that accounts for 1-3% of the complete water turbidity parameters; subsequently, the threshold of each small unit is calculated using Equation ⑥, and the total number of all pixels is obtained, where white pixels are regarded as valid pixels. The number of valid pixels (denoted as N rect ) within the rectangular area is compared with the threshold to determine whether the central pixel is a biological boundary feature point: where T value represents the number of all pixels in the self - defined rectangular window of the adaptive threshold N rectangle. The floor equation represents rounding down. The valid pixels in 0.75N must be within one of the rectangular windows or between two adjacent rectangular windows, otherwise the area will be regarded as background or noise.

Citation Information

Cited By

  • Intelligent monitoring system for sewage treatment pipeline

    CN121302260A