Disclosure of Invention
Based on the above purpose, the invention provides a three-dimensional point cloud-based building characteristic line extraction method.
The building characteristic line extraction method based on the three-dimensional point cloud comprises the following steps of:
s1, acquiring point cloud data, namely acquiring the point cloud data of a building by using a three-dimensional laser scanner;
s2, preprocessing the point cloud, namely preprocessing the acquired point cloud data, wherein the preprocessing comprises deleting isolated points and noise points;
S3, detecting the vertical face of the building, namely detecting the vertical face of the building by adopting an improved RANSAC algorithm, and determining a fitting plane;
s4, removing outliers, namely removing outliers in the vertical point cloud based on a multi-scale statistical analysis method;
s5, point cloud projection, namely projecting the denoised point cloud data onto a fitting plane to ensure the extraction precision of the characteristic lines;
s6, boundary extraction, namely extracting boundaries of the vertical point cloud by using a self-adaptive ALPHA SHAPE algorithm;
s7, boundary clustering, namely separating boundary point clouds into a plurality of clusters by adopting a density peak clustering algorithm;
s8, extracting straight line segments, namely extracting the straight line segments of the boundary point cloud from each cluster by using an improved RANSAC algorithm;
S9, calculating intersection points, namely obtaining the intersection points by extending adjacent straight line segments to obtain the integral characteristic line of the building facade;
s10, checking the accuracy of the extracted characteristic lines.
Further, the step S3 specifically includes:
s31, setting initial parameters of a RANSAC algorithm, wherein the initial parameters comprise iteration times N, an interior point threshold d and fitting accuracy E;
S32, a dynamic sampling strategy is to dynamically adjust the number of sample points under different sampling scales, so that the adaptability of the algorithm to building facades of different scales is improved;
S33, preliminary elevation detection, namely randomly selecting S points as sample point sets in each iteration, and calculating candidate plane parameters;
s34, estimating inner points, namely calculating the distances from all points to the plane by using parameters of the candidate plane, wherein the distances are defined as: Wherein d i is the distance from point i to the plane, (x i,yi,zi) is the coordinates of the point, and (a, b, c, d) is the parameters of the plane;
S35, selecting interior points, namely if d i is less than or equal to epsilon, counting the number of the interior points by taking the point i as the interior point, and selecting a candidate plane with the largest number of the interior points;
s36, plane fitting optimization, namely performing plane fitting on the selected inner point set by using a least square method, and optimizing plane parameters to enable the plane parameters to meet the following formula:
wherein (x i,yi,zi) is the coordinates of the inner points, and n is the number of the inner points;
S37, self-adaptive adjustment, namely, after each iteration, adjusting the number of sampling points and the iteration times according to the interior point proportion, wherein the formula is N=log (1-p)/log (1- (1-epsilon) s), p is the expected confidence coefficient, epsilon is the interior point proportion, and S is the number of sampling points.
Further, the step S4 specifically includes:
S41, neighborhood definition, namely defining a neighborhood for each point in the point cloud data set Wherein the method comprises the steps ofIs a set of all points within a sphere centered on point p i and having a radius r k, where k is a multi-scale parameter;
S42, calculating the distance d ij:dij=‖pi-pj II of each point p i to all points in the neighborhood, wherein II represents Euclidean distance,
S43, calculating the average distance of each point under different scales, wherein the average distance is expressed as:
Wherein, Is the number of points in the neighborhood, k represents the kth scale;
S44, outlier detection, namely, the multi-scale average distance of all points obeys Gaussian distribution, and the global average distance mu k and the standard deviation sigma k are calculated;
S45, identifying outliers, namely identifying points with multi-scale average distances exceeding a threshold value in the point cloud data set as outliers, namely, threshold=mu k+t·σk, wherein t is a set standard deviation multiple;
And S46, removing the outliers, namely deleting all points identified as the outliers to obtain a point cloud data set after the outliers are removed.
Further, the step S5 specifically includes:
S51, determining parameters of a fitting plane, namely obtaining a parameter equation of the fitting plane through a RANSAC algorithm, wherein the equation is in the form of a.x+b.y+c.z+d=0, and a, b, c and d are parameters of the fitting plane;
S52, calculating the distance between the point cloud and the plane, namely calculating the vertical distance d Pi between each denoised point P (x s,ys,zs) and the fitting plane, wherein the calculation mode is the same as the calculation mode for calculating the distance between all points and the plane:
S53, calculating projection points, namely projecting each point P (x s,ys,zs) onto a fitting plane to obtain projection points P '(x s′,ys′,zs'), wherein the calculation is expressed as:
xs′=xs-a·t;
ys′=ys-b·t;
zs′=zs-c·t;
and S54, integrating projection points P '(x s′,ys′,zs') of all points P (x s,ys,zs) to form a projected point cloud data set, and performing accuracy verification on the projected point cloud data set to ensure that errors in the projection process are within a preset range so as to ensure the accuracy of feature line extraction.
Further, the extracting the boundary in S6 specifically includes:
S61, setting alphashape initial parameters of an algorithm, including an initial radius alpha 0;
s62, neighborhood definition, defining a neighborhood for each point in the point cloud data set Wherein, Is a set of all points within a sphere centered on point p i and having a radius of α 0;
s63, calculating the neighborhood density, namely calculating the density of the points in the neighborhood of each point:
Wherein, Is the number of points in the neighborhood;
S64, self-adaptive radius adjustment, namely adjusting alpha radius alpha i of each point according to the density of the point cloud data, wherein the formula is as follows: wherein ρ max is the maximum density in the point cloud dataset;
s65, constructing alphashape by using the self-adaptive adjusted radius alpha i, and rolling a sphere with the radius alpha i on the point cloud data set to form a boundary;
And S66, boundary extraction, namely recording alphashape boundary points formed by scrolling, and extracting boundaries of the vertical point cloud.
Further, after the boundary is extracted, boundary optimization is further included, and the boundary optimization optimizes the extracted boundary through a gradient descent algorithm, so that the boundary precision is improved.
Further, the boundary clustering in S7 specifically includes:
S71, calculating Euclidean distances among all points in the boundary point cloud to form a distance matrix D= { D ij }, wherein D ij represents the distance between the point P i and the point P j;
S72, calculating the density, namely calculating the local density rho i of each point P i, wherein the local density is defined as the number of points of the point P i within a distance threshold delta, and the points are expressed as:
S73, calculating a distance peak value, namely calculating the minimum distance delta i from each point P i to the point with higher local density, wherein the minimum distance delta i is expressed as: for the point with the highest local density, delta i=maxj(dij is set;
S74, selecting the point with the highest local density rho and distance peak delta as a clustering center;
S75, other points are distributed to the cluster where the nearest cluster center is located, and each point is distributed according to the distance and density between the point and the cluster center, wherein the formula is as follows:
Cluster (P i)=argminC(diC), wherein C represents the Cluster center, and d iC is the distance from the point P i to the Cluster center;
and S76, optimizing the clusters, namely optimizing the initially allocated clusters, adjusting the attribution of points to maximize the density of each cluster, and outputting the finally allocated clusters as a plurality of clusters of boundary point clouds.
Further, the step S8 specifically includes:
S81, respectively processing boundary point clouds of each cluster, and dividing a point cloud data set into a plurality of clusters { C T }, wherein T represents the serial number of the cluster;
S82, selecting sample points, namely randomly selecting S points in each cluster as a sample point set, and calculating candidate straight line parameters;
S83, fitting a candidate straight line, namely fitting the candidate straight line by using a least square method according to a sample point set, and calculating a parameter equation of the candidate straight line, wherein the parameter equation is expressed as y=mx+b, m is the slope of the straight line, and b is the intercept of the straight line;
S84, evaluating inner points, namely calculating the vertical distance d line from each point to the straight line by using parameters of the candidate straight line, wherein the formula is as follows: If d line(Pi) is less than or equal to E, taking the point P i as an inner point, and counting the number of the inner points;
S85, selecting the interior points, namely selecting the candidate straight line with the largest number of the interior points as the best straight line of the current cluster;
S86, linear fitting optimization, namely performing linear fitting on the selected inner point set by using a least square method, and optimizing linear parameters, wherein the formula is as follows:
wherein (x i,yi) is the coordinates of the inner points, and n is the number of the inner points;
S87, extracting straight line segments, namely extracting optimized straight line segments, and extending adjacent straight line segments to intersection points of the optimized straight line segments to form complete boundary straight line segments;
S88, self-adaptive adjustment, namely after each iteration, adjusting the number of sampling points and the iteration times according to the inner point proportion, wherein the formula is as follows:
N=log (1-p)/log (1- (1-e) s), where p is the desired confidence, e is the interior point ratio, s is the number of sampling points;
s89, verifying the accuracy of the extracted straight line segment, ensuring that the extracted straight line segment meets the requirement of building boundary detection, and adjusting the RANSAC parameter according to the requirement to perform iterative optimization.
Further, the step S9 specifically includes:
S91, straight line segment fitting, namely, fitting a plurality of straight line segments to boundary point cloud data in each cluster by using a modified RANSAC algorithm, and marking the straight line segments as L i, wherein a parameter equation of L i is as follows:
y=m ix+bi, where m i is the slope of the ith straight line segment, and b i is the intercept of the ith straight line segment;
S92, extending each fitted straight line segment L i, and marking the extended straight line segment as L i';
S93, calculating intersection points of the adjacent extension straight line segments L i 'and L i+1', wherein the intersection point coordinates (x ij,yij) are obtained by solving the following equation:
yij=mixij+bi;
S94, filtering the intersection points, namely filtering all the calculated intersection points to remove abnormal intersection points which do not accord with the outline of the building;
S95, constructing a characteristic line, namely sequentially connecting the filtered intersection points to construct an integral characteristic line of the building facade;
S96, optimizing the constructed characteristic line, ensuring the smoothness and the precision of the characteristic line, and smoothing the characteristic line by using a curve fitting algorithm, wherein the smoothing is as follows:
initializing an intersection set, namely sequentially arranging all intersection points (x ij,yij) obtained by extending adjacent straight-line segments to form the intersection set;
Selecting a curve fitting method, namely selecting a curve fitting algorithm suitable for the contour of a building, such as B spline curve fitting or polynomial fitting;
Setting curve fitting parameters, namely setting relevant parameters such as node number of a B spline curve or the order of a polynomial according to a selected fitting method;
constructing a fitting curve model by using a selected curve fitting method;
calculating a fitting curve, namely calculating parameters of a curve fitting model according to the intersection point set to obtain the fitting curve;
Smoothing the curve, namely smoothing the fitted curve to remove noise and sharp turning points on the curve;
And verifying the fitting degree of the fitted smooth curve and the actual building outline, and adjusting fitting parameters according to the requirements to ensure the accuracy and smoothness of the characteristic line.
Further, the step S10 specifically includes:
Comparing the extracted characteristic lines with the original point cloud data, and calculating the distance from each characteristic line point to the corresponding original point cloud point;
calculating error indexes, namely calculating error indexes of the characteristic line and the original point cloud data, wherein the error indexes comprise average error, root mean square error and maximum error;
and (3) error analysis, namely analyzing the error index obtained by calculation and judging whether the precision of the characteristic line meets the requirement.
The invention has the beneficial effects that:
the invention provides a high-efficiency and accurate building characteristic line extraction method by combining an improved RANSAC algorithm, a self-adaptive ALPHA SHAPE algorithm, a density peak clustering algorithm and a gradient descent algorithm. Through multi-scale sampling, dynamic parameter adjustment and multi-stage optimization, the adaptability and the precision of the algorithm to building facades of different scales are improved. Particularly, by utilizing a self-adaptive ALPHA SHAPE algorithm and a density peak clustering algorithm, noise and outliers in the point cloud data are effectively processed, and the integrity and the accuracy of feature line extraction are ensured. The method can rapidly and accurately extract the outline characteristic line of the building from the three-dimensional point cloud data, remarkably improves the extraction efficiency and accuracy, and is suitable for the high-precision three-dimensional modeling requirement in the construction of smart cities.
After the characteristic line is extracted, the characteristic line is smoothed by adopting a curve fitting algorithm, so that the smoothness and the precision of the characteristic line are ensured, the noise and sharp turning points on the curve are removed, and the continuity and the smoothness of the characteristic line are ensured. The method remarkably improves the quality of the characteristic lines, enables the extracted characteristic lines to be more in line with the outline of an actual building, improves the precision and the attractiveness of the three-dimensional model, and provides a solid foundation for high-precision building modeling.
The invention ensures that the extracted characteristic line has high accuracy and reliability through detailed precision checking steps. And calculating error indexes (comprising average error, root mean square error and maximum error) through the comparison of the characteristic lines and the original point cloud data, and comprehensively evaluating the accuracy and the error distribution condition of the characteristic lines by combining with a manual check sum error distribution map.
Detailed Description
The present invention will be further described in detail with reference to specific embodiments in order to make the objects, technical solutions and advantages of the present invention more apparent.
As shown in fig. 1, the three-dimensional point cloud-based building feature line extraction method comprises the following steps:
S1, acquiring point cloud data of a building by using a three-dimensional laser scanner, wherein the acquisition comprises the following steps of:
selecting a three-dimensional laser scanner with high precision and high resolution to ensure that the acquired point cloud data has sufficient detail and accuracy;
setting scanning parameters of a scanner, including scanning resolution, scanning range and scanning angle, according to the height, area and structural characteristics of a building;
Selecting a plurality of scanning positions to ensure that the outer vertical surface of the whole building can be covered, and reducing shielding and blind areas as much as possible;
scanning is carried out at each scanning position according to the set scanning parameters, and point cloud data of the building are obtained;
Integrating and calibrating the point cloud data acquired from the plurality of scanning positions, and storing the integrated and calibrated point cloud data in a storage device for backup so as to prevent data loss;
s2, preprocessing the point cloud, namely preprocessing the acquired point cloud data, including deleting isolated points and noise points, specifically including:
performing preliminary processing on the acquired point cloud data by using open source point cloud processing software;
cutting out relatively complete partial point cloud data;
deleting isolated points and noise points, and ensuring the integrity and purity of point cloud data;
S3, detecting the vertical face of the building, namely detecting the vertical face of the building by adopting an improved RANSAC algorithm, and determining a fitting plane;
s4, removing outliers, namely removing outliers in the vertical point cloud based on a multi-scale statistical analysis method;
s5, point cloud projection, namely projecting the denoised point cloud data onto a fitting plane to ensure the extraction precision of the characteristic lines;
s6, boundary extraction, namely extracting boundaries of the vertical point cloud by using a self-adaptive ALPHA SHAPE algorithm;
s7, boundary clustering, namely separating boundary point clouds into a plurality of clusters by adopting a density peak clustering algorithm;
s8, extracting straight line segments, namely extracting the straight line segments of the boundary point cloud from each cluster by using an improved RANSAC algorithm;
S9, calculating intersection points, namely obtaining the intersection points by extending adjacent straight line segments to obtain the integral characteristic line of the building facade;
s10, checking the accuracy of the extracted characteristic lines.
S3 specifically comprises:
s31, setting initial parameters of a RANSAC algorithm, wherein the initial parameters comprise iteration times N, an interior point threshold d and fitting accuracy E;
S32, a dynamic sampling strategy is to dynamically adjust the number of sample points under different sampling scales, so that the adaptability of the algorithm to building facades of different scales is improved;
S33, preliminary elevation detection, namely randomly selecting S points as sample point sets in each iteration, and calculating candidate plane parameters;
s34, estimating inner points, namely calculating the distances from all points to the plane by using parameters of the candidate plane, wherein the distances are defined as: Wherein d i is the distance from point i to the plane, (x i,yi,zi) is the coordinates of the point, and (a, b, c, d) is the parameters of the plane;
S35, selecting interior points, namely if d i is less than or equal to epsilon, counting the number of the interior points by taking the point i as the interior point, and selecting a candidate plane with the largest number of the interior points;
s36, plane fitting optimization, namely performing plane fitting on the selected inner point set by using a least square method, and optimizing plane parameters to enable the plane parameters to meet the following formula:
wherein (x i,yi,zi) is the coordinates of the inner points, and n is the number of the inner points;
S37, self-adaptive adjustment, namely after each iteration, adjusting the number of sampling points and the iteration times according to the inner point proportion, wherein the formula is N=log (1-p)/log (1- (1-epsilon) s), wherein p is the expected confidence coefficient, epsilon is the inner point proportion, S is the number of sampling points, verifying the accuracy of a fitting plane, ensuring that the fitting plane meets the requirement of building elevation detection, and adjusting the RANSAC parameter according to the requirement to perform iterative optimization.
S4 specifically comprises the following steps:
S41, neighborhood definition, namely defining a neighborhood for each point in the point cloud data set Wherein the method comprises the steps ofIs a set of all points within a sphere centered on point p i and having a radius r k, where k is a multi-scale parameter;
S42, calculating the distance d ij:dij=‖pi-pj II of each point p i to all points in the neighborhood, wherein II represents Euclidean distance,
S43, calculating the average distance of each point under different scales, wherein the average distance is expressed as:
Wherein, Is the number of points in the neighborhood, k represents the kth scale;
S44, outlier detection, namely, the multi-scale average distance of all points obeys Gaussian distribution, and the global average distance mu k and the standard deviation sigma k are calculated and expressed as:
wherein n is the total point number of the point cloud data set;
S45, identifying outliers, namely identifying points with multi-scale average distances exceeding a threshold value in the point cloud data set as outliers, namely, threshold=mu k+t·σk, wherein t is a set standard deviation multiple;
And S46, removing the outliers, namely deleting all points identified as the outliers to obtain a point cloud data set after the outliers are removed.
Outliers in the point cloud data are effectively removed through a multi-scale statistical analysis method. The multi-scale neighborhood definition and distance calculation ensure the comprehensiveness and accuracy of outlier detection, and the outlier can be accurately identified by calculating the multi-scale average distance and assuming that the multi-scale average distance is subjected to Gaussian distribution. Setting a reasonable threshold ensures the effectiveness of outlier removal. The method can effectively improve the purity and the integrity of the point cloud data, and provides a high-quality data basis for the subsequent feature line extraction.
S5 specifically comprises the following steps:
S51, determining parameters of a fitting plane, namely obtaining a parameter equation of the fitting plane through a RANSAC algorithm, wherein the equation is in the form of a.x+b.y+c.z+d=0, and a, b, c and d are parameters of the fitting plane;
S52, calculating the distance between the point cloud and the plane, namely calculating the vertical distance d Pi between each denoised point P (x s,ys,zs) and the fitting plane, wherein the calculation mode is the same as the calculation mode for calculating the distance between all points and the plane:
S53, calculating projection points, namely projecting each point P (x s,ys,zs) onto a fitting plane to obtain projection points P '(x s′,ys′,zs'), wherein the calculation is expressed as:
xs′=xs-a·t;
ys′=ys-b·t;
zs′=zs-c·t;
and S54, integrating projection points P '(x s′,ys′,zs') of all points P (x s,ys,zs) to form a projected point cloud data set, and performing accuracy verification on the projected point cloud data set to ensure that errors in the projection process are within a preset range so as to ensure the accuracy of feature line extraction.
The boundary extraction in S6 specifically includes:
S61, setting alphashape initial parameters of an algorithm, including an initial radius alpha 0;
s62, neighborhood definition, defining a neighborhood for each point in the point cloud data set Wherein, Is a set of all points within a sphere centered on point p i and having a radius of α 0;
s63, calculating the neighborhood density, namely calculating the density of the points in the neighborhood of each point:
Wherein, Is the number of points in the neighborhood;
S64, self-adaptive radius adjustment, namely adjusting alpha radius alpha i of each point according to the density of the point cloud data, wherein the formula is as follows: wherein ρ max is the maximum density in the point cloud dataset;
s65, constructing alphashape by using the self-adaptive adjusted radius alpha i, and rolling a sphere with the radius alpha i on the point cloud data set to form a boundary;
And S66, boundary extraction, namely recording alphashape boundary points formed by scrolling, and extracting boundaries of the vertical point cloud.
After boundary extraction, boundary optimization is further included, and the boundary optimization optimizes the extracted boundary through a gradient descent algorithm, so that the boundary precision is improved, and the method specifically comprises the following steps:
Boundary point initial set: initializing boundary point set { P i }, wherein P i=(xi,yi,zi) from boundary point set extracted from adaptive alphashape algorithm;
The energy function is defined as an energy function E for defining a boundary point set, which is used for measuring the smoothness and the precision of the boundary point set, and the formula is as follows: Wherein, Is a neighborhood point set of points P i, lambda is a regularization parameter,Is an initial boundary point;
calculating the gradient of the energy function E with respect to the boundary point set { P i }, calculating the gradient The formula is:
Gradient descent iteration, namely updating a boundary point set { P i } by using a gradient descent method, wherein the formula is as follows:
Wherein, The boundary point position at the t-th iteration is defined, and eta is the learning rate;
Judging whether the change of the energy function E is smaller than a preset threshold E, if so, stopping iteration, otherwise, returning to the step to continue iteration;
And taking the final converged boundary point set { P i } as the optimized boundary output.
The boundary clustering in S7 specifically includes:
S71, calculating Euclidean distances among all points in the boundary point cloud to form a distance matrix D= { D ij }, wherein D ij represents the distance between the point P i and the point P j;
S72, calculating the density, namely calculating the local density rho i of each point P i, wherein the local density is defined as the number of points of the point P i within a distance threshold delta, and the points are expressed as:
S73, calculating a distance peak value, namely calculating the minimum distance delta i from each point P i to the point with higher local density, wherein the minimum distance delta i is expressed as: for the point with the highest local density, delta i=maxj(dij is set;
S74, selecting the point with the highest local density rho and distance peak delta as a clustering center, wherein the points are usually in a high-density area and are far away from other high-density points;
S75, other points are distributed to the cluster where the nearest cluster center is located, and each point is distributed according to the distance and density between the point and the cluster center, wherein the formula is as follows:
Cluster (P i)=argminC(diC), wherein C represents the Cluster center, and d iC is the distance from the point P i to the Cluster center;
and S76, optimizing the clusters, namely optimizing the initially allocated clusters, adjusting the attribution of points to maximize the density of each cluster, and outputting the finally allocated clusters as a plurality of clusters of boundary point clouds.
S8 specifically comprises the following steps:
S81, setting initial parameters of a RANSAC algorithm, including iteration times N, an interior point threshold d and fitting accuracy E, respectively processing boundary point clouds of each cluster, and dividing a point cloud data set into a plurality of clusters { C T }, wherein T represents the number of the clusters;
S82, selecting sample points, namely randomly selecting S points in each cluster as a sample point set, and calculating candidate straight line parameters;
S83, fitting a candidate straight line, namely fitting the candidate straight line by using a least square method according to a sample point set, and calculating a parameter equation of the candidate straight line, wherein the parameter equation is expressed as y=mx+b, m is the slope of the straight line, and b is the intercept of the straight line;
S84, evaluating inner points, namely calculating the vertical distance d line from each point to the straight line by using parameters of the candidate straight line, wherein the formula is as follows: If d line(Pi) is less than or equal to E, taking the point P i as an inner point, and counting the number of the inner points;
S85, selecting the interior points, namely selecting the candidate straight line with the largest number of the interior points as the best straight line of the current cluster;
S86, linear fitting optimization, namely performing linear fitting on the selected inner point set by using a least square method, and optimizing linear parameters, wherein the formula is as follows:
wherein (x i,yi) is the coordinates of the inner points, and n is the number of the inner points;
S87, extracting straight line segments, namely extracting optimized straight line segments, and extending adjacent straight line segments to intersection points of the optimized straight line segments to form complete boundary straight line segments;
S88, self-adaptive adjustment, namely after each iteration, adjusting the number of sampling points and the iteration times according to the inner point proportion, wherein the formula is as follows:
N=log (1-p)/log (1- (1-e) s), where p is the desired confidence, e is the interior point ratio, s is the number of sampling points;
s89, verifying the accuracy of the extracted straight line segment, ensuring that the extracted straight line segment meets the requirement of building boundary detection, and adjusting the RANSAC parameter according to the requirement to perform iterative optimization.
S9 specifically comprises:
S91, straight line segment fitting, namely, fitting a plurality of straight line segments to boundary point cloud data in each cluster by using a modified RANSAC algorithm, and marking the straight line segments as L i, wherein a parameter equation of L i is as follows:
y=m ix+bi, where m i is the slope of the ith straight line segment, and b i is the intercept of the ith straight line segment;
S92, extending each fitted straight line segment L i, and marking the extended straight line segment as L i';
S93, calculating intersection points of the adjacent extension straight line segments L i 'and L i+1', wherein the intersection point coordinates (x ij,yij) are obtained by solving the following equation:
yij=mixij+bi;
S94, filtering the intersection points, namely filtering all the calculated intersection points to remove abnormal intersection points which do not accord with the outline of the building;
S95, constructing a characteristic line, namely sequentially connecting the filtered intersection points to construct an integral characteristic line of the building facade;
S96, optimizing the constructed characteristic line, ensuring the smoothness and the precision of the characteristic line, and smoothing the characteristic line by using a curve fitting algorithm, wherein the smoothing is as follows:
initializing an intersection set, namely sequentially arranging all intersection points (x ij,yij) obtained by extending adjacent straight-line segments to form the intersection set;
Selecting a curve fitting method, namely selecting a curve fitting algorithm suitable for the contour of a building, such as B spline curve fitting or polynomial fitting;
Setting curve fitting parameters, namely setting relevant parameters such as node number of a B spline curve or the order of a polynomial according to a selected fitting method;
constructing a fitting curve model by using a selected curve fitting method;
calculating a fitting curve, namely calculating parameters of a curve fitting model according to the intersection point set to obtain the fitting curve;
Smoothing the curve, namely smoothing the fitted curve to remove noise and sharp turning points on the curve;
And verifying the fitting degree of the fitted smooth curve and the actual building outline, and adjusting fitting parameters according to the requirements to ensure the accuracy and smoothness of the characteristic line.
S10 specifically comprises the following steps:
Comparing the extracted characteristic lines with the original point cloud data, and calculating the distance from each characteristic line point to the corresponding original point cloud point;
calculating error indexes, namely calculating error indexes of the characteristic line and the original point cloud data, wherein the error indexes comprise average error, root mean square error and maximum error;
analyzing the error index obtained by calculation, and judging whether the precision of the characteristic line meets the requirement;
The error distribution diagram can be drawn, the distribution condition of errors on each point of the characteristic line is displayed, the identification of the region with larger errors is facilitated, the parameters of the characteristic line extraction algorithm are adjusted according to error analysis, and the extraction precision of the characteristic line is optimized.
It will be appreciated by persons skilled in the art that the above discussion of any embodiment is merely exemplary and is not intended to imply that the scope of the invention is limited to these examples, that combinations of technical features in the above embodiments or in different embodiments may also be implemented in any order, and that many other variations of the different aspects of the invention as described above exist, which are not provided in detail for the sake of brevity.
The present invention is intended to embrace all such alternatives, modifications and variances which fall within the broad scope of the appended claims. Therefore, any omission, modification, equivalent replacement, improvement, etc. of the present invention should be included in the scope of the present invention.