Lossless rapid segmentation method and device for muck particle point cloud and medium
By combining axis-aligned bounding boxes and watershed algorithms, a non-destructive and rapid segmentation of slag particle point clouds is achieved, solving the problems of slow processing speed and information loss in existing technologies, improving segmentation accuracy and real-time performance, and making it suitable for the detection of slag and other particulate matter.
Patent Information
- Application Number
- CN202511502136.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-10-21
AI Technical Summary
Existing technologies for segmenting point clouds of slag particles suffer from slow processing speed, information loss, and parameter sensitivity, making it difficult to meet the needs for fast and flexible segmentation.
Axially aligned bounding boxes (AABB) are used to calculate the point cloud projection image, and the watershed algorithm is combined for segmentation. Lossless and fast segmentation is achieved through pixel-point cloud mapping relationship.
It improves the segmentation speed, ensures segmentation accuracy and the accuracy of subsequent analysis, is suitable for complex scenarios, meets real-time processing requirements, and is suitable for rapid and accurate detection of slag particles and other particulate matter.
Smart Images

Figure CN120976258A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of intelligent detection of building materials and resource utilization of waste, and particularly relates to a non-destructive and rapid segmentation method and device for slag particle point cloud and a medium. BACKGROUND
[0002] In the field of engineering slag resource utilization, the point cloud data obtained by 3D camera scanning provides rich information for the analysis of the physical characteristics of engineering slag. The rapid segmentation of slag particle point cloud provides a data basis for subsequent particle feature extraction and is one of the most important steps in the analysis process of slag particle physical characteristics. At present, the segmentation of slag particle point cloud mainly relies on clustering algorithms for three-dimensional point cloud data, such as DBSCAN (density-based spatial clustering algorithm) and the improved version of the algorithm (PPC, particle clustering and segmentation algorithm in the patent with the title of a slag particle grading feature real-time detection method and the publication number CN119360363A). However, there are the following shortcomings: Slow processing speed: DBSCAN has a high computational complexity (usually O(N log N)) when processing large-scale point cloud data, which results in slow processing speed and cannot meet the real-time requirements.
[0003] Information loss: In order to improve the speed, the PPC algorithm needs to downsample the point cloud data, which will result in the loss of point cloud information and affect the segmentation accuracy and the accuracy of subsequent analysis.
[0004] Parameter sensitivity: DBSCAN relies on parameters such as neighborhood radius ε and minimum point number minPts. Improper parameter selection will lead to poor segmentation results, especially when the point cloud density is uneven.
[0005] In summary, the existing technology has the problems of slow processing speed, information loss and parameter sensitivity in the segmentation of slag particle point cloud, which cannot meet the rapid and flexible segmentation requirements of aggregate particle point cloud. Therefore, it is urgent to study a new method. SUMMARY
[0006] In order to solve the problems of slow processing speed, information loss and parameter sensitivity in the segmentation of slag particle point cloud, the application proposes a non-destructive and rapid segmentation method for slag particle point cloud, which includes the following steps: S1: reading the particle point cloud file and calculating the axis-aligned bounding box (AABB) of the particle point cloud; S2: calculating the particle projection image of the point cloud in the maximum face direction of the particle point cloud AABB according to the axis-aligned bounding box, and saving the corresponding relationship between the pixel and the point cloud; S3: segmenting the particle projection image by using the watershed algorithm; S4: Convert the segmented projection image into point cloud data by pixel-point cloud correspondence formula and output.
[0007] A computer device comprising a memory, a processor and a computer program stored on the memory, the processor executing the computer program to implement the steps of the above method.
[0008] A computer readable storage medium storing a computer program, when the program is executed by a processor, the steps of the above method are implemented.
[0009] A computer program product comprising a computer program or instructions, when the program or instructions are executed by a processor, the steps of the above method are implemented.
[0010] The technical scheme provided by the present application has the beneficial effects that: by avoiding downsampling of point cloud data, the present application effectively solves the poor segmentation effect of the prior art under the condition of uneven point cloud density, and ensures the stability and accuracy in complex scenes. By adopting the strategy of combining projection dimension reduction and watershed algorithm, the complete information of the point cloud data is preserved, information loss is avoided, and the segmentation accuracy and the accuracy of subsequent analysis are ensured, realizing lossless segmentation. By projection technology, the high-dimensional point cloud data is converted into a two-dimensional projection image, and through steps such as morphological processing, distance transformation, background and foreground region generation, the information of the particle point cloud in the two-dimensional projection image is effectively extracted, and then the watershed algorithm is used for accurate segmentation. Compared with the simple clustering algorithm used in the traditional method, the watershed algorithm provides more accurate segmentation results, and is especially suitable for complex particle morphology and irregularly distributed scenes. Compared with DBSCAN, the algorithm of the present application has higher calculation efficiency on high-dimensional point cloud data. Under the same hardware conditions, the processing speed of the traditional method is relatively slow, while the algorithm of the present application can significantly improve the segmentation speed and improve the real-time processing capability. Through the combination of projection dimension reduction and watershed algorithm, the processing speed is significantly improved. Through the efficient projection and segmentation algorithm, the processing speed and efficient segmentation are improved to meet the real-time requirement. Compared with the DBSCAN algorithm, the efficiency of the algorithm of the present application is improved by more than 95% when processing point cloud data of the same size on a computer with a conventional hardware configuration, ensuring the real-time requirement and meeting the demand for rapid segmentation of large-scale slag particle point cloud. The present application adopts the mapping relationship between pixels and point cloud data to convert the two-dimensional image result after segmentation back to three-dimensional point cloud data, realizing accurate mapping of the projection image to the actual particle point cloud. This technical point breaks through the limitation of the traditional algorithm, ensuring the consistency of segmentation accuracy and subsequent analysis. The present method is especially suitable for the segmentation of slag particle point cloud, and can also be extended to other particle material point cloud segmentation scenarios, such as construction sandstone, mineral particles, etc. It is suitable for the grading characteristic detection of residual slag particles, and can also be applied to real-time detection requirements involving particle materials in other fields, such as mineral particle screening, construction sandstone detection, agricultural granular fertilizer grading, etc. This multifunctional detection method can realize fast and accurate detection of particle grading characteristics in different industries, meeting the needs of various industrial production and engineering applications. BRIEF DESCRIPTION OF DRAWINGS
[0011] The present application will be further described below in conjunction with the drawings and examples, wherein: Figure 1 is a flowchart of the lossless rapid segmentation method of slag particle point cloud in the present embodiment; Figure 2 is a schematic diagram of particle point cloud data in the present embodiment; Figure 3is a schematic diagram of the projection image of the particle in the XY plane of the AABB in this embodiment; Figure 4 is a schematic diagram of the operation result of the watershed algorithm on the particle projection image in this embodiment; Figure 5 is a schematic diagram of the segmented point cloud data obtained by converting the segmentation result and the pixel-point cloud correspondence relationship in this embodiment. Figure 4 is a schematic diagram of the segmented point cloud data obtained by converting the segmentation result and the pixel-point cloud correspondence relationship in this embodiment. DETAILED DESCRIPTION
[0012] In order to have a clearer understanding of the technical features, objectives and effects of the present application, the specific embodiments of the present application will be described in detail with reference to the accompanying drawings.
[0013] Embodiment 1 Please refer to Figure 1 , Figure 1 is a flowchart of a non-destructive and fast segmentation method for slag particle point cloud in the embodiment of the present application, which specifically includes the following steps: S1. Calculate the Axis Aligned Bounding Box (AABB) of the particle point cloud (I) Point cloud data reading: read the point cloud data in the format of .ply Each point cloud contains a series of three-dimensional coordinate points (x, y, z). As shown in Figure 2 , the original particle point cloud data obtained by 3D camera scanning in this embodiment cannot be distinguished by the computer in this stage. This data is regarded as a whole.
[0014] (II) Find the minimum and maximum coordinates: for each coordinate axis (x, y and z), find the minimum and maximum values of all points on this coordinate axis. These two points represent the minimum and maximum ranges of the point cloud data in each coordinate axis direction, i.e. the two opposite corners of the AABB.
[0015] (III) AABB Bounding Box Generation: AABB is an axis-aligned cuboid with 8 vertices, which can be determined by the minimum and maximum boundaries. Specifically, given the minimum boundary and the maximum boundary of the AABB, their eight vertices can be obtained by combining all coordinates. The eight vertices are , , , , , , , . These points are the 8 vertices of the AABB cuboid, representing all the corners of the bounding box in three-dimensional space.
[0016] S2. Calculate the projection image of the point cloud in the direction of the maximum face of the particle point cloud AABB, and save the corresponding relationship function of the pixel-point cloud data.
[0017] The point cloud data can be represented as The pixel point of the corresponding projection image can be represented as . Now assume that the particle point cloud data scanned by a 3D camera is A , containing n point cloud data, which can be represented as formula (1): (1) Point cloud data A Each point is read and stored by the computer, and each point is assigned a fixed position index . The projection image obtained by projection is I , which can be represented as formula (2): (2) Point cloud data A and projection image I both store the same mapping function: , where is the position of the point cloud or pixel point in the point cloud data , projection image , is the number of point cloud data, is the first point cloud data, is the second point cloud data, is the third point cloud data, is the point cloud data, is the pixel point corresponding to the first point cloud data, is the pixel point corresponding to the first point cloud data, is the pixel point corresponding to the point cloud data.
[0018] According to the position information, the pixel point corresponding to the point cloud data can be found, and the pixel point corresponding to the point cloud data can also be found through the position information, that is, the corresponding relationship function of the pixel-point cloud data, through which the conversion from the projection image to the point cloud data can be realized.
[0019] (I) AABB is a cuboid with three different faces, corresponding to the XY plane, XZ plane and YZ plane. The area of each face can be obtained by calculating the corresponding edge length: XY plane area:
[0020] XZ plane area:
[0021] YZ plane area:
[0022] where, are the maximum and minimum values on the X-axis, are the maximum and minimum values on the Y-axis, are the maximum and minimum values on the Z-axis.
[0023] The largest area face is the largest face of AABB. Generally, in particle point cloud data, the largest face is the XY face.
[0024] (II) After determining the largest face, project the particle point cloud in the Z-axis direction to the XY face. Figure 3 is the projection image obtained after the projection processing of the point cloud data. Similarly, the computer cannot distinguish the particles in the image, and this data is considered as a whole. The projected point coordinates are mapped to a fixed size two-dimensional grid (image coordinate system), using integer pixel index np.digitize , convert the coordinates of each projection point to the pixel index on the image. By mapping each projection point to the pixel position on the image, a binary image is finally generated, with the pixel value of the projection point in the image being 255, and the other pixel value being 0.
[0025] S3. Use the watershed algorithm to segment the particle projection image, the specific steps are as follows: (I) Morphological opening operation: In order to remove noise in the image, morphological opening operation (cv2.morphologyEx) is applied before the watershed algorithm. This step uses a small convolution kernel (kernel) to operate on the image, removes small objects and noise in the image, and extracts larger, connected regions. The opening operation actually performs erosion operation first, and then performs dilation operation to remove small regions.
[0026] (II) Generate background and foreground: Generate a clear background area through dilation operation (cv2.dilate). This background area is used to mark the background part in the watershed algorithm. Next, apply distance transform (cv2.distanceTransform) to calculate the distance from each pixel in the foreground region to the nearest background pixel. This will help determine the boundary of the foreground region. Then, use thresholding to convert these regions to foreground regions.
[0027] (III) Generate a label image: By subtracting the foreground region from the background, we get the uncertain parts of the image, which will usually be the watershed algorithm's boundary line. Use OpenCV's cv2.connectedComponents function to generate labels for the foreground region. Then, each region of the label image will have a unique identifier, which will be used to label each region in the watershed algorithm.
[0028] (IV) Apply the watershed algorithm: Use OpenCV's cv2.watershed function to apply the watershed algorithm to the image. By the label image generated earlier, the image is divided into multiple regions by the watershed algorithm. The working principle of the watershed algorithm is to find the watershed line in the image according to the label information and the gradient in the image, and divide the image into different regions. Finally, these regions will be marked with different colors. After the watershed algorithm is processed, the projection image is divided into different colors, that is, the segmentation task of the image is completed, and each color represents a particle.
[0029] S4. Convert the segmented projection image to point cloud data through the pixel-point cloud correspondence.
[0030] After the watershed algorithm is executed, the projection image is divided into different colors, such as red, yellow, green, etc. in Figure 4 , the same color represents the same particle, which completes the segmentation task of the projection image, that is, the computer can distinguish different particles. Now the computer can determine the point cloud data of each segmentation region according to the different colors of the pixel labels. The specific steps are as follows: (I) Get the label value of each pixel from the watershed segmentation result.
[0031] (II) Find the corresponding point cloud index through the pixel position, map each pixel position back to the point cloud index, and also pass the color information of the pixel assigned by the watershed algorithm to the point cloud data.
[0032] (III) As shown in Figure 5 , according to the label value of the watershed segmentation result and the pixel-point cloud correspondence, extract the point cloud data of each segmentation region.
[0033] Example 2 A computer device comprising a memory, a processor, and a computer program stored on the memory, the processor executing the computer program to implement the steps of the above method.
[0034] Example 3 A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above method.
[0035] Example 4 A computer program product comprising computer programs or instructions, which when executed by a processor, implement the steps of the above method.
[0036] The above description is merely that of the preferred embodiments of the application and is not intended to limit its scope, and it will be appreciated that any modification made within the spirit and principle of the application should be included within the scope of the application.
Claims
1. A non-destructive and rapid segmentation method for point clouds of slag particles, characterized in that, The method includes the following steps: S1: Read the particle point cloud file and calculate the axis-aligned bounding box of the particle point cloud; S2: Based on the axis-aligned bounding box, calculate the particle projection image of the point cloud in the direction of the largest face of the particle point cloud AABB, and save the pixel-point cloud correspondence. S3: Segment the particle projection image using the watershed algorithm; S4: Convert the segmented projection image into point cloud data and output it using the pixel-point cloud correspondence formula.
2. The non-destructive and rapid segmentation method for point clouds of slag particles according to claim 1, characterized in that, S1 specifically refers to: S1.1: Point cloud data reading Read point cloud data, where each point cloud contains a series of three-dimensional coordinate points (x, y, z); S1.2: Finding the minimum and maximum coordinates For each coordinate axis, find the minimum and maximum values of all points on that coordinate axis. The point corresponding to the minimum value and the point corresponding to the maximum value represent the minimum and maximum ranges of the point cloud data in each coordinate axis direction, that is, the two diagonal points of AABB. S1.3: AABB bounding box generation An AABB is an axis-aligned cuboid with 8 vertices, defined by its minimum and maximum boundaries. Specifically, given the minimum boundary of an AABB... and maximum boundary The eight vertices of the AABB cuboid are obtained by combining all the coordinates. , , , , , , , , representing all the angles of the bounding box in three-dimensional space.
3. The non-destructive and rapid segmentation method for point clouds of slag particles according to claim 1, characterized in that, S2 specifically refers to: S2.1: AABB is a cuboid with three faces, corresponding to the XY plane, XZ plane, and YZ plane respectively. Calculate the area of each face: XY plane area: XZ plane area: YZ plane area: in, These are the maximum and minimum values on the X-axis. These are the maximum and minimum values on the Y-axis. The maximum and minimum values on the Z-axis represent the largest and largest areas, and the face with the largest area is the largest face of the AABB. S2.2: Project the particle point cloud onto the largest surface along the Z-axis. The coordinates of the projected points are mapped to a fixed-size two-dimensional grid using integer pixel indices. np.digitize The coordinates of each projection point are converted into pixel indices on the image. By mapping each projection point to a pixel position on the image, a binary image is finally generated.
4. A non-destructive and rapid segmentation method for point clouds of slag particles according to claim 1, characterized in that, In S2, point cloud data A for The corresponding pixels of the projected image are two-dimensional data. The projected image is I ,in: (1) (2) The pixel-to-point cloud data correspondence function is: ; in, Is it point cloud or pixels in point cloud data? Projected images The position in the middle, It refers to the amount of point cloud data. This is the first point cloud data. This is the second point cloud data. This is the third point cloud data. It is the first Point cloud data, It is the pixel corresponding to the first point cloud data. It is the pixel corresponding to the first point cloud data. It is the first Each point cloud data corresponds to a pixel.
5. The non-destructive and rapid segmentation method for point clouds of slag particles according to claim 1, characterized in that, S3 specifically refers to: S3.1: Perform morphological opening operations on the image to remove small objects and noise, and extract larger, connected regions; S3.2: A background region is generated through dilation to mark the background part in the watershed algorithm. Then, a distance transformation is applied to calculate the distance from each pixel in the foreground region to the nearest background pixel. Finally, thresholding is used to convert these regions into foreground regions. S3.3: By subtracting the foreground region from the background, the uncertain parts of the image are obtained, which will become the boundaries of the watershed algorithm; the cv2.connectedComponents function of OpenCV is used to generate labels for the foreground region; each region of the labeled image will have a unique identifier, which is used to label each region in the watershed algorithm; S3.4: Use OpenCV's cv2.watershed function to apply the watershed algorithm to the image, dividing the image into multiple regions based on the previously generated labeled image; S3.5: First, initialize all markers to black. Then, for different markers, randomly generate colors and map them to the corresponding areas, and draw red boundaries between the marked areas.
6. The non-destructive and rapid segmentation method for point clouds of slag particles according to claim 5, characterized in that, S4 specifically refers to: S4.1: Obtain the label value of each pixel from the watershed segmentation results; S4.2: Find the corresponding point cloud index by pixel position and map each pixel position back to the point cloud index; S4.3: Extract point cloud data for each segmented region based on the label values of the watershed segmentation results and the pixel-point cloud correspondence.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes a computer program to implement the steps of the non-destructive and rapid segmentation method for point clouds of slag particles as described in any one of claims 1-6.
8. A computer-readable storage medium, characterized in that, The device contains a computer program that, when executed by a processor, implements the steps of the non-destructive and rapid segmentation method for point clouds of slag particles as described in any one of claims 1-6.
9. A computer program product, characterized in that, It includes a computer program or instructions that, when executed by a processor, implement the steps of the non-destructive and rapid segmentation method for point clouds of slag particles as described in any one of claims 1-6.
Citation Information
Patent Citations
Real-time detection method for grain composition characteristics of muck
CN119360363A
Method and system for constructing directed bounding box of three-dimensional model
CN103729877A
Method for mapping two-dimensional projected image to three-dimensional model
CN107146287A
Point cloud segmentation method based on structured light
CN111951197A
Quick sectioning method based on point cloud, intelligent terminal and cloud platform
CN112241998A