Disclosure of Invention
In order to solve the above problems, a first aspect of the present invention provides a method for constructing a three-dimensional model of a tunnel construction area, which is capable of accurately constructing a three-dimensional model of a tunnel construction area.
In order to achieve the purpose, the invention adopts the following technical scheme:
a method for constructing a three-dimensional model of a tunnel construction area comprises the following steps:
coaxially acquiring three-dimensional laser point cloud data and a plurality of two-dimensional images of a tunnel construction area, wherein all the two-dimensional images can be spliced into a tunnel construction area panoramic view;
and performing spherical projection on all the two-dimensional images, simultaneously directly giving RGB information of pixel points in the two-dimensional images to the three-dimensional laser point cloud data with the same angle, directly splicing all the two-dimensional images, and constructing a three-dimensional model of the tunnel construction area.
In order to solve the above problems, a second aspect of the present invention provides a tunnel construction area three-dimensional model construction system, which is capable of accurately constructing a tunnel construction area three-dimensional model.
In order to achieve the purpose, the invention adopts the following technical scheme:
a three-dimensional model building system for a tunnel construction area comprises:
the coaxial data acquisition module is used for coaxially acquiring three-dimensional laser point cloud data and a plurality of two-dimensional images of a tunnel construction area, and all the two-dimensional images can be spliced into a tunnel construction area panorama;
and the data matching projection module is used for performing spherical projection on all the two-dimensional images, simultaneously directly endowing RGB information of pixel points in the two-dimensional images to the three-dimensional laser point cloud data with the same angle, directly splicing all the two-dimensional images and constructing a three-dimensional model of the tunnel construction area.
A third aspect of the invention provides a computer-readable storage medium.
A computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps in the method of building a three-dimensional model of a tunnel construction area as described above.
A fourth aspect of the invention provides a computer apparatus.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the method for building a three-dimensional model of a tunnel construction area as described above when executing the program.
The invention has the beneficial effects that:
according to the invention, two-dimensional pixel information and three-dimensional laser point cloud data are directly and coaxially acquired, the pixel information is subjected to spherical projection, pixel point RGB information with the same angle is directly endowed to a three-dimensional laser point for direct splicing, so that the measurement error generated by a traditional method based on characteristic point registration or reflector method manual registration is avoided, and the calculation steps are simplified.
Detailed Description
The invention is further described with reference to the following figures and examples.
It is to be understood that the following detailed description is exemplary and is intended to provide further explanation of the invention as claimed. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the invention. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
Fig. 1 is a flowchart of a method for building a three-dimensional model of a tunnel construction area according to an embodiment of the present invention.
As shown in fig. 1, a method for constructing a three-dimensional model of a tunnel construction area according to this embodiment includes:
s101: and coaxially acquiring three-dimensional laser point cloud data and a plurality of two-dimensional images of the tunnel construction area, wherein all the two-dimensional images can be spliced into a tunnel construction area panoramic view.
The essence of the image gradient domain saliency optimization is to enlarge images with insignificant differences, and enhance the characteristics of image edges through an image interpolation technology to realize the identification of structural plane traces. However, the conventional image interpolation methods, such as nearest neighbor interpolation, linear interpolation, etc., are prone to cause distortion of image edges, and generate influences such as structural plane trace saw-tooth shape or trace distortion. The method comprises the steps of segmenting a smooth region and a texture region of an image by using an isoline method, applying polynomial model interpolation in the smooth region, adopting rational function model interpolation in the texture region, calculating the gradient of the image according to a Sobel operator template, and performing weight optimization according to different texture directions of the image, thereby overcoming the defect of distortion of the traditional method.
The division threshold values of different areas of the image are 4 pixel points of the interpolation unit and surrounding pixel points thereof. And taking the pixel point mean value as a threshold value. For an arbitrary data set fi+r,j+s(r, s-1, 0,1,2) different pixel structures, with different detection thresholds. The detection threshold is shown as:
the image interpolation calculation is to detect the image edges in the horizontal and vertical directions by utilizing an isotropic Sobel operator, and then to perform convolution with an image interpolation plane to solve the image gradient direction. The image gradient direction is perpendicular to the texture direction.
And after the gradient direction of the image is determined, carrying out significance optimization on the corresponding central point. And (4) pre-estimating the gray value of the central point according to the mixed weighting of the pixel values around the central point of the interpolation unit.
In the implementation, the essence of the camera imaging process is the process of projecting the spatial points to the imaging plane through coordinate system transformation and by using the pinhole imaging principle. In the process of acquiring the rock mass structure pixel information by the camera, because the light rays generate bending phenomena with different amplitudes in the process of transmitting through the lens, the shot pictures are distorted, and the distortion of the rock mass structure information is caused. In the traditional rock mass structure non-contact measurement process, a camera is used for directly shooting a face, and the obtained image is used as a rock mass structure analysis basis without correction processing, so that large errors can be brought to the rock mass structure analysis.
In order to effectively identify two-dimensional pixel information of a rock mass structure, distortion is required to be reduced as much as possible in the image acquisition process, and the acquired image is corrected. According to the distortion generation principle, distortion generated at the edge of an image is large. Therefore, the larger the captured image width is, the more significant the error due to distortion is. The two-dimensional pixel information acquisition mode that the small image frame mode is adopted for shooting and a plurality of small image frames are spliced can effectively reduce distortion. In order to reduce splicing errors, the camera performs three-dimensional rotation by taking the center of an imaging plane as an origin point in the shooting process, photographs are shot in the whole space at different inclination angles, the photographs are corrected, then a two-dimensional local coordinate system is constructed on the obtained pixel information, and a true color data basis of a three-dimensional rock mass structure information model is established.
The i-cam camera is calibrated by using a calibration tool developed by CALTECH and a Zhang calibration method, and distortion parameters are measured. The method is characterized in that a grid image with equal length and width and alternating black and white is displayed in a display, and the display is used as a calibration reference. The calibration object is shot for multiple times at different angles, the internal reference and the external reference of the camera are calculated, and the calculation formulas are shown in formulas 2 and 3.
Distortion parameter K1,K2,K3,P1,P2A total of 5, wherein the radial distortion parameter is K1,K2,K3(ii) a Tangential distortion parameter of P1,P2。
Radial distortion:
xcorrected=x(1+k1r2+k2r4+k3r6)
ycorrected=y(1+k1r2+k2r4+k3r6) (2)
tangential distortion:
xcorrected=x+[2p1xy+p2(r2+2x2)]
ycorrected=y+[2p2xy+p1(r2+2y2)](3)
the calibration tool calculation is briefly performed as follows:
(1) extracting coordinates of corner points in the calibration plate from each photo;
(2) extracting pixel information of angular points of each picture;
(3) solving an internal parameter, an external parameter and a distortion matrix of the camera;
(4) minimizing an objective function;
(5) carrying out statistical evaluation on the average error of the calibration result;
(6) and applying the calibration result to correct the subsequent image.
The distortion parameter of the i-cam camera is calculated by calibration software developed by CALTECH, and is represented by formula 4:
after distortion correction is carried out on the photos, cc of each photo is set as an original point, the horizontal direction is an x axis, and the vertical direction is a y axis, so that a two-dimensional coordinate system of each photo is established. In the process of acquiring the two-dimensional pixel information of the rock mass structure, the camera performs equal-focus three-dimensional rotation shooting by taking the center of an imaging plane as an origin, so that the two-dimensional coordinate system of each picture is only subjected to three-dimensional rotation transformation without scaling transformation, and a unified pixel information local coordinate system can be established. Equations 6 to 10 are three-dimensional coordinate transformation processes.
Setting the vector in a three-dimensional coordinate system
At three-dimensional right anglesAs shown in fig. 2, the coordinate system includes a point P and XY, XZ and YZ planes respectively having an included angle θ
x、θ
y、θ
z。
Rotation matrix R of rotation angles about Z-axisz(θ) is:
rotation matrix R of rotation angles about Y-axisy(θ) is:
rotation matrix R of rotation angles about the X-axisx(θ) is:
the three-dimensional rotation matrix M is:
M=Rz(θ)Ry(θ)Rx(θ) (8)
the following can be obtained:
after three-dimensional rotation of the coordinate system, the x axis of the unified pixel information local coordinate system forms a regular polygon with the rotation origin as the center, and the y axis forms a half shape of the regular polygon with the rotation origin as the center. The overall coordinate system constitutes a pseudo three-dimensional coordinate system with the focal length of the camera as the radius.
The three-dimensional laser scanning equipment mainly comprises a phase laser ranging module and an angle measuring module. The laser ranging module mainly realizes the laser ranging function by a laser transmitter, a laser receiver and a modulator. After the laser transmitter transmits laser, the laser reaches the rock wall after a certain distance, and then the laser transmitter transmits the laser and is received by the laser receiver, so that the distance between the laser transmitter and a rock wall measuring point can be represented as follows:
wherein: s is the distance between the laser ranging transmitter and a rock wall measuring point, c is the light propagation speed, and T is the modulation signal period time.
After the distance between the laser emission point and the rock wall is calculated through speed and time, the relative coordinate value of the rock wall point can be solved according to the horizontal and vertical rotating angles of the angle measuring module. As shown in FIG. 3, assume that the O point is the laser emission point and the coordinate is (x)0,y0,z0) If the point P is a rock wall point, the coordinates are (x, y, z), α is a drilling and rotating angle in the horizontal direction, β is a rotating angle in the vertical direction, the solving method for the relative coordinate values of the point P is (equation 12-14):
x=S cosβcosα (12)
y=S cosβsinα (13)
z=S sinβ (14)
the absolute coordinate value of the point P is:
due to the fact that the tunnel face and the side wall area are likely to have unevenness of a large extent, the laser scanning path can be shielded to a certain degree, and a detection blind area is formed. Causing the laser point cloud model to generate a cavity. When the situation exists, multi-point detection is needed to eliminate the local detection blind areas of the tunnel face and the side wall area, and the scanning contour point cloud is encrypted to ensure the refinement and the accuracy of the acquisition of the rock mass structure information form. The key to perform multi-point detection point cloud registration is a transformation relationship of coordinate systems, taking two-station detection as an example, assuming that one station coordinate system is o-xyz, and the other station coordinate system is o '-x' y 'z', the transformation process rotates the coordinate system o-xyz around three coordinate axes of itself, and then obtains o '-x' y 'z' through a translation matrix, which can be expressed by formula (16):
wherein, the translation matrix T can pass the translation amount x on the three-dimensional coordinate axis0,y0,z0Represents:
equation 17 includes 7 parameters, scale factor, 3 rotation parameters (α, gamma), and 3 translation parameters (x)0,y0,z0) And the rock wall has no scale change, so that the scale factor v in the coordinate solving process is 1. Suppose that the rotation angles of the coordinate system o-xyz along the x, y and z coordinate axes are theta in sequencex、θy、θzAnd sequentially translating x along x, y, z coordinate axes0,y0,z0And converted to o '-x' y 'z'. The matrix transformation is rotated along the x, y, z coordinate axes see equations 5 through 10.
When the three-dimensional laser scanning of the rock mass structure is carried out, the horizontal coordinates and the vertical coordinates of the laser emission points are known, namely the corresponding translation matrix T (formula 17) is a known quantity, and the rotation adjustment posture of the laser emission probe and the corresponding scanning results x, y and z coordinate axes are known, so that the coordinate conversion relation between two measuring points, namely 6 parameters, can be determined, accordingly, the point cloud data of a plurality of measuring points can be converted and spliced, and the repeated exploration and splicing of the rock mass structure with complex morphology can be realized.
S102: and performing spherical projection on all the two-dimensional images, simultaneously directly giving RGB information of pixel points in the two-dimensional images to the three-dimensional laser point cloud data with the same angle, directly splicing all the two-dimensional images, and constructing a three-dimensional model of the tunnel construction area.
As shown in fig. 4(a) and 4(b), assuming that the x-axis of the local coordinate system of the uniform pixel information is a regular n-polygon, the y-axis is a half of a regular m-polygon, the image width is w, the height is u, the coordinate of one point P in the trajectory image of the rock mass structure identified by the two-dimensional rock mass structure is (x, y), the projected point P' (R, α, R) in the coordinate system with the projected sphere radius R, and the chord length is a, there are:
2πR=nw (18)
πR=mu (19)
from the trigonometric cosine theorem we can obtain:
in the same way, the method for preparing the composite material,
after the above projective transformation (equations 20 to 24), the pseudo three-dimensional coordinate system of the pixel data becomes a smooth spherical coordinate system.
In the three-dimensional laser point cloud data, assuming that the coordinates of a point M in the point cloud data are (x ', y', z '), the coordinates of a point M' in the corresponding spherical coordinate system are (r, α ', β'), where:
because the spherical coordinate system of the pixel data and the spherical coordinate system of the three-dimensional laser point cloud data have a common origin and the coordinate axes are in the same direction, any point coordinate in the pixel data has a coordinate and only one coordinate in the three-dimensional laser point cloud data corresponds to the coordinate. The RGB values in the pixel data and the space coordinate values in the three-dimensional laser point cloud data are butted under an angular bridge, the fusion of the pixel data and the three-dimensional laser point cloud data is realized, the two-dimensional rock mass structure trace is endowed with three-dimensional characteristics, the three-dimensional rock mass structure identification is realized, and meanwhile, the high-precision true color three-dimensional face and side wall model is constructed
In the embodiment, two-dimensional pixel information and three-dimensional laser point cloud data are directly and coaxially acquired, the pixel information is subjected to spherical projection, pixel point RGB information with the same angle is directly endowed to a three-dimensional laser point for direct splicing, measurement errors generated by a traditional method based on feature point registration or manual registration based on a reflector method are avoided, and calculation steps are simplified.
Fig. 5 is a schematic diagram of a system for building a three-dimensional model of a tunnel construction area according to an embodiment of the present invention.
As shown in fig. 5, a system for constructing a three-dimensional model of a tunnel construction area includes:
(1) the coaxial data acquisition module is used for coaxially acquiring three-dimensional laser point cloud data and a plurality of two-dimensional images of a tunnel construction area, and all the two-dimensional images can be spliced into a tunnel construction area panorama;
in a specific implementation, in the coaxial data acquisition module, in the process of acquiring the two-dimensional image, the corresponding two-dimensional image is acquired by performing equal-focal-length three-dimensional rotation with the center of the imaging plane of the camera as an origin.
(2) And the data matching projection module is used for performing spherical projection on all the two-dimensional images, simultaneously directly endowing RGB information of pixel points in the two-dimensional images to the three-dimensional laser point cloud data with the same angle, directly splicing all the two-dimensional images and constructing a three-dimensional model of the tunnel construction area.
As an embodiment, the system for building a three-dimensional model of a tunnel construction area further includes:
and the image correction module is used for carrying out distortion correction on all the two-dimensional images before carrying out spherical projection on all the two-dimensional images.
As another embodiment, the system for building a three-dimensional model of a tunnel construction area further includes:
and the edge feature enhancement module is used for dividing a smooth area and a texture area of each two-dimensional image by using an isoline method after distortion correction is carried out on all the two-dimensional images, applying polynomial model interpolation to the smooth area, adopting rational function model interpolation to the texture area, then calculating the gradient of the two-dimensional images according to a Sobel operator template, carrying out weight optimization according to different texture directions of the two-dimensional images and enhancing the edge features of the two-dimensional images.
In the embodiment, two-dimensional pixel information and three-dimensional laser point cloud data are directly and coaxially acquired, the pixel information is subjected to spherical projection, pixel point RGB information with the same angle is directly endowed to a three-dimensional laser point for direct splicing, measurement errors generated by a traditional method based on feature point registration or manual registration based on a reflector method are avoided, and calculation steps are simplified.