Three-dimensional reconstruction method and device, electronic device and storage medium
Through local reconstruction and picture-level fusion splicing, it solves the problem of splicing multiple reconstruction results in three-dimensional reconstruction, improves accuracy and efficiency, and is suitable for a variety of application scenarios.
Patent Information
- Application Number
- CN202110056555.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-15
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-01-15
AI Technical Summary
With existing 3D reconstruction technology, when the number of images increases, the reconstruction time increases exponentially, and the splicing between multiple reconstruction results is difficult to correctly integrate, resulting in errors and inconsistencies in the splicing.
A three-dimensional reconstruction method is proposed, which groups the pictures to be reconstructed for local reconstruction, determines the associated picture pairs and loop picture pairs, and updates the camera pose trajectory and point cloud based on these constraint information to achieve picture-level fusion between local reconstruction results. Splicing to improve the accuracy and overall consistency of the splicing.
It improves the accuracy and efficiency of three-dimensional reconstruction, ensures the consistency of the overall results, and does not require timing information. It is suitable for real-time positioning, map reconstruction, and motion recovery structures.
Smart Images

Figure CN112767541B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer vision technology, and in particular to a three-dimensional reconstruction method and device, an electronic device, and a storage medium. Background Art
[0002] In the process of using images for 3D reconstruction, the length of reconstruction time increases exponentially with the number of images used. In order to solve this problem, the images to be reconstructed can be grouped first, and then each group of images can be reconstructed separately, and finally the reconstruction results can be spliced and registered to obtain the final reconstruction result. Summary of the invention
[0003] The present disclosure proposes a three-dimensional reconstruction method and device, an electronic device and a storage medium, which can realize image-level fusion and splicing between local reconstruction results, improve the accuracy of the splicing, and thus improve the accuracy and efficiency of reconstruction.
[0004] According to one aspect of the present disclosure, a three-dimensional reconstruction method is provided, comprising:
[0005] Based on multiple first images to be reconstructed, multiple local reconstruction results are obtained; based on the multiple local reconstruction results, associated image pairs and loop closure image pairs are determined, the associated image pairs include two first images representing the same position of the target object and used to construct the same local reconstruction result, and the loop closure image pairs include two first images representing the same position of the target object and used to construct different local reconstruction results; based on the constraint information of the associated image pairs and the constraint information of the loop closure image pairs, the camera pose trajectory and point cloud in each local reconstruction result are updated to obtain the target reconstruction result.
[0006] In the disclosed embodiment, based on the transformation relationship between the images representing the same position in the same local reconstruction result, and the transformation relationship between the images representing the same position in different local reconstruction results, the camera pose trajectory and point cloud in each local reconstruction result are updated, so as to achieve image-level fusion and splicing between the local reconstruction results, and improve the accuracy of the splicing. In addition, in the disclosed embodiment, each local reconstruction result is updated at the same time, and the error is spread over the overall reconstruction, so as to achieve overall optimization and ensure overall consistency. In addition, the three-dimensional reconstruction method provided in the disclosed embodiment can realize three-dimensional reconstruction without timing information. Therefore, in addition to being applied to Simultaneous Localization And Mapping (SLAM), it can also be applied to Structure Form Motion (SFM).
[0007] In a possible implementation manner, determining the associated picture pairs based on the multiple local reconstruction results includes:
[0008] Obtain a second picture and a third picture from a first picture for constructing a first local reconstruction result, wherein the first local creation result is any one of the multiple local creation results, the second picture and the third picture are any one of the first picture for constructing the first local reconstruction result, and the third picture is different from the second picture; determine the degree of common vision and the position distance between the second picture and the third picture; and when the degree of common vision and the position distance meet preset association conditions, determine the second picture and the third picture as an associated picture pair.
[0009] In the disclosed embodiment, by determining associated image pairs in a local reconstruction result, an association between images within the local reconstruction result is established, which is beneficial to improving overall optimization and maintaining overall consistency.
[0010] In a possible implementation manner, determining the degree of co-viewing between the second picture and the third picture includes:
[0011] The degree of common viewing of the second image and the third image is determined based on the correspondence between the feature points in the second image and the third image and the three-dimensional points in the first point cloud, respectively, wherein the first local reconstruction result includes the first point cloud.
[0012] In the disclosed embodiment, by determining the degree of common view, pictures of the same position of the target object in the same local reconstruction result can be obtained, thereby achieving association between pictures within the local reconstruction result.
[0013] In a possible implementation manner, determining the loop picture pair based on the multiple local creation results includes:
[0014] A fourth picture and a fifth picture are obtained from a first picture for constructing a second local reconstruction result and a first picture for constructing a third local reconstruction result, respectively, wherein the second local reconstruction result and the third local reconstruction result are any two of the multiple local creation results, the fourth picture is any one of the first pictures for constructing the second local reconstruction result, and the fifth picture is any one of the first pictures for constructing the third local reconstruction result; matching feature points of the fourth picture and the fifth picture are determined; when the number of matching feature points is greater than a first threshold, a reprojection error between the fourth picture and the fifth picture is determined according to a correspondence between the matching feature points and the three-dimensional points in the second point cloud and a correspondence between the matching feature points and the three-dimensional points in the third point cloud, wherein the second local reconstruction result includes the second point cloud, and the third local reconstruction result includes the third point cloud; when the reprojection error and the position distance between the fourth picture and the fifth picture meet a preset loop condition, the fourth picture and the fifth picture are determined as a loop picture pair.
[0015] In the disclosed embodiment, by determining a loop picture pair in two local reconstruction results, an association between pictures in the local reconstruction results is established, which is beneficial to improving the accuracy of the splicing.
[0016] In a possible implementation, the method further includes:
[0017] The pose constraint of the associated picture pair is determined according to the camera poses corresponding to the two first pictures in the associated picture pair.
[0018] In the disclosed embodiment, by determining the pose constraints of the associated image pairs, the camera pose trajectory can be updated, thereby improving the overall optimization and maintaining overall consistency.
[0019] In a possible implementation, the method further includes:
[0020] Determine a three-dimensional similarity transformation between two first images in the loop picture pair; determine a pose constraint of the loop picture pair according to the three-dimensional similarity transformation and the camera poses corresponding to the two first images in the loop picture pair; determine a scale constraint of the loop picture pair according to the three-dimensional similarity transformation.
[0021] In the disclosed embodiment, by determining the pose constraints and scale constraints of the loop-closed image pair, the camera pose trajectory can be updated, thereby improving the accuracy of the stitching.
[0022] In a possible implementation, based on the constraint information of the associated image pair and the constraint information of the loopback image pair, the camera pose trajectory and the point cloud in each local reconstruction result are updated to obtain a target reconstruction result, including:
[0023] Based on the constraint information of the associated image pair and the constraint information of the loopback image pair, the camera pose trajectory in each local reconstruction result is updated; based on the updated camera pose trajectory in each local reconstruction result, the point cloud in each local reconstruction result is updated; and according to the updated camera pose trajectory and point cloud in each local reconstruction result, the target reconstruction result is determined.
[0024] In the disclosed embodiment, by updating the camera pose trajectory and point cloud in each local reconstruction result, the accuracy of the splicing point can be improved to obtain a target reconstruction result with higher accuracy.
[0025] In a possible implementation, based on the updated camera pose trajectory in each local reconstruction result, the point cloud in each local reconstruction result is updated, including:
[0026] From the multiple local reconstruction results, obtain the correspondence between the three-dimensional points in the point cloud and the feature points on the first image; based on the obtained correspondence, perform triangulation and reprojection processing to obtain the reprojection error of each three-dimensional point; filter out the target three-dimensional points whose reprojection error is less than a second threshold from the three-dimensional points; use the bundle adjustment method to jointly optimize the target three-dimensional points and the camera pose trajectory in each updated local reconstruction result to obtain an updated target three-dimensional point; use the updated target three-dimensional point to update the point cloud in each local reconstruction result.
[0027] According to one aspect of the present disclosure, a three-dimensional reconstruction device is provided, including: an acquisition module, used to obtain multiple local reconstruction results based on multiple first images to be reconstructed; a first determination module, used to determine associated image pairs and loop closure image pairs based on the multiple local reconstruction results, the associated image pairs including two first images representing the same position of the target object and used to construct the same local reconstruction result, and the loop closure image pairs including two first images representing the same position of the target object and used to construct different local reconstruction results; an update module, used to update the camera pose trajectory and point cloud in each local reconstruction result based on the constraint information of the associated image pairs and the constraint information of the loop closure image pairs, to obtain the target reconstruction result.
[0028] In a possible implementation manner, the first determining module is further configured to:
[0029] Obtain a second picture and a third picture from a first picture for constructing a first local reconstruction result, wherein the first local creation result is any one of the multiple local creation results, the second picture and the third picture are any one of the first picture for constructing the first local reconstruction result, and the third picture is different from the second picture; determine the degree of common vision and the position distance between the second picture and the third picture; and when the degree of common vision and the position distance meet preset association conditions, determine the second picture and the third picture as an associated picture pair.
[0030] In a possible implementation manner, determining the degree of co-viewing between the second picture and the third picture includes:
[0031] The degree of common viewing of the second image and the third image is determined based on the correspondence between the feature points in the second image and the third image and the three-dimensional points in the first point cloud, respectively, wherein the first local reconstruction result includes the first point cloud.
[0032] In a possible implementation manner, the first determining module is further configured to:
[0033] A fourth picture and a fifth picture are obtained from a first picture for constructing a second local reconstruction result and a first picture for constructing a third local reconstruction result, respectively, wherein the second local reconstruction result and the third local reconstruction result are any two of the multiple local creation results, the fourth picture is any one of the first pictures for constructing the second local reconstruction result, and the fifth picture is any one of the first pictures for constructing the third local reconstruction result; matching feature points of the fourth picture and the fifth picture are determined; when the number of matching feature points is greater than a first threshold, a reprojection error between the fourth picture and the fifth picture is determined according to a correspondence between the matching feature points and the three-dimensional points in the second point cloud and a correspondence between the matching feature points and the three-dimensional points in the third point cloud, wherein the second local reconstruction result includes the second point cloud, and the third local reconstruction result includes the third point cloud; when the reprojection error and the position distance between the fourth picture and the fifth picture meet a preset loop condition, the fourth picture and the fifth picture are determined as a loop picture pair.
[0034] In a possible implementation manner, the device further includes:
[0035] The second determination module is used to determine the posture constraint of the associated picture pair according to the camera postures corresponding to the two first pictures in the associated picture pair.
[0036] In a possible implementation manner, the device further includes:
[0037] A third determination module is used to determine a three-dimensional similarity transformation between two first images in the loop picture pair;
[0038] A fourth determination module, configured to determine a pose constraint of the loop picture pair according to the three-dimensional similarity transformation and the camera poses corresponding to the two first pictures in the loop picture pair;
[0039] A fifth determination module is used to determine the scale constraint of the loop picture pair according to the three-dimensional similarity transformation.
[0040] In a possible implementation, the update module is further configured to:
[0041] Based on the constraint information of the associated image pair and the constraint information of the loopback image pair, the camera pose trajectory in each local reconstruction result is updated; based on the updated camera pose trajectory in each local reconstruction result, the point cloud in each local reconstruction result is updated; and according to the updated camera pose trajectory and point cloud in each local reconstruction result, the target reconstruction result is determined.
[0042] In a possible implementation, based on the updated camera pose trajectory in each local reconstruction result, the point cloud in each local reconstruction result is updated, including:
[0043] From the multiple local reconstruction results, obtain the correspondence between the three-dimensional points in the point cloud and the feature points on the first image; based on the obtained correspondence, perform triangulation and reprojection processing to obtain the reprojection error of each three-dimensional point; filter out the target three-dimensional points whose reprojection error is less than a second threshold from the three-dimensional points; use the bundle adjustment method to jointly optimize the target three-dimensional points and the camera pose trajectory in each updated local reconstruction result to obtain an updated target three-dimensional point; use the updated target three-dimensional point to update the point cloud in each local reconstruction result.
[0044] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
[0045] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor.
[0046] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present disclosure. Other features and aspects of the present disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0048] Figure 1 A flowchart showing a three-dimensional reconstruction method according to an embodiment of the present disclosure is shown;
[0049] Figure 2a A schematic diagram showing the camera pose trajectory in each local reconstruction result before updating;
[0050] Figure 2b A schematic diagram showing the updated camera pose trajectory;
[0051] Figure 3a A schematic diagram showing a target reconstruction result obtained based on multiple local reconstruction results in the related art;
[0052] Figure 3b A schematic diagram showing a target reconstruction result of an embodiment of the present disclosure;
[0053] Figure 4a A schematic diagram showing a target reconstruction result obtained based on multiple local reconstruction results in the related art;
[0054] Figure 4b A schematic diagram showing a target reconstruction result of an embodiment of the present disclosure;
[0055] Figure 5 A block diagram of a three-dimensional reconstruction device according to an embodiment of the present disclosure is shown;
[0056] Figure 6 A block diagram of an electronic device 800 according to an embodiment of the present disclosure is shown;
[0057] Figure 7 A block diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0058] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0059] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0060] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0061] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0062] In three-dimensional reconstruction using images, the length of reconstruction time increases exponentially with the number of reconstructed images. Therefore, it is proposed to cluster the images according to their feature correlation, reconstruct them separately, and then splice and align the results of multiple groups of reconstructions. In the process of splicing and aligning the reconstruction results to obtain the final reconstruction result, in the related technology, for any two reconstruction results, the corresponding three-dimensional points in the two reconstruction results are found by the correlation between the images at the splicing point, and the transformation relationship between the two reconstruction results is determined by calculating the similarity transformation between the corresponding three-dimensional points, and the two reconstruction results are spliced and aligned based on the transformation relationship. In the case of multiple reconstruction results, especially when the relationship between the multiple reconstruction results is complex (for example, reconstruction result A, reconstruction result B and reconstruction result C need to be spliced in pairs), it is difficult to correctly splice the point cloud as a whole by simply calculating the transformation relationship between the reconstruction results in the splicing seam.
[0063] In order to solve the above problems, the embodiments of the present disclosure provide a three-dimensional reconstruction method, which can correctly stitch multiple reconstruction results, thereby improving the accuracy of three-dimensional reconstruction. Figure 1 A flowchart of a three-dimensional reconstruction method according to an embodiment of the present disclosure is shown. Figure 1 As shown, the method includes:
[0064] Step S11, obtaining a plurality of local reconstruction results based on a plurality of first pictures to be reconstructed.
[0065] Among them, each local reconstruction result is constructed based on multiple first images to be reconstructed, and each local reconstruction result includes a point cloud, a camera pose trajectory, and a correspondence between feature points in each first image used to construct the local reconstruction result and three-dimensional points in the point cloud included in the local reconstruction result. The camera pose trajectory includes the camera pose of each first image used to construct the local reconstruction result.
[0066] Step S12: determining associated picture pairs and loopback picture pairs based on the multiple local reconstruction results.
[0067] The associated image pair includes two first images representing the same position of the target object and used to construct the same local reconstruction result, and the loop image pair includes two first images representing the same position of the target object and used to construct different local reconstruction results.
[0068] The first picture may represent a picture to be reconstructed. The first picture may be any two-dimensional picture.
[0069] The target object can be used to represent the object being photographed. In one example, the target object may include a table, a person, an animal, a building, a car, etc. The target object may also include all objects in the target area. In the embodiment of the present disclosure, there is no restriction on the target object. It is understandable that the first image used for three-dimensional reconstruction includes the target object. Taking a person as the target object as an example, the position in the target object may include a face, a body, an eye, a mouth, a nose, an ear, a shoe, an eyelash or an eyeball, etc. The embodiment of the present disclosure does not limit the granularity of the position in the target object. In one example, when two first images both capture the face of person A, it can be considered that the two first images represent the same position of the target object. In another example, when one first image captures the face of person A and the other first image captures the back of person A, it can be considered that the two first images represent different positions of the target object. It should be noted that the two first images obtained when the same position of the target object is captured from two different angles can also be used as the first images representing the same position of the target object. For example, when the two first images capture the face of person A from the front and the side, respectively, it can be considered that the two first images represent the same position of the target object.
[0070] In other words, in the disclosed embodiment, the associated image pair includes two first images, the two first images are used to construct the same local reconstruction result, and the two images both capture the same position of the target object. The loopback image pair includes two first images, the two first images are used to construct different local reconstruction results, and the two images both capture the same position of the target object.
[0071] Step S13: based on the constraint information of the associated image pair and the constraint information of the loopback image pair, update the camera pose trajectory and point cloud in each local reconstruction result to obtain a target reconstruction result.
[0072] The constraint information includes a posture constraint and a scale constraint, wherein the posture constraint is used to represent the transformation between camera postures of the two first images, and the scale constraint is used to represent the transformation between measurement standards of the two first images.
[0073] In a possible implementation, the three-dimensional reconstruction method can be executed by an electronic device such as a terminal device or a server, and the terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The method can be implemented by a processor calling a computer-readable instruction stored in a memory. Alternatively, the method can be executed by a server.
[0074] In the disclosed embodiment, based on the transformation relationship between the images representing the same position in the same local reconstruction result, and the transformation relationship between the images representing the same position in different local reconstruction results, the camera pose trajectory and point cloud in each local reconstruction result are updated, so as to achieve image-level fusion and splicing between the local reconstruction results, and improve the accuracy of the splicing. In addition, in the disclosed embodiment, each local reconstruction result is updated at the same time, and the error is spread over the overall reconstruction, so as to achieve overall optimization and ensure overall consistency. In addition, the three-dimensional reconstruction method provided in the disclosed embodiment can realize three-dimensional reconstruction without timing information. Therefore, in addition to being applied to Simultaneous Localization And Mapping (SLAM), it can also be applied to Structure Form Motion (SFM).
[0075] In step S11, the user can collect multiple first pictures of the target object through the shooting device of a terminal device such as a mobile phone, a tablet computer or a personal computer. The user can also collect multiple first pictures of the target object through a camera, and then send the collected first pictures to the terminal device. The terminal device can obtain multiple local reconstruction results based on the multiple first pictures obtained. In one example, the terminal device can cluster the multiple first pictures according to feature correlation to obtain multiple picture groups, each picture group including multiple first pictures. Then, the terminal device can construct a local reconstruction result for each picture group. The terminal device can use methods such as stereoscopic vision method, chromaticity shaping method and stereoscopic optical method to construct the local reconstruction result. The embodiment of the present disclosure does not limit the clustering method of the first picture and the method of constructing the local reconstruction result.
[0076] Each local reconstruction result may include a point cloud, a camera pose trajectory, and a correspondence between a feature point in each first picture of the local reconstruction result and a three-dimensional point in the point cloud included in the local reconstruction result. The point cloud includes a plurality of three-dimensional points. In one example, the three-dimensional point can be represented by three-dimensional coordinates (x, y, z). The camera pose trajectory includes the camera poses of each first picture of the corresponding local reconstruction result. In one example, for any local reconstruction result: when the first first picture of the local reconstruction result is used as a reference, the camera coordinates of the first first picture are used as the world system coordinates; for any other first picture of the local reconstruction result, the displacement vector of the camera pose of the first picture relative to the camera pose of the first first picture is the coordinate of the world system where the current camera of the first picture is located; the camera pose trajectory in the local reconstruction result can be formed according to the coordinates of the corresponding cameras of each first picture of the local reconstruction result in the world system. In implementation, the camera pose can be represented by seven degrees of freedom, including three translations (translation distances along the x-axis, y-axis, and z-axis, respectively), three rotations (three rotation angles around the x-axis, y-axis, and z-axis, respectively), and a scale information. The scale information can represent a measurement standard.
[0077] In step S12, the terminal device may determine an associated picture pair based on the multiple local reconstruction results. The associated picture pair may include two first pictures representing the same position of the target object and used to construct the same local reconstruction result. In other words, the associated picture pair includes two first pictures, the two first pictures are used to construct the same local reconstruction result, and the two first pictures represent the same position of the target object.
[0078] In one possible implementation, based on the multiple local reconstruction results, determining an associated picture pair includes: obtaining a second picture and a third picture from a first picture that constructs a first local reconstruction result; determining a degree of co-viewing and a position distance between the second picture and the third picture; and determining the second picture and the third picture as an associated picture pair when the degree of co-viewing and the position distance meet preset association conditions.
[0079] The first local reconstruction result may be any one of the multiple local creation results, the second picture and the third picture may be any one of the first pictures for constructing the first local reconstruction result, and the third picture is different from the second picture. In other words, the third picture may be any first picture other than the first picture determined as the second picture in the first pictures for constructing the first local reconstruction result. It can be seen that the second picture and the third picture are two first pictures for constructing the same local reconstruction result (i.e., the first local reconstruction result).
[0080] Based on this, the terminal device can determine the degree of co-viewing and position distance between the second picture and the third picture. When the degree of co-viewing and position distance meet the preset association conditions, it is determined that the second picture and the third picture represent the same position of the target object, and then the second picture and the third picture are determined as an associated picture pair.
[0081] The degree of co-viewing of the second image and the third image can be used to indicate the degree of visual overlap between the second image and the third image. When the degree of co-viewing is large, it indicates that the degree of visual overlap is large. At this time, it can be determined that the second image and the third image are likely to include the same position of the target object (for example, the second image and the third image are likely to include the face of person A, and for example, the second image and the third image are likely to include a certain car), and then the second image and the third image are determined as an associated image pair. When the degree of co-viewing is small, it indicates that the degree of visual overlap is small. At this time, it can be determined that the second image and the third image are likely to include the same position of the target object, and then the second image and the third image cannot be determined as associated images.
[0082] In one example, the terminal device may determine the degree of co-viewing of the second image and the third image based on the correspondence between feature points in the second image and the third image and the three-dimensional points in the first point cloud, respectively.
[0083] The first local reconstruction result includes the first point cloud. The feature points in the second picture are recorded as first feature points, and the feature points in the third picture are recorded as second feature points. The correspondence between the feature points in the second picture and the three-dimensional points in the first point cloud is the correspondence between the second feature points and the three-dimensional points in the first point cloud, and the correspondence between the feature points in the third picture and the three-dimensional points in the first point cloud is the correspondence between the third feature points and the three-dimensional points in the first point cloud. Based on the above two correspondences, the first feature point and the second feature point corresponding to the same three-dimensional point in the first point cloud can be determined. The first feature point and the second feature point corresponding to the same three-dimensional point in the first point cloud can be called common viewpoints. The terminal device can determine the number of common viewpoints of the first picture and the second picture as the degree of common view of the first picture and the second picture.
[0084] The position distance between the second image and the third image can be used to indicate the proximity of the camera positions when the second image and the third image were captured. When the position distance is large, it indicates that the position proximity is small. In this case, it can be determined that the possibility of including the same position of the target object in the second image and the third image is small, and thus the second image and the third image cannot be determined as associated images. When the position distance is small, it indicates that the position proximity is large. In this case, it can be determined that the possibility of including the same position of the target object in the second image and the third image is large, and thus the second image and the third image can be determined as associated images.
[0085] In one example, the terminal device can determine the position distance between the second image and the third image based on the camera pose corresponding to the second image and the camera pose corresponding to the third image. For example, the terminal device can obtain the difference between the translation amount (including three translation amounts along the x-axis, y-axis and z-axis) in the camera pose corresponding to the second image and the translation amount in the camera pose corresponding to the third image as the translation distance; obtain the difference between the rotation amount (including three rotation amounts around the x-axis, y-axis and z-axis) in the camera pose corresponding to the second image and the rotation amount in the camera pose corresponding to the third image as the rotation angle. Then, the translation distance and / or the rotation angle are determined as the position distance between the second image and the third image. It should be noted that since the second image and the third image correspond to the same local reconstruction result, the scale information in the camera poses corresponding to the two is the same, which can be ignored when calculating the position distance between the second image and the third image.
[0086] In a possible implementation, the preset association condition may include: the degree of common vision is greater than the common vision threshold and the position distance is less than the distance threshold. Among them, the common vision threshold and the distance threshold can be set as needed. Taking the number of common view points as the degree of common vision as an example, the common vision threshold may be 15, 30 or 50, etc. Taking the translation distance as the position distance as an example, the distance threshold may be 0.1 or 0.5, etc. Taking the rotation angle as the position distance, the distance threshold may be 1 or 1.5, etc. In one example, the distance threshold may include a first sub-threshold and a second sub-threshold, and the preset association condition may include that the degree of common vision is greater than the first threshold, the translation distance is less than the first sub-threshold and the rotation angle is less than the second sub-threshold. The first sub-threshold and the second sub-threshold may also be set as needed, and are not limited in the embodiments of the present disclosure.
[0087] In the disclosed embodiment, the associated picture pair is determined based on each of the multiple local reconstruction results obtained in step S11. The method of determining the associated picture pair based on each local reconstruction result can refer to the method of determining the associated picture pair based on the first local reconstruction result, and one or more associated picture pairs can be determined based on each local reconstruction result.
[0088] In step S12, the terminal device may also determine a loopback picture pair based on multiple local reconstruction results. The loopback picture pair includes two first pictures representing the same position of the target object and used to construct different local reconstruction results. In other words, the loopback picture pair includes two first pictures, the two first pictures are used to construct different local reconstruction results, and the two first pictures represent the same position of the target object.
[0089] In a possible implementation, based on the multiple local creation results, determining a loop picture pair may include: obtaining a fourth picture and a fifth picture from the first picture for constructing a second local reconstruction result and the first picture for constructing a third local reconstruction result, respectively; determining matching feature points of the fourth picture and the fifth picture; when the number of matching feature points is greater than a first threshold, determining a reprojection error between the fourth picture and the fifth picture based on a correspondence between the matching feature points and three-dimensional points in the second point cloud and a correspondence between the matching feature points and three-dimensional points in the third point cloud; when the reprojection error and position distance between the fourth picture and the fifth picture meet a preset loop condition, determining the fourth picture and the fifth picture as a loop picture pair.
[0090] The second local reconstruction result and the third local reconstruction result are any two of the multiple local creation results. The fourth picture is any one of the first pictures for constructing the second local reconstruction result, and the fifth picture is any one of the first pictures for constructing the third local reconstruction result. That is, the fourth picture and the fifth picture are two first pictures for constructing different local reconstruction results (i.e., the second local reconstruction result and the third local reconstruction result). The second point cloud is included in the second local reconstruction result, and the third point cloud is included in the third reconstruction result.
[0091] Based on this, the terminal device may first determine the matching feature points of the fourth image and the fifth image. In one example, the terminal device may respectively extract the feature points of the fourth image and the feature points of the fifth image by using a boundary feature method, a geometric parameter method, etc., and then calculate the similarity between each feature point of the fourth image and each feature point of the fifth image. The terminal device may determine the feature points of the fourth image and the feature points of the fifth image whose similarity is greater than a similarity threshold (which may be set as needed) as matching feature points. In the case where the number of matching feature points is less than or equal to the first threshold, it indicates that the fourth image and the fifth image are not photographed at the same position of the target object, or even photographed at the same position of the target object, and the terminal device does not perform subsequent processing. In the case where the number of matching feature points is greater than the first threshold, it indicates that the fourth image and the fifth image may be photographed at the same position of the target object. At this time, in order to improve the accuracy, the terminal device may perform further processing: the terminal device may determine the reprojection error based on the corresponding relationship between the matching feature points and the three-dimensional points in the second point cloud and the corresponding relationship with the three-dimensional points in the third point cloud. In one example, the terminal device may perform PnP calculation based on the corresponding relationship between the matching feature points and the three-dimensional points in the second point cloud and the corresponding relationship with the three-dimensional points in the third point cloud to obtain the reprojection error.
[0092] Then, the terminal device may determine the position distance between the fourth picture and the fifth picture. The position distance between the fourth picture and the fifth picture may refer to the position distance between the second picture and the third picture, which will not be described in detail here.
[0093] Finally, the terminal device may determine the fourth picture and the fifth picture as a loop picture pair when the reprojection error and the position distance between the fourth picture and the fifth picture meet a preset loop condition. The loop condition may include that the reprojection error is less than a reprojection threshold and the position distance is greater than a distance threshold.
[0094] It should be noted that the first threshold, the reprojection threshold and the distance threshold can be set as needed, and the embodiments of the present disclosure do not limit this.
[0095] In the disclosed embodiment, based on the multiple local reconstruction results obtained in step S11, loop closure picture pairs are determined between each pair. The method of determining the associated picture pair based on each two local reconstruction results can refer to the method of determining the loop closure picture pair based on the second local reconstruction result and the third local reconstruction result, and one or more loop closure picture pairs can be determined based on each two local reconstruction results.
[0096] At this point, the terminal device has determined one or more associated image pairs and one or more loopback image pairs, thereby achieving the association of local reconstruction results at the image level.
[0097] In step S13, the constraint information includes a pose constraint and a scale constraint. The pose constraint can be used to represent the transformation between the camera poses of the two first images, and the scale constraint can be used to represent the transformation between the measurement standards of the two first images. Among them, the pose constraint includes a translation constraint and a rotation constraint. Among them, the translation constraint represents a constraint on the translation distance, and the rotation constraint represents a constraint on the rotation angle.
[0098] It can be understood that the pose constraint of an associated picture pair can be used to represent the transformation between the camera poses of the two first pictures in the associated picture pair, and the scale constraint of an associated picture pair can be used to represent the transformation between the measurement standards of the two first pictures in the associated picture pair. In one possible implementation, the method further includes: determining the pose constraint of the associated picture pair based on the camera poses corresponding to the two first pictures in the associated picture pair. For example, the associated picture pair includes picture 1 and picture 2, where the camera pose corresponding to picture 1 is T1, and the camera pose corresponding to picture 2 is T2, then the pose constraint of picture 1 and picture 2 is T1. -1 T2.
[0099] It should be noted that, since the two first pictures in the associated picture pair belong to the same local reconstruction result, the scale constraint of the associated picture pair is 1.
[0100] It can be understood that the pose constraint of the loop picture pair can be used to represent the transformation between the camera poses of the two first pictures in the loop picture pair, and the scale constraint of the loop picture pair can be used to represent the transformation between the measurement standards of the two first pictures in the loop picture pair. In one possible implementation, the method also includes: determining a three-dimensional similarity transformation between the two first pictures in the loop picture pair; determining the pose constraint of the loop picture pair based on the three-dimensional similarity transformation and the camera poses corresponding to the two first pictures in the loop picture pair; determining the scale constraint of the loop picture pair based on the three-dimensional similarity transformation. The three-dimensional similarity transformation of the two first pictures in the loop picture pair can be determined based on their common view three-dimensional points using methods in the relevant technology, which will not be repeated here.
[0101] For example, the loop image pair includes image 3 and image 4, where the camera pose corresponding to image 1 is T3. After the three-dimensional similarity transformation, the camera pose of image 3 becomes T′3, and the camera pose of image 4 is T4. Then the pose constraint of image 3 and image 4 is T3′ -1 T2. Similarly, the measurement standard of picture 3 can be first subjected to a three-dimensional similarity transformation, and then the scale constraints of pictures 3 and 4 can be determined by using the transformed measurement standard of picture 3 and the untransformed measurement standard of picture 4.
[0102] After determining the constraint information of the associated image pairs and the constraint information of the loop closure image pairs, the terminal device can update the camera pose trajectory and point cloud in each local reconstruction result based on the constraint information of the associated image pairs and the constraint information of the loop closure image pairs to obtain the target reconstruction result.
[0103] In a possible implementation, step S13 may include: updating the camera pose trajectory in each local reconstruction result based on the constraint information of the associated image pair and the constraint information of the loopback image pair; updating the point cloud in each local reconstruction result based on the updated camera pose trajectory in each local reconstruction result; and determining the target reconstruction result according to the updated camera pose trajectory and point cloud in each local reconstruction result.
[0104] In one example, the terminal device can update the camera pose of each first picture in the associated picture pair according to the constraint information of the associated picture pair, thereby updating the camera pose trajectory of a corresponding local reconstruction result. The terminal device can update the camera pose of each first picture in the loop picture pair according to the constraint information of the loop picture pair, thereby updating the camera pose trajectory of the corresponding two local reconstruction results. Exemplarily, the terminal device can fix the camera pose of a first picture in the associated picture pair unchanged, and update the camera pose of another first picture in the associated picture pair based on the constraint information of the associated picture pair. For the loop picture pair, this method of fixing one first can also be adopted, which will not be repeated here.
[0105] Figure 2a Schematic diagram showing the camera pose trajectory in each local reconstruction result before updating. Figure 2a , trajectory 1, trajectory 2, trajectory 3 and trajectory 4 correspond to the camera pose trajectory of local reconstruction result 1, the camera pose trajectory of local reconstruction result 2, the camera pose trajectory of local reconstruction result 3 and the camera pose trajectory of local reconstruction result 4 respectively. Figure 2a As shown in the figure, the camera pose trajectories of different local reconstruction results cannot be well stitched together, and there is a certain gap, resulting in a large error when multiple local reconstruction results are combined. Figure 2b Schematic diagram showing the updated camera pose trajectory. Figure 2b The camera pose trajectory shown is a 3D reconstruction method according to an embodiment of the present disclosure. Figure 2a The camera pose trajectory shown in FIG. Figure 2b As shown in the figure, the camera pose trajectories of different local reconstruction results are well spliced together, especially the loop image pairs are optimized, and the overall camera pose consistency is further improved.
[0106] In a possible implementation, during the process of updating the camera pose trajectory, weights may be set for the first images first, and the camera pose trajectory may be updated based on the weights of the first images.
[0107] In one example, updating the point cloud in each local reconstruction result based on the camera pose trajectory in each updated local reconstruction result can include: obtaining the correspondence between the three-dimensional points in the point cloud and the feature points on the first image from the multiple local reconstruction results; performing triangulation and reprojection processing based on the obtained correspondence to obtain the reprojection error of each three-dimensional point; screening out target three-dimensional points whose reprojection error is less than a second threshold from the three-dimensional points; using the bundle adjustment method to jointly optimize the target three-dimensional points and the camera pose trajectory in each updated local reconstruction result to obtain updated target three-dimensional points; and using the updated target three-dimensional points to update the point cloud in each local reconstruction result.
[0108] Figure 3a A schematic diagram showing a target reconstruction result obtained based on multiple local reconstruction results in the related art. Figure 3b A schematic diagram showing a target reconstruction result according to an embodiment of the present disclosure. Figure 4a A schematic diagram showing a target reconstruction result obtained based on multiple local reconstruction results in the related art. Figure 4b A schematic diagram showing the target reconstruction result of the embodiment of the present disclosure is shown. Figure 3a and Figure 3b , and contrast Figure 4a and Figure 4b It can be seen that the point cloud image of the target reconstruction result obtained by the embodiment of the present disclosure is clearer, and the camera posture trajectory is more connected, which not only ensures that the stitching is normal, but also maintains global consistency, and the three-dimensional reconstruction effect is better.
[0109] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0110] In addition, the present disclosure also provides a three-dimensional reconstruction device, an electronic device, a computer-readable storage medium, and a program, all of which can be used to implement any three-dimensional reconstruction method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to the corresponding records in the method part and will not be repeated here.
[0111] Figure 5 FIG. 2 is a block diagram of a three-dimensional reconstruction device according to an embodiment of the present disclosure. Figure 5 As shown, the device 500 includes:
[0112] An acquisition module 501 is used to obtain multiple local reconstruction results based on multiple first images to be reconstructed; a first determination module 502 is used to determine associated image pairs and loop closure image pairs based on the multiple local reconstruction results, wherein the associated image pairs include two first images representing the same position of the target object and used to construct the same local reconstruction result, and the loop closure image pairs include two first images representing the same position of the target object and used to construct different local reconstruction results; an update module 503 is used to update the camera pose trajectory and point cloud in each local reconstruction result based on the constraint information of the associated image pairs and the constraint information of the loop closure image pairs to obtain the target reconstruction result.
[0113] In a possible implementation manner, the first determining module is further configured to:
[0114] Obtain a second picture and a third picture from a first picture for constructing a first local reconstruction result, wherein the first local creation result is any one of the multiple local creation results, the second picture and the third picture are any one of the first picture for constructing the first local reconstruction result, and the third picture is different from the second picture; determine the degree of common vision and the position distance between the second picture and the third picture; and when the degree of common vision and the position distance meet preset association conditions, determine the second picture and the third picture as an associated picture pair.
[0115] In a possible implementation manner, determining the degree of co-viewing between the second picture and the third picture includes:
[0116] The degree of common viewing of the second image and the third image is determined based on the correspondence between the feature points in the second image and the third image and the three-dimensional points in the first point cloud, respectively, wherein the first local reconstruction result includes the first point cloud.
[0117] In a possible implementation manner, the first determining module is further configured to:
[0118] A fourth picture and a fifth picture are obtained from a first picture for constructing a second local reconstruction result and a first picture for constructing a third local reconstruction result, respectively, wherein the second local reconstruction result and the third local reconstruction result are any two of the multiple local creation results, the fourth picture is any one of the first pictures for constructing the second local reconstruction result, and the fifth picture is any one of the first pictures for constructing the third local reconstruction result; matching feature points of the fourth picture and the fifth picture are determined; when the number of matching feature points is greater than a first threshold, a reprojection error between the fourth picture and the fifth picture is determined according to a correspondence between the matching feature points and the three-dimensional points in the second point cloud and a correspondence between the matching feature points and the three-dimensional points in the third point cloud, wherein the second local reconstruction result includes the second point cloud, and the third local reconstruction result includes the third point cloud; when the reprojection error and the position distance between the fourth picture and the fifth picture meet a preset loop condition, the fourth picture and the fifth picture are determined as a loop picture pair.
[0119] In a possible implementation manner, the device further includes:
[0120] The second determination module is used to determine the posture constraint of the associated picture pair according to the camera postures corresponding to the two first pictures in the associated picture pair.
[0121] In a possible implementation manner, the device further includes:
[0122] The third determination module is used to determine the three-dimensional similarity transformation between the two first images in the loop picture pair; the fourth determination module is used to determine the posture constraint of the loop picture pair according to the three-dimensional similarity transformation and the camera posture corresponding to the two first images in the loop picture pair; the fifth determination module is used to determine the scale constraint of the loop picture pair according to the three-dimensional similarity transformation.
[0123] In a possible implementation, the update module is further configured to:
[0124] Based on the constraint information of the associated image pair and the constraint information of the loopback image pair, the camera pose trajectory in each local reconstruction result is updated; based on the updated camera pose trajectory in each local reconstruction result, the point cloud in each local reconstruction result is updated; and according to the updated camera pose trajectory and point cloud in each local reconstruction result, the target reconstruction result is determined.
[0125] In a possible implementation, based on the updated camera pose trajectory in each local reconstruction result, the point cloud in each local reconstruction result is updated, including:
[0126] From the multiple local reconstruction results, obtain the correspondence between the three-dimensional points in the point cloud and the feature points on the first image; based on the obtained correspondence, perform triangulation and reprojection processing to obtain the reprojection error of each three-dimensional point; filter out the target three-dimensional points whose reprojection error is less than a second threshold from the three-dimensional points; use the bundle adjustment method to jointly optimize the target three-dimensional points and the camera pose trajectory in each updated local reconstruction result to obtain an updated target three-dimensional point; use the updated target three-dimensional point to update the point cloud in each local reconstruction result.
[0127] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0128] The embodiment of the present disclosure also provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented. The computer-readable storage medium may be a non-volatile computer-readable storage medium.
[0129] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
[0130] The embodiments of the present disclosure also provide a computer program product, including computer-readable codes. When the computer-readable codes are run on a device, a processor in the device executes instructions for implementing the three-dimensional reconstruction method provided in any of the above embodiments.
[0131] The embodiments of the present disclosure also provide another computer program product for storing computer-readable instructions, which, when executed, enable a computer to perform the operations of the three-dimensional reconstruction method provided in any of the above embodiments.
[0132] The electronic device may be provided as a terminal, a server, or a device in other forms.
[0133] Figure 6 A block diagram of an electronic device 800 according to an embodiment of the present disclosure is shown. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
[0134] Reference Figure 6, the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0135] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0136] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0137] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0138] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0139] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0140] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0141] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a complementary metal oxide semiconductor (CMOS) or a charge coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0142] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0143] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0144] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 804 including computer program instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above method.
[0145] Figure 7 1 is a block diagram of an electronic device 1900 according to an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server. Figure 7 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0146] The electronic device 1900 may further include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Microsoft's server operating system (Windows ServerTM), Apple's graphical user interface-based operating system (Mac OSXTM), a multi-user multi-process computer operating system (UnixTM), a free and open source Unix-like operating system (LinuxTM), an open source Unix-like operating system (FreeBSDTM), or the like.
[0147] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.
[0148] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0149] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: 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), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0150] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0151] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0152] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0153] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0154] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0155] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0156] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.
[0157] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A three-dimensional reconstruction method, characterized in that: include: Based on a plurality of first images to be reconstructed, obtaining a plurality of local reconstruction results; Based on the multiple local reconstruction results, determining an associated picture pair and a loop picture pair, wherein the associated picture pair includes two first pictures representing the same position of the target object and used to construct the same local reconstruction result, and the loop picture pair includes two first pictures representing the same position of the target object and used to construct different local reconstruction results; Based on the constraint information of the associated picture pair and the constraint information of the loop closure picture pair, the camera pose trajectory and the point cloud in each local reconstruction result are updated to obtain a target reconstruction result, wherein the constraint information of the associated picture pair includes the pose constraint and the scale constraint of the associated picture pair, the pose constraint of the associated picture pair is used to represent the transformation between the camera poses of the two first pictures in the associated picture pair, the scale constraint of the associated picture pair is used to represent the transformation between the measurement standards of the two first pictures in the associated picture pair, and the constraint information of the loop closure picture pair includes the pose constraint and the scale constraint of the loop closure picture pair, the pose constraint of the loop closure picture pair is used to represent the transformation between the camera poses of the two first pictures in the loop closure picture pair, and the scale constraint of the loop closure picture pair is used to represent the transformation between the measurement standards of the two first pictures in the loop closure picture pair; Wherein, the method further comprises: Determining a pose constraint of the associated picture pair according to camera poses corresponding to two first pictures in the associated picture pair; Determining a three-dimensional similarity transformation between two first images in the looped image pair; Determine a pose constraint of the loop picture pair according to the three-dimensional similarity transformation and the camera poses corresponding to the two first pictures in the loop picture pair; According to the three-dimensional similarity transformation, a scale constraint of the loop closure image pair is determined.
2. The method according to claim 1, characterized in that Based on the multiple local reconstruction results, determining the associated picture pairs includes: Acquire a second picture and a third picture from a first picture used to construct a first local reconstruction result, wherein the first local reconstruction result is any one of the multiple local reconstruction results, the second picture and the third picture are any one of the first pictures used to construct the first local reconstruction result, and the third picture is different from the second picture; Determining a co-viewing degree and a position distance between the second picture and the third picture; When the co-viewing degree and the position distance satisfy a preset association condition, the second picture and the third picture are determined as an associated picture pair.
3. The method according to claim 2, characterized in that Determining the degree of co-viewing of the second picture and the third picture includes: The degree of common viewing of the second image and the third image is determined based on the correspondence between the feature points in the second image and the third image and the three-dimensional points in the first point cloud, respectively, wherein the first local reconstruction result includes the first point cloud.
4. The method according to any one of claims 1 to 3, characterized in that Based on the multiple local reconstruction results, determining the loopback picture pair includes: Acquire a fourth picture and a fifth picture from a first picture for constructing a second local reconstruction result and a first picture for constructing a third local reconstruction result, respectively, wherein the second local reconstruction result and the third local reconstruction result are any two of the multiple local reconstruction results, the fourth picture is any one of the first pictures for constructing the second local reconstruction result, and the fifth picture is any one of the first pictures for constructing the third local reconstruction result; Determining matching feature points of the fourth image and the fifth image; When the number of matching feature points is greater than a first threshold, determining a reprojection error between the fourth image and the fifth image according to a correspondence between the matching feature points and the three-dimensional points in the second point cloud and a correspondence between the matching feature points and the three-dimensional points in the third point cloud, wherein the second local reconstruction result includes the second point cloud, and the third local reconstruction result includes the third point cloud; When a reprojection error and a position distance between the fourth picture and the fifth picture satisfy a preset loop condition, the fourth picture and the fifth picture are determined as a loop picture pair.
5. The method according to claim 1, characterized in that Based on the constraint information of the associated image pair and the constraint information of the looped image pair, the camera pose trajectory and the point cloud in each local reconstruction result are updated to obtain a target reconstruction result, including: Updating the camera pose trajectory in each local reconstruction result based on the constraint information of the associated image pair and the constraint information of the loopback image pair; Based on the updated camera pose trajectory in each local reconstruction result, the point cloud in each local reconstruction result is updated; The target reconstruction result is determined according to the camera pose trajectory and point cloud in each updated local reconstruction result.
6. The method according to claim 5, characterized in that Based on the updated camera pose trajectory in each local reconstruction result, the point cloud in each local reconstruction result is updated, including: Acquire, from the multiple local reconstruction results, a correspondence between the three-dimensional points in the point cloud and the feature points on the first image; Based on the obtained correspondence, triangulation and reprojection processing are performed to obtain the reprojection error of each three-dimensional point; Filter out target three-dimensional points whose reprojection errors are less than a second threshold from the three-dimensional points; Using a bundle adjustment method to jointly optimize the target three-dimensional point and the camera pose trajectory in each updated local reconstruction result to obtain an updated target three-dimensional point; The updated target 3D points are used to update the point clouds in each local reconstruction result.
7. A three-dimensional reconstruction device, characterized in that: include: An acquisition module, used for obtaining a plurality of local reconstruction results based on a plurality of first images to be reconstructed; A first determination module is used to determine an associated picture pair and a loop picture pair based on the multiple local reconstruction results, wherein the associated picture pair includes two first pictures representing the same position of the target object and used to construct the same local reconstruction result, and the loop picture pair includes two first pictures representing the same position of the target object and used to construct different local reconstruction results; An updating module, configured to update the camera pose trajectory and point cloud in each local reconstruction result based on the constraint information of the associated picture pair and the constraint information of the loop closure picture pair, so as to obtain a target reconstruction result, wherein the constraint information of the associated picture pair includes the pose constraint and the scale constraint of the associated picture pair, the pose constraint of the associated picture pair is used to represent the transformation between the camera poses of the two first pictures in the associated picture pair, the scale constraint of the associated picture pair is used to represent the transformation between the measurement standards of the two first pictures in the associated picture pair, the constraint information of the loop closure picture pair includes the pose constraint and the scale constraint of the loop closure picture pair, the pose constraint of the loop closure picture pair is used to represent the transformation between the camera poses of the two first pictures in the loop closure picture pair, and the scale constraint of the loop closure picture pair is used to represent the transformation between the measurement standards of the two first pictures in the loop closure picture pair; Wherein, the device further comprises: A second determination module, configured to determine a pose constraint of the associated picture pair according to camera poses corresponding to two first pictures in the associated picture pair; A third determination module is used to determine a three-dimensional similarity transformation between two first images in the loop picture pair; A fourth determination module, configured to determine a pose constraint of the loop picture pair according to the three-dimensional similarity transformation and the camera poses corresponding to the two first pictures in the loop picture pair; A fifth determination module is used to determine the scale constraint of the loop picture pair according to the three-dimensional similarity transformation.
8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
