Disclosure of Invention
The invention aims to provide a three-dimensional deformation detection method based on an actual three-dimensional model front-view image, which is a method for generating a two-dimensional front-view image based on a three-dimensional model (namely, reducing the dimension of the actual three-dimensional model to generate a two-dimensional front-view image, carrying out homonymy point matching and quality control), carrying out three-dimensional deformation monitoring by simultaneously combining three-dimensional and two-dimensional image information (namely, reducing the dimension of three-dimensional actual data into a two-dimensional image, then establishing an accurate corresponding relation through image matching, and calculating a deformation amount on the basis) to obtain a three-dimensional change vector field of a target, and being capable of obtaining reliable deformation information, high in precision, high in efficiency and low in cost; the method solves the problems that under the three-dimensional reconstruction model based on the unmanned aerial vehicle, deformation detection is directly carried out based on live-action data, a plurality of defects exist (for example, a strict corresponding relation of two-stage three-dimensional live-action data is not established definitely), and reliable deformation information cannot be obtained.
In order to achieve the purpose, the technical scheme of the invention is as follows: the three-dimensional deformation detection method based on the front-view image of the live-action three-dimensional model is characterized by comprising the following steps of: taking a live-action three-dimensional model as a basic data source, utilizing the live-action three-dimensional models at different time phases to reduce the dimension to obtain an orthographic image, carrying out image matching under an image pyramid strategy to obtain a homonymy point, then increasing the dimension to the three-dimensional model, and interpolating to obtain a three-dimensional deformation vector field; the live-action three-dimensional model scene comprises deformation monitoring areas such as landslides and dangerous rock masses;
the specific three-dimensional deformation detection method comprises the following steps,
the method comprises the following steps: generating a two-stage front view image (namely dimension reduction processing);
determining a normal vector of a space projection plane through plane fitting according to the input real-scene three-dimensional models of the front and rear time phases
Wherein, a, b and c are normal vectors of a space plane, and then the real-scene three-dimensional model is projected to the calculated space projection plane to generate a corresponding front-view image;
step two: acquiring feature points with the same name of two-stage front-view images through image matching;
performing image matching on the front-rear time phase front-view image obtained in the step one by using an image pyramid strategy to obtain two-dimensional homonymy point coordinates of the homonymy ground object on the front-rear time phase front-view image
(ii) a This formula represents a pair of homologous points whose coordinates are respectively
And
;
xis the abscissa of the coordinate system, and,
yis the ordinate, and the units are pixels;
step three: converting the two-dimensional homonymous points into an object space coordinate system (namely, ascending dimension processing);
respectively converting front and rear time phase front-view image homonymous points into a three-dimensional model through the parameters in the front-view image obtained in the step one to obtain three-dimensional homonymous point coordinates
;
The formula represents a pair of object party homonyms, and the coordinates of the object party homonyms are
And
the units are pixels, X is the horizontal coordinate of the plane, Y is the vertical coordinate of the plane, and Z is the elevation;
step four: generating a three-dimensional change vector field;
calculating the change vector of each homonymous point for the three-dimensional homonymous points obtained in the step three
Interpolating the result to obtain a three-dimensional change vector field of the target;
the three-dimensional model is reduced into the two-dimensional front-view image for image matching, the strict corresponding relation of the same ground point in the two-stage data is established, and then the dimension is increased to the three-dimensional model, so that the three-dimensional homonymy point is determined, and more accurate deformation information can be extracted.
In the technical scheme, in the first step, the two-stage three-dimensional model needs to use the same space projection plane to generate an orthographic image so as to unify coordinate references; in addition, compared with an orthoimage with a projection plane being a horizontal plane, since the orthographic image projection plane is an optimal spatial plane (such as a tangent plane of a landslide surface, a vertical plane of a wall surface and the like) facing the ground scene, the projection deformation is small, and the ground information can be better represented.
In the above technical solution, in the first step, when the three-dimensional scene is a landslide area, the specific method for generating the two-stage orthophoto map includes:
firstly, calculating a proper plane of the landslide (namely a space plane of the best-fit landslide) through plane fitting according to the three-dimensional model of the anterior phase, and determining a normal vector of a space projection plane
Calculating the coordinate system of the object space
To projection space plane coordinate system
Of the rotation matrix
;
Then, calculating the coordinates of each vertex by calculating the bounding box of the three-dimensional model, and determining the coordinates of the starting point
;
Then any spatial point in the three-dimensional model that is in
Coordinates of (5)
And in
Coordinates of (5)
The conversion relationship is as follows:
and finally, converting the image into a local coordinate system, and then carrying out gridding processing to obtain a front time phase orthographic view image, and carrying out the same steps on a rear time phase image to obtain a rear time phase orthographic view image so as to obtain front and rear time phase orthographic view images.
In the technical scheme, in the second step, when the images with the original scale are directly matched, the homonymous image point search needs to be carried out in a larger image range, the efficiency is low, and the mismatching is easy to occur; according to the method, an image pyramid strategy is adopted, image matching is carried out from the minimum scale to the original scale, the image matching result of each scale is used for correcting the next layer of image matching prediction point, the searching range is reduced, and the precision is continuously improved;
for the topmost image pyramid, the resolution is low enough, and the image coordinate difference between the image points with the same name predicted by the geographic coordinates and the actual point positions is small (less than or equal to dozens of pixels), so that the matching is easy; and establishing an affine transformation relation between the geographic coordinates corresponding to the matched image points with the same name as an initial corresponding model, and definitely establishing a strict corresponding relation of the two-stage three-dimensional live-action data to acquire reliable deformation information.
In the above technical solution, in the second step, as shown in fig. 2, the specific image matching method includes:
step 21: constructing an image pyramid according to the front-time phase orthographic images and the rear-time phase orthographic images;
step 22: determining an affine transformation initial model;
step 23: the pyramid top layer is currently in place;
step 24: for the previous phase image I (x, y), firstly, extracting the characteristic points of the previous phase image through a Harris operator;
step 241: calculating the image (i.e. the anterior phase image) I (x, y) atxAndygradient in two directionsI x 、I y ;
In formula (1):
represents a convolution;
I x represent an image in
xGradient in direction, pure numerical value, no unit;
in the formula (2):
Represents a convolution;
I y represent an image in
yGradient values in direction, pure numerical values, no units;
step 242: calculate the image at
xAnd
yproduct of two directional gradients
And
;
step 243: gaussian weighting the result of the previous step by using a Gaussian function
Generating a covariance matrix M of each pixel point gradient;
in formula (6): each I in the matrix is a product of corresponding gradient values and is used for constructing a covariance matrix M of the gradient;
wrepresenting a gaussian kernel function with sigma =1,
represents a convolution; all numerical values in the formula are calculated, and no unit exists;
A. b and C are letters for simply describing matrix values, and have no specific significance;
step 244: calculating a corner response value of each pixel;
in formula (7): m is a covariance matrix;
equation (7) is here an approximate calculation equation; det (M) represents a determinant of a matrix M, trace (M) represents a Trace of the matrix, and k represents an empirical constant, and the value of k is usually 0.04 to 0.06; the whole process is still numerical calculation and has no unit;
step 245: setting a threshold value to find out possible points and carrying out non-maximum suppression, wherein the local maximum point is a final characteristic point;
step 25: with respect to feature points in front-time phase orthophoto image
Through affine transformation model, the predicted points in the rear time phase orthophoto image are carried out
The calculation of (2):
in formulas (8) and (9):a、b、c、d、e、fthe coefficients are coefficients of an affine transformation model, and have no specific meaning or unit;
x 1 、y 1 the coordinates of the characteristic points in the front time phase orthophoto image are free of units;
x 2 ’andy 2 ’representing the corresponding characteristic point coordinates obtained by prediction in the rear time phase orthophoria image without a unit;
it should be noted that in the initial model (i.e., the affine transformation model which has not been fitted for the first time is used), the parameters a =1 and e =1, and the other parameters are all 0;
step 26: for each feature point
At the predicted point of step 25
Constructing a search window with radius r as the center, adopting a correlation coefficient method, taking m multiplied by m as the size of a fixed template, calculating the correlation coefficient of each pixel in the window, and obtaining the pixel point with the maximum correlation coefficient
I.e. as corresponding homologous points:
in formula (10):m、ncolumn and row, i.e. number of rows and columns, where n = m, is the length and width of the template window; j is a count variable of the accumulated symbols; g represents a gray image of the anterior phase; g' represents the gray level image of the later time phase, and the upper and lower subscripts represent the gray level values of the corresponding position points; each parameter has no unit;
step 27: for the obtained coordinates of the same-name points, in order to prevent the image of the gross error points with the maximum value and the minimum value from existing, the gross error points are removed through the probability distribution of the standard normal distribution;
step 28: if the image is in a scale of 1; otherwise, for all the coordinates of the same-name points, the front-time phase orthographic view image coordinates
And rear time phase orthographic view image coordinate
Fitting the affine transformation model by the least square method, updating the affine transformation model parameters of the equations (8) and (9), reducing the hierarchy of the image pyramid (as shown in fig. 3), and recalculating from step 24; the invention adopts an image pyramid strategy and an affine transformation model to determine the prediction point with higher precision, greatly reduces the search window range in image matching, and continuously optimizes the model layer by layer, thereby not only improving the image matching efficiency, but also improving the precision of the homonymy point.
In the above technical solution, in step 27, the method for removing gross error points includes the following steps:
step 271: first calculating the homologous points separatelydxNamely, the corresponding coordinates before and after the homonymous point are subtracted:
step 272: for the results obtained, the centering was performed by subtracting the median value:
step 273: probability distribution according to standard normal distribution, over
The distribution probability of (2) is 68.3%; therefore, the results of step 272 are converted into absolute values, arranged in descending order, and the probabilities are accumulated from the first point, and the corresponding points with the same name and the accumulated probability of being out of 68.3% are removed:
step 274: for the result obtained in the step 273, carrying out similar step elimination on the y coordinate to obtain a coordinate of a same-name point within an error range; according to the probability distribution characteristic of standard normal distribution, the gross error points are removed by centralizing the coordinates of the homonymous points, so that the reliability of the homonymous points is further improved, the tolerance to homonymous image points of the changed ground object points is increased, the method is suitable for matching the homonymous image points of images with local ground object movement and even movement, and the usability of the deformation detection method is improved; the method solves the problem that the existing gross error elimination method is only suitable for matching images of unchanged ground objects and is very easy to judge the correct homonymous image points of the changed ground objects as gross errors.
In the above technical solution, in the third step, the same-name point is converted to a three-dimensional coordinate system, and the specific method includes:
for the characteristic points obtained in the second step, the depth data of the front-view image produced before (for a certain time phase image, the front-view image obtained after a three-dimensional model is constructed, and corresponding depth data can be generated at the same time) and the coordinates of the starting point determined in the first step are further used
And computing a rotation matrix by projecting the normal vector of the spatial plane, i.e. the homonym point (i.e. the point of identity)
) Coordinate conversion to object coordinate system
Among them:
in formula (14): x, Y and Z are coordinates of the ground object point under a geocentric space rectangular coordinate system, and the unit is meter;
wherein R is a rotation matrix from a corresponding coordinate system to a geocentric space rectangular coordinate system when the front-view image is constructed, and T represents transposition, a numerical matrix and no unit;
x ', Y ' and Z ' represent object coordinates of the ground object points in a unit of meter corresponding to a coordinate system when the front-view image is constructed;
xs, ys, and Zs are coordinates of a starting point of a corresponding coordinate system when the front view image is constructed, or coordinates of an origin of the coordinate system under a geocentric space rectangular coordinate system, and the unit is meter.
Compared with the prior art, the invention has the following advantages:
(1) The three-dimensional model is reduced into a two-dimensional front-view image to carry out image matching, the strict corresponding relation of the same ground point in two-stage data is established, and then the dimension is increased to the three-dimensional model, so that the three-dimensional homonymy point is determined, and more accurate deformation information can be extracted; according to the method, the two-dimensional front-view image corresponding to the target is established through the three-dimensional model, so that the information of complex targets such as a slope, a cliff and a bridge can be acquired to a greater extent, and the method has great significance in deformation detection research; in addition, compared with the deformation detection method based on the orthoimage, the method adopts the orthoimage to overcome the problem that the deformation detection precision is reduced because the slope scene is compressed due to the orthoimage (as shown in fig. 4, the orthoimage is a high-position steep slope orthoimage with the slope close to 90 degrees and an orthoimage contrast image, and as can be seen, the texture information of the steep slope can hardly be expressed on the orthoimage, and the slope information on the orthoimage is rich);
(2) An image pyramid strategy and an affine transformation model are adopted to determine a prediction point with higher precision, the search window range in image matching is greatly reduced, and the model is continuously optimized layer by layer, so that the image matching efficiency is improved, and the precision of the homonymy point is also improved; meanwhile, by constructing affine transformation constraint relations corresponding to the homonymous image points on the same pyramid images by multiple times, coarse difference points in the homonymous image points obtained by image matching are eliminated, and the reliability of deformation detection is improved;
(3) The method for detecting the gross error of the image matching of the changing area based on the standard normal distribution probability distribution characteristic is provided, the tolerance of the homonymous image points of the changing ground feature points is increased, the problem that the correct homonymous image points of the changing ground features are easily judged to be the gross error only by applying the matching of the images of the unchanged ground features in the existing gross error removing method is solved, and the usability of the deformation detection method is improved.
Detailed Description
The embodiments of the present invention will be described in detail with reference to the accompanying drawings, which are not intended to limit the present invention, but are merely exemplary. While the advantages of the invention will be clear and readily understood by the description.
The method comprises the steps of taking a real-scene three-dimensional model of a monitored scene as a basic data source, adopting different time-phase real-scene three-dimensional models to reduce dimensions to manufacture two-dimensional front-view images (the three-dimensional models are used for establishing the two-dimensional front-view images corresponding to targets, information of complex targets such as slopes, cliffs, bridges and the like can be obtained to a greater extent, carrying out image matching under an image pyramid strategy to obtain the same-name feature points, utilizing the front-view images to constrain the relative geometric relationship so as to eliminate wrong matching points, then upgrading the correct same-name feature points into the three-dimensional model, calculating the three-dimensional variable quantity of each same-name feature point, finally interpolating to obtain the three-dimensional deformation vector field of the monitored scene, obtaining reliable deformation information, having high detection precision, high efficiency and low cost, overcoming the defects that the prior art cannot obtain the reliable deformation information, having low detection precision and low cost, combining geographic coordinates and prediction point constraint of a transformation model, adopting the image pyramid strategy to multiply constrain the same-name point matching and quality control of the front-view images, obtaining the same-name points, upgrading the three-dimensional models, and constructing the vector field of the real-name three-dimensional models according to the true coordinate change.
Example (b): the invention will be described in detail by taking the embodiment of the invention for testing the three-dimensional deformation of the landslide of a certain terrace as an example, and has a guiding function for the three-dimensional deformation testing of the invention applied to other geographic environments.
In the embodiment, a landslide of a large terrace is taken as an example, and the landslide is positioned about 20 kilometers in the northwest upstream of a hydropower station; for the landslide, two-stage approach photography is performed respectively on 29 days in 3 months in 2021 and 25 days in 5 months in 2021, 3500 images in two stages are obtained in total, and a two-stage live-action three-dimensional model obtained through stage reconstruction is used as input data of the implementation case, as shown in fig. 5;
the general steps of deformation detection in this embodiment are shown in fig. 1 (in fig. 1, 2D represents two dimensions; and 3D represents three dimensions), and the specific steps are as follows:
step 1, generating a two-stage front view image (dimension reduction); determining the normal vector of the space projection plane by plane fitting according to the input three-dimensional models of the front and rear time phases
Generating a corresponding front-view image;
for a landslide area, firstly, according to a three-dimensional model of a front time phase, selecting a proper plane of a landslide for plane fitting, and determining a normal vector of a space projection plane as
(ii) a Calculating object space coordinate system
To projection space plane coordinate system
The rotation matrix of (2):
counting each vertex by the bounding box of the three-dimensional model, and determining the coordinates of the starting point as follows:
then any spatial point in the three-dimensional model that is in
Coordinates of (5)
And is shown in
Coordinates of (5)
The conversion relationship is as follows:
the front-view image can be obtained by converting the image into a local coordinate system and then performing gridding processing, the rear time phase image is processed in the same step, and the front-view image and the rear time phase front-view image are obtained as shown in fig. 6;
fig. 4 (a) shows a photograph of an arrow-through hole scene; fig. 4 (b) shows an arrow hole (inside a white circle) on an orthographic image; fig. 4 (c) is a front view of the arrow hole; as can be seen from the diagrams (b) and (c) in fig. 4, the slope scene caused by the orthographic image is compressed, while the information of complex targets such as a slope, a cliff, a bridge and the like can be acquired to a greater extent by the orthographic image, the slope scene is not compressed and is basically consistent with an arrow-through hole live-action photograph (i.e., the diagram (a) in fig. 4), and more accurate deformation information can be extracted by the orthographic image in the invention;
step 2, performing image matching on the two-stage front-view image; carrying out image matching on the front and rear time phase front-view image obtained in the
step 1 to obtain corresponding two-dimensional homonymy point coordinates
;
For a certain large plateau land landslide area, the variation amount of image points of deformation points in a two-stage front-view image is about 60 pixels, the resolution of the image is reduced by establishing an image pyramid as shown in fig. 3, and the scale of the topmost layer is 1;
in this case, in the top image, because the deformation amplitude is small, the coordinates of the same-name points of the front and rear time phases are very similar, the geographic coordinates of the local coordinate system are directly used as the prediction points, that is, the prediction points are the 'same-name points' of the same geographic coordinates while the features are extracted; therefore, the initial affine change model is an equivalent model, and the predicted point calculation is performed by calculating the coordinates of the homonymous points of each layer and then re-fitting the affine transformation model; for example, for an image of a scale 1; however, since the feature points extracted from the images at different scales are different, the feature points need to be continuously re-extracted when recursive image matching is performed;
the following is the process flow starting from the topmost image:
(1) For anterior phase image
Firstly, extracting characteristic points of a front time phase image through a Harris operator;
calculating the image I (x, y) at
xAnd
ygradient in two directions
I x 、I y ;
Calculating the product of two directional gradients of an image
And
;
gaussian weighting the result of the previous step by using a Gaussian function
Generating a moment M of each pixel point;
calculating the corner response of each pixel;
setting a threshold value to find out possible points and carrying out non-maximum suppression, wherein the local maximum point is a final characteristic point;
(2) With respect to feature points in front-time phase orthophoto image
Through affine transformation model, the predicted points in the rear time phase orthophoto image are carried out
The calculation of (2):
it should be noted that in the initial model, the above parameters
All other parameters are
;
(3) For each feature point
With the predicted point of step (2)
Constructing a 17 × 17 search window with the radius of 8 as the center, calculating the correlation coefficient of each pixel in the window by adopting a correlation coefficient method and taking 33 × 33 as a fixed template, wherein the pixel point with the maximum correlation coefficient is taken as the corresponding coordinate of the point with the same name
;
(4) For the obtained coordinates of the same-name points, in order to prevent the image of the gross error points with the maximum value and the minimum value from existing, the gross error points are removed through the probability distribution of the standard normal distribution;
first calculating the homologous points separately
dx,Namely, the corresponding coordinates before and after the homonymous point are subtracted:
for the results obtained, the centering was performed by subtracting the median value:
probability distribution according to standard normal distribution, over
Has a distribution probability of 68.3%; thus, the step of
The results are subjected to absolute value conversion, are arranged from small to large, accumulate the probability from the first point, and eliminate the corresponding points with the same name and the accumulated probability of being 68.3 percent:
for the step
The y coordinate is subjected to similarity step elimination to obtain a coordinate of a same name point within an error range;
(5) If the image is in a scale of 1; otherwise, for all the coordinates of the same-name points, the front-time phase orthographic view image coordinates
And rear time phase orthographic view image coordinate
Fitting an affine transformation model by a least square method, updating parameters of the affine transformation model, reducing the level of an image pyramid, and recalculating from the step (1); the image matching result is shown in fig. 7;
fig. 7 (a) shows a local area image matching result map (in fig. 7 (a), the left image is the rear time phase, and the right image is the front time phase), in which a small white circle is a matching homonymous point, the number beside the small white circle is the number thereof, and the dots encircled by the small white circles having the same number in the left image and the right image in fig. 7 (a) are a pair of homonymous image points; the graph (b) in fig. 7 is a schematic diagram of image matching with a single homonymous point, the left graph of the graph (b) in fig. 7 is a rear time phase, the right graph is a front time phase, the white small circles on the left graph and the right graph in the graph (b) in fig. 7 are positions of matched homonymous image points, and the change value of the geographic position of the homonymous image point in the left graph and the right graph in the graph (b) in fig. 7 is about 0.6 m, so that the homonymous image point is easy to be marked as an error match by a general matching algorithm, but the matching algorithm of the invention can still identify the homonymous image point as a correct homonymous image point, so that the tolerance of the homonymous image point of a changed place is increased, the usability of a deformation detection method is improved, and the deformation detection accuracy and reliability are improved; the problems that the existing gross error elimination method is only suitable for matching images of unchanged ground objects, and the correct image points with the same name of the changed ground objects are easily judged to be gross errors and eliminated, so that the deformation detection precision and reliability are reduced and the like are solved;
step 3, converting the same-name points into a three-dimensional coordinate system (ascending dimension); respectively converting corresponding homonymous points of front and rear time phases into a three-dimensional model through the parameters in the front-view image obtained in the step 1 to obtain three-dimensional homonymous point coordinates
The result of the two-phase three-dimensional model of a certain landslide according to the geographical position in this embodiment is shown in fig. 8; FIG. 8 is a registration diagram of the two-phase three-dimensional model of the pier shown in the diagram (b) of FIG. 7 (FIG. 8 is a diagram of displacement detected by absolute coordinate registration, and the deformation can be calculated according to the respective coordinates of the corresponding image points of the same name), wherein the diagram (a) of FIG. 8 is a side view and the diagram (b) of FIG. 8 is a top view; in fig. 8 (a), the black circles circle the same-name image points which have been displaced, and after the two-stage three-dimensional models are superimposed according to the geographic positions, when the same-name image points are displaced, the same-name image points are not in a registration state; as can be seen from the graph (b) in fig. 8, the displacement change of the image point of the same name displaced in the black circle is 0.61 m; the black color mark and 0.61 m in fig. 8 (b) represent the same-name image with displacement circled in fig. 8 (a)The displacement variation distance of the point is 0.61 meter;
in this case, it is only necessary to use the feature points obtained in
step 2, and then to generate the depth data of the front-view image based on the depth data of the front-view image previously generated and the coordinates of the starting point previously determined
And calculating a rotation matrix by a normal vector of the projection space plane, namely converting the coordinate of the same-name point into the coordinate system of the object space
Among them:
step 4, generating a three-dimensional change vector field; calculating the change vector of each homonymous point of the three-dimensional homonymous points obtained in the step (3), and interpolating the result to obtain a target three-dimensional change vector field; fig. 9 shows a three-dimensional change vector field of a large plateau landslide, and it can be seen from fig. 9 that in this embodiment, the three-dimensional live-action data is reduced to two-dimensional images by using the method of the present invention, and then an accurate corresponding relationship is established by image matching, and a deformation amount is calculated on the basis to perform three-dimensional deformation monitoring, so as to obtain a three-dimensional change vector field of a target (as shown by an arrow in fig. 9), which can obtain reliable deformation information, and is high in accuracy and efficiency.
The specific embodiments described herein are merely illustrative of the spirit of the invention. Various modifications or additions may be made to the described embodiments, or alternatives may be employed, by those skilled in the art, without departing from the spirit or ambit of the invention as defined in the appended claims.
Other parts not described belong to the prior art.