CN118097066A - Generation method and system for automatically constructing 3D model - Google Patents

Generation method and system for automatically constructing 3D model Download PDF

Info

Publication number
CN118097066A
CN118097066A CN202410508344.7A CN202410508344A CN118097066A CN 118097066 A CN118097066 A CN 118097066A CN 202410508344 A CN202410508344 A CN 202410508344A CN 118097066 A CN118097066 A CN 118097066A
Authority
CN
China
Prior art keywords
plane
cluster
point cloud
points
point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410508344.7A
Other languages
Chinese (zh)
Other versions
CN118097066B (en
Inventor
吴立军
王晓龙
宋文峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen 20000 Li Culture Media Co ltd
Original Assignee
Xiamen 20000 Li Culture Media Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen 20000 Li Culture Media Co ltd filed Critical Xiamen 20000 Li Culture Media Co ltd
Priority to CN202410508344.7A priority Critical patent/CN118097066B/en
Publication of CN118097066A publication Critical patent/CN118097066A/en
Application granted granted Critical
Publication of CN118097066B publication Critical patent/CN118097066B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention provides a generation method and a system for automatically constructing a 3D model, and relates to the technical field of data processing, wherein the method comprises the following steps: calculating the distribution density of the point cloud for each plane cluster respectively, and comparing the distribution density with the distribution density of the point cloud in the plane candidate set to obtain a density comparison result; determining a dynamic influence factor according to the density comparison result, and dynamically adjusting the plane cluster according to the dynamic influence factor to generate a plane segmentation result; extracting contour lines of each building according to the plane segmentation result; analyzing the geometric shape change on the contour line to decompose the contour line of the building into a plurality of independent line segments; selecting and marking key points according to each independent line segment and specific geometric characteristics; and carrying out triangulation processing on the key points to generate the three-dimensional game building model. The invention can more accurately identify the potential plane structure from the noise background.

Description

Generation method and system for automatically constructing 3D model
Technical Field
The invention relates to the technical field of data processing, in particular to a generation method and system for automatically constructing a 3D model.
Background
The traditional three-dimensional game design modeling process, sometimes relying on a designer to make manual adjustments using specialized software, is time consuming and error prone. Despite recent advances in automated modeling technology in the field of game design, many challenges remain in practical use. Taking building modeling in a game scene as an example, when key plane structures such as wall surfaces, windows and door openings of a building are identified from point cloud data, current automatic modeling technology may often be interfered by data noise and incompleteness, so that a modeling result is inaccurate.
When in a game scene with complex design and rich details, such as old castles, luxury urban sets and the like, due to interleaving and shielding among buildings, point cloud data can often be missing or unevenly distributed, which brings a plurality of difficulties to an automatic modeling process.
For example, in a noisy data background, it may be difficult for an automated algorithm to accurately identify key planar features of the walls, arches, etc. of a gaming building, thereby making the modeling result far away from the original design, and thus affecting the visual effect and overall realism of the gaming model.
Disclosure of Invention
The invention aims to provide a generation method and a system for automatically constructing a 3D model, which can more accurately identify a potential plane structure from a noise background.
In order to solve the technical problems, the technical scheme of the invention is as follows:
in a first aspect, a method for generating an automatically constructed 3D model, the method comprising:
Obtaining model parameters of a game building, wherein the model parameters are used for primarily identifying a planar structure of the building from a complex game environment and generating a planar candidate set according to the planar structure;
Utilizing point cloud data in a game scene, and grouping and gathering points in the point cloud data according to the spatial proximity and attribute similarity characteristics of the point cloud data to form a plane cluster corresponding to the plane candidate set;
Calculating the distribution density of the point cloud for each plane cluster respectively, and comparing the distribution density with the distribution density of the point cloud in the plane candidate set to obtain a density comparison result;
Determining a dynamic influence factor according to the density comparison result, and dynamically adjusting the plane cluster according to the dynamic influence factor to generate a plane segmentation result;
extracting contour lines of each building according to the plane segmentation result;
Analyzing the geometric shape change on the contour line to decompose the contour line of the building into a plurality of independent line segments;
selecting and marking key points according to each independent line segment and specific geometric characteristics;
and carrying out triangulation processing on the key points to generate the three-dimensional game building model.
Further, obtaining model parameters of the game building, the model parameters being used for initially identifying a planar structure of the building from a complex game environment, and generating a planar candidate set according to the planar structure, the method comprising:
randomly selecting a data subset from the point cloud data in the game scene;
Estimating model parameters through a least square method according to the data subset;
And according to the estimated model parameters, calculating the distance between each data point and the estimated plane, regarding the points with the space distance smaller than the preset threshold value as belonging to the plane structure, and aggregating the point cloud data on the identified plane structure to form a plane candidate set.
Further, using point cloud data in a game scene, grouping and gathering points in the point cloud data according to the spatial proximity and attribute similarity characteristics of the point cloud data to form different plane clusters, including:
for each planar structure in the planar candidate set, creating an empty planar cluster for storing point cloud data corresponding to the planar structure;
Traversing each point in the point cloud data, and calculating the space distance between each point and each plane structure in the plane candidate set;
Setting a distance threshold, regarding the points with the space distance less than the distance threshold as being adjacent to the plane structure space, and adding the corresponding points into the corresponding plane clusters;
for each point added into the planar cluster, calculating the attribute similarity between the point and the rest points in the cluster;
If the attribute of the point is similar to the attribute of the rest points in the cluster, the corresponding point is reserved in the plane cluster; otherwise, removing or marking the corresponding point from the plane cluster as an abnormal point;
After the plane cluster is formed preliminarily, gathering points which are adjacent in space and similar in attribute through a clustering algorithm to form the plane cluster;
and merging the plane clusters according to the space distance, the angle difference and the attribute similarity between the plane clusters to obtain a plane cluster set.
Further, calculating the distribution density of the point cloud for each planar cluster, and comparing the distribution density of the point cloud with the distribution density of the point cloud in the planar candidate set to obtain a density comparison result, including:
Traversing all point clouds in the current plane cluster, and calculating the quantity of all point clouds in the current plane cluster;
calculating the coverage area of the current plane cluster according to the number of all point clouds in the current plane cluster;
Dividing the number of all the point clouds in the current plane cluster by the area covered by the current plane cluster to obtain the point cloud distribution density of the current plane cluster;
Traversing all the point clouds in the plane candidate set, and calculating the total point cloud quantity in the plane candidate set;
calculating the total area covered by the whole candidate set according to the total point cloud quantity in the plane candidate set;
dividing the total point cloud quantity in the plane candidate set by the total area covered by the whole candidate set to obtain the average point cloud distribution density in the plane candidate set;
and comparing the distribution density of the point clouds of the current plane cluster with the average distribution density of the point clouds in the plane candidate set to obtain a density comparison result.
Further, determining a dynamic influence factor according to the density comparison result, and dynamically adjusting the plane cluster according to the dynamic influence factor to generate a plane segmentation result, including:
according to the point cloud distribution density of the current plane cluster and the average point cloud distribution density in the plane candidate set, the method comprises the following steps:
Calculating a dynamic impact factor, wherein/( Representing the dynamic influence factor of the ith plane cluster, N i is the number of points in plane cluster i,/>Is the normal vector of the j-th point in the plane cluster i,/>Is the average of the normal vectors of all points in the plane cluster i,/>Is the variance of the normal vector in the plane cluster i, M i is the number of points in the plane cluster i,/>Is the color value of the j-th point in the plane cluster i,Is the average of the color values of all points in the plane cluster i,/>And/>Is an adjustment coefficient,/>Representing the point cloud distribution density of the ith plane cluster,/>Representing the average point cloud distribution density inside the plane candidate set,/>Is an adjustment coefficient, i and j represent indexes;
According to the dynamic influence factor, the method comprises the following steps:
dynamically adjusting each plane cluster to generate a threshold value after the plane cluster adjustment, wherein L i is the number of points in the plane cluster i,/> Is the size of the j-th point in the plane cluster i,/>Is the average of the sizes of all points in the planar cluster i,/>Is a standardized function,/>Represents the/>The weight of the individual geometry is determined,Is the threshold value after the i-th plane cluster is adjusted,/>Representing the original threshold value,/>Representing the number of statistical properties,/>Representing an iteration variable;
re-evaluating attribution of point clouds in the plane cluster according to the threshold value after the plane cluster is adjusted so as to obtain a re-evaluation result;
and carrying out plane segmentation on the whole point cloud data according to the re-evaluation result, and generating a final plane segmentation result.
Further, extracting the contour line of each building according to the planar segmentation result includes:
According to the final plane segmentation result, determining points positioned at the plane edge by analyzing the distribution condition of point clouds in the plane cluster;
the points of the planar edges are connected to form the contour of the building based on the points of the planar edges.
Further, analyzing the geometric shape change on the contour line to decompose the contour line of the building into a plurality of independent line segments, comprising:
Analyzing points on the contour of the building to identify analysis results of the geometric shape changes;
determining a division point on the contour line according to the analysis result of the geometric shape change, wherein the division point corresponds to the position of the geometric feature change;
Using the segmentation points, the contour of the building is decomposed into a plurality of individual line segments, wherein each line segment represents a relatively geometrically consistent portion of the contour.
In a second aspect, a generating system for automatically constructing a 3D model includes:
The acquisition module is used for acquiring model parameters of the game building, wherein the model parameters are used for primarily identifying the plane structure of the building from a complex game environment and generating a plane candidate set according to the plane structure; utilizing point cloud data in a game scene, and grouping and gathering points in the point cloud data according to the spatial proximity and attribute similarity characteristics of the point cloud data to form a plane cluster corresponding to the plane candidate set; calculating the distribution density of the point cloud for each plane cluster respectively, and comparing the distribution density with the distribution density of the point cloud in the plane candidate set to obtain a density comparison result;
the processing module is used for determining a dynamic influence factor according to the density comparison result, and dynamically adjusting the plane cluster according to the dynamic influence factor so as to generate a plane segmentation result; extracting contour lines of each building according to the plane segmentation result; analyzing the geometric shape change on the contour line to decompose the contour line of the building into a plurality of independent line segments; selecting and marking key points according to each independent line segment and specific geometric characteristics; and carrying out triangulation processing on the key points to generate the three-dimensional game building model.
In a third aspect, a computing device includes:
one or more processors;
And a storage means for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the method.
In a fourth aspect, a computer readable storage medium has a program stored therein, which when executed by a processor, implements the method.
The above scheme of the invention at least comprises the following beneficial effects.
By iteratively selecting the data subset pre-estimated model parameters, the invention can more accurately identify potential plane structures from noise background. The space adjacency and attribute similarity characteristics of the point cloud data are utilized for grouping and gathering, so that different plane structures are effectively distinguished, and the accuracy and effect of point cloud grouping are improved. By analyzing the geometric shape change of the contour line, the invention can more accurately decompose the contour line of the building into a plurality of independent line segments, thereby improving the precision and detail expression capability of the final model.
Drawings
Fig. 1 is a schematic flow chart of a generating method for automatically constructing a 3D model according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of a generating system for automatically constructing a 3D model according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, an embodiment of the present invention proposes a generating method for automatically constructing a 3D model, the method including the steps of:
step 11, obtaining model parameters of a game building, wherein the model parameters are used for primarily identifying a planar structure of the building from a complex game environment and generating a planar candidate set according to the planar structure;
Step 12, utilizing point cloud data in a game scene, and grouping and gathering points in the point cloud data according to the spatial proximity and attribute similarity characteristics of the point cloud data so as to form a plane cluster corresponding to the plane candidate set;
Step 13, calculating the distribution density of the point cloud for each plane cluster respectively, and comparing the distribution density with the distribution density of the point cloud in the plane candidate set to obtain a density comparison result;
Step 14, determining a dynamic influence factor according to the density comparison result, and dynamically adjusting the plane cluster according to the dynamic influence factor to generate a plane segmentation result;
step 15, extracting the contour lines of each building according to the plane segmentation result;
step 16, analyzing the geometric shape change on the contour line to decompose the contour line of the building into a plurality of independent line segments;
Step 17, selecting and marking key points according to each independent line segment and specific geometric characteristics;
and step 18, triangulating the key points to generate a three-dimensional game building model.
In the embodiment of the invention, step 11 can rapidly screen out the key part of the data, thereby efficiently and preliminarily identifying the potential plane structure in the noise background. This greatly improves the accuracy and efficiency of planar structure recognition. In step 12, by grouping and aggregating the point cloud data by using the spatial proximity and attribute similarity features of the point cloud data, the point cloud data can be precisely divided into planar clusters corresponding to the planar candidate sets. And 13, calculating the distribution density of the point clouds of each plane cluster, and comparing the distribution density with the distribution density of the point clouds in the plane candidate set to obtain a density comparison result, thereby being beneficial to identifying dense and sparse areas of the point cloud data. And step 14, determining a dynamic influence factor according to the density comparison result, and dynamically adjusting the plane cluster according to the factor. And 15, extracting the contour lines of the planes to clearly draw the appearance characteristics of the object. And step 16, analyzing the geometric shape change on the contour line, and decomposing the contour line of the building into a plurality of independent line segments, thereby being beneficial to describing the detail characteristics of the object more accurately and improving the fineness of the three-dimensional model. And step 17, selecting and marking key points according to each independent line segment and specific geometric characteristics, so as to help maintain the geometric shape and detail characteristics of the model. And 18, generating a three-dimensional game building model by carrying out triangulation on the key points, and constructing the three-dimensional shape of the object efficiently, wherein the generated model has higher fidelity and detail expressive force.
In a preferred embodiment of the present invention, the step 11 may include:
step 111, randomly selecting a data subset from point cloud data in a game scene;
112, estimating model parameters through a least square method according to the data subset;
step 113, according to the estimated model parameters, calculating the distance between each data point and the estimated plane, regarding the points with the spatial distance smaller than the preset threshold value as belonging to the plane structure, and aggregating the point cloud data on the identified plane structure to form a plane candidate set.
In the embodiment of the present invention, step 111 helps to reduce the computational complexity, improve the processing efficiency, and also maintain the diversity of data. Secondly, step 112 predicts model parameters according to the selected data subset by a least square method, so that the model parameters can be estimated effectively, and the predicted planar structure is more accurate and reliable. Finally, step 113 regards the points with the spatial distance smaller than the preset threshold value as belonging to the planar structure by calculating the distance between each data point and the estimated plane according to the estimated model parameters, so that the potential planar structure can be accurately identified, and the point cloud data on the structures are aggregated to form a plane candidate set, thereby improving the accuracy of planar structure identification. In summary, the processing efficiency and the data diversity are improved by randomly selecting the data subsets; the model parameters are estimated by using a least square method, so that the accuracy of planar structure identification is improved; and the plane structure is accurately identified through distance calculation, so that the efficiency and accuracy of the whole 3D model construction process are improved.
In another preferred embodiment of the present invention, in step 111, the point cloud data in the game scene refers to a set of a large number of points acquired by a measuring device (such as a laser radar, a three-dimensional scanner or a stereo camera, etc.) in a three-dimensional space, each point contains its coordinates (X, Y, Z) in the three-dimensional space, and the whole point cloud data is assumed to contain N points, each point is denoted as P i= (xi,yi,zi, where (i=1, 2, …, N), a subset size M (M < N) is set, and M points are randomly selected from the N points using a random number generator to constitute a data subset. Step 112, for the planar model, using point-normal representation of the planar equation: (ax+by+cz+d=0), wherein A, B, C is the normal vector to the plane, D is the distance of the plane from the origin; the least squares method is used to fit the planar model, specifically by solving a system of linear equations consisting of the points in the subset of data and the planar equations to minimize the sum of the squares of the distances of all data points to the plane, and solving this system of linear equations to obtain the estimated model parameters A, B, C and D. Step 113), for each point P i= (xi,yi,zi in the point cloud data, calculating its distance to the estimated plane, where the calculation formula of this distance is:
A preset threshold (e.g., δ) is set, and if the distance d i from a point P i to the plane is less than δ, the point is considered to belong to the plane structure, and all the points belonging to the plane structure are aggregated to form a plane candidate set.
For example, assuming that the overall point cloud data has 1000 points, it is desirable to randomly select a subset of 200 points. 200 non-repeating random numbers are obtained by a random number generator, and the random numbers correspond to indexes in the whole point cloud data, so that a data subset containing 200 points is obtained. For the 200 point subset of data selected in step 111, a least squares method is used to fit a plane equation. By solving the linear equation set, the estimated model parameters a=1.5, b= -2.3, c=0.8, d=4.2 are obtained, which means that the estimated plane equation is 1.5 x-2.3y+0.8z+4.2=0. For each point in the overall point cloud data, its distance to the estimated plane (1.5 x-2.3y+0.8z+4.2=0) is calculated. A preset threshold δ=0.1 is set and a point is added to the plane candidate set if the distance from the point to the plane is less than 0.1. Finally, a planar candidate set is obtained comprising a plurality of points which are considered to belong to the same potential planar structure.
In a preferred embodiment of the present invention, the step 12 may include:
Step 121, for each planar structure in the planar candidate set, creating an empty planar cluster for storing point cloud data corresponding to the planar structure;
step 122, traversing each point in the point cloud data, and calculating the spatial distance between each point and each plane structure in the plane candidate set;
Step 123, a distance threshold is set, the points with the space distance less than the distance threshold are regarded as being adjacent to the plane structure space, and the corresponding points are added into the corresponding plane clusters;
Step 124, for each point added to the planar cluster, calculating the attribute similarity between the point and the rest points in the cluster;
Step 125, if the attribute of the point is similar to the attribute of the rest points in the cluster, reserving the corresponding point in the plane cluster; otherwise, removing or marking the corresponding point from the plane cluster as an abnormal point;
Step 126, after the plane cluster is formed preliminarily, the points which are adjacent in space and have similar attributes are gathered through a clustering algorithm to form the plane cluster;
and step 127, merging the plane clusters according to the spatial distance, the angle difference and the attribute similarity between the plane clusters to obtain a plane cluster set.
In another preferred embodiment of the present invention, step 12 enables more accurate classification of point cloud data by creating separate planar clusters for each identified planar structure. By calculating the spatial distance between the point and the planar structure and setting the distance threshold, step 12 can filter out points that are not related or distant from the planar structure, thereby improving the quality and accuracy of the data. In addition to spatial distance, step 12 includes similarity of the properties of the points, which helps to further refine the planar clusters, and ensures that the points within the clusters are not only spatially similar, but also similar in properties, thereby improving data consistency and reliability. By comparing the similarity of the attributes of the points to the rest of the points in the cluster, step 12 is able to effectively detect outliers that may not be consistent with other points for various reasons (e.g., measurement errors, data contamination, etc.). Removing or marking these points as anomalies from the planar cluster helps to promote the accuracy of subsequent analysis. After the preliminary formation of the planar clusters, the cluster formation can be further optimized using a clustering algorithm. This helps to more closely group together spatially adjacent and similarly-attributed points, forming a more precise planar cluster. Finally, by merging the planar clusters in consideration of spatial distance, angular differences, and attribute similarity between the planar clusters, a more compact and compact collection of planar clusters can be obtained. This not only reduces redundancy of data, but also facilitates understanding and analyzing the structure of point cloud data from a higher level.
In another preferred embodiment of the present invention, the step 121 may include, for each planar structure in the candidate set of planes, initializing an empty list or set as a cluster of planes for the planar structure. Step 122, traversing each point P in the point cloud data, and for each planar structure, calculating a distance from the point P to the plane, where a specific distance formula is as follows:
Wherein A, B, C, D are parameters of the plane, and x, y, z are coordinates of the point. Step 123, a distance threshold delta is set, and if the distance between the point P and a certain plane is smaller than delta, the point P is added into the plane cluster corresponding to the plane. Step 124, determining attributes to be used for calculating the similarity, which may be color, density, texture features, etc., for the point cloud data, the attributes including RGB color values, reflection intensity, normal direction, etc. of the points, normalizing the attributes, for example, if the attributes are colors, the RGB values typically need to be normalized to within the [0,1] range; by means of selected attributes
Calculating the color similarity between two points, and for each point in the planar cluster, calculating the similarity between the planar cluster and all other points in the cluster, wherein/>Is the total amount of color difference, representing the degree of visual difference of two colors, for quantifying the perceived difference between the two colors,/>Representing the difference in luminance of two colors in the CIELAB color space,/>The luminance component representing the color, in CIELAB, is a luminance value related to visual perception,/>And/>Respectively represent the chromaticity difference of two colors in CIELAB color space,/>And/>Is chromaticity coordinates describing hue and saturation information of the color, respectively,/>Positive values represent red and negative values represent green; /(I)Positive values represent yellow, negative values represent blue, and k L,ka and k b are adjustment coefficients; s L,Sa and S b are weight functions, wherein:
;/>;/> Wherein/> Is the chromaticity value of the color, calculated by the following formula:
Step 125, for each point in the planar cluster, calculating the average similarity between the point and other points in the cluster, and when the average similarity of a point is lower than a set threshold value, considering that the point is not similar enough to other points in the cluster, so that the point should be removed from the planar cluster or marked as an abnormal point; after the outlier is removed or marked, the member list of the planar cluster is updated to ensure that only points sufficiently similar to other points within the cluster are included. Step 126, determining the number of clusters to be formed, K2 points are randomly selected as initial cluster centers (also called centroids), for each point in the point cloud data, calculating its distance from each cluster center, assigning each point to its nearest cluster center to form K2 clusters, for each cluster, calculating the average value of all data points therein, the new cluster center being this average value, repeating the steps until a certain stop condition is met, outputting K2 clusters and their corresponding cluster centers, each cluster including a set of spatially adjacent and similar-attribute points. Step 127, according to the spatial distance, the angle difference and the attribute similarity, it may be determined which plane clusters should be merged, when merging, all points in two plane clusters are merged into a new plane cluster, and the center point, the normal vector and the attribute of the new plane cluster are recalculated, after merging is completed, the spatial distance, the angle difference and the attribute similarity between the remaining plane clusters need to be recalculated and checked to determine whether further merging is required, and this process may be iterated until no more plane clusters need to be merged, and finally, a merged plane cluster set is obtained, where each plane cluster represents an actually existing, spatially continuous and similar plane area.
For example, the point cloud data originates from a 3D scan of an indoor environment, including walls, floors, ceilings, furniture, and the like. The goal is to identify and segment out the primary planar structures (walls, floors, ceilings) and ignore or as secondary treatment furniture and other non-primary planar objects. Step 121, for each main plane (wall, floor, ceiling) of the indoor environment, initializing an empty list as a candidate set of plane clusters. Step 122, traversing each point P in the point cloud data, for each planar structure (assuming that the plane equation of the wall surface is ax+by+Cz+D=0, calculating the distance D i from the point P to the plane, step 123, setting a distance threshold delta (such as 5 cm), if the distance from the point P to a certain plane is smaller than delta, adding the point P to a plane cluster corresponding to the plane, step 124, assuming that the color attribute is concerned, normalizing the RGB color values of the points in the point cloud data, and then calculating the color similarity of the point P and all other points in the cluster for each point in the plane cluster.
In step 125, the average color similarity of each point to other points in the planar cluster is calculated, and points below a certain threshold are considered insufficiently similar, and are therefore removed from the planar cluster or marked as anomalies. Step 126, determining the number of clusters to be formed, K, (assuming that 3 main planes: wall, floor, ceiling are to be segmented), randomly selecting K points as initial cluster centers, then iteratively assigning points to the nearest cluster centers, and updating the cluster centers until a stop condition is met. Step 127, merging the plane clusters that should be merged according to the spatial distance, the angle difference and the attribute similarity. For example, if two planar clusters represent different portions of the same wall, they will be merged. The center point, normal vector and attribute of the combined plane cluster are recalculated.
Three main planar clusters are successfully identified and segmented through the steps: floors, walls and ceilings. In steps 121 to 125, clusters corresponding to these planes are initially formed by calculating the point-to-plane distances and color similarities. Next, in step 126, the clusters are further refined by a clustering algorithm, and the center of each cluster is determined. Finally, in step 127, the relationship between these planar clusters is examined, and it is found that the two smaller clusters actually belong to different parts of the same wall, thus merging them into one cluster, ultimately forming a clear, continuous wall planar cluster. By the case, the whole process of identifying and dividing the plane structure from the point cloud data can be seen to be gradually carried out, each step is based on the geometric and attribute analysis of the point cloud data, and the effective division and combination of the plane clusters are finally realized.
In a preferred embodiment of the present invention, the step 13 may include:
Step 131, traversing all point clouds in the current plane cluster, and calculating the quantity of all point clouds in the current plane cluster;
step 132, calculating the coverage area of the current plane cluster according to the number of all point clouds in the current plane cluster;
Step 133, dividing the number of all the point clouds in the current plane cluster by the area covered by the current plane cluster to obtain the point cloud distribution density of the current plane cluster;
step 134, traversing all point clouds in the plane candidate set, and calculating the total number of point clouds in the plane candidate set;
Step 135, calculating the total area covered by the whole candidate set according to the total point cloud quantity in the plane candidate set;
step 136, dividing the total point cloud quantity in the plane candidate set by the total area covered by the whole candidate set to obtain the average point cloud distribution density in the plane candidate set;
and step 137, comparing the point cloud distribution density of the current plane cluster with the average point cloud distribution density in the plane candidate set to obtain a density comparison result.
In the embodiment of the invention, the distribution condition of the point cloud data in different areas can be more accurately known by calculating the point cloud distribution density of each plane cluster and the average point cloud distribution density of the whole plane candidate set. The distribution density of the solution point cloud helps to optimize the data processing strategy. For example, finer processing may be used in areas of higher density, while coarser processing may be used in areas of lower density, thereby improving overall processing efficiency. By comparing the distribution density of the point clouds of different planar clusters with the average density, areas of abnormally high density or areas of abnormally low density, which may represent noise, outliers or missing portions in the data, can be easily identified, based on which targeted filtering or repair operations can be performed. In the point cloud data processing, the point cloud is often required to be downsampled or upsampled, and a more reasonable sampling strategy can be formulated by solving the distribution density of the point cloud, so that the sampled point cloud data can still keep the original space structure and characteristics. In the tasks such as three-dimensional reconstruction or object recognition, the distribution density of the point cloud directly influences the precision of the model. By comparing and analyzing the point cloud densities of different areas, more priori information can be provided for model training, so that the accuracy and the robustness of the model are improved.
In another preferred embodiment of the present invention, step 131, a planar cluster is selected, and each point is counted by traversing all the point cloud data in the planar cluster, so as to determine the number of point clouds contained in the planar cluster. Step 132, calculating a two-dimensional area covered by the planar cluster, which specifically includes: assuming that the vertices of the convex hull are (x 1,y1),(x2,y2),…,(xn,yn) in order, where n is the number of vertices of the convex hull and the nth vertex is connected to the first vertex, the convex hull area a is calculated by the following formula:
Wherein A represents the area of the convex hull, x i and y i represent the x and y coordinates of the ith vertex, And/>The coordinates of the (i+1) th vertex are shown, x n and y n are the x and y coordinates, respectively, of the last vertex of the polygon, which is closed, so that the last vertex is connected by an edge to the first vertex x 1 and y 1, and x 1 and y 1 are the coordinates of the first vertex of the polygon. Step 133, dividing the number of the point clouds obtained in step 131 by the area estimated in step 132 to obtain the distribution density of the point clouds, i.e. the number of the point clouds in a unit area. Step 134, obtaining the total point cloud number in the whole candidate set by traversing all the plane clusters and accumulating the point cloud number. In step 135, the area covered by the entire planar candidate set is estimated by summing the areas of the plurality of planar clusters. Step 136, dividing the total point cloud number obtained in step 134 by the total area calculated in step 135 to obtain the average point cloud distribution density of the plane candidate set. In step 137, the point cloud distribution density of the current planar cluster calculated in step 133 is compared with the average density obtained in step 136, and this comparison may help identify areas having densities above or below the average level.
For example, assume that there is one plane candidate set containing three plane clusters (A, B, C); in step 131, the plane cluster a contains 100 point clouds, the plane cluster B contains 150 point clouds, and the plane cluster C contains 200 point clouds. Step 132, assuming that the area of the planar cluster a is 10 square meters, the area of the planar cluster B is 15 square meters, and the area of the planar cluster C is 25 square meters, calculated by the convex hull algorithm. In step 133, the point cloud distribution density of the plane cluster a is 100 points/10 square meters=10 points/square meters, the point cloud distribution density of the plane cluster B is 150 points/15 square meters=10 points/square meters, and the point cloud distribution density of the plane cluster C is 200 points/25 square meters=8 points/square meters. Step 134, the total number of point clouds in the entire planar candidate set is 100+150+200=450 points, step 135, assuming that the convex hull area of the entire candidate set is 50 square meters. In step 136, the average point cloud distribution density is 450 points/50 square meters = 9 points/square meter. In step 137, the distribution density of the point cloud of each planar cluster is compared with the average density, and it is found that the densities of the planar clusters a and B are higher than the average level, and the density of the planar cluster C is lower than the average level.
In a preferred embodiment of the present invention, the step 14 may include:
Step 141, according to the point cloud distribution density of the current plane cluster and the average point cloud distribution density in the plane candidate set, passing:
Calculating a dynamic impact factor, wherein/( Representing the dynamic influence factor of the ith plane cluster, N i is the number of points in plane cluster i,/>Is the normal vector of the j-th point in the plane cluster i,/>Is the average of the normal vectors of all points in the plane cluster i,/>Is the variance of the normal vector in the plane cluster i, M i is the number of points in the plane cluster i,/>Is the color value of the j-th point in the plane cluster i,Is the average of the color values of all points in the plane cluster i,/>And/>Is an adjustment coefficient,/>Representing the point cloud distribution density of the ith plane cluster,/>Representing the average point cloud distribution density inside the plane candidate set,/>Is an adjustment coefficient, i and j represent indexes;
step 142, according to the dynamic influence factor, by:
dynamically adjusting each plane cluster to generate a threshold value after the plane cluster adjustment, wherein L i is the number of points in the plane cluster i,/> Is the size of the j-th point in the plane cluster i,/>Is the average of the sizes of all points in the planar cluster i,/>Is a standardized function,/>Represents the/>The weight of the individual geometry is determined,Is the threshold value after the i-th plane cluster is adjusted,/>Representing the original threshold value,/>Representing the number of statistical properties,/>Representing an iteration variable;
step 143, re-evaluating attribution of point clouds in the plane cluster according to the adjusted threshold value of the plane cluster to obtain a re-evaluation result;
and 144, carrying out plane segmentation on the whole point cloud data according to the re-evaluation result, and generating a final plane segmentation result.
In the embodiment of the invention, the threshold value of each plane cluster can be dynamically adjusted by calculating the dynamic influence factor, and the dynamic adjustment can lead the algorithm to be more flexible and adapt to different distribution densities and characteristics of point clouds, thereby improving the accuracy and the robustness of plane segmentation. The calculation of the dynamic influence factors comprehensively considers various factors such as the distribution density of the point cloud, the distribution of normal vectors, the distribution of color values and the like, and the comprehensive consideration makes the algorithm more effective in processing complex and diversified point cloud data. By re-evaluating the attribution of the point cloud in the plane cluster, possible errors in the initial segmentation can be corrected, and the precision of the plane segmentation is further improved. The method can optimize the resource allocation of the algorithm by dynamically adjusting the threshold value, and concentrate more calculation resources in the areas with higher point cloud density and more complex characteristics, so that the overall efficiency and performance of the algorithm are improved.
The point cloud data of an indoor scene is assumed to comprise a plurality of plane clusters such as floors, walls, furniture and the like. Step 141, first, a dynamic impact factor of each planar cluster is calculated. For example, for a ground plane cluster, since its point cloud distribution density is high, the normal vector and the color value distribution are relatively concentrated, and thus its dynamic influence factor value may be high. Whereas for wall plane clusters containing complex textures or colors, their dynamic impact factor values may be relatively low due to the dispersion of normal vectors and color values. In step 142, the threshold value of each planar cluster is then adjusted according to the dynamic influence factor value, and the threshold value of the planar cluster may be increased due to the high dynamic influence factor value, so that more point clouds can be included, and the threshold value of the planar cluster may be decreased to exclude those point clouds that do not match the main body characteristics. After the threshold is adjusted, the attribution of each point cloud is re-evaluated, for example, the point cloud originally misjudged as a wall, which may now be reclassified as a floor due to the increase of the threshold of the floor. And 144, finally, carrying out plane segmentation on the whole point cloud data according to the reevaluated point cloud attribution. The division of the floor and the wall is now more accurate and does not contain any more false point clouds of each other, resulting in a more accurate planar division result.
In step 143, the method may further include:
For each point cloud, calculating the vertical distance from the point cloud to the plane cluster fitting plane, comparing the distances with the adjusted threshold, and if the distance from the point cloud to a certain plane cluster is smaller than the adjusted threshold of the plane cluster, the point cloud possibly belongs to the plane cluster. If the normal direction of the point cloud is similar to the normal direction of a certain plane cluster (can be judged within a certain angle threshold), the probability that the point cloud belongs to the certain plane cluster is increased. If the point cloud data contains color or intensity information, the information can also be used for attribution judgment, the color or intensity of the point cloud is compared with the average color or intensity of the plane cluster, and if the color or intensity of the point cloud is similar to the average color or intensity of the plane cluster, the possibility that the point cloud belongs to the plane cluster is increased; taking the factors of distance measurement, normal line consistency, color or intensity consistency and the like into comprehensive consideration, a certain weight can be allocated to each factor, and then a comprehensive score is calculated to judge which plane cluster the point cloud most possibly belongs to, wherein the method specifically comprises the following steps: weights are respectively set for three factors of distance measurement, normal line consistency and color or intensity consistency, and reflect the importance of each factor in judging point cloud attribution. The sum of the weights should be 1. For example:
The weight (Wd) of the distance measure is 0.5;
the weight (Wn) of the normal line consistency is 0.3;
A weight (Wc) of color or intensity uniformity of 0.2;
For each factor, its metric value is converted to a normalized score for comparison and weighted summation. The normalized score is typically between 0 and 1, where 0 represents a complete mismatch and 1 represents a complete match; a distance metric score (Sd) is calculated using the ratio of the distance of the point cloud to the planar cluster to a threshold. For example, if the distance is less than half of the threshold, the score is 1; if the distance is equal to the threshold, a score of 0; the intermediate value is linearly interpolated.
And calculating an included angle between the point cloud normal and the plane cluster normal, and converting the included angle into a score to obtain a normal consistency score (Sn). For example, if the included angle is less than a certain small angle (e.g., 5 degrees), the score is 1; if the included angle is larger than a certain large angle (such as 30 degrees), the score is 0; the intermediate angle is linearly interpolated.
A color or intensity consistency score (Sc) is calculated by comparing the color or intensity value of the point cloud with the average color or intensity value of the planar clusters. For example, if the two are identical, the score is 1; if the difference exceeds a certain threshold, the score is 0; the intermediate difference is then linearly interpolated. Finally, a composite score (Stotal) is calculated using the following formula, where stotal=wd×sd+wn×sn+wc×sc; for each plane cluster, a composite score can be calculated, and then the plane cluster with the highest score is selected as the attribution of the point cloud.
For example, assume that there is a point cloud P that would have been misinterpreted as part of a wall. At the time of reevaluation, distances from the point P to the floor and the wall are calculated, the distances are compared with respective adjusted thresholds, the similarity between the normal direction of the point P and the normal direction of the floor and the wall is compared, if the point cloud data contains color information, the color of the point P is also compared with the average color of the floor and the wall, and if the distance from the point P to the floor is smaller than the threshold, and the normal direction and the color are more consistent with the floor, the point P is reclassified as a part of the floor.
In a preferred embodiment of the present invention, the step 15 may include:
step 151, determining points located at the edge of the plane by analyzing the distribution condition of point clouds in the plane cluster according to the final plane segmentation result;
Step 152, connecting the points of the planar edges to form the contour of the building based on the points of the planar edges.
In the embodiment of the present invention, step 151, after obtaining the final planar segmentation result, analyzes the distribution situation of the point cloud in each planar cluster, and identifies the points located at the edges of the plane by comparing the density, the position or other relevant features of the point cloud, where the points have some common features, such as points on the boundary line between a certain planar cluster and other planar clusters or the background. Accurately identifying points of a plane edge helps define the boundaries of the plane more accurately. Step 152, obtaining a set of points located at the plane edge from step 151, wherein the points are candidate points of the plane edge, and constructing a convex hull by using the set of points; the method comprises the steps of obtaining the point with the minimum ordinate as a starting point, sequencing all points according to the polar angle of the starting point by photographing, sequentially processing the sequenced points, determining whether to add the point into the convex hull by judging the relation between the point and the constructed convex hull, gradually connecting edge points to form the boundary of the convex hull, and therefore ensuring that all the points are positioned in the convex hull or on the boundary of the convex hull, wherein a line segment between any two adjacent vertexes on the convex hull is positioned in the convex hull, and no point is positioned outside the line segment. Finally, a convex hull formed by edge points is obtained, the convex hull is the outer contour of the plane, the convex hull can be displayed in a graphical mode, and the contour lines can clearly display the shape and the boundary of the plane, so that the structure and the characteristics of the plane can be more intuitively understood.
For example, assuming an item being subjected to an indoor 3D reconstruction, point cloud data is required to identify and reconstruct various planes (e.g., walls, floors, etc.) within the room. After the planar segmentation is completed, an accurate profile of each plane is desired to facilitate subsequent three-dimensional modeling. Firstly, the laser radar equipment is used for comprehensively scanning an office, point cloud data of the office are obtained, and the collected point cloud data are preprocessed, including noise removal, missing data filling and the like, so that accuracy and integrity of the data are ensured.
Carrying out plane segmentation on the preprocessed point cloud data by using a region growing algorithm, and obtaining different plane clusters such as walls, floors, ceilings and the like after segmentation; after the plane segmentation result is obtained, the distribution condition of point clouds in each plane cluster is further analyzed. By comparing the characteristics of the point cloud density, the position and the like, the points positioned at the edges of the respective planes are successfully identified. The points are located at the junctions of different planar clusters and have obvious demarcation characteristics. To obtain the outer contour of the plane, first, the point with the smallest ordinate is selected from the edge point set as the starting point, and all the points are ordered in terms of polar angle with respect to the starting point. And then sequentially processing the ordered points, and determining whether to add the points to the convex hull by judging the relation between the points and the constructed convex hull. Finally, a compact convex polygon is formed, which is the outer contour of the plane, and based on the obtained convex hull contour, a three-dimensional model is easily constructed by using 3D modeling software.
In a preferred embodiment of the present invention, the step 16 may include:
step 161, analyzing points on the contour of the building to identify analysis results of the geometric shape change;
Step 162, determining a division point on the contour line according to the analysis result of the geometric shape change, wherein the division point corresponds to the position where the geometric feature changes;
Step 163, using the segmentation points, decomposing the contour of the building into a plurality of independent line segments, wherein each line segment represents a portion of the contour that is relatively geometrically uniform.
In the embodiment of the present invention, step 161, firstly, the continuous contour line generated in step 15 is obtained, then, each point on the contour line is sequentially checked, geometric features such as curvature, angle change and the like are analyzed, and the change of the geometric shape is identified by comparing the position relationship, distance, angle and the like between the adjacent points. This step helps to understand the specific shape and orientation of the contour, and through detailed analysis of the points, fine changes in the contour can be more accurately captured.
Step 162, based on the analysis result in step 161, determines those positions where the geometric features have changed significantly, such as abrupt changes in curvature, sharp changes in angle, etc., are defined as dividing points, which are actually junctions between regions of different geometric features on the contour. The determination of the segmentation points helps to decompose complex contour lines into simpler geometric elements.
Step 163, using the segmentation points determined in step 162, cuts the contour of the building into a plurality of portions, each portion (i.e., line segment) representing a segment of relatively uniform geometry on the contour, which may be further used for shape description, matching, and recognition tasks. By decomposition, the complex contour line is simplified into a plurality of line segments which are easy to process, which greatly reduces the complexity of subsequent processing and helps to improve the accuracy of shape recognition and classification.
For example, when scanning an interior or exterior wall of a building using 3D scanning techniques, the resulting point cloud data may include the contours of a plurality of wall panels. To automatically identify and segment these wallboards for subsequent modeling and analysis, the process described above in step 16 is employed. Firstly, point cloud data of a building wall surface are obtained through a 3D scanning technology, and continuous contour lines of the wall surface are obtained through plane segmentation and edge detection. A detailed analysis of each point on the contour line, focusing particularly on points that may be wallboard edges or intersections, can initially identify junctions or corners between wallboards by analyzing the position, curvature, and relationship between adjacent points. On the basis of the analysis, the points at which the geometric characteristics change significantly are determined to be the splitting points, which are typically edges of the wall panels, corners of the wall, or joints between different wall panels. Using the determined division points, the continuous wall contour is broken down into a plurality of individual line segments, each representing a wall panel or a part of a wall surface, in such a way that different wall panels can be clearly distinguished. According to the method, accurate partition of the wallboard can be obtained rapidly, the working efficiency is greatly improved, and partitioned wallboard data can be directly imported into 3D modeling software to perform more accurate modeling and design.
In another preferred embodiment of the present invention, the step 17 may include: first, each individual line segment decomposed in step 16 is determined. Then, according to the geometric characteristics (such as length, curvature, direction, etc.) of each line segment, key points are selected, wherein the key points are the end points, inflection points, points with maximum or minimum curvature, etc. of the line segment, and the key points are marked and stored for subsequent processing. The selection of key points helps capture the main features of the line segment, and by reducing the number of data points, the efficiency of subsequent processing can be improved while retaining sufficient information to reconstruct the geometry.
Step 18, reading the coordinates of all marked key points from the result of step 17, wherein the key points may comprise end points, intersection points, curvature change points and the like of line segments, and the key points have definite position information (x, y, z coordinates) in a three-dimensional space; the key points are used as input, a Delaunay triangulation method is operated, and an optimal triangle connection mode is calculated according to the spatial relationship among the points of the Delaunay triangulation method; the Delaunay triangle splitting method outputs a series of triangles which are connected to each other to form a continuous mesh structure, each triangle being defined by three key points, and the sides of the triangle sharing the sides of adjacent triangles, thereby forming a complete mesh, inspecting the resulting mesh to ensure that there are no errors or anomalies, such as overlapping triangles, unconnected areas, etc. Using three-dimensional modeling software or a graphics library, a three-dimensional model with a mesh structure is generated from the constructed triangular mesh, the model is composed of vertices (i.e., key points) and triangular patches connecting the vertices, textures, colors or other attributes can be added to the model to enhance its visual effect and realism, and the three-dimensional model is saved as a common 3D file format (e.g., obj, stl, etc.) for subsequent use and analysis.
The invention can convert discrete key points into a continuous three-dimensional grid structure through triangulation, is convenient for visual display and subsequent analysis, and can generate a high-quality triangular grid by a Delaunay triangulation method, thereby maintaining the geometric shape and detail characteristics of the model.
For example, a building in a design scene for a game. By the previous steps, the contour lines of the building have been extracted from the point cloud data and the key points are marked. These keypoints now need to be translated into three-dimensional models for use by game engines. From step 17, a set of key points of the building is obtained, including feature points such as corners, edges of windows, door openings, etc. And carrying out triangulation on the key points by using a Delaunay triangulation algorithm, and automatically calculating an optimal triangle connection mode by using the algorithm to form a compact triangle grid. From the constructed triangular mesh, a three-dimensional model having a mesh structure is generated using a modeling tool of the game engine. The model retains the geometric features and details of the building, such as the shape of the window, the position of the door, etc. And importing the generated three-dimensional model into a game engine to perform scene building and testing. The model is well compatible with the game engine, can smoothly render and interact, and provides realistic visual experience for game players.
As shown in fig. 2, an embodiment of the present invention further provides a generating system 20 for automatically constructing a 3D model, including:
An obtaining module 21, configured to obtain model parameters of a game building, where the model parameters are used to primarily identify a planar structure of the building from a complex game environment, and generate a planar candidate set according to the planar structure; utilizing point cloud data in a game scene, and grouping and gathering points in the point cloud data according to the spatial proximity and attribute similarity characteristics of the point cloud data to form a plane cluster corresponding to the plane candidate set; calculating the distribution density of the point cloud for each plane cluster respectively, and comparing the distribution density with the distribution density of the point cloud in the plane candidate set to obtain a density comparison result;
The processing module 22 is configured to determine a dynamic impact factor according to the density comparison result, and dynamically adjust the plane cluster according to the dynamic impact factor to generate a plane segmentation result; extracting contour lines of each building according to the plane segmentation result; analyzing the geometric shape change on the contour line to decompose the contour line of the building into a plurality of independent line segments; selecting and marking key points according to each independent line segment and specific geometric characteristics; and carrying out triangulation processing on the key points to generate the three-dimensional game building model.
Optionally, obtaining model parameters of the game building, where the model parameters are used to primarily identify a planar structure of the building from a complex game environment, and generate a planar candidate set according to the planar structure, where the method includes:
randomly selecting a data subset from the point cloud data in the game scene;
Estimating model parameters through a least square method according to the data subset;
And according to the estimated model parameters, calculating the distance between each data point and the estimated plane, regarding the points with the space distance smaller than the preset threshold value as belonging to the plane structure, and aggregating the point cloud data on the identified plane structure to form a plane candidate set.
Optionally, using point cloud data in the game scene, grouping and aggregating points in the point cloud data according to the spatial proximity and the attribute similarity characteristics of the point cloud data to form different plane clusters, including:
for each planar structure in the planar candidate set, creating an empty planar cluster for storing point cloud data corresponding to the planar structure;
Traversing each point in the point cloud data, and calculating the space distance between each point and each plane structure in the plane candidate set;
Setting a distance threshold, regarding the points with the space distance less than the distance threshold as being adjacent to the plane structure space, and adding the corresponding points into the corresponding plane clusters;
for each point added into the planar cluster, calculating the attribute similarity between the point and the rest points in the cluster;
If the attribute of the point is similar to the attribute of the rest points in the cluster, the corresponding point is reserved in the plane cluster; otherwise, removing or marking the corresponding point from the plane cluster as an abnormal point;
After the plane cluster is formed preliminarily, gathering points which are adjacent in space and similar in attribute through a clustering algorithm to form the plane cluster;
and merging the plane clusters according to the space distance, the angle difference and the attribute similarity between the plane clusters to obtain a plane cluster set.
Optionally, calculating the distribution density of the point cloud for each planar cluster, and comparing the distribution density of the point cloud with the distribution density of the point cloud in the planar candidate set to obtain a density comparison result, including:
Traversing all point clouds in the current plane cluster, and calculating the quantity of all point clouds in the current plane cluster;
calculating the coverage area of the current plane cluster according to the number of all point clouds in the current plane cluster;
Dividing the number of all the point clouds in the current plane cluster by the area covered by the current plane cluster to obtain the point cloud distribution density of the current plane cluster;
Traversing all the point clouds in the plane candidate set, and calculating the total point cloud quantity in the plane candidate set;
calculating the total area covered by the whole candidate set according to the total point cloud quantity in the plane candidate set;
dividing the total point cloud quantity in the plane candidate set by the total area covered by the whole candidate set to obtain the average point cloud distribution density in the plane candidate set;
and comparing the distribution density of the point clouds of the current plane cluster with the average distribution density of the point clouds in the plane candidate set to obtain a density comparison result.
Optionally, determining a dynamic influence factor according to the density comparison result, and dynamically adjusting the plane cluster according to the dynamic influence factor to generate a plane segmentation result, including:
according to the point cloud distribution density of the current plane cluster and the average point cloud distribution density in the plane candidate set, the method comprises the following steps:
A dynamic impact factor is calculated, wherein, Representing the dynamic influence factor of the ith plane cluster, N i is the number of points in plane cluster i,/>Is the normal vector of the j-th point in the plane cluster i,/>Is the average of the normal vectors of all points in the plane cluster i,/>Is the variance of the normal vector in the plane cluster i, M i is the number of points in the plane cluster i,/>Is the color value of the j-th point in the plane cluster i,/>Is the average of the color values of all points in the plane cluster i,/>And/>Is an adjustment coefficient,/>Representing the point cloud distribution density of the ith plane cluster,/>Representing the average point cloud distribution density inside the plane candidate set,/>Is an adjustment coefficient, i and j represent indexes;
According to the dynamic influence factor, the method comprises the following steps:
dynamically adjusting each plane cluster to generate a threshold value after the plane cluster adjustment, wherein L i is the number of points in the plane cluster i,/> Is the size of the j-th point in the plane cluster i,/>Is the average of the sizes of all points in the planar cluster i,/>Is a standardized function,/>Represents the/>The weight of the individual geometry is determined,Is the threshold value after the i-th plane cluster is adjusted,/>Representing the original threshold value,/>Representing the number of statistical properties,/>Representing an iteration variable;
re-evaluating attribution of point clouds in the plane cluster according to the threshold value after the plane cluster is adjusted so as to obtain a re-evaluation result;
and carrying out plane segmentation on the whole point cloud data according to the re-evaluation result, and generating a final plane segmentation result.
Optionally, extracting the contour line of each building according to the planar segmentation result includes:
According to the final plane segmentation result, determining points positioned at the plane edge by analyzing the distribution condition of point clouds in the plane cluster;
the points of the planar edges are connected to form the contour of the building based on the points of the planar edges.
Optionally, analyzing the geometric change in the contour to decompose the contour of the building into a plurality of independent line segments, comprising:
Analyzing points on the contour of the building to identify analysis results of the geometric shape changes;
determining a division point on the contour line according to the analysis result of the geometric shape change, wherein the division point corresponds to the position of the geometric feature change;
Using the segmentation points, the contour of the building is decomposed into a plurality of individual line segments, wherein each line segment represents a relatively geometrically consistent portion of the contour.
It should be noted that, the system is a system corresponding to the above method, and all implementation manners in the above method embodiment are applicable to the embodiment, so that the same technical effects can be achieved.
Embodiments of the present invention also provide a computing device comprising: a processor, a memory storing a computer program which, when executed by the processor, performs the method as described above. All the implementation manners in the method embodiment are applicable to the embodiment, and the same technical effect can be achieved.
Embodiments of the present invention also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform a method as described above. All the implementation manners in the method embodiment are applicable to the embodiment, and the same technical effect can be achieved.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
Furthermore, it should be noted that in the apparatus and method of the present invention, it is apparent that the components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered as equivalent aspects of the present invention. Also, the steps of performing the series of processes described above may naturally be performed in chronological order in the order of description, but are not necessarily performed in chronological order, and some steps may be performed in parallel or independently of each other. It will be appreciated by those of ordinary skill in the art that all or any of the steps or components of the methods and apparatus of the present invention may be implemented in hardware, firmware, software, or any combination thereof in any computing device (including processors, storage media, etc.) or network of computing devices, as would be apparent to one of ordinary skill in the art upon reading the present specification.
The object of the invention can thus also be achieved by running a program or a set of programs on any computing device. The computing device may be a well-known general purpose device. The object of the invention can thus also be achieved by merely providing a program product containing program code for implementing said method or apparatus. That is, such a program product also constitutes the present invention, and a storage medium storing such a program product also constitutes the present invention. It is apparent that the storage medium may be any known storage medium or any storage medium developed in the future. It should also be noted that in the apparatus and method of the present invention, it is apparent that the components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered as equivalent aspects of the present invention. The steps of executing the series of processes may naturally be executed in chronological order in the order described, but are not necessarily executed in chronological order. Some steps may be performed in parallel or independently of each other.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that various modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.

Claims (10)

1. A method of generating an automatically constructed 3D model, the method comprising:
Obtaining model parameters of a game building, wherein the model parameters are used for primarily identifying a planar structure of the building from a complex game environment and generating a planar candidate set according to the planar structure;
Utilizing point cloud data in a game scene, and grouping and gathering points in the point cloud data according to the spatial proximity and attribute similarity characteristics of the point cloud data to form a plane cluster corresponding to the plane candidate set;
Calculating the distribution density of the point cloud for each plane cluster respectively, and comparing the distribution density with the distribution density of the point cloud in the plane candidate set to obtain a density comparison result;
Determining a dynamic influence factor according to the density comparison result, and dynamically adjusting the plane cluster according to the dynamic influence factor to generate a plane segmentation result;
extracting contour lines of each building according to the plane segmentation result;
Analyzing the geometric shape change on the contour line to decompose the contour line of the building into a plurality of independent line segments;
selecting and marking key points according to each independent line segment and specific geometric characteristics;
and carrying out triangulation processing on the key points to generate the three-dimensional game building model.
2. The method for generating the automatically constructed 3D model according to claim 1, wherein obtaining model parameters of the game building, the model parameters being used for preliminarily identifying a planar structure of the building from a complex game environment, and generating a planar candidate set according to the planar structure, comprises:
randomly selecting a data subset from the point cloud data in the game scene;
Estimating model parameters through a least square method according to the data subset;
And according to the estimated model parameters, calculating the distance between each data point and the estimated plane, regarding the points with the space distance smaller than the preset threshold value as belonging to the plane structure, and aggregating the point cloud data on the identified plane structure to form a plane candidate set.
3. The method for generating the automatically constructed 3D model according to claim 2, wherein grouping points in the point cloud data to form different planar clusters according to the spatial proximity and attribute similarity characteristics of the point cloud data by using the point cloud data in the game scene comprises:
for each planar structure in the planar candidate set, creating an empty planar cluster for storing point cloud data corresponding to the planar structure;
Traversing each point in the point cloud data, and calculating the space distance between each point and each plane structure in the plane candidate set;
Setting a distance threshold, regarding the points with the space distance less than the distance threshold as being adjacent to the plane structure space, and adding the corresponding points into the corresponding plane clusters;
for each point added into the planar cluster, calculating the attribute similarity between the point and the rest points in the cluster;
If the attribute of the point is similar to the attribute of the rest points in the cluster, the corresponding point is reserved in the plane cluster; otherwise, removing or marking the corresponding point from the plane cluster as an abnormal point;
after the preliminary formation of the planar clusters, the points which are adjacent in space and similar in attribute are gathered to form the planar clusters;
and merging the plane clusters according to the space distance, the angle difference and the attribute similarity between the plane clusters to obtain a plane cluster set.
4. The method for generating the automatically constructed 3D model according to claim 3, wherein calculating the distribution density of the point cloud for each planar cluster and comparing the distribution density of the point cloud with the distribution density of the point cloud in the planar candidate set to obtain a density comparison result comprises:
Traversing all point clouds in the current plane cluster, and calculating the quantity of all point clouds in the current plane cluster;
calculating the coverage area of the current plane cluster according to the number of all point clouds in the current plane cluster;
Dividing the number of all the point clouds in the current plane cluster by the area covered by the current plane cluster to obtain the point cloud distribution density of the current plane cluster;
Traversing all the point clouds in the plane candidate set, and calculating the total point cloud quantity in the plane candidate set;
calculating the total area covered by the whole candidate set according to the total point cloud quantity in the plane candidate set;
dividing the total point cloud quantity in the plane candidate set by the total area covered by the whole candidate set to obtain the average point cloud distribution density in the plane candidate set;
and comparing the distribution density of the point clouds of the current plane cluster with the average distribution density of the point clouds in the plane candidate set to obtain a density comparison result.
5. The method for generating the automatically constructed 3D model according to claim 4, wherein determining a dynamic influence factor according to the density comparison result, and dynamically adjusting the planar cluster according to the dynamic influence factor to generate the planar segmentation result comprises:
according to the point cloud distribution density of the current plane cluster and the average point cloud distribution density in the plane candidate set, the method comprises the following steps:
Calculating a dynamic impact factor, wherein/( Representing the dynamic influence factor of the ith plane cluster, N i is the number of points in plane cluster i,/>Is the normal vector of the j-th point in the plane cluster i,/>Is the average of the normal vectors of all points in the plane cluster i,/>Is the variance of the normal vector in the plane cluster i, M i is the number of points in the plane cluster i,/>Is the color value of the j-th point in the plane cluster i,/>Is the average of the color values of all points in the plane cluster i,/>And/>Is an adjustment coefficient,/>Representing the point cloud distribution density of the ith plane cluster,/>Representing the average point cloud distribution density inside the plane candidate set,/>Is an adjustment coefficient, i and j represent indexes;
According to the dynamic influence factor, the method comprises the following steps:
dynamically adjusting each plane cluster to generate a threshold value after the plane cluster adjustment, wherein L i is the number of points in the plane cluster i,/> Is the size of the j-th point in the plane cluster i,/>Is the average of the sizes of all points in the planar cluster i,/>Is a standardized function,/>Represents the/>Weight of individual geometry,/>Is the threshold value after the i-th plane cluster is adjusted,/>Representing the original threshold value,/>Representing the number of statistical properties,/>Representing an iteration variable;
re-evaluating attribution of point clouds in the plane cluster according to the threshold value after the plane cluster is adjusted so as to obtain a re-evaluation result;
and carrying out plane segmentation on the whole point cloud data according to the re-evaluation result, and generating a final plane segmentation result.
6. The method for generating the automatically constructed 3D model according to claim 5, wherein extracting contour lines of each building according to the planar segmentation result comprises:
According to the final plane segmentation result, determining points positioned at the plane edge by analyzing the distribution condition of point clouds in the plane cluster;
the points of the planar edges are connected to form the contour of the building based on the points of the planar edges.
7. The method of generating an automatically constructed 3D model according to claim 6, wherein analyzing the geometric change on the contour line to decompose the contour line of the building into a plurality of independent line segments comprises:
Analyzing points on the contour of the building to identify analysis results of the geometric shape changes;
determining a division point on the contour line according to the analysis result of the geometric shape change, wherein the division point corresponds to the position of the geometric feature change;
Using the segmentation points, the contour of the building is decomposed into a plurality of individual line segments, wherein each line segment represents a relatively geometrically consistent portion of the contour.
8. A generation system for automatically constructing a 3D model, comprising:
The acquisition module is used for acquiring model parameters of the game building, wherein the model parameters are used for primarily identifying the plane structure of the building from a complex game environment and generating a plane candidate set according to the plane structure; utilizing point cloud data in a game scene, and grouping and gathering points in the point cloud data according to the spatial proximity and attribute similarity characteristics of the point cloud data to form a plane cluster corresponding to the plane candidate set; calculating the distribution density of the point cloud for each plane cluster respectively, and comparing the distribution density with the distribution density of the point cloud in the plane candidate set to obtain a density comparison result;
the processing module is used for determining a dynamic influence factor according to the density comparison result, and dynamically adjusting the plane cluster according to the dynamic influence factor so as to generate a plane segmentation result; extracting contour lines of each building according to the plane segmentation result; analyzing the geometric shape change on the contour line to decompose the contour line of the building into a plurality of independent line segments; selecting and marking key points according to each independent line segment and specific geometric characteristics; and carrying out triangulation processing on the key points to generate the three-dimensional game building model.
9. A computing device, comprising:
one or more processors;
Storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the method of any of claims 1 to 7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a program which, when executed by a processor, implements the method according to any of claims 1 to 7.
CN202410508344.7A 2024-04-26 2024-04-26 Generation method and system for automatically constructing 3D model Active CN118097066B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410508344.7A CN118097066B (en) 2024-04-26 2024-04-26 Generation method and system for automatically constructing 3D model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410508344.7A CN118097066B (en) 2024-04-26 2024-04-26 Generation method and system for automatically constructing 3D model

Publications (2)

Publication Number Publication Date
CN118097066A true CN118097066A (en) 2024-05-28
CN118097066B CN118097066B (en) 2024-06-21

Family

ID=91157561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410508344.7A Active CN118097066B (en) 2024-04-26 2024-04-26 Generation method and system for automatically constructing 3D model

Country Status (1)

Country Link
CN (1) CN118097066B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200167940A1 (en) * 2017-07-21 2020-05-28 Tadano Ltd. Data point group clustering method, guide information display device, and crane
CN113223062A (en) * 2021-06-04 2021-08-06 武汉工控仪器仪表有限公司 Point cloud registration method based on angular point feature point selection and quick descriptor
CN114708382A (en) * 2022-03-17 2022-07-05 中国科学院深圳先进技术研究院 Three-dimensional modeling method, device, storage medium and equipment based on augmented reality
CN116416366A (en) * 2021-12-30 2023-07-11 华为技术有限公司 3D model construction method and device and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200167940A1 (en) * 2017-07-21 2020-05-28 Tadano Ltd. Data point group clustering method, guide information display device, and crane
CN113223062A (en) * 2021-06-04 2021-08-06 武汉工控仪器仪表有限公司 Point cloud registration method based on angular point feature point selection and quick descriptor
CN116416366A (en) * 2021-12-30 2023-07-11 华为技术有限公司 3D model construction method and device and electronic equipment
CN114708382A (en) * 2022-03-17 2022-07-05 中国科学院深圳先进技术研究院 Three-dimensional modeling method, device, storage medium and equipment based on augmented reality

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
卢维欣;万幼川;何培培;陈茂霖;秦家鑫;王思颖;: "大场景内建筑物点云提取及平面分割算法", 中国激光, no. 09, 10 September 2015 (2015-09-10) *

Also Published As

Publication number Publication date
CN118097066B (en) 2024-06-21

Similar Documents

Publication Publication Date Title
Ochmann et al. Automatic reconstruction of parametric building models from indoor point clouds
CN111915730B (en) Method and system for automatically generating indoor three-dimensional model by taking semantic slave point cloud into consideration
Sanchez et al. Planar 3D modeling of building interiors from point cloud data
Poullis A framework for automatic modeling from point cloud data
CN109740227B (en) Miniature complex part modeling method based on feature recognition
Wang et al. Modeling indoor spaces using decomposition and reconstruction of structural elements
CN108171780A (en) A kind of method that indoor true three-dimension map is built based on laser radar
IL266060A (en) Robust merge of 3d textured meshes
CN111986322B (en) Point cloud indoor scene layout reconstruction method based on structural analysis
CN112164145B (en) Method for rapidly extracting indoor three-dimensional line segment structure based on point cloud data
CN110047036B (en) Polar grid-based ground laser scanning data building facade extraction method
CN114241119A (en) Game model generation method, device and system and computer storage medium
CN118097066B (en) Generation method and system for automatically constructing 3D model
AU2010200146A1 (en) Extraction processes
CN111881964A (en) Linear building mode identification method and system based on Delaunay triangulation network
Zhang et al. Automated demarcation of the homogeneous domains of trace distribution within a rock mass based on GLCM and ISODATA
Sahebdivani et al. Deep learning based classification of color point cloud for 3D reconstruction of interior elements of buildings
Sapkota Segmentation of coloured point cloud data
CN115410036A (en) Automatic classification method for key element laser point clouds of high-voltage overhead transmission line
CN116091559A (en) Assembly state identification method based on optimal viewing angle
Román et al. Towards the automatic 3D parametrization of non-planar surfaces from point clouds in HBIM applications
Zhou et al. Visibility-driven mesh analysis and visualization through graph cuts
CN109101998B (en) Clustering method and system based on spatial information of residential ground context
Dierenbach et al. Next-Best-View method based on consecutive evaluation of topological relations
CN116863099B (en) Building automatic modeling method and system based on point cloud data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant