Image grouping method for 3D reconstruction and its device, electronic device, and computer-readable storage medium

The image grouping method iteratively merges image groups based on modularity increments to enhance 3D reconstruction accuracy and robustness in large-scale scenes, addressing inefficiencies and resource demands in current methods.

JP7541184B2Active Publication Date: 2024-08-27ZHEJIANG SENSETIME TECH DEV CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2023507417
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-08-21
Filing Date
2021-06-18
Publication Date
2024-08-27
Estimated Expiration
2041-06-18

AI Technical Summary

Technical Problem

Current 3D reconstruction methods for large-scale scenes are inefficient and require significant computational resources, leading to low accuracy and robustness due to weak internal connectivity in image grouping using normalized cut algorithms.

Method used

An image grouping method that calculates modularity and increment of modularity for image sets, iteratively merging image groups with the maximum modularity increment until a single group is formed, ensuring strong connections within groups and weak connections between groups, thereby improving accuracy and robustness.

Benefits of technology

Enhances the accuracy and robustness of 3D reconstruction by ensuring strong internal connections and weak external connections among image groups, resulting in improved efficiency and reduced computational requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007541184000081
    Figure 0007541184000081
  • Figure 0007541184000087
    Figure 0007541184000087
  • Figure 0007541184000084
    Figure 0007541184000084
Patent Text Reader

Abstract

Provided is a method for grouping images in 3D reconstruction, an apparatus therefor, an electronic device, and a computer-readable storage medium, which includes: calculating a modularity corresponding to the set of images to be grouped by using each image in the set of images to be grouped as one image group (S202); calculating an increment of modularity corresponding to each combination of two image groups included in the set of images to be grouped to obtain an increment set (S204); determining a maximum increment in the increment set, merging two image groups corresponding to the maximum increment to obtain a merged image group, updating the modularity corresponding to the set of images to be grouped and the increment set; and repeating these steps until the set of images to be grouped includes a unique image group (S206).
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] (CROSS-REFERENCE TO RELATED APPLICATIONS) This application is filed based on a Chinese patent having application number 202010852560.5 and filing date of August 21, 2020, and claims priority to the Chinese patent application, the entire contents of which are incorporated herein by reference.

[0002] The present embodiment relates to computer vision technology, and more particularly to a method and apparatus for grouping images in 3D reconstruction, an electronic device, and a computer-readable storage medium. [Background technology]

[0003] In the field of computer vision technology, Structure From Motion (SfM) is a commonly used 3D reconstruction technique. The technique can determine a camera pose corresponding to the scene image of each frame by analyzing an image sequence corresponding to a scene. After the camera pose is determined, the technique can determine a camera motion trajectory based on the camera poses corresponding to the scene images of several consecutive frames, and perform 3D reconstruction for the scene based on the motion trajectory.

[0004] In practical situations, the SfM algorithm is very complex, so it takes a long time to perform 3D reconstruction for a large scene, resulting in low 3D reconstruction efficiency. Meanwhile, performing 3D reconstruction for a large scene requires a very large amount of computational resources, so 3D reconstruction may not be possible in extreme situations.

[0005] To solve the above problem, in the related art, when performing 3D reconstruction for a large-scale scene, the image sequence corresponding to the large-scale scene is usually first divided into several groups of image sequences, and then 3D reconstruction is performed for the image sequence of each group by using the SfM algorithm. After performing 3D reconstruction for the image sequence of each group to obtain a reconstruction model corresponding to each group, the reconstruction models corresponding to each group are fused to obtain a final reconstruction model corresponding to the large-scale scene.

[0006] This shows that in the above-mentioned large-scale scene 3D construction process, the effect of the reconstruction model of each group may affect the robustness of the final reconstruction model. However, in the related art, when grouping images, the images are mainly clustered and grouped by the normalized cut algorithm. Although this grouping method can ensure the uniformity of the division, the internal connectivity of the image groups obtained by the division is weak, which results in low accuracy of image grouping and further reduces the robustness of 3D reconstruction by image grouping. Summary of the Invention [Means for solving the problem]

[0007] The embodiments of the present application provide a method for image grouping in 3D reconstruction, which can improve the accuracy of image grouping and the robustness of 3D reconstruction based on image grouping, and an apparatus therefor, an electronic device, and a computer-readable storage medium.

[0008] The present embodiment discloses a method for grouping images in 3D reconstruction, comprising the steps of: Using each image in the set of images to be grouped as one image group, calculate a modularity corresponding to the set of images to be grouped; Calculating an increment of modularity corresponding to each combination of the image groups included in the set of images to be grouped, to obtain an increment set, assuming that the image groups are combined in pairs; determining a maximum increment in the set of increments, merging two image groups corresponding to the maximum increment to obtain a merged image group, updating a modularity corresponding to the set of images to be grouped and the set of increments, and repeating this step until the set of images to be grouped contains a unique image group; If the set of images to be grouped contains a unique image group, determining a maximum modularity among the recorded modularities after updating in each iteration, and determining an image combination scheme corresponding to the maximum modularity as an image grouping result of the set of images to be grouped.

[0009] In one embodiment shown, determining the image combination scheme corresponding to the maximum modularity as an image grouping result of the set of images to be grouped includes: determining whether the maximum modularity has reached a predetermined threshold; When the maximum modularity reaches the predetermined threshold, determining an image combination method corresponding to the maximum modularity as an image grouping result of the set of images to be grouped; If the maximum modularity does not reach the predetermined threshold, then each image included in the set of images to be grouped is used as an independent image group.

[0010] In one embodiment shown, combining two or more image groups included in the set of images to be grouped includes: combining two image groups having a connection relationship among the plurality of image groups, and recording a correspondence relationship between group identifiers of the image groups having a connection relationship; Here, two image groups having a connected relationship means that the similarity between images in the first image group and the second image group of the two image groups reaches a predetermined similarity threshold value.

[0011] In one illustrative embodiment, the set of increments includes a correspondence between group identifiers of two groups of images that are assumed to be combined and the increments calculated assuming that the two groups of images are merged; Updating the incremental set may include: searching for a correspondence between group identifiers of the recorded image groups having a connection relationship, and determining another image group having a connection relationship with one of the two image groups corresponding to the maximum increment; determining the increments obtained by assuming that the other group of images is merged with each of the two images, and adding the determined increments together to obtain an increment of modularity obtained by assuming that the merged group of images is merged with the other group of images; and recording in the increment set a correspondence between the group identifiers of the merged image group, the other image group, and the increment of the module obtained by assuming that the two are merged.

[0012] In one illustrative embodiment, the method comprises: In each iteration process, after updating the incremental set, the method further includes recording the correspondence between the group identifier of the merged image group and the group identifier of the other image group.

[0013] In one illustrative embodiment, the method comprises: In each iteration process, the method further includes recording a merged image group obtained by merging, and a correspondence between the group identifier of the merged image group and the group identifiers of the two merged image groups.

[0014] In one illustrated embodiment, the merged image group corresponds to an updated modularity in the iterations of generating the merged image group, and group identifiers of the image group correspond to image identifiers corresponding to each image included in the image group; determining a maximum modularity among the recorded modularities after updating in each iteration, and determining an image combination method corresponding to the maximum modularity as an image grouping result of the set of images to be grouped; performing the following steps for the merged image groups recorded in each iteration in reverse order of occurrence of the iterations, starting from the merged image group recorded in the last iteration, the steps including: determining whether a group identifier of the merged image group is included in an identifier set for identifying an image combination scheme, and if the group identifier of the merged image group is not included in the identifier set, writing the group identifier of the merged image group into the identifier set; determining whether the updated modularity corresponding to the merged image group is a maximum modularity among the recorded updated modularities in each iteration; If the updated modularity corresponding to the merged image group is the maximum modularity among the recorded updated modularities in each iteration, images indicated by image identifiers corresponding to each group identifier included in the identifier set are used as one image combination, and each obtained image combination is determined as an image grouping result of the set of images to be grouped.

[0015] In one illustrative embodiment, the method comprises: If the updated modularity corresponding to the merged image group is not the maximum modularity among the recorded updated modularities in each iteration, the method further includes replacing the group identifier of the merged image group recorded in the identifier set with the group identifiers of the two pre-merged image groups corresponding to the merged image group.

[0016] In one embodiment shown, determining whether the updated modularity corresponding to the recorded merged image group is a maximum modularity among the updated modularities in each iteration includes: determining whether the updated modularity in the current iteration has reached the updated modularity in the previous iteration corresponding to the current iteration; If so, determining the updated modularity in the current iteration as the maximum modularity.

[0017] In one embodiment shown, when the above-mentioned plurality of image groups are assumed to be combined in pairs, the step of calculating the increment of modularity corresponding to each combination to obtain an increment set includes the following steps: and for each of the calculated increments assumed to be combined, performing the steps of: determining a binary tree corresponding to each of the two image groups assumed to be combined, and writing the increment and group identifiers of the two images assumed to be combined into the determined binary tree; Here, in the root node of the binary tree, the maximum increment among all the increments recorded in the binary tree and a group identifier corresponding to the maximum increment are recorded.

[0018] In one illustrated embodiment, determining a maximum increment in the set of increments comprises: pushing the root node pointer of said binary tree corresponding to each image group into a max heap for determining a maximum increment; determining a pointer recorded in a root node of said max heap; determining the increment recorded at the node pointed to by said recorded pointer as the maximum increment contained in said set of increments.

[0019] In one illustrative embodiment, the method comprises: Among the obtained image groups, determine an image group containing a number of images smaller than a first predetermined number threshold, and determine the determined image group as an image group to be fused, where the first predetermined number threshold indicates a minimum number of images in each group; determining the remaining groups other than the image group to be fused as a remainder group among the image groups; Calculating a connection weight value between every two image groups among the groups to be merged to construct a connection weight value set, where the connection weight value indicates the number of matching images between the two image groups; The method further includes fusing the group of images to be fused based on the set of connection weight values.

[0020] In one illustrative embodiment, fusing the group of images to be fused based on the set of connection weight values ​​includes: and repeatedly executing the following steps until the set of connection weight values ​​does not include any connection weight values, the steps comprising: determining a maximum connection weight value in said set of connection weight values; determining whether the quantity of images in the image group with the larger quantity of the two image groups corresponding to the maximum connection weight value has reached a second predetermined quantity threshold, the second predetermined quantity threshold indicating the maximum quantity of images in each image group; terminating the current iteration if the second predetermined quantity threshold is reached; and If the second predetermined quantity threshold is not reached, merging the two image groups to obtain a merged image group, and updating the set of connection weight values; If the set of connection weight values ​​does not include any connection weight values, the image groups included in the group waiting to be merged and the image groups among the remainder group are used as the final image groups of the set of images waiting to be grouped.

[0021] In one embodiment shown, calculating connection weights between two image groups among the groups to be merged to configure a set of connection weights includes: creating a binary tree for each image group in the group waiting to be merged that corresponds one-to-one with each image group; The method includes calculating connection weight values ​​between two image groups in the group waiting to be merged, and recording the connection weight values ​​and group identifiers of the two image groups in the binary tree nodes, wherein the root node of the binary tree records the maximum connection weight value among the connection weight values ​​corresponding to each image group, and the group identifier corresponding to the maximum connection weight value.

[0022] In one illustrated embodiment, determining a maximum connection weight value in the set of connection weight values ​​comprises: pushing a root node pointer of the binary tree corresponding to each of the image groups into a max heap for deriving the maximum connection weight value; reading a pointer recorded in the root node of the maximum heap, and determining a connection weight value recorded in the binary tree node pointed to by the recorded pointer as the maximum connection weight value.

[0023] In one illustrative embodiment, after determining the maximum connection weight value in the set of connection weight values, the method further comprises: determining whether a binary tree corresponding to either of the two image groups corresponding to the maximum connection weight value is empty; If it is not empty, continue executing the subsequent steps; If it is empty, terminating the current iteration.

[0024] In one illustrative embodiment, updating the set of connection weight values ​​comprises: removing binary trees corresponding to each of the two merged image groups; Calculating connection weight values ​​between the merged image group and other groups in the waiting-to-fuse group; writing the calculated connection weight value and group identifiers of the merged image group and the other group into a binary tree corresponding to the other group; and deleting, from the binary tree corresponding to the other group, a node in which a connection weight value between the other group and the two image groups merged is recorded.

[0025] The present embodiment further provides an image grouping method in 3D reconstruction, the method comprising: Calculating modularity corresponding to the set of images to be grouped when each image in the set of images to be grouped is used as one image group; calculating an increment of modularity corresponding to each combination when combining two by two the multiple image groups included in the set of images to be grouped, thereby obtaining an increment set; determining a maximum increment included in the increment set, and determining whether the maximum increment has reached 0, and if the maximum increment has reached 0, merging the two recorded image groups corresponding to the maximum increment to obtain a merged image group, updating the increment set, and repeating this step until the set of images to be grouped includes a unique image group; In each iteration process, if the maximum increment does not reach 0, terminate the above iteration steps, and use the merged image combination method in the previous iteration as the final image grouping result of the set of images to be grouped; If the set of images to be grouped includes a unique image group, dividing each image included in the set of images to be grouped into one image group.

[0026] An embodiment of the present application provides an image grouping device for 3D reconstruction, comprising: a first calculation unit configured to calculate a modularity corresponding to the set of images to be grouped by using each image in the set of images to be grouped as one image group; a first generation unit configured to calculate an increment of modularity corresponding to each combination when it is assumed that the plurality of image groups included in the set of images to be grouped are combined in pairs, and to obtain an increment set; a first merging unit configured to determine a maximum increment in the increment set, merge two image groups corresponding to the maximum increment to obtain a merged image group, update a modularity corresponding to the set of images to be grouped and the increment set, and repeatedly perform this step until the set of images to be grouped includes a unique image group; and a first group determination unit configured to determine a maximum modularity among the recorded modularities after updating in each iteration when the set of images to be grouped includes a unique image group, and to determine an image combination scheme corresponding to the maximum modularity as an image grouping result for the set of images to be grouped.

[0027] In one embodiment shown, the first group determiner further comprises: determining whether the maximum modularity has reached a predetermined threshold; When the maximum modularity reaches a predetermined threshold, an image combination method corresponding to the maximum modularity is determined as an image grouping result of the set of images to be grouped; If the maximum modularity does not reach the predetermined threshold, each image included in the set of images to be grouped is used as an independent image group.

[0028] In one embodiment shown, the first generating unit further comprises: a plurality of image groups, each pair of image groups having a connection relationship is combined, and a correspondence relationship between group identifiers of the image groups having a connection relationship is recorded; Here, two image groups having a connected relationship means that the similarity between images in the first image group and the second image group of the two image groups reaches a predetermined similarity threshold value.

[0029] In one illustrative embodiment, the set of increments includes a correspondence between group identifiers of two groups of images that are assumed to be combined and the increments calculated assuming that the two groups of images are merged; The first merging unit further includes: searching for a correspondence between the group identifiers of the recorded image groups having a connection relationship, and determining another image group having a connection relationship with one of the two image groups corresponding to the maximum increment; determining the increments obtained by assuming that the other group of images is merged with each of the two images, and adding the determined increments together to obtain an increment of modularity obtained by assuming that the merged group of images is merged with the other group of images; The apparatus is configured to record in the increment set a correspondence between the group identifiers of the merged image group and the other image groups and the increments of the modules obtained by assuming that the two are merged.

[0030] In one illustrated embodiment, the apparatus further comprises: and a first recording unit configured to record a correspondence relationship between the group identifier of the merged image group and the group identifier of the other image group after updating the incremental set in each iteration process.

[0031] In one illustrated embodiment, the apparatus further comprises: A second recording unit is configured to record, in each iteration process, the merged image group obtained by merging and the correspondence between the group identifier of the merged image group and the group identifiers of the two merged image groups.

[0032] In one illustrated embodiment, the merged image group corresponds to an updated modularity in the iterations of generating the merged image group, and group identifiers of the image group correspond to image identifiers corresponding to each image included in the image group; The first group determination unit further The method is configured to perform the following steps for the merged image groups recorded in each iteration, starting from the merged image group recorded in the last iteration, in the reverse order of occurrence of the iterations, said steps being: determining whether a group identifier of the merged image group is included in an identifier set for identifying an image combination scheme, and if the group identifier of the merged image group is not included in the identifier set, writing the group identifier of the merged image group into the identifier set; determining whether the updated modularity corresponding to the merged image group is a maximum modularity among the recorded updated modularities in each iteration; If the updated modularity corresponding to the merged image group is the maximum modularity among the recorded updated modularities in each iteration, images indicated by image identifiers corresponding to each group identifier included in the identifier set are used as one image combination, and each obtained image combination is determined as an image grouping result of the set of images to be grouped.

[0033] In one illustrated embodiment, the apparatus further comprises: The system further includes a replacement unit configured to replace the group identifier of the merged image group recorded in the identifier set with the group identifiers of the two pre-merged image groups corresponding to the merged image group if the updated modularity corresponding to the merged image group is not the maximum modularity among the recorded updated modularities in each iteration.

[0034] In one embodiment shown, the replacement portion further comprises: determining whether the updated modularity in the current iteration has reached the updated modularity in the previous iteration that corresponds to the current iteration; If so, the updated modularity in the current iteration is determined as the maximum modularity.

[0035] In one embodiment shown, the first generator comprises: For each of the calculated increments assumed to be combined, the following steps are performed: determining a binary tree corresponding to each of the two image groups assumed to be combined, and writing the increment and group identifiers of the two images assumed to be combined into the determined binary tree; Here, in the root node of the binary tree, the maximum increment among all the increments recorded in the binary tree and a group identifier corresponding to the maximum increment are recorded.

[0036] In one embodiment shown, the first generating unit further comprises: Pushing the root node pointer of said binary tree corresponding to each image group into a max heap for determining the maximum increment; determining a pointer recorded in the root node of said maximum heap; The method is configured to determine the increment recorded at the node pointed to by the recorded pointer as the maximum increment contained in the set of increments.

[0037] In one illustrated embodiment, the apparatus further comprises: a fusion-awaiting image group determination unit configured to determine, from among the obtained image groups, image groups containing a number of images smaller than a first predetermined number threshold, and determine the determined image groups as fusion-awaiting image groups, the first predetermined number threshold indicating the minimum number of images in each group; a remainder group determination unit configured to determine, among the image groups, remaining groups other than the to-be-fused image group as remainder groups; a connection weight value calculation unit configured to calculate a connection weight value between two image groups among the groups waiting to be merged to form a connection weight value set, the connection weight value indicating the number of matching images between the two image groups; and a group fusion unit configured to fuse the groups of images to be fused based on the set of connection weight values.

[0038] In one embodiment shown, the group merging unit further comprises: The method is configured to repeatedly execute the following steps until the set of connection weight values ​​does not include any connection weight values, the steps including: determining a maximum connection weight value in said set of connection weight values; determining whether the number of images in the image group with the larger number of the two image groups corresponding to the maximum connection weight value has reached a second predetermined number threshold, the second predetermined number threshold indicating the maximum number of images in each image group; terminating the current iteration if the second predetermined quantity threshold is reached; and If the second predetermined quantity threshold is not reached, merging the two image groups to obtain a merged image group, and updating the set of connection weight values; If the set of connection weight values ​​does not include any connection weight values, the image groups included in the group waiting to be merged and the image groups among the remainder group are used as the final image groups of the set of images waiting to be grouped.

[0039] In one embodiment shown, the connection weight value calculation unit further comprises: For each image group in the group waiting to be merged, a binary tree is created that corresponds one-to-one with each image group. The method is configured to calculate a connection weight value between each image group in the fusion waiting group, and record the connection weight value and the group identifiers of the two image groups in the binary tree node, and the root node of the binary tree records the maximum connection weight value among the connection weight values ​​corresponding to each image group, and the group identifier corresponding to the maximum connection weight value.

[0040] In one embodiment shown, the group merging unit further comprises: Pushing a root node pointer of the binary tree corresponding to each of the image groups into a max heap for deriving the maximum connection weight value; The method is configured to read a pointer recorded in the root node of the maximum heap, and determine the connection weight value recorded in the binary tree node pointed to by the recorded pointer as the maximum connection weight value.

[0041] In one embodiment shown, the apparatus further comprises a data determiner, the data determination unit determines whether a binary tree corresponding to either of the two image groups corresponding to the maximum connection weight value is empty; If it is not empty, continue executing the subsequent steps, If it is empty, it is configured to terminate the current iteration.

[0042] In one embodiment shown, the group merging unit further comprises: Remove the binary trees corresponding to each of the two merged image groups above, Calculate connection weight values ​​between the merged image group and other groups in the waiting-to-fuse group; writing the calculated connection weight value and group identifiers of the merged image group and the other group into a binary tree corresponding to the other group; The method is configured to delete a node, for which a connection weight value between the other group and the two image groups merged therewith is recorded, from the binary tree corresponding to the other group.

[0043] An embodiment of the present application provides an image grouping device for 3D reconstruction, comprising: A second calculation unit configured to calculate a modularity corresponding to the set of images to be grouped when each image in the set of images to be grouped is used as one image group; a second generation unit configured to calculate an increment of modularity corresponding to each combination when combining two by two the multiple image groups included in the set of images to be grouped, and obtain an increment set; a second merging unit configured to determine a maximum increment in the increment set, determine whether the maximum increment reaches 0, and if the maximum increment reaches 0, merge the two recorded image groups corresponding to the maximum increment to obtain a merged image group, update the increment set, and repeatedly perform this step until the set of images to be grouped includes a unique image group; In each iteration, if the maximum increment does not reach 0, terminate the above iteration steps, and use the image combination method merged in the previous iteration as the final image grouping result of the set of images to be grouped; a second group determination unit configured to divide each image included in the set of images to be grouped into one image group when the set of images to be grouped includes a unique image group.

[0044] An embodiment of the present application provides an electronic device. The electronic device includes: A processor; a memory configured to store the processor-executable instructions; Here, the processor is configured to implement the image grouping method in 3D reconstruction shown in any of the above embodiments by calling and executing executable instructions stored in the memory.

[0045] An embodiment of the present application provides a computer-readable storage medium having stored thereon a computer program for executing the method for grouping images in 3D reconstruction as described in any of the above embodiments.

[0046] An embodiment of the present application provides a computer program comprising computer readable code, which, when executed in an electronic device, causes a processor of the electronic device to perform the image grouping method for 3D reconstruction as set forth in any of the above embodiments.

[0047] According to the above technical solution, the method merges two image groups corresponding to the maximum modularity increment in each iteration step, thereby ensuring that after each merging, the image combination scheme is the best combination scheme that can be achieved in this merging.

[0048] On the other hand, when merging until only one image group remains, the method determines the maximum modularity among the modularities by tracing back the recorded modularities after updating in each iteration, and determines the image combination scheme corresponding to the maximum modularity as the image grouping result of the set of images to be grouped, thereby ensuring that the best image combination scheme emerging in the image group merging process can be determined as the image grouping result of the set of images to be grouped. By dividing the groups, the connection relationship between the images in each group is relatively strong, and the connection relationship between the images in each group and the images in other groups is relatively weak, thereby improving the accuracy of image grouping and further improving the robustness of 3D reconstruction by image grouping.

[0049] It is to be understood that the foregoing general description and the following detailed description are merely exemplary and explanatory and are not restrictive of the present application. For example, the present application provides the following: (Item 1) A method for grouping images in three-dimensional reconstruction, comprising the steps of: Using each image in the set of images to be grouped as one image group, calculate a modularity corresponding to the set of images to be grouped; calculating an increment of modularity corresponding to each combination of the plurality of image groups included in the set of images to be grouped, to obtain an increment set; determining a maximum increment in the set of increments, merging two image groups corresponding to the maximum increment to obtain a merged image group, updating a modularity corresponding to the set of images to be grouped and the set of increments, and repeating this step until the set of images to be grouped contains a unique image group; A method for grouping images in 3D reconstruction, comprising: when the set of images to be grouped includes a unique image group, determining a maximum modularity among the modularities after updating in each iteration, and determining an image combination scheme corresponding to the maximum modularity as an image grouping result for the set of images to be grouped. (Item 2) determining an image combination method corresponding to the maximum modularity as an image grouping result of the set of images to be looped, determining whether the maximum modularity has reached a predetermined threshold; When the maximum modularity reaches the predetermined threshold, determining an image combination method corresponding to the maximum modularity as an image grouping result of the set of images to be grouped; if the maximum modularity does not reach the predetermined threshold, using each image included in the set of images to be grouped as an independent image group. The method according to item 1. (Item 3) Combining two by two of the plurality of image groups included in the set of images to be grouped includes combining two image groups having a connection relationship among the plurality of image groups, and recording a correspondence relationship between group identifiers of the image groups having a connection relationship; Two image groups that have a connection relationship mean that the similarity between the images of the first image group and the second image group of the two image groups reaches a predetermined similarity threshold. The method according to item 1. (Item 4) the increment set includes a correspondence between group identifiers of two image groups assumed to be combined and the increment calculated assuming that the two image groups are merged; Updating the incremental set comprises: searching for a correspondence between the group identifiers of the recorded image groups having a connection relationship, and determining another image group having a connection relationship with one of the two image groups corresponding to the maximum increment; determining the increments obtained by assuming that the other image group is merged with each of the two images, and using the result obtained by adding the determined increments as the increment of modularity when it is assumed that the merged image group and the other image group are merged; and recording in the increment set a correspondence between the group identifiers of the merged image group and the other image group and an increment of the module obtained by assuming that the two are merged. The method according to item 3. (Item 5) The image grouping method for the three-dimensional reconstruction includes: In each iteration process, after updating the incremental set, the method further includes recording the correspondence between the group identifier of the merged image group and the group identifier of the other image group. The method according to item 4. (Item 6) The image grouping method for the three-dimensional reconstruction includes: In each iteration, the method further includes recording a merged image group obtained by merging, and a correspondence between the group identifier of the merged image group and the group identifiers of the two merged image groups. The method according to item 1. (Item 7) the merged image group corresponds to an updated modularity in the iteration that generated the merged image group, and a group identifier of the image group corresponds to an image identifier corresponding to each image included in the image group; determining a maximum modularity among the recorded modularities after updating in each iteration, and determining an image combination method corresponding to the maximum modularity as an image grouping result of the set of images to be grouped; performing the following steps for the merged image groups recorded in each iteration in reverse order of occurrence of the iterations, starting from the merged image group recorded in the last iteration, the steps including: determining whether a group identifier of the merged image group is included in an identifier set for identifying an image combination scheme, and if the identifier set does not include the group identifier of the merged image group, writing the group identifier of the merged image group into the identifier set; determining whether the updated modularity corresponding to the merged image group is a maximum modularity among the recorded updated modularities in each iteration; If the updated modularity corresponding to the merged image group is the maximum modularity among the recorded updated modularities in each iteration, images indicated by image identifiers corresponding to each group identifier included in the identifier set are used as one image combination, and each obtained image combination is determined as an image grouping result of the set of images to be grouped. The method according to item 6. (Item 8) The image grouping method for the three-dimensional reconstruction includes: If the updated modularity corresponding to the merged image group is not the maximum modularity among the recorded updated modularities in each iteration, the method further includes replacing the group identifier of the merged image group recorded in the identifier set with the group identifiers of the two image groups before merging corresponding to the merged image group. The method according to item 7. (Item 9) Determining whether the updated modularity corresponding to the recorded merged image group is a maximum modularity among the updated modularities in each iteration includes: determining whether the updated modularity in the current iteration has reached the updated modularity in the previous iteration corresponding to the current iteration; if so, determining the updated modularity in the current iteration as the maximum modularity. The method according to item 8. (Item 10) Calculating an increment of modularity corresponding to each combination of the plurality of image groups, assuming that the plurality of image groups are combined in pairs, to obtain an increment set, and for each of the calculated increments assumed to be combined, performing the steps of: determining a binary tree corresponding to each of the two image groups assumed to be combined, and writing the increment and group identifiers of the two images assumed to be combined into the determined binary tree; The root node of the binary tree records the maximum increment among all the increments recorded in the binary tree and a group identifier corresponding to the maximum increment. The method according to item 3. (Item 11) Determining a maximum increment included in the set of increments comprises: pushing the root node pointer of said binary tree corresponding to each image group onto a max heap for determining a maximum increment; determining a pointer recorded in a root node of the max heap; determining the increment recorded at the node pointed to by the recorded pointer as the maximum increment included in the set of increments. The method according to item 10. (Item 12) The image grouping method for the three-dimensional reconstruction includes: Among the obtained image groups, determine an image group containing a number of images smaller than a first predetermined number threshold, and determine the determined image group as an image group to be fused, where the first predetermined number threshold indicates a minimum number of images in each group; determining, from among the image groups, the remaining groups other than the image group to be fused as a remainder group; Calculating a connection weight value between every two image groups in the to-be-fused group to construct a connection weight value set, where the connection weight value indicates the quantity of matching images between the two image groups; and fusing the group of images to be fused based on the set of connection weight values. 12. The method according to any one of items 1-11. (Item 13) Fusing the group of images to be fused based on the set of connection weight values ​​includes: and repeatedly performing the following steps until the set of connection weight values ​​does not include any connection weight values, the steps comprising: determining a maximum connection weight value in said set of connection weight values; determining whether the number of images in the image group with the larger number of the two image groups corresponding to the maximum connection weight value has reached a second predetermined number threshold, the second predetermined number threshold indicating the maximum number of images in each image group; terminating the current iteration if the second predetermined quantity threshold is reached; and if the second predetermined quantity threshold is not reached, merging the two image groups to obtain a merged image group and updating the set of connection weight values; if the set of connection weight values ​​does not include any connection weight value, using the image groups included in the group to be merged and the image groups among the remainder group as final image groups of the set of images to be grouped. Item 13. The method according to item 12. (Item 14) Calculating connection weight values ​​between two image groups among the groups to be fused and configuring a connection weight value set; creating a binary tree for each image group in the group to be merged that corresponds one-to-one with each image group; calculating a connection weight value between every two image groups in the group to be merged, and recording the connection weight value and group identifiers of the two image groups in nodes of the binary tree, wherein a maximum connection weight value among the connection weight values ​​corresponding to each image group and a group identifier corresponding to the maximum connection weight value are recorded in a root node of the binary tree. Item 13. The method according to item 12. (Item 15) Determining a maximum connection weight value in the set of connection weight values ​​comprises: pushing a root node pointer of a binary tree corresponding to each of the image groups into a max heap for deriving the maximum connection weight value; reading a pointer recorded in a root node of the maximum heap, and determining a connection weight value recorded in a binary tree node pointed to by the recorded pointer as the maximum connection weight value. Item 15. The method according to item 14. (Item 16) After determining the maximum connection weight value in the set of connection weight values, the image grouping method in 3D reconstruction includes: determining whether a binary tree corresponding to either of the two image groups corresponding to the maximum connection weight value is empty; If it is not empty, continue executing the subsequent steps; if empty, terminating the current iteration. Item 15. The method according to item 14. (Item 17) Updating the set of connection weight values ​​includes: removing binary trees corresponding to each of the two merged image groups; Calculating connection weight values ​​between the merged image group and other groups in the to-be-fused group; writing the calculated connection weight value and group identifiers of the merged image group and the other group into a binary tree corresponding to the other group; and deleting a node in which a connection weight value between the other group and the two merged image groups is recorded from the binary tree corresponding to the other group. Item 15. The method according to item 14. (Item 18) A method for grouping images in three-dimensional reconstruction, comprising the steps of: Calculating modularity corresponding to the set of images to be grouped when each image in the set of images to be grouped is used as one image group; calculating an increment of modularity corresponding to each combination when combining two by two the multiple image groups included in the set of images to be grouped, to obtain an increment set; determining a maximum increment included in the increment set, and determining whether the maximum increment has reached 0, and if the maximum increment has reached 0, merging the two recorded image groups corresponding to the maximum increment to obtain a merged image group, updating the increment set, and repeating this step until the set of images to be grouped includes a unique image group; In each iteration, if the maximum increment does not reach 0, terminate the above iteration steps, and use the image combination method after merging in the previous iteration as the final image grouping result of the set of images to be grouped; and dividing each image included in the set of images to be grouped into one image group if the set of images to be grouped includes a unique image group. (Item 19) An image grouping device for 3D reconstruction, comprising: a first calculation unit configured to calculate a modularity corresponding to the set of images to be grouped by using each image in the set of images to be grouped as one image group; a first generation unit configured to calculate an increment of modularity corresponding to each combination when it is assumed that the image groups included in the set of images to be grouped are combined in pairs, and to obtain an increment set; a first merging unit configured to determine a maximum increment in the set of increments, merge two image groups corresponding to the maximum increment to obtain a merged image group, update a modularity corresponding to the set of images to be grouped and the set of increments, and repeatedly perform this step until the set of images to be grouped includes a unique image group; An image grouping device for 3D reconstruction comprising: a first group determination unit configured to determine a maximum modularity among the recorded modularities after update in each iteration when the set of images to be grouped includes a unique image group, and to determine an image combination method corresponding to the maximum modularity as an image grouping result for the set of images to be grouped. (Item 20) The image grouping device for 3D reconstruction further comprises: a fusion-awaiting image group determination unit configured to determine, from among the obtained image groups, image groups containing a number of images smaller than a first predetermined number threshold, and determine the determined image groups as fusion-awaiting image groups, the first predetermined number threshold indicating a minimum number of images in each group; a remainder group determination unit configured to determine, among the image groups, remaining groups other than the to-be-fused image groups as remainder groups; a connection weight value calculation unit configured to calculate a connection weight value between two image groups among the fusion waiting groups to form a connection weight value set, the connection weight value indicating the number of matching images between the two image groups; a group fusion unit configured to fuse the groups of images to be fused based on the set of connection weight values. Item 19. The apparatus according to item 19. (Item 21) An image grouping device for 3D reconstruction, comprising: A second calculation unit configured to calculate a modularity corresponding to the set of images to be grouped when each image in the set of images to be grouped is used as one image group; a second generation unit configured to calculate an increment of modularity corresponding to each combination when combining two or more image groups included in the set of images to be grouped, and obtain an increment set; a second merging unit configured to determine a maximum increment included in the increment set, and further determine whether the maximum increment reaches 0, and if the maximum increment reaches 0, merge two recorded image groups corresponding to the maximum increment to obtain a merged image group, update the increment set, and repeatedly perform this step until the set of images to be grouped includes a unique image group; In each iteration, if the maximum increment does not reach 0, terminate the above iteration steps, and use the image combination method after merging in the previous iteration as the final image grouping result of the set of images to be grouped; and a second group determination unit configured to divide each image included in the set of images to be grouped into one image group if the set of images to be grouped includes a unique image group. (Item 22) An electronic device, A processor; and a memory configured to store the processor-executable instructions. Here, the processor is configured to realize the image grouping method for 3D reconstruction described in any one of items 1 to 17, or the image grouping method for 3D reconstruction described in item 18, by calling and executing executable instructions stored in the memory, said electronic device. (Item 23) A computer-readable storage medium having stored thereon a computer program for executing the method for grouping images in three-dimensional reconstruction described in any one of items 1 to 17, or the method for grouping images in three-dimensional reconstruction described in item 18. (Item 24) A computer program comprising computer-readable code, the computer program causing a processor of the electronic device to execute the method for grouping images in a three-dimensional reconstruction according to any one of items 1 to 17, or the method for grouping images in a three-dimensional reconstruction according to item 18, when the computer-readable code runs on an electronic device. [Brief description of the drawings]

[0050] [Figure 1] FIG. 2 is a schematic diagram of network community division according to an embodiment of the present invention. [Diagram 2] 1 is a flowchart of a method for grouping images in 3D reconstruction according to an embodiment of the present invention. [Diagram 3] FIG. 2 is a schematic diagram of an image grouping scene according to an embodiment of the present invention; [Figure 4] FIG. 2 is a schematic diagram of an incremental set according to an embodiment of the present invention. [Diagram 5] FIG. 2 is a schematic diagram of a balanced binary tree according to an embodiment of the present invention. [Figure 6] FIG. 2 is a schematic diagram of merging groups of images according to an embodiment of the present invention; [Figure 7] 4 is a flow chart of an incremental set update method according to an embodiment of the present invention. [Figure 8] FIG. 2 is a schematic diagram of image group merging according to an embodiment of the present invention; [Figure 9]1 is a flowchart of a method for grouping images in 3D reconstruction according to an embodiment of the present invention. [Figure 10] FIG. 2 is a schematic diagram of a process in which the image grouping method in 3D reconstruction is applied to a real scene according to an embodiment of the present application. [Figure 11] FIG. 2 is a structural diagram of an image grouping device for 3D reconstruction according to an embodiment of the present invention; [Figure 12] FIG. 2 is a structural diagram of an image grouping device for 3D reconstruction according to an embodiment of the present invention; [Figure 13] FIG. 2 is a hardware structure diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0051] In order to more clearly explain one or more embodiments of the present application or the technical solutions in the related art, the above briefly introduces drawings necessary for describing the embodiments. Obviously, the above drawings are only some embodiments in one or more aspects of the present application, and a person skilled in the art can obtain other drawings based on these drawings without creative efforts.

[0052] In order to make those skilled in the art better understand the technical solutions in one or more aspects of the present application, the following clearly and completely describes the technical solutions in one or more aspects of the present application with reference to drawings in one or more forms of the present application, and obviously, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. Based on one or more embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts shall be included in the protection scope of the present application.

[0053] Large-scale 3D reconstruction technology has a wide range of applications in the fields of cultural relic protection, positioning and navigation, scene roaming, augmented reality, industrial measurement, etc., and how to effectively reconstruct large-scale scenes has become an important research issue in the field of 3D vision. Due to the limitations of the scene scale and the complexity of the reconstruction algorithm, it often takes several days to reconstruct a large-scale scene, which also poses great challenges to computing resources.

[0054] Current 3D reconstruction systems can only process small scenes, and the processing time for large scenes such as an 80,000 square meter indoor scene is too long. Even the best conventional SfM system requires a processing time of more than 40 hours, resulting in low 3D reconstruction efficiency. To solve the above problems, some systems use parallel optimization techniques or distributed computing methods to improve the reconstruction efficiency. Such methods result in a decrease in calculation accuracy, low scalability, and the time required increases cube-wise as the scene expands. In addition, some systems group scenes, store the scene data of each group in an independent server, perform model reconstruction processing, and fuse the reconstructed models. However, in such methods, when performing image grouping, images are mainly clustered and grouped by the normalized cut algorithm. The grouping method of normalized cut can only guarantee the uniformity of the division, and cannot guarantee the internal connectivity of the image groups obtained by division, resulting in low image grouping accuracy and further reducing the robustness of 3D reconstruction by image grouping.

[0055] The present embodiment aims to propose an image grouping method in 3D reconstruction, in which the connection relationship between the images of each group determined by the method is relatively strong and the connection relationship between the images of other groups is relatively weak, thereby improving the accuracy of image grouping and further improving the robustness of 3D reconstruction by image grouping. The image grouping method proposed in the present application may be applied to scenes such as 3D modeling, augmented reality, image processing, photography, games, animation, movies and television, e-commerce, education, real estate, home renovation, etc., and may be specifically selected according to actual situations, and the present embodiment is not limited thereto.

[0056] The method proposed in the present embodiment first groups each image individually, determines the modularity corresponding to the set of images to be grouped at this time, merges the image groups contained in the set of images according to a merging principle that maximizes the increase in modularity after each merging, and records the modularity corresponding to the set of images to be grouped after each merging.

[0057] If the set of images to be grouped contains only one image group, the maximum modularity among the modularities recorded in each merging process is searched for, and the image combination method corresponding to the maximum modularity is determined as the image grouping result for the set of images to be grouped.

[0058] As can be seen from the above technical solution, the method can ensure that after each merging, the image combination scheme is the best combination scheme that can be achieved in this merging by merging two image groups corresponding to the maximum modularity increment in each iteration step.

[0059] On the other hand, when merging until only one image group remains, the method determines the maximum modularity among the modularities by tracing back the recorded modularities after updating in each iteration, and determines the image combination scheme corresponding to the maximum modularity as the image grouping result of the set of images to be grouped, thereby ensuring that the best image combination scheme emerging in the image group merging process can be determined as the image grouping result of the set of images to be grouped. By dividing the groups, the connection relationship between the images in each group is relatively strong, and the connection relationship between the images in each group and the images in other groups is relatively weak, thereby improving the accuracy of image grouping and further improving the robustness of 3D reconstruction by image grouping.

[0060] Before describing the embodiments described herein, the applicant first introduces in detail the modularity, the increment of the modularity, and the calculation formulas of the modularity and the increment of the modularity.

[0061] The modularity is also called modularity metric, and is a method for measuring the network community partitioning standard. Here, the higher the modularity, the more reasonable the partitioning result of the network. That is, the higher the modularity, the stronger the connection relationship between nodes in each community in the current network, and the weaker the connection relationship with nodes in other communities.

[0062] The formula for calculating the modularity above is:

[0063]

number

[0064] Regarding the derivation process of the above formula (1), reference can be made to the relevant contents in Newman's "Finding and evaluating community structure in networks."

[0065] The meaning of each element in the above formula (1) will be explained below with reference to the drawings.

[0066] Please refer to FIG. 1, which is a schematic diagram of network community division according to an embodiment of the present invention.

[0067] As shown in Fig. 1, nodes 1-7 constitute a network, where nodes 1, 2, 3, and 4 are adjacently connected to each other (i.e., connection edges between adjacent nodes 1, 2, 3, and 4), nodes 5, 6, and 7 are adjacently connected to each other (i.e., connection edges between adjacent nodes 5, 6, and 7), and node 4 is connected to node 5 (i.e., connection edges between adjacent nodes 4 and 5).

[0068] In the above formula (1), Q represents the corresponding modularity in the current community division situation of the above network.

[0069] Here, n indicates that the network is divided into n communities. For example, referring to Fig. 1, if nodes 1, 2, 3, and 4 included in the network shown in Fig. 1 are one community, and nodes 5, 6, and 7 are one community, the network is divided into two communities. In this case, n is 2. If nodes 1-7 are each one separate community, the network is divided into seven communities. In this case, n is 7.

[0070] The above i represents community i among the above n communities.

[0071] the above

[0072] [ka]

[0073] represents the ratio between the sum of the additional weight coefficients corresponding to each edge included in the community i and the sum of the additional weight coefficients corresponding to all edges included in the network.

[0074] Here, the edge can indicate whether there is a connection relationship between the two nodes. For example, if the above node v and node w respectively represent two images, when determining whether there is a connection relationship between the above nodes v and w, the similarity between v and w can be calculated. If the similarity between the above nodes v and w reaches a predetermined similarity threshold, it may be considered that there is a connection relationship between the above nodes v and w, or there may be two edges between v and w. In this case, the above v and w are the two end points of the above two edges.

[0075] The additional weighting factor can quantitatively represent the connection relationship between the two nodes. For example, if there is an edge between the nodes v and w, the matching quantity of image feature points between v and w can be mapped as the additional weighting factor of the edge between v and w. The larger the additional weighting factor, the stronger the connection relationship between node v and node w.

[0076] Those skilled in the art can easily understand that in order to calculate modularity more accurately, in practical applications, an additional weighting factor corresponding to the edge needs to be considered when calculating modularity. However, for the convenience of describing this embodiment, the value of the additional weighting factor is set to 1 in this application. When calculating modularity under the above circumstances, the ratio of the number of edges included in the community i to the number of edges included in the network is used to calculate the modularity.

[0077] [ka]

[0078] can be calculated as shown in equation (2), which is:

[0079]

number

[0080] Here, the above

[0081] [ka]

[0082] indicates the number of edges included in community i, and m indicates the number of edges included in the network.

[0083] For example, still referring to FIG. 1, assume that the above network is divided into two communities, community 1 and community 2 (community 1 is composed of nodes 1, 2, 3, and 4, and community 2 is composed of nodes 5, 6, and 7). In this case, the number of edges contained in community 1 is 6. The number of edges contained in community 2 is 3. The number of edges contained in the above network is 10. When i is 1, according to the above formula (2),

[0084] [ka]

[0085] is 0.6. When i is 2, the above

[0086] [ka]

[0087] is 0.3.

[0088] We will continue to introduce the above formula (1).

[0089] The above formula (1)

[0090] [ka]

[0091] indicates the ratio between the sum of the in-degrees of each node in community i and twice the number of edges in the above network.

[0092] [ka]

[0093] may be calculated according to the following formula (3):

[0094]

number

[0095] Here, the above

[0096] [ka]

[0097] represents the sum of the in-degrees of each node included in the above community i, and m represents the number of edges included in the above network.

[0098] The in-degree of the node indicates the quantity of the node as an edge end point. For example, still referring to FIG. 1, since four edges are connected to node 4 in FIG. 1, the quantity of node 4 as an edge end point is 4, and it can be determined that the in-degree of node 4 is 4. Since three edges are connected to node 5, the in-degree of node 5 is 3.

[0099] Continuing to refer to Figure 1, assume that the above network is divided into two communities, community 1 and community 2 (community 1 consists of nodes 1, 2, 3, and 4, and community 2 consists of nodes 5, 6, and 7). In this case, the sum of the in-degrees of each node in community 1 is 13. The sum of the in-degrees of each node in community 2 is 7. The number of edges in the above network is twice 20. When i is 1,

[0100] [ka]

[0101] is 0.65. If i is 2, the above

[0102] [ka]

[0103] is 0.35.

[0104] Next, the increment of modularity

[0105] [ka]

[0106] We will continue to introduce

[0107] The increment in modularity refers to the difference between the modularity corresponding to a network after two communities contained in the network are merged into one community and the modularity corresponding to the network before the merge.

[0108] Here, those skilled in the art can understand that if the increment is a positive number, the larger the increment, the larger the increase in modularity corresponding to the network after the merge, i.e., the more valuable the merge is. If the increment is a negative number, the larger the increment, the smaller the decrease in modularity corresponding to the network after the merge, i.e., the less adverse effects caused by the merge. Therefore, under the condition that it is not determined whether the modularity of the network after the merge increases or decreases, when merging communities included in a network, among all possible combination methods of two communities in the network, a combination corresponding to a merge that can maximize the increment can be merged, thereby ensuring that the modularity of the network after the merge is maximized or minimized.

[0109] For example, with continued reference to FIG. 1, assume that each of nodes 1 to 7 in the network is divided into one community. In this case, the modularity corresponding to the network is:

[0110] [ka]

[0111] may be written in.

[0112] In the above situation, if any two communities in the network are merged into one community, the modularity corresponding to the network is:

[0113] [ka]

[0114] and the expression for the increment of modularity is

[0115] [ka]

[0116] It is.

[0117] The modularity increment formula is as follows:

[0118] [ka]

[0119] We will introduce the derivation process of

[0120] Assuming that the network currently contains n communities, and that the network contains community i and community j, then equation (1) shows that the modularity corresponding to the current network is:

[0121] [ka]

[0122] Assume that community i and community j included in the above network are merged to obtain community p.

[0123] According to formula (2),

[0124] [ka]

[0125] where

[0126] [ka]

[0127] represent the number of edges in community i and community j, respectively, and

[0128] [ka]

[0129] represents the number of edges connected between each node included in community i and each node included in community j, and m represents the number of edges included in the network.

[0130] According to equation (3),

[0131] [ka]

[0132] Here, the above

[0133] [ka]

[0134] represent the sum of the in-degrees of each node included in the above community i and community j, respectively, and m represents the number of edges included in the above network.

[0135] According to equation (1), the modularity corresponding to the current network is:

[0136] [ka]

[0137] According to the above modularity increment formula, after merging community i with community j, the modularity increment corresponding to the above network is:

[0138] [ka]

[0139] [ka]

[0140] Assume that indicates the ratio of the number of edges connected between each node included in community i and each node included in community j to twice the number of edges connected between each image included in the images to be grouped.

[0141] That is,

[0142] [ka]

[0143] In this case, it is as shown in equation (4).

[0144]

number

[0145] As a result, when community i and community j are merged, the increment of the module corresponding to the above network is

[0146] [ka]

[0147] can be derived, where:

[0148] [ka]

[0149] indicates the ratio of the number of edges between each node included in community i and each node included in community j to twice the number of edges between each image included in the images to be grouped,

[0150] [ka]

[0151] indicates the ratio between the sum of the in-degrees of each node in community i and community j and twice the number of edges in the above network.

[0152] In the above situation, if we need to calculate the increment in modularity corresponding to the above network when we assume that community p obtained by merging community i with community j is merged with another community q, then: The modularity increment calculated by formula (4) above may be:

[0153] [ka]

[0154] From the above equation, the following equation (5) can be derived.

[0155]

number

[0156] Up to now, modularity, modularity increment, and related formulas have been introduced. Now, we will start to introduce the embodiments of the present application.

[0157] In some embodiments of the present application, reference is made to FIG. 2, which is a flow chart of a method for image grouping in 3D reconstruction according to an embodiment of the present application.

[0158] As shown in FIG. 2 , the image grouping method in 3D reconstruction can include the following steps: In step S202, each image in the set of images to be grouped is used as one image group, and the modularity corresponding to the set of images to be grouped is calculated.

[0159] In step S204, the image groups included in the set of images to be grouped are combined two by two, and an increment of modularity corresponding to each combination is calculated to obtain an increment set.

[0160] In step S206, a maximum increment in the increment set is determined, two image groups corresponding to the maximum increment are merged to obtain a merged image group, and the modularity corresponding to the set of images to be grouped and the increment set are updated, and this step is repeated until the set of images to be grouped contains a unique image group.

[0161] In step S208, if the set of images to be grouped contains a unique image group, the maximum modularity among the modularities after updating in each iteration is determined, and the image combination method corresponding to the maximum modularity is determined as the image grouping result of the set of images to be grouped.

[0162] The image grouping method may be implemented in any software and hardware environment capable of executing the method. For example, the software and hardware environment may be an electronic device such as a personal PC, a PAD, a server, or a virtual system, and the present application is not limited thereto. In the following, an example will be described in which the execution body of the method is an electronic device (hereinafter, abbreviated as device).

[0163] In some embodiments, the set of images to be grouped may include a sequence of images that need to be grouped in a 3D reconstructed scene. It can be appreciated that when calculating modularity, the set of images to be grouped may be considered as a network.

[0164] In practical application, when the device maintains the inclusion relationship between the set of images to be grouped and the images contained therein, it can usually maintain one set of image identifiers to be grouped corresponding to the set of images to be grouped, and then write image identifiers corresponding to images into the set of image identifiers to be grouped, thereby maintaining the inclusion relationship between the set of images to be grouped and the images contained therein, where the image identifiers may be node identifiers of data nodes corresponding to the images.

[0165] The image group may be composed of some images in the set of images to be grouped. When calculating modularity, it can be understood that the image group may be considered as a community corresponding to the network. The images may be considered as nodes of the network.

[0166] In practical application, when the device maintains the inclusion relationship between the set of images to be grouped and the image groups contained therein, the device usually maintains one image group identifier set corresponding to the set of images to be grouped, and then writes the group identifiers of the image groups contained therein into the image group identifier set, thereby maintaining the inclusion relationship between the set of images to be grouped and the image groups contained therein, where the group identifiers may be node identifiers of data nodes corresponding to the image groups.

[0167] In this case, when it is necessary to determine the image groups included in the set of images to be grouped, first, each group identifier included in the set of image group identifiers is read, and then the image groups corresponding to each group identifier are output as the image groups included in the set of images to be grouped.

[0168] On the other hand, when a merge operation is performed on any two image groups included in the set of images awaiting grouping, the group identifiers of the two merged image groups are deleted from the image group identifier set, and the group identifier of the merged image group generated by the merge operation is written to the image group identifier set, thereby completing the merge operation.

[0169] When the device maintains the inclusion relationship between the image group and the images contained therein, the device can generally maintain a correspondence relationship between the identifier of the image group and the image identifier corresponding to the image contained in the image group. For example, the device can create one data node for the image group and use the group identifier of the image group as the node identifier (node ​​index) of the data node. Then, the device can write the image identifier corresponding to the image contained in the image group to the data node, thereby maintaining the inclusion relationship between the image group and the images contained therein.

[0170] In some embodiments, the image combination scheme may be included in the combination scheme for each image included in the set of images to be grouped after one merging step is completed in each iteration.

[0171] In practical application, a group identifier corresponding to each image group and an image identifier corresponding to each image can usually be defined, and then the image combination scheme is recorded by recording the correspondence between the identifier of each group and the image identifier corresponding to each image.

[0172] For example, assume that the set of images to be grouped includes 10 images corresponding to image identifiers 0 to 9. After one merging is completed, assume that the identifiers of the image groups included in the set of images to be grouped are a, b, c, and d, and that the group identifier a corresponds to the image identifiers 0 to 3, the group identifier b corresponds to the image identifiers 4 to 5, the group identifier c corresponds to the image identifier 6, and the group identifier d corresponds to the image identifiers 7 to 9.

[0173] In the above situation, when it is necessary to determine each image combination scheme included in the current image set to be grouped, the group identifiers included in the current image set to be grouped can be determined. After determining the currently included group identifiers, the corresponding relationship between the group identifiers and the image identifiers can be queried to determine that the image combination schemes included in the current image set to be grouped are: image 0-3 is one image group, image 4-5 is one image group, image 6 is one image group, and image 7-9 is one image group.

[0174] When performing image grouping on a set of images to be grouped, the device can execute step S202, in which each image in the set of images to be grouped is used as an image group, and a modularity corresponding to the set of images to be grouped is calculated.

[0175] In practical application, the device can first traverse each image in the set of images to be grouped, and make a one-to-one correspondence between each image and a unique image identifier. Then, the device can associate each image identifier with a unique group identifier. In this case, the device can record the correspondence between each group identifier and the image identifier, thereby recording the correspondence between the image group and the image.

[0176] In this step, it is assumed that each image included in the set of images to be grouped forms a separate group, and therefore it can be understood that the image identifier corresponding to each of the images may be used as the group identifier of the image group corresponding to each of the images.

[0177] For example, assume that the set of images to be grouped includes 10 images. When performing step S202, the device can first associate image identifiers 0 to 9 with the 10 images in a one-to-one relationship. Next, the device can create data nodes in the same quantity as the number of images (wherein the data nodes can be recorded in the form of an array) and associate the data nodes with the 10 images in a one-to-one relationship. Next, the device can set the image identifier corresponding to each of the images as the node identifier (node ​​index) of the data node corresponding to each image, and write the image identifier corresponding to each of the images to the data node corresponding to each of the images.

[0178] At this time, it can be understood that each of the above data nodes actually corresponds not only one-to-one to the above 10 images, but also one-to-one to the above 10 image groups, and the group identifiers of the above 10 image groups are 0-9.

[0179] Please refer to FIG. 3, which is a schematic diagram of an image grouping scene according to an embodiment of the present invention.

[0180] As shown in Fig. 3, the image grouping scene shown in Fig. 3 is to group 10 images included in the set waiting to be grouped. Here, the node identifier (node ​​index) of each data node shown in Fig. 3 is the group identifier of the image group corresponding to each data node. In each data node, an image identifier corresponding to an image included in the image group corresponding to each data node is recorded.

[0181] It should be noted that the data node structure shown in FIG. 3 is only exemplary, and actual applications may include various data node structures, and the present application is not limited thereto.

[0182] After considering each image in the set of images to be grouped as one image group, the device calculates the modularity corresponding to the network in the current image combination method according to the above formula (1).

[0183] [ka]

[0184] can be calculated.

[0185] In practical applications, the modularity

[0186] [ka]

[0187] Before calculating, the device can first determine the connection relationship between each image group in the current image combination scheme.

[0188] It should be noted here that since each current image group contains one image, determining the connection relationships between each image group is equivalent to determining the connection relationships between each image contained in the grouped image set.

[0189] When determining the connection relationships between each image included in the images to be grouped, each image included in the images to be grouped can be used in sequence as a target image, and the similarity between the target image and other images included in the images to be grouped can be calculated.

[0190] After the similarity between the target image and any other image is obtained, it can further be determined whether the similarity between the target image and the other image is greater than a predetermined similarity threshold (wherein the predetermined similarity threshold may be set according to experience), and if it is greater than the predetermined similarity threshold, it is deemed that there is a connection relationship between the target image and the other image, or there is a connection edge between the target image and the other image, in which case the target image and the other image are two end points of the edge.

[0191] When it is determined that there is an edge between any two images, the correspondence between the group identifiers of the image groups corresponding to each of the two images can be recorded in an adjacency list maintained by the device. For example, in the image grouping scene corresponding to FIG. 3, data nodes 0-9 correspond one-to-one with each of the image groups 0-9 included in the set of images to be grouped. In this case, when it is determined that there is an edge between image 0 and image 1, the correspondence between group identifier 0 and group identifier 1 can be recorded in the adjacency list.

[0192] In addition, since in the above-mentioned adjacency list maintenance method, there is a possibility that the correspondence between the group identifiers of two connected image groups may be recorded twice, a duplicate elimination operation is performed here to ensure that the correspondence between the group identifiers of two connected image groups in the above-mentioned adjacency list is recorded only once.

[0193] A person skilled in the art will understand that after the connection relationships between each image included in the set to be grouped are confirmed, the correspondence relationships between the group identifiers of all current image groups with connections are recorded in the adjacency list.

[0194] In this case, when it is necessary to determine whether there is a connection relationship between any two image groups, the adjacency list can be queried to determine whether a correspondence relationship between the group identifiers of the two image groups is recorded. If a correspondence relationship is recorded, it is determined that there is a connection relationship between the two image groups.

[0195] When it is necessary to calculate the in-degree of a certain group of images, the number of correspondences recorded in the adjacency list that include the group identifier of the group of images can be counted.

[0196] For example, the in-degree of image group 0

[0197] [ka]

[0198] When calculating, a counter (initial value is 0) may be set first. Then, the group identifier correspondences recorded in the adjacency list are traversed to see whether group identifier 0 is included. Each time a correspondence containing group identifier 0 is queried, the count of the counter may be incremented by 1. After the adjacency list is queried, the count of the counter may be read and the count may be calculated as the in-degree of image group 0.

[0199] [ka]

[0200] It can be used as:

[0201] When a connection relationship between each image included in the images to be grouped is confirmed, the device

[0202] [ka]

[0203] can be calculated, where

[0204] [ka]

[0205] denotes the in-degree of image group i.

[0206] Once the in-degrees of each image group have been calculated, the formula

[0207] [ka]

[0208] According to the above, the number of edges included in the set of images to be grouped can be calculated.

[0209] Next, according to the above formula (3),

[0210] [ka]

[0211] where i is a natural number greater than 0 and less than or equal to the number of images included in the set of images to be grouped.

[0212] Since each current image group contains one image,

[0213] [ka]

[0214] is 0.

[0215] [ka]

[0216] When is calculated, according to formula (1), the modularity corresponding to the above network in the above current image combination method is

[0217] [ka]

[0218] can be calculated.

[0219] the above

[0220] [ka]

[0221] If is calculated, the above equipment is

[0222] [ka]

[0223] In practical applications, the above

[0224] [ka]

[0225] may be recorded in any form. For example,

[0226] [ka]

[0227] may be recorded in the data node shown in FIG. 3, or

[0228] [ka]

[0229] A dedicated array may be maintained for recording:

[0230] When step S202 is executed, the device can continue to execute step S204 in which the device calculates the increment of modularity corresponding to each combination, assuming that the multiple image groups included in the set of images to be grouped are combined in pairs, to obtain an increment set.

[0231] In practical application, the device can combine two of each image group in the set of images to be grouped, and for each combination obtained, calculate the increment of the modularity when it is assumed that the image group corresponding to the combination is merged, and generate an incremental set based on the calculated increment.

[0232] In the present embodiment, when calculating the increment of modularity, the device first combines any two image groups included in the set of images to be grouped to obtain all possible combination results. After the combination results are obtained, for each combination result, it first determines whether there is a connection relationship between the two image groups corresponding to the combination result (e.g., determines whether there is a connection relationship between the two image groups by querying whether the corresponding relationship between the group identifiers of the two image groups is recorded in the adjacency list).

[0233] In this case, if there is a connection between the two image groups corresponding to the above combination result, the number of edges between the two image groups with the connection is

[0234] [ka]

[0235] It can be determined that the number of edges between the two image groups that are not connected is 1.

[0236] [ka]

[0237] can be determined to be 0.

[0238] The number of edges between the two image groups above

[0239] [ka]

[0240] After i, j are determined, the device can calculate the increment of modularity when the image groups corresponding to the combination are assumed to be merged according to formula (4), where i, j are integers greater than 0 and less than or equal to 9.

[0241] The above increment

[0242] [ka]

[0243] After the increments are calculated, the device can generate an increment set based on the calculated increments, and record the correspondence between the group identifiers of the two image groups assumed to be combined and the increments calculated after merging the two image groups.

[0244] In practical application, the device maintains a correspondence table between increments and group identifiers, and calculates the increments calculated on the assumption that all possible combinations and image groups corresponding to all possible combinations are merged.

[0245] [ka]

[0246] The correspondence between the increment and the group identifier can be recorded in a correspondence table between the increment and the group identifier.

[0247] Up to now, the preparatory work for the above image grouping method has been completed.

[0248] Next, an iterative step is entered, and in some embodiments, the device can perform step S206, determining the maximum increment contained in the increment set, merging the two recorded image groups corresponding to the maximum increment, updating the modularity after merging, updating the increment set after merging, and repeatedly performing this step until the set of images to be grouped contains a unique image group.

[0249] In this embodiment, when determining the maximum increment included in the set of increments, the device can obtain all increments by querying the set of increments, and then the device can compare all increments two by two to determine the maximum increment in the set of increments.

[0250] After the maximum increment is determined, the device can determine two image groups corresponding to the maximum increment by querying the correspondence between the increment and a group identifier. After the two image groups are determined, the device can merge the two image groups.

[0251] In practical application, when merging the two image groups, the device can merge the two image groups to obtain a merged image group. Then, the device can delete the group identifiers of the two merged image groups from the image group identifier set corresponding to the image set to be grouped, and write the group identifier of the merged image group generated by the merging operation into the image group identifier set. In this case, it can be understood that the image group identifier set includes the group identifier of the merged image group and the group identifiers of other image groups that are not merged.

[0252] For example, assume that the set of images to be grouped includes 10 image groups with group identifiers 0-9, and the group identifiers of the two image groups corresponding to the maximum increment are 0 and 1. The group identifier of the merged image group obtained after merging the two image groups is a. In this case, after merging the two image groups, the image groups included in the current images to be grouped include group a and group 2-9.

[0253] After the merging is completed, the image groups contained in the set of images to be grouped change, and therefore the modularity of the set to be grouped needs to be updated.

[0254] When updating the modularity of the set to be grouped, the device

[0255] [ka]

[0256] The above modularity after update can be obtained by adding the maximum increment corresponding to the current merge to .

[0257] When the update of the current modularity is completed, the device can record the image combination form indicated by each of the image groups in association with the modularity.

[0258] When the merging is complete, the incremental set needs to be updated since a new merged image group has been generated.

[0259] In practical applications, when updating the increment set, one can first calculate the increment of the modularity when it is assumed that the merged image group is merged with each of the other image groups included in the set of images to be grouped.

[0260] After the increment is calculated, the device may record the increment in the increment set and delete the increment corresponding to the group identifier of either of the two merged image groups.

[0261] After the increment is updated, the device can record the correspondence between the group identifiers of the merged image group and the other image group, and the increment calculated assuming that the merged image group and the other image group are merged in an increment and group identifier pairing table maintained by the device.

[0262] Once modularity and incremental set updates are complete, step S206 can be repeated until the set of images to be grouped contains unique image groups.

[0263] If the set of images to be grouped contains unique image groups, the device can determine a maximum modularity among the recorded updated modularities in each iteration, and determine an image combination scheme corresponding to the maximum modularity as an image grouping result for the set of images to be grouped.

[0264] In this step, when determining the maximum modularity, the device can first determine the current iteration corresponding to the maximum modularity, and then the device can read each group identifier included in the image group identifier set after the merging operation is performed in the current iteration, and determine the image combination method corresponding to the image group corresponding to each group as the image grouping result of the set of images to be grouped.

[0265] As can be seen from the above technical solution, the method can ensure that the image combination scheme after each merging is the best combination scheme that can be achieved in this merging by merging two image groups corresponding to the maximum modularity increment in each iteration step.

[0266] On the other hand, when merging until only one image group remains, the method determines the maximum modularity among the modularities by tracing back the recorded modularities after updating in each iteration, and determines the image combination scheme corresponding to the maximum modularity as the image grouping result of the set of images to be grouped, thereby ensuring that the best image combination scheme emerging in the image group merging process can be determined as the image grouping result of the set of images to be grouped. By dividing the groups, the connection relationship between the images in each group is relatively strong, and the connection relationship between the images in each group and the images in other groups is relatively weak, thereby improving the accuracy of image grouping and further improving the robustness of 3D reconstruction by image grouping.

[0267] In some embodiments of the present application, in order to improve the stability of image grouping, in the step of determining an image combination method corresponding to the maximum modularity as an image grouping result of the set of images to be grouped, it can determine whether the maximum modularity reaches a predetermined threshold, and if the maximum modularity reaches the predetermined threshold, determine the image combination method corresponding to the maximum modularity as an image grouping result of the set of images to be grouped. It should be noted that reaching a predetermined threshold can mean greater than or equal to a predetermined threshold, and can be set according to actual circumstances.

[0268] In some embodiments, the predetermined threshold may be a threshold related to a stability evaluation criterion of the grouping result set by a developer according to experience, where a higher threshold indicates a higher requirement for the stability of the grouping result.

[0269] Therefore, when determining whether the maximum modularity has reached a predetermined threshold, if the modularity has reached the predetermined threshold, it indicates that the current image combination scheme has reached a predetermined stability criterion, and at this time, the image combination scheme corresponding to the maximum modularity can be determined as the image grouping result for the set of images to be grouped.

[0270] If the maximum modularity does not reach the specified threshold, it indicates that the image combination method corresponding to the maximum modularity in this grouping process does not reach a specified stability criterion, and in this case, each image included in the set of images to be grouped can be used as an independent image group.

[0271] In some embodiments of the present application, in order to reduce the computational complexity of the image grouping method and thereby improve the image grouping efficiency, the above steps S204-S208 may be realized by performing the following process.

[0272] In some embodiments, when the device executes step S204 to combine the image groups in the set of images to be grouped two by two, the device can combine image groups that have a connection relationship two by two.

[0273] Then, for each combination obtained, the increment after merging the image group corresponding to the combination is calculated.

[0274] [ka]

[0275] Calculate (see above

[0276] [ka]

[0277] (The steps of calculating are similar to the above situation.) It should be noted that in the above situation, the increment of the modularity after merging two disconnected image groups can be set to 0.

[0278] It can be seen that the above step eliminates the need to calculate the increment of modularity after merging two image groups that have no connection relationship, thus reducing the amount of computation required to calculate the increment and improving the efficiency of image grouping.

[0279] When the increments are calculated, an increment set can be generated based on the calculated increments, and the correspondence between the group identifiers of the two image groups of each group and the increments of modularity of each group can be recorded.

[0280] In this embodiment, the increment set may be stored in the form of a matrix. In practical application, the device can maintain an n*n matrix when generating the increment set.

[0281] Here, each element in the n*n matrix can indicate the increment calculated by merging the image groups corresponding to the row and column to which the element belongs, where n is the number of images included in the set of images to be grouped. It should be noted that the number of connected image pairs is generally small, and therefore, for ease of calculation, the matrix may be a sparse matrix.

[0282] For example, in the image grouping scene shown in FIG. 3, the increment set may be recorded by a 10*10 sparse matrix T. Referring to FIG. 4, FIG. 4 is a schematic diagram of an increment set according to an embodiment of the present application. As shown in FIG. 4, the elements included in the sparse matrix T are

[0283] [ka]

[0284] is the increment calculated on the assumption that image group i and image group j corresponding to the row and column to which the element belongs are merged.

[0285] [ka]

[0286] where i and j are integers greater than 0 and less than or equal to 9.

[0287] In this embodiment, when recording the increments by maintaining an n*n matrix, the device may first create a binary tree (e.g., a balanced binary tree) corresponding to each image group. Also, when each increment in the increment set is calculated, two image groups assumed to be combined when calculating the increment are determined. Next, the device first determines a binary tree corresponding to a first image group of the two image groups assumed to be combined, records the increments and group identifiers of the two image groups in a node of the binary tree corresponding to the first image group, and determines a binary tree corresponding to a second image group of the two image groups assumed to be combined, and records the increments and group identifiers of the two image groups in a node of the binary tree corresponding to the second image group.

[0288] When all of the above increments have been recorded, the maximum increment among the increments recorded in each binary tree and the group identifier corresponding to the maximum increment are recorded in the root node of the binary tree corresponding to each image group.

[0289] For example, currently one increment

[0290] [ka]

[0291] Assuming that the increments are calculated, the device can determine that the image groups i and j are currently assumed to be combined. Next, the device can determine the binary trees corresponding to the image groups i and j, respectively. After the binary trees are determined, the device can calculate the increments

[0292] [ka]

[0293] It can be determined whether or not t is greater than the increment recorded in the root node of the binary tree, and if so, t is greater than the increment recorded in the root node of the binary tree.

[0294] [ka]

[0295] The group identifier i and the group identifier j can be written to the root node of the binary tree.

[0296] It should be noted that when the nodes other than the root node of the binary tree are maintained, they may be maintained in any manner, and the present application is not limited thereto. Of course, in order to facilitate node query, when the nodes other than the root node of the binary tree are maintained, the two group identifiers corresponding to the increments may be maintained in order of the size of another group identifier other than the group identifier i.

[0297] Referring to Fig. 5, Fig. 5 is a schematic diagram of a balanced binary tree according to an embodiment of the present invention. As shown in Fig. 5, the balanced binary tree corresponds to the image group i. The root node of the balanced binary tree includes the maximum increment among the increments corresponding to the group identifier i.

[0298] [ka]

[0299] and the above increment

[0300] [ka]

[0301] The group identifiers i and j of the two image groups that are assumed to be combined when computing

[0302] It should be noted that the balanced binary tree and the node structure of the balanced binary tree shown in Fig. 5 are merely exemplary. In practical applications, the balanced binary tree and the node structure may be set according to practical situations, and the present application is not limited thereto.

[0303] For each of the combinations, the increment is calculated assuming that the image group corresponding to the combination is merged, and each calculated increment is written into the corresponding binary tree, after which the generation of the increment set is completed.

[0304] In this embodiment, generating an incremental set in the above manner provides at least the following advantages: By creating a binary tree corresponding to each image group, the same increment is actually recorded in each binary tree of the two image groups corresponding to the increment. In this case, when two image groups in each image group are merged into one merged image group, when recording the increment corresponding to the merged image group, the increment can be recorded in the binary tree of another image group corresponding to the merged image group without the need to maintain one new binary tree for the merged image group, thereby reducing the amount of calculation when recording the increment corresponding to the merged image group and further improving image grouping efficiency.

[0305] Meanwhile, since the maximum value of the increments corresponding to each image group is recorded in the root node of the binary tree, when determining the maximum increment in the increment set in the subsequent iterative step, it is only necessary to compare the increments recorded in the root node of the binary tree corresponding to each image group, thereby improving the efficiency of determining the maximum increment and further improving the efficiency of image grouping.

[0306] Up to now, the preparatory work for the above image grouping method has been completed.

[0307] Next, an iterative step is entered, and in some embodiments, the device can perform step S206, determining the maximum increment in the increment set, merging two image groups corresponding to the maximum increment to obtain a merged image group, updating the modularity corresponding to the set of images to be grouped and the increment set, and repeatedly performing this step until the set of images to be grouped contains a unique image group.

[0308] In this embodiment, when determining the maximum increment contained in the increment set, the maximum increment can be derived using a max heap (where the value corresponding to each parent node in the max heap is greater than or equal to the values ​​corresponding to its left and right child nodes).

[0309] For example, when determining the maximum increment included in the set of increments, the device may push a pointer corresponding to the root node of each binary tree into a maintained max heap, and then the device may read the pointer recorded in the root node of the max heap and determine that the maximum increment is the increment recorded in the node pointed to by the pointer after reading the pointer.

[0310] According to the characteristics of a max heap, the value corresponding to each parent node is equal to or greater than the values ​​corresponding to its left and right child nodes, so that a maximum root node records the maximum value maintained in the max heap. The maximum increment in the increment set can be determined by reading the pointer recorded in the root node of the max heap and determining the increment recorded in the node pointed to by the pointer after reading the pointer.

[0311] When the maximum increment contained in the set of increments is determined, the device can first determine two image groups that correspond to the maximum increment.

[0312] In this embodiment, the device can determine the two image groups by querying the group identifiers recorded in the nodes indicated by the pointers.

[0313] For example, assume that the node pointed to by the pointer is the root node of the binary tree shown in Figure 5. With continued reference to Figure 5, in this case, it can be determined that the two image groups corresponding to the maximum increment are group i and group j.

[0314] After the two image groups corresponding to the maximum increment are determined, the device can merge the two images, and after merging, record the merged image group obtained after merging, and the correspondence between the group identifier of the merged image group and the group identifiers of the two merged image groups.

[0315] In practical applications, after merging two image groups corresponding to the maximum increment in the set of images to be grouped, one data node can be assigned to the merged image group generated after merging, where the node identifier (node ​​index) of the data node may be the group identifier of the merged image group.

[0316] In this case, when recording the correspondence between the group identifier of the merged image group and the group identifiers indicating the two image groups, the device may record the correspondence in a data node corresponding to the merged image group.

[0317] For example, in the image grouping scene shown in FIG. 3, it is assumed that the two image groups corresponding to the determined maximum increment are image group 0 and image group 1. In this case, the device merges the image group 0 and the image group 1 to obtain a merged image group. When the merged image group is obtained, the device can create a data node corresponding to the merged image group, and use the node identifier (node ​​index) of the data node as the group identifier of the merged image group. Then, the device can record the group identifier 0 and the group identifier 1 in the data node.

[0318] Please refer to FIG. 6, which is a schematic diagram of merging image groups according to an embodiment of the present invention.

[0319] As shown in Fig. 6, image group 0 and image group 1 are merged as merged image group a. Here, data node a corresponds to merged image group a. The node identifier (node ​​index) of the data node a is the group identifier a of the merged image group, and group identifiers 0 and 1 are recorded in the data node a. It can be understood that in the technical solution described in this embodiment, the data node records the group identifier of the merged image group and the group identifiers of the two merged image groups, so as to record the correspondence between the merged image group and the two merged image groups.

[0320] In the present application, the device can also determine the data node corresponding to each image group in the two merged image groups, and read the recorded image identification information from each determined data node. After obtaining the image identification information recorded in each data node, the device can write the image identification information to the data node corresponding to the merged image group, thereby recording the correspondence between the generated merged image group and each image contained therein.

[0321] Continuing to refer to Fig. 6, image identifiers 0 and 1 are recorded in data node a corresponding to merged image group a shown in Fig. 6. In this case, by reading the image identifiers recorded in node a, it can be determined that image group a includes image 0 and image 1.

[0322] When the merging is complete, the device can update the modularity corresponding to the set of images to be grouped.

[0323] In this embodiment, the device first:

[0324] [ka]

[0325] Then, the maximum increment corresponding to the current iteration is added to obtain the modularity corresponding to the set of images to be grouped. After the modularity is obtained, the modularity can be recorded in the data node corresponding to the merged image group generated in the current iteration. Still referring to FIG. 6, the data node a corresponding to the merged image group shown in FIG. 6 contains the updated modularity in the current iteration.

[0326] [ka]

[0327] is recorded.

[0328] When the merge is complete, the device needs to update the incremental set.

[0329] Please refer to FIG. 7, which is a flow chart of an incremental set update method according to an embodiment of the present invention.

[0330] As shown in FIG. 7, the incremental set update method includes the following steps: in step S702, searching for a correspondence relationship between the group identifiers of the recorded image groups having a connection relationship, and determining another image group having a connection relationship with either of the image groups of the two image groups corresponding to the maximum increment.

[0331] In step S704, the increments obtained by assuming that the other image group is merged with each of the two images are determined, and the result obtained by adding the determined increments is used as the increment of modularity obtained by assuming that the merged image group is merged with the other image group.

[0332] In step S706, the correspondence between the group identifiers of the merged image group and the other image group, and the increment of the module obtained by assuming that the two are merged, is recorded in the increment set.

[0333] In this embodiment, when the device performs step S702, it can query a correspondence relationship including a group identifier of any image group in the two image groups in an adjacent list maintained by the device, and determine the other image group from the queried correspondence relationship.

[0334] The device can execute the step S704 each time it determines one of the other image groups. In this embodiment, when executing the step S704, the device can calculate the increment of the modularity when the merged image group and the other image group are assumed to be merged according to (5), where the merged image group is the merged image group obtained by merging the two image groups.

[0335] For example, assume that image group 0 and image group 1 are merged as merged image group a. According to the query to the adjacency list, image group i is connected to image group 0. In this case, it is necessary to calculate the increment of the modularity when it is assumed that merged image group a and image group i are merged.

[0336] According to the above formula (5),

[0337] [ka]

[0338] It is.

[0339] Here, in one method,

[0340] [ka]

[0341] may be obtained by respectively querying the binary trees corresponding to the image group 0 and the image group 1. Those skilled in the art will understand that in this embodiment, the increment obtained by merging image groups with no connection relationship is set to 0, so that if there is no connection relationship between the other image group i and image group 1,

[0342] [ka]

[0343] It can be seen that what is recorded in is not the actual modularity increment, but 0. In this case, the exact

[0344] [ka]

[0345] In order to obtain

[0346] [ka]

[0347] can be calculated.

[0348] In another method,

[0349] [ka]

[0350] Both of the above may be calculated according to the above formula (4), where the specific calculation process can be referred to the above content.

[0351] After calculating the increment of the module when the merged image group is assumed to be merged with another image group, the device can continue to execute step S706.

[0352] In this embodiment, when performing step S706, a binary tree corresponding to the other image group is first determined, and the increment can be recorded in the determined binary tree.

[0353] Assume that image group 0 and image group 1 are merged as merged image group a. According to the query to the adjacency list, there is a connection between image group i and image group 0. When it is assumed that merged image group a and image group i are merged, the modularity is

[0354] [ka]

[0355] Assume that.

[0356] In this case, the device can first determine a binary tree corresponding to the image group i. After the binary tree is determined,

[0357] [ka]

[0358] can be inserted into the binary tree.

[0359] [ka]

[0360] After is inserted into the binary tree, the binary tree may redetermine the maximum increment among the increments recorded by itself and move the node in which the maximum increment resides to the root node of the binary tree.

[0361] If the calculated increment is recorded, the device can delete the increment that corresponds to the group identifier of any picture group within the two picture groups.

[0362] In this embodiment, the device can delete the data recorded in the root node from the binary trees corresponding to each of the two image groups.

[0363] After the binary tree corresponding to each image group is updated, for the next iteration, the device may also push the root node pointer corresponding to each current image group into the max heap.

[0364] Up to now, the above incremental set updates have been completed.

[0365] In this embodiment, in each iteration, the connection relationship between the merged image group generated in the current iteration and the other image groups is recorded in the adjacency list, and it is also possible to delete a connection relationship in the adjacency list that includes either of the image groups of the two merged image groups.

[0366] So far, one iteration has been completed. The device may repeat the iterative step S206 until the set of images to be grouped contains unique image groups.

[0367] It can be understood that in each iteration, a merged image group is obtained by merging two image groups, and therefore, assuming that the set of images to be grouped initially contains N image groups (N is a natural number greater than 0), N-1 merging iterations are required until the N image groups are merged into one image group.

[0368] In the above situation, before the iterative step starts, a counter with a value of 1 can be set, and each time an iteration is performed, the value of the counter can be incremented by 1. In this case, the device can determine whether to terminate the execution of the iterative step S206 by determining whether the value of the counter has reached N-1 before each iterative step.

[0369] If the set of images to be grouped includes a unique image group, the device can perform step S208.

[0370] In this embodiment, the device can perform the following step S2082 on the merged image groups recorded in each iteration, starting from the merged image group recorded in the last iteration, in the reverse order of the occurrence of the iterations, where the step S2082 is: determining whether a group identifier of the merged image group is included in an identifier set for checking an image combination method, and if the group identifier of the merged image group is not included in the identifier set, writing the group identifier of the merged image group recorded in this iteration into the identifier set; determining whether the updated modularity corresponding to the recorded merged image group is a maximum modularity among the recorded updated modularities in each iteration; If the updated modularity corresponding to the merged image group is the maximum modularity among the recorded updated modularities in each iteration, images indicated by image identifiers corresponding to each group identifier included in the identifier set are used as one image combination, and each obtained image combination is determined as an image grouping result of the set of images to be grouped.

[0371] If the updated modularity corresponding to the merged image group is not the maximum modularity among the recorded updated modularities in each iteration, the group identifier of the merged image group recorded in the identifier set is replaced with the group identifiers of the two pre-merged image groups corresponding to the merged image group.

[0372] Please refer to FIG. 8, which is a schematic diagram of merging image groups according to an embodiment of the present invention.

[0373] The nodes shown in Fig. 8 are data nodes corresponding to image groups, where nodes 0-9 are data nodes corresponding to image groups that correspond one-to-one to each image included in the set to be grouped, and node ai is a data node corresponding to a merged image group generated in each iteration. Fig. 8 above shows the correspondence relationship between two image groups and a merged image group generated by merging the two image groups.

[0374] It can be understood that when each data node is created, it usually includes a current timestamp, and therefore the creation order of each data node can be determined by determining the timestamp information included in each data node. In the above FIG. 8, assume that the index of each data node indicates the creation order of each data node. For example, the creation time of node a is earlier than the creation time of node b, and the creation time of node g is earlier than the creation time of node i.

[0375] When the device executes step S2082 on the last recorded merged image group, the identifier set for determining the image combination method is initially empty, so the group identifier of the image group corresponding to node i recorded in node i can be written into the identifier set first. In this case, the identifier set includes group identifier i.

[0376] The device can then determine whether the modularity recorded in the node i is the maximum modularity among the recorded updated modularities in each iteration.

[0377] The following describes how to determine whether the modularity recorded in the node i is the maximum modularity.

[0378] Those skilled in the art can understand that in a practical situation, when modularity is maximum, the combination forms of images included in the image set to be grouped can be three kinds: 1, all images are combined into one group; 2, each image is in its own group; 3, some images are combined into one group.

[0379] For situation 1, in fact, after each merging, the combination form of the current image tends to stabilize, and therefore the corresponding modularity gradually increases, and in this case, the change tendency of the modularity becomes monotonically larger with each iteration.

[0380] For situation 2, in fact, after each merging, the current image combination form tends to become unstable, and therefore the corresponding modularity gradually decreases, and in this case, the change tendency of the modularity becomes monotonically smaller with each iteration.

[0381] For situation 3, in fact, from the initial image combination scheme to the emergence of the image combination scheme with the maximum modularity, the current image combination form after each merge tends to be stable. After the emergence of the image combination scheme with the maximum modularity, the current image combination form after each merge tends to be unstable. In this case, the change tendency of the modularity will be monotonically larger with each iteration at first, and then monotonically smaller after reaching a peak.

[0382] Those skilled in the art can understand that for the above three situations, starting from the last iteration, in the reverse order of the iterations, for each iteration, determine whether the updated modularity in this iteration reaches the updated modularity in the previous iteration corresponding to this iteration. In the above situation, if it is found that the updated modularity in this iteration reaches the updated modularity in the previous iteration corresponding to this iteration, it means that the updated modularity in this iteration is the maximum modularity. In this case, if no modularity that satisfies the judgment condition is found after performing the determination step for each iteration, it means that the maximum value of modularity is the modularity corresponding to the image combination mode before the each iteration.

[0383] Therefore, when the device determines whether the modularity recorded in the node i is the maximum modularity among the modularities recorded after updating in each iteration, the device may:

[0384] [ka]

[0385] and the modularity recorded in node h above

[0386] [ka]

[0387] can be compared with the above.

[0388] [ka]

[0389] The above

[0390] [ka]

[0391] If i is reached, then determine that the node i is the maximum modularity.

[0392] When the device determines whether the modularity recorded in the node i is the maximum modularity among the recorded modularities after updating in each iteration, if the modularity recorded in the node i is the maximum modularity among the recorded modularities after updating in each iteration, the device can use images indicated by image identifiers corresponding to each group identifier included in the identifier set as one image set, and determine each obtained image combination as an image grouping result for the set of images to be grouped.

[0393] If the modularity recorded in the node i is not the maximum modularity among the recorded modularities after updating in each iteration, the group identifier of the merged image group recorded in the identifier set is replaced with a group identifier for indicating the two image groups corresponding to the group identifier of the recorded merged image group.

[0394] Continuing to refer to Figure 8, assume that the modularity recorded in node f in Figure 8 is the maximum modularity. In the above situation, when performing step S2082 for node i, the device can determine that the modularity recorded in node i is not the maximum modularity. In this case, the device can replace the group identifier i in the identifier set with the group identifiers g, h of the two image groups merged into image group i. In this case, the identifier set includes group identifiers g, h.

[0395] After performing the above step for node i, the above step S2082 can be subsequently performed for node h. Since the modularity recorded for node h is not the maximum modularity, the device can replace the group identifier h in the identifier set with the group identifiers e, f of the two image groups merged into image group h. In this case, the identifier set includes group identifiers g, e, f.

[0396] After performing the above step for node h, the above step S2082 can be subsequently performed for node g. Because the modularity recorded for node g is not the maximum modularity, the device can replace the group identifier g in the identifier set with the group identifiers c, 4 of the two image groups merged into image group g. In this case, the identifier set includes group identifiers c, 4, e, and f.

[0397] After performing the above step for node g, the above step S2082 can be subsequently performed for node f. Since the modularity recorded in node f is the maximum modularity, the device can determine that the image grouping results of the set of images to be grouped are that images 0-3 are in one group, image 4 is independent in one group, images 5-6 are in one group, and images 7-9 are in one group.

[0398] As can be seen from the technical solution described in this embodiment, in addition to rationally grouping the images to be grouped, the technical solution described in this embodiment can also achieve the following effects: By creating a binary tree corresponding to each image group, the same increment is actually recorded in each binary tree of the two image groups corresponding to the increment. In this case, after two image groups in each image group are merged into one merged image group, when recording the increment corresponding to the merged image group, the increment can be recorded in the binary tree of another image group corresponding to the merged image group without the need to maintain one new binary tree for the merged image group, thereby reducing the amount of calculation when recording the increment corresponding to the merged image group and further improving image grouping efficiency.

[0399] Meanwhile, since the maximum value of the increments corresponding to each image group is recorded in the root node of the binary tree, when determining the maximum increment in the increment set in the subsequent iterative step, it is only necessary to compare the increments recorded in the root node of the binary tree corresponding to each image group, thereby improving the efficiency of determining the maximum increment and further improving the efficiency of image grouping.

[0400] On the other hand, by pushing the root node pointer of the above binary tree into the max heap and deriving the maximum increment from the max heap, the efficiency of determining the maximum increment from the increment set can be improved, thereby further improving the efficiency of image grouping.

[0401] In some embodiments of the present application, after the images in the set of images to be grouped are grouped, an image group containing a relatively small number of images may be generated, in which case, when 3D reconstruction is performed on the image group containing a relatively small number of images, the reconstruction result may be poor or 3D reconstruction may not be possible due to the small number of images contained in the image group.

[0402] In the related art, some image groups containing a number of images below a minimum threshold are selected and fused to obtain a fused image group, thereby increasing the number of images contained in the obtained image group.

[0403] However, in related technologies, when fusing image groups, the connection relationships between each of the image groups being fused are not taken into consideration, so the connection relationships between each image in the image group obtained by this method are not very strong, and as a result, the robustness of the 3D reconstruction results obtained by performing 3D reconstruction on the image group obtained by fusion is low.

[0404] According to the technical solution proposed in this embodiment, when fusing image groups with a small number of images, the two image groups with the strongest connection relationship are first fused, thereby fusing image groups with a small number of images and ensuring that the connection relationship between each image in the image groups obtained after fusion is strong, thereby improving the robustness of the reconstruction results of 3D reconstruction for the image groups obtained by fusion.

[0405] Before introducing the detailed steps of this embodiment, we first introduce an indicator for evaluating the strength of the connection relationship between image groups, namely, the connection weight value.

[0406] In some embodiments, the connection weight value may include an indicator for quantifying the connection relationship between two image groups.

[0407] When calculating the connection weight value between two image groups, first, the similarity between each image included in one image group (e.g., the first image group) and each image included in another image group (e.g., the second image group) can be calculated. Then, it is determined whether each calculated similarity reaches a predetermined similarity threshold, and two images corresponding to a similarity that reaches the predetermined similarity threshold are determined as matching images, the number of matching images between the two image groups is counted, and the image number is used as the connection weight value between the two image groups.

[0408] As can be seen, the connection weight value can quantify the connection relationship between two image groups.

[0409] Next, the detailed steps of this embodiment will be introduced.

[0410] First, the device can determine, among the obtained image groups, an image group containing a quantity of images smaller than a first predetermined quantity threshold, and determine the determined image group as a to-be-fused image group, where the first predetermined quantity threshold indicates a minimum quantity of images in each group. Then, among the image groups, determine groups other than the to-be-fused image group as a remainder group.

[0411] In some embodiments, the first predetermined quantity threshold may be a minimum quantity of images in each group, where the minimum quantity of images may be a minimum quantity of images allowed to be included in a predefined group of images.

[0412] In this step, the device can first assign one set of image group identifiers to the image groups to be fused, then the device can sequentially determine the number of images included in each image group, and add the group identifiers of the image groups whose number of images included is less than the first predetermined number threshold to the fusion image group identifier set, thereby completing the step of determining the image groups to be fused.

[0413] Here, the step of determining the remaining group can refer to the step of determining the image group to be fused.

[0414] When the image groups to be merged are determined, the device can calculate connection weight values ​​between every two image groups among the image groups to be merged to construct a connection weight value set, where the connection weight values ​​indicate the number of matching images between the two image groups.

[0415] In this step, the device can create a binary tree (e.g., a balanced binary tree) for each image group in the group waiting to be fused, which corresponds one-to-one with the image group. Next, the device can calculate connection weight values ​​between every two image groups in the group waiting to be fused, and record the connection weight values ​​and group identifiers of the two image groups in the binary tree nodes, and the maximum connection weight value among the connection weight values ​​corresponding to each image group and the group identifier corresponding to the maximum connection weight value are recorded in the root node of the binary tree.

[0416] Up to this point, the generation of the above connection weight value set has been completed.

[0417] The device may then fuse the group of images to be fused based on the set of connection weight values.

[0418] In some embodiments, when fusing the group of images to be fused based on the set of connection weight values, the device may iteratively perform the following steps until the set of connection weight values ​​does not include any connection weight values: The maximum connection weight value in the set of connection weight values ​​is determined.

[0419] In this step, when determining the maximum connection weight value, the root node pointer of the binary tree corresponding to each image group can be pushed to a max heap for deriving the maximum connection weight value. Then, the pointer recorded in the root node of the max heap is read, and the connection weight value recorded in the binary tree node pointed to by the recorded pointer is determined as the maximum connection weight value.

[0420] After the maximum connection weight value is determined, the device can determine the two image groups corresponding to the maximum connection weight value according to the group identifiers recorded in the binary tree nodes.

[0421] After the two image groups corresponding to the maximum connection weight values ​​have been determined, the device can determine whether the quantity of images in the one image group containing a greater quantity of images has reached a second predetermined quantity threshold, where the second predetermined quantity threshold indicates a maximum quantity of images in each image group; If the second predetermined quantity threshold is reached, then terminate the current iteration; If the second predetermined quantity threshold is not reached, the two image groups are merged to obtain a merged image group, and the set of connection weight values ​​is updated.

[0422] The second predetermined quantity threshold is specifically used to indicate a maximum image quantity for each image group, where the maximum image quantity is the maximum image quantity allowed to be included in each image group.

[0423] In this step, when the two image groups are merged to obtain a merged image group, the device can create one data node for the merged image group and write the image identifiers recorded in the data nodes corresponding to the two merged image groups to the data node. Then, the device can delete the image identifiers of the two merged image groups in the set of image group identifiers waiting to be merged and add the group identifier of the merged image group.

[0424] When the merging is complete, the device can update the set of connection weight values.

[0425] In this step, the device can first delete data recorded in the binary tree corresponding to each of the two merged image groups.

[0426] Next, the device can calculate a connection weight value between the merged image group and another group among the groups waiting to be fused, and write the calculated connection weight value and group identifiers of the merged image group and the other group into a binary tree corresponding to the other group. In this case, the device can also delete a node in which the connection weight value between the two image groups merged with the other group is recorded from the binary tree corresponding to the other group.

[0427] It can be understood that, in order to improve image fusion efficiency, when calculating the connection weight values ​​between the merged image group and other groups in the fusion waiting group, only the connection weight values ​​between the merged image group and other image groups that have a connection relationship with the merged image group can be calculated.

[0428] Up to now, the device has completed updating the set of connection weight values.

[0429] The device may then repeat the steps until the set of connection weight values ​​does not contain any connection weight values.

[0430] In this embodiment, when the number of images in one of the two image groups corresponding to the maximum connection weight value, which contains a larger number of images, reaches a second predetermined quantity threshold, the device, in addition to performing an operation of stopping the current iteration, can delete the binary tree corresponding to the image group containing a larger number of images, and delete the node in which the connection weight value between the two image groups is recorded from the binary tree corresponding to the image group containing a smaller number of images.

[0431] It should be noted that when two image groups are merged, or when the number of images contained in an image group is greater than the second predetermined threshold, the corresponding binary tree is deleted; therefore, when the binary tree of the image group corresponding to the maximum connection weight value is empty, it means that the image group can no longer be merged.

[0432] As can be seen, in order to improve the efficiency of image group fusion, after determining the maximum connection weight value in each iteration, the device can first determine whether the binary tree corresponding to either of the two image groups corresponding to the maximum connection weight value is empty. If it is empty, the current iteration can be terminated, and the node in which the connection weight value between the two image groups is recorded can be deleted from the non-empty binary tree, thereby reducing invalid iterations and improving the efficiency of image group fusion.

[0433] If the set of connection weight values ​​does not include any connection weight values, the device can use the image groups included in the group waiting to be fused and the image groups in the remainder group as the final image groups of the set of images waiting to be grouped.

[0434] In some embodiments, the device may read each group identifier included in the set of group identifiers to be merged, and for each group identifier, split images indicated by image identifiers corresponding to each group identifier into one image group, and then output each image group obtained by splitting and an image group of the remainder group as final image groups of the set of images to be grouped.

[0435] In this embodiment, the two image groups corresponding to the maximum connection weight value in each iteration can be fused, so that when fusing an image group with a small number of images, the two image groups with the strongest connection relationship can be first fused, thereby ensuring that the connection relationship between each image in the image group obtained after fusion is relatively strong while fusing the image group with a small number of images, thereby improving the robustness of the reconstruction result of 3D reconstruction for the image group obtained by fusion.

[0436] Based on the inventive concept of the above embodiment, the present embodiment further provides an image grouping method in 3D reconstruction. Refer to FIG. 9, which is a flow chart of the image grouping method in 3D reconstruction according to the present embodiment. As shown in FIG. 9, the method includes the following steps: In step S902, when each image in the set of images to be grouped is used as one image group, the modularity corresponding to the set of images to be grouped is calculated.

[0437] In step S904, when the image groups included in the set of images to be grouped are combined two by two, an increment in modularity corresponding to each combination is calculated to obtain an increment set.

[0438] In step S906, the maximum increment contained in the increment set is determined, and then it is determined whether the maximum increment has reached 0. If so, the two recorded image groups corresponding to the maximum increment are merged to obtain a merged image group, and the increment set is updated. This step is repeated until the set of images to be grouped contains a unique image group.

[0439] In step S908, if the maximum increment does not reach 0 in each iteration, the above iteration steps are terminated, and the image combination method after merging in the previous iteration of this iteration is used as the final image grouping result of the set of images to be grouped.

[0440] In step S910, if the set of images to be grouped includes a unique image group, each image included in the set of images to be grouped is divided into one image group.

[0441] According to the analysis of the change trend of the modularity corresponding to the current image combination form after the merging operation in each iteration process in the above embodiment, when the modularity reaches the maximum value, the modularity in the subsequent iterations will decrease monotonically.

[0442] Therefore, before each merging operation, it can be determined whether the current merging will reduce the modularity, and if not, the merging operation is performed; otherwise, the merging is terminated and the image combination method after the previous iteration can be used as the final image grouping result of the set of images to be grouped.

[0443] In some embodiments, it is determined whether the maximum module increment in the current iteration has reached 0, and if so, this means that the modularity will at least not decrease after this merge. However, if it is detected that the maximum module increment in the current iteration is a negative value, this means that the modularity will decrease after this merge, and will continue to decrease after each subsequent merge operation.

[0444] As can be seen from the above technical solution, the method can ensure that after each merging, the image combination scheme is the best combination scheme that can be achieved in this merging by merging two image groups corresponding to the maximum modularity increment in each iteration step.

[0445] On the other hand, before each merging operation, it is judged whether the current merging will reduce the modularity, and if the modularity will not be reduced, the merging operation is performed; if not, the merging is terminated, and the image combination method after the previous iteration can be used as the final image grouping result for the set of images to be grouped, thereby ensuring that the corresponding image combination method when the modularity is maximized in the iterative process is determined as the image grouping result for the set of images to be grouped, so that the connection relationship between the images in each divided group is relatively strong, and the connection relationship between the images in each group and the images in other groups is relatively weak, thereby improving the accuracy of image grouping and further improving the robustness of 3D reconstruction through image grouping.

[0446] In some embodiments, refer to Fig. 10, which is a schematic diagram of the process in which the image grouping method in 3D reconstruction according to the embodiment of the present application is applied to a real scene. Fig. 10 shows three processes of the image grouping method in the embodiment of the present application, namely, a scene image construction process, an image group generation process and an image group fusion process, which will be described in detail as follows.

[0447] The scene image construction process can be realized by the above-mentioned device performing feature extraction and feature matching on multiple real scene images collected from a real scene. Specifically, the feature extraction process includes: extracting multiple feature points from each real scene image, illustratively extracting Harris corner points as feature points, statistically calculating the grayscale histogram of a predetermined area around each feature point, and generating a feature vector for describing the feature point, for example, a 128-dimensional feature vector, thereby obtaining the corresponding feature vector of each feature point of each real scene image. In the feature matching process, the matching relationship between two real scene images can be calculated based on the feature vector set corresponding to each real scene image. Specifically, the process includes: for one feature point of one real scene image, finding a feature point similar to the feature point from another real scene image and using it as one matching point pair. Here, the similarity between feature points can be measured by the Euclidean distance between their corresponding feature vectors, and if the number of matched matching point pairs between two real scene images is greater than a predetermined quantity threshold, the two real scene images are determined to be matching images.

[0448] In some embodiments, a scale-invariant feature transform (SIFT) feature extraction method may be adopted for feature extraction, and the specific method may be selected according to actual conditions, and the embodiments of the present application are not limited thereto.

[0449] In some embodiments, when performing feature matching, non-maximum suppression and bidirectional matching consistency can also be used to eliminate false matching. Or, in some scenes with weak texture or large changes in viewing angle, when the number of matched matching point pairs is less than a predetermined minimum matching number threshold, an essential matrix between two corresponding real scene images can be obtained based on the matched matching point pairs, and the essential matrix provides an epipolar geometry constraint between the images, which allows the search range of similar features to be constrained to the epipolar line, thereby greatly enhancing matching.

[0450] For the image group generation process, the process of image grouping, modularity calculation and iterative merging based on modularity is performed by the method of steps S202-S208 above or the method of steps S902-S910 above. When a unique image group is obtained, the image combination method corresponding to the maximum modularity obtained in step S208 is determined as the initial result of image grouping, or each image included in the set waiting to be grouped obtained in step S209 is divided into one image group to obtain the initial result of image grouping.

[0451] Here, in the execution process of step S204 or step S904, the connection relationships between each region are obtained from the generated scene image, and when further performing image grouping, only image groups that have connection relationships are combined, thereby reducing the amount of calculation for modularity increments and improving the efficiency of image group generation.

[0452] In the image group fusion process, first, in the initial image grouping result, based on the number of images in each image group, image groups to be fused that contain relatively few images can be determined, and then connection weight values ​​between two image groups can be calculated to obtain a connection weight value set. A binary tree that corresponds one-to-one with each image group to be fused is used, and if the number of images in the image group to be fused that contains more images among the two image groups to be fused that correspond to the maximum connection weight value does not reach a second predetermined quantity threshold, the two image groups to be fused that correspond to the maximum connection weight value are fused, and the binary tree and the connection weight value are updated based on the fusion result, and if the connection weight value set does not include any connection weight value, the image group obtained after fusing the image groups to be fused and the remaining groups other than the image groups to be fused are used as the final image grouping result.

[0453] As can be seen from the above technical solution, in the case of the image group generation process based on modularity, it can be realized that the connectivity of images in the same group is strong and the connectivity between different groups is weak, thereby improving the accuracy of image grouping, improving the success rate of image reconstruction in the same group and the overall efficiency of the overall reconstruction, thereby improving the robustness of the 3D reconstruction. In addition, in the case of the image group fusion process, when fusing an image group with a small number of images, the two image groups with the strongest connectivity are first fused, and by fusing the image group with a small number of images in this way, the uniformity of the image group is ensured, and at the same time, the connectivity between each image in the final image group obtained after fusion is relatively strong, thereby further improving the robustness of the reconstruction result of the 3D reconstruction using the final image group obtained by fusion.

[0454] The present embodiment further provides an image grouping device in 3D reconstruction. Please refer to FIG. 11, which is a structural diagram of the image grouping device in 3D reconstruction according to the present application. As shown in FIG. 11, the device 100 includes: a first calculation unit 101 configured to use each image in a set of images to be grouped as one image group and calculate a modularity corresponding to the set of images to be grouped; a first generating unit 102 configured to combine two or more image groups included in the set of images to be grouped, calculate an increment of modularity corresponding to each combination, and obtain an increment set; a first merging unit 103 configured to determine a maximum increment in the increment set, merge two image groups corresponding to the maximum increment to obtain a merged image group, update a modularity corresponding to the set of images to be grouped and the increment set, and repeatedly perform this step until the set of images to be grouped contains a unique image group; and a first group determination unit 104 configured to determine a maximum modularity among the recorded modularities after updating in each iteration when the set of images to be grouped includes a unique image group, and to determine an image combination scheme corresponding to the maximum modularity as an image grouping result for the set of images to be grouped.

[0455] In one embodiment shown, the first group determination unit 104 further comprises: determining whether the maximum modularity has reached a predetermined threshold; When the maximum modularity reaches a predetermined threshold, an image combination method corresponding to the maximum modularity is determined as an image grouping result of the set of images to be grouped; If the maximum modularity does not reach a predetermined threshold, each image included in the set of images to be grouped is used as an independent image group.

[0456] In one embodiment shown, the first generating unit 102 further comprises: a plurality of image groups, each pair of image groups having a connection relationship is combined, and a correspondence relationship between group identifiers of the image groups having a connection relationship is recorded; Here, two image groups having a connected relationship means that the similarity between images in the first image group and the second image group of the two image groups reaches a predetermined similarity threshold value.

[0457] In one illustrative embodiment, the set of increments includes a correspondence between group identifiers of two image groups assumed to be combined and the increments calculated assuming that the two image groups are merged; The first generation unit 103 further searching for a correspondence between the group identifiers of the recorded image groups having a connection relationship, and determining another image group having a connection relationship with one of the two image groups corresponding to the maximum increment; determining the increments obtained by assuming that the other group of images is merged with each of the two images, and adding the determined increments together to obtain an increment of modularity obtained by assuming that the merged group of images is merged with the other group of images; The apparatus is configured to record in the increment set a correspondence between the group identifiers of the merged image group and the other image groups and the increments of the modules obtained by assuming that the two are merged.

[0458] In one embodiment shown, the apparatus 100 further comprises: and a first recorder configured to record a correspondence relationship between the group identifier of the merged image group and the group identifier of the other image group after updating the incremental set in each iteration process.

[0459] In one embodiment shown, the apparatus 100 further comprises: A second recording unit is configured to record, in each iteration process, the merged image group obtained by merging and the correspondence between the group identifier of the merged image group and the group identifiers of the two merged image groups.

[0460] In one illustrated embodiment, the merged image group corresponds to an updated modularity during the iterations of generation of the merged image group, and group identifiers of the image group correspond to image identifiers corresponding to each image included in the image group; The first group determination unit 104 further The method is configured to perform the following steps for the merged image groups recorded in each iteration, starting from the merged image group recorded in the last iteration, in the reverse order of occurrence of the iterations, said steps being: determining whether a group identifier of the merged image group is included in an identifier set for identifying an image combination scheme, and if the group identifier of the merged image group is not included in the identifier set, writing the group identifier of the merged image group into the identifier set; determining whether the updated modularity corresponding to the merged image group is a maximum modularity among the recorded updated modularities in each iteration; If the updated modularity corresponding to the merged image group is the maximum modularity among the recorded updated modularities in each iteration, images indicated by image identifiers corresponding to each group identifier included in the identifier set are used as one image combination, and each obtained image combination is determined as an image grouping result of the set of images to be grouped.

[0461] In one embodiment shown, the apparatus 100 further comprises: The system further includes a replacement unit configured to replace the group identifier of the merged image group recorded in the identifier set with the group identifiers of the two pre-merged image groups corresponding to the merged image group if the updated modularity corresponding to the merged image group is not the maximum modularity among the recorded updated modularities in each iteration.

[0462] In one embodiment shown, the replacement portion further comprises: determining whether the updated modularity in the current iteration has reached the updated modularity in the previous iteration that corresponds to the current iteration; If so, the updated modularity in the current iteration is determined as the maximum modularity.

[0463] In one embodiment shown, the first generating unit 102 further comprises: For each of the calculated increments assumed to be combined, the following steps are performed: determining a binary tree corresponding to each of the two image groups assumed to be combined, and writing the increment and group identifiers of the two images assumed to be combined into the determined binary tree; Here, in the root node of the binary tree, the maximum increment among all the increments recorded in the binary tree and a group identifier corresponding to the maximum increment are recorded.

[0464] In one embodiment shown, the first generating unit 102 further comprises: Pushing the root node pointer of said binary tree corresponding to each image group into a max heap for determining the maximum increment; determining a pointer recorded in the root node of said maximum heap; The method is configured to determine the increment recorded at the node pointed to by the recorded pointer as the maximum increment contained in the set of increments.

[0465] In one embodiment shown, the apparatus 100 further comprises: a fusion-awaiting image group determination unit configured to determine, from among the obtained image groups, image groups containing a number of images smaller than a first predetermined number threshold, and determine the determined image groups as fusion-awaiting image groups, the first predetermined number threshold indicating the minimum number of images in each group; a remainder group determination unit configured to determine, among the image groups, remaining groups other than the to-be-fused image group as remainder groups; a connection weight value calculation unit configured to calculate a connection weight value between two image groups among the groups waiting to be merged to form a connection weight value set, the connection weight value indicating the number of matching images between the two image groups; and a group fusion unit configured to fuse the groups of images to be fused based on the set of connection weight values.

[0466] In one embodiment shown, the group merging unit further comprises: The method is configured to repeatedly execute the following steps until the set of connection weight values ​​does not include any connection weight values, the steps including: determining a maximum connection weight value in said set of connection weight values; determining whether the number of images in the image group with the larger number of the two image groups corresponding to the maximum connection weight value has reached a second predetermined number threshold, the second predetermined number threshold indicating the maximum number of images in each image group; terminating the current iteration if the second predetermined quantity threshold is reached; and If the second predetermined quantity threshold is not reached, merging the two image groups to obtain a merged image group, and updating the set of connection weight values; If the set of connection weight values ​​does not include any connection weight values, the image groups included in the group waiting to be merged and the image groups among the remainder group are used as the final image groups of the set of images waiting to be grouped.

[0467] In one embodiment shown, the connection weight value calculation unit: For each image group in the group waiting to be merged, a binary tree is created that corresponds one-to-one with each image group. The method is configured to calculate a connection weight value between each image group in the fusion waiting group, and record the connection weight value and the group identifiers of the two image groups in the binary tree node, and the root node of the binary tree records the maximum connection weight value among the connection weight values ​​corresponding to each image group, and the group identifier corresponding to the maximum connection weight value.

[0468] In one embodiment shown, the group merging unit further comprises: Pushing a root node pointer of the binary tree corresponding to each of the image groups into a max heap for deriving the maximum connection weight value; The method is configured to read a pointer recorded in the root node of the maximum heap, and determine the connection weight value recorded in the binary tree node pointed to by the recorded pointer as the maximum connection weight value.

[0469] In one embodiment shown, the device 100 further comprises a data determiner, the data determiner being configured to: determining whether a binary tree corresponding to either of the two image groups corresponding to the maximum connection weight value is empty; If not, continue to execute the subsequent steps. If it is empty, it is configured to terminate the current iteration.

[0470] In one embodiment shown, the group merging unit further comprises: Remove the binary trees corresponding to each of the two merged image groups above, Calculate connection weight values ​​between the merged image group and other groups in the waiting-to-fuse group; writing the calculated connection weight value and group identifiers of the merged image group and the other group into a binary tree corresponding to the other group; The method is configured to delete a node, for which a connection weight value between the other group and the two image groups merged therewith is recorded, from the binary tree corresponding to the other group.

[0471] The present embodiment further provides an image grouping device in 3D reconstruction. Refer to FIG. 12, which is a structural diagram of an image grouping device in 3D reconstruction according to the present application. As shown in FIG. 12, the device 110 includes: a second calculation unit 11 configured to calculate a modularity corresponding to the set of images to be grouped when each image in the set of images to be grouped is used as one image group; a second generation unit (112) configured to calculate an increment of modularity corresponding to each combination when the image groups included in the set of images to be grouped are combined two by two, thereby obtaining an increment set; a second merging unit 113 configured to determine a maximum increment in the increment set, determine whether the maximum increment has reached 0, and if the maximum increment has reached 0, merge the two recorded image groups corresponding to the maximum increment to obtain a merged image group, update the increment set, and repeatedly perform this step until the set of images to be grouped includes a unique image group; In each iteration, if the maximum increment does not reach 0, terminate the above iteration steps, and use the image combination method after merging in the previous iteration as the final image grouping result of the set of images to be grouped; and a second group determination unit 114 configured to divide each image included in the set of images to be grouped into one image group if the set of images to be grouped includes a unique image group.

[0472] It should be noted that the above description of the device embodiment is similar to the above description of the method embodiment, and has the same beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application.

[0473] The embodiment of the device shown in the present application may be applied to an electronic device. The embodiment of the device may be realized by software, hardware, or a combination of software and hardware. Taking the example of being realized by software, as a device in a logical sense, the processor of the electronic device in which it is arranged reads the corresponding computer program instructions in the non-volatile memory into the internal memory and executes them. From the viewpoint of hardware, as shown in FIG. 13, FIG. 13 is a hardware structure diagram of an electronic device according to an embodiment of the present application, and in addition to the processor, internal memory, network interface, and non-volatile memory shown in FIG. 13, the electronic device in which the device is arranged may also include other hardware according to the actual functions of the electronic device, and the description thereof will be omitted.

[0474] Referring to the electronic device shown in FIG. 13, the electronic device includes a processor; and a memory configured to store processor-executable instructions. Here, the processor executes the executable instructions to realize the image grouping method in 3D reconstruction shown in any of the above embodiments.

[0475] An embodiment of the present application provides a computer-readable storage medium having stored thereon a computer program for executing the method for grouping images in 3D reconstruction as described in any of the above embodiments.

[0476] An embodiment of the present application further provides a computer program product including computer readable code, which, when executed in an electronic device, causes a processor of the electronic device to perform the image grouping method for 3D reconstruction as set forth in any of the above embodiments.

[0477] It should be understood by those skilled in the art that one or more embodiments of the present application may be provided as a method, a system, or a computer program product. As such, one or more embodiments of the present application may take the form of a fully hardware embodiment, a fully software embodiment, or an embodiment combining hardware and software. Also, one or more embodiments of the present application may take the form of a computer program product stored on one or more computer usable storage media (including, but not limited to, magnetic disk memory, CD-ROM, optical memory, etc.) containing computer usable program code.

[0478] In this application, "and / or" indicates the inclusion of at least one of both, for example, "A and / or B" includes the three cases of A, B, and "A and B."

[0479] Each embodiment of the present application will be described step by step, and the same or similar parts between each embodiment may be referred to each other, and each embodiment will be described focusing on the differences from other embodiments. In particular, the data processing device embodiment will be described relatively briefly since it is basically similar to the method embodiment, and the relevant points may be referred to the partial description of the method embodiment.

[0480] The above describes certain embodiments of the present application. Other embodiments are within the scope of the claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that in the examples and still achieve desirable results. Also, the processes depicted in the figures do not necessarily require the particular order or sequential order depicted to achieve desirable results. In some embodiments, multitasking and parallel processing may be possible or advantageous.

[0481] Embodiments of the subject matter and functional operations described herein may be implemented in digital electronic circuitry, tangibly embodied computer software or firmware, computer hardware including the structures disclosed herein and structural equivalents thereof, or one or more combinations thereof. Embodiments of the subject matter described herein may be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier for execution by or control of the operation of a data processing apparatus. Alternatively or additionally, the program instructions may be encoded in an artificially generated propagated signal, such as a machine-generated electrical, optical or electromagnetic signal, which is generated to transmit the encoded information to an appropriate receiver device for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access storage device, or one or more combinations thereof.

[0482] The processing and logical processes described herein may be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processing and logical processes may be performed by, and devices may be implemented as, special purpose logic circuitry, such as an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit).

[0483] A computer suitable for executing a computer program includes, for example, a general-purpose and / or special-purpose microprocessor, or any other type of central processing unit. Typically, the central processing unit receives instructions and data from a read-only memory and / or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions, and one or more storage devices for storing instructions and data. Typically, a computer also includes one or more mass storage devices for storing data, such as magnetic disks, magneto-optical disks, or optical disks, or the like, or the computer is operatively coupled to the mass storage devices and can receive data from, transmit data to, or transmit data to, or receive data from, or receive data from, the mass storage devices. However, a computer does not necessarily include such devices. A computer may also be integrated into another device, such as, for example, a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash memory drive, to name just a few examples.

[0484] Computer-readable storage media suitable for storing computer program instructions and data include all forms of volatile or non-volatile storage media, where non-volatile storage media includes non-volatile memory, media and storage devices, such as semiconductor storage devices (e.g., EPROM, EEPROM and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks. The processes and memory may be supplemented by, or incorporated in, special purpose logic circuitry.

[0485] Although the present application includes many specific implementation details, these should not be construed as limiting the scope of the present application or the scope of protection claimed, but are mainly used to describe the features of certain disclosed specific embodiments. Some features described in multiple embodiments in the present application may be implemented in combination in a single embodiment. Meanwhile, various features described in a single embodiment may be implemented separately in multiple embodiments or in any suitable subcombination. Also, even if features function in several combinations as described above and are originally claimed as such, one or more features from a claimed combination may be deleted from the combination in some cases, and a claimed combination may refer to a subcombination or a variation of the subcombination.

[0486] Similarly, in the figures, although operations are illustrated in a particular order, this should not be construed as requiring those operations to be performed in the particular order illustrated, or as requiring all of the operations illustrated to be performed, in order to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Also, it should be understood that the separation of various system modules and components in the above examples should not be construed as requiring such separation in all circumstances, and that the program components and systems described may typically be integrated into a single software product or packaged into multiple software products.

[0487] Thus far, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve desirable results. Also, the processes depicted in the figures do not necessarily require the particular order or sequentiality shown to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous.

[0488] The above are merely preferred embodiments of one or more embodiments of the present application, and are not intended to limit the one or more embodiments of the present application. Any modifications, equivalent replacements, improvements, etc. made without departing from the spirit and principles of one or more embodiments of the present application shall be included within the protection scope of the present application. [Industrial Applicability]

[0489] In the embodiment of the present application, by merging two image groups corresponding to the maximum modularity increment in each iteration step, it is ensured that the image combination scheme after each merging is the best combination scheme that can be achieved in this merging.

[0490] On the other hand, when merging until only one image group remains, the maximum modularity among the modularities can be determined by tracing back the recorded modularities after updating in each iteration, and the image combination method corresponding to the maximum modularity is determined as the image grouping result of the set of images to be grouped, thereby ensuring that the best image combination method that appears in the image group merging process can be determined as the image grouping result of the set of images to be grouped. Or, before each merging operation, it is determined whether the modularity is reduced by the current merging, and if the modularity is not reduced, the merging operation is performed, and if not, the merging is terminated and the image combination method after the previous iteration is used as the final image grouping result of the set of images to be grouped, thereby ensuring that the corresponding image combination method when the modularity is maximized in the iterative process is determined as the image grouping result of the set of images to be grouped. The division of the groups realizes that the connection relationship between the images in each group is relatively strong and the connection relationship between the images in each group and the images in other groups is relatively weak, thereby improving the accuracy of image grouping and further improving the robustness of 3D reconstruction by image grouping.

[0491] As described above, in a large-scale 3D reconstruction system, by adopting the image grouping method proposed in the embodiments of the present application, efficient grouping of image sets can be realized, and efficient reconstruction of large-scale scenes can be realized; in an image classification application scene, image clustering can be realized by using this algorithm; and in a graph network partitioning scene, by adopting the image grouping method proposed in the embodiments of the present application, effective partitioning of the graph network structure can be realized.

Claims

1. 1. A method for grouping images in three-dimensional reconstruction, comprising: Using each image in the set of images to be grouped as one image group, calculate a modularity corresponding to the set of images to be grouped; calculating an increment of modularity corresponding to each combination of the plurality of image groups included in the set of images to be grouped, to obtain an increment set; determining a maximum increment in the set of increments, merging two image groups corresponding to the maximum increment to obtain a merged image group, updating a modularity corresponding to the set of images to be grouped and the set of increments, and repeating this step until the set of images to be grouped contains a unique image group; If the set of images to be grouped includes a unique image group, a maximum modularity is determined among the modularities after updating in each iteration, and an image combination method corresponding to the maximum modularity is determined as an image grouping result of the set of images to be grouped. Including, The image grouping method for three-dimensional reconstruction includes: In each iteration, the method further includes recording a merged image group obtained by merging, and a correspondence between a group identifier of the merged image group and a group identifier of the two merged image groups; the merged image group corresponds to an updated modularity in the iteration that generated the merged image group, and a group identifier of the image group corresponds to an image identifier corresponding to each image included in the image group; determining a maximum modularity among the recorded modularities after updating in each iteration, and determining an image combination method corresponding to the maximum modularity as an image grouping result of the set of images to be grouped; performing the following steps for the merged image groups recorded in each iteration in reverse order of occurrence of the iterations, starting from the merged image group recorded in the last iteration, the steps including: determining whether a group identifier of the merged image group is included in an identifier set for identifying an image combination scheme, and if the identifier set does not include the group identifier of the merged image group, writing the group identifier of the merged image group into the identifier set; determining whether the updated modularity corresponding to the merged image group is a maximum modularity among the recorded updated modularities in each iteration; if the updated modularity corresponding to the merged image group is the maximum modularity among the recorded updated modularities in each iteration, use images indicated by image identifiers corresponding to each group identifier included in the identifier set as one image combination, and determine each obtained image combination as an image grouping result of the set of images to be grouped; A method for grouping images in three-dimensional reconstruction, comprising:

2. Determining an image combination method corresponding to the maximum modularity as an image grouping result of the set of images to be grouped, determining whether the maximum modularity has reached a predetermined threshold; When the maximum modularity reaches the predetermined threshold, determining an image combination method corresponding to the maximum modularity as an image grouping result of the set of images to be grouped; if the maximum modularity does not reach the predetermined threshold, each image included in the set of images to be grouped is used as an independent image group; The method of claim 1 , comprising:

3. Combining two by two of the plurality of image groups included in the set of images to be grouped includes: combining two image groups having a connection relationship among the plurality of image groups, and recording a correspondence relationship between group identifiers of the image groups having a connection relationship; The method of claim 1 , wherein two image groups are connected means that a similarity between images in a first image group and a second image group of the two image groups reaches a predetermined similarity threshold.

4. the increment set includes a correspondence between group identifiers of two image groups assumed to be combined and the increment calculated assuming the two image groups are merged; Updating the incremental set comprises: searching for a correspondence between the group identifiers of the recorded picture groups having a connection relationship, and determining another picture group having a connection relationship with one of the two picture groups corresponding to the maximum increment; determining the increment obtained by assuming that the other group of images is merged with each of the two groups of images, and using the result obtained by adding the determined increments as the increment of modularity when it is assumed that the merged group of images and the other group of images are merged; recording in the increment set a correspondence between the group identifiers of the merged image group and the other image group and the increment of the modularity obtained by assuming that the two groups are merged; The method of claim 3 , comprising:

5. The image grouping method for three-dimensional reconstruction includes: The method of claim 4 , further comprising: recording the correspondence between the group identifiers of the merged image group and the group identifiers of the other image groups after updating the incremental set in each iteration process.

6. The image grouping method for three-dimensional reconstruction includes: The method of claim 1 , further comprising: if the updated modularity corresponding to the merged image group is not the maximum modularity among the recorded updated modularities in each iteration, replacing the group identifier of the merged image group recorded in the identifier set with the group identifiers of the two image groups before merging that correspond to the merged image group.

7. Determining whether the updated modularity corresponding to the recorded merged image group is a maximum modularity among the updated modularities in each iteration includes: determining whether the updated modularity in the current iteration has reached the updated modularity in the previous iteration corresponding to the current iteration; If so, determine the updated modularity in the current iteration as the maximum modularity. The method of claim 6, comprising:

8. Calculating an increment of modularity corresponding to each combination of the plurality of image groups when the plurality of image groups are combined two by two to obtain an increment set, and for each of the calculated increments assumed to be combined, performing the steps of: determining a binary tree corresponding to each of the two image groups assumed to be combined, and writing the increment and group identifiers of the two image groups assumed to be combined into the determined binary tree; The method according to claim 3 , wherein a maximum increment of all increments recorded in the binary tree and a group identifier corresponding to the maximum increment are recorded in a root node of the binary tree.

9. Determining a maximum increment included in the set of increments comprises: pushing the root node pointer of said binary tree corresponding to each image group onto a max heap for determining a maximum increment; determining a pointer recorded in a root node of the max heap; determining the increment recorded at the node pointed to by the recorded pointer as the maximum increment included in the set of increments; The method of claim 8 , comprising:

10. The image grouping method for three-dimensional reconstruction includes: Among the obtained image groups, determine an image group containing a number of images smaller than a first predetermined number threshold, and determine the determined image group as an image group to be merged, the first predetermined number threshold indicating a minimum number of images in each group; determining, from among the image groups, the remaining groups other than the image group to be fused as a remainder group; Calculating a connection weight value between two image groups in the to-be-fused group to construct a connection weight value set, where the connection weight value indicates a quantity of matching images between the two image groups; fusing the group of images to be fused based on the set of connection weight values; The method of any one of claims 1 to 9, further comprising:

11. Fusing the group of images to be fused based on the set of connection weight values ​​includes: and repeatedly performing the following steps until the set of connection weight values ​​does not include any connection weight values, the steps comprising: determining a maximum connection weight value in said set of connection weight values; determining whether a quantity of images in the image group with a larger quantity of the two image groups corresponding to the maximum connection weight value has reached a second predetermined quantity threshold, the second predetermined quantity threshold indicating a maximum quantity of images in each image group; terminating the current iteration if the second predetermined quantity threshold is reached; and if the second predetermined quantity threshold is not reached, merging the two image groups to obtain a merged image group and updating the set of connection weight values; if the set of connection weight values ​​does not include any connection weight value, the image groups included in the group waiting to be merged and the image groups among the remainder group are used as final image groups of the set of images waiting to be grouped. The method of claim 10, comprising:

12. Calculating connection weight values ​​between two image groups among the groups to be merged to configure a connection weight value set, creating a binary tree for each image group in the group to be merged that has a one-to-one correspondence with the image group; calculating a connection weight value between two image groups in the group to be merged, and recording the connection weight value and group identifiers of the two image groups in nodes of the binary tree, wherein a maximum connection weight value among the connection weight values ​​corresponding to each image group and a group identifier corresponding to the maximum connection weight value are recorded in a root node of the binary tree; The method of claim 10, comprising:

13. Determining a maximum connection weight value in the set of connection weight values ​​comprises: pushing a root node pointer of a binary tree corresponding to each of the image groups into a max heap for deriving the maximum connection weight value; reading a pointer recorded in a root node of the maximum heap, and determining a connection weight value recorded in a binary tree node pointed to by the recorded pointer as the maximum connection weight value. The method of claim 12.

14. After determining the maximum connection weight value in the set of connection weight values, the image grouping method in 3D reconstruction includes: determining whether a binary tree corresponding to either of the two image groups corresponding to the maximum connection weight value is empty; If it is not empty, continue executing the subsequent steps; If it is empty, it terminates the current iteration. The method of claim 12 further comprising:

15. Updating the set of connection weight values ​​includes: removing binary trees corresponding to each of the two merged image groups; Calculating connection weight values ​​between the merged image group and other groups in the to-be-fused group; writing the calculated connection weight value and group identifiers of the merged image group and the other group into a binary tree corresponding to the other group; deleting a node in which a connection weight value between the other group and the two merged image groups is recorded from the binary tree corresponding to the other group; The method of claim 12, comprising:

16. An electronic device, comprising: A processor; a memory configured to store instructions executable by the processor; Equipped with The electronic device, wherein the processor is configured to execute the image grouping method for three-dimensional reconstruction according to any one of claims 1 to 15 by calling and executing the instructions stored in the memory.

17. A computer-readable storage medium having a computer program stored thereon, the computer program including computer-readable code that, when executed by a processor of an electronic device, causes the processor to perform the method for grouping images in three-dimensional reconstruction according to any one of claims 1 to 15.

18. A computer program comprising computer readable code, which when executed by a processor of an electronic device causes the processor to perform the method for grouping images in three-dimensional reconstruction according to any one of claims 1 to 15.

Citation Information

Patent Citations

  • Image classifying apparatus and method

    JP2020095498A