Three-dimensional reconstruction method, device, and vehicle, equipment, and medium based thereon

By optimizing the triangle mesh method, the visibility of the three-dimensional reconstruction model is improved, the problem of low fitting degree of the three-dimensional reconstruction model in the existing technology is solved, and higher similarity and visual effects are achieved.

CN116704151BActive Publication Date: 2024-10-29BYD CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210183566.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-25
Publication Date
2024-10-29
Estimated Expiration
2042-02-25

AI Technical Summary

Technical Problem

Among the existing 3D reconstruction methods, the model based on 3D point cloud has low fitting degree, resulting in a large difference between the image of the 3D reconstructed object and the actual object, affecting visibility.

Method used

By obtaining the three-dimensional point cloud data of the object to be reconstructed, triangulation is performed, the insertion point is determined and new triangles are constructed, the triangle mesh is optimized to minimize the sum of angle variances, and then three-dimensional rendering is performed to improve the visibility of the model.

Benefits of technology

The similarity between the three-dimensional model and the object to be reconstructed is improved, the visual effect of the three-dimensional model is enhanced, and the visibility problem of the three-dimensional reconstruction result is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116704151B_ABST
    Figure CN116704151B_ABST
Patent Text Reader

Abstract

The present application discloses a 3D reconstruction method, apparatus, and a vehicle, equipment, and medium based thereon. After acquiring the 3D point cloud data of an object to be reconstructed, an insertion point is determined based on the principle of minimizing the sum of the angle variances corresponding to the triangles, thereby obtaining a target triangular mesh with richer shape expression information. Three-dimensional rendering is then performed based on the target triangular mesh to obtain a 3D reconstructed model corresponding to the object to be reconstructed, thereby effectively improving the similarity between the 3D model and the object to be reconstructed and improving the visual effect of the 3D model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure generally relates to the field of data processing, specifically to the field of three-dimensional reconstruction, and more particularly to a three-dimensional reconstruction method, apparatus, and a vehicle, equipment, and medium based thereon. Background Art

[0002] In the related technology, the 3D reconstruction model based on 3D point cloud has a low fitting degree, and the object after 3D reconstruction is far from the actual object image, which seriously affects the visibility of the 3D reconstruction result. Therefore, it is necessary to improve the 3D reconstruction method to improve the visibility of the 3D reconstruction result. Summary of the invention

[0003] In view of the above-mentioned defects or deficiencies in the prior art, it is desired to provide a three-dimensional reconstruction method, apparatus, and vehicles, equipment, and media based thereon to effectively improve the visibility effect after three-dimensional reconstruction.

[0004] In a first aspect, an embodiment of the present application provides a three-dimensional reconstruction method, comprising:

[0005] Acquire three-dimensional point cloud data of the object to be reconstructed;

[0006] Triangulate the two-dimensional points corresponding to the three-dimensional point cloud data to obtain a first triangular mesh;

[0007] Determine an insertion point in at least one first triangle in the first triangular mesh, and construct three second triangles using the insertion point and three vertices of the first triangle respectively; wherein the position of the insertion point is determined based on the principle of minimizing the sum of the angle variances corresponding to the three second triangles;

[0008] Respectively obtain convex quadrilaterals composed of the three second triangles and their adjacent first triangles, and for any of the convex quadrilaterals, respectively calculate the sum of the angle variances of triangles obtained from different diagonals of the convex quadrilateral, and use the two triangles with the smaller sum of the angle variances as new first triangles;

[0009] Adding the new first triangle to the first triangular mesh, and deleting the first triangle in the first triangular mesh that overlaps with the new first triangle, to obtain a target triangular mesh;

[0010] Based on the target triangular mesh, three-dimensional rendering is performed to obtain a three-dimensional reconstruction model of the object to be reconstructed.

[0011] In some embodiments, performing three-dimensional rendering based on the target triangular mesh to obtain a three-dimensional reconstruction model of the object to be reconstructed includes:

[0012] If the quantization error between the target triangular mesh and the target polygon is less than a preset error, three-dimensional rendering is performed based on the target triangular mesh to obtain a three-dimensional reconstructed model of the object to be reconstructed, and the target polygon is a contour graphic of the object to be reconstructed determined based on the image of the object to be reconstructed.

[0013] In some embodiments, if the quantization error between the target triangular mesh and the target polygon is greater than or equal to a preset error, the target triangular mesh is used as a new first triangular mesh, and the step of determining an insertion point in at least one first triangle in the first triangular mesh and subsequent steps are returned to execute until the quantization error between the obtained target triangular mesh and the target polygon is less than the preset error.

[0014] In some embodiments, the method of determining the location of the insertion point includes:

[0015] Traversing each candidate insertion point in the first triangle, and connecting the candidate insertion point with three vertices of the first triangle respectively to form three second triangles;

[0016] Obtaining the internal angle of each second triangle, and determining the angle variance corresponding to each second triangle and the sum of the angle variances corresponding to the three second triangles based on the internal angle of the second triangle;

[0017] The position of the candidate insertion point that minimizes the sum of the angle variances corresponding to the three second triangles is determined as the position of the insertion point.

[0018] In some embodiments, the method of determining the location of the insertion point includes:

[0019] sequentially calculating the sum of the angle variances of three second triangles corresponding to each candidate insertion point in the first triangle;

[0020] When it is identified that the sum of the angle variances is less than a preset threshold, the corresponding candidate insertion point whose sum of the angle variances is less than the threshold is used as the insertion point.

[0021] In some embodiments, a first triangle corresponding to a historical insertion point and three first triangles adjacent to the first triangle of the historical insertion point are obtained, and marked as unavailable triangles;

[0022] A first triangle for inserting the current insertion point is selected from other first triangles in the first triangle mesh except the unavailable triangle.

[0023] In some embodiments, when the other first triangles do not exist in the first triangle mesh, a flag of the unavailable triangle in the first triangle mesh is cleared.

[0024] In a second aspect, an embodiment of the present application provides a three-dimensional reconstruction device, including:

[0025] An acquisition module, used for acquiring three-dimensional point cloud data of an object to be reconstructed;

[0026] A triangulation module, used for triangulating the two-dimensional points corresponding to the three-dimensional point cloud data to obtain a first triangular mesh;

[0027] A first determining module, configured to determine an insertion point in at least one first triangle in the first triangular mesh, and construct three second triangles using the insertion point and three vertices of the first triangle respectively; wherein the position of the insertion point is determined based on the principle of minimizing the sum of the angle variances corresponding to the three second triangles;

[0028] A second determination module is used to respectively obtain convex quadrilaterals composed of the three second triangles and their adjacent first triangles, and for any of the convex quadrilaterals, respectively calculate the sum of the angle variances of triangles obtained from different diagonals of the convex quadrilateral, and use the two triangles with the smaller sum of the angle variances as new first triangles;

[0029] A third determining module is used to add the new first triangle to the first triangular mesh, and delete the first triangle in the first triangular mesh that overlaps with the new first triangle, so as to obtain a target triangular mesh;

[0030] The rendering module is used to perform three-dimensional rendering based on the target triangular mesh to obtain a three-dimensional reconstruction model of the object to be reconstructed.

[0031] In a third aspect, an embodiment of the present application provides a vehicle, which is provided with multiple groups of cameras, and the multiple groups of cameras are arranged on the front and rear sides, left and right sides, and roof of the vehicle or the front and rear sides, left and right sides, and bottom of the vehicle, wherein each group of cameras includes two fisheye cameras, and the vehicle also includes: a three-dimensional reconstruction device that implements the method described in the embodiment of the present application.

[0032] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the embodiment of the present application when executing the program.

[0033] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the embodiment of the present application.

[0034] The 3D reconstruction method proposed in the embodiment of the present application, after acquiring the 3D point cloud data of the object to be reconstructed, determines the insertion point based on the principle of minimizing the sum of the angle variances corresponding to the triangles, and obtains a target triangular mesh with richer shape expression information, and then performs three-dimensional rendering based on the target triangular mesh to obtain the 3D reconstructed model corresponding to the object to be reconstructed, effectively improving the similarity between the 3D model and the object to be reconstructed, and improving the visual effect of the 3D model.

[0035] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0037] Figure 1 A flowchart of a three-dimensional reconstruction method proposed in one embodiment of the present application;

[0038] Figure 2 A schematic diagram of multiple groups of cameras proposed in one embodiment of the present application;

[0039] Figure 3 A schematic diagram of the principle of selecting an insertion point proposed in one embodiment of the present application;

[0040] Figure 4-Figure 5 A schematic diagram of the principle of the minimum variance criterion proposed in one embodiment of the present application;

[0041] Figure 6 A flowchart of a three-dimensional reconstruction method proposed in another embodiment of the present application;

[0042] Figure 7 A schematic diagram of the effect of quantization error proposed in one embodiment of the present application;

[0043] Figure 8 A block diagram of a three-dimensional reconstruction device proposed in one embodiment of the present application;

[0044] Fig. 9 A schematic block diagram of a vehicle according to an embodiment of the present application;

[0045] Fig.10 The present invention is a schematic diagram of the structure of a computer system of an electronic device or a server suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION

[0046] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.

[0047] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0048] As intelligent driving technology advances with each passing day, road traffic safety has also become a focus of society. The current mature panoramic surround view system collects information about the vehicle's surrounding environment through cameras around the vehicle body, and then performs distortion correction and visual transformation processing on the image information collected by each camera, and then splices it into a panoramic video containing the vehicle and the surrounding environment, and displays it on the central control display screen to assist the driver in better operation during driving, reversing, and parking, reducing the possibility of accidents. There are two types of panoramic solutions: two-dimensional and three-dimensional. The two-dimensional panoramic system generates panoramic videos from a bird's-eye view, which can provide intuitive assisted driving for the driver; it can also provide the driver with reliable blind spot display assistance functions under conditions such as parking in parking lots, narrow or crowded roads, etc. Three-dimensional panoramic reconstruction can assist the driver in observing the driving environment of the car from multiple angles, improve the driving experience, and have better safety performance. It is the trend of visual enhancement safety systems.

[0049] However, the traditional fisheye camera-based surround view system has problems such as camera distortion, object shape distortion, and poor display effect. In addition, a single static fisheye camera does not have the ability to measure distance and cannot determine the distance between the vehicle and surrounding objects, which is not conducive to reminding the driver to drive safely. In order to solve the problem of object distortion in panoramic images, some scholars use optical flow technology to obtain the relative posture transformation of the camera, and then use the plane scanning method to obtain the depth image of a single perspective, and finally use the depth image to correct the panoramic image. This method is complex to calculate and difficult to ensure real-time performance, and the depth image generated in complex environments has large errors. In order to obtain the relative position of objects in panoramic images, some researchers use multi-sensor fusion methods, such as the fusion of lidar and fisheye cameras, and the fusion of ultrasonic sensors and fisheye cameras. However, lidar is expensive and difficult to popularize in the short term. Ultrasonic sensors cannot provide point cloud information of objects, and it is difficult to correct the deformation of objects in panoramic images.

[0050] Based on this, the present application proposes a three-dimensional reconstruction method, device, and vehicle, equipment, and medium based thereon to solve the above-mentioned problems.

[0051] Figure 1This is a flow chart of the three-dimensional reconstruction method proposed in an embodiment of the present application.

[0052] It should be noted that the executor of the three-dimensional reconstruction method of this embodiment is a three-dimensional reconstruction device, which can be implemented by software and / or hardware. The three-dimensional reconstruction device in this embodiment can be configured in an electronic device or in a server for controlling the electronic device, which communicates with the electronic device and controls it.

[0053] Among them, the electronic equipment in this embodiment may include but is not limited to personal computers, platform computers, smart phones, vehicle-mounted terminals and other devices. This embodiment does not specifically limit the electronic equipment.

[0054] like Figure 1 As shown, the three-dimensional reconstruction method proposed in the embodiment of the present application includes the following steps:

[0055] Step 101: Acquire three-dimensional point cloud data of an object to be reconstructed.

[0056] It should be noted that in the embodiment of the present application, the object to be reconstructed may be an object in a calibration image acquired by multiple fisheye cameras installed on a vehicle. Specifically, the measurement content involved in the present application is provided with five groups of cameras, which are arranged on the front and rear sides, left and right sides, and the roof or bottom of the vehicle, wherein each group of cameras includes two fisheye cameras.

[0057] For example, if Figure 2 As shown, the vehicle may be provided with four sets of surround view cameras and one set of top cameras or one set of bottom cameras. The top view is five sets of cameras consisting of four sets of surround view cameras and one set of top cameras, and the bottom view is five sets of cameras consisting of four sets of surround view cameras and one set of bottom cameras.

[0058] It should be understood that by setting five groups of cameras on the vehicle, the overall effect of the vehicle in five directions can be obtained through three-dimensional reconstruction, that is, the combined effect of the vehicle body surround view and the roof situation, or the combined effect of the vehicle body surround view and the bottom situation. Moreover, when the vehicle has both a roof camera and a bottom camera, the combined effect can be switched and displayed according to the user's selection, effectively improving the visibility of the three-dimensional scene.

[0059] Furthermore, the field of view of each fisheye camera is 190 degrees, and the distance between the two cameras in each group is the baseline length, wherein the baseline length can be determined according to the range of the scene to be 3D reconstructed and the requirements for modeling accuracy. Thus, any object in space can be observed by two or more cameras at the same time, further improving the accuracy of the image data used for 3D reconstruction.

[0060] In one or more embodiments, before determining the three-dimensional point cloud data based on the calibration image, each camera installed on the vehicle needs to be calibrated to determine the intrinsic parameters and extrinsic parameters of each camera.

[0061] Specifically, the camera calibration process is the process of determining the camera projection matrix. Assume that the coordinates of the inner pole coordinates corresponding to the camera are (u0, v0) in the pixel coordinate system (u, v), and the physical size of each pixel in the x-axis and y-axis directions of the image coordinate system is (dx, dy). There is a certain conversion relationship between the pixel coordinates (u, v) and the physical coordinates (x, y). Since the camera may generate images of the scene in the world coordinate system from any angle and position, the relationship between the camera coordinate system and the world coordinate system can be described by a rotation matrix R and a translation vector t. The coordinates P(x w ,y w ,z w ) and any point P(x) in the camera coordinate system c ,y c ,z c ) can be transformed into:

[0062]

[0063] Among them, R is a 3×3 orthogonal rotation matrix, t is a translation vector, and M 2 is a 4×4 matrix. Then, normalization is performed, and any point P(x c ,y c ,z c ) The imaging position p(x,y) on the image plane is the intersection of the line connecting the optical center and point P and the image plane. Among them, f is the focal length of the camera, z c is the depth coordinate of point P in the camera coordinate system. Therefore, there is a certain mapping relationship between the camera coordinates and the image coordinates of the object. Combining the above relationships, we can get point P (x w ,y w ,z w )Pixel coordinates (u,v) on the camera imaging plane:

[0064]

[0065] Among them, M 1 is the internal parameter matrix of the camera. f / dx, f / dy, u0, and v0 are only related to the internal structure of the camera and are the internal parameters of the camera. 2 It depends on the selection of the world coordinate system and the placement of the camera, and is the external parameter of the camera. 1 M 2 , M is called the imaging transformation matrix, then:

[0066]

[0067] It should be understood that the calibration of the camera is to determine the values ​​of the 3×4=12 components in the matrix M. This process can be completed through human-computer interaction and the least squares method. Specifically, first select a standard test object, select the world coordinate system, and mark several test points on the standard test object to determine the three-dimensional coordinates P(x w ,y w ,z w ), determine the pixel coordinates (u, v) of each test point in the image through human-computer interaction, substitute them into the above equation, and get the 12 components in the matrix M. Use the least squares method to solve the components in the matrix, thus completing the camera calibration.

[0068] Furthermore, in the present application, for any group of cameras, it is possible to perform stereo matching on the detected objects through calibration images captured by two cameras.

[0069] Specifically, assuming that the images captured by two cameras in any camera group are the left image and the right image, then, specify a pixel point p1(u1,v1) in the left image and find its opposite pixel point p2(u2,v2) in the right image to form a stereo pixel point pair. Finally, it is mapped to the original spatial point, which is also the core of binocular vision theory. If the pixel points p1 and p2 form a stereo point pair, corresponding to the same spatial point P(x w ,y w ,z w ), the brightness and color of the two pixels are roughly equal. If the pixel p1(u1,v1) is a feature point in the left image, then p2(u2,v2) is also the same type of feature point in the right image. In stereo matching, the limit constraints of the stereo point pairs p1(u1,v1) and p2(u2,v2) are often used. The geometric interpretation of the limit constraint condition is: the spatial point P(x w ,y w ,z w ) The pixel point p1 in the left image and the pixel point p2 in the right image must be located on the intersection of their respective camera planes and plane PO1O2. These two intersection lines are called epipolar lines. Suppose the imaging transformation matrices of the left and right cameras are M1 and M2, respectively, denoted as M1 = [M 11 m1] and M2 = [M 21 m2].

[0070] For a point P(x w ,y w ,z w ), the image coordinates in the left image and the right image are: c1U1=M1P w =[M 11 m1]P w and z c2 U2=M2P w =[M 21 m2]P w .

[0071] Among them, U=(u,v,1) T , the limit equation can be obtained from the above two equations:

[0072]

[0073] According to the limit constraint, after p1(u1,v1) is known, the dual point p2(u2,v2) is searched in the entire right image. Combined with the above physical constraints, stereo matching can be completed more accurately.

[0074] Furthermore, from the imaging transformation formula, we can know that if the two-dimensional image coordinates of a spatial point are known, then the point P(x w ,y w ,z w )The pixel coordinate formula on the camera imaging plane becomes w ,y w , z w , z c For two cameras, we can get the equations about x w ,y w , z w , z c The two limiting equations of z are eliminated. c Then we can get the limit intersection point, which is the space point P(x w ,y w ,z w ). Assume that the imaging formulas of the left and right cameras are:

[0075]

[0076]

[0077] Then, by solving the equation, we can get the three-dimensional coordinates P(x w ,y w ,z w ).

[0078] It should be understood that camera calibration is to obtain the internal and external parameters of the camera, which is the basis for 3D reconstruction, while stereo matching is to connect the two images obtained by the binocular camera and analyze the similarity of the elements in the two images. Then, the three-dimensional coordinates of the actual scene points are obtained based on the matching points and the two rays determined by the two optical centers. Based on the internal and external parameters of each camera obtained by the above calibration, the calibration images taken by a pair of fisheye cameras in each direction are used for stereo matching to obtain a dense pixel depth image, whose value represents the distance of each pixel in the image from the optical center of the camera, and each area obtained by stitching is synthesized into a three-dimensional space.

[0079] According to the above scheme, the constraints of the multi-camera can be fully utilized to constrain the spatial position of the object and obtain the dense three-dimensional structure of the scene. Through the dense three-dimensional point cloud data of the scene at different angles, the three-dimensional point cloud information at different angles in the scene is obtained, and then the scene point cloud data is smoothed using a bilateral filter to remove noise points, distortion points and external isolated points in the point cloud data in the scene, and then the three-dimensional point cloud information at different angles of the scene is matched and quasi-fused to obtain the all-round point cloud information of the scene.

[0080] In order to improve the efficiency of subsequent processing, the scene point cloud can be further simplified by using an octree-based point cloud simplification algorithm that retains edge points.

[0081] Specifically, the number of subdivision layers corresponding to the original three-dimensional point cloud data is first determined according to the original three-dimensional point cloud data, and then the three-dimensional point cloud data is divided layer by layer according to the number of subdivision layers, and the encoding value of each octree child node is calculated, and then the child nodes obtained by the octree division are stored in the order of the encoding value from small to large, among which the point cloud data with the same encoding value are stored in a unified linked list, and the data point closest to the center point of the cube corresponding to the linked list is retained, thereby compiling the simplified three-dimensional point cloud data.

[0082] It should be noted that the three-dimensional point cloud data used in the embodiments of the present application is simplified three-dimensional point cloud data.

[0083] Step 102 , triangulate the two-dimensional points corresponding to the three-dimensional point cloud data to obtain a first triangular mesh.

[0084] The first triangular mesh includes a plurality of first triangles.

[0085] In an embodiment of the present application, the three-dimensional point cloud data is projected onto a two-dimensional plane to obtain the two-dimensional points corresponding to the two-dimensional point cloud data, and the empty circumscribed circle criterion (Delaunay rule) is used for triangulation of the two-dimensional points. Among them, Delaunay triangulation is defined as if a triangulation T of the point set V contains only Delaunay edges, then the triangulation becomes a Delaunay triangulation. Delaunay edge: Assume an edge e in the set E (with two endpoints a and b), if e satisfies the following conditions, it is called a Delaunay edge: there exists a circle passing through points a and b, and the circle (note that it is inside the circle, and at most three points on the circle are in the same circle) does not contain any other points in the point set V. This feature is also called the empty circle feature.

[0086] That is to say, the present application determines the Delaunay edges of the points in the three-dimensional point cloud data based on the empty circle characteristics, and then the mesh data composed of these edges is the first triangular mesh data. Among them, the first mesh data is recorded through a convex hull linked list. The convex hull linked list records the position and connection relationship of each point in the two-dimensional point according to the preset rules, wherein, based on the position and connection relationship of each point, the triangle information composed of the two-dimensional points can be determined.

[0087] Step 103, determining an insertion point in at least one first triangle in the first triangular mesh, and constructing three second triangles using the insertion point and the three vertices of the first triangle respectively; wherein the position of the insertion point is determined based on the principle of minimizing the sum of the angle variances corresponding to the three second triangles.

[0088] The insertion point may be determined from candidate insertion points in the first triangle, and the candidate insertion point may be two-dimensional point data in the first triangle that is not used by the first triangular mesh, or may be a randomly selected point in the first triangle.

[0089] The angle variance of the second three angles can be calculated by first finding the sum of the squares of the differences between the three internal angles of the second triangle and the reference angle, then finding the average value, and using the average value as the angle variance of the second triangle. Optionally, the reference angle is 60°.

[0090] In one or more embodiments, the method of determining the position of the insertion point includes: traversing each candidate insertion point in the first triangle, connecting the candidate insertion points with the three vertices of the first triangle respectively to form three second triangles; obtaining the internal angle of each second triangle, and determining the angle variance corresponding to each second triangle and the sum of the angle variances corresponding to the three second triangles based on the internal angle of the second triangle; and determining the position of the candidate insertion point that minimizes the sum of the angle variances corresponding to the three second triangles as the position of the insertion point.

[0091] Specifically, first obtain all candidate insertion points in any first triangle, then construct three second triangles corresponding to each candidate insertion point, and calculate the angular variance of each second triangle, and then obtain the sum of the angular variances of the three second triangles corresponding to each candidate insertion point, sort the sums of multiple angular variances, and determine the candidate insertion point corresponding to the minimum sum of angular variances as the insertion point.

[0092] For example, if Figure 3 As shown, triangle ABC is the selected first triangle. When the insertion point P is determined in triangle ABC, the internal angles of the second triangle PAC, the second triangle PBC and the second triangle PAB are obtained respectively, that is, the angles of the three internal angles ∠PAC, ∠PCA and ∠CAP of the second triangle PAC, the three internal angles ∠PBC, ∠PCB and ∠CPB of the second triangle PBC and the three internal angles ∠PAB, ∠PBA and ∠BPA of the second triangle PAB are obtained, and then the angle variance formula is used to calculate the angle variances corresponding to the second triangle PAC, the second triangle PBC and the second triangle PAB respectively, and then the angle variances of the second triangle PAC, the second triangle PBC and the second triangle PAB are summed as the angle variance sum corresponding to point P. The candidate insertion points in the first triangle ABC are traversed, and the point P with the smallest angle variance sum is inserted into the first triangle ABC as the insertion point.

[0093] Among them, taking the first triangle ABC as an example, the algorithm for the triangle angle variance is:

[0094]

[0095] It should be understood that in the embodiment of the present application, the insertion point is determined based on the principle of minimizing the sum of the angle variances corresponding to the three second triangles, so that the three second triangles formed after the insertion of the insertion point can be close to an equilateral triangle, so that the surface of the reconstructed object can be smoother during the subsequent three-dimensional rendering.

[0096] In one or more embodiments, in order to reduce the amount of calculation for traversing candidate insertion points, a threshold corresponding to the sum of angle variances can be preset in advance, so that the sum of angle variances can be compared with the preset threshold when the sum of angle variances corresponding to the candidate insertion points is calculated sequentially. When the sum of angle variances is less than the preset threshold, the candidate insertion point corresponding to the sum of angle variances is directly used as the insertion point, without calculating the sum of angle variances for the candidate insertion points for which the sum of angle variances has not yet been calculated.

[0097] Specifically, the candidate insertion points in the first triangle are obtained, and the candidate insertion points are sorted in a preset order, such as the order of coordinate rules, and then the sum of the angle variances of the three second triangles corresponding to each candidate insertion point is calculated in turn according to the sorting result, and after the sum of the angle variances is calculated, the sum of the angle variances is directly compared with the preset threshold value, if the sum of the angle variances is less than the preset threshold value, the current candidate insertion point is determined as the insertion point, and subsequent operations are performed, if the sum of the angle variances is greater than or equal to the preset threshold value, the next candidate insertion point is determined from the candidate insertion point sequence and the sum of the angle variances of the three second triangles corresponding to the next candidate insertion point is calculated, until there is a candidate insertion point whose corresponding three second triangles have a sum of angle variances less than the preset threshold value, or the candidate insertion point sequence has been traversed and there is no second triangle whose sum of angle variances is less than the preset threshold value, at this time, the candidate insertion point with the smallest corresponding angle variance in the candidate insertion point sequence is determined as the insertion point.

[0098] Step 104, respectively obtain convex quadrilaterals consisting of three second triangles and their adjacent first triangles, and for any convex quadrilateral, respectively calculate the sum of the angle variances of triangles obtained based on different diagonals of the convex quadrilateral, and use the two triangles with the smallest sum of the angle variances as new first triangles.

[0099] It should be noted that the process of determining the triangles in the convex quadrilateral can be as follows: the sum of the angle variances of the two adjacent triangles constituting the convex quadrilateral in the two-dimensional plane is S1, and after exchanging the diagonals of the convex quadrilateral, the sum of the angle variances of the new two adjacent triangles is S2. If S1>S2, it is necessary to exchange the diagonals, otherwise it is not necessary.

[0100] Based on this, after determining the insertion point, obtain the three convex quadrilaterals formed by the three second triangles corresponding to the insertion point and the three adjacent first triangles. At this time, the second triangle and its adjacent first triangle are the two triangles corresponding to the convex quadrilateral. Calculate the angle variance of the current two triangles to obtain the angle variance sum, and then replace the diagonal in the convex quadrilateral from the vertex line of the second triangle to the vertex of the insertion point and the adjacent first triangle. At this time, the two triangles with the insertion point as the vertex are the two triangles corresponding to the convex quadrilateral. Calculate the angle variance of the current two triangles to obtain the angle variance sum, judge the size of the two groups of angle variance sums, and use the two triangles corresponding to the combination with the smaller angle variance sum as the new first triangles.

[0101] Therefore, by fine-tuning the convex quadrilateral composed of the second triangle based on the sum of the angle variances, the triangle optimization after the insertion point is determined is achieved, and the angle variance of the triangle formed by the points related to the insertion point is further minimized, so that the surface of the reconstructed object can be smoother during the subsequent three-dimensional rendering.

[0102] For example, as Figure 4 shown, after determining the insertion point P in the first triangle ABC, three first triangles adjacent to the sides AC, AB, and BC in the plane are determined, namely, the first triangle AEC, the second triangle AFB, and the first triangle BCD, so as to form the convex quadrilaterals AECP, AFBP, and PCDB.

[0103] Then, for the convex quadrilateral AECP, the sum of variances S11 of triangles ACE and APC when AC is the diagonal and the sum of variances S12 of triangles AEP and EPC when EP is the diagonal are calculated respectively. If S11 > S12, then EP is the target diagonal for splitting the convex quadrilateral AECP. If S11 < S12, then AC is the target diagonal for splitting the convex quadrilateral AECP. Similarly, for the convex quadrilateral AFBP, the sum of variances S21 of triangles AFB and APB when AB is the diagonal and the sum of variances S22 of triangles AFP and FBP when FP is the diagonal are calculated respectively. If S21 > S22, then FP is the target diagonal for splitting the convex quadrilateral AFBP. If S21 < S22, then AB is the target diagonal for splitting the convex quadrilateral AFBP. Similarly, for the convex quadrilateral PCDB, the sum of variances S31 of triangles BCD and PBC when BC is the diagonal and the sum of variances S32 of triangles PCD and PBD when PD is the diagonal are calculated respectively. If S31 > S32, then PD is the target diagonal for splitting the convex quadrilateral PCDB. If S31 < S32, then BC is the target diagonal for splitting the convex quadrilateral PCDB.

[0104] After calculation, as Figure 5 shown, AC, AB, and PD are the target diagonals of the convex quadrilaterals AECP, AFBP, and PCDB respectively. Then, at least one triangle with the target insertion point as the convex edge point in the two triangles obtained by splitting the convex quadrilateral along the target diagonal is obtained. That is, in the convex quadrilateral AECP, the triangle with the target diagonal AC for splitting and the target insertion point P as the convex edge point is triangle ACP. In the convex quadrilateral AFBP, the triangle with the target diagonal AB for splitting and the target insertion point P as the convex edge point is triangle ABP. In the convex quadrilateral PCDB, the triangles with the target diagonal PD for splitting and the target insertion point P as the convex edge point are triangle PCD and triangle PBD. Therefore, triangles ACP, ABP, PCD, and PBD are the updated first triangles.

[0105] Step 105: Add the new first triangles to the first triangle mesh and delete the first triangles that coincide with the positions of the new first triangles in the first triangle mesh to obtain the target triangle mesh.

[0106] That is to say, during the computer data processing process, the edge data of the triangle will gradually increase with the calculation. That is, when calculating the sum of the angle variances of the triangles in a convex quadrilateral, the triangle data generated by the calculation process is repeated with the triangle data used for updating the triangle mesh. At this time, in order to reduce the amount of cached data, the first triangle data to be replaced needs to be deleted, thereby effectively reducing the amount of data.

[0107] For example, Figure 5 For example, after determining that triangles AEC, AFB, ACP, ABP, PCD and PBD in polygon AECDBF are the new first triangles, triangles AEC, AFB, ACP, ABP, PCD and PBD are used to replace the area covered by the original polygon AECDBF. In other words, triangles AEC, AFB, ACP, ABP, PCD and PBD are used to replace the area covered by the original triangles ABC, AEC, AFB and BCD.

[0108] Step 106 , performing three-dimensional rendering based on the target triangular mesh to obtain a three-dimensional reconstructed model of the object to be reconstructed.

[0109] Therefore, the three-dimensional reconstruction method proposed in the embodiment of the present application, after acquiring the three-dimensional point cloud data of the object to be reconstructed, determines the insertion point based on the principle of minimizing the sum of the angle variances corresponding to the triangles, and obtains a target triangular mesh with richer shape expression information, and then performs three-dimensional rendering based on the target triangular mesh to obtain the three-dimensional reconstructed model corresponding to the object to be reconstructed, effectively improving the similarity between the three-dimensional model and the object to be reconstructed, and improving the visual effect of the three-dimensional model.

[0110] In one or more embodiments, performing three-dimensional rendering based on the target triangular mesh to obtain a three-dimensional reconstruction model of the object to be reconstructed includes:

[0111] If the quantization error between the target triangular mesh and the target polygon is less than a preset error, three-dimensional rendering is performed based on the target triangular mesh to obtain a three-dimensional reconstructed model of the object to be reconstructed, where the target polygon is a contour figure of the object to be reconstructed determined based on the image of the object to be reconstructed. If the quantization error between the target triangular mesh and the target polygon is greater than or equal to the preset error, the target triangular mesh is used as a new first triangular mesh, and the step of determining an insertion point in at least one first triangle in the first triangular mesh and subsequent steps are returned to execute until the quantization error between the obtained target triangular mesh and the target polygon is less than the preset error.

[0112] Among them, the target polygon can be the same set of images as the images for generating three-dimensional point cloud data, for example, images taken by multiple groups of fisheye cameras installed on a vehicle, based on which the three-dimensional point cloud data of the object to be reconstructed in a three-dimensional environment and the contour graphics in a two-dimensional plane are obtained.

[0113] The quantization error may be an error value between an edge contour formed by a target triangle mesh and a target polygon.

[0114] Optionally, edge recognition may be performed on a calibration image corresponding to the object to be reconstructed to obtain a target polygon corresponding to the object to be reconstructed. For example, the calibration image may be input into a trained edge recognition model to obtain a target polygon corresponding to the object to be reconstructed using the edge recognition model, wherein the edge recognition model may be trained using label images of road environment data such as traffic facilities, lane information, buildings, etc., so that the trained edge recognition model is more sensitive to objects in the driving environment.

[0115] Specifically, if Figure 6 As shown, after obtaining the target triangular mesh based on step 105, it is executed to determine whether the quantization error between the target triangular mesh and the target polygon is less than the preset error. If so, step 106 is executed to perform three-dimensional rendering based on the target triangular mesh to obtain a three-dimensional reconstructed model of the object to be reconstructed. If not, it returns to step 102, and the target triangular mesh is used as a new first triangular mesh to continue to determine a new insertion point, and a new target triangular mesh is obtained based on the new insertion point, and then the step of determining whether the quantization error between the target triangular mesh and the target polygon is less than the preset error is continued, until the quantization error between the obtained target triangular mesh and the target polygon is less than the preset error.

[0116] It should be understood that if all candidate insertion points generated based on the three-dimensional point cloud data are determined as insertion points, and the quantization error between the target triangular mesh and the target polygon is still greater than or equal to the preset error, a point can be randomly determined from any first triangle in the first triangular mesh as a candidate insertion point.

[0117] Therefore, as the quantization error between the target triangular mesh and the target polygon gradually decreases, the visibility of the triangular mesh gradually improves, that is, the expression effect of the triangular mesh on the three-dimensional scene gradually improves.

[0118] For example, if Figure 7 As shown in the figure, the first row shows the change of the triangle mesh generated by gradually inserting points into the triangle mesh, and the second row shows the quantization error effect of mapping the triangle mesh to the target polygon. Figure 3In the embodiment of the invention, the target polygon is a circular polygon. Thus, by inserting points in the initial triangular mesh and gradually reducing the quantization error, a target triangular mesh with a quantization error of 0.4% is finally obtained, wherein the pattern effect formed by the target triangle with a quantization error of 0.4% is much more similar to the target polygon than the initial triangular mesh.

[0119] In one or more embodiments, the first triangle corresponding to the historical insertion point and three first triangles adjacent to the first triangle of the historical insertion point are obtained and marked as unusable triangles; and the first triangle for inserting the current insertion point is selected from other first triangles in the first triangle mesh except the unusable triangle.

[0120] And, when no other first triangles exist in the first triangle mesh, the flag of the unavailable triangle in the first triangle mesh is cleared to zero.

[0121] That is to say, since the first triangle with the insertion point determined and its adjacent first triangle have been optimized based on the sum of angle variances through step 104 in the process of obtaining the target triangular mesh, in order to avoid the uneven distribution of the triangular mesh caused by excessive concentration of insertion points determined multiple times, that is, the triangles in some areas of the target triangular mesh are dense, and the triangles in some areas are sparse, thereby affecting the overall effect of triangle rendering, the present application further marks the triangles that have been optimized by the sum of angle variances as unavailable, so as to avoid repeated determination of insertion points in the same round of insertion, so that the triangles in the target triangular mesh are distributed as evenly as possible, thereby improving the smoothness of triangle rendering.

[0122] Specifically, after obtaining the first triangular mesh, after each time the insertion point is determined, the first triangle that determines the insertion point and its adjacent first triangles are marked as unusable triangles, and then the historically marked unusable triangles are obtained, and the first triangles used to determine the current insertion point are selected from the other first triangular meshes except the unusable triangles in the first triangular mesh, until the first triangles in the first triangular mesh are all marked as unusable triangles, indicating that all the first triangles in the current first triangular mesh have been optimized once based on the sum of angular variances. If it is still necessary to continue to determine the insertion point at this time, the unusable mark in the current first triangular mesh will be cleared, that is, the first triangles in the first triangular mesh will be optimized for the second time based on the sum of angular variances, and so on, until a target polygon is obtained whose quantization error with the target polygon is less than a preset threshold.

[0123] To summarize, the three-dimensional reconstruction method proposed in the embodiment of the present application, after acquiring the three-dimensional point cloud data of the object to be reconstructed, determines the insertion point based on the principle of minimizing the sum of the angle variances corresponding to the triangles, and obtains a target triangular mesh with richer shape expression information, and then performs three-dimensional rendering based on the target triangular mesh to obtain a three-dimensional reconstructed model corresponding to the object to be reconstructed, which effectively improves the similarity between the three-dimensional model and the object to be reconstructed, and improves the visual effect of the three-dimensional model.

[0124] Figure 8 A block diagram of a three-dimensional reconstruction device proposed in one embodiment of the present application.

[0125] like Figure 8 As shown, the three-dimensional reconstruction device 10 proposed in the embodiment of the present application includes:

[0126] An acquisition module 11 is used to acquire three-dimensional point cloud data of the object to be reconstructed;

[0127] A triangulation module 12 is used to triangulate the two-dimensional points corresponding to the three-dimensional point cloud data to obtain a first triangular mesh;

[0128] A first determining module 13 is used to determine an insertion point in at least one first triangle in the first triangular mesh, and construct three second triangles using the insertion point and three vertices of the first triangle respectively; wherein the position of the insertion point is determined based on the principle of minimizing the sum of the angle variances corresponding to the three second triangles;

[0129] The second determination module 14 is used to obtain convex quadrilaterals composed of three second triangles and their adjacent first triangles, and for any convex quadrilateral, calculate the sum of the angle variances of triangles obtained from different diagonals of the convex quadrilateral, and use the two triangles with the smaller sum of the angle variances as new first triangles;

[0130] A third determining module 15 is used to add the new first triangle to the first triangular mesh, and delete the first triangle in the first triangular mesh that overlaps with the new first triangle, to obtain a target triangular mesh;

[0131] The rendering module 16 is used to perform three-dimensional rendering based on the target triangle mesh to obtain a three-dimensional reconstructed model of the object to be reconstructed.

[0132] In some embodiments, the rendering module 16 is further configured to:

[0133] If the quantization error between the target triangular mesh and the target polygon is less than a preset error, three-dimensional rendering is performed based on the target triangular mesh to obtain a three-dimensional reconstructed model of the object to be reconstructed, and the target polygon is a contour graphic of the object to be reconstructed determined according to the image of the object to be reconstructed.

[0134] In some embodiments, the rendering module 16 is further configured to:

[0135] If the quantization error between the target triangular mesh and the target polygon is greater than or equal to the preset error, the target triangular mesh is used as the new first triangular mesh, and the step of determining the insertion point in at least one first triangle in the first triangular mesh and subsequent steps are returned to execute until the quantization error between the target triangular mesh and the target polygon is less than the preset error.

[0136] In some embodiments, the first determining module 13 is further configured to:

[0137] Traversing each candidate insertion point in the first triangle, and connecting the candidate insertion point with three vertices of the first triangle to form three second triangles;

[0138] Obtain the internal angle of each second triangle, and determine the angle variance corresponding to each second triangle and the sum of the angle variances corresponding to the three second triangles based on the internal angle of the second triangle;

[0139] The position of the candidate insertion point that minimizes the sum of the angle variances corresponding to the three second triangles is determined as the position of the insertion point.

[0140] In some embodiments, the first determining module 13 is further configured to:

[0141] Calculate the sum of the angle variances of the three second triangles corresponding to each candidate insertion point in the first triangle in turn;

[0142] When it is identified that the sum of the angle variances is less than a preset threshold, the corresponding candidate insertion point whose sum of the angle variances is less than the threshold is used as the insertion point.

[0143] In some embodiments, the first determining module 13 is further configured to:

[0144] Get the first triangle corresponding to the historical insertion point and three first triangles adjacent to the first triangle of the historical insertion point, and mark them as unavailable triangles;

[0145] A first triangle for determining a current insertion point is selected from other first triangles excluding unavailable triangles in the first triangle mesh.

[0146] In some embodiments, the first determining module 13 is further configured to:

[0147] When no other first triangles exist in the first triangle mesh, a flag of an unavailable triangle in the first triangle mesh is cleared to zero.

[0148] It should be understood that the units or modules described in the three-dimensional reconstruction device 10 are similar to those described in the reference Figure 1 The steps in the described method correspond to each other. Therefore, the operations and features described above for the method are also applicable to the three-dimensional reconstruction device 10 and the units contained therein, and will not be repeated here. The three-dimensional reconstruction device 10 can be pre-implemented in a browser or other security application of an electronic device, or loaded into a browser or its security application of an electronic device by downloading or the like. The corresponding units in the three-dimensional reconstruction device 10 can cooperate with the units in the electronic device to implement the solution of the embodiment of the present application.

[0149] For the several modules or units mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0150] To summarize, the three-dimensional reconstruction device proposed in the embodiment of the present application, after acquiring the three-dimensional point cloud data of the object to be reconstructed, determines the insertion point based on the principle of minimizing the sum of the angle variances corresponding to the triangles, and obtains a target triangular mesh with richer shape expression information, and then performs three-dimensional rendering based on the target triangular mesh to obtain a three-dimensional reconstructed model corresponding to the object to be reconstructed, effectively improving the similarity between the three-dimensional model and the object to be reconstructed, and improving the visual effect of the three-dimensional model.

[0151] Fig. 9 A schematic block diagram of a vehicle according to an embodiment of the present application. Fig. 9 As shown, the vehicle 100 is provided with multiple groups of cameras 110, and the multiple groups of cameras 110 are arranged on the front and rear sides, left and right sides, and the roof of the vehicle or the front and rear sides, left and right sides, and the bottom of the vehicle, wherein each group of cameras includes two fisheye cameras, and the vehicle also includes: a three-dimensional reconstruction device 10 for implementing the method described in the embodiment of the present application.

[0152] Reference below Fig.10 , Fig.10 A schematic diagram of the structure of a computer system of an electronic device or server suitable for implementing an embodiment of the present application is shown.

[0153] like Fig.10As shown, the computer system includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage part 1008 into the random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation instructions of the system are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0154] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.

[0155] In particular, according to an embodiment of the present application, the above reference flow chart Figure 2 The described process can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, the above-mentioned functions defined in the system of the present application are executed.

[0156] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium such as a computer-readable storage medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0157] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operating instructions of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the aforementioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, the boxes represented by two connections can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operating instruction, or can be implemented with a combination of dedicated hardware and computer instructions.

[0158] The units or modules involved in the embodiments of the present application may be implemented by software or hardware. The units or modules described may also be provided in a processor. For example, they may be described as follows: a processor includes an acquisition module, a segmentation module, an optimization module, and a rendering module. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves. For example, the acquisition module may also be described as "acquiring three-dimensional point cloud data determined based on a calibration image acquired by a camera".

[0159] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the three-dimensional reconstruction method described in the present application.

[0160] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

Claims

1. A three-dimensional reconstruction method, characterized in that: include: Acquire three-dimensional point cloud data of the object to be reconstructed; Triangulate the two-dimensional points corresponding to the three-dimensional point cloud data to obtain a first triangular mesh; Determine an insertion point in at least one first triangle in the first triangular mesh, and construct three second triangles using the insertion point and three vertices of the first triangle respectively; wherein the position of the insertion point is determined based on the principle of minimizing the sum of the angle variances corresponding to the three second triangles; Respectively obtain convex quadrilaterals composed of the three second triangles and their adjacent first triangles, and for any of the convex quadrilaterals, respectively calculate the sum of the angle variances of triangles obtained from different diagonals of the convex quadrilateral, and use the two triangles with the smaller sum of the angle variances as new first triangles; Adding the new first triangle to the first triangular mesh, and deleting the first triangle in the first triangular mesh that overlaps with the new first triangle, to obtain a target triangular mesh; Based on the target triangular mesh, three-dimensional rendering is performed to obtain a three-dimensional reconstruction model of the object to be reconstructed; The method of determining the position of the insertion point includes: Traversing each candidate insertion point in the first triangle, and connecting the candidate insertion point with three vertices of the first triangle respectively to form three second triangles; Obtaining the internal angle of each second triangle, and determining the angle variance corresponding to each second triangle and the sum of the angle variances corresponding to the three second triangles based on the internal angle of the second triangle; Determine the position of the candidate insertion point that minimizes the sum of the angle variances corresponding to the three second triangles as the position of the insertion point; or sequentially calculating the sum of the angle variances of three second triangles corresponding to each candidate insertion point in the first triangle; When it is identified that the sum of the angle variances is less than a preset threshold, the corresponding candidate insertion point whose sum of the angle variances is less than the threshold is used as the insertion point.

2. The method according to claim 1, characterized in that The performing three-dimensional rendering based on the target triangular mesh to obtain a three-dimensional reconstruction model of the object to be reconstructed includes: If the quantization error between the target triangular mesh and the target polygon is less than a preset error, three-dimensional rendering is performed based on the target triangular mesh to obtain a three-dimensional reconstructed model of the object to be reconstructed, and the target polygon is a contour graphic of the object to be reconstructed determined based on the image of the object to be reconstructed.

3. The method according to claim 2, characterized in that Also includes: If the quantization error between the target triangular mesh and the target polygon is greater than or equal to the preset error, the target triangular mesh is used as a new first triangular mesh, and the step of determining an insertion point in at least one first triangle in the first triangular mesh and subsequent steps are returned to execute until the quantization error between the obtained target triangular mesh and the target polygon is less than the preset error.

4. The method according to claim 3, characterized in that Also includes: Obtaining the first triangle corresponding to the historical insertion point and three first triangles adjacent to the first triangle of the historical insertion point, and marking them as unavailable triangles; A first triangle for determining a current insertion point is selected from other first triangles in the first triangle mesh except the unavailable triangle.

5. The method according to claim 4, characterized in that Also includes: When the other first triangles do not exist in the first triangle mesh, the flags of the unavailable triangles in the first triangle mesh are cleared to zero.

6. A three-dimensional reconstruction device, characterized in that: include: An acquisition module, used for acquiring three-dimensional point cloud data of an object to be reconstructed; A triangulation module, used for triangulating the two-dimensional points corresponding to the three-dimensional point cloud data to obtain a first triangular mesh; A first determining module, configured to determine an insertion point in at least one first triangle in the first triangular mesh, and construct three second triangles using the insertion point and three vertices of the first triangle respectively; wherein the position of the insertion point is determined based on the principle of minimizing the sum of the angle variances corresponding to the three second triangles; A second determination module is used to respectively obtain convex quadrilaterals composed of the three second triangles and their adjacent first triangles, and for any of the convex quadrilaterals, respectively calculate the sum of the angle variances of triangles obtained from different diagonals of the convex quadrilateral, and use the two triangles with the smaller sum of the angle variances as new first triangles; A third determining module is used to add the new first triangle to the first triangular mesh, and delete the first triangle in the first triangular mesh that overlaps with the new first triangle, so as to obtain a target triangular mesh; A rendering module, used for performing three-dimensional rendering based on the target triangular mesh to obtain a three-dimensional reconstruction model of the object to be reconstructed; The method of determining the position of the insertion point includes: Traversing each candidate insertion point in the first triangle, and connecting the candidate insertion point with three vertices of the first triangle respectively to form three second triangles; Obtaining the internal angle of each second triangle, and determining the angle variance corresponding to each second triangle and the sum of the angle variances corresponding to the three second triangles based on the internal angle of the second triangle; Determine the position of the candidate insertion point that minimizes the sum of the angle variances corresponding to the three second triangles as the position of the insertion point; or sequentially calculating the sum of the angle variances of three second triangles corresponding to each candidate insertion point in the first triangle; When it is identified that the sum of the angle variances is less than a preset threshold, the corresponding candidate insertion point whose sum of the angle variances is less than the threshold is used as the insertion point.

7. A vehicle, characterized in that: The vehicle is provided with multiple groups of cameras, and the multiple groups of cameras are arranged on the front and rear sides, left and right sides, and roof of the vehicle or the front and rear sides, left and right sides, and bottom of the vehicle, wherein each group of cameras includes two fisheye cameras. The vehicle also includes: a three-dimensional reconstruction device for executing the three-dimensional reconstruction method of any one of the methods described in claims 1-5.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the three-dimensional reconstruction method as described in any one of claims 1 to 5 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the three-dimensional reconstruction method as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Triangulation method and system for planar point set in three-dimensional scanning

    CN108765572A

  • Two-dimensional topology reconstruction method for point cloud data

    CN113643402A