Three-dimensional reconstruction method, apparatus and device, and computer readable storage medium

Through multi-view stereo matching and image segmentation technology, a more accurate matching cost function is constructed, which solves the problem that the reconstruction result of the three-dimensional reconstruction technology is not sharp enough at the object boundary and improves the accuracy of the three-dimensional reconstruction.

CN118628645APending Publication Date: 2024-09-10PEKING UNIV SHENZHEN GRADUATE SCHOOL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410664668.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

The reconstruction results of matching-based 3D reconstruction technology at object boundaries are not sharp enough, resulting in insufficient accuracy.

Method used

Obtain the initial depth map and initial cost map through multi-view stereo matching, perform triangulation to obtain the initial plane model, and obtain the ID map through image segmentation, construct the target plane model, and aggregate the initial and target plane models to generate a matching cost function for 3D reconstruction.

Benefits of technology

The sharpness and accuracy of 3D reconstruction at object boundaries are improved, ensuring more accurate depth estimation and reconstruction effects at object boundaries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628645A
    Figure CN118628645A
Patent Text Reader

Abstract

The invention discloses a three-dimensional reconstruction method, device and equipment and a computer readable storage medium, and belongs to the technical field of three-dimensional reconstruction. The method comprises the following steps: acquiring an initial depth map and an initial cost map of a reference view based on multi-view stereo matching; performing triangulation on the reference view according to the initial depth map and the initial cost map to obtain an initial plane model of the reference view; performing image segmentation on the reference view to obtain an ID image of the reference view; on the basis of the initial plane model, constructing a target plane model according to the ID graph; aggregating the initial plane model and the target plane model, and constructing a matching cost function of the reference view; and generating a depth map of the reference view according to the matching cost function, and performing three-dimensional reconstruction according to the depth map. According to the method, the target plane model is constructed through the phenomenon of boundary segmentation and depth sharing, so that reconstruction of three-dimensional reconstruction at the object boundary is sharper, and the precision is higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In recent years, the field of computer vision has made great progress in the field of three-dimensional reconstruction technology. Three-dimensional reconstruction technology has been widely used in architecture, transportation, military, medical, games, film and television production and other fields.

[0003] In order to achieve faster and more accurate 3D reconstruction, the matching-based 3D reconstruction method uses plane prior to assist in 3D reconstruction, and adds the initial plane model obtained by triangulating the trusted points into the calculation of the matching cost, thereby obtaining more accurate depth information and effectively improving the accuracy of 3D reconstruction.

[0004] However, the plane model obtained by triangulation in this method does not fit the boundary of the object well, resulting in a technical problem that the reconstruction result at the boundary of the object is not sharp enough during three-dimensional reconstruction. Summary of the invention

[0005] The main purpose of the present invention is to provide a three-dimensional reconstruction method, device, equipment and computer-readable storage medium, aiming to solve the technical problem that the reconstruction results of matching-based three-dimensional reconstruction technology at the object boundary are not sharp enough.

[0006] To achieve the above object, the present invention provides a three-dimensional reconstruction method, the method comprising:

[0007] Based on multi-view stereo matching, obtain the initial depth map and initial cost map of the reference view;

[0008] Triangulate the reference view according to the initial depth map and the initial cost map to obtain an initial plane model of the reference view;

[0009] Performing image segmentation on the reference view to obtain an ID map of the reference view, wherein pixels with the same ID value in the ID map belong to the same object;

[0010] On the basis of the initial plane model, constructing a target plane model according to the ID map;

[0011] Aggregating the initial plane model and the target plane model to construct a matching cost function for obtaining the reference view;

[0012] A depth map of the reference view is generated according to the matching cost function, and three-dimensional reconstruction is performed according to the depth map.

[0013] Optionally, the step of triangulating the reference view according to the initial depth map and the initial cost map to obtain an initial plane model of the reference view includes:

[0014] Based on the initial cost map, determining an initial cost of each pixel in the reference view, and taking a pixel whose initial cost is less than a first preset value as a credible point;

[0015] According to the credible points, the reference view is divided into a plurality of triangular planes using a Delaunay triangulation method;

[0016] Based on the initial depth map and the two-dimensional pixel coordinates of the vertices of each triangular plane, the world coordinates of the vertices of each triangular plane are calculated, and according to the world coordinates of the vertices of each triangular plane, the normal vectors of each triangular plane and the distances between each triangular plane and the origin are calculated respectively, wherein the origin is the optical center of the camera corresponding to the reference view;

[0017] An initial plane model of the reference view is determined according to the normal vectors of the triangular planes and the distances between the triangular planes and the origin.

[0018] Optionally, the target plane model includes a boundary plane model, and the step of constructing the target plane model according to the ID map based on the initial plane model includes:

[0019] According to the ID map, the initial plane model is classified into a boundary plane model and a non-boundary plane model;

[0020] Dividing the interface plane model into a plurality of boundary areas according to the ID values ​​of the pixels in the interface plane model;

[0021] According to the ID value of the pixel point and the distance between the boundary area and the non-intersection plane model, the boundary plane model corresponding to each boundary area is determined, and the weight of the boundary plane model is calculated according to the distance between the boundary plane model and the corresponding boundary area and the matching cost of the boundary plane model, wherein the weight of the boundary plane model is used to construct the matching cost function of the reference view.

[0022] Optionally, the step of classifying the initial plane model into an interface plane model and a non-interface plane model according to the ID map includes:

[0023] The adjacent pixels with different ID values ​​in the ID map are used as contour pixels;

[0024] An initial plane model whose number of contour pixels is greater than a preset number is classified as a boundary plane model, and an initial plane model whose number of contour pixels is less than or equal to the preset number is classified as a non-boundary plane model.

[0025] Optionally, the matching cost function includes a first matching cost function, and the step of aggregating the initial plane model and the target plane model to construct a matching cost function for obtaining the reference view includes:

[0026] According to the weight of the boundary plane model, the initial plane model and the boundary plane model are aggregated through a probability graph model to construct a first matching cost function for the reference view.

[0027] Optionally, the target plane model further includes an object plane model, and the step of constructing the target plane model according to the ID map based on the initial plane model includes:

[0028] Extracting texture information of the reference view, and determining the texture degree of each pixel in the reference view according to the texture information;

[0029] According to the ID map, the reference view is divided into a plurality of object planes, and the number of pixels in each of the object planes and the number of pixels in each of the initial plane models are counted;

[0030] Calculating the confidence of each object plane according to the texture of each pixel in the reference view, the number of pixels in the object plane, and the number of pixels in the initial plane model;

[0031] An object plane with a confidence level lower than a preset confidence level is used as the object plane to be fitted, and a RANSAC algorithm is used to perform plane fitting on the object plane to be fitted according to the credible points in the object plane to be fitted, so as to obtain a target fitting plane;

[0032] If the inlier rate of the target fitting plane is greater than a preset inlier rate, calculating a normal vector of the target fitting plane and a distance between the target fitting plane and an origin based on the initial depth map;

[0033] The object plane model is determined according to the normal vector of the target fitting plane and the distance between the target fitting plane and the origin, and the weight of the object plane model is calculated according to the matching cost of the object plane model, wherein the weight of the object plane model is used to construct the matching cost function of the reference view.

[0034] Optionally, the matching cost function includes a second matching cost function, and the step of aggregating the initial plane model and the target plane model to construct a matching cost function for obtaining the reference view includes:

[0035] According to the weight of the boundary plane model and the weight of the object plane model, the initial plane model, the boundary plane model and the object plane model are aggregated through a probability graph model to construct a second matching cost function for the reference view.

[0036] In addition, to achieve the above-mentioned purpose, the present invention also provides a three-dimensional reconstruction device, the device comprising:

[0037] An initialization module, configured to obtain an initial depth map and an initial cost map of a reference view based on multi-view stereo matching; triangulate the reference view according to the initial depth map and the initial cost map to obtain an initial plane model of the reference view;

[0038] A plane aggregation module is used to perform image segmentation on the reference view to obtain an ID map of the reference view, wherein pixels with the same ID value in the ID map belong to the same object; based on the initial plane model, a target plane model is constructed according to the ID map; the initial plane model and the target plane model are aggregated to construct a matching cost function for the reference view;

[0039] The 3D reconstruction module is used to generate a depth map of the reference view according to the matching cost function, and perform 3D reconstruction according to the depth map.

[0040] In addition, to achieve the above-mentioned purpose, the present invention also provides a three-dimensional reconstruction device, which includes: a memory, a processor, and a three-dimensional reconstruction program stored in the memory and executable on the processor, wherein the three-dimensional reconstruction program is configured to implement the steps of the three-dimensional reconstruction method as described above.

[0041] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a three-dimensional reconstruction program is stored, and when the three-dimensional reconstruction program is executed by a processor, the steps of the three-dimensional reconstruction method described above are implemented.

[0042] The present invention obtains an initial depth map and an initial cost map of a reference view based on multi-view stereo matching; triangulates the reference view according to the initial depth map and the initial cost map to obtain an initial plane model of the reference view; performs image segmentation on the reference view to obtain an ID map of the reference view, wherein pixels with the same ID value in the ID map belong to the same object; on the basis of the initial plane model, a target plane model is constructed according to the ID map; the initial plane model and the target plane model are aggregated to construct a matching cost function of the reference view; according to the matching cost function, a depth map of the reference view is generated, and three-dimensional reconstruction is performed according to the depth map. The present invention uses the phenomenon of segmentation and depth sharing boundaries, utilizes the ID map obtained by image segmentation, constructs a target plane model on the basis of the initial plane model, aggregates the initial plane model and the target plane model, obtains a more reliable plane prior, adds it to the calculation of the matching cost, and assists in the depth estimation at the object boundary, so that the reconstruction of the three-dimensional reconstruction at the object boundary is sharper and more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a schematic diagram of the flow chart of the first embodiment of the three-dimensional reconstruction method of the present invention;

[0044] Figure 2 Schematic diagram of the construction process of the initial plane model according to an embodiment of the present invention;

[0045] Figure 3 A schematic diagram of the construction process of the boundary plane model according to an embodiment of the present invention;

[0046] Figure 4 It is a schematic diagram of modules of a three-dimensional reconstruction device involved in an embodiment of the present invention;

[0047] Figure 5 It is a structural schematic diagram of a three-dimensional reconstruction device in a hardware operating environment involved in an embodiment of the present invention;

[0048] Figure 6 Schematic diagram of constructing a boundary plane model according to an embodiment of the present invention.

[0049] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0050] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0051] The embodiment of the present invention provides a three-dimensional reconstruction method, referring to Figure 1 , Figure 1 FIG. 4 is a flow chart of a first embodiment of a three-dimensional reconstruction method according to the present invention.

[0052] In this embodiment, the three-dimensional reconstruction method includes:

[0053] Step S100: acquiring an initial depth map and an initial cost map of a reference view based on multi-view stereo matching;

[0054] Those skilled in the art will know that Multi-View Stereo (MVS) is a 3D vision technology that uses a stereo matching algorithm to restore the stereo structure from color images of multiple perspectives with known camera internal and external parameters. In the field of 3D reconstruction technology, generally, from the multiple perspectives of the target scene, one of the perspectives is selected as the reference view, and the views of the remaining perspectives are used as the source view. The 3D reconstruction of multi-view stereo matching is to calculate the matching cost between the source view and the reference view based on the reference view, so as to obtain a depth map.

[0055] It is worth mentioning that multi-view stereo matching is to match corresponding pixels in two or more perspectives, calculate disparity, and estimate the disparity of pixels by establishing a matching cost function and minimizing the matching cost function to obtain depth. Therefore, in the process of multi-view stereo matching, the matching cost (also called cost) of each pixel in the reference view is calculated according to the preset matching cost function to form a cost map, thereby estimating the depth of each pixel and obtaining a depth map.

[0056] In this embodiment, from a group of views of the target scene, one of the views is selected as a reference view, and the matching cost and depth estimation are performed on the reference view through normal multi-view stereo matching, and the cost map obtained by the matching cost calculation is used as the initial cost map, and the depth map obtained by the depth estimation is used as the initial depth map.

[0057] Step S200: triangulating the reference view according to the initial depth map and the initial cost map to obtain an initial plane model of the reference view;

[0058] In one possible implementation, please refer to Figure 2 , Figure 2 The schematic diagram of the construction process of the initial plane model of an embodiment of the present invention is as follows. Step S200 triangulates the reference view according to the initial depth map and the initial cost map to obtain the initial plane model of the reference view, including:

[0059] Step S210: determining an initial cost of each pixel in the reference view based on the initial cost map, and taking a pixel whose initial cost is less than a first preset value as a credible point;

[0060] In this embodiment, the first preset value is set by the user according to actual needs, and the credible point refers to a pixel point in the initial depth map whose depth value is reliable (that is, a pixel point whose initial cost is less than the first preset value) estimated by multi-view stereo matching.

[0061] Step S220: using the Delaunay triangulation method according to the credible points to divide the reference view into a plurality of triangular planes;

[0062] Those skilled in the art will know that the Delaunay triangulation method is a commonly used triangulation method. In the plane prior-assisted three-dimensional reconstruction technology, the Delaunay triangulation method is generally used to construct a plane prior model (that is, the initial plane model in this embodiment). Therefore, this embodiment does not elaborate on the Delaunay triangulation method.

[0063] In this embodiment, the reference view is divided into multiple triangular planes by Delaunay triangulation method on the set of credible points. It is not difficult to understand that the three vertices of each triangular plane are credible points. The triangular plane obtained by Delaunay triangulation method has two characteristics: maximizing the minimum angle and the "closest to regularization" triangulation network and uniqueness (any four points cannot be in a circle). Based on this, the initial plane model is constructed as a plane prior to assist 3D reconstruction, which can adaptively capture more suitable saliency information for texture areas, thereby better assisting depth estimation.

[0064] Step S230: based on the initial depth map and the two-dimensional pixel coordinates of the vertices of each triangular plane, calculate the world coordinates of the vertices of each triangular plane, and calculate the normal vector of each triangular plane and the distance between each triangular plane and the origin according to the world coordinates of the vertices of each triangular plane, wherein the origin is the optical center of the camera corresponding to the reference view;

[0065] Those skilled in the art will know that in the process of converting two-dimensional pixel coordinates into world coordinates, it is first necessary to normalize the two-dimensional pixel coordinates according to the camera intrinsic parameters corresponding to the view, so as to convert the two-dimensional pixel coordinates in the pixel coordinate system into two-dimensional image coordinates in the image coordinate system, and then add the depth information (that is, the depth value of the pixel point in the initial depth map) on the basis of the two-dimensional image coordinates to obtain the three-dimensional coordinates in the camera coordinate system, and finally align them according to the camera extrinsic parameters corresponding to the view to convert the three-dimensional coordinates in the camera coordinate system into world coordinates in the world coordinate system.

[0066] It should be particularly noted that when the 3D reconstruction method provided in this embodiment is used to take the remaining views as reference views, the origin is changed accordingly.

[0067] Step S240: determining an initial plane model of the reference view according to the normal vectors of each of the triangular planes and the distance between each of the triangular planes and the origin.

[0068] In this embodiment, the initial plane model is composed of the normal vector of the triangular plane and the distance between the triangular plane and the origin, and one triangular plane corresponds to one initial plane model.

[0069] This embodiment triangulates the reference view to obtain an initial plane model of the reference view, and then, based on the initial plane model, utilizes the principle of segmentation and depth shared boundaries, and constructs a target plane model through an ID (Identity) map obtained by image segmentation, corrects the error of the initial plane model not matching the object boundary at the object boundary, improves the reconstruction effect of the matching-based 3D reconstruction technology at the object boundary, and makes the reconstruction sharper.

[0070] Step S300: performing image segmentation on the reference view to obtain an ID map of the reference view, wherein pixels with the same ID value in the ID map belong to the same object;

[0071] In this embodiment, the reference view may be segmented by an image segmentation model, for example, the reference view may be segmented by SAM (Segment Anything Model), and the image obtained after the image segmentation is called an ID image.

[0072] Those skilled in the art will know that in the ID map obtained by image segmentation, each pixel has a value, which is referred to as the ID value in this embodiment. It is not difficult to understand that pixels with the same ID value belong to the same object, the depth of pixels with the same ID value changes continuously, and the depth of pixels with different ID values ​​changes discontinuously, and there is an obvious phenomenon of segmentation and depth sharing boundaries.

[0073] Step S400: constructing a target plane model according to the ID map based on the initial plane model;

[0074] In one possible implementation, please refer to Figure 3 , Figure 3 The figure is a schematic diagram of the construction process of the boundary plane model of an embodiment of the present invention. The target plane model includes a boundary plane model. Step S400 constructs the target plane model according to the ID map based on the initial plane model, including:

[0075] Step S410: Classifying the initial plane model into a boundary plane model and a non-boundary plane model according to the ID map;

[0076] In this embodiment, by utilizing the phenomenon of segmentation and depth sharing boundaries, the area of ​​depth discontinuity in the reference view, that is, the boundary of the object, can be determined through the change of the ID value of the pixel point in the ID map, thereby classifying the initial plane model into a boundary plane model and a non-boundary model.

[0077] It is not difficult to understand that the boundary plane model refers to the initial plane model at the boundary of the object, that is, the depth of the pixels in the plane model is discontinuous, and the non-boundary plane model refers to the initial plane model inside the object. In the non-boundary plane model, the depth of the pixels is continuous.

[0078] Step S420: dividing the interface plane model into a plurality of boundary areas according to the ID values ​​of the pixels in the interface plane model;

[0079] In this embodiment, after the initial plane model is classified into a boundary plane model, the boundary plane model can be divided into multiple boundary areas according to the ID values ​​of the pixels in the boundary plane model. That is, the area with pixels having the same ID value and continuous coordinates is regarded as a boundary area. When the ID value of the pixel changes, another boundary area is divided.

[0080] It is not difficult to understand that the ID value of each pixel in the boundary area is the same, and the pixels in the same boundary area belong to the same object.

[0081] Step S430: Determine the boundary plane model corresponding to each boundary area based on the ID value of the pixel point and the distance between the boundary area and the non-boundary plane model, and calculate the weight of the boundary plane model based on the distance between the boundary plane model and the corresponding boundary area and the matching cost of the boundary plane model, wherein the weight of the boundary plane model is used to construct the matching cost function of the reference view.

[0082] In this embodiment, the non-intersection plane model belonging to the same object as the boundary area is determined by the ID value of the pixel point, and based on the distance between the non-intersection plane model belonging to the same object and the boundary area, one or more non-intersection plane models are selected as the boundary plane model corresponding to the boundary area.

[0083] To help understand, in an example, refer to Figure 6 , Figure 6 Schematic diagram of constructing a boundary plane model according to an embodiment of the present invention.

[0084] exist Figure 6In the figure, t1, t2, t3, t4, t5, t6, t7 and tb are initial plane models, among which tb and t4 are boundary plane models, and the rest are non-boundary plane models. In this example, the boundary divides tb into a triangular boundary area on the left and a quadrilateral boundary area on the right, d1 is the distance between t1 and the triangular boundary area, d2 is the distance between t2 and the triangular boundary area, and d3 is the distance between t3 and the triangular boundary area.

[0085] When determining the boundary plane model corresponding to the triangular boundary area on the left, according to the ID value of the pixel point, first select the non-intersection plane models t1, t2, t3 and t7 that belong to the same object as the triangular boundary area, and then according to the distance between each non-intersection plane model and the triangular boundary area (in this example, the distance between the center of gravity of each non-intersection plane model and the center of gravity of the triangular boundary area is used as the distance between each non-intersection plane model and the triangular boundary area. In addition to the center of gravity, it can also be the center of the circumscribed circle, etc.), exclude t7 which is far away, and finally use t1, t2 and t3 as the boundary plane models of the triangular boundary area.

[0086] It is not difficult to understand that when determining the boundary plane model, the number of boundary plane models in a single boundary area can be limited so as to filter them according to the distance. The distance can also be limited and a distance threshold can be set to exclude non-boundary plane models that are greater than the distance threshold.

[0087] In addition, when determining the boundary plane model, the user can choose to filter by ID value first and then by distance, or filter by distance first and then by ID value according to actual needs, and this embodiment does not make specific limitations on this.

[0088] After determining the boundary plane model of the boundary area, this embodiment also calculates the weight of each boundary plane model based on the distance between the boundary plane model and the boundary area, and the matching cost of the boundary plane model, to assist in constructing a matching cost function, wherein the matching cost of the boundary plane model is obtained by calculating the photometric consistency of the boundary plane model between the reference view and the source view.

[0089] Specifically, the calculation formula of the weight of the boundary plane model in this embodiment is as follows:

[0090]

[0091] Among them, ω b is the weight of the boundary plane model, C photo (θ b ) is the matching cost of the boundary plane model, d is the distance between the boundary plane model and the boundary area, e is the base of the natural logarithm, α is the empirical value, and γ bFor experience value.

[0092] The calculation formula of the distance d between the boundary plane model and the boundary area is as follows:

[0093] d=||pos r -pos t ||2;

[0094] Among them, pos r is the centroid coordinate of the boundary plane model, pos t are the centroid coordinates of the boundary area.

[0095] It should be noted that there is an intersection plane model in the initial plane model obtained by triangulation, and the practice of directly using the initial plane model as a plane prior in the prior art will result in the reconstruction effect of the three-dimensional reconstruction at the object boundary not being sharp enough, and different objects cannot be accurately distinguished at the object boundary. On this basis, this embodiment reconstructs the intersection plane model in the initial plane model to obtain the boundary plane model of each intersection plane model, thereby adding the boundary plane model to the calculation of the matching cost (that is, constructing a matching cost function), assisting the matching-based three-dimensional reconstruction technology to reconstruct at the object boundary, making the reconstruction sharper.

[0096] Step S500: Aggregating the initial plane model and the target plane model to construct a matching cost function of the reference view;

[0097] Those skilled in the art will know that in order to allow the plane prior to assist the depth map estimation, thereby improving the effect of three-dimensional reconstruction, a probability graph model can be constructed, and according to the full probability formula of the graph model and the Bayesian rule, the plane prior is added to the calculation of the matching cost, that is, the matching cost function is constructed in combination with the plane prior. The probability graph model includes likelihood probability and prior probability, wherein the likelihood probability is determined by calculating the photometric consistency cost, and the prior probability is determined according to the plane prior model. Among them, the calculation of the photometric consistency cost has been studied in depth in the relevant technology, and this embodiment will not elaborate on this. For details, please refer to the definition and calculation of the photometric consistency cost in the ACMP algorithm (Adaptive Consistency Maximization with Plane Prior, a MVS method based on plane prior) or the ACMMP algorithm (Adaptive Consistency Maximization with Multi-level Plane Prior and Multi-scale Geometry, a multi-scale geometric consistency-guided MVS method based on plane prior).

[0098] In the prior art, the plane prior model refers to the initial plane model in this embodiment, and in this embodiment, the plane prior model is determined by aggregating the initial plane model and the target plane model.

[0099] In this embodiment, step S500 includes:

[0100] Step S510: According to the weight of the boundary plane model, the initial plane model and the boundary plane model are aggregated through a probability graph model to construct a first matching cost function for the reference view;

[0101] In this embodiment, the first matching cost function is a matching cost function obtained by aggregating the initial plane model and the boundary plane model through a probabilistic graph model and adding plane priors into the calculation of the matching cost.

[0102] In this embodiment, aggregating the initial plane model and the boundary plane model actually means replacing the intersection plane model in the initial plane model with the boundary plane model through the weight of the boundary plane model, so as to obtain a more accurate plane prior, and then adding the plane prior to the calculation of the matching cost through the probabilistic graph model to obtain the final first matching cost function.

[0103] Specifically, the first matching cost function is as follows:

[0104]

[0105] Among them, θ i represents the plane hypothesis of the current pixel, Θ represents the plane model corresponding to the current pixel (non-intersection plane model or boundary plane model), C photo (θ i ) is the matching cost of the plane hypothesis of the current pixel, which is obtained by calculating the photometric consistency of the plane hypothesis of the current pixel between the reference view and the source view. i |Θ) represents the similarity between the plane hypothesis of the current pixel and the plane model corresponding to the current pixel, C 1_photo The first matching cost of the plane hypothesis of the current pixel in the source view is calculated by a first matching cost function obtained by aggregating the initial plane model and the boundary plane model, and has higher accuracy.

[0106] Since the plane models aggregated in this embodiment are the initial plane model and the boundary plane model, when a pixel of any initial plane in the reference view is used as the current pixel, the initial plane is either a non-boundary plane or a boundary plane. When it is a non-boundary plane, θ is the initial plane model θ corresponding to the current pixel. p , P(θ i |θ)=P(θi |θ p ), when it is a boundary plane, θ is the boundary plane model θ corresponding to the current pixel b , Since a pixel of an initial plane may correspond to multiple boundary plane models θ b , each boundary plane model has a corresponding weight ω b , j is the serial number of the boundary plane model, ω bj Represents the weight of the boundary plane model with sequence number j.

[0107] Among them, P(θ i |θ p ) is a common knowledge known to those skilled in the art, and will not be elaborated in detail in this embodiment. Accordingly, P(θ i |θ b ) is calculated in the same way as P(θ i |θ p ) is basically similar, and those skilled in the art, when knowing P(θ i |θ p ), combined with this embodiment, it can be easily deduced that P(θ i |θ b ) is calculated, which will not be elaborated in detail in this embodiment.

[0108] This embodiment calculates the prior probability for the pixel point corresponding to the non-intersection boundary plane model based on the similarity between the plane hypothesis of the pixel point and the non-intersection plane model, and calculates the prior probability for the pixel point corresponding to the intersection plane model based on the similarity between the plane hypothesis of the pixel point and the boundary plane model in combination with the weight of the boundary plane model.

[0109] Step S600: generating a depth map of the reference view according to the matching cost function, and performing three-dimensional reconstruction according to the depth map.

[0110] Those skilled in the art will know that after constructing the matching cost function of the reference view, the matching cost of each pixel in the reference view can be obtained according to the matching cost function, thereby determining the depth value of the pixel according to the matching cost of the pixel, and then forming a depth map of the reference view, and performing three-dimensional reconstruction based on the depth map.

[0111] It should be noted that during three-dimensional reconstruction, each view of the target scene needs to be used as a reference view in turn, and a matching cost function for each view is constructed according to the three-dimensional reconstruction method provided in this embodiment to obtain a depth map of each view, and then the target scene is reconstructed in three dimensions based on the depth map of each view.

[0112] This embodiment obtains the initial depth map and initial cost map of the reference view based on multi-view stereo matching; triangulates the reference view according to the initial depth map and the initial cost map to obtain the initial plane model of the reference view; performs image segmentation on the reference view to obtain the ID map of the reference view, wherein pixels with the same ID value in the ID map belong to the same object; on the basis of the initial plane model, constructs the target plane model according to the ID map; aggregates the initial plane model and the target plane model to construct the matching cost function of the reference view; generates the depth map of the reference view according to the matching cost function, and performs three-dimensional reconstruction according to the depth map. This embodiment uses the phenomenon of segmentation and depth sharing boundaries, utilizes the ID map obtained by image segmentation, constructs the target plane model on the basis of the initial plane model, and aggregates the initial plane model and the target plane model to obtain a more reliable plane prior to add to the calculation of the matching cost, and assists in the depth estimation at the object boundary, so that the three-dimensional reconstruction at the object boundary is sharper and more accurate.

[0113] In a possible implementation, the step of classifying the initial plane model into an interface plane model and a non-interface plane model according to the ID map includes:

[0114] Step S411: taking adjacent pixels with different ID values ​​in the ID map as contour pixels;

[0115] It is not difficult to understand that only at the junction between different objects will the ID values ​​of two adjacent pixels be different. In this embodiment, such adjacent pixels with different ID values ​​are used as contour pixels, thereby classifying the initial plane model according to the number of contour pixels.

[0116] Step S412: classify an initial plane model whose number of contour pixels is greater than a preset number as a boundary plane model, and classify an initial plane model whose number of contour pixels is less than or equal to the preset number as a non-boundary plane model.

[0117] In this embodiment, the initial plane model is classified by detecting the number of contour pixels in the initial plane model.

[0118] It is worth mentioning that the edge detection algorithm (such as Canny edge detection algorithm) can be used to perform edge detection on the ID image, so as to quickly determine the contour pixels from the ID image, and then classify the initial plane model, and then construct the boundary plane model.

[0119] In a possible implementation, the target plane model further includes an object plane model, and the step of constructing the target plane model according to the ID map based on the initial plane model includes:

[0120] Step S440: extracting texture information of the reference view, and determining the texture degree of each pixel in the reference view according to the texture information;

[0121] Those skilled in the art will appreciate that the texture degree can be determined by calculating the variance within a pixel block. The larger the variance, the richer the texture of the pixel block. This embodiment does not specifically limit this.

[0122] Step S450: dividing the reference view into a plurality of object planes according to the ID map, and counting the number of pixels in each of the object planes and the number of pixels in each of the initial plane models;

[0123] In this embodiment, those skilled in the art will know that in the ID map obtained by SAM segmentation, pixels with the same ID value belong to the same object. Therefore, based on the ID map, the reference view can be divided into multiple object planes, and the pixel ID values ​​in each object plane are the same.

[0124] Step S460: Calculating the confidence of each object plane according to the texture of each pixel in the reference view, the number of pixels in the object plane, and the number of pixels in the initial plane model;

[0125] In this embodiment, the average of the texture degrees of the pixels in the initial plane model is used as the texture degree of the initial plane model, and the proportion of the initial plane models in each object plane is calculated based on the number of pixels in the initial plane model and the number of pixels in the object plane, thereby calculating the confidence of each initial plane model based on the texture degree and proportion of the initial plane model, and then calculating the confidence of the object plane based on the confidence of each initial plane model in the object plane. It should be noted that the initial plane model in the object plane belongs to the object plane, that is, the initial plane model is a non-intersection plane model belonging to the object plane, and there can be multiple non-intersection plane models in an object plane. In the non-intersection plane models in the same object plane, the ID values ​​of the pixels are basically the same (there are a small number of contour pixels in some non-intersection plane models, so the ID values ​​of the pixels in the non-intersection plane model may be more than one).

[0126] Specifically, the calculation formula of the confidence of the object plane in this embodiment is as follows:

[0127]

[0128] Among them, o represents the object plane, m represents the initial plane model, and u represents the area outside the initial plane model in the object plane. o is the confidence of the object plane, Credit mis the confidence of the initial plane model, N o is the number of pixels in the object plane, N m is the number of pixels in the initial plane model, N u is the number of pixels outside the initial plane model in the object plane, N u =N o -N m , λ is the empirical value.

[0129] The calculation formula of the confidence of the initial plane model in this embodiment is as follows:

[0130]

[0131] Among them, o represents the object plane, m represents the initial plane model, p represents the pixel point, and Credit m is the confidence of the initial plane model, Credit p is the confidence of the pixel, N m is the number of pixels in the initial plane model, e is the base of the natural logarithm, and η is an empirical value.

[0132] The calculation formula of the confidence of the pixel in this embodiment is as follows:

[0133]

[0134] Among them, p represents pixel point, Credit p is the confidence of the pixel, Var is the texture of the pixel, ε var is the experience value, t min For experience value.

[0135] It is not difficult to understand that the larger the initial plane model is, the more pixel information needs to be predicted using the three vertices of the plane model, and the lower its confidence is. The greater the texture of the initial plane model is, the more accurate the pixel information that can be predicted by the initial plane is, and the higher its confidence is. This embodiment takes into account the size and texture of the initial plane model, calculates the confidence of the initial plane model, and thus determines the confidence of the object plane, and constructs an object plane model for the object plane with lower confidence, and adds the object plane model to the calculation of the matching cost, so as to construct a more accurate matching cost function for the reference view, thereby improving the reconstruction accuracy of the three-dimensional reconstruction in the weak texture area (i.e., the object plane with lower confidence).

[0136] Step S470: taking the object plane whose confidence is lower than the preset confidence as the object plane to be fitted, and performing plane fitting on the object plane to be fitted by using the RANSAC algorithm according to the reliable points in the object plane to be fitted, so as to obtain a target fitting plane;

[0137] Those skilled in the art will know that the RANSAC (Random Sample Consensus) algorithm is widely used in the field of computer vision (including the field of three-dimensional reconstruction technology). The algorithm is often used in line fitting, plane fitting, calculation of basic matrices, etc. This embodiment uses the algorithm to perform plane fitting on reliable points in the plane of the object to be fitted.

[0138] When the algorithm is used for plane fitting, three reliable points are randomly selected from the reliable points in the plane of the object to be fitted to fit a triangular plane each time, and the inlier rate of the triangular plane fitted this time is calculated, and this process is repeated until the number of fittings reaches the number preset by the user. Then the triangular plane with the largest inlier rate in the plane fitting is used as the target fitting plane.

[0139] Step S480: If the inlier rate of the target fitting plane is greater than a preset inlier rate, a normal vector of the target fitting plane and a distance between the target fitting plane and an origin are calculated based on the initial depth map;

[0140] Step S490: Determine the object plane model according to the normal vector of the target fitting plane and the distance between the target fitting plane and the origin, and calculate the weight of the object plane model according to the matching cost of the object plane model, wherein the weight of the object plane model is used to construct the matching cost function of the reference view.

[0141] In this embodiment, if the inlier rate of the target fitting plane is greater than the preset inlier rate, the normal vector of the target fitting plane and the distance between the target fitting plane and the origin are calculated according to the initial depth map, so as to construct an object plane model for the object plane, and calculate the weight of the object plane model, and then according to the weight of the object plane model, add the object plane model to the calculation of the matching cost to construct a more accurate matching cost function. It is not difficult to understand that if the inlier rate of the target fitting plane is less than the preset inlier rate, it means that the object is not a plane, and the corresponding object plane model does not need to be fitted and cannot be obtained. Among them, the matching cost of the object plane model is obtained by calculating the photometric consistency of the object plane model between the reference view and the source view.

[0142] Specifically, the calculation formula of the weight of the object plane model in this embodiment is as follows:

[0143]

[0144] Among them, ω o is the weight of the object plane model, C photo (θ o ) is the matching cost of the object plane model, e is the base of the natural logarithm, α is the empirical value, γo For experience value.

[0145] Furthermore, the matching cost function includes a second matching cost function, and the step of aggregating the initial plane model and the target plane model to construct a matching cost function for obtaining the reference view includes:

[0146] Step S520: According to the weight of the boundary plane model and the weight of the object plane model, the initial plane model, the boundary plane model and the object plane model are aggregated through a probability graph model to construct a second matching cost function of the reference view.

[0147] In this embodiment, aggregating the initial plane model, the boundary plane model, and the object plane model actually aggregates the non-boundary plane model, the boundary plane model, and the object plane model.

[0148] Specifically, the second matching cost function is as follows:

[0149]

[0150] Among them, θ i represents the plane hypothesis of the current pixel, Θ represents the plane model corresponding to the current pixel (1, non-intersection plane model, 2, boundary plane model, 3, boundary plane model and object plane model, 4, non-intersection plane model and object plane model), C photo (θ i ) is the matching cost of the plane hypothesis of the current pixel, which is obtained by calculating the photometric consistency of the plane hypothesis of the current pixel between the reference view and the source view. i |Θ) represents the similarity between the plane hypothesis of the current pixel and the plane model corresponding to the current pixel, C 2_photo The second matching cost of the plane hypothesis of the current pixel in the source view is calculated by a second matching cost function obtained by aggregating the initial plane model, the boundary plane model and the object plane model, and has higher accuracy.

[0151] Since the aggregated plane models in this embodiment are the initial plane model, the boundary plane model and the object plane model, when any pixel of the initial plane in the reference view is used as the current pixel, in the first case θ is the initial plane model θ corresponding to the current pixel p , P(θ i |θ)=P(θ i |θ p ), in the second case Θ is the boundary plane model θ corresponding to the current pixel b , Since the current pixel may correspond to multiple boundary plane models θb , each boundary plane model has a corresponding weight ω b , j is the serial number of the boundary plane model, ω bj Represents the weight of the boundary plane model with serial number j. In the third case, θ is the boundary plane model θ corresponding to the current pixel. b and the object plane model θ o , ω o is the weight of the object plane model. In the fourth case, θ is the initial plane model θ corresponding to the current pixel. p and the object plane model θ o , μ is an empirical value.

[0152] Among them, P(θ i |θ p The calculation method of ) is common knowledge known to those skilled in the art, and will not be elaborated in detail in this embodiment. i |θ b ) is calculated in the same way as P(θ i |θ p ) is basically similar, and those skilled in the art, when knowing P(θ i |θ p ), combined with this embodiment, it can be easily deduced that P(θ i |θ b ) is calculated, which will not be elaborated in detail in this embodiment. Accordingly, P(θ i |θ o ) is not elaborated in detail.

[0153] This embodiment calculates the prior probability for the pixel points corresponding only to the non-intersection boundary plane model according to the similarity between the plane hypothesis of the pixel point and the non-intersection plane model. For the pixel points corresponding only to the non-intersection plane model, the prior probability is calculated according to the similarity between the plane hypothesis of the pixel point and the boundary plane model in combination with the weight of the boundary plane model. For the pixel points corresponding to both the non-intersection plane model and the object plane model, the prior probability is calculated according to the similarity between the plane hypothesis of the pixel point and the non-intersection plane model, as well as the similarity between the plane hypothesis and the object plane model in combination with the weight of the object plane model. For the pixel points corresponding to both the intersection plane model and the object plane model, the prior probability is calculated according to the similarity between the plane hypothesis of the pixel point and the boundary plane model, as well as the similarity between the plane hypothesis and the object plane model in combination with the weight of the boundary plane model and the weight of the object plane model.

[0154] In addition, the present invention also provides a three-dimensional reconstruction device, please refer to Figure 4 , Figure 4The module diagram of the three-dimensional reconstruction device involved in the embodiment of the present invention is as follows:

[0155] An initialization module 10 is used to obtain an initial depth map and an initial cost map of a reference view based on multi-view stereo matching; triangulate the reference view according to the initial depth map and the initial cost map to obtain an initial plane model of the reference view;

[0156] The plane aggregation module 20 is used to perform image segmentation on the reference view to obtain an ID map of the reference view, wherein pixels with the same ID value in the ID map belong to the same object; based on the initial plane model, construct a target plane model according to the ID map; aggregate the initial plane model and the target plane model to construct a matching cost function for the reference view;

[0157] The 3D reconstruction module 30 is configured to generate a depth map of the reference view according to the matching cost function, and perform 3D reconstruction according to the depth map.

[0158] In one embodiment, the initialization module 10 is further used for:

[0159] Based on the initial cost map, determining an initial cost of each pixel in the reference view, and taking a pixel whose initial cost is less than a first preset value as a credible point;

[0160] According to the credible points, the reference view is divided into a plurality of triangular planes using a Delaunay triangulation method;

[0161] Based on the initial depth map and the two-dimensional pixel coordinates of the vertices of each triangular plane, the world coordinates of the vertices of each triangular plane are calculated, and according to the world coordinates of the vertices of each triangular plane, the normal vectors of each triangular plane and the distances between each triangular plane and the origin are calculated respectively, wherein the origin is the optical center of the camera corresponding to the reference view;

[0162] An initial plane model of the reference view is determined according to the normal vectors of the triangular planes and the distances between the triangular planes and the origin.

[0163] In one embodiment, the target plane model includes a boundary plane model, and the plane aggregation module 20 is further used to:

[0164] According to the ID map, the initial plane model is classified into a boundary plane model and a non-boundary plane model;

[0165] Dividing the interface plane model into a plurality of boundary areas according to the ID values ​​of the pixels in the interface plane model;

[0166] According to the ID value of the pixel point and the distance between the boundary area and the non-intersection plane model, the boundary plane model corresponding to each boundary area is determined, and the weight of the boundary plane model is calculated according to the distance between the boundary plane model and the corresponding boundary area and the matching cost of the boundary plane model, wherein the weight of the boundary plane model is used to construct the matching cost function of the reference view.

[0167] In one embodiment, the plane aggregation module 20 is further configured to:

[0168] The adjacent pixels with different ID values ​​in the ID map are used as contour pixels;

[0169] An initial plane model whose number of contour pixels is greater than a preset number is classified as a boundary plane model, and an initial plane model whose number of contour pixels is less than or equal to the preset number is classified as a non-boundary plane model.

[0170] In one embodiment, the matching cost function includes a first matching cost function, and the plane aggregation module 20 is further configured to:

[0171] According to the weight of the boundary plane model, the initial plane model and the boundary plane model are aggregated through a probability graph model to construct a first matching cost function for the reference view.

[0172] In one embodiment, the target plane model also includes an object plane model, and the plane aggregation module 20 is further used to:

[0173] Extracting texture information of the reference view, and determining the texture degree of each pixel in the reference view according to the texture information;

[0174] According to the ID map, the reference view is divided into a plurality of object planes, and the number of pixels in each of the object planes and the number of pixels in each of the initial plane models are counted;

[0175] Calculating the confidence of each object plane according to the texture of each pixel in the reference view, the number of pixels in the object plane, and the number of pixels in the initial plane model;

[0176] An object plane with a confidence level lower than a preset confidence level is used as the object plane to be fitted, and a RANSAC algorithm is used to perform plane fitting on the object plane to be fitted according to the credible points in the object plane to be fitted, so as to obtain a target fitting plane;

[0177] If the inlier rate of the target fitting plane is greater than a preset inlier rate, calculating a normal vector of the target fitting plane and a distance between the target fitting plane and an origin based on the initial depth map;

[0178] The object plane model is determined according to the normal vector of the target fitting plane and the distance between the target fitting plane and the origin, and the weight of the object plane model is calculated according to the matching cost of the object plane model, wherein the weight of the object plane model is used to construct the matching cost function of the reference view.

[0179] In one embodiment, the matching cost function includes a second matching cost function, and the plane aggregation module 20 is further configured to:

[0180] According to the weight of the boundary plane model and the weight of the object plane model, the initial plane model, the boundary plane model and the object plane model are aggregated through a probability graph model to construct a second matching cost function for the reference view.

[0181] The 3D reconstruction device provided in the embodiment of the present invention adopts the 3D reconstruction method in the above embodiment, which can solve the technical problem that the reconstruction result at the object boundary of the matching-based 3D reconstruction technology is not sharp enough. Compared with the prior art, the beneficial effects of the 3D reconstruction device provided in the embodiment of the present invention are the same as the beneficial effects of the 3D reconstruction method provided in the above embodiment, and the other technical features in the 3D reconstruction device are the same as the features disclosed in the above embodiment method, which will not be described in detail here.

[0182] In addition, the present invention also provides a three-dimensional reconstruction device, which includes a memory, a processor, and a three-dimensional reconstruction program stored in the memory and executable on the processor. When the three-dimensional reconstruction program is executed by the processor, the steps of the three-dimensional reconstruction method described above are implemented.

[0183] Please refer to Figure 5 , Figure 5 It is a schematic diagram of the structure of a three-dimensional reconstruction device in the hardware operating environment involved in the embodiment of the present invention.

[0184] like Figure 5As shown, the three-dimensional reconstruction device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0185] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation on the three-dimensional reconstruction device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0186] like Figure 5 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module and a three-dimensional reconstruction program.

[0187] exist Figure 5 In the three-dimensional reconstruction device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the three-dimensional reconstruction device of the present invention can be set in the three-dimensional reconstruction device, and the three-dimensional reconstruction device calls the three-dimensional reconstruction program stored in the memory 1005 through the processor 1001, and executes the three-dimensional reconstruction method provided by the embodiment of the present invention.

[0188] In addition, the present invention also provides a computer-readable storage medium, on which a three-dimensional reconstruction program is stored. When the three-dimensional reconstruction program is executed by a processor, the steps of the three-dimensional reconstruction method as described above are implemented.

[0189] The specific implementation of the computer-readable storage medium of the present invention is basically the same as the above-mentioned embodiments of the three-dimensional reconstruction method, and will not be described in detail here.

[0190] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system 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 system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0191] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0192] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0193] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A three-dimensional reconstruction method, characterized in that: The three-dimensional reconstruction method comprises the following steps: Based on multi-view stereo matching, obtain the initial depth map and initial cost map of the reference view; Triangulate the reference view according to the initial depth map and the initial cost map to obtain an initial plane model of the reference view; Performing image segmentation on the reference view to obtain an ID map of the reference view, wherein pixels with the same ID value in the ID map belong to the same object; On the basis of the initial plane model, constructing a target plane model according to the ID map; Aggregating the initial plane model and the target plane model to construct a matching cost function for obtaining the reference view; A depth map of the reference view is generated according to the matching cost function, and three-dimensional reconstruction is performed according to the depth map.

2. The three-dimensional reconstruction method according to claim 1, characterized in that: The step of triangulating the reference view according to the initial depth map and the initial cost map to obtain an initial plane model of the reference view comprises: Based on the initial cost map, determining an initial cost of each pixel in the reference view, and taking a pixel whose initial cost is less than a first preset value as a credible point; According to the credible points, the reference view is divided into a plurality of triangular planes using a Delaunay triangulation method; Based on the initial depth map and the two-dimensional pixel coordinates of the vertices of each triangular plane, the world coordinates of the vertices of each triangular plane are calculated, and according to the world coordinates of the vertices of each triangular plane, the normal vectors of each triangular plane and the distances between each triangular plane and the origin are calculated respectively, wherein the origin is the optical center of the camera corresponding to the reference view; An initial plane model of the reference view is determined according to the normal vectors of the triangular planes and the distances between the triangular planes and the origin.

3. The three-dimensional reconstruction method according to claim 2, characterized in that: The target plane model includes a boundary plane model, and the step of constructing the target plane model according to the ID map based on the initial plane model includes: According to the ID map, the initial plane model is classified into a boundary plane model and a non-boundary plane model; Dividing the interface plane model into a plurality of boundary areas according to the ID values ​​of the pixels in the interface plane model; According to the ID value of the pixel point and the distance between the boundary area and the non-intersection plane model, the boundary plane model corresponding to each boundary area is determined, and the weight of the boundary plane model is calculated according to the distance between the boundary plane model and the corresponding boundary area and the matching cost of the boundary plane model, wherein the weight of the boundary plane model is used to construct the matching cost function of the reference view.

4. The three-dimensional reconstruction method according to claim 3, characterized in that: The step of classifying the initial plane model into an interface plane model and a non-intersection plane model according to the ID map comprises: The adjacent pixels with different ID values ​​in the ID map are used as contour pixels; An initial plane model whose number of contour pixels is greater than a preset number is classified as a boundary plane model, and an initial plane model whose number of contour pixels is less than or equal to the preset number is classified as a non-boundary plane model.

5. The three-dimensional reconstruction method according to claim 4, characterized in that: The matching cost function includes a first matching cost function, and the step of aggregating the initial plane model and the target plane model to construct a matching cost function for the reference view includes: According to the weight of the boundary plane model, the initial plane model and the boundary plane model are aggregated through a probability graph model to construct a first matching cost function for the reference view.

6. The three-dimensional reconstruction method according to claim 5, characterized in that: The target plane model also includes an object plane model. The step of constructing the target plane model according to the ID map based on the initial plane model includes: Extracting texture information of the reference view, and determining the texture degree of each pixel in the reference view according to the texture information; According to the ID map, the reference view is divided into a plurality of object planes, and the number of pixels in each of the object planes and the number of pixels in each of the initial plane models are counted; Calculating the confidence of each object plane according to the texture of each pixel in the reference view, the number of pixels in the object plane, and the number of pixels in the initial plane model; An object plane with a confidence level lower than a preset confidence level is used as the object plane to be fitted, and a RANSAC algorithm is used to perform plane fitting on the object plane to be fitted according to the credible points in the object plane to be fitted, so as to obtain a target fitting plane; If the inlier rate of the target fitting plane is greater than a preset inlier rate, calculating a normal vector of the target fitting plane and a distance between the target fitting plane and an origin based on the initial depth map; The object plane model is determined according to the normal vector of the target fitting plane and the distance between the target fitting plane and the origin, and the weight of the object plane model is calculated according to the matching cost of the object plane model, wherein the weight of the object plane model is used to construct the matching cost function of the reference view.

7. The three-dimensional reconstruction method according to claim 6, characterized in that: The matching cost function includes a second matching cost function, and the step of aggregating the initial plane model and the target plane model to construct a matching cost function for the reference view includes: According to the weight of the boundary plane model and the weight of the object plane model, the initial plane model, the boundary plane model and the object plane model are aggregated through a probability graph model to construct a second matching cost function for the reference view.

8. A three-dimensional reconstruction device, characterized in that: The device comprises: An initialization module, configured to obtain an initial depth map and an initial cost map of a reference view based on multi-view stereo matching; triangulate the reference view according to the initial depth map and the initial cost map to obtain an initial plane model of the reference view; A plane aggregation module is used to perform image segmentation on the reference view to obtain an ID map of the reference view, wherein pixels with the same ID value in the ID map belong to the same object; based on the initial plane model, a target plane model is constructed according to the ID map; the initial plane model and the target plane model are aggregated to construct a matching cost function for the reference view; The 3D reconstruction module is used to generate a depth map of the reference view according to the matching cost function, and perform 3D reconstruction according to the depth map.

9. A three-dimensional reconstruction device, characterized in that: The device comprises: a memory, a processor, and a three-dimensional reconstruction program stored in the memory and executable on the processor, wherein the three-dimensional reconstruction program is configured 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: The computer-readable storage medium stores a three-dimensional reconstruction program, and when the three-dimensional reconstruction 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.