A three-dimensional reconstruction method, device, equipment and medium

The normalized coordinates are determined through the internal parameters of the visual sensor and dense optical flow. The Accord ratio matrix and Gauss-Newton iterative algorithm are used to solve the essential matrix, which solves the problem of insufficient stability and robustness in the three-dimensional reconstruction of the monocular camera and achieves the goal of operating in harsh environments. The three-dimensional coordinates below are accurately obtained.

CN118298113BActive Publication Date: 2024-10-01IMOTION AUTOMOTIVE TECH (SUZHOU) CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410724082.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-10-01
Estimated Expiration
2044-06-05

AI Technical Summary

Technical Problem

The existing monocular camera 3D reconstruction algorithm has high requirements for the accuracy of image feature matching points and poor robustness. Especially in harsh environments, it is difficult to solve the essential matrix, resulting in insufficient stability and robustness of 3D reconstruction.

Method used

By determining the normalized coordinates based on the internal parameters of the visual sensor and dense optical flow, using the Accord ratio matrix to construct the normal equation, and solving the degree of freedom matrix through the Gauss-Newton iterative algorithm, until the iteration stop condition is met, the target essential matrix is ​​calculated, and then the three-dimensional coordinates are determined.

Benefits of technology

The stability and robustness of the algorithm for solving the essential matrix are improved, ensuring that the three-dimensional coordinates of pixels in the image can be accurately obtained and three-dimensional reconstruction completed in harsh environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118298113B_ABST
    Figure CN118298113B_ABST
Patent Text Reader

Abstract

The present application discloses a three-dimensional reconstruction method, device, equipment and medium, which relates to the field of intelligent driving technology, including: determining the normalized coordinates of matching points in an image based on the intrinsic parameters of a visual sensor and the dense optical flow between the current frame image and the previous frame image; determining the corresponding Jacobi matrix using the essential matrix and the normalized coordinates, the essential matrix being calculated based on the degree of freedom matrix corresponding to the current iteration number; solving the normal equation constructed by the Jacobi matrix using a preset decomposition method to obtain the degree of freedom increment; if the preset iteration stop condition is not met at present, updating the current iteration number and updating the degree of freedom matrix using the degree of freedom increment, and then re-iterating until the preset iteration stop condition is met, calculating the target essential matrix corresponding to the target degree of freedom matrix, and determining the actual three-dimensional coordinates of the matching points in the current frame image according to the target essential matrix and the triangulation principle. The stability and robustness of the solution of the essential matrix are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent driving technology, and in particular to a three-dimensional reconstruction method, device, equipment and medium. Background Art

[0002] In the vehicle intelligent driving system, the camera is needed to perceive the surrounding environment in real time and locate the position of itself and the target through image features. In the case of only a monocular camera, multiple frames of continuous images are needed to construct the three-dimensional world coordinates corresponding to the pixel coordinates.

[0003] At present, the principle of 3D reconstruction using a monocular camera is based on epipolar geometry. It is necessary to solve the essential matrix between two or more consecutive frames of images and derive the 3D coordinates of the image points when the lens intrinsic parameters are known. The methods for solving the essential matrix include the eight-point method, RANSAC (RAndom SAmple Consensus) method, and the minimum reprojection error method. However, the existing algorithms for solving the essential matrix have high requirements on the accuracy of feature matching points between images and poor robustness. They may not be able to solve certain harsh environments during vehicle driving.

[0004] In summary, how to improve the stability and robustness of the algorithm for solving the essential matrix so as to use the essential matrix to accurately obtain the three-dimensional coordinates of the pixel points in the image and complete three-dimensional reconstruction is a problem that needs to be solved. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a 3D reconstruction method, device, equipment and medium, which can improve the stability and robustness of the algorithm for solving the essential matrix, so as to use the essential matrix to accurately obtain the 3D coordinates of the pixel points in the image and complete the 3D reconstruction. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses a three-dimensional reconstruction method, comprising:

[0007] Determine the normalized coordinates of matching points in the current frame image and the previous frame image based on the visual sensor internal parameters and the dense optical flow between the current frame image and the previous frame image;

[0008] Determine a Jacobi matrix corresponding to the essential matrix using the essential matrix and the normalized coordinates; wherein the essential matrix is ​​calculated based on a degree of freedom matrix corresponding to a current number of iterations;

[0009] constructing a normal equation using the Jacobi matrix, and solving the normal equation based on a preset decomposition method to obtain a solution result of a degree of freedom increment as the degree of freedom matrix;

[0010] Determine whether the preset iteration stop condition is met at present. If not, update the current iteration number and use the degree of freedom increment to update the degree of freedom matrix, and then jump to the step of calculating the essential matrix based on the degree of freedom matrix corresponding to the current iteration number, until the preset iteration stop condition is met, and determine the target degree of freedom matrix after the final iteration update based on the degree of freedom increment outputted by the last iteration;

[0011] The target intrinsic matrix is ​​calculated based on the target degree of freedom matrix, and the actual three-dimensional coordinates of the matching points in the current frame image are determined according to the target intrinsic matrix and the triangulation principle.

[0012] Optionally, determining the normalized coordinates of matching points in the current frame image and the previous frame image based on the intrinsic parameters of the visual sensor and the dense optical flow between the current frame image and the previous frame image includes:

[0013] Calculate the dense optical flow between the current frame image and the previous frame image based on a preset optical flow algorithm;

[0014] The dense optical flow is parsed to obtain pixel coordinates of matching points in the current frame image and the previous frame image, and normalized coordinates of the matching points are determined based on the pixel coordinates and internal parameters of the visual sensor.

[0015] Optionally, the calculating of the essential matrix based on the degree of freedom matrix corresponding to the current iteration number, so as to determine the Jacobi matrix corresponding to the essential matrix by using the essential matrix and the normalized coordinates, includes:

[0016] Determine a degree of freedom matrix corresponding to the current number of iterations, and use the degree of freedom matrix as an initial matrix to calculate a first essential matrix corresponding to the initial matrix; wherein the degree of freedom matrix includes a translation degree of freedom matrix and a rotation degree of freedom matrix;

[0017] Transforming each degree of freedom in the initial matrix based on a preset step size to obtain a plurality of transformed matrices, so as to calculate a second essential matrix corresponding to each of the transformed matrices;

[0018] A Jacobian matrix corresponding to the intrinsic matrix is ​​calculated based on the first intrinsic matrix, the second intrinsic matrix and the normalized coordinates.

[0019] Optionally, the calculating a Jacobian matrix corresponding to the essential matrix based on the first essential matrix, the second essential matrix and the normalized coordinates includes:

[0020] Calculating a first reprojection error based on the first essential matrix and the normalized coordinates, and calculating a second reprojection error based on the second essential matrix and the normalized coordinates;

[0021] Each item in the Jacobian ratio matrix is ​​calculated using the first reprojection error, the second reprojection error and the preset step size to construct the Jacobian ratio matrix.

[0022] Optionally, after calculating the first reprojection error based on the first essential matrix and the normalized coordinates, the method further includes:

[0023] Determining a target weight coefficient based on a comparison result of the first reprojection error and a preset reprojection error threshold;

[0024] Accordingly, the normal equation is constructed by using the Jacobi matrix, including:

[0025] A normal equation is constructed using the target weight coefficient and the Jacobian ratio matrix.

[0026] Optionally, determining a target weight coefficient based on a comparison result of the first reprojection error and a preset reprojection error threshold includes:

[0027] Obtaining a preset reprojection error threshold; wherein the preset reprojection error threshold includes a first error threshold and a second error threshold;

[0028] Calculating a difference between the first error threshold and the absolute value of the first reprojection error, and determining whether the difference is greater than zero;

[0029] If the difference is greater than zero, and the absolute value of the first reprojection error is greater than the second error threshold, calculating a target weight coefficient based on the first error threshold and the absolute value of the first reprojection error;

[0030] If the difference is greater than zero, and the absolute value of the first reprojection error is not greater than the second error threshold, determining a target weight coefficient based on a preset first default value;

[0031] If the difference is not greater than zero, the target weight coefficient is determined based on a preset second default value.

[0032] Optionally, the preset iteration stop condition includes a first stop condition set based on a maximum number of iterations and a second stop condition set based on a reprojection error, and the preset reprojection error threshold includes a third error threshold;

[0033] Accordingly, the determining whether the preset iteration stop condition is currently met includes:

[0034] Determine whether the current number of iterations is less than the maximum number of iterations;

[0035] Or, counting the sum of the first reprojection errors corresponding to all matching points in this iteration, and determining whether the sum is less than the third error threshold;

[0036] If the current number of iterations is not less than the maximum number of iterations, or if the sum is less than the third error threshold, it is determined that the preset iteration stop condition is currently met.

[0037] Optionally, determining the actual three-dimensional coordinates of the matching points in the current frame image according to the target intrinsic matrix and the triangulation principle includes:

[0038] Determining the normalized three-dimensional coordinates of the matching points in the current frame image according to the target essential matrix and the triangulation principle;

[0039] Determine the actual displacement of the vehicle between the previous frame image and the current frame image according to the motion information of the vehicle, and determine the displacement of the center of the rear axle of the vehicle according to the displacement matrix in the target intrinsic matrix and the camera extrinsic parameter;

[0040] The actual three-dimensional coordinates of the matching points in the current frame image are calculated based on the normalized three-dimensional coordinates, the actual displacement and the displacement of the center of the rear axle of the vehicle.

[0041] In a second aspect, the present application discloses a three-dimensional reconstruction device, comprising:

[0042] A normalized coordinate calculation module, used to determine the normalized coordinates of matching points in the current frame image and the previous frame image based on the internal parameters of the visual sensor and the dense optical flow between the current frame image and the previous frame image;

[0043] A matrix calculation module, used to determine a Jacobi matrix corresponding to the essential matrix using an essential matrix and the normalized coordinates; wherein the essential matrix is ​​calculated based on a degree of freedom matrix corresponding to a current number of iterations;

[0044] An incremental solution module, used for constructing a normal equation using the Jacobi matrix, and solving the normal equation based on a preset decomposition method to obtain a solution result of a degree of freedom increment as the degree of freedom matrix;

[0045] An iteration module, used to determine whether a preset iteration stop condition is currently satisfied, and if not satisfied, to update the current iteration number and update the degree of freedom matrix using the degree of freedom increment, and then jump back to the step of calculating the essential matrix based on the degree of freedom matrix corresponding to the current iteration number, until the preset iteration stop condition is satisfied, and then determine the target degree of freedom matrix after the final iteration update based on the degree of freedom increment outputted by the last iteration;

[0046] The three-dimensional coordinate calculation module is used to calculate the target essential matrix based on the target degree of freedom matrix, and determine the actual three-dimensional coordinates of the matching points in the current frame image according to the target essential matrix and the triangulation principle.

[0047] In a third aspect, the present application discloses an electronic device, comprising:

[0048] Memory, used to store computer programs;

[0049] A processor is used to execute the computer program to implement the steps of the above-disclosed three-dimensional reconstruction method.

[0050] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed three-dimensional reconstruction method are implemented.

[0051] It can be seen that the present application determines the normalized coordinates of the matching points in the current frame image and the previous frame image based on the intrinsic parameters of the visual sensor and the dense optical flow between the current frame image and the previous frame image; determines the Jacobi matrix corresponding to the essential matrix using the essential matrix and the normalized coordinates; wherein the essential matrix is ​​calculated based on the degree of freedom matrix corresponding to the current iteration number; constructs a normal equation using the Jacobi matrix, and solves the normal equation based on a preset decomposition method to obtain a solution result of the degree of freedom increment as the degree of freedom matrix; determines whether the preset iteration stop condition is currently met, if not, updates the current iteration number and updates the degree of freedom matrix using the degree of freedom increment, and then jumps back to the step of calculating the essential matrix based on the degree of freedom matrix corresponding to the current iteration number, until the preset iteration stop condition is met, determines the target degree of freedom matrix after the final iteration update based on the degree of freedom increment output by the last iteration; calculates the target essential matrix based on the target degree of freedom matrix, and determines the actual three-dimensional coordinates of the matching points in the current frame image according to the target essential matrix and the triangulation principle.

[0052] Beneficial effects: The present application needs to obtain the dense optical flow between the current frame image and the previous frame image, so as to determine the normalized coordinates of the matching points in the current frame image and the previous frame image by using the dense optical flow and the internal parameters of the visual sensor. Since the dense optical flow is more stable in extracting image feature points, it can provide more and more stable inputs for the essential matrix, thereby reducing the influence of noise and improving the stability of the algorithm. Furthermore, the present application needs to calculate the essential matrix based on the degree of freedom matrix corresponding to the current number of iterations, and then use the essential matrix and the normalized coordinates to determine the Jacobi matrix corresponding to the essential matrix. In order to solve the essential matrix, the present application uses the Jacobi matrix to construct the normal equation, and solves the normal equation based on the preset decomposition method, and uses the Gauss-Newton iterative algorithm to iteratively solve until the preset iteration stop condition is met to obtain the target degree of freedom matrix. Finally, the target essential matrix is ​​calculated by the target degree of freedom matrix, and the actual three-dimensional coordinates of the matching points in the current frame image are determined according to the target essential matrix and the triangulation principle. In the above scheme, dense optical flow is used as input, and the preset decomposition method and Gauss-Newton iterative algorithm are used to solve the essential matrix, thereby improving the stability and robustness of the algorithm. The essential matrix is ​​then used to accurately obtain the three-dimensional coordinates of the pixel points in the image to complete the three-dimensional reconstruction. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0054] Figure 1 A flow chart of a three-dimensional reconstruction method disclosed in this application;

[0055] Figure 2 A projection schematic diagram disclosed in this application;

[0056] Figure 3 A flow chart of a specific three-dimensional reconstruction method disclosed in this application;

[0057] Figure 4 A schematic diagram of a three-dimensional reconstruction process disclosed in this application;

[0058] Figure 5 A schematic diagram of the structure of a three-dimensional reconstruction device disclosed in this application;

[0059] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0061] The existing algorithm for solving the essential matrix has high requirements for the accuracy of feature matching points between images, and has poor robustness, and may not be able to solve in certain harsh environments during vehicle driving. To this end, the embodiment of the present application discloses that the existing algorithm for solving the essential matrix has high requirements for the accuracy of feature matching points between images, and has poor robustness, and may not be able to solve in certain harsh environments during vehicle driving.

[0062] See also Figure 1 As shown, the embodiment of the present application discloses a three-dimensional reconstruction method, which includes:

[0063] Step S11: determining the normalized coordinates of matching points in the current frame image and the previous frame image based on the visual sensor internal parameters and the dense optical flow between the current frame image and the previous frame image.

[0064] In this embodiment, it is necessary to obtain the dense optical flow between the current frame image and the previous frame image, so as to determine the normalized coordinates of the matching points in the current frame image and the previous frame image using the dense optical flow and the visual sensor internal parameters. Since the dense optical flow is more stable in extracting image feature points, it can provide more and more stable inputs for the essential matrix, thereby reducing the impact of noise and improving the stability of the algorithm.

[0065] In a specific embodiment, the above-mentioned determination of the normalized coordinates of the matching points in the current frame image and the previous frame image based on the visual sensor internal parameters and the dense optical flow between the current frame image and the previous frame image includes: calculating the dense optical flow between the current frame image and the previous frame image based on a preset optical flow algorithm; parsing the dense optical flow to obtain the pixel coordinates of the matching points in the current frame image and the previous frame image, and determining the normalized coordinates of the matching points based on the pixel coordinates and the visual sensor internal parameters. It should be pointed out that the embodiment of the present application does not limit the specific preset optical flow algorithm, as long as the dense optical flow between the current frame image and the previous frame image can be calculated, for example, it can be a Farneback optical flow algorithm. That is, the present application first uses the Farneback optical flow method to calculate the dense optical flow between the two consecutive frames of the monocular camera, and then parses the dense optical flow to obtain the pixel coordinates of all matching points in the current frame image and the previous frame image, wherein the pixel point is recorded as (X, Y), and correspondingly, the pixel coordinates of the matching point in the previous frame image are recorded as (X, Y). 1 , Y1 ), the pixel coordinates of the matching point in the current frame image are marked as (X 2 , Y 2 ), and then obtain the lens internal parameters, including the distortion coefficient recorded as matrix K, K is generally a 3x3 matrix, and then determine the normalized coordinates of the matching point based on the pixel coordinates and the visual sensor internal parameters. The calculation formula for the normalized coordinates (x, y) is:

[0066] x=KX, y=KY;

[0067] Then the normalized coordinates of the matching point in the previous frame image are (x 1 ,y 1 ), the normalized coordinates of the matching point in the current frame image are (x 2 ,y 2 ).

[0068] Step S12: using the essential matrix and the normalized coordinates to determine the Jacobian matrix corresponding to the essential matrix; wherein the essential matrix is ​​calculated based on the degree of freedom matrix corresponding to the current number of iterations.

[0069] In this embodiment, it is necessary to calculate the essential matrix based on the degree of freedom matrix corresponding to the current number of iterations, and then use the essential matrix and normalized coordinates to determine the Jacobi matrix corresponding to the essential matrix. It can be understood that the essential matrix can be determined by the five degrees of freedom in the degree of freedom matrix, and the degree of freedom matrix is ​​recorded as Q=[tx, ty, r1, r2, r3], where the first two degrees of freedom represent translation, that is, [tx, ty] can be constructed to obtain the translational degree of freedom matrix T, and the last three degrees of freedom represent rotation, that is, [r1, r2, r3] can be constructed to obtain the rotational degree of freedom matrix R, and Rodriguez is used to represent the rotation for easy calculation. The essential matrix E=[T] x R, where [T] x It is about the degree of freedom t i The antisymmetric matrix of (i=x,y).

[0070] It should be noted that the translational freedom matrix T is a 1×3 vector, and the third element is usually assumed to be 0, so T contains two unknowns, namely the two degrees of freedom tx and ty. The rotational freedom matrix R is a 3×3 matrix, which can be converted by Euler angles or Rodrigues vectors. Here, Rodrigues angles are used, which are the three degrees of freedom r1, r2, and r3.

[0071] According to the definition of the essential matrix in epipolar geometry, 0 = x 1 Ex 2 , where x is the normalized coordinate, and E is the essential matrix. The core of the present invention is to use the least squares principle to fit all the matching points to obtain E.

[0072] Step S13: constructing a normal equation using the Jacobi matrix, and solving the normal equation based on a preset decomposition method to obtain a solution result of a degree of freedom increment as the degree of freedom matrix.

[0073] In this embodiment, in order to solve the essential matrix, the present application constructs the normal equation using the Jacobi matrix, and solves the normal equation based on a preset decomposition method to obtain a solution result of the degree of freedom increment as the degree of freedom matrix. The preset decomposition method may be a modified Cholesky decomposition method, or a matrix decomposition method such as an LDLT decomposition method or a Crout decomposition method.

[0074] Step S14: Determine whether the preset iteration stop condition is currently met. If not, update the current iteration number and use the degree of freedom increment to update the degree of freedom matrix, and then jump again to the step of calculating the essential matrix based on the degree of freedom matrix corresponding to the current iteration number, until the preset iteration stop condition is met, and determine the target degree of freedom matrix after the final iterative update based on the degree of freedom increment output by the last iteration.

[0075] In order to solve the essential matrix, this embodiment uses the modified Cholesky decomposition method and the Gauss-Newton iterative algorithm for iterative solution. Specifically, after each iteration is completed, it is necessary to determine whether the preset iteration stop condition is met. If not, it means that the iteration has not ended yet, and it is necessary to update the current number of iterations and use the degree of freedom increment to update the degree of freedom matrix, and then jump back to the step of calculating the essential matrix based on the degree of freedom matrix corresponding to the current number of iterations, until the preset iteration stop condition is met, and the target degree of freedom matrix after the final iteration update is determined based on the degree of freedom increment output by the last iteration. This application improves the stability and robustness of the algorithm by solving the essential matrix using the modified Cholesky decomposition and Gauss-Newton iterative algorithm.

[0076] Step S15: Calculate the target essential matrix based on the target degree of freedom matrix, and determine the actual three-dimensional coordinates of the matching points in the current frame image according to the target essential matrix and the triangulation principle.

[0077] In this embodiment, the target essential matrix is ​​calculated based on the target degree of freedom matrix, and the actual three-dimensional coordinates of the matching points in the current frame image are determined according to the target essential matrix and the triangulation principle.

[0078] In a specific implementation, the above-mentioned determining the actual three-dimensional coordinates of the matching points in the current frame image according to the target essential matrix and the principle of triangulation includes: determining the normalized three-dimensional coordinates of the matching points in the current frame image according to the target essential matrix and the principle of triangulation; determining the actual displacement of the vehicle between the previous frame image and the current frame image according to the motion information of the vehicle, and determining the displacement of the center of the rear axle of the vehicle according to the displacement matrix in the target essential matrix and the camera extrinsic parameters; calculating the actual three-dimensional coordinates of the matching points in the current frame image based on the normalized three-dimensional coordinates, the actual displacement and the displacement of the center of the rear axle of the vehicle.

[0079] like Figure 2 As shown, according to the principle of epipolar geometry, the projection of point P in the world coordinate system at the two positions of the camera is p 1 and p 2 , O 1 and O 2 is the optical center of the camera at different positions. 1 and p 2 The normalized coordinates of are known and can be solved as described above to obtain O 1 , O 2 The essential matrix of , and the rotational freedom matrix R and translational freedom matrix T corresponding to the essential matrix.

[0080] By 1 x 1 =s 2 Rx 2 +T, where s 1 and 2 The actual 3D coordinates of the matching points in the previous frame image and the current frame image are respectively matched. The purpose of this embodiment is to solve the 3D information of the current image frame, that is, s2. Therefore, multiply both sides of the above formula by x. 1 ^Get:

[0081] s 1 x 1 ^x 1 =0=s 2 x 1 ^Rx 2 +x 1 ^T;

[0082] Among them, ^ is used to represent antisymmetry, that is, x 1 ^ is x 1 The antisymmetric matrix of ;

[0083] According to the above formula, the normal equation A is constructed T Ax=A T b;

[0084] It can be deduced that A=x1 ^Rx 2 , b = -x 1 ^T.

[0085] Finally, we get s 2 , due to the uncertainty of scale, the displacement T is a normalized representation, so the obtained three-dimensional coordinate s 2 There is a linear coefficient difference from the actual scale. To restore the scale, it is also necessary to use the body sensor to obtain the vehicle's own motion information between the two frames of images, including vehicle speed, yaw angular velocity and steering wheel angle, so as to calculate the actual displacement T of the vehicle between the two frames of images. v =(X v , Y v , Z v ). Then, according to the camera external parameters, the camera displacement T is calculated through coordinate transformation to obtain the displacement T'= (X', Y', Z') of the center of the rear axle of the vehicle, and T is calculated respectively. v and the Euclidean length of T', and finally the actual three-dimensional coordinates with scale are obtained.

[0086] Actual 3D coordinates = .

[0087] It can be seen that the present application determines the normalized coordinates of the matching points in the current frame image and the previous frame image based on the intrinsic parameters of the visual sensor and the dense optical flow between the current frame image and the previous frame image; determines the Jacobi matrix corresponding to the essential matrix using the essential matrix and the normalized coordinates; wherein the essential matrix is ​​calculated based on the degree of freedom matrix corresponding to the current iteration number; constructs a normal equation using the Jacobi matrix, and solves the normal equation based on a preset decomposition method to obtain a solution result of the degree of freedom increment as the degree of freedom matrix; determines whether the preset iteration stop condition is currently met, if not, updates the current iteration number and updates the degree of freedom matrix using the degree of freedom increment, and then jumps back to the step of calculating the essential matrix based on the degree of freedom matrix corresponding to the current iteration number, until the preset iteration stop condition is met, determines the target degree of freedom matrix after the final iteration update based on the degree of freedom increment output by the last iteration; calculates the target essential matrix based on the target degree of freedom matrix, and determines the actual three-dimensional coordinates of the matching points in the current frame image according to the target essential matrix and the triangulation principle.

[0088] Beneficial effects: The present application needs to obtain the dense optical flow between the current frame image and the previous frame image, so as to determine the normalized coordinates of the matching points in the current frame image and the previous frame image by using the dense optical flow and the internal parameters of the visual sensor. Since the dense optical flow is more stable in extracting image feature points, it can provide more and more stable inputs for the essential matrix, thereby reducing the influence of noise and improving the stability of the algorithm. Furthermore, the present application needs to calculate the essential matrix based on the degree of freedom matrix corresponding to the current number of iterations, and then use the essential matrix and the normalized coordinates to determine the Jacobi matrix corresponding to the essential matrix. In order to solve the essential matrix, the present application uses the Jacobi matrix to construct the normal equation, and solves the normal equation based on the preset decomposition method, and uses the Gauss-Newton iterative algorithm to iteratively solve until the preset iteration stop condition is met to obtain the target degree of freedom matrix. Finally, the target essential matrix is ​​calculated by the target degree of freedom matrix, and the actual three-dimensional coordinates of the matching points in the current frame image are determined according to the target essential matrix and the triangulation principle. In the above scheme, dense optical flow is used as input, and the preset decomposition method and Gauss-Newton iterative algorithm are used to solve the essential matrix, thereby improving the stability and robustness of the algorithm. The essential matrix is ​​then used to accurately obtain the three-dimensional coordinates of the pixel points in the image to complete the three-dimensional reconstruction.

[0089] See also Figure 3 and Figure 4 As shown, the embodiment of the present application discloses a specific three-dimensional reconstruction method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically, it includes:

[0090] Step S21: determining the normalized coordinates of matching points in the current frame image and the previous frame image based on the visual sensor internal parameters and the dense optical flow between the current frame image and the previous frame image.

[0091] Step S22: Determine the degree of freedom matrix corresponding to the current number of iterations, and use the degree of freedom matrix as an initial matrix to calculate a first essential matrix corresponding to the initial matrix; wherein the degree of freedom matrix includes a translation degree of freedom matrix and a rotation degree of freedom matrix.

[0092] In this embodiment, the degree of freedom matrix corresponding to the current iteration number is used as the initial matrix to calculate the first essential matrix E corresponding to the initial matrix. 0 It should be noted that in the first iteration, an initial degree of freedom matrix Q = [0, 0, 0, 0] can be set, and in subsequent iterations, it can be updated in real time based on the known vehicle motion in the previous frame.

[0093] Step S23: transform each degree of freedom in the initial matrix based on a preset step size to obtain several transformed matrices to calculate the second essential matrix corresponding to each transformed matrix; calculate the Jacobian ratio matrix corresponding to the essential matrix based on the first essential matrix, the second essential matrix and the normalized coordinates.

[0094] In this embodiment, each degree of freedom in the initial matrix is ​​transformed based on a preset step size to obtain a number of transformed matrices to calculate the second essential matrix Ei corresponding to each transformed matrix. For example, assuming that the preset step size delta=0.0005, the essential matrix corresponding to each degree of freedom in the initial matrix plus delta is calculated respectively. Since there are five degrees of freedom, five essential matrices Ei can be obtained, where i∈[1,5].

[0095] Take the calculation of E1 as an example:

[0096] T1=[t x +0.0005,t y ,0], according to T1, we get its antisymmetric matrix [T1] x ;

[0097] R1=[r1, r2, r3]=[0, 0, 0], where the rotation matrix R1 is obtained according to the transformation formula of Rodriguez and the rotation matrix;

[0098] That is, the corresponding Q1=[0.0005, 0, 0, 0], and the calculated E1=[T1] x R.

[0099] Similarly, according to Q2=[0, 0.0005, 0, 0, 0], E2 is calculated, according to Q3=[0, 0, 0.0005, 0, 0], E3 is calculated according to Q4=[0, 0, 0, 0.0005, 0], E4 is calculated according to Q5=[0, 0, 0, 0.0005], and E5 is calculated according to Q5=[0, 0, 0, 0.0005].

[0100] In a specific implementation, the above-mentioned calculation of the Jacobian ratio matrix corresponding to the essential matrix based on the first essential matrix, the second essential matrix and the normalized coordinates includes: calculating the first reprojection error based on the first essential matrix and the normalized coordinates, and calculating the second reprojection error based on the second essential matrix and the normalized coordinates; using the first reprojection error, the second reprojection error and the preset step size to calculate each item in the Jacobian ratio matrix to construct the Jacobian ratio matrix.

[0101] That is, this embodiment needs to calculate the Jacobian matrix of the essential matrix: ∂f(q) / ∂q=△f(q) / delta=(x 1 Ei x 2 –x 1 E 0 x 2 ) / delta, where q represents the degree of freedom in the degree of freedom matrix. Specifically, we need to calculate ∂f / ∂tx, ∂f / ∂ty, ∂f / ∂r1, ∂f / ∂r2, ∂f / ∂r3. 1 E 0 x 2 Based on the first essential matrix E 0 and the normalized coordinate x 1 、x 2 The calculated first projection error is denoted by e 0 ;x 1 E i x 2 Based on the second essential matrix Ei and the normalized coordinate x 1 、x 2 The calculated second projection error is denoted as e i The i-th item in the Jacobi matrix is:

[0102] Jac i =(e i –e 0 ) / delta=(x 1 E i x 2 –x 1 E 0 x 2 ) / delta, where i=1,2,3,4,5.

[0103] Step S24: constructing normal equations using the Jacobi matrix, and solving the normal equations based on a modified Cholesky decomposition method to obtain a solution result of a degree of freedom increment as the degree of freedom matrix.

[0104] It should be pointed out that in order to reduce the impact of noise, the target weight coefficient can also be calculated. Specifically, after calculating the first reprojection error based on the first essential matrix and the normalized coordinates, it also includes: determining the target weight coefficient based on the comparison result of the first reprojection error and the preset reprojection error threshold; correspondingly, the use of the Jacobi ratio matrix to construct the normal equation includes: using the target weight coefficient and the Jacobi ratio matrix to construct the normal equation. That is, the present application can determine the target weight coefficient based on the comparison result of the first reprojection error and the preset reprojection error threshold, and further use the target weight coefficient and the Jacobi ratio matrix to construct the normal equation, wherein the smaller the error, the larger the weight coefficient, and vice versa. The weight coefficient can reduce the impact of noise.

[0105] In a specific implementation, the above-mentioned determination of the target weight coefficient based on the comparison result of the first reprojection error and the preset reprojection error threshold includes: obtaining a preset reprojection error threshold; wherein the preset reprojection error threshold includes a first error threshold and a second error threshold; calculating the difference between the first error threshold and the absolute value of the first reprojection error, and determining whether the difference is greater than zero; if the difference is greater than zero, and the absolute value of the first reprojection error is greater than the second error threshold, then calculating the target weight coefficient based on the first error threshold and the absolute value of the first reprojection error; if the difference is greater than zero, and the absolute value of the first reprojection error is not greater than the second error threshold, then determining the target weight coefficient based on a preset first default value; if the difference is not greater than zero, then determining the target weight coefficient based on a preset second default value.

[0106] It can be understood that the preset reprojection error threshold includes a first error threshold and a second error threshold, wherein the first error threshold is specifically the outlier threshold, i.e., the outer point threshold, and the second error threshold is specifically the inlier threshold. The difference between the absolute value of the first error threshold and the first reprojection error is recorded as diff, i.e., diff=outlier threshold-abs(e 0 ).

[0107] When the difference diff is greater than zero, the calculation is as follows:

[0108] ;

[0109] That is, when the difference diff is greater than zero, and the absolute value of the first reprojection error is greater than the second error threshold, the target weight coefficient is the difference between the first error threshold and the absolute value of the first reprojection error; when the difference diff is greater than zero, and the absolute value of the first reprojection error is not greater than the second error threshold, the target weight coefficient is set to a preset first default value, for example, 0.0006. It should be pointed out that 0.0006 in the above formula is only a specific example in the embodiment of the present application, and can be adjusted according to actual conditions.

[0110] When the difference diff is not greater than zero, the target weight coefficient is set to a preset second default value of 0.

[0111] Since all pixels need to be traversed, the amount of calculation is large. In order to improve the calculation efficiency, a multi-threaded approach can be used to divide the input dense optical flow into multiple parts, for example, into 8 parts, and then enable 8 threads to calculate the Jacobi matrix for each pixel of the dense optical flow. Finally, the calculation results of all the pixels are summed up to improve the calculation efficiency.

[0112] This embodiment uses the target weight coefficient and the Jacobian ratio matrix to construct the normal equation AX 0 =b, where X 0 The increment of degrees of freedom corresponding to the degree of freedom matrix that needs to be solved.

[0113] in, , ; i∈[1,5], j∈[i+1,5].

[0114] Finally, we get a 5x5 matrix A and a 5x1 column vector b, and then use the modified Cholesky decomposition method to solve the degree of freedom increment △Q.

[0115] Before solving the normal equation, it is necessary to determine whether the normal equation is represented by A. T Whether the matrix composed of A is symmetrical, the equation has a solution only when it is symmetrical.

[0116] The principle of solving the modified Cholesky decomposition method is as follows:

[0117] A=LDL T ;

[0118] LDy=b;

[0119] L T X 0 =y;

[0120] Among them, L is a lower triangular matrix with diagonal elements of 1, D is a diagonal matrix, and after decomposing A, we have LDL T X 0 =b, then we can first solve for y in LDy=b, and then continue to solve for L T X=y Solve to get X 0 .

[0121] Among them, a correction amount E is calculated in the modified Cholesky decomposition process 5x1 , judge E 5x1 The normal equation is solvable only when the absolute value of each element is a minimum value close to zero;

[0122] Specific decomposition process: A=LDL T ;

[0123] Calculate the upper limit of a modified positive definite factor, n=5;

[0124] ;

[0125] in, , , i≠j;

[0126] Calculate the j-th row element of the L matrix:

[0127] , i ≥ j;

[0128] Update the i-th row and j-th column of matrix A:

[0129] , i ≥ j;

[0130] Find the maximum value of the jth column of the lower triangular matrix in A and record it as θ j :

[0131] ;

[0132] Compute the diagonal elements d of the diagonal matrix D j :

[0133] ;

[0134] Calculate the correction vector E j =d j -A ii ;

[0135] Update the diagonal elements of matrix A ii :

[0136] .

[0137] Step S25: Determine whether the preset iteration stop condition is currently met. If not, update the current iteration number and use the degree of freedom increment to update the degree of freedom matrix, and then jump again to the step of calculating the essential matrix based on the degree of freedom matrix corresponding to the current iteration number, until the preset iteration stop condition is met, and determine the target degree of freedom matrix after the final iterative update based on the degree of freedom increment output by the last iteration.

[0138] In this embodiment, it is determined whether the preset iteration stop condition is met. If not, the current iteration number is updated and the degree of freedom matrix is ​​updated using the degree of freedom increment. That is, the degree of freedom matrix Q corresponding to the current iteration number is added with the degree of freedom increment △Q to obtain a new input value, and then the process jumps again to the step of calculating the essential matrix based on the degree of freedom matrix corresponding to the current iteration number to perform iterative operations until the preset iteration stop condition is met, and the final solution is obtained to calculate the target degree of freedom matrix.

[0139] Specifically, the preset iteration stop condition includes a first stop condition set based on the maximum number of iterations and a second stop condition set based on the sum of reprojection errors, and the preset reprojection error threshold includes a third error threshold; accordingly, the judgment of whether the preset iteration stop condition is currently met includes: judging whether the current number of iterations is less than the maximum number of iterations; or, counting the sum of the first reprojection errors corresponding to all matching points in this iteration, and judging whether the sum is less than the third error threshold; if the current number of iterations is not less than the maximum number of iterations, or, if the sum is less than the third error threshold, it is determined that the preset iteration stop condition is currently met.

[0140] That is, when the current number of iterations is not less than the maximum number of iterations, or the sum of the first reprojection errors corresponding to all matching points is less than the third error threshold, the iteration is stopped.

[0141] Step S26: Calculate the target intrinsic matrix based on the target degree of freedom matrix, and determine the actual three-dimensional coordinates of the matching points in the current frame image according to the target intrinsic matrix and the triangulation principle.

[0142] For more specific processing procedures of the above steps S21 and S26, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described in detail here.

[0143] It can be seen that the implementation of this application requires that the degree of freedom matrix corresponding to the current number of iterations be used as the initial matrix, and the first essential matrix corresponding to the initial matrix be calculated, and then the second essential matrix corresponding to each degree of freedom in the initial matrix plus the preset step size is calculated, so as to use the first essential matrix, the second essential matrix and the normalized coordinates to calculate the Jacobi matrix corresponding to the essential matrix. In addition, in order to reduce the impact of noise, the first reprojection error can also be calculated based on the first essential matrix and the normalized coordinates, so as to determine the target weight coefficient based on the comparison result of the first reprojection error and the preset reprojection error threshold, so as to construct the normal equation using the target weight coefficient and the Jacobi matrix, and then solve it using the modified Cholesky decomposition and Gauss-Newton iterative algorithm, thereby improving the stability and robustness of the algorithm. In addition, this application also provides two ways to stop iteration, one is that the current number of iterations is not less than the maximum number of iterations, and the other is that the sum of the first reprojection errors corresponding to all matching points is less than the third error threshold. The above two methods can accurately determine whether the iteration can be stopped at present.

[0144] See also Figure 5 As shown, the embodiment of the present application discloses a three-dimensional reconstruction device, which includes:

[0145] A normalized coordinate calculation module 11, used to determine the normalized coordinates of matching points in the current frame image and the previous frame image based on the visual sensor internal parameters and the dense optical flow between the current frame image and the previous frame image;

[0146] A matrix calculation module 12, used to determine a Jacobi matrix corresponding to the essential matrix using an essential matrix and the normalized coordinates; wherein the essential matrix is ​​calculated based on a degree of freedom matrix corresponding to a current number of iterations;

[0147] An incremental solution module 13, configured to construct a normal equation using the Jacobi matrix, and solve the normal equation based on a preset decomposition method to obtain a solution result of a degree of freedom increment as the degree of freedom matrix;

[0148] Iteration module 14 is used to determine whether the preset iteration stop condition is currently met. If not, the current iteration number is updated and the degree of freedom matrix is ​​updated using the degree of freedom increment, and then the step of calculating the essential matrix based on the degree of freedom matrix corresponding to the current iteration number is jumped again until the preset iteration stop condition is met, and the target degree of freedom matrix after the final iteration update is determined based on the degree of freedom increment outputted from the last iteration;

[0149] The three-dimensional coordinate calculation module 15 is used to calculate the target intrinsic matrix based on the target degree of freedom matrix, and determine the actual three-dimensional coordinates of the matching points in the current frame image according to the target intrinsic matrix and the triangulation principle.

[0150] It can be seen that the present application determines the normalized coordinates of the matching points in the current frame image and the previous frame image based on the intrinsic parameters of the visual sensor and the dense optical flow between the current frame image and the previous frame image; determines the Jacobi matrix corresponding to the essential matrix using the essential matrix and the normalized coordinates; wherein the essential matrix is ​​calculated based on the degree of freedom matrix corresponding to the current iteration number; constructs a normal equation using the Jacobi matrix, and solves the normal equation based on a preset decomposition method to obtain a solution result of the degree of freedom increment as the degree of freedom matrix; determines whether the preset iteration stop condition is currently met, if not, updates the current iteration number and updates the degree of freedom matrix using the degree of freedom increment, and then jumps back to the step of calculating the essential matrix based on the degree of freedom matrix corresponding to the current iteration number, until the preset iteration stop condition is met, determines the target degree of freedom matrix after the final iteration update based on the degree of freedom increment output by the last iteration; calculates the target essential matrix based on the target degree of freedom matrix, and determines the actual three-dimensional coordinates of the matching points in the current frame image according to the target essential matrix and the triangulation principle.

[0151] Beneficial effects: The present application needs to obtain the dense optical flow between the current frame image and the previous frame image, so as to determine the normalized coordinates of the matching points in the current frame image and the previous frame image by using the dense optical flow and the internal parameters of the visual sensor. Since the dense optical flow is more stable in extracting image feature points, it can provide more and more stable inputs for the essential matrix, thereby reducing the influence of noise and improving the stability of the algorithm. Furthermore, the present application needs to calculate the essential matrix based on the degree of freedom matrix corresponding to the current number of iterations, and then use the essential matrix and the normalized coordinates to determine the Jacobi matrix corresponding to the essential matrix. In order to solve the essential matrix, the present application uses the Jacobi matrix to construct the normal equation, and solves the normal equation based on the preset decomposition method, and uses the Gauss-Newton iterative algorithm to iteratively solve until the preset iteration stop condition is met to obtain the target degree of freedom matrix. Finally, the target essential matrix is ​​calculated by the target degree of freedom matrix, and the actual three-dimensional coordinates of the matching points in the current frame image are determined according to the target essential matrix and the triangulation principle. In the above scheme, dense optical flow is used as input, and the preset decomposition method and Gauss-Newton iterative algorithm are used to solve the essential matrix, thereby improving the stability and robustness of the algorithm. The essential matrix is ​​then used to accurately obtain the three-dimensional coordinates of the pixel points in the image to complete the three-dimensional reconstruction.

[0152] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the three-dimensional reconstruction method performed by the electronic device disclosed in any of the aforementioned embodiments.

[0153] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0154] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0155] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.

[0156] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the three-dimensional reconstruction method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data transmitted from an external device received by the electronic device, the data 223 can also include data collected by its own input and output interface 25, etc.

[0157] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the three-dimensional reconstruction method steps disclosed in any of the aforementioned embodiments are implemented.

[0158] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0159] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0160] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a compact disc read-only memory (CD-ROM), or any other form of storage medium known in the art.

[0161] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0162] The above is a detailed introduction to a three-dimensional reconstruction method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A three-dimensional reconstruction method, characterized in that: include: Determine the normalized coordinates of matching points in the current frame image and the previous frame image based on the visual sensor internal parameters and the dense optical flow between the current frame image and the previous frame image; Determine a Jacobi matrix corresponding to the essential matrix using the essential matrix and the normalized coordinates; wherein the essential matrix is ​​calculated based on a degree of freedom matrix corresponding to a current number of iterations; constructing a normal equation using the Jacobi matrix, and solving the normal equation based on a preset decomposition method to obtain a solution result of a degree of freedom increment as the degree of freedom matrix; Determine whether the preset iteration stop condition is met at present. If not, update the current iteration number and use the degree of freedom increment to update the degree of freedom matrix, and then jump to the step of calculating the essential matrix based on the degree of freedom matrix corresponding to the current iteration number, until the preset iteration stop condition is met, and determine the target degree of freedom matrix after the final iteration update based on the degree of freedom increment outputted by the last iteration; Calculating a target essential matrix based on the target degree of freedom matrix, and determining actual three-dimensional coordinates of matching points in the current frame image according to the target essential matrix and triangulation principle; Wherein, the preset iteration stop condition includes a first stop condition set based on a maximum number of iterations and a second stop condition set based on a reprojection error; Accordingly, the determining whether the preset iteration stop condition is currently met includes: Determine whether the current number of iterations is less than the maximum number of iterations; Or, counting the sum of the first reprojection errors corresponding to all matching points in this iteration, and judging whether the sum is less than a third error threshold in the preset reprojection error threshold; the first reprojection error is calculated based on the first essential matrix and the normalized coordinates, and the first essential matrix is ​​the essential matrix corresponding to the degree of freedom matrix corresponding to the current iteration number; If the current number of iterations is not less than the maximum number of iterations, or if the sum is less than the third error threshold, it is determined that the preset iteration stop condition is currently met.

2. The three-dimensional reconstruction method according to claim 1, characterized in that: The determining the normalized coordinates of the matching points in the current frame image and the previous frame image based on the internal parameters of the visual sensor and the dense optical flow between the current frame image and the previous frame image includes: Calculate the dense optical flow between the current frame image and the previous frame image based on a preset optical flow algorithm; The dense optical flow is parsed to obtain pixel coordinates of matching points in the current frame image and the previous frame image, and normalized coordinates of the matching points are determined based on the pixel coordinates and internal parameters of the visual sensor.

3. The three-dimensional reconstruction method according to claim 1, characterized in that: The method of determining a Jacobian matrix corresponding to the essential matrix by using the essential matrix and the normalized coordinates includes: Determine a degree of freedom matrix corresponding to the current number of iterations, and use the degree of freedom matrix as an initial matrix to calculate a first essential matrix corresponding to the initial matrix; wherein the degree of freedom matrix includes a translation degree of freedom matrix and a rotation degree of freedom matrix; Transforming each degree of freedom in the initial matrix based on a preset step size to obtain a plurality of transformed matrices, so as to calculate a second essential matrix corresponding to each of the transformed matrices; A Jacobian matrix corresponding to the intrinsic matrix is ​​calculated based on the first intrinsic matrix, the second intrinsic matrix and the normalized coordinates.

4. The three-dimensional reconstruction method according to claim 3, characterized in that: The calculating of a Jacobian matrix corresponding to the essential matrix based on the first essential matrix, the second essential matrix and the normalized coordinates includes: Calculating a first reprojection error based on the first essential matrix and the normalized coordinates, and calculating a second reprojection error based on the second essential matrix and the normalized coordinates; Each item in the Jacobian ratio matrix is ​​calculated using the first reprojection error, the second reprojection error and the preset step size to construct the Jacobian ratio matrix.

5. The three-dimensional reconstruction method according to claim 4, characterized in that: After calculating the first reprojection error based on the first essential matrix and the normalized coordinates, the method further includes: Determining a target weight coefficient based on a comparison result of the first reprojection error and a preset reprojection error threshold; Accordingly, the normal equation is constructed by using the Jacobi matrix, including: A normal equation is constructed using the target weight coefficient and the Jacobian ratio matrix.

6. The three-dimensional reconstruction method according to claim 5, characterized in that: The determining a target weight coefficient based on a comparison result of the first reprojection error and a preset reprojection error threshold comprises: Obtaining a preset reprojection error threshold; wherein the preset reprojection error threshold includes a first error threshold and a second error threshold; Calculating a difference between the first error threshold and the absolute value of the first reprojection error, and determining whether the difference is greater than zero; If the difference is greater than zero, and the absolute value of the first reprojection error is greater than the second error threshold, calculating a target weight coefficient based on the first error threshold and the absolute value of the first reprojection error; If the difference is greater than zero, and the absolute value of the first reprojection error is not greater than the second error threshold, determining a target weight coefficient based on a preset first default value; If the difference is not greater than zero, the target weight coefficient is determined based on a preset second default value.

7. The three-dimensional reconstruction method according to any one of claims 1 to 6, characterized in that: Determining the actual three-dimensional coordinates of the matching points in the current frame image according to the target essential matrix and the triangulation principle includes: Determining the normalized three-dimensional coordinates of the matching points in the current frame image according to the target essential matrix and the triangulation principle; Determine the actual displacement of the vehicle between the previous frame image and the current frame image according to the motion information of the vehicle, and determine the displacement of the center of the rear axle of the vehicle according to the displacement matrix in the target intrinsic matrix and the camera extrinsic parameter; The actual three-dimensional coordinates of the matching points in the current frame image are calculated based on the normalized three-dimensional coordinates, the actual displacement and the displacement of the center of the rear axle of the vehicle.

8. A three-dimensional reconstruction device, characterized in that: include: A normalized coordinate calculation module, used to determine the normalized coordinates of matching points in the current frame image and the previous frame image based on the internal parameters of the visual sensor and the dense optical flow between the current frame image and the previous frame image; A matrix calculation module, used to determine a Jacobi matrix corresponding to the essential matrix using an essential matrix and the normalized coordinates; wherein the essential matrix is ​​calculated based on a degree of freedom matrix corresponding to a current number of iterations; An incremental solution module, used for constructing a normal equation using the Jacobi matrix, and solving the normal equation based on a preset decomposition method to obtain a solution result of a degree of freedom increment as the degree of freedom matrix; An iteration module, used to determine whether a preset iteration stop condition is currently satisfied, and if not satisfied, to update the current iteration number and update the degree of freedom matrix using the degree of freedom increment, and then jump back to the step of calculating the essential matrix based on the degree of freedom matrix corresponding to the current iteration number, until the preset iteration stop condition is satisfied, and then determine the target degree of freedom matrix after the final iteration update based on the degree of freedom increment outputted by the last iteration; A three-dimensional coordinate calculation module, used to calculate a target essential matrix based on the target degree of freedom matrix, and determine the actual three-dimensional coordinates of the matching points in the current frame image according to the target essential matrix and the triangulation principle; Wherein, the preset iteration stop condition includes a first stop condition set based on a maximum number of iterations and a second stop condition set based on a reprojection error; Correspondingly, the iteration module is specifically used to determine whether the current number of iterations is less than the maximum number of iterations; or, to count the sum of the first reprojection errors corresponding to all matching points in this iteration, and to determine whether the sum is less than a third error threshold in the preset reprojection error threshold; the first reprojection error is calculated based on the first essential matrix and the normalized coordinates, and the first essential matrix is ​​the essential matrix corresponding to the degree of freedom matrix corresponding to the current number of iterations; if the current number of iterations is not less than the maximum number of iterations, or, if the sum is less than the third error threshold, it is determined that the preset iteration stop condition is currently met.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the three-dimensional reconstruction method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the three-dimensional reconstruction method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method for calculating monocular video depth map

    CN107481279A

  • SLAM method and system based on monocular vision feature point matching

    CN107833245A

  • Pose positioning method of active rigid body in single-camera environment and related equipment

    CN110689577A

  • Electric power inspection robot positioning method based on multi-sensor fusion

    CN111739063A

  • SLAM system based on vehicle-mounted multi-view camera and deep neural network

    CN116664621A