Obstacle edge contour recognition method and system based on laser radar point cloud data
Patent Information
- Application Number
- CN202611460589.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2026-07-03
- Filing Date
- 2026-09-20
- Publication Date
- 2026-10-30
AI Technical Summary
当物体发生运动或传感器抖动时,单帧点云提取的轮廓容易出现断点、重叠或锯齿状畸变
[0062]与现有技术相比,本申请提供的基于激光雷达点云数据的障碍物边缘轮廓识别方法及系统,通过体素网格划分与内部离散度指标的双重判定机制,精准筛选有效体素并智能标记过渡区域以构建高纯净度的候选数据集;随后,利用局部点云切片的主成分分析结合反射强度与深度信息,构建六维复合特征向量并在特征空间中进行频次映射与异常剔除,从而生成高精度的特征点集;在此基础上通过迭代拟合最优直线模型,依据投影标量对点进行有序排列并合并相邻线段,形成连续初始边缘轮廓集合;进而引入曲率、角度及密度分量的加权置信度评分,通过二次贝塞尔曲线与最近投影点修正算法对轮廓进行平滑优化,最终构建出包含断点识别、历史数据替换及插值补全的时序迭代优化闭环,输出拓扑结构严密且几何连续的优化边缘轮廓。基于上述技术方案,本发明解决了现有技术中存在的噪声干扰大、几何特征描述单一、动态场景下轮廓断裂重叠严重以及轨迹不连续等关键问题。首先,针对点云噪声与非均匀分布难题,方案通过计算体素内点云与质心的欧氏距离并结合密度阈值,能够有效区分物体边缘与背景杂波,同时利用八邻域过渡体素策略填补边缘缝隙,从源头大幅提升了数据质量,避免了传统去噪方法丢失细节或保留噪点的弊端。其次,为克服几何特征提取维度不足的缺陷,方案构建了融合线性度、平面度、散度及物理属性(强度、深度)的六维特征描述子,并通过特征空间频次统计与距离阈值过滤,实现了对复杂曲面和遮挡环境下边缘特征的鲁棒性捕捉,显著提高了特征点识别的准确率。更为关键的是,针对动态场景中常见的轮廓断裂、重叠及锯齿状畸变问题,方案创新性地设计了置信度驱动的误差累积分析与时序迭代优化机制:一方面,利用曲率、角度和密度的加权评分动态控制二次贝塞尔曲线的拟合程度,并通过最近投影点算法消除离散点带来的锯齿效应,实现了轮廓的亚像素级平滑;另一方面,通过跨帧变换误差分析,自适应地选择历史参考数据替换或线性插值补全策略来修复断点与重叠区域,并严格遵循投影标量升序重排原则,确保了新生成线段在空间顺序上的单调性与拓扑逻辑的正确性。这种多阶段、迭代的优化流程,不仅彻底消除了单帧处理导致的逻辑跳变和自相交现象,还通过引入上一帧数据实现了时空一致性约束,最终输出一条无断裂、无冗余、平滑连续且高度贴合物体真实形态的边缘轮廓轨迹,极大地提升了自动驾驶及机器人导航系统在复杂动态环境下的感知精度与安全性。
Smart Images

Figure CN123015590A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of edge contour recognition technology, and in particular to a method and system for obstacle edge contour recognition based on lidar point cloud data. Background Technology
[0002] With the rapid development of autonomous driving, robot navigation, and intelligent transportation systems, LiDAR, as a core perception sensor, has seen widespread application in obstacle detection and edge contour recognition due to its acquisition of high-density 3D point cloud data. Accurately extracting obstacle edge contours is not only fundamental to building high-precision environmental maps but also a crucial prerequisite for path planning and safe obstacle avoidance. However, in practical applications, LiDAR point cloud data is often affected by various complex factors, posing a significant challenge to edge contour recognition.
[0003] First, raw point cloud data suffers from significant non-uniformity and noise. Limited by the scanning mechanism of LiDAR and environmental reflection characteristics, point clouds are extremely unevenly distributed on object surfaces, often accompanied by outliers, scattered points, and spurious point clouds caused by multipath effects. Traditional denoising algorithms often struggle to effectively remove this noise while preserving the geometric details of the object, leading to broken edges or artifacts in subsequent edge extraction. Second, existing technologies have limitations when handling complex geometric structures. Many methods rely on simple voxelization or clustering algorithms, making it difficult to distinguish between transitional regions and internal filling regions at object edges, especially when the surface curvature changes drastically or there is occlusion, easily resulting in the loss of crucial edge features. Furthermore, descriptor construction based on local geometric features is often one-dimensional, failing to comprehensively characterize the linearity, planarity, and divergence of point clouds, leading to decreased feature matching accuracy in low signal-to-noise ratio environments.
[0004] More critically, existing edge contour generation algorithms are inadequate in handling temporal consistency in dynamic scenes. When objects move or sensors vibrate, the contours extracted from a single frame of point cloud are prone to breakpoints, overlaps, or jagged distortions. Traditional methods typically use simple linear interpolation to fill in breakpoints or discard some data directly when anomalies are detected. This approach lacks utilization of historical data and cannot restore the true continuous shape of the object, resulting in unsmooth, discontinuous contour trajectories, and even logical self-intersections. Furthermore, existing solutions lack effective removal mechanisms for redundant point clouds in overlapping areas, leading to inconsistent edge contour line widths and positional drift, severely impacting the accuracy of subsequent control systems. Summary of the Invention
[0005] This application aims to at least partially address one of the technical problems in the related art.
[0006] To achieve the above objectives, this application proposes an obstacle edge contour recognition method based on LiDAR point cloud data, comprising the following steps:
[0007] Step 1: Obtain the raw point cloud data scanned by the lidar within a preset acquisition period, perform coordinate transformation and noise reduction preprocessing on the raw point cloud data, and generate an initial point cloud set.
[0008] Step 2: Based on the initial point cloud set, the three-dimensional space is divided into several three-dimensional voxel units using a voxel mesh partitioning algorithm. The internal dispersion index of each three-dimensional voxel unit is calculated, and effective voxel units and invalid voxel units are selected according to the preset dual judgment conditions and the internal dispersion index.
[0009] Step 3: Traverse the eight-neighbor space based on the invalid voxel units. If any of the valid voxel units exist in the eight-neighbor space, mark the invalid voxel units as transition voxel units. Construct candidate regions based on the valid voxel units and transition voxel units, and construct a dataset based on the internal point cloud data.
[0010] Step 4: Construct local point cloud slices based on the dataset and perform principal component analysis to obtain multiple coefficient indices. Construct composite feature vectors based on the multiple coefficient indices, map them to a six-dimensional feature space to obtain local geometric feature descriptors, and generate feature point sets.
[0011] Step 5: Combine the initial hypothesis model and the feature point set to identify interior points, construct initial edge contour lines based on the start and end points of the line segments, and perform adjacent line segment determination and merging to obtain a continuous set of initial edge contour lines.
[0012] Step 6: Construct a global topological sorting chain based on the set of continuous initial edge contour segments, identify three component values and sum them by weight to obtain a confidence score; perform error accumulation analysis based on the confidence score to obtain the optimized edge contour.
[0013] Furthermore, based on the initial point cloud set, the three-dimensional space is divided into several three-dimensional voxel units using a voxel mesh partitioning algorithm. The internal dispersion index of each three-dimensional voxel unit is calculated, and effective voxel units and invalid voxel units are selected according to preset dual judgment conditions and the internal dispersion index. This includes the following steps:
[0014] Step 21: Construct global voxel edge length parameters and the three-dimensional boundary range of the scan space, and generate a three-dimensional voxel mesh together. Each mesh of the three-dimensional voxel mesh is defined as a voxel unit. Map each point cloud data based on the initial point cloud set to the voxel unit. Each voxel unit includes 0 point cloud data, 1 point cloud data, or multiple point cloud data. Voxel units with one or more point cloud data are marked as non-empty voxel units.
[0015] Step 22: Obtain the number of point cloud data in each non-empty voxel unit and mark it as the first number; determine the first Euclidean distance between each point cloud data in the non-empty voxel unit and the centroid of the non-empty voxel unit; and obtain the internal dispersion index based on the first Euclidean distance and the first number.
[0016] Step 23: If the first quantity is greater than the preset first density threshold and the internal dispersion index is less than the first dispersion threshold, then the current voxel unit is marked as a valid voxel unit; otherwise, the current voxel unit is marked as an invalid voxel unit; voxel units with 0 point cloud data are marked as invalid voxel units.
[0017] Further, based on the invalid voxel units, the eight-neighbor space is traversed. If any of the valid voxel units exist within the eight-neighbor space, the invalid voxel units are marked as transitional voxel units. Candidate regions are constructed based on the valid voxel units and transitional voxel units, and a dataset is built based on the internal point cloud data, including the following steps:
[0018] Step 31: Construct a two-dimensional array based on the effective voxel units and the ineffective voxel units, initialize all elements of the two-dimensional array to 0; update the elements at the corresponding positions of the effective voxel units in the two-dimensional array to 1;
[0019] Step 32: Determine eight neighboring voxel units in the eight-neighbor space based on the invalid voxel unit. If at least one valid voxel unit exists among the eight neighboring voxel units, mark the current invalid voxel unit as a transition voxel unit and mark the element at the corresponding position of the current invalid voxel unit in the two-dimensional value as 1.
[0020] Step 33: Mark all voxel units in the two-dimensional array that are all 1 as candidate regions;
[0021] Step 34: The point cloud data of all voxel units falling within the candidate region are stitched together to form a dataset.
[0022] Further, based on the dataset, local point cloud slices are constructed and principal component analysis is performed to obtain multiple coefficient indices. A composite feature vector is then constructed based on these multiple coefficient indices, mapped to a six-dimensional feature space to obtain local geometric feature descriptors, and a feature point set is generated. This process includes the following steps:
[0023] Step 41: Based on each point cloud data in the dataset as the center of a sphere, construct a spherical neighborhood with a preset search radius in three-dimensional space, and take the point cloud data in the spherical neighborhood that belong to the dataset except for the center of the sphere as neighboring points, and construct a local point cloud slice based on all the neighboring points.
[0024] Step 42: Calculate the covariance matrix based on the local point cloud slices and solve for the eigenvalues. Calculate three coefficient indices based on the eigenvalues. Normalize the three coefficient indices and then concatenate them to form the basic set feature vector.
[0025] Step 43: Obtain the reflection intensity and depth information of the sphere center, and concatenate the reflection intensity and depth information to the tail of the basic set feature vector to obtain a composite feature vector;
[0026] Step 44: Construct a six-dimensional feature space, evenly divide each dimension into several feature spaces, obtain the frequency of each composite feature vector falling into each feature interval, and concatenate the frequencies of each feature interval into a vector as a local geometric feature descriptor for each point cloud data in the dataset.
[0027] Step 45: Calculate the average value of the local geometric feature descriptors of each point cloud data in each feature interval to obtain the mean vector as the global geometric feature descriptor; calculate the second Euclidean distance between the global geometric feature descriptor and the local geometric feature descriptor, remove point cloud data whose second Euclidean distance is less than a preset distance threshold, and use the remaining point cloud data as the feature point set.
[0028] Furthermore, by combining the initial hypothesis model and the feature point set to identify interior points, an initial edge contour line segment is constructed based on the start and end points of the line segment, and adjacent line segment determination and merging are performed to obtain a continuous set of initial edge contour line segments, including the following steps:
[0029] Step 51: Randomly and without replacement, three feature points are extracted from the feature point set: a first feature point, a second feature point, and a third feature point; a first vector and a second vector are calculated based on the first feature point, the second feature point, and the third feature point; the cross product is calculated based on the first vector and the second vector; if the cross product is greater than a preset collinearity threshold, it means that the first feature point, the second feature point, and the third feature point are not collinear, and an initial hypothesis model is constructed: an ideal straight line equation is fitted based on the first feature point, the second feature point, and the third feature point using the least squares method;
[0030] Step 52: Calculate the vertical distance between the remaining point cloud data in the feature point set and the ideal straight line equation. If the vertical distance is less than a preset distance threshold, mark the current point cloud data as an interior point; otherwise, mark it as an exterior point.
[0031] Step 53: Count the number of inliers. If the number of inliers is greater than the preset sampling ratio, retain the current initial hypothesis model. If the goodness of fit of the current model is better than the historical best model, use all the current inliers to refit the ideal line equation using the least squares method to obtain the optimal line model. Otherwise, retain the current ideal line equation. If the number of inliers is less than or equal to the preset sampling ratio, discard the current initial hypothesis model and return to step 51 to resample until the maximum number of iterations is reached.
[0032] Step 54: Obtain an interior point set based on the initial assumption model or the optimal straight line model. Based on each point cloud data in the interior point set, determine the projection scalar on the straight line direction vector. Arrange all interior points in the interior point set in ascending order according to the projection scalar to obtain an ordered point sequence. Take the first point in the ordered point sequence as the starting point of the line segment and the last point as the ending point of the line segment. Connect all points in the ordered point sequence in order to form a preliminary edge contour line segment.
[0033] Step 55: Determine the endpoint positions of the preliminary edge contour segments. Calculate the endpoint connection distance based on the endpoint positions of any two preliminary edge contour segments. If the endpoint connection distance is less than a preset connectivity threshold, then the two preliminary edge contour segments are determined to be adjacent segments; otherwise, they are determined to be non-adjacent segments.
[0034] Step 56: Remove the intermediate breakpoints between two preliminary edge contour segments in the adjacent line segments, and take the end point and start point of the two preliminary edge contour segments as the first endpoint; when there is an overlap between two preliminary edge contour segments in the adjacent line segments, extract the overlapping area and take the start point and end point of the overlapping area as the first endpoint;
[0035] Step 57: Based on two preliminary edge contour segments among all the adjacent line segments, merge them through the first endpoint to obtain a new line segment. Arrange and connect each interior point of the new line segment in ascending order of the projection scalar to form a continuous preliminary edge contour line segment. All the continuous preliminary edge contour line segments constitute a continuous initial edge contour line segment set.
[0036] Furthermore, a global topological sorting chain is constructed based on the set of continuous initial edge contour segments. Three component values are identified and weighted summation is performed to obtain a confidence score. Based on the confidence score, error accumulation analysis is performed to obtain the optimized edge contour, including the following steps:
[0037] Step 61: Each continuous initial edge contour segment of the set of continuous initial edge contour segments is defined as a node, and adjacent nodes are connected by connecting edges to form a topological chain; based on each continuous initial edge contour segment of the topological chain, the first center point of the current continuous initial edge contour segment, the second center point of the previous continuous initial edge contour segment, and the third center point of the next continuous initial edge contour segment are identified; the third vector and the fourth vector are calculated according to the distribution of the first center point, the second center point, and the third center point; the first angle between the third vector and the fourth vector is calculated; and the curvature component value is obtained according to the first angle.
[0038] Step 62: Calculate the second angle between the direction vector of the current continuous initial edge contour segment and the direction vector of the previous continuous initial edge contour segment; calculate the third angle between the direction vector of the current continuous initial edge contour segment and the direction vector of the next continuous initial edge contour segment; determine the maximum value of the second angle and the third angle as the maximum angle; and take the absolute value of the maximum angle as the angle component value.
[0039] Step 63: Obtain the average point cloud density of the voxel unit covered by each of the continuous initial edge contour segments and define it as the density component value. Determine the weight coefficients of the curvature component value, angle component value and density component value. Based on the curvature component value, angle component value, density component value and the corresponding weight coefficients, perform a weighted summation to obtain the confidence score of each continuous initial edge contour segment.
[0040] Step 64: Construct an error accumulation factor based on the confidence score of the continuous initial edge contour line segment. If the error accumulation factor is less than 0.8, construct a quadratic Bézier curve based on the first center point, the second center point, and the third center point, identify the nearest projection point corresponding to each inner point of the continuous initial edge contour line segment, and correct each inner point of the continuous initial edge contour line segment based on the nearest projection point to obtain the intermediate contour trajectory line segment.
[0041] Step 65: Identify abnormal positions based on the intermediate contour trajectory segment, construct transformation error based on the point cloud data of the previous frame, perform replacement and completion operations to obtain a new intermediate contour trajectory segment, and repeat the abnormal position identification and replacement and completion operations based on the new intermediate contour trajectory segment until no abnormal position is identified or the maximum number of iterations is reached, and use the latest intermediate contour trajectory segment as the optimized edge contour.
[0042] Further, an error accumulation factor is constructed based on the confidence score of the continuous initial edge contour segments. If the error accumulation factor is less than 0.8, a quadratic Bézier curve is constructed based on the first center point, the second center point, and the third center point. The nearest projection point corresponding to each interior point of the continuous initial edge contour segment is identified. The nearest projection point is used to correct each interior point of the continuous initial edge contour segment to obtain the intermediate contour trajectory segment, including the following steps:
[0043] Step 641: Construct a ratio based on the confidence scores of the current continuous preliminary edge contour segments and the previous continuous preliminary edge contour segments to obtain an error accumulation factor; if the error accumulation factor is less than 0.8, then execute step 642 to correct the interior points; otherwise, keep the original state.
[0044] Step 642: Construct a quadratic Bézier curve based on the first center point, the second center point, and the third center point. The quadratic Bézier curve represents the spatial coordinate point corresponding to the quadratic Bézier curve at the position of parameter t.
[0045] Step 643: Construct an Euclidean distance function based on each interior point, spatial coordinate point, and parameter of the current continuous preliminary edge contour segment, and construct a parameter interval based on the parameter. Divide the parameter interval into several uniform step sizes to obtain multiple discrete parameters. Substitute the discrete parameters into a quadratic Bézier curve to obtain the corresponding spatial coordinate points. Calculate the distance between the spatial coordinate points and the interior points of the current continuous preliminary edge contour segment. Take the discrete parameter corresponding to the minimum distance as the optimal parameter. Substitute the optimal parameter into a quadratic Bézier curve to obtain the spatial coordinate points as the nearest projection points of the interior points of the current continuous preliminary edge contour segment.
[0046] Step 644: Subtract the nearest projection point from the interior point of the current continuous preliminary edge contour segment to obtain the displacement correction amount; and superimpose the displacement correction amount on each interior point of the current continuous preliminary edge contour segment to obtain the corrected interior point.
[0047] Step 645: Based on all the corrected interior points of all the continuous preliminary edge contour segments, arrange them in ascending order of the projected scalars and connect them to form intermediate contour trajectory segments.
[0048] Further, based on the intermediate contour trajectory segment, abnormal positions are identified. Combining this with the point cloud data from the previous frame, a transformation error is constructed, and replacement and completion operations are performed to obtain new intermediate contour trajectory segments. Based on these new intermediate contour trajectory segments, the abnormal position identification, replacement, and completion operations are repeated until no abnormal positions are identified or the maximum number of iterations is reached. The latest intermediate contour trajectory segment is then used as the optimized edge contour, including the following steps:
[0049] Step 651: Based on the intermediate contour trajectory segments, identify adjacent intermediate contour trajectory segment pairs, calculate the third Euclidean distance between the end point of the previous intermediate contour trajectory segment and the start point of the next intermediate contour trajectory segment in the adjacent intermediate contour trajectory segment pair. If the third Euclidean distance is greater than a preset upper limit value, it is determined that there is a breakpoint between the adjacent intermediate contour trajectory segment pairs and the location of the breakpoint is defined as the first abnormal position; if the third Euclidean distance is less than the preset upper limit value, it is determined that there is an overlap between the adjacent intermediate contour trajectory segment pairs and the overlapping area is defined as the second abnormal position.
[0050] Step 652: Based on the first abnormal position and the second abnormal position, obtain the corresponding first point cloud subset and historical point cloud subset, and generate a transformation error based on the first point cloud subset and the historical point cloud subset;
[0051] Step 653: If the transformation error is less than the preset alignment threshold, then replace the first point cloud subset of the first abnormal position and / or the second abnormal position with the historical point cloud subset; otherwise, obtain the breakpoint start point and breakpoint end point of the first abnormal position, perform an interpolation operation between the breakpoint start point and the breakpoint end point to obtain several intermediate points, and insert the intermediate points into the breakpoint position.
[0052] Step 654: Based on the replacement and completion in step 653, a new intermediate contour trajectory line segment is generated by connecting the segments.
[0053] Step 655: Based on the new intermediate contour trajectory segment, repeat steps 651-654 to perform abnormal position identification, replacement and completion operations until no abnormal position is identified or the maximum number of iterations is reached, and use the latest intermediate contour trajectory segment as the optimized edge contour.
[0054] Furthermore, the multiple coefficient indicators include: linearity coefficient, flatness coefficient, and divergence coefficient; the first eigenvalue includes a first eigenvalue, a second eigenvalue, and a third eigenvalue; regularization is performed based on the first eigenvalue to obtain a regularization coefficient; the linearity coefficient is obtained based on the first eigenvalue, the second eigenvalue, and the regularization coefficient; the flatness coefficient is obtained based on the second eigenvalue, the third eigenvalue, and the regularization coefficient; and the divergence coefficient is obtained based on the third eigenvalue and the regularization coefficient.
[0055] This invention also provides an obstacle edge contour recognition system based on lidar point cloud data, comprising the following modules:
[0056] The data acquisition module is used to acquire the raw point cloud data obtained by the lidar scanning within a preset acquisition period, perform coordinate transformation and noise reduction preprocessing on the raw point cloud data, and generate an initial point cloud set.
[0057] The filtering module is used to divide the three-dimensional space into several three-dimensional voxel units based on the initial point cloud set using a voxel mesh partitioning algorithm, calculate the internal dispersion index of each three-dimensional voxel unit, and filter out effective voxel units and invalid voxel units according to the preset dual judgment conditions and the internal dispersion index.
[0058] The data construction module is used to traverse the eight-neighbor space based on the invalid voxel units. If any of the valid voxel units exist in the eight-neighbor space, the invalid voxel units are marked as transition voxel units. Candidate regions are constructed based on the valid voxel units and transition voxel units, and a dataset is constructed based on the internal point cloud data.
[0059] The data analysis module is used to construct local point cloud slices based on the dataset and perform principal component analysis to obtain multiple coefficient indices. Based on the multiple coefficient indices, a composite feature vector is constructed, mapped to a six-dimensional feature space to obtain local geometric feature descriptors, and a feature point set is generated.
[0060] The contour analysis module is used to identify interior points by combining the initial hypothesis model and the feature point set, construct initial edge contour lines based on the start and end points of the line segments, and perform adjacent line segment determination and merging to obtain a set of continuous initial edge contour lines.
[0061] The contour optimization module is used to construct a global topological sorting chain based on a set of continuous initial edge contour segments, identify three component values and sum them by weight to obtain a confidence score; and perform error accumulation analysis based on the confidence score to obtain the optimized edge contour.
[0062] Compared with existing technologies, the obstacle edge contour recognition method and system based on LiDAR point cloud data provided in this application accurately selects effective voxels and intelligently marks transition regions to construct a high-purity candidate dataset through a dual judgment mechanism of voxel mesh division and internal dispersion index. Subsequently, principal component analysis of local point cloud slices combined with reflection intensity and depth information is used to construct a six-dimensional composite feature vector and perform frequency mapping and anomaly removal in the feature space to generate a high-precision feature point set. On this basis, the optimal straight line model is iteratively fitted, and the points are arranged in an orderly manner according to the projection scalar and adjacent line segments are merged to form a continuous initial edge contour set. Then, a weighted confidence score of curvature, angle and density components is introduced, and the contour is smoothed and optimized through a quadratic Bézier curve and the nearest projection point correction algorithm. Finally, a time-series iterative optimization closed loop including breakpoint identification, historical data replacement and interpolation completion is constructed, outputting an optimized edge contour with a rigorous topological structure and geometric continuity. Based on the above technical solution, this invention solves the key problems of large noise interference, single geometric feature description, severe contour breakage and overlap in dynamic scenes and trajectory discontinuity in existing technologies. First, addressing the challenges of point cloud noise and non-uniform distribution, the proposed solution effectively distinguishes object edges from background clutter by calculating the Euclidean distance between the point cloud and its centroid within a voxel and combining this with a density threshold. Simultaneously, it utilizes an eight-neighbor transition voxel strategy to fill edge gaps, significantly improving data quality from the source and avoiding the drawbacks of traditional denoising methods that lose details or retain noise. Second, to overcome the insufficient dimensionality of geometric feature extraction, the solution constructs a six-dimensional feature descriptor that integrates linearity, flatness, divergence, and physical properties (intensity, depth). Through feature space frequency statistics and distance threshold filtering, it achieves robust capture of edge features in complex curved surfaces and occluded environments, significantly improving the accuracy of feature point recognition. More importantly, addressing common issues in dynamic scenes such as contour breaks, overlaps, and jagged distortion, the solution innovatively employs a confidence-driven error accumulation analysis and temporal iterative optimization mechanism. On one hand, it dynamically controls the fitting degree of the quadratic Bézier curve using weighted scores of curvature, angle, and density, and eliminates the jagged effect caused by discrete points through the nearest projection point algorithm, achieving sub-pixel-level smoothness of the contour. On the other hand, through cross-frame transformation error analysis, it adaptively selects historical reference data replacement or linear interpolation completion strategies to repair breakpoints and overlapping areas, strictly adhering to the principle of ascending order rearrangement of projection scalars to ensure the monotonicity of the newly generated line segments in spatial order and the correctness of topological logic. This multi-stage, iterative optimization process not only completely eliminates logical jumps and self-intersections caused by single-frame processing but also achieves spatiotemporal consistency constraints by introducing data from the previous frame. Ultimately, it outputs a smooth, continuous, and highly realistic edge contour trajectory without breaks or redundancy, significantly improving the perception accuracy and safety of autonomous driving and robot navigation systems in complex dynamic environments. Attached Figure Description
[0063] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0064] Figure 1 A flowchart illustrating the obstacle edge contour recognition method based on LiDAR point cloud data provided in this application embodiment;
[0065] Figure 2 This is a structural block diagram of an obstacle edge contour recognition system based on LiDAR point cloud data provided in an embodiment of this application;
[0066] Figure 3 This is a block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0067] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0068] The obstacle edge contour recognition method and system based on lidar point cloud data according to embodiments of this application are described below with reference to the accompanying drawings.
[0069] like Figure 1 As shown, the obstacle edge contour recognition method and system based on lidar point cloud data includes the following steps:
[0070] Step 1: Obtain the raw point cloud data scanned by the lidar within a preset acquisition period, perform coordinate transformation and noise reduction preprocessing on the raw point cloud data, and generate an initial point cloud set.
[0071] This embodiment activates a lidar sensor to continuously scan the surrounding environment at a preset frequency (e.g., 10Hz or 20Hz) within a complete acquisition cycle, acquiring a raw point cloud data stream containing a large number of three-dimensional coordinate points (recorded in millimeters or meters), reflection intensity, and timestamps. Subsequently, the raw data undergoes coordinate transformation processing, using a pre-calibrated extrinsic parameter matrix to transform each frame of the point cloud from the radar's local coordinate system to the vehicle's or robot's global world coordinate system. Simultaneously, odometry or IMU data is combined to eliminate pose drift caused by vehicle motion, ensuring spatial consistency across multiple frames of data. A statistical outlier removal algorithm is applied to eliminate isolated noise points; radius filtering is applied to remove sparse clutter; and adaptive filtering based on reflection intensity filters out low-intensity false echo points caused by rain, fog, dust, or strong light interference. Finally, a complete initial point cloud set is obtained. The raw point cloud data acquisition, coordinate transformation, and denoising preprocessing involved in this embodiment are existing technologies and will not be described in detail here.
[0072] Step 2: Based on the initial point cloud set, the three-dimensional space is divided into several three-dimensional voxel units using a voxel mesh partitioning algorithm. The internal dispersion index of each three-dimensional voxel unit is calculated, and effective voxel units and invalid voxel units are selected according to the preset dual judgment conditions and the internal dispersion index.
[0073] Step 21: Construct global voxel edge length parameters and the three-dimensional boundary range of the scan space, and generate a three-dimensional voxel mesh together. Each mesh of the three-dimensional voxel mesh is defined as a voxel unit. Map each point cloud data based on the initial point cloud set to the voxel unit. Each voxel unit includes 0 point cloud data, 1 point cloud data, or multiple point cloud data. Voxel units with one or more point cloud data are marked as non-empty voxel units.
[0074] First, based on the maximum effective detection range of the lidar and the coverage requirements of the current scene, the global voxel side length parameter is dynamically set (e.g., 0.1 meters or 0.05 meters). This parameter directly determines the fineness of the spatial division. Next, by traversing the extreme coordinate values of all points in the initial point cloud set, the three-dimensional boundary range of the scanning space is precisely determined, i.e., the minimum bounding box containing the minimum and maximum x, y, and z coordinates. Based on the set side length parameter and the determined three-dimensional boundary range, the continuous three-dimensional physical space is discretized into a regular mesh structure, where each cubic unit is defined as a voxel unit. Subsequently, for each data point in the initial point cloud set, based on its specific position in the global coordinate system, its position relative to the edge... The offset of the starting point of the boundary range is divided by the preset voxel side length and rounded down to calculate the integer index of the point in the x, y, and z dimensions. These three indices together constitute the grid coordinates of the voxel cell to which the point belongs. Finally, using an efficient hash table or three-dimensional array data structure, each point cloud data is mapped to the voxel cell pointed to by the calculated grid coordinates and statistically classified. During this process, the data filling status of each cell is automatically identified: voxel cells with more than or equal to 1 internal point cloud data are uniformly marked as non-empty voxel cells, serving as the core basis for subsequent geometric feature analysis and edge filtering, while voxel cells with no point cloud data falling into them are ignored.
[0075] Step 22: Obtain the number of point cloud data in each non-empty voxel unit and mark it as the first number; determine the first Euclidean distance between each point cloud data in the non-empty voxel unit and the centroid of the non-empty voxel unit; and obtain the internal dispersion index based on the first Euclidean distance and the first number.
[0076] This embodiment iterates through all meshes marked as non-empty voxel units, performs internal statistical calculations on each non-empty unit to accurately count the total number of point cloud data contained within that unit, and marks this value as the first quantity. Then, based on the three-dimensional coordinates of all point clouds within that unit, the geometric centroid C of that unit is calculated using the arithmetic mean method. Subsequently, the spatial positional relationship between each point cloud data and the centroid is extracted one by one, and the straight-line distance from each point to the centroid is calculated using the three-dimensional Euclidean distance formula. Furthermore, the calculated Euclidean distance is squared. The process involves summing the squared Euclidean distances from all points within a cell to the centroid. Then, this sum is divided by a first quantity to obtain the variance of the point cloud distribution within the cell, quantifying the dispersion of the point cloud relative to the centroid. Finally, the calculated variance is square-rooted to obtain the voxel-internal dispersion index, which is then normalized to become the final voxel-internal dispersion index. This index reflects the density of point cloud aggregation within a single non-empty voxel and accurately characterizes the sparsity and irregularity of point cloud distribution in edge regions.
[0077] Step 23: If the first quantity is greater than the preset first density threshold and the internal dispersion index is less than the first dispersion threshold, then the current voxel unit is marked as a valid voxel unit; otherwise, the current voxel unit is marked as an invalid voxel unit; voxel units with 0 point cloud data are marked as invalid voxel units.
[0078] Based on the statistical distribution characteristics of point cloud data and the normalization standard of voxel mesh, a dynamic judgment threshold is defined. The first density threshold is set to 5 points, determined based on the minimum statistical confidence of effective sampling of the object surface by the lidar at typical detection distances, aiming to eliminate sparse clustering caused by random noise. The first dispersion threshold is set to 0.15, corresponding to the critical point where the standard deviation of the point cloud distribution exceeds 15% of its mean (or centroid distance from the baseline), thus ensuring that the thresholds perfectly match the normalized index dimensions. Subsequently, all non-empty voxel units are traversed for... Double logical verification: If the first number of a unit is greater than 5 and its normalized internal dispersion index is less than 0.15, it indicates that the unit not only has sufficient sample support, but also that the relative dispersion of the point cloud with respect to the centroid is extremely low and the geometric features are highly stable, and it is marked as a high-confidence valid voxel unit; conversely, if the number of points is less than 5, or although the number of points meets the standard, the normalized dispersion index exceeds 0.15, it is marked as an invalid voxel unit and removed; in addition, for data mapping anomalies, any voxel unit that statistically shows a point cloud number of 0 is directly and forcibly marked as an invalid voxel unit.
[0079] This embodiment can efficiently remove low-quality data composed of sensor noise, environmental reflection clutter, or random outliers. In particular, it marks voxels that, although not empty, have sparse point clouds (insufficient quantity) or extremely divergent distributions (excessive dispersion) as invalid, thereby eliminating interference from false edges and spurious geometric features at the source and significantly improving the signal-to-noise ratio of subsequent data processing. Secondly, retaining only effective voxel units that simultaneously satisfy high density and low dispersion means locking onto high-confidence regions with tightly clustered point clouds, stable geometric structures, and representing the surfaces or edges of real objects. This process of removing false data and retaining true data is crucial. This significantly enhances the robustness of the 3D edge extraction algorithm, resulting in smoother, more continuous, and physically accurate edge contours, avoiding jagged breaks or drift caused by noise. Finally, this classification process is essentially a spatial index optimization strategy that compresses massive initial point cloud data into a concise and effective set of voxels, greatly reducing the computational complexity and memory consumption of subsequent edge detection, surface fitting, or 3D reconstruction algorithms. It achieves real-time or high-efficiency processing performance while ensuring high accuracy, ensuring the feasibility and practicality of the entire technical solution in real-world application scenarios.
[0080] Step 3: Traverse the eight-neighbor space based on the invalid voxel units. If any of the valid voxel units exist in the eight-neighbor space, mark the invalid voxel units as transition voxel units. Construct candidate regions based on the valid voxel units and transition voxel units, and construct a dataset based on the internal point cloud data.
[0081] Step 31: Construct a two-dimensional array based on the effective voxel units and the ineffective voxel units, initialize all elements of the two-dimensional array to 0, and update the elements at the corresponding positions of the effective voxel units in the two-dimensional array to 1.
[0082] First, a two-dimensional Boolean mask array is constructed, corresponding to the spatial dimensions of the three-dimensional voxel mesh. The number of rows and columns of this array correspond to the projection range of the voxel mesh on the horizontal plane (such as the X-axis and Y-axis), ensuring that each array element uniquely maps to a specific voxel unit in three-dimensional space. Then, all initial elements of this two-dimensional array are uniformly set to 0, indicating that all positions are marked as invalid or background areas by default. Next, the set of valid voxel units identified in the previous steps is traversed, and their projection indices (i.e., row and column numbers) on the two-dimensional plane are calculated using their coordinate information. The array element value at this index position is updated from 0 to 1, thereby accurately outlining the spatial distribution contour of valid voxels on the two-dimensional plane. For voxel units that are not marked as valid (including units with sparse original point clouds, excessively high dispersion, or forcibly removed units), their corresponding array elements remain unchanged at 0.
[0083] Step 32: Determine eight neighboring voxel units in the eight-neighbor space based on the invalid voxel unit. If at least one valid voxel unit exists among the eight neighboring voxel units, mark the current invalid voxel unit as a transition voxel unit and mark the element at the corresponding position of the current invalid voxel unit in the two-dimensional value as 1.
[0084] For each invalid voxel unit, an eight-neighborhood (i.e., eight adjacent voxel units in the horizontal and vertical directions) is defined in three-dimensional space. Then, the algorithm traverses all adjacent voxel units in the eight-neighborhood and retrieves their attributes in the valid / invalid classification state one by one. Once at least one adjacent voxel unit is detected to belong to the valid voxel unit determined in the previous step, it is determined that the current central invalid voxel unit is located at the boundary between the edge of the real object and the noise region, and has important geometric transition features. Based on this determination result, the current invalid voxel unit is dynamically relabeled as a transition voxel unit, and the previously generated two-dimensional array is updated simultaneously, and the array element value corresponding to the invalid voxel unit is forcibly corrected from 0 to 1. This method is used to repair edge breaks or holes that may be caused by strict threshold filtering: edge point clouds that were originally considered noise and were rejected are identified as continuous transition regions and preserved and activated because they are close to the surface of the real object (effective voxels). This allows for the construction of a complete, smooth and unbroken object contour boundary in the 2D index map, ensuring that subsequent edge extraction algorithms can obtain a continuous closed geometric structure, and significantly improving the integrity of 3D model reconstruction and the accuracy of edge localization.
[0085] Step 33: Mark all voxel units in the two-dimensional array that are all 1 as candidate regions.
[0086] In this embodiment, the system traverses the previously generated two-dimensional array and performs a full scan of all pixel positions with an element value of 1. These elements with a value of 1 cover the effective voxel units determined in the previous steps and the positions marked as transition voxel units after neighborhood determination. Together, they constitute a complete set of high-confidence geometric features and smooth edge transitions in the scene. Subsequently, the system aggregates all three-dimensional voxel units corresponding to coordinate points mapped to 1 in the two-dimensional array and formally defines them as candidate regions. This region forms a continuous and closed spatial mask, which not only preserves the core high-density point cloud of the object surface, but also fills in edge breaks or small holes that may occur due to noise filtering or excessive dispersion by introducing transition voxels, thereby ensuring the integrity and connectivity of the object contour in spatial topology.
[0087] Step 34: The point cloud data of all voxel units falling within the candidate region are stitched together to form a dataset.
[0088] Based on the spatial indexing relationship of the voxel grid, this embodiment accurately locates and extracts all point cloud data contained in each voxel unit falling within the candidate region. Regardless of whether these point clouds belong to the high-density core region or the low-density edge transition region, they are read one by one and included in the processing flow. Then, all the extracted discrete point cloud data are aligned and stitched according to a unified global coordinate system to eliminate the spatial fragmentation caused by voxel segmentation. Finally, they are fused into a complete, coherent target point cloud dataset that has been freed from background noise interference. This process not only realizes the transformation from sparse and scattered raw scan data to structured, high signal-to-noise ratio dataset, but also effectively restores the continuity of object edges by retaining the point cloud data in the transition voxels.
[0089] This application fundamentally solves the problems of edge breakage, detail loss, and noise interference caused by threshold filtering in traditional point cloud processing by constructing a progressive processing method of effective voxels, transition voxels, and candidate regions, thereby significantly improving the accuracy and robustness of 3D reconstruction and edge extraction. First, it uses a two-dimensional array to simplify the complex 3D spatial relationships and quickly locate high-confidence effective regions. Second, it innovatively introduces an eight-neighborhood judgment strategy to intelligently identify and retain edge points (i.e., transition voxels) that are close to the real object but are misjudged as invalid. This edge repair mechanism effectively fills the gaps caused by scanning angle, occlusion, or sparse surface texture. The geometric holes ensure the continuity and topological integrity of the object's outline. Subsequently, by uniformly aggregating effective and transitional voxels into candidate regions and extracting all point clouds within them, a high-quality dataset that removes background noise while fully preserving the object's edge details was successfully constructed. This process not only significantly reduces the computational complexity of subsequent algorithms, but more importantly, it provides a discontinuous, high signal-to-noise ratio input foundation for high-precision edge extraction and surface reconstruction, making the final generated 3D model more realistic and accurate in terms of geometry. It is particularly suitable for application scenarios such as industrial inspection, reverse engineering, and autonomous driving perception, where edge quality requirements are stringent.
[0090] Step 4: Construct local point cloud slices based on the dataset and perform principal component analysis to obtain multiple coefficient indices. Construct composite feature vectors based on the multiple coefficient indices, map them to a six-dimensional feature space to obtain local geometric feature descriptors, and generate feature point sets.
[0091] Step 41: Based on each point cloud data in the dataset as the center of a sphere, construct a spherical neighborhood with a preset search radius in three-dimensional space, and take the point cloud data belonging to the dataset other than the center of the sphere within the spherical neighborhood as neighboring points, and construct a local point cloud slice based on all the neighboring points.
[0092] This embodiment iterates through the aforementioned high-quality target point cloud dataset and selects each point cloud data point as a temporary sphere center. Then, with the sphere center as the origin, a preset fixed search radius (or adaptive dynamic radius) is set in three-dimensional Euclidean space to construct a spherical neighborhood space. Next, spatial retrieval is performed within this spherical neighborhood to filter out all point cloud data whose coordinates fall within the sphere's range and are other than the sphere center itself. These filtered points are defined as the set of neighboring points of the current sphere center. Furthermore, based on the spatial distribution characteristics of these neighboring points, geometric transformation methods such as projection, plane fitting, or polar coordinate mapping are used to reconstruct the neighboring points scattered in three-dimensional space into a two-dimensional local point cloud slice.
[0093] Step 42: Calculate the covariance matrix based on the local point cloud slices and solve for the eigenvalues. Calculate three coefficient indices based on the eigenvalues, normalize the three coefficient indices, and then concatenate them to form the basic set feature vector.
[0094] The multiple coefficient indicators include: linearity coefficient, flatness coefficient, and divergence coefficient; the first eigenvalue includes a first eigenvalue, a second eigenvalue, and a third eigenvalue; regularization is performed based on the first eigenvalue to obtain a regularization coefficient; the linearity coefficient is obtained based on the first eigenvalue, the second eigenvalue, and the regularization coefficient; the flatness coefficient is obtained based on the second eigenvalue, the third eigenvalue, and the regularization coefficient; and the divergence coefficient is obtained based on the third eigenvalue and the regularization coefficient.
[0095] This embodiment traverses all local point cloud slices and performs statistical checks on the neighboring point set within each slice. If the number of points in the slice is less than a preset minimum sample threshold (e.g., less than 3 points), the data in that region is determined to be sparse or too noisy, lacking statistical significance for calculating geometric features. The feature calculation process for that point is skipped and marked as invalid. For slices that meet the minimum sample requirement, the core calculation stage begins. A three-dimensional covariance matrix is constructed using the coordinate information of all neighboring points, and three eigenvalues—first, second, and third—are obtained through eigenvalue decomposition, arranged in descending order. All three eigenvalues are greater than 0. This embodiment sets a minimum positive number with dimensions identical to the first, second, and third eigenvalues. The maximum value of the first eigenvalue and the minimum positive number is used as a regularization coefficient to normalize the three coefficients. The first difference between the first and second eigenvalues is calculated. A normalized linearity coefficient is obtained by calculating the ratio of this first difference to a regularization coefficient. This coefficient characterizes the extent of the point cloud's extension along the dominant direction, reflecting the salience of edges or linear structures. The second difference between the second and third eigenvalues is calculated. The ratio of this second difference to the regularization coefficient is used as a flatness coefficient to describe the distribution differences of the point cloud along the secondary dominant direction, identifying flat surface regions. A normalized divergence coefficient is obtained by calculating the ratio of the third eigenvalue to the regularization coefficient. This coefficient measures the dispersion of the point cloud along the third dominant direction, determining the presence of noise or corner features. Finally, these three normalized coefficients are concatenated in a fixed order to form a basic set feature vector containing rich local geometric semantics. This vector not only quantifies the geometric shape of the current local region (whether it is a line, surface, or volume) but also effectively suppresses noise interference.
[0096] Step 43: Obtain the reflection intensity and depth information of the sphere center, and concatenate the reflection intensity and depth information to the tail of the basic set feature vector to obtain a composite feature vector.
[0097] The reflection intensity information corresponding to the center of the current local point cloud slice is extracted from the raw sensor data. This indicator reflects the degree of energy attenuation after the laser pulse is reflected by the object surface and can characterize the albedo, roughness, or color attributes of the material. At the same time, the depth information of the center of the sphere in the sensor coordinate system is obtained, that is, the straight-line distance from the center of the sphere to the optical center of the sensor, which is used to provide an absolute spatial scale reference. Subsequently, in order to enrich the expression dimension of the feature vector and improve the ability to recognize mixed material and geometric features, the above two scalar values (reflection intensity and depth) are added as new feature dimensions and directly concatenated to the end of the basic set feature vector in a predetermined order. Through this concatenation operation, the vector that originally only contained normalized geometric topology information is expanded into a composite feature vector. This vector not only fully preserves the shape features such as linearity, flatness, and divergence of the local region, but also integrates material attributes (reflection intensity) and spatial location (depth) information, thereby constructing a high-dimensional, multi-dimensional comprehensive feature representation. This effectively solves the problem that single geometric features are difficult to distinguish between similar shapes but different materials, and significantly improves the robustness and accuracy of subsequent classifiers or reconstruction algorithms when dealing with complex scenes.
[0098] Step 44: Construct a six-dimensional feature space, evenly divide each dimension into several feature spaces, obtain the frequency of each composite feature vector falling into each feature interval, and concatenate the frequencies of each feature interval into a vector as the local geometric feature descriptor of each point cloud data in the dataset.
[0099] A six-dimensional feature space is defined for a composite feature vector (six-dimensional) consisting of reflection intensity, depth, and normalized geometric indices. The six coordinate axes of this space correspond to the six components of the composite feature vector. Then, in each dimension, based on the data distribution characteristics or preset accuracy requirements, the continuous feature value interval is uniformly divided into N (greater than 3) discrete feature intervals (i.e., a set step size or number of bins is defined), thereby discretizing the continuous six-dimensional space into N... 6 The dataset consists of three mutually exclusive feature voxels or feature units. Next, it iterates through all point cloud data in the dataset, mapping the composite feature vector corresponding to each point cloud data point to the six-dimensional grid. The number of point cloud data points falling into each feature interval is counted to obtain the frequency within that interval. Finally, to form a compact and fixed-length feature representation, these N... 6The frequency values are concatenated according to a predetermined index order to form a high-dimensional sparse or dense counting vector, which is defined as the local geometric feature descriptor of the current point cloud data. This descriptor construction method based on global statistical distribution not only preserves the geometric topological details and material properties of the local point cloud but also effectively reduces the sensitivity of a single vector to noise. This makes the feature description invariant to translation, rotation, and partial deformation, providing highly discriminative and robust input features for subsequent point cloud registration, segmentation, or anomaly detection tasks.
[0100] Step 45: Calculate the average value of the local geometric feature descriptors of each point cloud data in each feature interval to obtain the mean vector as the global geometric feature descriptor; calculate the second Euclidean distance between the global geometric feature descriptor and the local geometric feature descriptor, remove point cloud data whose second Euclidean distance is less than a preset distance threshold, and use the remaining point cloud data as the feature point set.
[0101] For all point cloud data in the dataset, local geometric feature descriptors (i.e., the frequency vector of each point in the six-dimensional feature space) are generated. The entire dataset is traversed, and the arithmetic mean of the frequencies of all sample points within each feature interval is calculated to obtain a mean vector that can characterize the overall geometric distribution of the entire scene. This mean vector is defined as the global geometric feature descriptor. The second Euclidean distance between the local geometric feature descriptor of each point cloud data and the global geometric feature descriptor is calculated one by one to quantify the deviation of the local geometric attributes of a single point from the overall scene distribution features. The calculated distance value is compared with a preset distance threshold of 0.15. Point cloud data with a distance less than this threshold are determined to belong to the normal distribution or background noise and are removed from the original point cloud data because these points often lack unique geometric saliency. Finally, all point cloud data with a distance greater than or equal to the preset threshold of 0.15 are filtered and retained to construct a highly robust feature point set. In this embodiment, for ordinary points located on smooth curved surfaces or uniform background regions, their local geometry is highly consistent with the global trend, and the calculated second Euclidean distance is extremely small, indicating that the point lacks unique structural information and is a mediocre point. Therefore, these points are discarded to remove redundant data. Conversely, for anomalous points located at object edges, corners, breakpoints, or deformed areas, their local geometry often undergoes drastic changes, resulting in significant differences between the local and global descriptors. The calculated second Euclidean distance is large, and these points are key feature points. By employing a strategy of removing similarities and retaining differences, smooth background points that cannot provide additional geometric information are selectively filtered out, thereby reversely selecting edge points and anomalous points with significant geometric changes as the final feature point set. This process not only effectively reduces the complexity of subsequent calculations but also physically ensures that the retained point set is highly concentrated on the topological boundaries and potential defect areas of the object, avoiding the interference of smooth surface noise introduced by directly retaining the original point cloud. This lays a solid logical foundation for subsequent high-precision edge contour extraction.
[0102] This application can accurately remove background noise and invalid regions, filtering out the majority of conventional point cloud data with mediocre geometric features (such as flat ground and uniform walls) found in traditional methods. It retains only key points with significant uniqueness in local geometry, orientation offset, or attribute distribution, thereby greatly reducing the data volume and directly solving the problems of insufficient sparsity and excessive computational load in point cloud data. The feature point set after global statistical filtering has an extremely high signal-to-noise ratio and high information density, ensuring that subsequent 3D reconstruction, target recognition, or anomaly detection algorithms are no longer interfered with by a large amount of low-quality data, enabling faster convergence and identification of truly important scene structures.
[0103] Step 5: Combine the initial hypothesis model and the feature point set to identify interior points, construct initial edge contour lines based on the start and end points of the line segments, and perform adjacent line segment determination and merging to obtain a continuous set of initial edge contour lines.
[0104] Step 51: Randomly and without replacement, three feature points are extracted from the feature point set: a first feature point, a second feature point, and a third feature point; a first vector and a second vector are calculated based on the first feature point, the second feature point, and the third feature point, and the cross product is calculated based on the first vector and the second vector; if the cross product is greater than a preset collinearity threshold, it means that the first feature point, the second feature point, and the third feature point are not collinear, and an initial hypothesis model is constructed: the ideal straight line equation is fitted based on the first feature point, the second feature point, and the third feature point using the least squares method.
[0105] First, three key points are independently selected from the feature point set using a random sampling strategy without replacement, and labeled as the first feature point, the second feature point, and the third feature point, respectively. Geometric relationships are constructed based on the three-dimensional coordinates of these three points. Specifically, the first vector pointing from the first feature point to the second feature point and the second vector pointing from the first feature point to the third feature point are calculated, and the cross product of these two vectors is further solved to quantify their spatial deviation. The calculated cross product magnitude is then compared with a preset collinearity threshold (10). -4 The following comparison is performed: If the cross product value is greater than the threshold, it confirms that the three points form a valid triangle in three-dimensional space and are not collinear. Then, these three points are used to quickly fit the initial hypothesis model (i.e., the ideal straight line equation) using the least squares method, serving as a reliable starting point for subsequent optimization or detection. Conversely, if the cross product value is less than or equal to the threshold, it indicates that the selected three points are approximately collinear, and a straight line with stable geometric meaning cannot be uniquely determined. In this case, an exception handling mechanism will be automatically triggered, determining that the current sampling combination is invalid, immediately discarding the data set, and re-performing random sampling without replacement until a set of data with a cross product greater than 10 is successfully obtained. -4 The process continues until the non-collinear feature points are identified. This embodiment effectively avoids the risk of mathematical singularities (such as division by zero errors or plane degradation) caused by random sampling by introducing an explicit threshold discrimination and cyclic retry mechanism, ensuring the robustness and success rate of the initial hypothesis model generation, thereby guaranteeing the continuity and stability of the entire line detection process in complex noise environments.
[0106] Step 52: Calculate the vertical distance between the remaining point cloud data in the feature point set and the ideal straight line equation. If the vertical distance is less than a preset distance threshold, mark the current point cloud data as an interior point; otherwise, mark it as an exterior point.
[0107] The algorithm iterates through all remaining point cloud data in the feature point set, excluding those forming the model foundation. It calculates the vertical Euclidean distance (i.e., the shortest spatial distance from a point to a line) from each point to the line and compares the results with a preset distance threshold. This threshold is set according to the principle of minimizing geometric tolerance, adaptively adjusted based on the point cloud data acquisition accuracy, sensor noise level, and the scale of local geometric features. The specific value is generally set to 2 to 3 times the sensor ranging error. For example, in LiDAR point cloud processing, if the device's ranging accuracy is ±5mm, the threshold can be set to 10mm to 15mm to ensure effective removal of false detections caused by noise or outliers while retaining valid edge points on the real target structure. Based on this standard, classification logic is executed: if the vertical distance of a point is less than the threshold (e.g., <10mm), the point is determined to be closely aligned with the ideal line, marked as an interior point, and included in the current model's support set; conversely, if the vertical distance is greater than or equal to the threshold, the point is determined to deviate too far from the line, belonging to background noise or interfering objects, and marked as an exterior point for removal.
[0108] Step 53: Count the number of inliers. If the number of inliers is greater than the preset sampling ratio, retain the current initial hypothesis model. If the goodness of fit of the current model is better than the historical best model, use all the current inliers to refit the ideal straight line equation using the least squares method to obtain the optimal straight line model. Otherwise, retain the current ideal straight line equation. If the number of inliers is less than or equal to the preset sampling ratio, discard the current initial hypothesis model and return to step 51 to resample until the maximum number of iterations is reached.
[0109] First, the number of interior points corresponding to the current initial hypothesis model is counted and directly compared with a preset sampling ratio. This preset sampling ratio is set to 0.65 (i.e., 65%), which means that only when the number of interior points exceeds 65% of the total number of feature points is the current model considered to have significant statistical significance and geometric representativeness, and can effectively distinguish between true linear structure and random noise. If the counted number of interior points is greater than this preset threshold, it indicates that the current model has extremely high confidence and will enter the model evaluation stage. By calculating the sum of squared residuals or the goodness-of-fit index, the accuracy of the current model is compared with the historical best model in real time. If the goodness-of-fit of the current model is better than the historical best value, then the least squares method is called again to perform global refitting using all the data sets currently marked as interior points, thereby eliminating the bias caused by the initial random sampling, generating the best straight line model with the highest accuracy and updating the historical record. Conversely, if the goodness-of-fit of the current model does not exceed the historical best value, then the original ideal straight line equation is directly retained as the current best candidate. On the other hand, if the number of interior points obtained from the statistics is less than or equal to the preset threshold, it indicates that the current random sampling of three-point combinations has failed to capture the true linear structure, and is very likely to be noise interference or invalid geometric configuration. The initial hypothesis model will be discarded, and a backtracking mechanism will be immediately triggered, returning to step 51 to re-execute the random sampling operation without replacement. This process will continue to loop until the preset maximum number of iterations is reached. This maximum number of iterations is dynamically set according to the real-time and accuracy requirements of the scenario, with a value range of 100. Once this upper limit is reached and no model meeting the interior point ratio requirement is found, it is determined that there is no straight line structure meeting the significance standard in the current scenario, and an empty result is output or the optimal state accumulated in the previous round is maintained. The initial hypothesis model iterative optimization process is existing technology and will not be described in detail in this embodiment.
[0110] Step 54: Obtain an interior point set based on the initial assumption model or the optimal straight line model. Based on the point cloud data of each interior point set, determine the projection scalar on the straight line direction vector. Arrange all interior points in the interior point set in ascending order according to the projection scalar to obtain an ordered point sequence. Take the first point in the ordered point sequence as the starting point of the line segment and the last point as the ending point of the line segment. Connect all points in the ordered point sequence in order to form a preliminary edge contour line segment.
[0111] First, a high-precision set of interior points is extracted from the established initial hypothesis model or the optimal straight line model after global refitting, serving as the core data source for constructing the geometric entity. Then, the algorithm extracts the unit direction vector (obtained by normalizing the coordinate difference between any two points on the line) based on this straight line model, and selects a known reference point on the line as the origin (the known reference point is any fixed point coordinate in the definition of the straight line equation). The difference between each point cloud data in the interior point set and the known reference point is calculated to obtain the displacement vector from the reference point to the current point. The dot product of the displacement vector and the direction vector is calculated to solve for the projection scalar of each point on the projection axis of the straight line. Based on these calculated projection scalars, the interior point set is sorted in ascending order to generate an ordered point sequence that follows spatial topological order. This sequence not only preserves... This method not only establishes the adjacency relationship of points but also eliminates the disorder caused by random sampling. The first point in the ordered point sequence (corresponding to the point with the smallest projection scalar) is defined as the starting point of the line segment, and the last point (corresponding to the point with the largest projection scalar) is defined as the ending point. All intermediate points in the ordered point sequence are forcibly connected sequentially according to their index order to form a continuous, non-self-intersecting preliminary edge contour line segment. This embodiment, by introducing an explicit vector dot product projection calculation process and parameter definition, achieves a precise mapping from three-dimensional discrete points to a one-dimensional ordered sequence. This not only ensures the geometric consistency of line segment generation and avoids boundary misalignment caused by point cloud noise but also provides a standardized input data structure for subsequent length measurement, angle analysis, or Boolean operations with other geometric features, greatly improving the accuracy and efficiency of three-dimensional scene understanding and reconstruction.
[0112] Step 55: Determine the endpoint positions of the preliminary edge contour segments. Calculate the endpoint connection distance based on the endpoint positions of any two preliminary edge contour segments. If the endpoint connection distance is less than a preset connectivity threshold, then the two preliminary edge contour segments are determined to be adjacent segments; otherwise, they are determined to be non-adjacent segments.
[0113] First, the geometric features of all generated preliminary edge contour segments are precisely extracted, specifically including locking the start and end coordinates of each segment as its endpoint positions. Then, the algorithm enters the connectivity determination stage, traversing all line segment pairs in the current scene, randomly selecting any two line segments (denoted as line segment A and line segment B), and calculating the Euclidean distance between one endpoint of line segment A and one endpoint of line segment B using the three-dimensional spatial coordinate calculation formula. The calculated Euclidean distance is compared in real-time with a preset connectivity threshold. In this embodiment, the specific value of the connectivity threshold is set to 0.5 mm (dynamically adjusted according to the accuracy of the point cloud acquisition device and the scene scale, for example, between 0.3 mm and 0.8 mm at millimeter-level accuracy). If the Euclidean distance is less than the connectivity threshold (i.e., the endpoint spacing is less than the maximum allowable gap to tolerate minor measurement noise or reconstruction errors), then the two line segments are determined to be physically adjacent and connectable, triggering a merging logic to merge them into a longer continuous edge. Conversely, if the distance is greater than the threshold, then a significant spatial break exists between the two line segments, or they belong to different geometric entities, thus marking them as non-adjacent line segments and maintaining their independent state.
[0114] Step 56: Remove the intermediate breakpoints between two preliminary edge contour segments in the adjacent line segments, and take the end point and start point of the two preliminary edge contour segments as the first endpoints; when there is an overlap between two preliminary edge contour segments in the adjacent line segments, extract the overlapping area and take the start point and end point of the overlapping area as the first endpoints.
[0115] This embodiment detects the spatial relationship between the endpoints of two line segments. If a tiny breakpoint exists between them (i.e., the endpoints do not completely overlap but the distance is less than the connectivity threshold), redundant data at the breakpoint is directly removed, and the termination point of the preceding line segment and the starting point of the following line segment are seamlessly connected as the new first endpoint, thus forming a continuous and gapless complete edge. Secondly, when an overlapping area is detected between two adjacent line segments (i.e., part of the coordinate range of the following line segment intersects or covers the end of the preceding line segment), the algorithm automatically extracts the geometric features of the overlapping area, calculates and determines the overlapping part. The algorithm accurately identifies the starting and ending points of the fused path, defining these two points as the first endpoint to eliminate duplicate paths and avoid geometric topological errors. Through the two strategies mentioned above—breakpoint elimination and overlapping region extraction—it can intelligently and adaptively handle complex situations such as edge fragmentation, breakage, and overlap, generating final edge contour segments with rigorous topological structure and pure geometric information. This not only eliminates false nodes caused by local noise or uneven sampling but also ensures that subsequent 3D modeling, volume calculation, and path planning operations are based on the most accurate geometric boundaries, significantly improving the robustness and engineering practicality of the overall reconstruction algorithm.
[0116] Step 57: Based on two preliminary edge contour segments among all the adjacent line segments, merge them through the first endpoint to obtain a new line segment. Arrange and connect each interior point of the new line segment in ascending order of the projection scalar to form a continuous preliminary edge contour line segment. All the continuous preliminary edge contour line segments constitute a continuous initial edge contour line segment set.
[0117] This embodiment uses the first endpoint as a key anchor point to perform a chain-like merging operation on all preliminary edge contour segments determined to be adjacent: the termination points of two adjacent segments are logically merged with the starting point (i.e., the first endpoint) to eliminate intermediate breakpoints or overlapping areas, thereby generating a new segment with increased length and a better topological structure; for all discrete interior points contained within this new segment, the previously calculated projection scalar data is called to perform a strict ascending order sorting operation on these interior points, ensuring that the points strictly follow the physical order from the start point to the end point of the segment in space, and the points are connected sequentially according to the sorting result to form a geometrically continuous, non-self-intersecting, and directionally clear preliminary edge contour. Edge contour segments; this process iterates recursively in the system until all connectable adjacent segments are integrated, and finally all generated continuous initial edge contour segments are summarized to construct a complete set of continuous initial edge contour segments; this embodiment successfully aggregates fragmented local edge information into a globally coherent geometric skeleton through a dual mechanism based on endpoint merging and projection scalar reordering. This not only completely solves the edge breakage problem caused by sensor noise or occlusion, but also ensures the strict monotonicity and continuity of the segment sequence in mathematics, providing a high-quality and standardized input data foundation for subsequent high-precision 3D reconstruction, object recognition and dimensional measurement.
[0118] This application effectively overcomes the problem of traditional algorithms being susceptible to outlier interference in noisy environments, leading to fitting failure. It significantly reduces the false detection rate and ensures that the extracted straight line model can truly reflect the edge features of the object. Secondly, by utilizing projection scalar sorting and endpoint merging strategies, it successfully solves the fragmentation problem caused by existing technologies when processing sparse or broken point clouds. It intelligently stitches together originally discrete, disordered, and even overlapping local line segments into a topologically rigorous and directional complete contour, completely eliminating breakpoints and redundancies that are difficult to handle manually or by traditional algorithms. Finally, the continuous initial edge contour line segment set generated by this scheme has extremely high geometric fidelity, directly providing a high-quality data foundation for subsequent processing.
[0119] Step 6: Construct a global topological sorting chain based on the set of continuous initial edge contour segments, identify three component values and sum them by weight to obtain a confidence score; perform error accumulation analysis based on the confidence score to obtain the optimized edge contour.
[0120] Step 61: Each continuous initial edge contour segment of the set of continuous initial edge contour segments is defined as a node, and adjacent nodes are connected by connecting edges to form a topological chain; based on each continuous initial edge contour segment of the topological chain, the first center point of the current continuous initial edge contour segment, the second center point of the previous continuous initial edge contour segment, and the third center point of the next continuous initial edge contour segment are identified; the third vector and the fourth vector are calculated according to the distribution of the first center point, the second center point, and the third center point; the first angle between the third vector and the fourth vector is calculated; and the curvature component value is obtained according to the first angle.
[0121] First, each line segment in the set of continuous initial edge contour segments is abstracted as an independent node in graph theory. Then, a strategy combining endpoint coincidence determination and a preset connectivity threshold is used to construct spatial adjacency relationships. Specifically, the algorithm traverses the endpoint coordinates of all line segment nodes, calculates the Euclidean distance between the nearest endpoint pair between any two nodes, and if the distance is less than or equal to the preset connectivity threshold, it directly determines that the two nodes are physically connected and establishes a connection edge between them. Simultaneously, to enhance the robustness of the determination to cope with small sampling errors or fitting deviations, a projection coincidence check is introduced, that is, determining whether the projection position of the endpoint of one line segment on the line containing another line segment falls within the length range of that line segment and is sufficiently close. If this condition is met, they are also considered adjacent. Based on this, an unvisited line segment is arbitrarily selected from the set as the starting node, and a depth-first search (DFS) or breadth-first search (BFS) strategy is used to proceed along the connection edge. Row traversal: During the search process, the access path is dynamically recorded, and the current node is sequentially connected with all its determined adjacent nodes. Loops are automatically eliminated and duplicate paths are avoided until all nodes within the connected component have been traversed, thereby reorganizing the originally discrete and disordered set of line segments into a logically rigorous and directional ordered topological chain. The generated ordered topological chain is traversed sequentially. For each current line segment (i.e., the target node) in the chain, its first center point, as well as the second and third center points of its directly adjacent previous and next nodes in the topological sequence, are accurately extracted. Based on the spatial coordinates of these three center points, a third vector pointing from the second center point to the first center point and a fourth vector pointing from the first center point to the third center point are constructed respectively, and the first included angle between the two is accurately calculated using the vector dot product formula. Finally, based on the size of the first included angle and its deviation from 180 degrees, the curvature component value reflecting the curvature of the current line segment is mapped and calculated.
[0122] Step 62: Calculate the second angle between the direction vector of the current continuous initial edge contour segment and the direction vector of the previous continuous initial edge contour segment, calculate the third angle between the direction vector of the current continuous initial edge contour segment and the direction vector of the next continuous initial edge contour segment, determine the maximum value of the second angle and the third angle as the maximum angle, and take the absolute value of the maximum angle as the angle component value.
[0123] First, the direction vector of the current continuous initial edge contour segment (target segment) is extracted, and the direction vectors of its directly adjacent upper and lower line segments in the topological chain are obtained respectively. Then, the second angle between the current direction vector and the previous direction vector, and the third angle between the current direction vector and the next direction vector are accurately calculated using vector dot product operation. These two angles reflect the deflection of the target segment relative to the neighboring line segments from two dimensions. The second and third angles are compared, and the larger one is selected as the maximum angle, which aims to capture the most significant turning feature of the target segment in the local neighborhood and avoid missing key geometric changes due to a single direction judgment. Finally, the absolute value of the maximum angle is taken as the angle component value.
[0124] Step 63: Obtain the average point cloud density of the voxel units covered by each of the continuous initial edge contour segments and define it as the density component value. Determine the weight coefficients of the curvature component value, angle component value and density component value. Based on the curvature component value, angle component value, density component value and the corresponding weight coefficients, perform a weighted summation to obtain the confidence score of each continuous initial edge contour segment.
[0125] First, a voxelization mapping operation is performed on each line segment in the continuous preliminary edge contour line segment set, discretizing the spatial region where the line segment is located into several three-dimensional voxel units. The number of point clouds falling into each voxel is counted, and then the arithmetic mean of the number of point clouds of all voxel units within the coverage area of the line segment is calculated as the initial density component value. Using the linear max-min normalization algorithm, the original curvature, angle, and density values are mapped to [0, 1] based on the maximum and minimum values of each component value in the current batch of data. Within the standard range, normalized curvature component values, normalized angle component values, and normalized density component values are generated. Based on the differences in the contribution of each feature dimension to the edge confidence, corresponding weight coefficients are preset and assigned. The weight coefficient for the normalized curvature component value is set to 0.45 to highlight the core position of geometric shape changes; the weight coefficient for the normalized angle component value is set to 0.3 to enhance the recognition ability of turning and acute angle features; and the weight coefficient for the normalized density component value is set to 0.25 to help verify the point cloud sampling quality and noise resistance performance of the edge region. On this basis, for each continuous initial edge contour segment, the above three normalized component values are multiplied by their corresponding weight coefficients and then summed to calculate the final confidence score of the segment.
[0126] Step 64: Construct an error accumulation factor based on the confidence score of the continuous initial edge contour line segment. If the error accumulation factor is less than 0.8, construct a quadratic Bézier curve based on the first center point, the second center point, and the third center point, identify the nearest projection point corresponding to each inner point of the continuous initial edge contour line segment, and correct each inner point of the continuous initial edge contour line segment based on the nearest projection point to obtain the intermediate contour trajectory line segment.
[0127] Step 641: Construct a ratio based on the confidence scores of the current continuous preliminary edge contour segments and the previous continuous preliminary edge contour segments to obtain an error accumulation factor; if the error accumulation factor is less than 0.8, then execute step 642 to correct the interior points; otherwise, keep the original state.
[0128] First, obtain the confidence score of the current continuous preliminary edge contour segment and the confidence score of its immediate predecessor segment (i.e., the previous continuous preliminary edge contour segment). Then, construct a scaling factor by calculating the ratio of the two. Further define the error accumulation factor, whose calculation logic is as follows: when the confidence score of the current continuous preliminary edge contour segment is greater than the confidence score of the previous continuous preliminary edge contour segment, it indicates that the edge quality is stable or improved. Set: 1 - scaling factor as the error accumulation factor. When the confidence score of the current continuous preliminary edge contour segment is less than that of the previous continuous preliminary edge contour segment, it indicates that the quality of the current segment has decreased relative to the previous segment. The set 1-proportion factor at this time is the error accumulation factor reflecting the magnitude of the quality drop. The calculated error accumulation factor is compared in real time with a preset stability threshold of 0.8. If the error accumulation factor is determined to be less than 0.8, it means that the confidence of the current segment has not dropped drastically, and the edge sequence is in a relatively stable state. Then, step 642 is automatically triggered to execute the interior point correction strategy. That is, using the geometric constraints of the preceding and following segments and the local point cloud distribution characteristics, the discrete interior points on the current segment are smoothed or their positions fine-tuned to eliminate potential jagged effects. Improving the smoothness of the edges; conversely, it indicates that the confidence of the current line segment has deteriorated significantly compared to the previous line segment (e.g., dropped by more than 20%), which may suggest severe noise interference, occlusion breakage, or feature mutation at that point. In this case, the system determines that forced correction may lead to erroneous geometric reconstruction, so it decides to keep the original state, skip the interior point correction step, directly retain the original data, or mark it as an abnormal region to be further processed. This embodiment achieves a smart processing strategy of steady-state smoothing and anomaly protection through this adaptive control logic based on dynamic comparison of confidence. It effectively suppresses the cumulative error under normal conditions and avoids the risk of overfitting when the edge features change drastically, significantly improving the overall accuracy and robustness of the final edge contour reconstruction.
[0129] Step 642: Construct a quadratic Bézier curve based on the first center point, the second center point, and the third center point. The quadratic Bézier curve represents the spatial coordinate point corresponding to the quadratic Bézier curve at the position of parameter t.
[0130] A quadratic Bézier curve interpolation algorithm is used to smoothly reconstruct discrete edge control points. First, the algorithm extracts three key geometric control points determined in the preceding steps, defined as the first center point, the second center point, and the third center point. The first and second center points serve as the start and end points of the curve, respectively, while the first center point acts as the control vertex to determine the curve's curvature. Then, a standard quadratic Bézier curve equation is constructed based on these three points. This equation accurately describes the spatial coordinates of any point on the curve. In the specific implementation, by traversing the continuous interval of parameter t from 0 to 1 (or by discrete sampling according to a preset step size), the weighted combined coordinates at each point are calculated, thereby generating a smooth and continuous spatial trajectory curve. The quadratic Bézier curve equation is a conventional equation in existing technologies.
[0131] Step 643: Construct an Euclidean distance function based on each interior point, spatial coordinate point, and parameter of the current continuous preliminary edge contour segment, and construct a parameter interval based on the parameter. Divide the parameter interval into several uniform step sizes to obtain multiple discrete parameters. Substitute the discrete parameters into a quadratic Bézier curve to obtain the corresponding spatial coordinate points. Calculate the distance between the spatial coordinate points and the interior points of the current continuous preliminary edge contour segment. Take the discrete parameter corresponding to the minimum distance as the optimal parameter. Substitute the optimal parameter into a quadratic Bézier curve to obtain the spatial coordinate points as the nearest projection points of the interior points of the current continuous preliminary edge contour segment.
[0132] For the current continuous preliminary edge contour segment, the algorithm traverses all its contained interior points. To quantify the deviation between these interior points and the smooth curve, a Euclidean distance function is constructed. The core logic of this function is to calculate the straight-line distance between the 3D spatial coordinates of the current interior point and the spatial coordinates of any point on the quadratic Bézier curve. Specifically, for any position on the curve determined by the parameter t, its spatial coordinates are calculated by the weighted average formula of the start point, control point, and end point. The Euclidean distance function is obtained by subtracting the coordinates of the interior point from the calculated curve coordinates, summing the squares, and then taking the square root, thus obtaining a distance that varies with the parameter t. The process involves several steps: First, determining the parameter range (typically the entire range from 0 to 1) based on the domain of the quadratic Bézier curve. This range is then evenly divided into several discrete step sizes (e.g., setting a fixed step size or adaptively adjusting it according to the curve length), generating a series of sequentially arranged discrete parameter sets. Each discrete parameter is then substituted into the quadratic Bézier curve equation to calculate the corresponding set of candidate spatial coordinate points. The actual straight-line distance between each candidate point and the current interior point is calculated, resulting in a sequence of distance values. Finally, the minimum distance value in this sequence is found through iterative comparison, and the value corresponding to this minimum distance is extracted. The discrete parameters are used as the optimal parameters. Finally, the found optimal parameters are substituted back into the quadratic Bézier curve equation to accurately calculate the corresponding spatial coordinate points, which are defined as the nearest projection point of the current interior point on the curve. This embodiment uses this strategy of discrete sampling, distance search, and optimal mapping to force discrete interior points that may deviate from the ideal geometric shape to be constrained to a smooth quadratic Bézier curve. This not only effectively eliminates the local jitter and noise interference of the original contour line segments and realizes the denoising and smooth reconstruction of edge data, but also ensures that the projection points strictly satisfy the shortest distance principle geometrically, providing a mathematically rigorous and robust data foundation for the subsequent process.
[0133] Step 644: Subtract the nearest projection point from the interior point of the current continuous preliminary edge contour segment to obtain the displacement correction amount; and superimpose the displacement correction amount on each interior point of the current continuous preliminary edge contour segment to obtain the corrected interior point.
[0134] By using a quadratic Bézier curve as an ideal geometric reference, the original interior points that deviate from the ideal trajectory are forcibly pulled back to the smooth curve along the normal direction (or the shortest path), thus realizing topological reconstruction from discrete coarse point clouds to continuous smooth curves at the physical level. Secondly, this correction mechanism based on nearest projection can effectively eliminate high-frequency random noise, because any abnormal noise points that deviate from the curve will be identified and corrected to the corresponding nearest position on the curve, significantly improving the signal-to-noise ratio and robustness of edge data. Furthermore, compared with existing global smoothing algorithms (such as Gaussian filtering or spline fitting), this method retains the accuracy of local geometric features because it strictly ensures that the corrected point set still falls within the mathematical constraint space defined by key control points, avoiding feature loss caused by over-smoothing (such as blunting of sharp corners or curvature distortion). Finally, the generated corrected interior point set not only constitutes a mathematically continuous and differentiable closed or open contour, but also provides high-precision geometric input for subsequent 3D reconstruction, surface fitting, dimensional measurement, and robot path planning, greatly reducing the cumulative error caused by inaccurate edges and improving the measurement accuracy and automation success rate of the entire system.
[0135] Step 645: Based on all the corrected interior points of all the continuous preliminary edge contour segments, arrange them in ascending order of the projected scalars and connect them to form intermediate contour trajectory segments.
[0136] This embodiment utilizes projection scalars as the key sorting criterion to orderly reorganize the set of corrected interior points generated based on all continuous preliminary edge contour segments: First, the projection parameter value of each corrected interior point in the corresponding quadratic Bézier curve parameterization equation is extracted. This parameter value is mathematically equivalent to the normalized arc length or path progress from the curve's starting point to the projection point, reflecting the point's relative position on the curve. Then, the corrected interior points on all segments are globally sorted in ascending order according to their corresponding projection scalar values, breaking the physical boundary constraints of the original independent segments and reconnecting the potentially scattered, broken, or disordered point sets into a logically coherent sequence. Finally, these corrected interior points are connected sequentially according to the sorted order to form a smooth... The system generates continuous and non-self-intersecting intermediate contour trajectory segments. It solves the problems of contour fragmentation and breakpoints caused by uneven lighting, occlusion, or sensor noise in traditional edge detection. By uniformly sorting the parameter space, it achieves seamless stitching of multiple discrete data segments, ensuring the integrity of the contour in terms of topological structure. At the same time, it uses projected scalars instead of original spatial coordinates for sorting, which effectively avoids spatial intersection errors caused by curve folding, looping, or complex bending, ensuring the single-valuedness and monotonicity of trajectory generation. This makes the final generated intermediate contour not only retain the high-precision geometric features of the original edge, but also has the mathematical property of continuous differentiability, providing an ideal geometric model that is logically rigorous, data-coherent, and has strong anti-interference ability.
[0137] Step 65: Identify abnormal positions based on the intermediate contour trajectory segment, construct transformation error based on the point cloud data of the previous frame, perform replacement and completion operations to obtain a new intermediate contour trajectory segment, and repeat the abnormal position identification and replacement and completion operations based on the new intermediate contour trajectory segment until no abnormal position is identified or the maximum number of iterations is reached, and use the latest intermediate contour trajectory segment as the optimized edge contour.
[0138] Step 651: Based on the intermediate contour trajectory line segments, identify adjacent intermediate contour trajectory line segment pairs, calculate the third Euclidean distance between the end point of the previous intermediate contour trajectory line segment and the start point of the next intermediate contour trajectory line segment in the adjacent intermediate contour trajectory line segment pair. If the third Euclidean distance is greater than a preset upper limit value, it is determined that there is a breakpoint between the adjacent intermediate contour trajectory line segment pairs and the location of the breakpoint is defined as the first abnormal position; if the third Euclidean distance is less than the preset upper limit value, it is determined that there is an overlap between the adjacent intermediate contour trajectory line segment pairs and the overlapping area is defined as the second abnormal position.
[0139] First, iterate through all adjacent pairs of intermediate contour lines, extract the endpoint coordinates of the preceding line segment and the starting coordinates of the following line segment, and calculate the third Euclidean distance (i.e., the spatial straight-line distance) between them. During this process, a preset lower limit value is set to 0 or a very small positive number, and a preset upper limit value is set to a threshold based on the current scene resolution and the expected minimum feature size (e.g., 2.0 mm or 5% dynamically calculated based on the average line segment length). When the calculated third Euclidean distance is greater than the preset upper limit value, it is determined that there is a breakpoint between the two line segments, and the breakpoint position is defined as the first abnormal position. When the third Euclidean distance is less than the preset lower limit value (i.e., the two points coincide or are extremely close), it is usually considered a normal connection. However, if a small negative deviation occurs (such as logical overlap caused by coordinate jitter), it is determined to be an overlap, and the area is defined as the second abnormal position.
[0140] Step 652: Based on the first abnormal position and the second abnormal position, obtain the corresponding first point cloud subset and historical point cloud subset, and generate a transformation error based on the first point cloud subset and the historical point cloud subset.
[0141] Using a spatial indexing structure (such as a voxel grid), the first subset of point clouds covering the anomaly location is accurately extracted from the currently acquired data. Simultaneously, historical point cloud subsets corresponding to the spatial region are extracted from historical baseline data or valid data from the previous frame. These two point cloud subsets are preprocessed, including removing outliers and unifying the normal vector direction. Then, a rigid transformation solution is performed using a variant of the iterative nearest-point algorithm or a feature-point-based registration strategy. Specifically, by minimizing the sum of squared Euclidean distances between corresponding point pairs in the two subsets, the optimal rotation matrix and translation vector required to align the first point cloud subset to the historical point cloud subset are iteratively calculated. Based on this, the optimal transformation is applied. The matrix maps the first subset of point clouds to the historical coordinate system and recalculates the residual distance between each mapped point and its nearest neighbor in the historical subset. Finally, the transformation error is defined as a statistic of these residual distances, which can be taken as the root mean square error to reflect the overall deviation level, or the maximum residual value to capture extreme outliers. If the calculated transformation error exceeds a preset threshold, it indicates that there is a significant spatial mismatch between the point cloud data at the outlier location and the historical state, thus determining that the outlier is a real physical deformation or a serious measurement failure. Otherwise, it is noise interference. This step-by-step calculation process ensures the mathematical rigor and engineering practicality of error quantification.
[0142] Step 653: If the transformation error is less than a preset alignment threshold, the first point cloud subset of the first abnormal position and / or the second abnormal position is replaced with a historical point cloud subset; otherwise, the breakpoint start point and breakpoint end point of the first abnormal position are obtained, and several intermediate points are obtained by performing an interpolation operation between the breakpoint start point and the breakpoint end point, and the intermediate points are inserted into the breakpoint position.
[0143] The transformation error is compared with a dynamically set preset alignment threshold, which is set between 0.15mm and 0.25mm (e.g., 0.2mm) based on the accuracy level of the current scanning equipment and the ambient noise level. If the transformation error is less than this threshold, it indicates that although the first point cloud subset currently acquired has topological breaks or overlaps, its geometry is highly consistent with the historical reference data, and is caused by instantaneous noise or slight jitter during the measurement process. In this case, it is directly determined that no interpolation correction is needed, and the first point cloud subset at the first abnormal position and / or the second abnormal position is completely replaced with a high-precision historical point cloud subset, thereby using the integrity of historical data to cover the current local defects. Conversely, if the transformation error is greater than or equal to the threshold, then... This indicates that the abnormal area has undergone real physical deformation, object displacement, or severe occlusion, rendering historical data inapplicable. The system then enters a geometric reconstruction mode, extracting the starting and ending coordinates of the breakpoint. Based on the spatial distance and curvature characteristics between the two points, cubic spline interpolation or high-order Bézier curve fitting algorithms are used to generate a series of smoothly transitioning intermediate points. These intermediate points are then precisely inserted into the breakpoint location, thus constructing a continuous trajectory that conforms to the original surface characteristics of the object. This threshold-based binary decision mechanism avoids erroneously overwriting the new state with old data when real deformation occurs and effectively eliminates false breakpoints caused by minor noise, achieving high-fidelity restoration and seamless fusion of point cloud data in complex dynamic scenes.
[0144] Step 654: Based on the replacement and completion in step 653, a new intermediate contour trajectory line segment is generated by connecting them.
[0145] Step 655: Based on the new intermediate contour trajectory segment, repeat steps 651-654 to perform abnormal position identification, replacement and completion operations until no abnormal position is identified or the maximum number of iterations is reached, and use the latest intermediate contour trajectory segment as the optimized edge contour.
[0146] After completing the initial identification of abnormal locations, point cloud replacement, or breakpoint interpolation completion, this implementation generates a set of newly corrected intermediate contour trajectory segments. Using these new segments as input data, the core logic of steps 651 to 654 is repeated: rescanning the third Euclidean distance between adjacent segment pairs, determining again whether new breakpoints or overlaps introduced by the previous operation (e.g., minor node redundancy caused by interpolation), and calculating the transformation error accordingly to decide whether to perform historical data overwriting or secondary interpolation. This iterative process employs a dynamic termination mechanism, monitoring the output status of each loop in real time. When the currently generated intermediate contour trajectory is detected... When there are no more breakpoints or overlapping areas that meet the definition of anomalies in the trace segment, or when the number of iterations reaches the preset maximum safety threshold (e.g., 5 or 10 times to prevent the algorithm from getting into an infinite loop), the iteration loop is forcibly stopped. Finally, the intermediate contour trajectory segment of the last successful output is confirmed as the optimized edge contour. This contour not only eliminates the initial topological breaks and geometric overlaps, but also smooths out the local curvature fluctuations that may be caused by the interpolation algorithm through multiple iterations, ensuring the mathematical continuity and physical authenticity of the edge data. This provides high-precision and flawless reference data for subsequent 3D modeling, quality inspection or robot path planning.
[0147] like Figure 2 As shown, this embodiment also discloses an obstacle edge contour recognition system based on LiDAR point cloud data, including the following modules:
[0148] The data acquisition module is used to acquire the raw point cloud data obtained by the lidar scanning within a preset acquisition period, perform coordinate transformation and noise reduction preprocessing on the raw point cloud data, and generate an initial point cloud set.
[0149] The filtering module is used to divide the three-dimensional space into several three-dimensional voxel units based on the initial point cloud set using a voxel mesh partitioning algorithm, calculate the internal dispersion index of each three-dimensional voxel unit, and filter out effective voxel units and invalid voxel units according to the preset dual judgment conditions and the internal dispersion index.
[0150] The data construction module is used to traverse the eight-neighbor space based on the invalid voxel units. If any of the valid voxel units exist in the eight-neighbor space, the invalid voxel units are marked as transition voxel units. Candidate regions are constructed based on the valid voxel units and transition voxel units, and a dataset is constructed based on the internal point cloud data.
[0151] The data analysis module is used to construct local point cloud slices based on the dataset and perform principal component analysis to obtain multiple coefficient indices. Based on the multiple coefficient indices, a composite feature vector is constructed, mapped to a six-dimensional feature space to obtain local geometric feature descriptors, and a feature point set is generated.
[0152] The contour analysis module is used to identify interior points by combining the initial hypothesis model and the feature point set, construct initial edge contour lines based on the start and end points of the line segments, and perform adjacent line segment determination and merging to obtain a set of continuous initial edge contour lines.
[0153] The contour optimization module is used to construct a global topological sorting chain based on a set of continuous initial edge contour segments, identify three component values and sum them by weight to obtain a confidence score; and perform error accumulation analysis based on the confidence score to obtain the optimized edge contour.
[0154] To implement the above embodiments, this application also proposes an electronic device. Please see [link to relevant documentation]. Figure 3 , Figure 3 This is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. For example... Figure 3 As shown, the electronic device 500 includes: a processor 501 and a memory 502 communicatively connected to the processor 501; the memory 502 stores computer-executable instructions; the processor 501 executes the computer-executable instructions stored in the memory to implement the method provided in the foregoing embodiments.
[0155] To implement the above embodiments, this application also proposes a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided in the foregoing embodiments.
[0156] To implement the above embodiments, this application also proposes a computer program product, including a computer program that, when executed by a processor, implements the methods provided in the foregoing embodiments.
[0157] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. An obstacle edge contour recognition method based on lidar point cloud data, characterized in that, Includes the following steps: Step 1: Obtain the raw point cloud data scanned by the lidar within a preset acquisition period, perform coordinate transformation and noise reduction preprocessing on the raw point cloud data, and generate an initial point cloud set. Step 2: Based on the initial point cloud set, the three-dimensional space is divided into several three-dimensional voxel units using a voxel mesh partitioning algorithm. The internal dispersion index of each three-dimensional voxel unit is calculated, and effective voxel units and invalid voxel units are selected according to the preset dual judgment conditions and the internal dispersion index. Step 3: Traverse the eight-neighbor space based on the invalid voxel units. If any of the valid voxel units exist in the eight-neighbor space, mark the invalid voxel units as transition voxel units. Construct candidate regions based on the valid voxel units and transition voxel units, and construct a dataset based on the internal point cloud data. Step 4: Construct local point cloud slices based on the dataset and perform principal component analysis to obtain multiple coefficient indices. Construct composite feature vectors based on the multiple coefficient indices, map them to a six-dimensional feature space to obtain local geometric feature descriptors, and generate feature point sets. Step 5: Combine the initial hypothesis model and the feature point set to identify interior points, construct initial edge contour lines based on the start and end points of the line segments, and perform adjacent line segment determination and merging to obtain a continuous set of initial edge contour lines. Step 6: Construct a global topological sorting chain based on the set of continuous initial edge contour segments, identify three component values and sum them by weight to obtain a confidence score; perform error accumulation analysis based on the confidence score to obtain the optimized edge contour.
2. The obstacle edge contour recognition method based on lidar point cloud data according to claim 1, characterized in that, Based on the initial point cloud set, the three-dimensional space is divided into several three-dimensional voxel units using a voxel mesh partitioning algorithm. The internal dispersion index of each three-dimensional voxel unit is calculated, and effective voxel units and invalid voxel units are selected according to preset dual judgment conditions and the internal dispersion index. The process includes the following steps: Step 21: Construct global voxel edge length parameters and the three-dimensional boundary range of the scan space, and generate a three-dimensional voxel mesh together. Each mesh of the three-dimensional voxel mesh is defined as a voxel unit. Map each point cloud data based on the initial point cloud set to the voxel unit. Each voxel unit includes 0 point cloud data, 1 point cloud data, or multiple point cloud data. Voxel units with one or more point cloud data are marked as non-empty voxel units. Step 22: Obtain the number of point cloud data in each non-empty voxel unit and mark it as the first number; determine the first Euclidean distance between each point cloud data in the non-empty voxel unit and the centroid of the non-empty voxel unit; and obtain the internal dispersion index based on the first Euclidean distance and the first number. Step 23: If the first quantity is greater than the preset first density threshold and the internal dispersion index is less than the first dispersion threshold, then the current voxel unit is marked as a valid voxel unit; otherwise, the current voxel unit is marked as an invalid voxel unit; voxel units with 0 point cloud data are marked as invalid voxel units.
3. The obstacle edge contour recognition method based on lidar point cloud data according to claim 2, characterized in that, Based on the invalid voxel units, the eight-neighbor space is traversed. If any of the valid voxel units exist within the eight-neighbor space, the invalid voxel unit is marked as a transitional voxel unit. Candidate regions are constructed based on the valid and transitional voxel units, and a dataset is built based on the internal point cloud data, including the following steps: Step 31: Construct a two-dimensional array based on the effective voxel units and the ineffective voxel units, initialize all elements of the two-dimensional array to 0; update the elements at the corresponding positions of the effective voxel units in the two-dimensional array to 1; Step 32: Determine eight neighboring voxel units in the eight-neighbor space based on the invalid voxel unit. If at least one valid voxel unit exists among the eight neighboring voxel units, mark the current invalid voxel unit as a transition voxel unit and mark the element at the corresponding position of the current invalid voxel unit in the two-dimensional value as 1. Step 33: Mark all voxel units in the two-dimensional array that are all 1 as candidate regions; Step 34: The point cloud data of all voxel units falling within the candidate region are stitched together to form a dataset.
4. The obstacle edge contour recognition method based on lidar point cloud data according to claim 3, characterized in that, Based on the dataset, local point cloud slices are constructed and principal component analysis is performed to obtain multiple coefficient indices. A composite feature vector is then constructed based on these coefficient indices, mapped to a six-dimensional feature space to obtain local geometric feature descriptors, and a feature point set is generated. The process includes the following steps: Step 41: Based on each point cloud data in the dataset as the center of a sphere, construct a spherical neighborhood with a preset search radius in three-dimensional space, and take the point cloud data in the spherical neighborhood that belong to the dataset except for the center of the sphere as neighboring points, and construct a local point cloud slice based on all the neighboring points. Step 42: Calculate the covariance matrix based on the local point cloud slices and solve for the eigenvalues. Calculate three coefficient indices based on the eigenvalues. Normalize the three coefficient indices and then concatenate them to form the basic set feature vector. Step 43: Obtain the reflection intensity and depth information of the sphere center, and concatenate the reflection intensity and depth information to the tail of the basic set feature vector to obtain a composite feature vector; Step 44: Construct a six-dimensional feature space, evenly divide each dimension into several feature spaces, obtain the frequency of each composite feature vector falling into each feature interval, and concatenate the frequencies of each feature interval into a vector as a local geometric feature descriptor for each point cloud data in the dataset. Step 45: Calculate the average value of the local geometric feature descriptors of each point cloud data in each feature interval to obtain the mean vector as the global geometric feature descriptor; calculate the second Euclidean distance between the global geometric feature descriptor and the local geometric feature descriptor, remove point cloud data whose second Euclidean distance is less than a preset distance threshold, and use the remaining point cloud data as the feature point set.
5. The obstacle edge contour recognition method based on lidar point cloud data according to claim 4, characterized in that, Combining the initial hypothesis model and the feature point set to identify interior points, an initial edge contour line segment is constructed based on the start and end points of the line segment, and adjacent line segments are determined and merged to obtain a continuous set of initial edge contour line segments, including the following steps: Step 51: Randomly and without replacement, three feature points are extracted from the feature point set: a first feature point, a second feature point, and a third feature point; a first vector and a second vector are calculated based on the first feature point, the second feature point, and the third feature point; the cross product is calculated based on the first vector and the second vector; if the cross product is greater than a preset collinearity threshold, it means that the first feature point, the second feature point, and the third feature point are not collinear, and an initial hypothesis model is constructed: an ideal straight line equation is fitted based on the first feature point, the second feature point, and the third feature point using the least squares method; Step 52: Calculate the vertical distance between the remaining point cloud data in the feature point set and the ideal straight line equation. If the vertical distance is less than a preset distance threshold, mark the current point cloud data as an interior point; otherwise, mark it as an exterior point. Step 53: Count the number of inliers. If the number of inliers is greater than the preset sampling ratio, retain the current initial hypothesis model. If the goodness of fit of the current model is better than the historical best model, use all the current inliers to refit the ideal line equation using the least squares method to obtain the optimal line model. Otherwise, retain the current ideal line equation. If the number of inliers is less than or equal to the preset sampling ratio, discard the current initial hypothesis model and return to step 51 to resample until the maximum number of iterations is reached. Step 54: Obtain an interior point set based on the initial assumption model or the optimal straight line model. Based on each point cloud data in the interior point set, determine the projection scalar on the straight line direction vector. Arrange all interior points in the interior point set in ascending order according to the projection scalar to obtain an ordered point sequence. Take the first point in the ordered point sequence as the starting point of the line segment and the last point as the ending point of the line segment. Connect all points in the ordered point sequence in order to form a preliminary edge contour line segment. Step 55: Determine the endpoint positions of the preliminary edge contour segments. Calculate the endpoint connection distance based on the endpoint positions of any two preliminary edge contour segments. If the endpoint connection distance is less than a preset connectivity threshold, then the two preliminary edge contour segments are determined to be adjacent segments; otherwise, they are determined to be non-adjacent segments. Step 56: Remove the intermediate breakpoints between two preliminary edge contour segments in the adjacent line segments, and take the end point and start point of the two preliminary edge contour segments as the first endpoint; when there is an overlap between two preliminary edge contour segments in the adjacent line segments, extract the overlapping area and take the start point and end point of the overlapping area as the first endpoint; Step 57: Based on two preliminary edge contour segments among all the adjacent line segments, merge them through the first endpoint to obtain a new line segment. Arrange and connect each interior point of the new line segment in ascending order of the projection scalar to form a continuous preliminary edge contour line segment. All the continuous preliminary edge contour line segments constitute a continuous initial edge contour line segment set.
6. The obstacle edge contour recognition method based on lidar point cloud data according to claim 5, characterized in that, A global topological sorting chain is constructed based on a set of continuous initial edge contour segments. Three component values are identified and weighted summation is performed to obtain a confidence score. Based on the confidence score, error accumulation analysis is performed to obtain an optimized edge contour, including the following steps: Step 61: Each continuous initial edge contour segment of the set of continuous initial edge contour segments is defined as a node, and adjacent nodes are connected by connecting edges to form a topological chain; based on each continuous initial edge contour segment of the topological chain, the first center point of the current continuous initial edge contour segment, the second center point of the previous continuous initial edge contour segment, and the third center point of the next continuous initial edge contour segment are identified; the third vector and the fourth vector are calculated according to the distribution of the first center point, the second center point, and the third center point; the first angle between the third vector and the fourth vector is calculated; and the curvature component value is obtained according to the first angle. Step 62: Calculate the second angle between the direction vector of the current continuous initial edge contour segment and the direction vector of the previous continuous initial edge contour segment; calculate the third angle between the direction vector of the current continuous initial edge contour segment and the direction vector of the next continuous initial edge contour segment; determine the maximum value of the second angle and the third angle as the maximum angle; and take the absolute value of the maximum angle as the angle component value. Step 63: Obtain the average point cloud density of the voxel unit covered by each of the continuous initial edge contour segments and define it as the density component value. Determine the weight coefficients of the curvature component value, angle component value and density component value. Based on the curvature component value, angle component value, density component value and the corresponding weight coefficients, perform a weighted summation to obtain the confidence score of each continuous initial edge contour segment. Step 64: Construct an error accumulation factor based on the confidence score of the continuous initial edge contour line segment. If the error accumulation factor is less than 0.8, construct a quadratic Bézier curve based on the first center point, the second center point, and the third center point, identify the nearest projection point corresponding to each inner point of the continuous initial edge contour line segment, and correct each inner point of the continuous initial edge contour line segment based on the nearest projection point to obtain the intermediate contour trajectory line segment. Step 65: Identify abnormal positions based on the intermediate contour trajectory segment, construct transformation error based on the point cloud data of the previous frame, perform replacement and completion operations to obtain a new intermediate contour trajectory segment, and repeat the abnormal position identification and replacement and completion operations based on the new intermediate contour trajectory segment until no abnormal position is identified or the maximum number of iterations is reached, and use the latest intermediate contour trajectory segment as the optimized edge contour.
7. The obstacle edge contour recognition method based on lidar point cloud data according to claim 6, characterized in that, An error accumulation factor is constructed based on the confidence score of the continuous initial edge contour segments. If the error accumulation factor is less than 0.8, a quadratic Bézier curve is constructed based on the first center point, the second center point, and the third center point. The nearest projection point corresponding to each interior point of the continuous initial edge contour segments is identified. Each interior point of the continuous initial edge contour segments is corrected based on the nearest projection point to obtain the intermediate contour trajectory segment, including the following steps: Step 641: Construct a ratio based on the confidence scores of the current continuous preliminary edge contour segments and the previous continuous preliminary edge contour segments to obtain an error accumulation factor; if the error accumulation factor is less than 0.8, then execute step 642 to correct the interior points; otherwise, keep the original state. Step 642: Construct a quadratic Bézier curve based on the first center point, the second center point, and the third center point. The quadratic Bézier curve represents the spatial coordinate point corresponding to the quadratic Bézier curve at the position of parameter t. Step 643: Construct an Euclidean distance function based on each interior point, spatial coordinate point, and parameter of the current continuous preliminary edge contour segment, and construct a parameter interval based on the parameter. Divide the parameter interval into several uniform step sizes to obtain multiple discrete parameters. Substitute the discrete parameters into a quadratic Bézier curve to obtain the corresponding spatial coordinate points. Calculate the distance between the spatial coordinate points and the interior points of the current continuous preliminary edge contour segment. Take the discrete parameter corresponding to the minimum distance as the optimal parameter. Substitute the optimal parameter into a quadratic Bézier curve to obtain the spatial coordinate points as the nearest projection points of the interior points of the current continuous preliminary edge contour segment. Step 644: Subtract the nearest projection point from the interior point of the current continuous preliminary edge contour segment to obtain the displacement correction amount; and superimpose the displacement correction amount on each interior point of the current continuous preliminary edge contour segment to obtain the corrected interior point. Step 645: Based on all the corrected interior points of all the continuous preliminary edge contour segments, arrange them in ascending order of the projected scalars and connect them to form intermediate contour trajectory segments.
8. The obstacle edge contour recognition method based on lidar point cloud data according to claim 7, characterized in that, Based on the intermediate contour trajectory segment, abnormal positions are identified. A transformation error is constructed using the point cloud data from the previous frame, and replacement and completion operations are performed to obtain a new intermediate contour trajectory segment. Based on the new intermediate contour trajectory segment, the abnormal position identification, replacement, and completion operations are repeated until no abnormal positions are identified or the maximum number of iterations is reached. The latest intermediate contour trajectory segment is then used as the optimized edge contour, including the following steps: Step 651: Based on the intermediate contour trajectory segments, identify adjacent intermediate contour trajectory segment pairs, calculate the third Euclidean distance between the end point of the previous intermediate contour trajectory segment and the start point of the next intermediate contour trajectory segment in the adjacent intermediate contour trajectory segment pair. If the third Euclidean distance is greater than a preset upper limit value, it is determined that there is a breakpoint between the adjacent intermediate contour trajectory segment pairs and the location of the breakpoint is defined as the first abnormal position; if the third Euclidean distance is less than the preset upper limit value, it is determined that there is an overlap between the adjacent intermediate contour trajectory segment pairs and the overlapping area is defined as the second abnormal position. Step 652: Based on the first abnormal position and the second abnormal position, obtain the corresponding first point cloud subset and historical point cloud subset, and generate a transformation error based on the first point cloud subset and the historical point cloud subset; Step 653: If the transformation error is less than the preset alignment threshold, then replace the first point cloud subset of the first abnormal position and / or the second abnormal position with the historical point cloud subset; otherwise, obtain the breakpoint start point and breakpoint end point of the first abnormal position, perform an interpolation operation between the breakpoint start point and the breakpoint end point to obtain several intermediate points, and insert the intermediate points into the breakpoint position. Step 654: Based on the replacement and completion in step 653, a new intermediate contour trajectory line segment is generated by connecting the segments. Step 655: Based on the new intermediate contour trajectory segment, repeat steps 651-654 to perform abnormal position identification, replacement and completion operations until no abnormal position is identified or the maximum number of iterations is reached, and use the latest intermediate contour trajectory segment as the optimized edge contour.
9. The obstacle edge contour recognition method based on lidar point cloud data according to claim 4, characterized in that, The multiple coefficient indicators include: linearity coefficient, flatness coefficient, and divergence coefficient; the first eigenvalue includes a first eigenvalue, a second eigenvalue, and a third eigenvalue; regularization is performed based on the first eigenvalue to obtain a regularization coefficient; the linearity coefficient is obtained based on the first eigenvalue, the second eigenvalue, and the regularization coefficient; the flatness coefficient is obtained based on the second eigenvalue, the third eigenvalue, and the regularization coefficient; and the divergence coefficient is obtained based on the third eigenvalue and the regularization coefficient.
10. An obstacle edge contour recognition system based on lidar point cloud data, used to execute the obstacle edge contour recognition method based on lidar point cloud data as described in any one of claims 1-9, characterized in that, Includes the following modules: The data acquisition module is used to acquire the raw point cloud data obtained by the lidar scanning within a preset acquisition period, perform coordinate transformation and noise reduction preprocessing on the raw point cloud data, and generate an initial point cloud set. The filtering module is used to divide the three-dimensional space into several three-dimensional voxel units based on the initial point cloud set using a voxel mesh partitioning algorithm, calculate the internal dispersion index of each three-dimensional voxel unit, and filter out effective voxel units and invalid voxel units according to the preset dual judgment conditions and the internal dispersion index. The data construction module is used to traverse the eight-neighbor space based on the invalid voxel units. If any of the valid voxel units exist in the eight-neighbor space, the invalid voxel units are marked as transition voxel units. Candidate regions are constructed based on the valid voxel units and transition voxel units, and a dataset is constructed based on the internal point cloud data. The data analysis module is used to construct local point cloud slices based on the dataset and perform principal component analysis to obtain multiple coefficient indices. Based on the multiple coefficient indices, a composite feature vector is constructed, mapped to a six-dimensional feature space to obtain local geometric feature descriptors, and a feature point set is generated. The contour analysis module is used to identify interior points by combining the initial hypothesis model and the feature point set, construct initial edge contour lines based on the start and end points of the line segments, and perform adjacent line segment determination and merging to obtain a set of continuous initial edge contour lines. The contour optimization module is used to construct a global topological sorting chain based on a set of continuous initial edge contour segments, identify three component values and sum them by weight to obtain a confidence score; and perform error accumulation analysis based on the confidence score to obtain the optimized edge contour.
