A system and method for measuring sediment particle size distribution
Through image acquisition and processing technology, combined with K-means and DBSCN clustering algorithms, the problem of low measurement accuracy of sediment particles in complex underwater environments is solved, and efficient and accurate particle size distribution measurement is achieved.
Patent Information
- Application Number
- CN202510121823.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2045-01-26
AI Technical Summary
The existing sediment particle size measurement system has low measurement accuracy in complex underwater environments with dense sediment and large amounts of fine particles.
The image acquisition module is used to collect images of sediment particles in water bodies, and the image pre-processing module is used to perform grayscale processing and median filtering. The sediment particles are identified and classified in combination with the K-means clustering algorithm and the DBSCN clustering algorithm. Finally, through edge detection and binarization, equivalent circle diameter transformation is performed to statistically determine the particle size distribution.
It realizes rapid and efficient identification of silt particles in complex underwater environments, improves measurement accuracy, achieves a good balance between real-time and high precision, and reduces hardware costs.
Smart Images

Figure CN119555556B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of water conservancy engineering and relates to a sediment particle size distribution measurement system and method. Background Art
[0002] The particle size and gradation of sediment particles are important parameters for studying sediment transport, scouring and sedimentation, and are the key to revealing the laws of sediment movement. Accurate sediment particle size and gradation data can summarize the accurate laws of sediment movement, thereby formulating reasonable and effective water and sediment regulation measures, which has important engineering significance for riverbed regulation, flood prevention and disaster reduction, etc. Therefore, the technical research on obtaining the particle size and gradation of sediment particles in water bodies has received more and more attention.
[0003] At present, the commonly used methods for measuring the particle size of sediment particles include screening method, laser particle size measurement method, sedimentation method and microscopy method, etc. However, these methods have a relatively small scope of application, and have defects such as time-consuming and labor-intensive, high cost of use and weak ability to distinguish fine particles. For example, the laser particle size measurement method requires sample preparation and dilution, followed by measurement and analysis, and the whole process is time-consuming; and the laser particle size analyzer equipment used is expensive and requires regular maintenance and calibration during long-term operation; the laser particle size analyzer is based on the principle of light scattering and mainly obtains particle size distribution information, but cannot intuitively display the morphological characteristics of sediment particles (such as shape and irregularity). In contrast, digital image processing technology has irreplaceable advantages. As a particle size analysis technology, digital image processing technology has good applicability, low cost, and can quickly, real-time and accurately segment sediment particles, and calculate the particle size and gradation of sediment particles in the image. However, the existing sediment particle size measurement system based on digital image processing technology has the problem of low measurement accuracy in complex underwater environments, such as dense sediment and a large number of fine particles. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention proposes a sediment particle size distribution measurement system and method, which solves the problem of low measurement accuracy of the existing sediment particle size measurement system in a complex underwater environment with dense sediment and a large number of fine particles.
[0005] The present invention is achieved through the following technical solutions:
[0006] A sediment particle size distribution measurement system, comprising:
[0007] An image acquisition module is used to acquire images of sediment particles in the water body, obtain a first sediment particle image and transmit it to an image preprocessing module;
[0008] An image preprocessing module, used for performing grayscale processing and median filtering on the first sediment particle image to obtain a sediment grayscale image and transmit it to the particle recognition module;
[0009] The particle recognition module is used to perform cluster analysis on the sediment grayscale image using the K-means clustering algorithm to identify sediment particles and obtain an image with a primary clustering result; the DBSCN clustering algorithm is used to perform cluster analysis on sediment particles with a particle size smaller than a preset threshold in the image with the primary clustering result to obtain an image with a secondary clustering result and transmit it to the edge detection module;
[0010] An edge detection module is used to perform edge detection on the sediment particles in the image with the secondary clustering result, obtain a particle edge contour map and transmit it to the image binarization module;
[0011] An image binarization module is used to perform binarization processing on the particle edge contour image to obtain a binarized image and transmit it to an equivalent conversion module;
[0012] The equivalent conversion module is used to perform an equivalent circle diameter transformation on the binary image to obtain the particle size of the sediment particles, and to calculate the particle size distribution of the sediment particles to obtain the particle size distribution result.
[0013] Preferably, the particle recognition module, in the process of performing cluster analysis on the sediment grayscale image using the K-means clustering algorithm, uses the Davies-Bouldin index to evaluate the quality of the primary clustering results, and based on the obtained evaluation results, uses the Q-learning reinforcement learning model to update the K value in the K-means clustering algorithm, and then uses the K-means clustering algorithm with the updated K value to re-cluster the sediment grayscale image until the primary clustering results meet the preset clustering effect stability conditions.
[0014] Preferably, the image acquisition module includes a first camera and a second camera;
[0015] The first camera is used to collect images of sediment particles in the water body, obtain a first sediment particle image and transmit it to the image preprocessing module;
[0016] The second camera is used to collect images of sediment particles in the water body, obtain a second sediment particle image and transmit it to the image preprocessing module;
[0017] The image preprocessing module is further used to obtain a depth image based on the first sediment particle image and the second sediment particle image, perform grayscale processing and median filtering on the depth image, obtain a depth grayscale image, and transmit it to the particle recognition module;
[0018] The particle recognition module is used to output a preliminary regional mask of sediment particles according to the depth grayscale image and a preset depth value range; use the preliminary regional mask to crop the sediment grayscale image; use the K-means clustering algorithm to perform cluster analysis on the cropped sediment grayscale image to identify sediment particles and obtain an image with a primary clustering result; use the DBSCN clustering algorithm to perform cluster analysis on sediment particles with a particle size smaller than a preset threshold in the image with the primary clustering result, obtain an image with a secondary clustering result and transmit it to the edge detection module.
[0019] Preferably, the image acquisition module includes a first camera and a light source; the light source is a blue light source;
[0020] The first camera is used to collect images of sediment particles in the water body, obtain a first sediment particle image and transmit it to the image preprocessing module;
[0021] The light source is used to provide lighting for the first camera to collect images of sediment particles in the water body.
[0022] Furthermore, the sediment particle size distribution measurement system also includes a power consumption management module;
[0023] The power consumption management module comprises:
[0024] A light sensor is used to collect light intensity in the water body and transmit it to the light source control module;
[0025] The light source control module is used to control the illumination intensity of the light source according to the light intensity in the water body.
[0026] Furthermore, the sediment particle size distribution measurement system further includes a concentration calculation module; the power consumption management module further includes a camera control module;
[0027] The concentration calculation module is used to calculate the concentration of sediment particles according to the particle size distribution result;
[0028] The camera control module is used to control the operating frequency of the first camera according to the concentration of the sediment particles.
[0029] Preferably, the edge detection module uses the Prewitt operator to perform edge detection on the sediment particles in the image with the secondary clustering results.
[0030] A method for measuring the particle size distribution of sediment particles, comprising:
[0031] Collecting an image of sediment particles in a water body to obtain a first sediment particle image;
[0032] Performing grayscale processing and median filtering on the first sediment particle image to obtain a sediment grayscale image;
[0033] The K-means clustering algorithm is used to perform cluster analysis on the sediment grayscale image to identify sediment particles and obtain an image with a primary clustering result; the DBSCN clustering algorithm is used to perform cluster analysis on sediment particles with a particle size smaller than a preset threshold in the image with the primary clustering result to obtain an image with a secondary clustering result;
[0034] Performing edge detection on the sediment particles in the image with the secondary clustering result to obtain a particle edge contour map;
[0035] Binarizing the particle edge contour image to obtain a binary image;
[0036] The binary image is transformed into an equivalent circle diameter to obtain the particle size of the sediment particles, and the particle size distribution of the sediment particles is statistically analyzed to obtain a particle size distribution result.
[0037] Preferably, in the process of clustering analysis of the sediment grayscale image using the K-means clustering algorithm, the Davies-Bouldin index (DBI) is used to evaluate the quality of the primary clustering results, and based on the obtained evaluation results, the Q-learning reinforcement learning model is used to update the K value in the K-means clustering algorithm, and then the K-means clustering algorithm with the updated K value is used to re-cluster the sediment grayscale image until the primary clustering results meet the preset clustering effect stability conditions.
[0038] Preferably, the sediment particle size distribution measurement method further includes:
[0039] Collecting an image of sediment particles in a water body to obtain a second sediment particle image;
[0040] Obtaining a depth image according to the first sediment particle image and the second sediment particle image, and performing grayscale processing and median filtering on the depth image to obtain a depth grayscale image;
[0041] The K-means clustering algorithm is used to perform cluster analysis on the sediment grayscale image, specifically: output a preliminary regional mask of sediment particles according to the depth grayscale image and a range of preset depth values; use the preliminary regional mask to crop the sediment grayscale image; and use the K-means clustering algorithm to perform cluster analysis on the cropped sediment grayscale image.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] The system of the present invention can accurately and intuitively identify the morphology of suspended sediment particles in water bodies by collecting sediment particle images for analysis and processing, and can quickly and efficiently obtain the pixel area corresponding to the sediment particles in the image, and obtain the sediment particle size after equivalent circle diameter conversion, and then calculate the particle gradation of the area. Compared with the existing laser particle size measurement method, the present invention has a shorter detection time, can achieve real-time measurement, and the processing time can be shortened to within 2 seconds, which is suitable for real-time monitoring needs. In addition, the present invention has high accuracy and can achieve a good balance between real-time and high accuracy. In addition, the hardware cost of the solution based on the image recognition method of the present invention is low, and it has economic advantages. Moreover, it can intuitively display the morphological characteristics of sediment particles, and can provide particle size, shape and spatial distribution information at the same time, which is more suitable for comprehensive analysis. Compared with the existing sediment particle size measurement system based on digital image processing technology, the sediment particle size distribution measurement system of the present invention integrates the K-means clustering algorithm and the density-based spatial clustering algorithm (Density-Based Spatial Clustering of Applications with Noise, DBSCAN). The K-means clustering algorithm can efficiently process a large number of sediment particle data sets, while the DBSCAN clustering algorithm has stronger adaptability in detecting high-density areas and fine-grained particles, and can effectively identify clusters of any shape. Therefore, the present invention first uses the K-means clustering algorithm for clustering, and then uses the DBSCN clustering algorithm to further classify the fine sediment particles. The two work together to quickly and efficiently identify sediment particles in a complex underwater environment with dense sediment and a large number of fine particles, and have good environmental adaptability and high recognition accuracy.
[0044] Furthermore, the system of the present invention uses a reinforcement learning algorithm to adaptively and dynamically adjust the K value in the K-means clustering algorithm, further improving the measurement accuracy of the system in environments with different water quality and changes in sediment particle size.
[0045] Furthermore, the system of the present invention uses two cameras to collect images from different perspectives, and converts multi-perspective images into depth values, thereby obtaining three-dimensional information. Based on the three-dimensional information, the subsequent segmentation and classification effects of sediment particles are further improved, and the recognition accuracy of sediment particles in complex underwater environments is further improved.
[0046] Furthermore, in the system of the present invention, a blue light source is used. The wavelength of blue light is shorter, the absorption rate of blue light by water is low, and the propagation time of blue light in water is longer, which can ensure that the image of mud and sand particles taken in an underwater environment far away from the camera head has higher clarity. Therefore, the use of a blue light source makes the system of the present invention more suitable for taking clear images of mud and sand particles in complex underwater environments.
[0047] Furthermore, during the underwater identification process, the system of the present invention automatically adjusts the illumination intensity of the light source according to the light intensity of the underwater environment, performs effective power consumption management, and improves endurance, so that the system can work underwater for a long time and can provide continuous and reliable data collection and analysis without the convenience of frequent maintenance.
[0048] Furthermore, the system of the present invention automatically adjusts the camera operating frequency by real-time analysis of the concentration of sediment particles in the water, effectively reduces power consumption, and extends the battery life of the camera, so that the measurement system can work underwater for a long time and can provide continuous and reliable data collection and analysis without the inconvenience of frequent maintenance.
[0049] The sediment particle size distribution measurement method of the present invention can accurately and intuitively identify the morphology of suspended sediment particles in water bodies by collecting sediment particle images for analysis and processing, and can quickly and efficiently obtain the pixel area corresponding to the sediment particles in the image, and obtain the sediment particle size after equivalent circle diameter conversion, and then calculate the particle gradation. The present invention integrates the K-means clustering algorithm and the DBSCAN clustering algorithm, and can identify sediment particles in complex underwater environments with dense sediment and a large number of fine particles, with good environmental adaptability and high recognition accuracy.
[0050] Furthermore, the present invention uses a reinforcement learning algorithm to adaptively and dynamically adjust the K value in the K-means clustering algorithm, further improving the measurement accuracy in environments with different water quality and sediment particle size changes.
[0051] Furthermore, the present invention collects images of sediment particles in water bodies from different perspectives, converts multi-perspective images into depth images, thereby obtaining three-dimensional information. Based on the three-dimensional information, the subsequent segmentation and classification effects of sediment particles are further improved, and the recognition accuracy of sediment particles in complex underwater environments is further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 This is a flow chart of the sediment particle size distribution measurement method of the present invention;
[0054] Figure 2 This is a schematic diagram showing the principle of measuring the depth value of sediment particles by the first camera and the second camera of the present invention;
[0055] Figure 3is a sediment particle image collected in an embodiment of the present invention;
[0056] Figure 4 It is a grayscale image of the sediment particle image after grayscale processing and median filtering processing in an embodiment of the present invention;
[0057] Figure 5 The image is processed by the K-means clustering algorithm and the DBSCAN clustering algorithm in the embodiment of the present invention;
[0058] Figure 6 The image is processed by edge detection and binarization using the Prewitt operator in the embodiment of the present invention;
[0059] Figure 7 The particle size distribution curve of the sediment particles obtained when the amount of sand added is 480g in the embodiment of the present invention;
[0060] Figure 8 is the particle size distribution curve of the sediment particles obtained when the amount of sand added is 4000g in the embodiment of the present invention;
[0061] Fig. 9 This is the particle size distribution curve of the sediment particles obtained when the sand dosage is 8000g in the embodiment of the present invention. DETAILED DESCRIPTION
[0062] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.
[0063] It should be noted that the process equipment or devices not specifically specified in the following embodiments are all conventional equipment or devices in the art.
[0064] It should be noted that the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. Moreover, unless otherwise specified, the numbering of each method step is only a convenient tool for identifying each method step, and is not intended to limit the order of arrangement of each method step or to define the scope of the present invention. Changes or adjustments in their relative relationships should also be regarded as the scope of the present invention without substantially changing the technical content. In addition, it should be noted that the terms "first", "second", etc. in the present invention are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0065] The sediment particle size distribution measurement system of the present invention comprises:
[0066] An image acquisition module is used to acquire images of sediment particles in the water body, obtain a first sediment particle image and transmit it to an image preprocessing module;
[0067] An image preprocessing module, used for performing grayscale processing and median filtering on the first sediment particle image to obtain a sediment grayscale image and transmit it to the particle recognition module;
[0068] The particle recognition module is used to perform cluster analysis on the sediment grayscale image using the K-means clustering algorithm to identify sediment particles and obtain an image with a primary clustering result; the DBSCN clustering algorithm is used to perform cluster analysis on sediment particles with a particle size smaller than a preset threshold in the image with the primary clustering result to obtain an image with a secondary clustering result and transmit it to the edge detection module;
[0069] An edge detection module is used to perform edge detection on the sediment particles in the image with the secondary clustering result, obtain a particle edge contour map and transmit it to the image binarization module;
[0070] An image binarization module is used to perform binarization processing on the particle edge contour image to obtain a binarized image and transmit it to an equivalent conversion module;
[0071] The equivalent conversion module is used to perform an equivalent circle diameter transformation on the binary image to obtain the particle size of the sediment particles, and to calculate the particle size distribution of the sediment particles to obtain the particle size distribution result.
[0072] In a preferred embodiment of the present invention, the image acquisition module includes a first camera and a second camera; the first camera and the second camera are located in the same horizontal plane, and the angle between the camera axis of the first camera and the camera axis of the second camera is 50 to 70 degrees;
[0073] The first camera is used to collect images of sediment particles in the water body, obtain a first sediment particle image and transmit it to the image preprocessing module;
[0074] The second camera is used to collect images of sediment particles in the water body, obtain a second sediment particle image and transmit it to the image preprocessing module;
[0075] The image preprocessing module is used to perform grayscale processing and median filtering processing on the first sediment particle image to obtain a sediment grayscale image; obtain a depth image based on the first sediment particle image and the second sediment particle image, and perform grayscale processing and median filtering processing on the depth image to obtain a depth grayscale image; transmit the sediment grayscale image and the depth grayscale image to the particle recognition module;
[0076] The particle recognition module is used to output a preliminary regional mask of sediment particles according to the depth grayscale image and a preset depth value range; use the preliminary regional mask to crop the sediment grayscale image; use the K-means clustering algorithm to perform cluster analysis on the cropped sediment grayscale image to identify sediment particles and obtain an image with a primary clustering result; use the DBSCN clustering algorithm to perform cluster analysis on sediment particles with a particle size smaller than a preset threshold in the image with the primary clustering result, obtain an image with a secondary clustering result and transmit it to the edge detection module.
[0077] The present invention constructs a dual-camera image acquisition module by setting a first camera and a second camera, thereby obtaining multi-view image data of sediment particles. Preferably, the first camera and the second camera are fixed on the same horizontal plane at an angle of 60 degrees (that is, the angle between the camera axis of the first camera and the camera axis of the second camera is 60 degrees), and the cameras in the first camera and the second camera are calibrated using a calibration plate to correct camera distortion and determine the geometric relationship between the two cameras in the first camera and the second camera. The two cameras simultaneously capture images of sediment particles, and the disparity value is calculated by a block matching algorithm in the image preprocessing module to generate a depth image, in which each pixel value in the depth image represents the depth value of the corresponding point.
[0078] In the image preprocessing module, the disparity value of each pixel in the first sediment particle image and the second sediment particle image is determined by using a block matching algorithm, and the first sediment particle image and the second sediment particle image are converted into a depth image ( Figure 2 ).
[0079] Figure 2 middle, and are the optical centers of the first and second cameras, respectively. and are the feature points of the first sediment particle image and the second sediment particle image, P is the position of the map point corresponding to the two feature points in the three-dimensional scene, t is the translation vector.
[0080] The depth value of each pixel can be calculated by the following formula:
[0081]
[0082] In the formula, Z is the depth value (vertical distance) from the sediment particle to the baseline between the camera in the first camera and the camera in the second camera, is the focal length of the camera in the first camera or the second camera, is the baseline distance between the camera in the first camera and the camera in the second camera, is the disparity value.
[0083] The focal length of the camera in the first camera is the same as the focal length of the camera in the second camera.
[0084] In another more preferred embodiment of the present invention, the image acquisition module further includes a light source for providing illumination for the first camera and the second camera to collect images of silt particles in the water body, and the light source uses a blue light source with a wavelength range of 400-500nm. Due to the influence of silt particles and water on light scattering in the water, the water appears turbid, and the blue light wavelength is short, the water has a low absorption rate of blue light, and the blue light propagation time in the water is long, which can ensure that the image of silt particles taken in an underwater environment far from the camera has higher clarity. Therefore, the use of a blue light source makes the system of the present invention suitable for taking clear images of silt particles in a complex underwater environment.
[0085] In addition, in order to improve the endurance of the image acquisition module and ensure that the system can operate underwater for a long time, a power consumption management module is designed and constructed in the preferred embodiment of the present invention.
[0086] The power consumption management module includes a light sensor and a light source control module;
[0087] The light sensor is used to collect light intensity in the underwater environment and transmit it to the light source control module;
[0088] The light source control module is used to control the illumination intensity of the light source according to the illumination intensity in the underwater environment.
[0089] When the light intensity in the underwater environment is high, the light source control module will automatically reduce the illumination intensity of the light source to reduce energy consumption. When the light intensity in the underwater environment is weak, the illumination intensity of the light source will be increased to ensure the quality of the collected sediment particle images.
[0090] The power consumption management module of the present invention may also selectively include a camera control module; the sediment particle size distribution measurement system also includes a concentration calculation module, which calculates the concentration of sediment particles according to the particle size distribution result. The camera control module controls the operating frequency of the camera according to the concentration of sediment particles in the water body. When the concentration of sediment particles is low, for example, lower than a preset concentration, the camera control module controls to reduce the operating frequency of each camera of the image acquisition module, thereby saving power consumption.
[0091] The image preprocessing module of the present invention includes a grayscale conversion module and an image filtering module. The grayscale conversion module is used to convert the first sediment particle image and the depth image into a sediment grayscale image and a depth grayscale image, respectively, using only one grayscale value to represent each pixel, and each pixel requires a grayscale value to represent the brightness or grayscale level, thereby reducing the data dimension, simplifying the analysis process, and effectively speeding up the processing speed. The image filtering module is used to perform median filtering on the sediment grayscale image and the depth grayscale image. Since the image acquisition module itself also introduces noise, errors will be generated in the analysis of the particle size distribution of sediment particles, so it is necessary to perform median filtering on the sediment particle image. The present invention preferably uses a median filter with a window size of 5×5, finds the median of all pixel values in the window, and replaces the pixel value in the center of the window with this median value, removes random and isolated noise points, and retains the complete outline of the sediment particles, so as to more accurately extract the required information.
[0092] In the preferred embodiment of the present invention, before cluster analysis, the particle recognition module first converts the depth image to obtain a depth grayscale image, because the depth values of the sediment particles are relatively consistent, while the background depth values vary greatly. According to the preset depth value range and the depth grayscale image, the possible sediment particle area is divided, and a preliminary regional mask of the sediment particles is output, which contains the approximate contour position of the sediment particles; then, in combination with the sediment grayscale image, the preliminary regional mask is used to crop the sediment grayscale image to retain the area that may contain sediment particles; and then the K-means clustering algorithm is used to perform cluster analysis on the sediment grayscale image. The role of the depth image is to generate a preliminary regional mask of the sediment particles to distinguish between the sediment particles and the background.
[0093] The sediment grayscale image for cluster analysis in the following part of the present invention may be the sediment grayscale image output by the image preprocessing module, or may be the sediment grayscale image cropped by the particle recognition module using the preliminary region mask.
[0094] In order to enhance the environmental adaptability and accuracy of the system, the present invention uses a fusion of the K-means clustering algorithm and the DBSCAN clustering algorithm in the particle recognition module to perform cluster analysis on the sediment grayscale image. Since the DBSCAN clustering algorithm has stronger adaptability in detecting high-density areas and fine-grained particles, it can effectively identify clusters of any shape and automatically determine the number of clusters. It is particularly suitable for identifying irregularly shaped sediment particles in complex underwater environments. Therefore, after using the K-means clustering algorithm for cluster analysis, the present invention combines the DBSCAN clustering algorithm to cluster fine-grained sediment particles. Specifically, first, the K-means clustering algorithm is used to classify the pixel values of the sediment grayscale image to identify sediment particles and obtain an image with a first-level clustering result; then the DBSCAN clustering algorithm is used to perform cluster analysis again on sediment particles with a particle size less than a preset threshold, so that fine sediment particles can be accurately identified.
[0095] The present invention uses the "elbow" method to determine the initial optimal cluster number K before using the K-means clustering algorithm for cluster analysis. The method determines the initial optimal cluster number K by judging the core index (i.e., the sum of squared errors). The sum of squared errors can intuitively reflect the clustering error. The smaller the value, the better the clustering effect and the higher the degree of aggregation of each class. When the number of simulated clusters (i.e., the number of cluster center points) is less than the initial optimal cluster number K, the larger the number of simulated clusters, the higher the degree of aggregation of each class, and the decrease in the sum of squared errors will be greater; and when the number of simulated clusters is greater than the initial optimal cluster number K, as the number of simulated clusters increases, the degree of aggregation of each class obtained will tend to be stable, so the decrease in the sum of squared errors will become stable, and then tend to be flat as the number of simulated clusters continues to increase, and the cluster center will tend to no longer change. At this time, the position corresponding to the "elbow" is the initial optimal cluster number K.
[0096] The specific formula for the sum of squared errors is as follows:
[0097]
[0098] In the formula, H is the sum of squares of errors, Indicates Class, b for The sample points of for The center of mass.
[0099] During the execution of the K-means clustering algorithm, the initial optimal cluster number K obtained by the previous "elbow" method is used as a fixed parameter during initialization. The present invention uses the K-means++ initialization method to select K initial cluster centers according to the determined initial optimal cluster number K. First, select the first cluster center, that is, randomly select a pixel from the sediment grayscale image as the first cluster center. Then, for each pixel in the sediment grayscale image, find the shortest distance between it and the most recently selected cluster center, and calculate this shortest distance. The square of this shortest distance will be used as the weight of the pixel when selecting the next cluster center. When selecting the next cluster center, the probability of each pixel that is not selected as the cluster center being selected is proportional to its corresponding shortest distance. The farther the distance, the higher the probability of being selected. Repeat multiple times until K initial cluster centers are selected. The shortest distance between each pixel and the selected cluster center is calculated using the Euclidean distance.
[0100] The formula for calculating Euclidean distance is as follows:
[0101] For two points and The Euclidean distance between:
[0102]
[0103] Next, traverse each pixel of the sediment grayscale image, calculate the Euclidean distance between each pixel and each cluster center, and assign it to the class represented by the cluster center closest to it. Once all pixels are assigned to K classes, update the cluster center of each class. For each class, calculate the average grayscale value of all pixels, and set the pixel corresponding to this average value as the new cluster center. Then iterate until the cluster center no longer changes significantly, so that the difference in pixel grayscale values within the same class is as small as possible, and the difference in pixels of different classes is as large as possible, so as to achieve effective segmentation and classification of the image and obtain the first-level clustering result.
[0104] In order to maintain the high accuracy of the K-means clustering algorithm in environments with different water quality and sediment particle size changes, the present invention uses a reinforcement learning algorithm to dynamically and adaptively adjust the K value according to the distribution density and quantity of sediment particles during the execution of the K-means clustering algorithm. Through the reinforcement learning algorithm, the system can learn the optimal K value and its corresponding clustering parameters selected in the reinforcement learning process from the previous first-level clustering results and the currently processed sediment grayscale image data, so that the K-means clustering algorithm can maintain high efficiency and accuracy in environments with different water quality and sediment particle size changes.
[0105] Specifically, during the execution of the K-means clustering algorithm, the Davies-Bouldin index is used to evaluate the quality of the current first-level clustering result, and based on the evaluation result, the reinforcement learning algorithm is applied to gradually and adaptively adjust the K value. The adjusted K value will be used to re-cluster analysis until the first-level clustering result meets the quality requirements.
[0106] The present invention preferably adopts the Q-learning reinforcement learning model to perform adaptive adjustment of the K value. The specific process is: first set up an environment, including inputting a sediment grayscale image and a parameter range (particle size and shape), and initializing the model parameters of the Q-learning reinforcement learning model. The system extracts features from the input image (i.e., the sediment grayscale image of the present invention) to obtain image features. The first K-means clustering is performed using the initial optimal clustering number determined by the "elbow" method to obtain a preliminary first-level clustering result, and the clustering effect index, i.e., the Davies-Bouldin index, is calculated. The current image features and the clustering effect index are combined into the current state. Based on the current state, the Q-learning reinforcement learning model selects an action A (such as an increase, decrease, or no change in the K value) through the Q table, and updates the K value accordingly. After executing the action, rerun the K-means clustering algorithm to generate a new first-level clustering result, calculate a new clustering effect index, and form a new state. According to the new state, the reward value is calculated and the Q-learning update rule is applied to optimize the Q table to optimize future action selection. The whole process is repeated until the Davies-Bouldin index meets the preset clustering effect stability condition, and finally the optimized K value, the first-level clustering result and the image with the first-level clustering result are output.
[0107] The optimization formula of the Q table is as follows:
[0108]
[0109] in, is the current state; is in state The action selected is: R is in execution The reward value obtained after the action; Is to perform an action The new state to which it is transferred later; Is in the new state All possible actions that can be taken; In the new state Choose the best action The corresponding Q value is the maximum long-term reward that can be obtained in the future state; Represents the learning rate, which is used to control the update speed. is the discount factor.
[0110] The edge detection module of the present invention is used in the image after identifying the sediment particles, that is, the image with the secondary clustering result is processed. In a specific embodiment of the present invention, the Prewitt operator is used to perform edge detection on the sediment particles in the image with the secondary clustering result, that is, the Prewitt operator is applied to each clustering area of the image with the secondary clustering result to find and highlight the edge features in each clustering area, and the area with significant changes in depth value is identified by calculating the gradient value of the vertical and horizontal edges of each pixel in the image, thereby marking the edges and contours of the particles, and merging these particle edge contour maps to obtain a single particle edge contour map. The Prewitt operator used in the present invention can identify the edges, contours and important features in the image.
[0111] The image binarization module of the present invention uses the automatic threshold Otsu's algorithm to automatically select a suitable segmentation threshold according to the statistical characteristics of the image, maximize the variance between the foreground and the background to find the best segmentation threshold, and compare the particle edge contour map with the segmentation threshold to detect and highlight the obvious edges of the sediment particles.
[0112] The present invention sets up an equivalent conversion module because the characterization results of the relevant parameters of the sediment particles are all pixel values. In order to obtain the area of the sediment particles, it is necessary to count the number of pixels occupied by the sediment particles, and transform the pixel values of the sediment particles into equivalent circle diameters. Then, the particle size distribution is calculated based on the equivalent circle diameter, and then the sediment particle grading curve of the shooting area is output.
[0113] The camera model used in the embodiment of the present invention is Daheng MER-031-860U3MC, with a focal length of 111 mm and a pixel value of 14.5 μm. The calculation formula for the equivalent circle diameter is as follows:
[0114]
[0115] in, is the number of pixels occupied by sediment particles, is the pixel value, L is the vertical distance from the camera head in the first camera to its shooting area, is the focal length of the camera in the first camera.
[0116] Based on the above system, Figure 1 As shown, the method for measuring the particle size distribution of sediment particles of the present invention comprises:
[0117] Collecting an image of sediment particles in a water body to obtain a first sediment particle image;
[0118] Performing grayscale processing and median filtering on the first sediment particle image to obtain a sediment grayscale image;
[0119] The K-means clustering algorithm is used to perform cluster analysis on the sediment grayscale image to identify sediment particles and obtain an image with a primary clustering result; the DBSCN clustering algorithm is used to perform cluster analysis on sediment particles with a particle size smaller than a preset threshold in the image with the primary clustering result to obtain an image with a secondary clustering result;
[0120] Performing edge detection on the sediment particles in the image with the secondary clustering result to obtain a particle edge contour map;
[0121] Binarizing the particle edge contour image to obtain a binary image;
[0122] The binary image is transformed into an equivalent circle diameter to obtain the particle size of the sediment particles, and the particle size distribution of the sediment particles is statistically analyzed to obtain a particle size distribution result.
[0123] As a preferred solution, in the sediment particle size distribution measurement method, in the process of clustering the sediment grayscale image using the K-means clustering algorithm, the Davies-Bouldin index is used to evaluate the quality of the first-level clustering results obtained, and based on the obtained evaluation results, the Q-learning reinforcement learning model is used to update the K value in the K-means clustering algorithm, and then the K-means clustering algorithm with the updated K value is used to re-cluster the sediment grayscale image until the first-level clustering results meet the preset clustering effect stability conditions.
[0124] As a preferred embodiment, the sediment particle size distribution measurement method further includes:
[0125] Collecting an image of sediment particles in a water body to obtain a second sediment particle image;
[0126] Obtaining a depth image according to the first sediment particle image and the second sediment particle image, and performing grayscale processing and median filtering on the depth image to obtain a depth grayscale image;
[0127] The K-means clustering algorithm is used to perform cluster analysis on the sediment grayscale image, specifically: output a preliminary regional mask of sediment particles according to the depth grayscale image and a range of preset depth values; use the preliminary regional mask to crop the sediment grayscale image; and use the K-means clustering algorithm to perform cluster analysis on the cropped sediment grayscale image.
[0128] The system of the present invention achieves a real-time processing speed of 1.6105 seconds per image, enabling the system to respond quickly when the water flow changes. At the same time, during the algorithm processing and data transmission process, the system can dynamically adjust power consumption to meet the needs of long-term underwater monitoring, significantly enhancing the system's real-time performance and power consumption management capabilities.
[0129] Example
[0130] The present invention was tested under the following test conditions: in a laboratory, in a clean water environment with a volume of 400L and a water surface height of about 1.6m, different sand dosages (480g, 4000g, 8000g) were set to obtain sediment suspensions of different concentrations, the sediment used was a standard sediment particle sample with a particle size range of 0.002-0.1mm, two 2-megapixel industrial cameras were equipped as the first camera and the second camera, both with a focal length of 11cm, and a Malvern laser particle size analyzer was used as a comparative test device to ensure the authority of the particle size distribution data.
[0131] Figure 3 This is an image of sediment particles taken by one of the industrial cameras. The image shows the suspension state and distribution of the sediment particles. Figure 4 The grayscale image of sediment particles and the sediment grayscale image after median filtering provide simplified input for the K-means clustering algorithm. Figure 5 For images processed by K-means clustering algorithm and DBSCN clustering algorithm, the pixel values in the image are divided into several categories. Figure 6 Based on the secondary clustering results, the pixel gradient values are calculated and the edge features are extracted to generate a clear sediment particle segmentation map.
[0132] Figure 7~Figure 9 The particle size distribution curves of sediment particles obtained by using the measuring system (image recognition method) of the present invention and the Malvern laser particle size analyzer (Malvern method) when the amount of sediment added is 480g, 4000g, and 8000g respectively. Figure 7~Figure 9 It can be seen that the error of the measurement results of sediment particle size distribution obtained by the system of the present invention and the more mature Malvern laser particle size analyzer is between 0.0025 and 0.0035 mm. Considering the presence of flocculent fine particle impurities in the water body, it is believed that the error is within a reasonable range.
[0133] In summary, it can be seen that the present invention has a high accuracy in identifying sediment particles. Through precise image filtering and optimized K-means clustering algorithm, the system of the present invention can effectively identify fine suspended sediment particles with a particle size range of 0.002~0.1mm, which can meet the requirements for high-precision identification of sediment particles.
[0134] This shows that the present invention has achieved a good balance between real-time performance and high precision, especially in the suspended sediment measurement of natural water bodies, and has significant advantages. Unlike conventional particle size analysis instruments that cannot achieve real-time analysis of underwater sediment particles, the present invention method makes real-time monitoring and high-precision identification possible, ensuring the effective application of image recognition method for sediment particle size distribution measurement in complex underwater environments.
Claims
1. A sediment particle size distribution measurement system, characterized in that: include: The image acquisition module includes a first camera and a second camera; the first camera is used to acquire images of sediment particles in the water body, obtain a first sediment particle image and transmit it to the image preprocessing module; the second camera is used to acquire images of sediment particles in the water body, obtain a second sediment particle image and transmit it to the image preprocessing module; An image preprocessing module is used to perform grayscale processing and median filtering on the first sediment particle image to obtain a sediment grayscale image and transmit it to the particle recognition module; it is also used to obtain a depth image based on the first sediment particle image and the second sediment particle image, perform grayscale processing and median filtering on the depth image to obtain a depth grayscale image and transmit it to the particle recognition module; A particle recognition module is used to output a preliminary area mask of sediment particles based on the depth grayscale image and a range of preset depth values; The sediment grayscale image was cropped using a preliminary area mask; The K-means clustering algorithm is used to perform cluster analysis on the cropped sediment grayscale image to identify sediment particles and obtain an image with first-level clustering results; Performing cluster analysis on the sediment particles with a particle size smaller than a preset threshold in the image with the first-level clustering result using the DBSCN clustering algorithm, obtaining an image with the second-level clustering result and transmitting it to the edge detection module; An edge detection module is used to perform edge detection on the sediment particles in the image with the secondary clustering result, obtain a particle edge contour map and transmit it to the image binarization module; An image binarization module is used to perform binarization processing on the particle edge contour image to obtain a binarized image and transmit it to an equivalent conversion module; The equivalent conversion module is used to perform an equivalent circle diameter transformation on the binary image to obtain the particle size of the sediment particles, and to calculate the particle size distribution of the sediment particles to obtain the particle size distribution result.
2. The sediment particle size distribution measurement system according to claim 1, characterized in that: The particle recognition module, in the process of clustering the sediment grayscale image using the K-means clustering algorithm, uses the Davies-Bouldin index to evaluate the quality of the primary clustering result, and based on the obtained evaluation result, uses the Q-learning reinforcement learning model to update the K value in the K-means clustering algorithm, and then uses the K-means clustering algorithm with the updated K value to re-cluster the sediment grayscale image until the primary clustering result meets the preset clustering effect stability condition.
3. The sediment particle size distribution measurement system according to claim 1, characterized in that: The image acquisition module includes a light source; the light source is a blue light source; The light source is used to provide lighting for the first camera to collect images of sediment particles in the water body.
4. The sediment particle size distribution measurement system according to claim 3, characterized in that: The sediment particle size distribution measurement system also includes a power consumption management module; The power consumption management module comprises: A light sensor is used to collect light intensity in the water body and transmit it to the light source control module; The light source control module is used to control the illumination intensity of the light source according to the light intensity in the water body.
5. The sediment particle size distribution measurement system according to claim 4, characterized in that: The sediment particle size distribution measurement system further includes a concentration calculation module; the power consumption management module further includes a camera control module; The concentration calculation module is used to calculate the concentration of sediment particles according to the particle size distribution result; The camera control module is used to control the operating frequency of the first camera according to the concentration of the sediment particles.
6. The sediment particle size distribution measurement system according to claim 1, characterized in that: The edge detection module uses the Prewitt operator to perform edge detection on the sediment particles in the image with the secondary clustering result.
7. A method for measuring the particle size distribution of sediment particles, characterized in that: include: Collecting an image of sediment particles in a water body to obtain a first sediment particle image; Collecting an image of sediment particles in a water body to obtain a second sediment particle image; Performing grayscale processing and median filtering on the first sediment particle image to obtain a sediment grayscale image; Obtaining a depth image according to the first sediment particle image and the second sediment particle image, and performing grayscale processing and median filtering on the depth image to obtain a depth grayscale image; Output a preliminary regional mask of sediment particles according to the depth grayscale image and the range of preset depth values; The sediment grayscale image was cropped using a preliminary area mask; The K-means clustering algorithm is used to perform cluster analysis on the cropped sediment grayscale image to identify sediment particles and obtain an image with first-level clustering results; Performing cluster analysis on the sediment particles with a particle size smaller than a preset threshold in the image with the first-level clustering result using the DBSCN clustering algorithm to obtain an image with the second-level clustering result; Performing edge detection on the sediment particles in the image with the secondary clustering result to obtain a particle edge contour map; Binarizing the particle edge contour image to obtain a binary image; The binary image is transformed into an equivalent circle diameter to obtain the particle size of the sediment particles, and the particle size distribution of the sediment particles is statistically analyzed to obtain a particle size distribution result.
8. The method for measuring the particle size distribution of sediment particles according to claim 7, characterized in that: In the process of clustering analysis of the sediment grayscale image using the K-means clustering algorithm, the Davies-Bouldin index is used to evaluate the quality of the primary clustering results, and based on the obtained evaluation results, the Q-learning reinforcement learning model is used to update the K value in the K-means clustering algorithm, and then the K-means clustering algorithm with the updated K value is used to re-cluster the sediment grayscale image until the primary clustering results meet the preset clustering effect stability conditions.
Citation Information
Patent Citations
Sediment particle analysis device and analysis method based on digital imaging technology
CN102288522A
Real-time detection method for grain composition characteristics of muck
CN119360363A