Automatic coal gangue segmentation method in combination with gray scale fluctuation phenomenon at coal gangue contour
By improving the regional growth algorithm combined with grayscale fluctuations, the initial seed points and update thresholds are automatically determined, which solves the problem of inaccurate attitude and shape acquisition in coal gangue image recognition, and realizes high-precision automatic segmentation on gray-black conveyor belts to adapt to coal gangue characteristics in different regions.
Patent Information
- Application Number
- CN202510356964.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-11
Smart Images

Figure CN120298425A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an automatic coal gangue segmentation method combining the gray-scale fluctuation phenomenon at the contour of coal gangue, industrial processes, and the field of applied image processing. Background Art
[0002] Coal is an important basic energy source and industrial raw material, occupying an important position in the global energy supply. As the second-largest energy source after oil, coal is an indispensable energy source. In the actual industrial application of current intelligent coal gangue screening, the existing traditional coal gangue image recognition technology has achieved high efficiency and accuracy. However, during the coal gangue selection process, the manipulator cannot accurately obtain the current posture and shape of the coal gangue, resulting in the phenomenon that the coal gangue falls off from the manipulator, and the phenomenon that the manipulator fails to grasp the coal gangue with the wrong posture, which greatly reduces the efficiency of intelligent coal gangue selection. Therefore, in order to improve the efficiency of intelligent coal gangue selection, we can try to further obtain the shape of the coal gangue, that is, perform contour segmentation processing on the coal gangue image to better enable the manipulator to grasp the coal gangue.
[0003] Currently, the use of artificial intelligence or deep learning models can achieve high-precision automatic contour segmentation of coal gangue. However, a large number of training sets are required in advance to train the model, and it is difficult to obtain the image segmentation data set. Moreover, the image features exhibited by coal gangue in different regions and coal mining areas are not the same. When applied to different places, a large number of data sets need to be collected again for re-training, which is very inconvenient to use.
[0004] Although some traditional segmentation algorithms can achieve relatively ideal segmentation accuracy, certain parameters need to be determined manually or through interaction, and automatic segmentation cannot be achieved. In addition, although some other traditional algorithms can perform automatic segmentation, under the condition of similar backgrounds, such as the image segmentation accuracy of coal gangue on a grayish-black conveyor belt is not ideal and there is still much room for improvement. Summary of the Invention
[0005] The purpose of the present invention is to provide an automatic coal gangue segmentation method combining the gray-scale fluctuation phenomenon at the contour of coal gangue to solve the above problems.
[0006] The region growing algorithm is an existing technology for image segmentation. The basic steps of using the region growing algorithm to segment the coal gangue image are as follows:
[0007] The first step: Import the processed coal gangue image as the input image;
[0008] The second step: The user manually determines a point on the coal gangue as the initial seed point; The third step: Save the color intensity of the initial seed point as the base value;
[0009] The fourth step: Set the threshold;
[0010] Step 5: Similarity check;
[0011] Step 6: Add adjacent pixels that meet the conditions according to the growth rule and save them as growth points;
[0012] Step 7: Check the new adjacent pixels again, add adjacent pixels that meet the conditions, and save them as growth points;
[0013] Step 8: Until there are no new growth points, the obtained pixel array is the segmented gangue area, and the outermost pixels are the segmented gangue contour boundary.
[0014] An automatic gangue segmentation method combining the gray-scale fluctuation phenomenon at the gangue contour provided by the present invention is realized by improving the region growing algorithm and then combining the gray-scale fluctuation phenomenon at the gangue contour.
[0015] The steps of an automatic gangue segmentation method combining the gray-scale fluctuation phenomenon at the gangue contour are as follows:
[0016] Step 1: Import the output image from the image recognition module, crop it, and use the processed result as the input image; Step 2: Gray-scale the input image to obtain a gray-scale image;
[0017] Step 3: Use the gray-scale chaos method to obtain a rough contour image;
[0018] Combine the gray-scale fluctuation phenomenon at the gangue contour to determine the initial seed points of the improved region growing algorithm. In the case of similar colors, the gray-scale value distributions on the gangue and the background are relatively stable, while the gray-scale value distribution at the contour line is relatively complex, showing a cliff-like change. Through analysis, it is found that because the pixel block at the contour contains the gray-scale values of both the gangue and the conveyor belt regions, the gray-scale values show a large distribution difference at the contour. Therefore, we designed a method to judge the gray-scale fluctuation chaos degree in a certain area. Specifically, a group of 3×3 pixels forms a pixel block, and then according to the formula The disorder of the pixel block is determined. After multiple tests, analysis and verification, it is finally determined that the image adapted to the threshold of disorder C is set to 220, which is the most universal; H measures the number of rows in the 3×3 pixel block matrix that meet the monotonic trend of the edge, and the positive and negative values indicate the direction of the monotonicity. If H≥2, it can be considered that the pixel block meets the monotonicity of the edge in the row direction; V measures the number of columns in the 3×3 pixel block matrix that meet the monotonic trend of the edge, and the positive and negative values indicate the direction of the monotonicity. If V≥2, it can be considered that the pixel block meets the monotonicity of the edge in the row direction. Therefore, when the disorder of the pixel block is H≥220, H≥2, and V≥2, the area is the contour line of the gangue, and its central pixel is marked as white. All pixel points are traversed to obtain the binary image of the contour of the gangue.
[0019] Step 4: Automatically determine the initial seed point p1 and process the grayscale histogram to obtain the grayscale threshold for segmentation
[0020] The maximum contour in the binary image obtained in the third step is extracted, and the contour is the rough contour of the gangue and is set as the target contour D. The centroid C of the target contour is found, and the centroid C is set as the initial seed point, where A in the formula is the area of the target contour D.
[0021] Step 5: Select the grayscale image as the input image for fine segmentation and save the grayscale value of the initial seed point as the base value
[0022] Step 6: Add adjacent pixels that meet the conditions according to the region growing algorithm rules and save them as growth points;
[0023] Step 7: Check the new adjacent pixels again, add the adjacent pixels that meet the conditions, and save them as growth points;
[0024] Step 8: until there are no new growth points, the pixel array obtained is the segmented coal gangue area;
[0025] Step 9: Identify the contour with the largest area as the boundary of the segmented gangue and fill the inside;
[0026] Step 10: Initial seed point expansion
[0027] After determining the centroid C of the target contour D, two intersecting dividing lines are made with the centroid C as the origin, and the angles of the two intersecting dividing lines are both 90°, dividing the area into 4 regions. The centroids of the 4 regions are set as 4 additional points for expansion, namely, point p1, point p2, point p3 and point p4. If a centroid appears outside the contour of the area, the midpoint of the minimum distance line between the centroid and the contour of the area is set as the expanded point, and the obtained points p1, p2, point p3 and point p4 are used as initial seed points for expansion.
[0028] The eleventh step: Automatically update the grayscale threshold
[0029] When performing region growing at the initial seed point p0, set the threshold as the grayscale value corresponding to the intersection point of the grayscale histograms of the grayscale values inside and outside the rough contour of the coal gangue in the grayscale image of the input image minus the grayscale value at the seed point. At the centroid points of the 4 regions, use the grayscale value corresponding to the intersection point of the grayscale histograms of the inside and outside of the contour of the region corresponding to the initial seed point p1 minus the grayscale value at the p1 seed point as the grayscale threshold for contour segmentation of p1. For the initial seed points p2, p3, and p4, the set thresholds for queuing for region growing are all updated sequentially through the above operations.
[0030] The twelfth step: Repeat the sixth step to the ninth step to obtain 5 coal gangue contours for region growing at the initial seed point p0, the initial seed point p1, the initial seed point p2, the initial seed point p3, and the initial seed point p4
[0031] The thirteenth step: According to the established coal gangue contour screening conditions, select the combination of the credible segmentation results obtained from the initial seed point p0 to the initial seed point p4 as the final segmentation result
[0032] Use the contour image segmented by the initial seed point p0 as the fine contour, use the contour image segmented by the initial seed point p1 as the region contour, and the image obtained by subtracting the fine contour is called the difference contour. Judge each region in the difference contour. If the length of the side of the region overlapping with the fine contour is greater than 0.75 times the perimeter of the region, then the region shows an obvious concave-in characteristic and is merged into the fine contour. Otherwise, if the concave-in characteristic is not obvious, it is discarded. The same operations are performed on the initial seed points p2, p3, and p4, and select all the final merging results among the initial seed point p0 to the initial seed point p4 as the final segmentation result
[0033] The beneficial effects of the present invention are: for the coal gangue on the grayish-black conveyor belt, this method can eliminate a large amount of manual operations, realize automatic coal gangue segmentation, and the combination of multiple segmentation results as the final segmentation result has higher segmentation accuracy Description of the drawings
[0034] Figure 1 It is a flowchart of an automatic coal gangue segmentation method combining the gray-scale fluctuation phenomenon at the coal gangue contour
[0035] Figure 2 It is a schematic diagram of the expansion of the initial seed point Detailed implementation manners
[0036] To describe the present invention more specifically, the following will provide a detailed description of an automatic coal gangue segmentation method that combines the gray-scale fluctuation phenomenon at the coal gangue contour with reference to the accompanying drawings and specific embodiments.
[0037] The present invention provides an automatic coal gangue segmentation method that combines the gray-scale fluctuation phenomenon at the coal gangue contour. As shown in the flowchart of this method Figure 1 as follows, its main implementation steps are as follows:
[0038] First step: Import the output image from the image recognition module, crop it, and use the processed result as the input image; Second step: Grayscale the input image to obtain a grayscale image;
[0039] Third step: Use the gray-scale chaos method to obtain a rough contour image;
[0040] Combined with the gray-scale fluctuation phenomenon at the coal gangue contour to determine the initial seed points of the improved region growing algorithm. In the case of similar colors, the gray-scale values on the coal gangue and the background are relatively stable, while the gray-scale value distribution at the contour line is relatively complex, showing a cliff-like change. After analysis, it is found that because the pixel block at the contour contains the gray-scale values of both the coal gangue and the conveyor belt regions, the gray-scale values show a large distribution difference at the contour. Therefore, we designed a method to judge the gray-scale fluctuation chaos degree in a certain area. Specifically, a group of 3×3 pixel points form a pixel block, and then according to the formula judge the chaos degree of the pixel block. Through multiple tests, analyses, and verifications, it is finally determined that the image adapted when the threshold of chaos degree C is set to 220 is the most universal; H measures the number of rows in the 3×3 pixel block matrix that satisfy the edge monotonic trend, and the positive and negative indicate the monotonic direction. If H≥2, it can be considered that the pixel block satisfies the edge monotonicity in the row direction; V measures the number of columns in the 3×3 pixel block matrix that satisfy the edge monotonic trend, and the positive and negative indicate the monotonic direction. If V≥2, it can be considered that the pixel block satisfies the edge monotonicity in the row direction. Therefore, when the chaos degree of the pixel block H≥220, H≥2, and V≥2, this area is the coal gangue contour line, and its central pixel is marked white. Traverse all pixel points to obtain the binary image of the coal gangue contour.
[0041] Fourth step: Automatically determine the initial seed point p1 and process the gray-scale histogram to obtain the gray-scale threshold for segmentation
[0042] Extract the largest contour in the binary image obtained in the third step. This contour is the rough contour of the coal gangue and is set as the target contour D. Through the formula find the centroid C of the target contour and set the centroid C as the initial seed point. In the formula, A is the area of the target contour D.
[0043] Step 5: Select the grayscale image as the input image for fine segmentation and save the grayscale value of the initial seed point as the base value
[0044] Step 6: Add adjacent pixels that meet the conditions according to the region growing algorithm rules and save them as growth points;
[0045] Step 7: Check the new adjacent pixels again, add the adjacent pixels that meet the conditions, and save them as growth points;
[0046] Step 8: until there are no new growth points, the pixel array obtained is the segmented coal gangue area;
[0047] Step 9: Identify the contour with the largest area as the boundary of the segmented gangue and fill the inside;
[0048] Step 10: Initial seed point expansion
[0049] After determining the centroid C of the target contour D, two intersecting dividing lines are made with the centroid C as the origin, and the angles of the two intersecting dividing lines are both 90°, dividing the area into 4 regions. The centroids of the 4 regions are set as 4 additional points for expansion, namely, point p1, point p2, point p3 and point p4. If a centroid appears outside the contour of the area, the midpoint of the minimum distance line between the centroid and the contour of the area is set as the expanded point, and the obtained points p1, p2, point p3 and point p4 are used as initial seed points for expansion.
[0050] Step 11: Automatically update the grayscale threshold
[0051] When the initial seed point p0 is used for regional growth, the threshold is set to the grayscale value corresponding to the intersection point of the grayscale histogram of the grayscale values inside and outside the rough contour of the gangue in the grayscale image of the input image minus the grayscale value at the seed point. At the centroid point of the four regions, the grayscale value corresponding to the intersection point of the grayscale histogram of the inner and outer contour of the region corresponding to the initial seed point p1 minus the grayscale value at the p1 seed point is used as the grayscale threshold for contour segmentation of p1. The initial seed point p2, the initial seed point p3, the initial seed point p4, and the set thresholds for queuing for regional growth are all updated in sequence through the above operations.
[0052] Step 12: Repeat steps 6 to 9 to obtain 5 coal gangue contours for regional growth at initial seed point p0, initial seed point p1, initial seed point p2, initial seed point p3, and initial seed point p4;
[0053] Step 13: According to the established gangue contour screening conditions, a combination of credible segmentation results obtained from the initial seed point p0 to the initial seed point p4 is selected as the final segmentation result;
[0054] The contour image obtained by segmenting with the initial seed point p0 is the fine contour, the contour image obtained by segmenting with the initial seed point p1 is the region contour, and the image obtained by subtracting the fine contour is called the difference contour. For each region in the difference contour, if the length of the side where the region overlaps with the fine contour is greater than 0.75 times the perimeter of the region, then the region exhibits an obvious concave characteristic and is merged into the fine contour; otherwise, if the concave characteristic is not obvious, it is discarded. The same operation is performed on the initial seed points p2, p3, and p4, and all the final merging results among the initial seed points p0 to p4 are selected as the final segmentation result.
Claims
1. An automatic coal gangue segmentation method that combines the gray-scale fluctuation phenomenon at the contour of coal gangue, characterized in that The following steps are implemented: Step 1: Import the output image from the image recognition module, crop it, and use the processed result as the input image; Step 2: Grayscale the input image to obtain a grayscale image; Step 3: Use the grayscale chaos degree method to obtain a rough contour image; Step 4: Automatically determine the initial seed point p1, and process the grayscale histogram to obtain the grayscale threshold for segmentation; Step 5: Select the grayscale image as the input image for fine segmentation, and save the grayscale value of the initial seed point as the base value; Step 6: Add adjacent pixel points that meet the conditions according to the region growing algorithm rules, and save them as growing points; Step 7: Check the new adjacent pixel points again, add adjacent pixel points that meet the conditions, and save them as growing points; Step 8: Until there are no new growing points, the obtained pixel point array is the segmented gangue region; Step 9: Identify the contour with the largest area as the boundary of the segmented gangue and fill the interior; Step 10: Expand the initial seed points; Step 11: Automatically update the grayscale threshold (the grayscale threshold value of the i-th image); Step 12: Repeat steps 6 to 9 to obtain 5 gangue contours for region growing with the initial seed points p0, p1, p2, p3, and p4; Step 13: According to the established gangue contour screening conditions, select the combination of credible segmentation results obtained from the initial seed points p0 to p4 as the final segmentation result.
2. An automatic coal gangue segmentation method for improving the region growing algorithm according to claim 1, characterized in that, The initial seed points can be automatically determined through the third and fourth steps, combined with the gray-scale fluctuation phenomenon at the contour of the coal gangue: there are obvious distribution differences in the gray-scale values of the two regions of the coal gangue and the conveyor belt on both sides of the contour. A group of 3×3 pixel points form a pixel block, and then according to the formula judge the chaos degree of the pixel block. When the chaos degree H of the pixel block satisfies H≥220, H≥2, and V≥2, this area is the contour line of the coal gangue. Mark its central pixel as white, traverse all pixel points to obtain the binary image of the coal gangue contour, so as to obtain the rough contour of the coal gangue and set it as the target contour D. Through the formula find the centroid C of the target contour, and set the centroid C as the initial seed point p0.
3. An automatic coal gangue segmentation method using an improved region growing algorithm according to claim 1, characterized in that, For the expansion of the initial seed points in Step 10, after determining the centroid C of the target contour D, draw two intersecting segmentation lines with the centroid C as the origin. The included angles of the two intersecting segmentation lines are both 90°, dividing it into 4 regions. Take the centroids of the 4 regions as the 4 additional expanded points, namely p1, p2, p3, and p4. If a certain centroid appears outside the contour of the corresponding region, set the midpoint of the minimum distance line between the centroid and the contour of the region as the expanded point. Take the obtained p1, p2, p3, and p4 as the expanded initial seed points.
4. An automatic coal gangue segmentation method for improving the region growing algorithm according to claim 1, characterized in that, For updating the threshold in Step 11, when performing region growing with the initial seed point p0, set the threshold as the grayscale value corresponding to the intersection point of the grayscale histograms of the grayscale values inside and outside the rough gangue contour in the grayscale image of the input image minus the grayscale value at the seed point. At the centroid points of the 4 regions, use the grayscale value corresponding to the intersection point of the grayscale histograms of the inside and outside of the contour of the region corresponding to the initial seed point p1 minus the grayscale value at the p1 seed point as the grayscale threshold for contour segmentation of p1. The initial seed points p2, p3, and p4, and the set thresholds for queuing for region growing are all updated sequentially through the above operations.
5. An automatic coal gangue segmentation method for improving the region growing algorithm according to claim 1, characterized in that, The screening conditions for the coal gangue contour in the thirteenth step are as follows: The contour image obtained by dividing with the initial seed point p0 is the fine contour, the contour image obtained by dividing with the initial seed point p1 is the regional contour, and the image obtained by subtracting the fine contour is called the difference contour. For each region in the difference contour, if the length of the side overlapping with the fine contour is greater than 0.75 times the perimeter of the region, then the region exhibits an obvious concave characteristic and is merged into the fine contour; otherwise, if the concave characteristic is not obvious, it is discarded. The same operations are performed on the initial seed points p2, p3, and p4, and all the final merging results among the initial seed points p0 to p4 are selected as the final segmentation result.