A method for measuring particle size distribution of riverbed sediment
By employing a double watershed segmentation algorithm and grayscale image processing in the measurement of pebble size distribution in riverbed sediment, the problem of identifying complex gravel layers was solved, achieving higher accuracy in particle size distribution measurement and supporting river basin habitat restoration.
Patent Information
- Application Number
- CN202211300423.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-24
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-10-24
AI Technical Summary
Existing methods for measuring the particle size distribution of gravel in riverbeds suffer from problems such as undersegmentation, misidentification, and poor identification accuracy when dealing with complex gravel layers, which affects the effectiveness of river basin habitat restoration.
By employing at least two watershed segmentation algorithms combined with grayscale image processing, and through edge enhancement, morphological coefficient judgment, and multi-threshold segmentation techniques, the pebbles with overlapping relationships are identified and separated, and their particle size distribution is calculated.
This improved the accuracy and reliability of pebble size distribution measurement, ensuring the accuracy and effectiveness of river basin habitat restoration.
Smart Images

Figure CN115511871B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sediment particle size measurement research on riverbed fish spawning grounds, specifically to a method for measuring riverbed sediment particle size distribution. Background Technology
[0002] The upper reaches of the Yangtze River boast diverse landforms, significant elevation differences in the riverbed, complex habitats, and abundant hydropower resources, nurturing a large number of rare and endemic fish species. Historical records indicate that 286 fish species were distributed in the upper reaches of the Yangtze, including 124 endemic species. This basin contains numerous important habitats and ecologically sensitive areas of global and national conservation significance. Due to intensified human activities, the habitats of many adhesive-egg-laying fish species in the upper reaches of the Yangtze have been damaged to varying degrees. In 2000, Luzhou City designated a 132km section of the Yangtze River from Naxi to Hejiang as the main stream section of the National Nature Reserve for Rare and Endemic Fish Species in the Upper Yangtze. However, according to a survey conducted in 2015-2016, of the 96 spawning grounds of adhesive-egg-laying fish in the main stream section of the nature reserve, 28 were damaged to varying degrees, and 11 were severely damaged. Damaged spawning grounds accounted for 29.17%, and severely damaged spawning grounds accounted for 11.46%. The destruction of spawning grounds for sticky fish in the upper reaches of the Yangtze River National Nature Reserve will lead to a continuous decline in fishery resources in the upper reaches of the Yangtze River, and in the most severe case, even a phenomenon of aquatic desertification with "no fish in the upper reaches of the Yangtze River." Therefore, the restoration and reconstruction of sticky spawning grounds in the upper reaches of the Yangtze River National Nature Reserve is a current hot topic and a difficult issue. The key habitat factors for the restoration of habitats for sticky spawning fish mainly include riverbed morphology, riverbed sediment, water physicochemical indicators, and hydraulic habitat indicators. Among them, riverbed sediment, also known as river channel sediment, is usually composed of pebbles with different particle sizes. Riverbed sediment is an important physical component of river habitats. For bottom-dwelling sticky spawning fish, riverbed sediment is the carrier of their natural reproduction; it constitutes the physical environment for the fertilized eggs and early embryonic development of sticky fish, and its changes may directly affect the scale and effectiveness of natural reproduction of fish.
[0003] Therefore, to promote river basin habitat restoration, it is necessary to measure the particle size distribution of riverbed gravel. Existing methods for measuring riverbed gravel particle size distribution rely on traditional image processing, which involves image recognition processing based on digital photographs of the riverbed to automatically extract particle size distribution. Traditional computer image recognition methods employ automatic watershed segmentation algorithms. These algorithms are highly effective for interlocking, uniformly colored, flattened round particles. However, riverbed gravel layers typically have a more complex particle composition, with intraparticle variations, irregular shading, and large-scale sizes. Therefore, traditional automatic watershed methods suffer from undersegmentation, misidentification, and the need for extensive and time-consuming post-processing (e.g., basic processing using segmentation, merging, and deletion tools) when applied to such complex images. This results in poor accuracy and reliability of gravel segmentation and recognition, further reducing the accuracy of particle size distribution measurement data and impacting the effectiveness of river basin habitat restoration. Summary of the Invention
[0004] In view of the shortcomings of the prior art, the technical problem to be solved by the present invention is: how to provide a method for measuring the particle size distribution of riverbed sediment that can better identify and separate pebbles with covering relationships, thereby improving the accuracy of particle size distribution measurement.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0006] A method for measuring the particle size distribution of riverbed sediment is characterized by first taking a picture of the riverbed sediment to be measured, processing the picture into a standard-sized image, then converting it into a grayscale image, preprocessing the grayscale image to enhance the edges and obtain the edge contours of gravel (i.e., pebbles) (including single gravel and gravel to be segmented), then using a watershed segmentation algorithm to achieve gravel segmentation and identification by relying on at least two segmentations, calculating the length of each identified gravel, and statistically obtaining the particle size distribution of the riverbed sediment based on this value.
[0007] Thus, by employing the watershed segmentation algorithm, this invention relies on at least two segmentation identifications to better separate gravels with overlapping relationships, segment and identify the shape of individual gravels, and improve the accuracy of particle size distribution measurement. The scheme converts color photographs to grayscale images; this method has two advantages when applied to grayscale images: 1. Gravel particles are typically gray, brown, and black, and grayscale images can fully display the shape characteristics of the gravels; 2. Color gradations consume more computation time than grayscale (approximately three times).
[0008] Furthermore, a fixed square frame was placed at the riverbed sampling point, and the riverbed sediment was photographed perpendicular to the square frame. The photograph of the area inside the square frame was then processed into a standard square image.
[0009] This facilitates the cropping and acquisition of standard images, and standard square images make subsequent size ratio calculations easier. It also avoids recognition and processing errors caused by factors such as tilted shooting angles.
[0010] Furthermore, a scale is provided on the surface of the square frame facing the camera.
[0011] This makes it easier to quickly calculate the accurate size of the gravel by comparing it to the actual dimensions during later image processing. An even better option is a 1m x 1m border, which further facilitates proportional calculations.
[0012] Furthermore, images were taken over several consecutive days during the day. Each time an image was taken, a GPS positioning system was used to determine the current longitude and latitude geographical location to determine the location of the sampling point. After taking multiple photos, the average value was calculated to obtain the measurement results.
[0013] This will improve the accuracy and reliability of the measurement. Specifically, the Google positioning system can be used for positioning, with a horizontal error not exceeding 3 meters.
[0014] Furthermore, after the photo is converted to a grayscale image, the following preprocessing steps are performed: (1) image noise reduction; (2) image sharpening; (3) gradient amplitude edge detection to obtain the gravel edge contour.
[0015] In this way, the edge contour of the gravel can be obtained more clearly. In practice, the specific implementation methods such as image denoising, sharpening and edge detection are mature existing technologies in the field of image processing, so they will not be described in detail here.
[0016] More specifically, in the following steps: (1) Median filters are preferred for image denoising. Using median filters for image denoising removes noise while preserving image edges, resulting in a satisfactory restoration effect. Therefore, this scheme selects median filters. (2) Image sharpening is used because the smoothing of gravel photographs blurs boundaries and contours. To reduce the impact of these adverse effects, image sharpening techniques are used to clarify image edges, highlighting the edges and contours of ground features or certain linear target elements. This filtering improves the contrast between ground feature edges and surrounding pixels, and is also known as edge enhancement.
[0017] Furthermore, the segmentation and recognition process includes the following steps: (1) First, the computer uses the (traditional) watershed segmentation algorithm to perform the first segmentation, obtain each first segmented gravel and extract its image for storage; (2) Calculate the morphological coefficient of each first segmented gravel image; (3) Use the morphological coefficient to determine whether it is under-segmented; (4) Perform a second segmentation on the under-segmented gravel image; (5) Repeat steps (2), (3), and (4) on the gravel image after the second segmentation until the result no longer changes.
[0018] In this way, repeated segmentation and identification can better segment and identify the shape of individual gravel, improving the accuracy of particle size distribution measurement. In step (1), the computer identifies and stores individual gravel separately. The purpose of extracting each gravel separately is to make it easier, faster and more accurate for the computer to calculate its morphological coefficient.
[0019] Furthermore, the method for measuring and calculating the morphology coefficient includes the following two measurement steps: ① measuring the perimeter of the gravel edge; ② measuring the area of the gravel; after obtaining the above two data, the morphology coefficient is obtained by dividing the perimeter of the gravel edge by the circumference of the circle with the same area as the gravel area.
[0020] After extracting individual gravels, the shape factor of each gravel is calculated. The shape factor is the ratio of the perimeter of a two-dimensional object to the circumference of a circle of the same area. As is well known, a circle has the shortest circumference for the same area; the closer an object is to a circle, the more regular its shape, and thus the shorter its circumference. Therefore, the shape factor can be determined according to this principle, which can effectively distinguish whether there is undersegmentation.
[0021] Furthermore, during calculations, the perimeter and area are measured using the number of pixels. This makes the calculations more convenient.
[0022] Furthermore, ① when measuring the perimeter of the gravel edge: the first step is to convert the binary image into an image that only retains the edge outline, directly extracting only the edge outline of the entire gravel image; the next step is to count how many pixels are on the outline, that is, to calculate the perimeter of the gravel.
[0023] Specifically, the formula for calculating pixels is as follows:
[0024]
[0025] In the formula, X(i,j) represents the value at position (i,j) in the binary image. The value of white pixels in the binary image is 1, and the value of black pixels is 0.
[0026] ② When measuring the area of gravel, (same principle as above) calculate the number of white pixels in the entire gravel to represent the area of the gravel; since in a binary image, white pixels X(i,j)=1 and black pixels Y(i,j)=0;
[0027] Specifically, the formula is as follows:
[0028]
[0029] In the formula, X(i,j) represents the value at position (i,j) in the binary image.
[0030] Furthermore, in step (3), when using the morphological coefficient to determine whether there is undersegmentation, the gravel processed by the computer is divided into three types according to the morphological coefficient: 1. Gravel with a morphological coefficient between 1 and 1.4 is a single gravel; 2. Gravel with a morphological coefficient between 1.4 and 2 is a gravel with more overlap; 3. Gravel with a morphological coefficient above 2 is a gravel with less overlap; Gravel of type 2 and gravel of type 3 are identified as undersegmented gravel.
[0031] The rationale for this division is that, during implementation, the greater the overlap ratio between overlapping gravels, the closer they are to a circle or ellipse, and the smaller the morphology coefficient. Conversely, if only the edges overlap with little overlap, the morphology coefficient will be larger. For gravels with little overlap, they need to be separated for calculation. However, for gravels with a very large overlap ratio, even if they are mistakenly identified as a single gravel, the resulting dimensional error will not be significant, so forced separation is unnecessary. Therefore, based on this principle, a morphology coefficient threshold can be set according to an empirical value (which can be verified to ensure accuracy through multiple tests), allowing the computer to automatically separate under-divided gravels from well-divided gravels. The morphology coefficient is used to determine whether there is under-dividing. Specifically: 1. Single gravels do not require secondary processing; their maximum diameter can be measured directly after sorting. 2. Gravels with significant overlap are the most difficult type to handle in secondary division. In this type, the two gravels cover a large area, and after separating them, the maximum diameter cannot be measured directly. The gravels need to be filled in to cover the missing side before the maximum diameter can be measured. 3. Gravel with minimal overlap: This type is easier to handle than gravel with significant overlap. Most of the overlap is only marginal, covering a small area. Simply separate the gravel and measure its maximum diameter. Therefore, individual gravel of type 1 does not need to be separated, while gravel of types 2 and 3 needs to be separated individually to improve detection accuracy.
[0032] Furthermore, in step (4), when performing secondary division of the under-divided gravel, the type 2 gravel and the type 3 gravel are respectively divided into secondary divisions;
[0033] ① For Type 3 gravel secondary segmentation: First, edge recognition is performed to obtain a ring of pixels around the image edge. Then, tangents are drawn along the image edge, which are the lines connecting every two adjacent pixels on the edge. Abrupt changes in the tangent direction are found (the angle of change in the tangent direction exceeds a threshold or the quadrant to which the tangent direction points changes). The angle between the two tangents adjacent to the abrupt change point is calculated and checked to see if it is less than 45° (this value is a verified empirical value). If the angle between the two tangents is less than 45°, the abrupt change point is identified as a gravel-covered intersection point. All gravel-covered intersection points are found along the image edge. If the number of gravel-covered intersection points is 0, the image is re-identified as a single gravel. If the number of gravel cover intersections is 1, then segmentation is achieved along the midline of the angle between the two tangents at that gravel cover intersection. If the number of gravel cover intersections is 2, then segmentation is achieved along the line connecting the two gravel cover intersections. If the number of gravel cover intersections is greater than 2, then another gravel cover intersection that is closest to the perpendicular distance from the midline of the angle between the two tangents at the first gravel cover intersection is found, and segmentation is achieved along the line connecting the two gravel cover intersections. (The morphology coefficients of the two gravel images obtained in this way are then repeatedly calculated to determine whether there is undersegmentation, and the undersegmented gravel is segmented a second time, and this process is repeated until no more undersegmented gravel appears.)
[0034] Specifically, the formula for calculating the angle between two adjacent tangents at a point of abrupt change is as follows:
[0035] ;
[0036] In the formula, (i1,j1), (i2,j2), and (i3,j3) are the coordinates of three pixels on the perimeter of the gravel edge; α is the angle between the tangents at the abrupt change point.
[0037] To determine whether a point is a gravel-covered intersection, we only need to check if the angle between the vectors formed by three consecutive pixels at that point is cos(α)≤cos(45°). Since the angle between two vectors, cos(α), is always in the range of [-1,1], we only need to set a threshold cos(α)≤cos(45°) to find the feature point.
[0038] ② The secondary segmentation process for Type 2 gravel is based on the secondary segmentation process for Type 3 gravel, but with the addition of a step to fill in the segmented gravel image at the segmentation location; (because Type 2 gravel is generally a large area covered by two gravels, compared with Type 3 gravel, the covered area needs to be filled in after separation in order to calculate the maximum diameter, so as to ensure that the final detection result is accurate enough)
[0039] The completion steps specifically include: finding the maximum symmetry line in the segmented image. The maximum symmetry line has the following characteristics: perpendicular lines are drawn at equal intervals along this symmetry line, dividing the line into left and right segments. The ratio of the distance between the left and right segments of the perpendicular line to that of any segmentation line in the gravel is the highest among all such segments. In other words, this segmentation line makes the gravel most symmetrical. After obtaining the maximum symmetry line, the lengths of all perpendicular lines along it are calculated, and the longest perpendicular line is defined as the longest perpendicular line. The maximum symmetry line is defined as being divided into segments A and B by the longest perpendicular line. The longer of segments A and B is taken as the major semi-axis a of the ellipse. Using the position of this major semi-axis as the reference, half the length of the longest perpendicular line is taken as the minor semi-axis b of the ellipse. The original gravel shape is preserved, and the cuts are completed using the corresponding ellipse.
[0040] In this method, gravel with different morphological coefficients is classified into different types corresponding to different cover conditions. Different segmentation methods are then designed for each type. It's important to note that during repeated segmentation, the morphological coefficients need to be reassessed; that is, gravel may be re-identified as different gravel types and re-segmented during repeated segmentation. This process is more accurate and reliable, better ensuring the reliability of the final measurement results.
[0041] Furthermore, when calculating the length of each identified gravel, the coordinate distance between all pixels in the image outline is first calculated based on the gravel image obtained after segmentation and recognition processing. The distance between the two pixels with the largest distance is taken as the maximum diameter of the gravel image. Then, the actual maximum diameter of the gravel is obtained by conversion according to the corresponding ratio. Each gravel is classified and statistically analyzed according to different maximum diameter ranges to obtain the gravel gradation statistics of the riverbed bottom sediment.
[0042] Therefore, this scheme develops a novel semi-automatic measurement technology. It improves the traditional watershed segmentation method by utilizing various preprocessing techniques and multi-threshold semi-automatic control methods. It also incorporates automatic differentiation of under-segmented gravel, performing secondary segmentation on these under-segmented gravel. Furthermore, through multiple preprocessing steps and multi-level threshold fusion, it identifies the regional characteristics of various gravels, ensuring the reliability of the secondary segmentation. Thus, the improved method constructed in this scheme can effectively identify and differentiate under-segmented gravel, and simulate the edge curve of each under-segmented gravel individually before measuring its maximum diameter. This significantly improves the accuracy of the identification and measurement. Attached Figure Description
[0043] Figure 1 This is a schematic diagram of the structure using a square frame in the implementation of the present invention.
[0044] Figure 2 This is a photographic illustration taken during the implementation of the present invention.
[0045] Figure 3 for Figure 2 A diagram illustrating the process of converting to grayscale.
[0046] Figure 4 for Figure 3 This is a schematic diagram of the initial image segmentation result.
[0047] Figure 5 This is a schematic diagram of a single gravel with a morphology coefficient between 1 and 1.4.
[0048] Figure 6 This is a schematic diagram of a cluster of gravels with overlapping morphological coefficients between 1.4 and 2.
[0049] Figure 7 This is a schematic diagram of gravel with fewer overlaps and a morphology factor of 2 or higher.
[0050] Figure 8 for Figure 7 The diagram shows the secondary segmentation result of the gravel diagram.
[0051] Figure 9 This is a schematic diagram of the secondary segmentation result of the gravel diagram shown in Question 6.
[0052] Figure 10 for Figure 9 A schematic diagram showing the process of finding the line of maximum symmetry for the two gravels after they have been divided into two pieces.
[0053] Figure 11 for Figure 10 After finding the line of maximum symmetry between the two pebbles, schematic diagrams of segments A and B are defined respectively.
[0054] Figure 12 for Figure 11 A diagram showing the two gravels after they have been filled in.
[0055] Figure 13 This is a schematic diagram comparing the cumulative percentage curves and percentage histograms measured using three different methods during reliability verification.
[0056] Figure 14 A table showing the correlation results of measurement results from three different methods used for reliability verification. Detailed Implementation
[0057] The present invention will now be described in further detail with reference to specific embodiments.
[0058] Detailed implementation method: See Figure 1-3 ,
[0059] A method for measuring the particle size distribution of riverbed sediment is characterized by the following steps: First, photograph the riverbed sediment to be measured, process the photograph into a standard-sized image, then convert it into a grayscale image, preprocess the grayscale image to enhance the edges and obtain the edge contours of gravel (i.e., pebbles) (including single gravel and gravel to be segmented), then use a watershed segmentation algorithm to achieve gravel segmentation and identification by relying on at least two segmentations, calculate the length of each identified gravel, and statistically obtain the particle size distribution of the riverbed sediment based on this value.
[0060] Thus, by employing the watershed segmentation algorithm, this invention relies on at least two segmentation identifications to better separate gravels with overlapping relationships, segment and identify the shape of individual gravels, and improve the accuracy of particle size distribution measurement. The scheme converts color photographs to grayscale images; this method has two advantages when applied to grayscale images: 1. Gravel particles are typically gray, brown, and black, and grayscale images can fully display the shape characteristics of the gravels; 2. Color gradations consume more computation time than grayscale (approximately three times).
[0061] In implementation, a fixed square border 1 is used (see...). Figure 1 Place the sampling point on the riverbed and take a picture of the riverbed sediment perpendicular to the square frame 1 (see...). Figure 2 The image inside the square border is processed into a standard square-sized image.
[0062] This facilitates the cropping and acquisition of standard images, and standard square images make subsequent size ratio calculations easier. It also avoids recognition and processing errors caused by factors such as tilted shooting angles.
[0063] Among them, a scale 2 is set on the surface of the square frame 1 facing the camera.
[0064] This makes it easier to quickly calculate the accurate size of the gravel by comparing it to the actual dimensions during later image processing. An even better option is a 1m x 1m border, which further facilitates proportional calculations.
[0065] During implementation, images were taken over several consecutive days during the day. Each time an image was taken, a GPS positioning system was used to determine the current longitude and latitude geographical location to determine the location of the sampling point. After taking multiple photos, the average value was calculated to obtain the measurement results.
[0066] This will improve the accuracy and reliability of the measurement. Specifically, the Google positioning system can be used for positioning, with a horizontal error not exceeding 3 meters.
[0067] Among them, after the photo is converted to a grayscale image (see...) Figure 3 The following preprocessing steps are performed respectively: (1) Image denoising; (2) Image sharpening; (3) Gradient amplitude edge detection to obtain the gravel edge contour.
[0068] In this way, the edge contour of the gravel can be obtained more clearly. In practice, the specific implementation methods such as image denoising, sharpening and edge detection are mature existing technologies in the field of image processing, so they will not be described in detail here.
[0069] More specifically, in the following steps: (1) Median filters are preferred for image denoising. Using median filters for image denoising removes noise while preserving image edges, resulting in a satisfactory restoration effect. Therefore, this scheme selects median filters. (2) Image sharpening is used because the smoothing of gravel photographs blurs boundaries and contours. To reduce the impact of these adverse effects, image sharpening techniques are used to clarify image edges, highlighting the edges and contours of ground features or certain linear target elements. This filtering improves the contrast between ground feature edges and surrounding pixels, and is also known as edge enhancement.
[0070] The segmentation and recognition process includes the following steps: (1) First, a (traditional) watershed segmentation algorithm is used by a computer to perform the first segmentation (see...). Figure 4 (1) Obtain each first-segmented gravel and extract its image separately for storage; (2) Calculate the morphological coefficient of each first-segmented gravel image; (3) Use the morphological coefficient to determine whether it is under-segmented; (4) Perform secondary segmentation on the under-segmented gravel image; (5) Repeat steps (2), (3), and (4) on the gravel image after secondary segmentation until the result no longer changes.
[0071] In this way, repeated segmentation and identification can better segment and identify the shape of individual gravel, improving the accuracy of particle size distribution measurement. In step (1), the computer identifies and stores individual gravel separately. The purpose of extracting each gravel separately is to make it easier, faster and more accurate for the computer to calculate its morphological coefficient.
[0072] The method for measuring and calculating the morphology coefficient includes the following two measurement steps: ① measuring the perimeter of the gravel edge; ② measuring the area of the gravel. After obtaining the above two data, the morphology coefficient is obtained by dividing the perimeter of the gravel edge by the circumference of the circle with the same area as the gravel area.
[0073] After extracting individual gravels, the shape factor of each gravel is calculated. The shape factor is the ratio of the perimeter of a two-dimensional object to the circumference of a circle of the same area. As is well known, a circle has the shortest circumference for the same area; the closer an object is to a circle, the more regular its shape, and thus the shorter its circumference. Therefore, the shape factor can be determined according to this principle, which can effectively distinguish whether there is undersegmentation.
[0074] In this calculation, the perimeter and area are measured using the number of pixels. This makes the calculation more convenient.
[0075] Among them, ① when measuring the perimeter of the gravel edge: the first step is to convert the binary image into an image that only retains the edge outline, directly leaving only the edge outline of the entire gravel image; the next step is to count how many pixels are on the outline, that is, to calculate the perimeter of the gravel.
[0076] Specifically, the formula for calculating pixels is as follows:
[0077]
[0078] In the formula, X(i,j) represents the value at position (i,j) in the binary image. The value of white pixels in the binary image is 1, and the value of black pixels is 0.
[0079] ② When measuring the area of gravel, (same principle as above) calculate the number of white pixels in the entire gravel to represent the area of the gravel; since in a binary image, white pixels X(i,j)=1 and black pixels Y(i,j)=0;
[0080] Specifically, the formula is as follows:
[0081]
[0082] In the formula, X(i,j) represents the value at position (i,j) in the binary image.
[0083] During implementation, when using morphological coefficients to determine whether there is undersegmentation in step (3), the gravel processed by the computer is divided into three types based on the morphological coefficients: 1. Gravel with a morphological coefficient between 1 and 1.4 is a single gravel (see [link to relevant documentation]). Figure 5 ); 2. Gravel with a morphology coefficient between 1.4 and 2 is characterized by significant overlap (see Figure 6 ); 3. Gravel with a morphology coefficient of 2 or higher is characterized by less overlap (see Figure 7 Type 2 gravel and Type 3 gravel were identified as under-divided gravel.
[0084] The rationale for this division is that, during implementation, the greater the overlap ratio between overlapping gravel, the closer it is to a circle or ellipse, and the smaller the morphology coefficient. Conversely, if only the edges overlap with little overlap, the morphology coefficient will be larger. For gravel with little overlap, it needs to be separated for calculation. However, for gravel with a very large overlap ratio, even if it is mistakenly identified as a single gravel, the resulting dimensional error will not be significant, so forced separation is unnecessary. Therefore, based on this principle, a morphology coefficient threshold can be set according to an empirical value (which can be verified to ensure accuracy through multiple tests), allowing the computer to automatically separate under-divided gravel from well-divided gravel. The morphology coefficient is used to determine whether under-dividing is necessary. Specifically: 1. Single gravel does not require secondary processing; its maximum diameter can be measured directly after sorting. 2. Gravel with significant overlap is the most difficult type to handle for secondary division. In this type, the two gravels cover a large area, and after separating them, the maximum diameter cannot be measured directly. The gravel needs to be filled in to cover the missing side before the maximum diameter can be measured. 3. Gravel with minimal overlap: This type is easier to handle than gravel with significant overlap. Most of the overlap is only marginal, covering a small area. Simply separate the gravel and measure its maximum diameter. Therefore, individual gravel of type 1 does not need to be separated, while gravel of types 2 and 3 needs to be separated individually to improve detection accuracy.
[0085] In step (4), when performing secondary segmentation on the under-segmented gravel, type 2 gravel and type 3 gravel are respectively subjected to secondary segmentation (see...). Figures 8-9 );
[0086] ① For Type 3 gravel secondary segmentation: First, edge recognition is performed to obtain a ring of pixels around the image edge. Then, tangents are drawn along the image edge, which are the lines connecting every two adjacent pixels on the edge. Abrupt changes in the tangent direction are identified (the angle of change exceeds a threshold or the quadrant the tangent points to changes). The angle between the two tangents adjacent to the abrupt change point is calculated and checked to see if it is less than 45° (this is a verified empirical value). If the angle is less than 45°, the abrupt change point is identified as a gravel-covered intersection. All gravel-covered intersections are found along the image edge. If the number of gravel-covered intersections is 0, the image is reclassified as a single gravel. If the number of gravel-covered intersections is 0, the image is reclassified as a single gravel. If the number of intersection points is 1, segmentation is achieved along the midline of the angle between the two tangents at that intersection point. If the number of intersection points is 2, segmentation is achieved along the line connecting the two intersection points. If the number of intersection points is greater than 2, find the other gravel cover intersection point that is closest to the perpendicular distance from the midline of the angle between the two tangents at the first gravel cover intersection point, and segment along the line connecting the two intersection points. (The morphological coefficients of the two gravel images obtained in this way are then repeatedly calculated to determine if there is undersegmentation. Undersegmented gravel is then segmented a second time, and this process is repeated until no more undersegmented gravel appears.) See the secondary segmentation results for Type 3 gravel for details. Figure 8 ;
[0087] Specifically, the formula for calculating the angle between two adjacent tangents at a point of abrupt change is as follows:
[0088] ;
[0089] In the formula, (i1,j1), (i2,j2), and (i3,j3) are the coordinates of three pixels on the perimeter of the gravel edge; α is the angle between the tangents at the abrupt change point.
[0090] To determine whether a point is a gravel-covered intersection, we only need to check if the angle between the vectors formed by three consecutive pixels at that point is cos(α)≤cos(45°). Since the angle between two vectors, cos(α), is always in the range of [-1,1], we only need to set a threshold cos(α)≤cos(45°) to find the feature point.
[0091] ② Type 2 gravel secondary segmentation process (see segmentation result image) Figure 9-12 (For example) Based on the above-mentioned Type 3 gravel secondary segmentation process, an additional step is to add processing to the segmented gravel image (see...). Figure 9 The step of filling in the gaps at the split locations; (because Type 2 gravel is generally a large area covered by two gravels, compared with Type 3 gravel, after separation, the covered areas need to be filled in in order to calculate the maximum diameter, so as to ensure that the final detection results are accurate enough)
[0092] The completion step specifically includes: finding the maximum symmetry line in the segmented image (see...). Figure 10 The characteristic of this maximum symmetry line is as follows: Perpendicular lines are drawn at equal intervals along this symmetry line, dividing it into left and right segments. The percentage of segments whose distance is divided by the length of the left and right segments within the range of 0.9-1.1 is the highest among any dividing lines in this gravel. In other words, this dividing line makes the gravel most symmetrical. After obtaining the maximum symmetry line, the lengths of all perpendicular lines along it are calculated, and the longest perpendicular line is defined as the longest perpendicular line. The maximum symmetry line is defined as being divided into segments A and B by the longest perpendicular line (see...). Figure 11 Determine the length of segment A and segment B, and take the longer one as the major semi-axis 'a' of the ellipse. Using this major semi-axis as the reference point, take half the length of the longest perpendicular line as the minor semi-axis 'b'. Preserve the original gravel shape, and fill in the cuts with the corresponding ellipse (see...). Figure 12 ).
[0093] In this method, gravel with different morphological coefficients is classified into different types corresponding to different cover conditions. Different segmentation methods are then designed for each type. It's important to note that during repeated segmentation, the morphological coefficients need to be reassessed; that is, gravel may be re-identified as different gravel types and re-segmented during repeated segmentation. This process is more accurate and reliable, better ensuring the reliability of the final measurement results.
[0094] During implementation, when calculating the length of each identified gravel, the coordinate distance between all pixels in the image outline is first calculated based on the gravel image obtained after segmentation and recognition processing. The distance between the two pixels with the largest distance is taken as the maximum diameter of the gravel image. Then, the actual maximum diameter of the gravel is obtained by conversion according to the corresponding ratio. Each gravel is classified and statistically analyzed according to different maximum diameter ranges to obtain the gravel gradation statistics of the riverbed bottom sediment.
[0095] In addition, to verify the accuracy and reliability of the algorithm in the field photos, the Dazhongba spawning ground was selected as the verification object. For eight gradations of gravel (0-2, 2-4, 4-6, 6-8, 8-10, 10-12, 12-14, 14-16, and 16-20 cm; all representing the maximum diameter), five sampling points in the Dazhongba spawning ground were measured using three methods: The first method involved manual on-site measurement, followed by merging the maximum diameter results from the five sampling points to form gradation A; the second method used the traditional watershed method, again merging the maximum diameter results from the five sampling points to form gradation B; and the third method used an improved watershed method, merging the maximum diameter results from the five sampling points to form gradation C.
[0096] After three measurements using different methods, three gradations (A, B, and C) were obtained for the Dazhongba spawning grounds. The three sets of data were compared and correlation analysis was performed to determine the advantages, disadvantages, accuracy, and reliability of improving the watershed region.
[0097] Depend on Figure 13 It can be seen that, using manual measurement as the true value, comparing the improved watershed method of this application with the traditional watershed domain method, the improved watershed domain method is closer to the true value and has higher accuracy. Figure 14 The table below shows the correlation analysis of the particle size distribution gradation obtained by the three methods. Using manual measurement as a reference, the correlation coefficient of our method is 0.999, while the correlation coefficient of the traditional watershed method is 0.952. This indicates that our method is superior to the traditional watershed method in measuring the particle size distribution of riverbed sediment. The main reason for this is that the traditional watershed method is prone to undersegmentation in complex backgrounds, where many stones merge into one, significantly reducing the accuracy of measuring the maximum diameter of pebbles. The improved algorithm first incorporates multi-threshold adjustment, making the contours of gravel extracted from complex backgrounds clearer and more accurate. Secondly, it improves the undersegmentation problem by performing secondary segmentation on undersegmented gravel, greatly improving accuracy.
Claims
1. A method for measuring the particle size distribution of riverbed sediment, characterized in that, First, take a picture of the riverbed sediment to be measured, process the picture into a standard size image, then convert it into a grayscale image, preprocess the grayscale image to enhance the edge and obtain the edge contour of the gravel, and then use the watershed segmentation algorithm to achieve the segmentation and identification of the gravel by at least two segmentations. Calculate the length of each identified gravel and statistically obtain the particle size distribution of the riverbed sediment based on this value. The segmentation and recognition process includes the following steps: (1) First, the watershed segmentation algorithm is used to perform the first segmentation using a computer to obtain each first segmented gravel and extract its image for storage; (2) The morphological coefficients of each first segmented gravel image are calculated; (3) The morphological coefficients are used to determine whether there is undersegmentation; (4) The undersegmented gravel images are segmented a second time; (5) Steps (2), (3), and (4) are repeated for the gravel images after the second segmentation until the results no longer change.
2. The method for measuring the particle size distribution of riverbed sediment as described in claim 1, characterized in that, A fixed square frame was placed at the riverbed sampling point, and the riverbed sediment was photographed perpendicular to the frame. The photographs of the area inside the square frame were then processed into standard square-sized images.
3. The method for measuring the particle size distribution of riverbed sediment as described in claim 2, characterized in that, A scale is set on the surface of the square frame facing the camera. The border dimensions are 1m x 1m; Images were taken over several consecutive days during the day. During each shooting session, a GPS positioning system was used to determine the current longitude and latitude geographical location to pinpoint the sampling point.
4. The method for measuring the particle size distribution of riverbed sediment as described in claim 2, characterized in that, After the photo is converted to grayscale, the following preprocessing steps are performed: (1) image noise reduction; (2) image sharpening; (3) gradient amplitude edge detection to obtain the gravel edge contour.
5. The method for measuring the particle size distribution of riverbed sediment as described in claim 4, characterized in that, A median filter is used for image noise reduction.
6. The method for measuring the particle size distribution of riverbed sediment as described in claim 1, characterized in that, The calculation of the morphology factor involves the following two measurement steps: ① measuring the perimeter of the gravel edge; ② measuring the area of the gravel. After obtaining the above two data, the morphology factor is obtained by dividing the perimeter of the gravel edge by the circumference of the circle with the same area as the gravel area. During the calculation, the perimeter and area are measured using the number of pixels. ① When measuring the perimeter of a gravel edge: First, convert the binary image into an image that only retains the edge outline. Directly extract the entire gravel image and leave only the edge outline. Next, count the number of pixels on the outline to calculate the perimeter of the gravel. ② When measuring the area of a gravel, the area can be represented by the number of white pixels in the entire gravel.
7. The method for measuring the particle size distribution of riverbed sediment as described in claim 1, characterized in that, When using the morphology coefficient to determine whether the gravel is under-segmented in step (3), the gravel processed by the computer is divided into three types according to the morphology coefficient:
1. Gravel with a morphology coefficient between 1 and 1.4 is a single gravel; 2. Gravel with a morphology coefficient between 1.4 and 2 is a gravel with more overlap; 3. Gravel with a morphology coefficient above 2 is a gravel with less overlap. Type 2 gravel and Type 3 gravel are identified as under-segmented gravel.
8. The method for measuring the particle size distribution of riverbed sediment as described in claim 7, characterized in that, In step (4), when performing secondary division of the under-divided gravel, the type 2 gravel and the type 3 gravel are divided into secondary divisions respectively; For Type 3 gravel secondary segmentation: First, edge recognition of the image is performed to obtain a ring of pixels around the image edge. Then, tangents are drawn along the image edge, which are the lines connecting every two adjacent pixels on the edge. Abrupt changes in the direction of the tangents are found, and the angle between the two tangents adjacent to the abrupt change point is calculated. If the angle is less than 45°, the abrupt change point is identified as a gravel-covered intersection. All gravel-covered intersections are found along the image edge. If the number of gravel-covered intersections is 0, the image is re-identified as a single gravel. If the number of gravel-covered intersections is 1, segmentation is performed from that gravel-covered intersection along the midline of the angle between the two tangents at that point. If the number of gravel-covered intersections is 2, segmentation is performed along the line connecting the two gravel-covered intersections. If the number of gravel-covered intersections is greater than 2, the other gravel-covered intersection closest to the vertical distance of the midline of the angle between the two tangents at the first gravel-covered intersection is found, and segmentation is performed along the line connecting the two gravel-covered intersections. The Type 2 gravel secondary segmentation process is based on the Type 3 gravel secondary segmentation process described above, with the addition of a step to fill in the segmented gravel image at the segmentation position; The completion steps specifically include: finding the maximum symmetry line in the segmented image. The maximum symmetry line has the following characteristics: perpendicular lines are drawn at equal intervals along this symmetry line, dividing the line into left and right segments. The ratio of the distance between the left and right segments of the perpendicular line to that of any segmentation line in the gravel is the highest among all such segments. In other words, this segmentation line makes the gravel most symmetrical. After obtaining the maximum symmetry line, the lengths of all perpendicular lines along it are calculated, and the longest perpendicular line is defined as the longest perpendicular line. The maximum symmetry line is defined as being divided into segments A and B by the longest perpendicular line. The longer of segments A and B is taken as the major semi-axis a of the ellipse. Using the position of this major semi-axis as the reference, half the length of the longest perpendicular line is taken as the minor semi-axis b of the ellipse. The original gravel shape is preserved, and the cuts are completed using the corresponding ellipse.
9. The method for measuring the particle size distribution of riverbed sediment as described in claim 1, characterized in that, When calculating the length of each identified gravel, the coordinate distance between all pixels in the image outline is first calculated based on the gravel image obtained after segmentation and recognition. The distance between the two pixels with the largest distance is taken as the maximum diameter of the gravel image. Then, the actual maximum diameter of the gravel is obtained by conversion according to the corresponding ratio. Each gravel is classified and statistically analyzed according to different maximum diameter ranges to obtain the gravel gradation statistics of the riverbed bottom.
Citation Information
Patent Citations
LiDAR (Light Detecting and Ranging) data single-tree extraction method with combination of morphological canopy control and watershed
CN102419818A
Ore image granularity detection algorithm based on image processing technology
CN111047555A