Cabin boundary identification method and system based on point cloud map
By combining the boundary recognition method of RANSAC and Sobel algorithms in the cabin environment, the problem of insufficient noise filtering mechanism and the inability of a single algorithm to adapt in the prior art is solved, and boundary recognition with higher accuracy and robustness is achieved.
Patent Information
- Application Number
- CN202510670957.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-05-23
AI Technical Summary
When identifying boundary in cabin environments in the prior art, there are problems such as insufficient noise filtering mechanism and the inability of a single algorithm to evaluate extraction quality and adaptive adjustment parameters, resulting in low recognition accuracy and poor robustness.
A cabin boundary recognition method based on point cloud map is adopted, and two complementary algorithms of RANSAC plane fitting and Sobel edge detection are combined for boundary extraction, and an overlap degree cross-verification mechanism is introduced to evaluate boundary consistency, and an adaptive threshold adjustment method is designed to improve boundary extraction accuracy.
It improves the accuracy and robustness of cabin boundary extraction, can effectively filter cabin-specific interference, adaptively adjust parameters to adapt to complex environment changes, and significantly improves the reliability of boundary recognition.
Smart Images

Figure CN120198865A_ABST
Abstract
Description
Technical Field
[0001] This application relates to unmanned operation of ship cabins, and particularly to a method and system for identifying cabin boundaries based on point cloud maps. Background Art
[0002] In the automated operation of ships, the spatial layout inside the cabin is crucial for tasks such as internal ship navigation, robot positioning, and item handling. With the development of the intelligent and unmanned trend in the shipping industry, accurately identifying cabin boundaries has become a basic ability of ship automation systems, directly affecting the internal operation efficiency, safety, and resource utilization rate of ships. Traditional cabin boundary identification methods rely on manual annotation and simple geometric models, and do not consider the influence of cabin material piles and dynamic obstacles. These methods are not only inefficient but also easily affected by factors such as environmental changes and equipment errors, resulting in low identification accuracy.
[0003] With the development of Light Detection and Ranging (LiDAR) technology, point cloud data has become an important means for spatial environment modeling. Especially in complex spaces (such as ship cabins), point cloud data can provide high-precision three-dimensional environmental information. Therefore, how to automatically identify cabin boundaries using point cloud maps has become a research hotspot.
[0004] When dealing with cabin boundary extraction in the prior art, a scheme of single LiDAR scanning and single boundary extraction algorithm is generally adopted. Although there are already environment modeling methods based on point clouds, in this special cabin environment, the following technical defects mainly exist:
[0005] Traditional point cloud data or image data usually contains a large amount of noise, such as scanning errors, light changes, or environmental interference. Existing methods lack an effective filtering mechanism for specific cabin interferences (such as material piles, cabin roof structures, dynamic obstacles); single algorithms lack a result verification mechanism, cannot evaluate the quality of boundary extraction, and cannot adaptively adjust parameters according to environmental complexity;
[0006] These technical defects are particularly obvious in the cabin environment because the cabin has special environmental characteristics: the spatial structure is complex, with both regular planes and irregular curved surfaces; it may contain reflective materials and special coatings, resulting in abnormal laser measurements; the lighting conditions are limited, and the point cloud density is uneven; the boundary features are diverse, with both obvious geometric boundaries and texture boundaries.
[0007] The performance of traditional single algorithm schemes varies in this environment: RANSAC performs plane recognition based on random sampling of geometric features and inlier consistency, and is accurate in recognizing regular structures but has limited ability to handle complex boundaries; Sobel edge detection is sensitive to edge changes but sensitive to noise and lacks 3D spatial understanding. More seriously, devices such as pipes and brackets commonly found in cabins may be misidentified as boundaries in single algorithms, causing serious deviations.
[0008] Especially in the vibration and sway environment during ship navigation, it is difficult for a single algorithm to adjust its parameters to adapt to environmental changes, resulting in a significant decrease in the reliability of boundary recognition. These problems make it difficult for the existing technology to meet the high requirements of ship automation for the accuracy and robustness of boundary recognition, and it is urgent to develop a new boundary recognition method suitable for the complex environment of the ship's cabin. Summary of the Invention
[0009] Aiming at the low accuracy of boundary extraction in the complex environment of the ship's cabin, this application provides a method and system for recognizing the boundary of the ship's cabin based on a point cloud map. It combines two complementary algorithms, RANSAC plane fitting and Sobel edge detection, for boundary extraction, and introduces an overlap cross-validation mechanism to evaluate the boundary consistency. At the same time, an adaptive threshold adjustment method is designed to achieve boundary correction, etc., improving the accuracy of boundary extraction in the ship's cabin.
[0010] One aspect of this application provides a method for recognizing the boundary of the ship's cabin based on a point cloud map, including: collecting point cloud data in the ship's cabin, and performing fusion processing on the point cloud data to obtain fused point cloud; preprocessing the fused point cloud to obtain static point cloud; based on the static point cloud, performing boundary extraction through the RANSAC algorithm to obtain the first boundary; converting the static point cloud into a grid map, and using the Sobel algorithm to perform boundary extraction on the grid map to obtain the second boundary; performing cross-validation on the first boundary and the second boundary, and judging the boundary consistency by calculating the overlap degree between the two; according to the cross-validation result, taking the boundary that passes the consistency verification as the boundary of the ship's cabin, and correcting the boundary that fails to pass the consistency verification by using the method of adjusting the threshold.
[0011] In particular, the spatial coverage of multiple lidars and the point cloud preprocessing in this application form a "quality foundation", providing high-quality input for boundary extraction; the boundary extraction of the dual algorithms verifies each other, forming a "complementary correction", greatly reducing the risk of failure of a single algorithm; the cross-validation and parameter adjustment mechanism constitute a "self-improving" ability to adapt to the complex and changing environment of the ship's cabin.
[0012] Further, collecting point cloud data in the ship's cabin and performing fusion processing on the point cloud data includes: using the top lidar as the main lidar, and using the left and right lidars as side lidars; using the NDT point cloud registration method for spatial synchronization calibration to obtain the homogeneous transformation matrix of the side lidar relative to the main lidar; where NDT is a point cloud registration method based on the probability density function, which does not depend on feature extraction; compared with the ICP algorithm, NDT has a lower dependence on the initial pose estimation and usually requires fewer iterations.
[0013] Take the main engine installed in the cabin as the time source (master) of PTP (Precision Time Protocol), and all lidars as the time clients (slaves) of PTP, and perform time synchronization using the PTP time synchronization method; among them, PTP is a high-precision network time synchronization protocol defined in the IEEE1588 standard. It synchronizes time through a master-slave architecture. The main engine in the cabin serves as the time master node, and all lidars serve as slave nodes;
[0014] Perform anomaly judgment, noise removal, and distortion removal on the top main lidar point cloud and the side lidar point clouds that have undergone spatial calibration and time synchronization, and splice and fuse the processed point clouds through a homogeneous transformation matrix to obtain a fused point cloud in the same coordinate system.
[0015] Specifically, the cabin is a closed three-dimensional space with a complex geometric structure. The top lidar, as the main lidar, can usually obtain a relatively wide field of view, which is suitable for capturing the overall structure of the cabin; the left and right lidars, as side lidars, can supplement the blind spots of the top lidar's field of view, especially the side wall area and the occluded area; this "1+2" layout forms a triangulation structure in space, enhancing the spatial coverage and geometric integrity of the point cloud. A single lidar is restricted by its installation position and has inevitable self-occluded areas. Lidars at different angles can optimize the incident angle of the laser beam with the surface and reduce measurement errors caused by extreme incident angles.
[0016] Furthermore, preprocess the fused point cloud, including: based on the fused point cloud, through ground stockpile filtering, calculate the vertical height difference and the angle of the horizontal height difference of points in the same column of adjacent two scanning beam bundles, and obtain the points with an angle less than the threshold θ as the point cloud for removing the ground stockpile; specifically, the scanning of the lidar is carried out row by row by beam bundles, forming a structured point cloud; for points in adjacent beam bundles in the same column, calculate the angle of their vertical and horizontal differences; the ground and stockpiles usually have a gentle angle change, so the angle threshold θ is set, and points less than this threshold are determined to be the ground or stockpile; using local geometric gradients instead of global plane fitting is more suitable for the uneven cabin floor and accumulations; through angle threshold parameterization, it can adapt to different inclined floors; beam bundle structured analysis reduces the computational complexity and is suitable for real-time processing.
[0017] Based on the point cloud after removing the ground stockpile, filter out the point cloud above the preset height threshold to obtain the point cloud after removing the cabin ceiling; specifically, set the Z-axis height threshold based on the cabin structure characteristics and perform a dimensional clipping operation.
[0018] Based on the point cloud after removing the cabin ceiling, identify and remove the point cloud generated by moving objects in the cabin to obtain a static point cloud as the processed fused point cloud;
[0019] Specifically, this application constructs a highly structured three-level progressive preprocessing system, forming a spatial information purification mechanism of "from large to small, from static to dynamic". Ground stockpile filtering → eliminating large-area nearly horizontal structures; roof filtering → removing high-position non-target areas; dynamic object filtering → finely removing motion interference. This hierarchical design achieves the optimal balance between computational complexity and filtering accuracy. The preprocessing of the previous layer reduces the data volume of the subsequent layer, improving the overall efficiency.
[0020] Furthermore, obtaining the static point cloud includes: calculating the position change of points in continuous scans, defining the positions of points in the t-th scan and the (t + 1)-th scan as and , respectively, and calculating the position change of points through the distance formula ; calculating the consistency score C based on the time window, , where N is the number of scans within the time window, and n is the number of times the point position change is below the threshold; where this application not only analyzes two adjacent frames, but also performs statistical analysis within the N-frame window. Calculating the standard deviation σ of the positions of points in n occurrences, where , is the average position of points in n occurrences; judging the dynamicity of points according to the consistency score C and the standard deviation σ. When or , the point is considered a dynamic point, where and are preset thresholds; using the DBSCAN clustering algorithm to group the point cloud data to form point cloud clusters; calculating the centroid change and the shape transformation of each point cloud cluster, where and are the cluster centroids at times t and t + 1, respectively, and and represent the shape descriptors of the cluster; judging the dynamicity of the point cloud cluster according to the set thresholds and . When or , the corresponding point cloud cluster is marked as a dynamic cluster; and all points in the dynamic cluster are marked as dynamic points; filtering and removing the point cloud marked as dynamic points through the statistical outlier algorithm to obtain the static point cloud.
[0021] Specifically, this application combines point-level marking and cluster-level marking: single-point analysis discovers small-scale or slowly moving dynamic points; cluster analysis captures objects moving as a whole, even if the movement of individual points is not obvious. Final filtering is performed on the points marked as dynamic to remove misjudged points. Point-level analysis captures the dynamic characteristics of scattered small objects, and cluster-level analysis identifies large objects moving as a whole. The dual determination of centroid + morphology reduces the probability of misjudgment. Finally, filtering is performed through a statistical outlier algorithm, forming a triple protection mechanism.
[0022] Further, obtaining the first boundary includes: (1) constructing a plane model for plane fitting , where A, B, and C are the components of the plane normal vector, and D is the plane offset, and are the point coordinates in the point cloud; among them, the plane model transforms the plane structure in the cabin into points in the parameter space, realizing the mapping from the point set to geometric features. (2) Initializing the parameters of the RANSAC algorithm, the parameters include: setting the maximum number of iterations N, the error threshold ε, and the minimum number of inlier points threshold ; among them, the error threshold ε represents the maximum allowable distance for a point to be considered part of the plane, and its physical meaning is "the comprehensive representation of measurement noise and model deviation"; the minimum number of inlier points threshold represents the minimum number of points that make up an effective plane, and its physical meaning is "the point density representation of the minimum detectable area of the plane"; (3) Executing the RANSAC algorithm to obtain a candidate plane model and the corresponding inlier set; among them, the RANSAC algorithm is based on the Markov Monte Carlo sampling theory, and this random sampling strategy is particularly suitable for complex environments with a large number of non-planar interference elements in the cabin. During the N iterations, RANSAC performs an implicit maximum a posteriori probability (MAP) estimation: each randomly selected 3 points form a sampling point in the hypothesis space; the size of the inlier set is used as an approximation of the likelihood function; the iterative process is essentially a search for the global optimal solution in the hypothesis space; this optimization strategy avoids the defect that the traditional least squares method is easily affected by outliers. (4) Repeating step (3) N times, selecting the plane model with the largest number of inlier points as the best plane model; among them, N is a positive integer; (5) If the number of inlier points of the best plane model is greater than the threshold , then identify the corresponding plane as an effective plane and remove the identified effective plane from the point cloud; (6) Repeating steps (3) to (5) for the remaining point cloud until the number of inlier points in the plane model is less than the threshold ; (7) Extracting all the identified plane edge points to form the first boundary of the cabin;
[0023] Specifically, the cabin is mainly in a planar structure, which exactly conforms to the planar model assumption of RANSAC. Noise points generated by factors such as hull vibration and measurement errors can be effectively filtered. Even if the planar part is blocked by equipment, RANSAC can still identify the entire plane through the visible part.
[0024] Further, execute the RANSAC algorithm to obtain a candidate planar model and the corresponding inlier set, including: randomly select 3 points from the static point cloud , , ; based on the selected 3 points , fit a planar model and calculate the plane normal vector ; calculate the plane offset D = -(Ax1 + By1 + Cz1); calculate the distance from each point in the point cloud to the fitted plane ; count the points with a distance
[0025] less than the error threshold ε as inliers, and calculate the number of inliers num_inliers; record the current candidate planar model and the corresponding inlier set.
[0026] Further, obtain the second boundary, including: convert the static point cloud into a two-dimensional grid map, where the grid value represents the occupancy state of the position in space, 0 represents free space, 100 represents occupied, and -1 represents an unknown area; specifically, the main structural features of the cabin are sufficiently represented in the planar view; vertical structures (such as walls) will appear as edges in the top view; although the height information is lost, it is not necessary in the boundary detection task.
[0027] Define a Sobel filter for edge detection, including: a vertical edge detection filter ; a horizontal edge detection filter ; where the design of these two filters is based on the approximation of central difference numerical differentiation, and smoothing (through row / column weights) is added to reduce the influence of noise.
[0028] Perform a two-dimensional convolution operation on the normalized grid map norm_grid using the defined Sobel filter to obtain: the horizontal direction gradient ; the vertical direction gradient ; Calculate the gradient magnitude at each grid position ; Binarize the gradient magnitude using a set threshold T. When , mark the grid as a boundary point; otherwise, mark it as a non-boundary point. Extract all the grid positions marked as boundary points to form the second boundary of the cabin.
[0029] Specifically, Sobel edge detection and RANSAC plane fitting complement each other well in principle: RANSAC: Based on geometric model fitting, it extracts clear geometric structure boundaries; Sobel: Based on image gradient changes, it can capture boundaries of texture and density changes. RANSAC: Directly performs plane fitting in the original 3D space; Sobel: Processes the information after compressing it into 2D, simplifying the computational complexity. RANSAC: Expresses boundaries through the relationships between planes, tending to represent clear geometric features; Sobel: Expresses boundaries through pixel gradient changes, capable of capturing boundaries caused by non-geometric features. The grid boundary extraction method based on the Sobel operator in this application captures the point cloud density change through gradient analysis, providing boundary information complementary to RANSAC plane fitting for the cabin environment, especially suitable for identifying boundaries caused by non-geometric features, and improving the comprehensiveness and accuracy of cabin boundary recognition.
[0030] Furthermore, perform cross-validation on the first boundary and the second boundary, and judge the boundary consistency by calculating their overlap degree, including: According to the first boundary and the second boundary, calculate the overlap degree Overlap Ratio of the two boundaries, OverlapRatio=(A∩B) / (A∪B), where A represents the area enclosed by the first boundary, B represents the area enclosed by the second boundary, A∩B represents the intersection area of the two areas, and A∪B represents the union area of the two areas; When the overlap degree Overlap Ratio is greater than the preset threshold, judge that the boundary consistency is good and the boundary extraction is successful; otherwise, judge that the boundary consistency is insufficient and boundary correction is required.
[0031] Furthermore, according to the cross-validation result, use the boundary that passes the consistency verification as the cabin boundary, and correct the boundary that fails the consistency verification by adjusting the threshold method, including: When the overlap degree is greater than the preset threshold, use the intersection area of the first boundary and the second boundary as the extracted cabin boundary; When the overlap degree is less than or equal to the threshold: Adjust the error threshold ε of the RANSAC algorithm, and re-execute step S3 to obtain the adjusted first boundary; where the RANSAC error threshold : The distance tolerance from the control point to the plane. Increasing it can capture more potential inliers, but may introduce noise. The Sobel gradient threshold T: Controls the sensitivity of edge detection. Decreasing it can identify more potential boundaries, but may introduce false boundaries.
[0032] Adjust the gradient threshold T of the Sobel algorithm, and re - execute step S4 to obtain the adjusted second boundary; for the adjusted first boundary and second boundary, re - execute the cross - validation process in step S5; if the overlap degree is greater than the threshold, then use the intersection area of the corrected first boundary and second boundary as the final cabin boundary. If the overlap degree is still less than or equal to the threshold after three threshold adjustments, then select the result with the highest overlap degree as the final cabin boundary.
[0033] Another aspect of the present application also provides a cabin boundary recognition system based on a point cloud map, including: a point cloud fusion module that collects point cloud data inside the cabin and performs fusion to generate a fused point cloud in the same coordinate system; a point cloud processing module that performs ground filtering, cabin filtering, and dynamic point removal on the fused point cloud to obtain a static point cloud; a RANSAC boundary extraction module that performs boundary extraction through the RANSAC algorithm based on the static point cloud to obtain a first boundary; a Sobel boundary extraction module that performs boundary extraction through the Sobel algorithm based on the static point cloud to obtain a second boundary; a boundary verification module that performs cross - validation on the first boundary and the second boundary to obtain the final cabin boundary; and a boundary correction module that corrects the first boundary and the second boundary according to the cross - validation result.
[0034] Compared with the prior art, the advantages of the present application are as follows:
[0035] When the prior art processes cabin boundary extraction, it generally adopts a scheme of single lidar scanning and single - boundary extraction algorithm. However, there are defects such as incomplete point cloud coverage, inability to effectively filter environmental interference, limited algorithm accuracy, and lack of a verification mechanism. The present application combines a technical scheme of multi - lidar fusion acquisition, three - level point cloud pre - processing, dual - algorithm boundary extraction, and a cross - validation mechanism, effectively improving the accuracy and robustness of cabin boundary recognition.
[0036] In particular, the cabin environment has the following special characteristics: 1) The spatial structure is complex, with both regular planes and irregular curved surfaces existing simultaneously; 2) It may contain reflective materials and special coatings, resulting in abnormal laser measurements; 3) The lighting conditions are limited, and the point cloud density is uneven; 4) The boundary features are diverse, with both obvious geometric boundaries and texture boundaries. These characteristics make it difficult for a single algorithm to achieve reliable boundary extraction. Among them, RANSAC performs plane recognition based on random sampling of geometric features and inlier consistency. Its advantage lies in its strong robustness to noise and outliers and its precise recognition of clear geometric structures (such as cabin wall planes), but it has limited processing ability at the intersection of curved surfaces and planes; Sobel edge detection recognizes boundaries based on pixel gradient changes. Its advantage lies in its sensitivity to edge changes and its ability to capture continuous boundaries, but it is sensitive to noise and lacks 3D space understanding.
[0037] On the one hand, devices such as pipes and brackets commonly found in the cabin may be misidentified as boundaries in a single algorithm. However, through the cross - verification of two algorithms, these pseudo - boundaries are effectively identified and eliminated, resulting in a significant improvement in accuracy.
[0038] On the other hand, RANSAC may be affected by the point cloud density in 3D space, while Sobel may be affected by projection distortion in 2D grids. But after combining the two, accurate boundary extraction can still be achieved in areas with uneven density in the cabin (such as corners far from the lidar), overcoming the blind spots of a single algorithm. In the vibrating and swaying environment during ship navigation, it is difficult to adjust the parameters of a single algorithm. However, through the interactive correction of the two algorithms in this solution, stable extraction of the cabin boundary under different navigation states is realized. Brief Description of the Drawings
[0039] This application will be further described in the form of exemplary embodiments, which will be described in detail through the drawings. These embodiments are not restrictive. In these embodiments, the same numbers represent the same structures, where:
[0040] Figure 1 is an exemplary flowchart of a cabin boundary recognition method based on a point cloud map according to some embodiments of this application;
[0041] Figure 2 is an exemplary flowchart of the calibration of the main lidar and the side lidar according to some embodiments of this application. Detailed Embodiments
[0042] The methods and systems provided in the embodiments of this application will be described in detail below with reference to the drawings.
[0043] As Figure 1 shown, collect the point cloud data in the cabin, perform fusion processing on the point cloud data to obtain the fused point cloud; pre - process the fused point cloud to obtain the static point cloud; based on the static point cloud, perform boundary extraction through the RANSAC algorithm to obtain the first boundary; convert the static point cloud into a grid map, and use the Sobel algorithm to perform boundary extraction on the grid map to obtain the second boundary; perform cross - verification on the first boundary and the second boundary, and judge the boundary consistency by calculating their overlap degree; according to the cross - verification result, use the boundary that passes the consistency verification as the cabin boundary, and for the boundary that fails to pass the consistency verification, use the method of adjusting the threshold for correction.
[0044] Specifically, for point cloud data collection: Obtain the three - dimensional point cloud data in the cabin. After completing the ptp time synchronization and spatial calibration, perform data pre - processing, such as denoising and down - sampling, and splice the real - time lidar point cloud to obtain the fused point cloud.
[0045] Data preprocessing: Remove the ground and dynamic points from the cabin point cloud. Point cloud data segmentation: Generate a pcd file based on the obtained fused point cloud, remove the cabin top through straight-through filtering, and use feature-based RASC clustering and other methods to segment the point cloud data and extract the boundary points of different areas in the cabin.
[0046] Boundary detection and extraction of point cloud to image: Convert point cloud data into raster map form, adopt the idea of image, and use Sobel to complete the boundary extraction of the cabin; Geometric consistency verification: Cross-verify the first boundary and the second boundary to ensure the accuracy of boundary recognition. The correctness of the boundary information is verified by comparing the overlap of the two recognition results.
[0047] Result feedback: Successfully identified boundaries are uploaded to the platform for unified management. Unsuccessfully identified boundaries are further corrected by adjusting the algorithm threshold online.
[0048] Multiple lidars can increase the scanning range and reduce blind spots. This system uses three lidars: top, left, and right. External parameters need to be calibrated to facilitate subsequent point cloud fusion. The lidar external parameter calibration is essentially to obtain the displacement (x, y, z) and rotation (roll, pitch, yaw) between the two lasers. Generally, the main laser is used as a reference (parent coordinate system) to transform the other two side lidars (child coordinate systems) to the coordinate system of the main laser. In three-dimensional space, a homogeneous transformation matrix (R, T) can be used to describe such a transformation relationship. In the field of three-dimensional data processing, NDT point cloud registration is a type of x, y, zroll, pitch, yaw method used to deal with the pose matching problem between two point clouds. After the calibration is completed, the static TF of the main lidar and the side lidar is released. The calibration diagram is shown as follows Figure 2 shown.
[0049] After completing the spatial calibration, the laser radar needs to be time synchronized. Since the satellite signal quality is poor inside the cabin, pps time synchronization cannot be completed, so ptp time synchronization is used. The host acts as the master of PTP, and the laser radar acts as the slave of PTP to complete the time synchronization of the laser radar.
[0050] The three laser point cloud data after time and space synchronization are processed for abnormality judgment, noise removal and distortion removal, and the processed laser point cloud data are spliced to obtain the fused point cloud.
[0051] The ground removal algorithm calculates the vertical height difference and horizontal height difference of the same column of two adjacent scanning beams hitting the ground, and calculates the angle of the vertical height difference and the horizontal height difference. ,like < , it is considered an obstacle or a pile of materials, and this point is excluded. The top of the cabin uses passthrough filtering in the PCL library to filter the point cloud data above a certain height. To exclude dynamic points, it is necessary to calculate the point-to-point difference:
[0052] To evaluate the position change of a single point in the point cloud during consecutive scans, we first define the positions of the point in the t-th scan and the (t + 1)-th scan as pt and pt+1 respectively. The position change of the point can be calculated by the following distance formula to obtain a consistency score: .
[0053] Calculate a score based on the consistency within a time window. Let N be the number of scans within the time window, the number of times point p appears be n, and the position change each time it appears is below the threshold. The consistency score C can be expressed as: , if C is close to 1, it indicates that point p remains static throughout the time window; if C is low, it indicates that the point is dynamically changing.
[0054] In multiple observations, a more complex statistical analysis can be performed on the consistency of each point, such as calculating the standard deviation of its appearance positions: , where is the average position of point p in n appearances. The smaller the standard deviation σ, the more stable the position of the point.
[0055] Based on the above statistical analysis, a decision formula can be defined to finally determine the dynamics of the point. If the standard deviation σ is greater than a certain threshold or the consistency score C is lower than a certain threshold, then the point is considered dynamic: when or , the point is considered a dynamic point, where and are preset thresholds.
[0056] Apply the DBSCAN clustering algorithm to group the point cloud data. After clustering, analyze the change of each cluster over time, and track the change of the centroid: , where and are the cluster centroids at times t and t + 1 respectively.
[0057] Shape change analysis: , where and represent the difference in the shape descriptors of the cluster (such as the volume of the bounding box or other geometric features) in consecutive time frames.
[0058] Use the set threshold to determine the dynamics of the cluster: when or When it is, the corresponding point cloud clustering is marked as dynamic clustering; and all points in the dynamic clustering are marked as dynamic points; among them and are the thresholds for position and shape changes. If it is greater than the threshold, it is considered a dynamic point and marked as 1. If it is less than the threshold, it is a non-dynamic point and marked as 0. Marking process: According to the above scoring or judgment results, all points scored or marked as 0 are marked as dynamic points and filtered using the Statistical Outlier Removal algorithm. The filtered point cloud is obtained.
[0059] Due to the particularity of the cabin environment, the plane regions are extracted from the point cloud using the segmentation - RANSAC (Random Sample Consensus) algorithm based on plane fitting, and these regions are separated from other regions. The goal of RANSAC plane fitting is to extract the plane region from the given point cloud by minimizing the fitting error. The mathematical expression of the plane model is: , where A, B, and C are the normal vector components of the plane, and D is the offset of the plane, and (x, y, z) is a point in the point cloud.
[0060] The specific steps of the algorithm are as follows:
[0061] Initialize the parameters, set the maximum number of iterations N and the error threshold e. Set the minimum number of inliers for the plane model (usually 3 points). Randomly select 3 points from the point cloud These 3 points are used to fit a plane model.
[0062] Plane fitting, use the selected 3 points to fit the plane model. Let these points be 、 、 Calculate the parameters A, B, C, D of the plane model
[0063] Calculate the plane normal vector: Calculate the plane normal vector by cross - multiplying two vectors: , ; Calculate the normal vector: , ; where A, B, and C are the normal vector components of the plane.
[0064] Calculate the plane offset D. For each point in the point cloud, calculate the distance from the point to the fitted plane. The distance formula is: , if the distance is less than the set threshold , then the point is considered an inlier, that is, it belongs to the fitted plane
[0065] Record the number of inlier points. Statistically count the number of inlier points in the current plane model, denoted as num_inliers. Repeat this N times. Each time, randomly select 3 points for fitting and calculate the number of inlier points. After each fitting, record the plane model with the most inlier points and its set of inlier points.
[0066] Select the best plane model to remove inlier points. If the number of inlier points in the current plane model is greater than the threshold num_inliers > Nmin, then consider the current plane model as a valid plane. Select this plane model and remove all inlier points belonging to this plane from the point cloud. Continue to perform the above steps on the remaining point cloud until there are not enough points in the point cloud for plane fitting. Finally, all inlier points segmented by plane fitting are the target plane regions. The remaining points belong to, for example, the bulkhead region
[0067] Convert the obtained point cloud data into a grid map (occupancy grid map). The grid map is usually a two-dimensional array, and each cell represents the occupancy probability or occupancy status at a certain position in space: 0: free space, 100: occupied, -1: unknown region (can be chosen to be ignored or processed first). This system regards the grid map as a single-channel image and normalizes it to between 0 and 1. The normalization convention is as follows: grid[grid == -1] = 0, norm_grid = grid / 100.0
[0068] Perform Sobel operation on the grid map. First, define the Sobel filter to detect vertical edges ; detect horizontal edges ; perform two-dimensional convolution on the normalized grid map norm_grid: ; .
[0069] Calculate the gradient magnitude , calculate the gradient magnitude of each pixel . Use the threshold T to determine whether this pixel belongs to the boundary: when , mark this grid as a boundary point, otherwise mark it as a non-boundary point.
[0070] Boundary extraction based on lidar point cloud and boundary extraction based on point cloud image use the same point cloud data source, so they have the same coordinate system. The overlap degree is calculated by computing the ratio of the intersection area to the union area of two polygons. If the overlap ratio (Overlap Ratio) is greater than 90%, it proves that the boundary consistency is good and the boundary extraction is successful. The formula for calculating the overlap ratio is as follows: Overlap Ratio = (A ∩ B) / (A ∪ B), where A represents the area enclosed by the first boundary, B represents the area enclosed by the second boundary, A ∩ B represents the intersection area of the two areas, and A ∪ B represents the union area of the two areas.
[0071] According to the obtained verification results, the successfully identified boundaries are uploaded to the platform for unified management. For the boundaries that are not successfully identified, the algorithm threshold is further adjusted online for correction.
[0072] The present application and its implementation manners are schematically described above. This description is not restrictive. Without departing from the spirit or basic features of the present application, the present application can be implemented in other specific forms. What is shown in the drawings is only one of the implementation manners of the present application, and the actual structure is not limited thereto. Therefore, if those of ordinary skill in the art are inspired by it and design similar structural manners and embodiments without creative efforts without departing from the purpose of this creation, they shall fall within the protection scope of the present application. In addition, the word "including" does not exclude other elements or steps, and the word "a" before an element does not exclude including "a plurality of" such elements. The multiple elements stated in the product claims can also be implemented by one element through software or hardware. The words "first", "second", etc. are used to indicate names and do not indicate any specific order.
Claims
1. A method for identifying the cabin boundary based on a point cloud map, characterized in that, Including: Collect the point cloud data inside the cabin, and perform fusion processing on the point cloud data to obtain the fused point cloud; Preprocess the fused point cloud to obtain the static point cloud; Based on the static point cloud, perform boundary extraction through the RANSAC algorithm to obtain the first boundary; Convert the static point cloud into a grid map, and use the Sobel algorithm to perform boundary extraction on the grid map to obtain the second boundary; Perform cross-verification on the first boundary and the second boundary, and judge the boundary consistency by calculating the overlap degree between the two; According to the cross-verification result, take the boundary that passes the consistency verification as the cabin boundary, and correct the boundary that fails to pass the consistency verification by using the method of adjusting the threshold.
2. The method for identifying the cabin boundary based on the point cloud map according to claim 1, characterized in that: Collect the point cloud data inside the cabin, and perform fusion processing on the point cloud data, including: Take the top lidar as the main lidar, and take the left and right lidars as the side lidars; Use the NDT point cloud registration method for spatial synchronization calibration to obtain the homogeneous transformation matrix of the side lidar relative to the main lidar; Take the host installed inside the cabin as the master of PTP, and take all lidars as the slaves of PTP, and use the PTP time synchronization method for time synchronization; Perform anomaly judgment, noise removal and distortion removal processing on the top main lidar point cloud and the side lidar point clouds that have undergone spatial calibration and time synchronization, and splice and fuse the processed point clouds through the homogeneous transformation matrix to obtain the fused point cloud in the same coordinate system.
3. The method for identifying the cabin boundary based on the point cloud map according to claim 2, characterized in that: Preprocess the fused point cloud, including: Based on the fused point cloud, through ground material pile filtering processing, calculate the vertical height difference and the angle of the horizontal height difference of the points in the same column of two adjacent scanning beam bundles, and obtain the points with an angle less than the threshold θ as the point cloud for removing the ground material pile; Based on the point cloud for removing the ground material pile, filter out the point cloud above the preset height threshold to obtain the point cloud for removing the cabin top; Based on the point cloud for removing the cabin top, identify and remove the point cloud generated by moving objects inside the cabin to obtain the static point cloud as the processed fused point cloud.
4. The method for identifying the cabin boundary based on the point cloud map according to claim 3, characterized in that: Obtain the static point cloud, including: Calculate the position change of a point in consecutive scans. Define the positions of the point in the t-th scan and the (t + 1)-th scan as and respectively. The position change of the point is calculated by the distance formula ; Calculate the consistency score C based on a time window, where N is the number of scans within the time window and n is the number of times the point position change is below the threshold; Calculate the standard deviation σ of the position of a point in n occurrences, where, , is the average position of the point in n occurrences; Judging the dynamics of a point according to the consistency score C and the standard deviation σ. When or , this point is considered a dynamic point, where and are preset thresholds; Use the DBSCAN clustering algorithm to group the point cloud data to form point cloud clusters; Calculate the centroid change of each point cloud cluster and the shape transformation , where and are the cluster centroids at times t and t+1 respectively, and represent the shape descriptors of the cluster; According to the set threshold and judge the dynamics of the point cloud clustering. When or hold, mark the corresponding point cloud clustering as a dynamic clustering; and mark all points in the dynamic clustering as dynamic points; Filter and remove the point cloud marked as dynamic points through the statistical outlier algorithm to obtain the static point cloud.
5. The method for identifying the cabin boundary based on the point cloud map according to claim 3, characterized in that: Obtain the first boundary, including: (1) Construct a plane model for plane fitting , where A, B, and C are the components of the plane normal vector, and D is the plane offset, being the point coordinates in the point cloud; (2) Initialize the parameters of the RANSAC algorithm. The parameters include: setting the maximum number of iterations N, the error threshold ε, and the threshold for the minimum number of inliers in the plane model ; (3) Execute the RANSAC algorithm to obtain the candidate plane model and the corresponding inlier set; (4) Repeat step (3) N times, and select the plane model with the largest number of inliers as the best plane model; where N is a positive integer; (5) If the number of inliers of the best plane model is greater than the threshold , the corresponding plane is recognized as a valid plane, and the recognized valid plane is removed from the point cloud; (6) Repeat steps (3) to (5) for the remaining point cloud until the number of inliers in the plane model is less than the threshold ; (7) Extract all the identified plane edge points to form the first boundary of the cabin.
6. The method for identifying the cabin boundary based on the point cloud map according to claim 5, characterized in that: Execute the RANSAC algorithm to obtain a candidate plane model and the corresponding inlier set, including: Randomly select 3 points from the static point cloud , , ; Based on the selected three points , fit a plane model and calculate the plane normal vector ; Calculate the plane offset ; Calculate the distance of each point in the point cloud to the fitted plane ; Statistical distance Points less than the error threshold ε are regarded as inliers, and the number of inliers num_inliers is calculated; Record the current candidate plane model and the corresponding inlier set.
7. The method for identifying the cabin boundary based on the point cloud map according to claim 5, characterized in that: Obtain the second boundary, including: Convert the static point cloud into a two-dimensional grid map, where the grid value represents the occupancy state of the position in space, 0 represents free space, 100 represents occupied, and -1 represents unknown area; Perform normalization processing on the grid map, set the value of the unknown area to 0, and divide the occupancy value by 100 to obtain the normalized grid map norm_grid; Define the Sobel filter for edge detection, including: vertical edge detection filter ; horizontal edge detection filter ; Perform a two-dimensional convolution operation on the normalized grid map norm_grid using the defined Sobel filter to obtain: the horizontal gradient ; the vertical gradient ; Calculate the gradient magnitude at each grid position ; Binarize the gradient magnitude using the set threshold T. When occurs, mark the grid as a boundary point; otherwise, mark it as a non-boundary point. Extract all grid positions marked as boundary points to form the second boundary of the cabin.
8. The method for identifying the cabin boundary based on the point cloud map according to claim 7, characterized in that: Perform cross-validation on the first boundary and the second boundary, and judge the boundary consistency by calculating the overlap degree between the two, including: According to the first boundary and the second boundary, calculate the overlap degree Overlap Ratio of the two boundaries, Overlap Ratio=(A∩B) / (A∪B), where A represents the area enclosed by the first boundary, B represents the area enclosed by the second boundary, A∩B represents the intersection area of the two areas, and A∪B represents the union area of the two areas; When the overlap degree Overlap Ratio is greater than the preset threshold, it is judged that the boundary consistency is good and the boundary extraction is successful; otherwise, it is judged that the boundary consistency is insufficient and boundary correction is required.
9. The method for identifying the cabin boundary based on the point cloud map according to claim 8, characterized in that: According to the cross-validation result, use the boundary that passes the consistency verification as the cabin boundary, and correct the boundary that fails to pass the consistency verification by adjusting the threshold method, including: When the overlap degree is greater than the preset threshold, use the intersection area of the first boundary and the second boundary as the extracted cabin boundary; When the overlap degree is less than or equal to the threshold: Adjust the error threshold of the RANSAC algorithm , and re-execute step S3 to obtain the adjusted first boundary; Adjust the gradient threshold T of the Sobel algorithm, and re-execute step S4 to obtain the adjusted second boundary; For the adjusted first boundary and the second boundary, re-execute the cross-validation process in step S5; If the overlap degree is greater than the threshold, use the intersection area of the corrected first boundary and the second boundary as the final cabin boundary. If the overlap degree is still less than or equal to the threshold after three threshold adjustments, select the result with the highest overlap degree as the final cabin boundary.
10. A cabin boundary recognition system based on a point cloud map, characterized in that, Including: Point cloud fusion module, which collects the point cloud data inside the cabin and performs fusion to generate the fused point cloud in the same coordinate system; Point cloud processing module, which performs ground filtering, cabin filtering, and removing dynamic points on the fused point cloud to obtain static point cloud; RANSAC boundary extraction module, which performs boundary extraction on the static point cloud through the RANSAC algorithm to obtain the first boundary; Sobel boundary extraction module, which performs boundary extraction on the static point cloud through the Sobel algorithm to obtain the second boundary; Boundary verification module, which performs cross-validation on the first boundary and the second boundary to obtain the final cabin boundary; Boundary correction module, which corrects the first boundary and the second boundary according to the cross-validation results.
Citation Information
Patent Citations
Ship loader cabin hatch identification method
CN113340287A
Height detection method and system for height limiting device
CN113658226A
Road boundary detection method and device, computer equipment and storage medium
CN115731527A
Cabin driving area division method and system based on point cloud polygon fitting
CN117152672A
Cooperative surveying and mapping control method and system based on unmanned ship and unmanned aerial vehicle
CN119152235A
Cited By
Three-dimensional modeling system and method based on laser radar
CN120823329A
