Disclosure of Invention
In order to solve the problems set forth in the background art, in a first aspect of the present invention, there is provided a tunnel wall modeling method based on a three-dimensional laser point cloud, including: acquiring three-dimensional laser point cloud data to be modeled of a tunnel wall, and preprocessing the three-dimensional laser point cloud data, wherein the preprocessing comprises the steps of complementing, filtering, simplifying and smoothing the three-dimensional laser point cloud data; and reconstructing the preprocessed three-dimensional laser point cloud data based on the KD tree and the grid method.
In some embodiments of the invention, the preprocessing the three-dimensional laser point cloud data includes: completing the part with the missing part in the point cloud data; based on the preset distance, eliminating one or more outliers in the point cloud data; simplifying the point cloud data based on one or more parameters of preset data simplification; and smoothing the simplified data.
Further, the removing one or more outliers in the point cloud data based on the preset distance includes: counting the field of each point in the point cloud data, and calculating the average distance and standard deviation from each point to all adjacent points; determining a distance threshold based on the average distance and standard deviation; and marking one or more outliers in the point cloud data according to the distance threshold, and eliminating the outliers.
Further, the average distanceStandard deviation of distance/>The calculation formulas of (a) are expressed as follows:
,/>,
Wherein,For each point's distance to its neighbors within its K neighborhood,/>And j represents the sequence number of the adjacent point of each point in the point cloud data, m is the total number of the adjacent points in the K domain range of each point in the point cloud data.
In some embodiments of the present invention, the reconstructing the preprocessed three-dimensional laser point cloud data based on the KD-tree and the grid method includes: determining the size of a local neighborhood of each point based on the KD tree; generating one or more hierarchical spaces by weighting component analysis filters according to the size of the local neighborhood of each point; performing grid division on each hierarchical space, and creating a smooth grid curved surface; performing connectivity propagation on the grid curved surface map; the attributes contained in the point set are propagated to the reconstructed surface while processing the topology of the reconstructed surface.
Further, the meshing of each hierarchical space and creating a smooth mesh surface includes: meshing is performed in the smoothest hierarchical space using an alpha shape algorithm to create a smoothed mesh surface.
In a second aspect of the present invention, there is provided a tunnel wall modeling system based on a three-dimensional laser point cloud, comprising: the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring three-dimensional laser point cloud data to be modeled of a tunnel wall and preprocessing the three-dimensional laser point cloud data, and the preprocessing comprises the steps of supplementing, filtering, simplifying and smoothing the three-dimensional laser point cloud data; and the reconstruction module is used for reconstructing the preprocessed three-dimensional laser point cloud data based on the KD tree and the grid method.
Further, the obtaining module includes: the complementing unit is used for complementing the part with the missing part in the point cloud data; the rejecting unit is used for rejecting outliers in the point cloud data based on the preset distance; the simplifying unit is used for simplifying the point cloud data based on one or more parameters of preset data simplification; and the smoothing unit is used for smoothing the simplified data.
In a third aspect of the present invention, there is provided an electronic apparatus comprising: one or more processors; and the storage device is used for storing one or more programs, and the one or more programs are executed by the one or more processors, so that the one or more processors realize the tunnel wall modeling method based on the three-dimensional laser point cloud provided by the first aspect of the invention.
In a fourth aspect of the present invention, a computer readable medium is provided, on which a computer program is stored, wherein the computer program, when being executed by a processor, implements the three-dimensional laser point cloud based tunnel wall modeling method provided in the first aspect of the present invention.
The beneficial effects of the invention are as follows:
The invention relates to a tunnel wall modeling method and system based on three-dimensional laser point cloud, wherein the method comprises the following steps: acquiring three-dimensional laser point cloud data to be modeled of a tunnel wall, and preprocessing the three-dimensional laser point cloud data, wherein the preprocessing comprises the steps of complementing, filtering, simplifying and smoothing the three-dimensional laser point cloud data; and reconstructing the preprocessed three-dimensional laser point cloud data based on the KD tree and the grid method.
It can be seen that the present invention has advantages over conventional tunnel modeling techniques:
1. the method is used for complementing the missing point cloud data based on an improved minimum angle complementing algorithm, and improves the quality of the tunnel wall triangle network model which is finally reconstructed.
2. In the process of reconstructing the tunnel wall surface, the point cloud is smoothed under different layers, so that not only can the influence caused by a sensor or other sampling processes be effectively resisted, but also the characteristics of different layers of the point cloud data can be simultaneously extracted, so that model details and overall shapes can be conveniently reserved, and the surface reconstruction is more comprehensive. In the practical use process, the reconstruction method can also have better adaptability in processing point clouds with different proportions and densities.
Detailed Description
The principles and features of the present invention are described below with reference to the drawings, the examples are illustrated for the purpose of illustrating the invention and are not to be construed as limiting the scope of the invention.
Referring to fig. 1 and 2, in a first aspect of the present invention, there is provided a tunnel wall modeling method based on a three-dimensional laser point cloud, including: s100, acquiring three-dimensional laser point cloud data to be modeled of a tunnel wall, and preprocessing the three-dimensional laser point cloud data, wherein the preprocessing comprises the steps of supplementing, filtering, simplifying and smoothing the three-dimensional laser point cloud data; s200, reconstructing the preprocessed three-dimensional laser point cloud data based on the KD tree and the grid method.
Referring to fig. 3, in step S100 of some embodiments of the present invention, the preprocessing the three-dimensional laser point cloud data includes:
S101, complementing a part with the missing part in the point cloud data;
Specifically, in the process of scanning and collecting point cloud data, due to the influence of factors such as object shielding or sensor errors, local defects exist in final data, so that the subsequent application and modeling of the point cloud data are influenced, and therefore, certain measures are necessary to supplement the missing parts in the point cloud data.
Further, firstly determining the boundary of the missing part, encrypting the points on the boundary, then connecting the boundary points, performing preliminary triangularization on the missing part, further subdividing the triangle, and finally taking out the vertexes of all triangles in the boundary of the missing range as the data of point cloud completion.
More specifically, referring to fig. 4 and 5, step S101 includes:
Step S1011: searching points in the fan-shaped range of four directions of each point in the point cloud data are traversed, so that boundary points of a missing range are extracted, and the boundary points are encrypted according to the acquisition precision of the point cloud data.
Step S1012: the missing part is subjected to preliminary triangularization.
Assuming that fig. 4 (a) is a missing part (including a boundary), first calculating the included angle at each vertex, as shown in fig. 4 (b), finding the vertex with the smallest current included angle as D, triangulating the two adjacent edges to form a new triangle. As shown in figure 4 (c), the vertex with the smallest included angle in the continuous search of the rest polygon is E, and two adjacent edges of the vertex are triangulated to form a new triangle/>. This step is iterated until more than three polygons are no longer present within the boundary, and the final result of the preliminary triangularization is shown in fig. 4 (d).
Step S1013: and carrying out subdivision processing on the triangles in the boundary of the missing part, wherein the flow is specifically as follows.
(1) Counting the average side length of the boundary of the missing part as a basic length threshold d, and simultaneously taking the aesthetic degree of the form into consideration to introduce the aesthetic degree coefficientDetermining the length threshold range as/>, acting on the base length thresholdUsed for controlling the side length of the thinned triangle within the range.
(2) Traversing all triangles in the boundary, and judging whether the side length of the current triangle is in the length threshold rangeIf the side length of the current triangle is not within the length threshold range/>In, the center point of the triangle is respectively connected with three vertexes to form 3 new triangles, otherwise, if the side length of the current triangle is in the length threshold range/>And if so, the subdivision processing of the current triangle is not performed. Traversing each triangle completes this step.
(3) And adjusting each triangle in the memory based on a folding edge algorithm in turn, and calculating the aspect ratios of the triangle before and after adjustment to be N and N respectively. Judging the size relation between N and N, if the aspect ratio N of the triangle before adjustment is larger than the aspect ratio N of the triangle after adjustment, the triangle after adjustment has higher quality than the triangle before adjustment, and executing the adjustment operation, otherwise, the triangle after adjustment has lower quality than the triangle before adjustment, and the adjustment operation is not executed on the triangle. Traversing each triangle completes this step.
(4) And (3) continuously iterating the two steps of operation (2) and (3) until the side lengths of all triangles in the missing range are within the length threshold range D.
Step S1014: and taking out all triangle vertexes in the boundary of the missing range as data of point cloud completion.
Referring to fig. 5, an example of a point cloud completion result after executing the point cloud data completion module flow of the present invention.
S102, eliminating one or more outliers in the point cloud data based on a preset distance;
The point cloud data usually has outliers caused by noise, sampling errors and other factors, and the existence of the outliers can influence the subsequent processing and surface reconstruction of the point cloud data, so that the outliers need to be identified and removed.
Further, a statistical analysis is performed on the neighborhood of each point in the point cloud data, and the average distance and standard deviation of the distance to all the adjacent points are calculated. And identifying the outliers in the point cloud data after determining the distance threshold according to the average distance and the distance standard deviation, calculating the distance average value of the neighborhood of each point, and if the distance average value is larger than the previously determined distance threshold, marking the outliers and removing the outliers from the data.
Specifically, the method comprises the following steps:
s1021, firstly, setting parameters for eliminating outliers, wherein the parameters comprise a neighborhood range value K and a standard deviation multiple threshold h.
S1022 searching all the adjacent points in the K neighborhood range of each point, and calculating the average distance from all the points to all the adjacent points in the K neighborhood rangeStandard deviation of distance/>. Average distance/>Standard deviation of distance/>Is calculated according to the formula:
,
,
Wherein,For each point's distance to its nearest point in the K neighborhood,/>Representing common/>, in point cloud dataPoint,/>Representing the commons/> within the K neighborhood of each pointAdjacent points.
S1023, calculating the average distance from each point to all the adjacent points in the K neighborhood range。
S1024 condition of breaking "Or/>If yes, step S1025 is executed, and if not, step S1026 is executed.
S1025, marking the current point as a discrete point, and eliminating the discrete point from the data.
S1026, the current point is not a discrete point, and the data of the point is reserved.
S103, simplifying point cloud data based on one or more parameters of preset data simplification;
In particular, three-dimensional laser point cloud data are often distributed very densely, and the data are too huge, so that subsequent data processing and surface reconstruction are not facilitated, and meanwhile, inconvenience is brought to links such as interactive display and data transmission. Thus, it is required to ensure
And simplifying the point cloud data on the premise of a certain data precision.
Further, firstly setting necessary parameters for data simplification, such as a point cluster size and a surface variation measure maximum_variation, and then recursively dividing a point set in the point cloud data into smaller point clusters until the simplified point clusters meet the following conditions: the number of points in each point cluster is smaller than the size of the point cluster, and the surface change factor of each point cluster is lower than the surface change measure maximum_variance.
S104, smoothing the simplified data.
Specifically, the simplified point cloud data is subjected to smoothing processing, and noise points are further removed, so that the processed point cloud data can more accurately express the spatial position of the scanned tunnel wall.
Further, each point in the point cloud data is projected onto an implicit curved surface established by the data in a certain neighborhood range of the point cloud data in an iterative mode, and the current point is corrected to a position after smoothing is completed through the distance weight of the current point and the adjacent point and the projection weight of the adjacent point along the normal vector of the current point.
Specifically, each point in the tunnel wall point cloud data is projected onto an implicit curved surface established by data in a certain neighborhood range, and the current point is corrected to a smoothed position by determining the distance weight of the current point and the adjacent point and the projection weight of the adjacent point along the normal vector of the current point.
In step S200 of some embodiments of the present invention, the reconstructing the preprocessed three-dimensional laser point cloud data based on the KD-tree and grid method includes:
S201, determining the size of a local neighborhood of each point based on the KD tree;
Specifically, the K-D tree is used to estimate the neighborhood size first, so as to determine the local neighborhood size range of each point in the hierarchical construction process.
S202, generating one or more hierarchical spaces through a weighted component analysis filter according to the size of the local neighborhood of each point; specifically, applying weighted principal component analysis smoothing filters several times generates point clouds at different levels to create a level space in order to express different details of the tunnel wall surface.
S203, carrying out grid division on each hierarchical space, and creating a smooth grid curved surface;
Specifically, meshing is performed in the smoothest hierarchical space using an alpha shape algorithm to create a smooth mesh surface. The generated surface is stored as a set of triples, where each triplet contains three indices pointing to a point set.
S204, performing connectivity propagation on the grid curved surface mapping; specifically, connectivity generated between the smoothed points is propagated to the original set of input points. I.e. the meshing information is mapped back to the original set of points to ensure that the smoothed points at different levels are correctly connected.
S205, transmitting the attribute contained in the point set to the reconstructed curved surface, and simultaneously processing the topological structure of the reconstructed surface.
Specifically, the properties contained in the point set are propagated onto the reconstructed surface while processing the topology of the reconstructed surface.
Further, in step S203, the meshing the hierarchical space and creating a smooth mesh surface includes: meshing is performed in the smoothest hierarchical space using an alpha shape algorithm to create a smoothed mesh surface.
As shown in fig. 7, in this embodiment, three-dimensional laser point cloud data of a tunnel wall of the input system is shown in fig. 8, and the effect of reconstructing the surface of the tunnel wall according to the implementation steps of the present invention is shown in fig. 8, where the reconstructed surface of the tunnel wall includes 121660 triangular patches in total.
Example 2
Referring to fig. 9, a second aspect of the present invention provides a tunnel wall modeling system 1 based on a three-dimensional laser point cloud, comprising: an obtaining module 11, configured to obtain three-dimensional laser point cloud data to be modeled by a tunnel wall, and perform preprocessing on the three-dimensional laser point cloud data, where the preprocessing includes complement, filtration, simplification, and smoothing of the three-dimensional laser point cloud data; and the reconstruction module 12 is used for reconstructing the preprocessed three-dimensional laser point cloud data based on the KD tree and the grid method.
Further, the obtaining module 11 includes: the complementing unit is used for complementing the part with the missing part in the point cloud data; the rejecting unit is used for rejecting outliers in the point cloud data based on the preset distance; the simplifying unit is used for simplifying the point cloud data based on one or more parameters of preset data simplification; and the smoothing unit is used for smoothing the simplified data.
Referring to fig. 2, in some embodiments of the present invention, the modules applied in the method and system for modeling a tunnel wall based on three-dimensional laser point cloud data include a point cloud data complement module 101, an outlier rejection module 102, a point cloud data simplification module 103, a point cloud data smoothing module 104, and a tunnel wall surface reconstruction module 105.
The point cloud data complement module 101: the method is used for complementing the missing local data in the tunnel wall point cloud data so as to improve the final modeling accuracy of the tunnel wall.
Example 3
Referring to fig. 10, a third aspect of the present invention provides an electronic device, including: one or more processors; and a 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 three-dimensional laser point cloud-based tunnel wall modeling method of the present invention in the first aspect.
The electronic device 500 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with programs stored in a Read Only Memory (ROM) 502 or loaded from a storage 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following devices may be connected to the I/O interface 505 in general: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 508 including, for example, a hard disk; and communication means 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 10 shows an electronic device 500 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 10 may represent one device or a plurality of devices as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or from the storage means 508, or from the ROM 502. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 501. It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In an embodiment of the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. Whereas in embodiments of the present disclosure, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more computer programs which, when executed by the electronic device, cause the electronic device to:
Computer program code for carrying out operations of embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++, python and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.