Loop detection method and device, electronic device and storage medium
By filtering and combining image correlations to determine the loop image, the problem of camera pose error accumulation in SfM is solved, and the accuracy and robustness of three-dimensional reconstruction are improved.
Patent Information
- Application Number
- CN202010851685.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-21
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2040-08-21
AI Technical Summary
In computer vision technology, during the three-dimensional reconstruction process of Structure from Motion (SfM), due to the accumulation of camera pose errors in consecutive frame images, the camera pose has low accuracy and poor robustness.
A loop-closing detection method is proposed. By screening out the images whose similarity score reaches the threshold value with the image to be detected, the corresponding loop-closing image candidate set is determined, and combined with the correlation between the previous and next frame images to establish a more accurate loop-closing image, thereby improving the performance of the loop-closing image. Accuracy and robustness of 3D reconstruction.
It effectively avoids erroneous loopback relationships introduced by abnormal frames, improving the accuracy of loopback detection results and the accuracy and robustness of three-dimensional reconstruction.
Smart Images

Figure CN111986313B
Abstract
Description
Technical Field
[0001] The present application relates to computer vision technology, and specifically to a loop detection method and device, an electronic device, and a storage medium. Background Art
[0002] In the field of computer vision technology, Structure from Motion (SfM) is a commonly used 3D reconstruction technology. This technology can determine the camera pose corresponding to each frame by analyzing the image sequence. After determining the camera pose, the motion trajectory of the camera can be determined based on the camera pose corresponding to at least one continuous frame of images, and the scene can be reconstructed in 3D based on the motion trajectory.
[0003] When determining the motion trajectory, each frame image in the continuous frames will cause errors in the determined camera pose due to reasons such as light and camera parameters, and the camera pose corresponding to the next frame image is usually estimated based on the previous frame image. Therefore, when calculating the camera pose based on continuous frame images, it is easy to cause error accumulation, resulting in cumulative errors, resulting in low accuracy and poor robustness of the final determined camera pose. Summary of the invention
[0004] In view of this, the present application at least discloses a loop detection method and device, an electronic device, and a storage medium.
[0005] According to a first aspect of an embodiment of the present application, the present application proposes a loop detection method, the method comprising:
[0006] Screening out images whose similarity scores with the image to be detected reach a first similarity score threshold from images preceding the image to be detected in the image sequence to be detected, and creating a loop image candidate set corresponding to the image to be detected based on the screened images;
[0007] Determine whether the loop image candidate set corresponding to the image to be detected has a common image with the loop image candidate sets corresponding to at least one consecutive frame of image before the image to be detected; wherein the common image is an image whose similarity score reaches a second similarity score threshold;
[0008] If there is a common image, the common image is determined as a loop image corresponding to the image to be detected.
[0009] In an embodiment shown, the method further includes:
[0010] The first similarity score threshold is determined based on the similarity score of each frame image in the image neighborhood range corresponding to the image to be detected; wherein the image neighborhood range is a range of at least one frame image sequence continuous before and after the image to be detected.
[0011] In an embodiment shown, the first similarity score threshold is determined based on the similarity score of each frame image in the image neighborhood corresponding to the image to be detected, including:
[0012] Determine the highest similarity score among the similarity scores between each frame image in the vicinity of the image and the image to be detected;
[0013] The product of the highest similarity score and a preset first scoring coefficient is calculated to obtain the first similarity scoring threshold; wherein the first scoring coefficient is a natural number between 0 and 1.
[0014] In an embodiment shown, the method further includes:
[0015] Determining whether the highest similarity score reaches a preset threshold;
[0016] If the highest similarity score does not reach the preset threshold, the loop detection for the image to be detected is terminated.
[0017] In an illustrated embodiment, the step of selecting, from the images preceding the image to be detected in the image sequence, an image whose similarity score with the image to be detected reaches a first similarity score threshold, includes:
[0018] From the images in the above-mentioned image sequence that are located in the loop image detection range corresponding to the above-mentioned image to be detected, images whose similarity scores with the above-mentioned image to be detected reach the above-mentioned first similarity score threshold are screened out; wherein the above-mentioned loop image detection range is a sequence range from the first frame image in the above-mentioned image sequence to the image in the above-mentioned image sequence that is located before the above-mentioned image to be detected and is more than a preset number of frames away from the above-mentioned image to be detected.
[0019] In an embodiment shown, determining the loop closure image candidate set corresponding to the image to be detected, and determining whether the loop closure image candidate set corresponding to at least one continuous frame of image before the image to be detected includes the image before the common image, further includes:
[0020] The images satisfying the continuity condition in each frame image included in the above loop image candidate set are respectively combined to divide each frame image included in the above loop image candidate set into a plurality of groups; wherein the above continuity condition refers to images in which the number of matching pairs of image features between the images reaches a preset threshold;
[0021] Images whose similarity scores in each group reach a third similarity score threshold are screened out, and images in the above loop image candidate set are replaced with the screened images.
[0022] In an embodiment shown, the method further includes:
[0023] Determine the highest similarity score among the similarity scores between each frame image in each of the above groups and the above image to be detected;
[0024] The product of the highest similarity score and the preset second scoring coefficient is calculated respectively to obtain the third similarity scoring threshold corresponding to each group; wherein the second scoring coefficient is a natural number between 0 and 1.
[0025] In an embodiment shown, the method further includes:
[0026] Count the number of images in each group corresponding to the above grouping;
[0027] Comparing the number of images in each group corresponding to each group with a preset first security threshold one by one;
[0028] If the number of images in the group corresponding to any group does not reach the first safety threshold, all images in the group are deleted.
[0029] In an illustrated embodiment, the method further comprises:
[0030] If, after filtering out images whose similarity scores reach the third similarity score threshold, the number of remaining images in any group is lower than the preset second safety threshold, the entire group of images of the group is deleted.
[0031] In an illustrated embodiment, a system applying the method includes a common image set for storing common images included in a loop image candidate set corresponding to at least one continuous frame image before a current frame image to be detected;
[0032] The determining whether the loop closure image candidate set corresponding to the image to be detected has a common image with the loop closure image candidate sets corresponding to at least one continuous frame of image before the image to be detected, comprises:
[0033] determining whether the common image set includes any image;
[0034] If the common image set includes any image, determining whether the common image set and the loop image candidate set corresponding to the image to be detected include the common image;
[0035] If the common image set and the loop image candidate set corresponding to the image to be detected include any common image, it is determined that the loop image candidate set corresponding to the image to be detected and the loop image candidate sets corresponding to at least one continuous frame of image before the image to be detected have common images.
[0036] In an illustrated embodiment, the system further comprises a counter indicating the number of times the common image set is updated;
[0037] If there is a common image, determining the common image as a loop image corresponding to the image to be detected includes:
[0038] Using the common images in the common image set and the loop image candidate set corresponding to the image to be detected to cover the original images in the common image set, so as to update the common image set;
[0039] Increasing the count of the counter by 1;
[0040] Determine whether the count of the counter reaches a preset number of iterations;
[0041] If the count of the counter reaches a preset number of iterations, the image included in the common image set is determined as the loop image corresponding to the image to be detected.
[0042] In an embodiment shown, determining the common image as a loop image corresponding to the image to be detected includes:
[0043] Performing geometric verification on the shared image and the image to be detected;
[0044] If the verification is successful, it is determined that the shared image is a loop image corresponding to the image to be detected.
[0045] According to a second aspect of an embodiment of the present application, the present application provides a loop detection device, the device comprising:
[0046] A first screening module is configured to screen out images whose similarity scores with the image to be detected reach a first similarity score threshold from images preceding the image to be detected in the image sequence to be detected, and to create a loop image candidate set corresponding to the image to be detected based on the screened images;
[0047] A loop closure image determination module is used to determine whether a loop closure image candidate set corresponding to the image to be detected has a common image with loop closure image candidate sets corresponding to at least one consecutive frame of image before the image to be detected;
[0048] If there is a common image, the common image is determined as a loop image corresponding to the image to be detected.
[0049] In one embodiment shown, the above device further includes:
[0050] A similarity scoring module is determined to determine the first similarity scoring threshold based on the similarity scores of each frame image in the image proximity range corresponding to the image to be detected; wherein the image proximity range is a range of at least one frame image sequence continuous before and after the image to be detected.
[0051] In an embodiment shown, the first similarity score threshold is determined based on the similarity score of each frame image in the image neighborhood corresponding to the image to be detected, including:
[0052] Determine the highest similarity score among the similarity scores between each frame image in the vicinity of the image and the image to be detected;
[0053] The product of the highest similarity score and a preset first scoring coefficient is calculated to obtain the first similarity scoring threshold; wherein the first scoring coefficient is a natural number between 0 and 1.
[0054] In one embodiment shown, the above device further includes:
[0055] Determining whether the highest similarity score reaches a preset threshold;
[0056] If the highest similarity score does not reach the preset threshold, the loop detection for the image to be detected is terminated.
[0057] In an illustrated embodiment, the step of selecting, from the images preceding the image to be detected in the image sequence, an image whose similarity score with the image to be detected reaches a first similarity score threshold, includes:
[0058] From the images in the above-mentioned image sequence that are located in the loop image detection range corresponding to the above-mentioned image to be detected, images whose similarity scores with the above-mentioned image to be detected reach the above-mentioned first similarity score threshold are screened out; wherein the above-mentioned loop image detection range is a sequence range from the first frame image in the above-mentioned image sequence to the image in the above-mentioned image sequence that is located before the above-mentioned image to be detected and is more than a preset number of frames away from the above-mentioned image to be detected.
[0059] In an embodiment shown, determining the loop closure image candidate set corresponding to the image to be detected, and determining whether the loop closure image candidate set corresponding to at least one continuous frame of image before the image to be detected includes the image before the common image, further includes:
[0060] The images satisfying the continuity condition in each frame image included in the above loop image candidate set are respectively combined to divide each frame image included in the above loop image candidate set into a plurality of groups; wherein the above continuity condition refers to images in which the number of matching pairs of image features between the images reaches a preset threshold;
[0061] Images whose similarity scores in each group reach a third similarity score threshold are screened out, and images in the above loop image candidate set are replaced with the screened out images.
[0062] In one embodiment shown, the above device further includes:
[0063] Determine the highest similarity score among the similarity scores between each frame image in each of the above groups and the above image to be detected;
[0064] The product of the highest similarity score and the preset second scoring coefficient is calculated respectively to obtain the third similarity scoring threshold corresponding to each group; wherein the second scoring coefficient is a natural number between 0 and 1.
[0065] In one embodiment shown, the above device further includes:
[0066] A statistics module is used to count the number of images in each group.
[0067] A comparison module, comparing the number of images in each group corresponding to each group with a preset first security threshold one by one;
[0068] The deleting module deletes all images in any group if the number of images in the group corresponding to the group does not reach the first safety threshold.
[0069] In one embodiment shown, the device further comprises:
[0070] If, after filtering out images whose similarity scores reach the third similarity score threshold, the number of remaining images in any group is lower than the preset second safety threshold, the entire group of images of the group is deleted.
[0071] In an illustrated embodiment, a system applying the method includes a common image set for storing common images included in a loop image candidate set corresponding to at least one continuous frame image before a current frame image to be detected;
[0072] The loop closure image determination module comprises:
[0073] determining whether the common image set includes any image;
[0074] If the common image set includes any image, determining whether the common image set and the loop image candidate set corresponding to the image to be detected include the common image;
[0075] If the common image set and the loop image candidate set corresponding to the image to be detected include any common image, it is determined that the loop image candidate set corresponding to the image to be detected and the loop image candidate sets corresponding to at least one continuous frame of image before the image to be detected have common images.
[0076] In an illustrated embodiment, the system further comprises a counter indicating the number of times the common image set is updated;
[0077] The loop image determination module further includes:
[0078] Using the common images in the common image set and the loop image candidate set corresponding to the image to be detected to cover the original images in the common image set, so as to update the common image set;
[0079] Increasing the count of the counter by 1;
[0080] Determine whether the count of the counter reaches a preset number of iterations;
[0081] If the count of the counter reaches a preset number of iterations, the image included in the common image set is determined as the loop image corresponding to the image to be detected.
[0082] In an embodiment shown, determining the common image as a loop image corresponding to the image to be detected includes:
[0083] Performing geometric verification on the shared image and the image to be detected;
[0084] If the verification is successful, it is determined that the shared image is a loop image corresponding to the image to be detected.
[0085] According to a third aspect of the embodiments of the present application, the present application proposes a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute any of the loop detection methods of the first aspect.
[0086] According to a fourth aspect of an embodiment of the present application, a loop detection device is provided, the device comprising: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to call the executable instructions stored in the memory to implement any one of the loop detection methods of the first aspect.
[0087] It can be seen from the above technical solution that the method determines the common image of the loop image candidate set corresponding to the current frame image (for example: at least the first frame image) and the loop image candidate sets corresponding to at least one consecutive frame image before the frame image (for example: the N-1th frame image, the N-2th frame image, and the N-3th frame image) as the loop image corresponding to the current frame image.
[0088] Therefore, on the one hand, if the current frame image itself is abnormal, its corresponding loop image candidate set will not have a common image with the loop image candidate set corresponding to at least one frame image before the frame image. At this time, the loop relationship of the current abnormal frame will not be introduced in the process of calculating the camera trajectory, thereby avoiding the introduction of an erroneous loop relationship due to the abnormality of the current frame itself, and improving the accuracy of the loop detection result.
[0089] On the other hand, when determining the above-mentioned loop closure image, the correlation relationship between the current image to be detected and at least one frame of image before it can be combined to determine a more accurate loop closure image, so that a more accurate camera pose and camera motion trajectory can be determined based on the above-mentioned loop closure image, thereby improving the accuracy and robustness of three-dimensional reconstruction.
[0090] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] In order to more clearly illustrate the technical solutions in one or more embodiments of the present application or related technologies, the drawings required for use in the embodiments or related technology descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in one or more embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0092] Figure 1 A dictionary structure diagram in the form of a K-ary tree shown in this application;
[0093] Figure 2 A method flow chart of a loop detection method shown in this application;
[0094] Figure 3 A method flow chart of a loop detection method shown in this application;
[0095] Figure 4 A method flow chart of a method for determining an adaptive similarity score threshold value shown in the present application;
[0096] Figure 5 A method flow chart of a loop closure image screening method shown in the present application;
[0097] Figure 6 A structural diagram of a loop detection device shown in this application;
[0098] Figure 7 The following is a hardware structure diagram of a loop detection device shown in this application. DETAILED DESCRIPTION
[0099] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of the present application, the technical solutions in one or more embodiments of the present application will be clearly and completely described below in conjunction with the drawings in one or more embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on one or more embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0100] In the field of computer vision technology, Structure from Motion (SfM) is a commonly used 3D reconstruction technology. This technology can determine the camera pose corresponding to each frame by analyzing the image sequence. After determining the camera pose, the camera motion trajectory can be determined based on the camera pose corresponding to at least one continuous frame of images, and the scene can be reconstructed in 3D based on the motion trajectory.
[0101] The above-mentioned motion trajectory usually needs to be determined based on the camera pose corresponding to at least one continuous frame of images. On the one hand, each frame of the above-mentioned continuous frames will cause a certain error in the camera pose due to reasons such as light and camera parameters; on the other hand, the camera pose corresponding to the next frame of images is usually estimated based on the pose of the previous frame of images. Therefore, when determining the camera motion trajectory based on the camera pose corresponding to at least one continuous frame of images, it may easily lead to error accumulation, resulting in the problem of low accuracy and poor robustness of the final determined camera pose.
[0102] In practical applications, in order to eliminate the above-mentioned cumulative error, a loop closure image corresponding to the frame image can usually be determined in at least one frame image before the current frame. The so-called loop closure image may refer to an image whose similarity score with the current frame image reaches a score threshold in at least one frame image before the current frame. After determining the loop closure image corresponding to the frame image, the camera pose of the determined current frame image can be corrected based on the determined loop closure image.
[0103] The process of determining the loop image corresponding to the frame image in at least one frame image before the current frame can be called loop detection. The corresponding relationship between the frame image and the loop image can be called a loop relationship.
[0104] For example, if SfM outputs an image sequence with 100 consecutive frames, the similarity scores between the 10th to 15th frames and the 100th frame exceed the score threshold. At this time, the 10th to 15th frames can be called the loop closure images corresponding to the 100th frame. After determining the loop closure image corresponding to the 100th frame, the camera pose corresponding to the 100th frame can be corrected based on the 10th to 15th frames.
[0105] In the above method, since the position of the above loop closure image in the above image sequence is usually relatively forward, the corresponding camera pose is usually less affected by the error; therefore, the camera pose corrected based on the loop closure image will also be relatively accurate, thereby achieving the purpose of eliminating the above cumulative error as a whole.
[0106] Through the above analysis process, it is not difficult to find that if you need to obtain a 3D reconstruction result with high accuracy and good robustness, you need to first obtain a motion trajectory with high accuracy and good robustness; and to obtain a camera trajectory with high accuracy and good robustness, you need to determine a relatively accurate camera pose, and determining a relatively accurate camera pose depends on the correct loop detection results.
[0107] It can be seen that in the three-dimensional reconstruction in the field of computer vision technology, obtaining accurate loop detection results through loop closure detection helps to improve the accuracy and robustness of three-dimensional reconstruction.
[0108] In a related technology, in order to determine the loop image corresponding to the current frame image in the image sequence, each frame image in the interval from the first frame image of the image sequence to the previous frame image of the current frame image can be directly matched with the current frame image in terms of image features (e.g., SIFT features). Then, the number of image feature pairs that match between the two frames of images is calculated, and the ratio of the number of image feature pairs that match to the number of image features of the current frame image is determined as the similarity score between each frame image and the current frame image.
[0109] After determining the similarity scores between each frame image and the current image, the above similarity scores can be matched with a preset score threshold, and the image whose similarity score reaches the above score threshold is determined as the loop image corresponding to the current frame image.
[0110] In the above technical solution, since the process of directly matching the image features of each frame image usually requires a relatively large amount of calculation and is very time-consuming; therefore, adopting the above method will result in very low loop detection efficiency.
[0111] In order to improve the efficiency and accuracy of loop closure detection, in another related technology, another method of calculating the similarity score of each frame image based on the bag-of-words tree (hereinafter referred to as the bag-of-words tree method) is proposed.
[0112] First, a dictionary (e.g., a dictionary in the form of a K-ary tree) can be constructed based on the feature description subsets included in the image sequence. After the dictionary is constructed, the number of words included in each frame image can be determined based on each word included in the dictionary (e.g., a leaf node of the K-ary tree) and the feature descriptors of each frame image, and a corresponding word vector can be constructed.
[0113] Then, based on the word vectors corresponding to each frame image, determine the similarity score between each frame image before the current frame image and the current frame image;
[0114] Finally, the above-mentioned similarity scores can be matched with a preset score threshold, and the image whose similarity score reaches the above-mentioned score threshold is determined as the loop image corresponding to the current frame image.
[0115] See also Figure 1 , Figure 1 This is a dictionary structure diagram in the form of a K-ary tree shown in this application. Figure 1 As shown, when constructing a dictionary, a K-ary tree can be constructed. The K-ary tree has D layers, where the nth layer has K n The leaf node layer stores words. When constructing the K-ary tree, the number of layers of the K-ary tree (the size of the D value) and the number of child nodes connected to each node of the K-ary tree (the size of the K value) can be specified first.
[0116] Then, the feature description subset included in the image sequence (corresponding to the root node of the K-ary tree) is clustered by a clustering algorithm (e.g., k-means or K-means++) and divided into K categories (each category corresponds to a node in the first layer of the K-ary tree). Then, the clustering algorithm is continued for each category to be divided into K subcategories. Repeat the above steps until the K-ary tree is established. At this time, the feature description subset included in the leaf node of the above K-ary tree can be used as a word in the dictionary. When searching for a word, it can be searched layer by layer based on the K-ary tree, and the search efficiency is high.
[0117] It should be noted that the dictionary may be in other forms, and the clustering algorithm may be other algorithms. The above is only an example description and is not limited here.
[0118] After the K-ary tree dictionary is constructed, a word vector description can be performed for each frame image in the image sequence based on the dictionary.
[0119] For example, 256 words are determined based on the features of each image in the image sequence, and a dictionary in the form of a K-ary tree is constructed based on the 256 words. At this time, when constructing the word vector corresponding to each frame of image, the feature description subset included in each word can be determined based on the dictionary. Then, according to the feature descriptors included in each frame of image, the number corresponding to each word is determined. After determining the number of words corresponding to each frame of image, a 256-dimensional word vector F = {(a1, word 1), (a2, word 2), (a3, word 3), ... (ai, word i) ..., (a256, word 256)} can be constructed for each frame of image; where ai can represent the number of i-th words included in each frame of image.
[0120] After the word vectors corresponding to each frame image are constructed, when determining the loop image corresponding to the current frame image, the similarity score between each frame image before the current frame image and the current frame image can be determined first. Specifically, the Euclidean distance between the word vector of each frame image and the word vector of the current frame image can be calculated. After calculating the Euclidean distance, the calculated Euclidean distance can be used as the similarity score of the two frames, thereby obtaining the similarity score between each frame image before the current frame image and the current frame image.
[0121] It should be noted that the calculation method of the above similarity score can also be a calculation method based on the weight of each word (in this case, ai represents the weight of the i-th word included in each frame image) (please refer to the relevant technology for the specific process), which is not particularly limited here.
[0122] After determining the similarity score between each frame image before the current frame image and the current frame image, the above similarity scores can be matched with a preset score threshold, and the image whose similarity score reaches the above score threshold is determined as the loop image corresponding to the current frame image.
[0123] Based on the above-described scheme of calculating the similarity score of each frame image by using the bag-of-words tree, when calculating the similarity score between images, the direct matching of image features is replaced by calculating the Euclidean distance of word vectors, thereby simplifying the calculation complexity and greatly improving the detection efficiency of loop detection;
[0124] However, on the one hand, when determining the loop closure image corresponding to the current frame image, it still only uses the image whose similarity score with the current frame image reaches the first similarity score threshold as the above loop closure image, and does not combine the association relationship between the current image to be detected and its previous and next frame images; therefore, assuming that the current frame image itself is an abnormal frame (for example, an abnormal image shot due to camera shake), then the loop closure image determined by the above bag-of-words tree method will also be an abnormal image. At this time, an erroneous loop relationship will be introduced in the loop closure detection;
[0125] On the other hand, the loop closure images detected by this method are not very accurate, resulting in poor robustness of the camera motion trajectory determined based on it and poor three-dimensional reconstruction effect.
[0126] Based on this, the present application proposes a loop detection method that avoids introducing erroneous loop relationships by combining the association relationship between the current image to be detected and its previous and subsequent frame images.
[0127] In implementation, when determining the loop image corresponding to the image to be detected, the image whose similarity score with the image to be detected reaches a first similarity score threshold can be first screened out from the images before the image to be detected in the image sequence to be detected, and a loop image candidate set corresponding to the image to be detected is created based on the screened images. The images in the image sequence to be detected are sequentially determined as the images to be detected.
[0128] After obtaining the loop image candidate set corresponding to the image to be detected, it can be determined whether the loop image candidate set corresponding to the image to be detected and the loop image candidate sets corresponding to at least one continuous frame of image before the image to be detected include a common image. The common image is an image whose similarity score reaches the second similarity score threshold.
[0129] If so, the shared image may be determined as a loop image corresponding to the image to be detected.
[0130] It can be seen from the above technical solution that this method determines the loop image corresponding to the current frame image as the common image of the loop image candidate set corresponding to the current frame image and the loop image candidate set corresponding to at least one consecutive frame image before the frame image;
[0131] On the one hand, for the corresponding loop image candidate set, the loop image candidate set corresponding to at least one continuous frame image before the frame image does not have an abnormal frame with a common image, and its loop relationship will not be introduced into the process of calculating the camera trajectory, thereby avoiding the introduction of an erroneous loop relationship due to the abnormality of the current frame itself, and improving the correctness of the loop detection result;
[0132] On the other hand, by combining the correlation between the current image to be detected and its previous and subsequent frame images to detect the loop image, the detection accuracy of the loop image can be improved, so that a more accurate camera pose and camera motion trajectory can be determined based on the loop image, thereby improving the accuracy and robustness of three-dimensional reconstruction.
[0133] The loop detection method described in this application is described in detail below in conjunction with specific embodiments.
[0134] Embodiment 1
[0135] See also Figure 2 , Figure 2 A flow chart of a loop detection method shown in the present application.
[0136] like Figure 2 As shown, the method includes:
[0137] S201, screening out images whose similarity scores with the image to be detected reach a first similarity score threshold from images preceding the image to be detected in the image sequence to be detected, and creating a loop image candidate set corresponding to the image to be detected based on the screened images.
[0138] S202, determining whether the loop image candidate set corresponding to the image to be detected has a common image with the loop image candidate set corresponding to at least one consecutive frame of image before the image to be detected, wherein the common image is an image whose similarity score reaches a second similarity score threshold.
[0139] S203: If there is a common image, determine the common image as a loop image corresponding to the image to be detected.
[0140] The above-mentioned image sequence to be detected specifically refers to an image sequence output during the SfM process that needs to be subjected to loop closure detection.
[0141] For example, when performing SfM, it is usually necessary to calculate the camera's pose and motion trajectory based on the image sequence it outputs. In order to obtain accurate pose and motion trajectory, it is usually necessary to perform loop detection on the images in the above image sequence to correct the camera's pose and motion trajectory. In this case, the above image sequence is the image sequence to be detected.
[0142] The above-mentioned image to be detected specifically refers to the image in the above-mentioned image sequence to be detected that is confirmed as the image that currently needs to be loop-closed detected. When determining the image to be detected, the images in the above-mentioned image sequence to be detected can be determined as the above-mentioned image to be detected in sequence. For example, it is assumed that the above-mentioned sequence to be detected is a sequence of 100 consecutive frames. When determining the image to be detected, the current frame image can be determined as the above-mentioned image to be detected in sequence from the first frame image to the 100th frame image, and the above-mentioned S201-S203 are performed for each image to be detected.
[0143] The first similarity scoring threshold can be a fixed threshold pre-specified based on development experience, or a self-adaptive threshold calculated based on a certain algorithm (the above algorithm is specifically described in Example 2). For example, when determining the first similarity scoring threshold, a fixed threshold (for example, 0.9) can be used as the first similarity scoring threshold based on development experience. Alternatively, a set of algorithms can be designed so that the first similarity scoring threshold can change according to the changes in the image to be detected, and a first similarity scoring threshold that is more suitable for the current image to be detected is determined, thereby determining a candidate set of loop images that better matches the current image to be detected.
[0144] The above-mentioned loop image candidate set specifically refers to a set of images whose similarity scores with the above-mentioned image to be detected reach a first similarity score threshold value from the images located before the image to be detected in the image sequence to be detected. For example, assuming that the above-mentioned sequence to be detected is a sequence of 100 consecutive frames, the image to be detected is the 50th frame image, and the above-mentioned first similarity score threshold value is 0.9. After the images of frames 1-49 in the sequence to be detected are respectively calculated for similarity scores with the 50th frame image, the similarity scores obtained are 0.9 for frames 1-5, frames 11-15, and frames 45-49. At this time, the images included in the above-mentioned loop image candidate set are frames 1-5, frames 11-15, and frames 45-49.
[0145] The above-mentioned shared images specifically refer to images included in several image sets whose similarity scores reach the second similarity score threshold. When the above-mentioned second similarity score threshold is full score, the above-mentioned shared images may refer to the same images shared by several image sets.
[0146] For example, assuming that the sequence to be detected is a sequence of 100 consecutive frames, and the images to be detected are the 50th, 51st, and 52nd frames, the corresponding loop image candidate sets are A, B, and C. When determining the common images included in the above sets A, B, and C, the similarity between the images in A and the images in B can be calculated first, and then the images whose calculated similarity scores reach the above second similarity score threshold are grouped into set D. Then the similarity between the images in D and the images in C is calculated. At this time, the images whose similarity scores reach the above second similarity score threshold are the common images of the above sets A, B, and C. It can be understood that when the above second similarity score threshold is full, the above common images refer to the same images shared by the above A, B, and C. The method for determining the above second similarity score threshold can refer to the method for determining the above first similarity score threshold, which will not be described here.
[0147] The implementation steps of Example 1 are described in detail below.
[0148] Before performing loop detection, the image to be detected can be determined from the image sequence to be detected. In one embodiment, each image can be determined as the above-mentioned image to be detected in sequence according to the arrangement order of the images in the image sequence to be detected. For example, assuming that the above-mentioned sequence to be detected is a sequence of 100 consecutive frames, when the 50th frame image completes S201-S203, the 51st frame image can be used as the image to be detected next.
[0149] Of course, it can be understood by those skilled in the art that, assuming that the loop detection process of the current image to be detected is terminated by the program, the next frame image of the current image to be detected can also be used as the image to be detected to continue to execute S201-S203. For example, assuming that the above sequence to be detected is a sequence of 100 consecutive frames. When the 50th frame image is executed in S202, the loop image candidate set corresponding to the frame image and the loop image candidate set corresponding to at least one consecutive frame image before the frame image do not include any common images, then the loop detection for the 50th frame image can be terminated, and the 51st frame image can continue to be used as the image to be detected to execute S201-S203.
[0150] After determining the image to be detected, S201 can be executed to filter out images whose similarity scores with the image to be detected reach a first similarity score threshold from the images before the image to be detected in the image sequence to be detected, and create a loop image candidate set corresponding to the image to be detected based on the filtered images.
[0151] When executing this step, the loop closure image detection range corresponding to the image to be detected can be determined first.
[0152] In one embodiment, the loop image detection range can be determined from the first frame image of the sequence to be detected to the previous frame image of the image to be detected. For example, the image to be detected is the 50th frame image. At this time, the corresponding loop image detection range is the 1st to 49th frame image.
[0153] In another embodiment, in order to improve the loop detection effect, when determining the loop image detection range, the sequence range from the first frame image in the above image sequence to the image in the above image sequence that is located before the above image to be detected and is more than the preset frame number away from the above image to be detected can be determined as the above loop image detection range. For example, the above preset frame number is 5, and the image to be detected is the 50th frame image. At this time, the corresponding loop image detection range can be the 1st to 45th frame images.
[0154] Since the determined loop closure image detection range does not include images within the above-mentioned preset frame number range adjacent to the current image to be detected, the loop closure image determined in the loop closure image detection range will not include images adjacent to the current image to be detected. At this time, when determining the loop closure image corresponding to the image to be detected, it can be avoided that the determined loop closure image is too close to the image to be detected, which leads to a large error in the revised camera pose, thereby achieving a better loop detection effect.
[0155] After the loop closure image detection range is determined, the similarity score between each frame image within the loop closure image detection range and the image to be detected can be calculated based on a preset similarity scoring algorithm.
[0156] In one embodiment, the preset similarity scoring algorithm may be an image feature matching method. In practical applications, the following steps may be performed in sequence starting from the first frame image within the loop image detection range and ending with the last frame image: S2011, calculating the image features (e.g., SIFT features) included in the image within the loop image detection range and the current image to be detected, and constructing a feature vector. S2012, calculating the distance (e.g., Euclidean distance) between the image features included in the two images. S2013, determining the number of matching pairs whose distance is less than a reference threshold among the image features included in the two images. S2014, calculating the ratio of the number of matching pairs to the number of image features of the current image to be detected, and calculating the ratio according to the mapping algorithm to obtain the similarity score of the two images.
[0157] For example, the image to be detected includes 100 image features. Through the above image feature matching method, it is determined that the number of feature matching pairs between image A and the above image to be detected is 90, and the similarity score between image A and the above image to be detected is 0.9.
[0158] In another embodiment, the above-mentioned preset similarity scoring algorithm may be a similarity scoring algorithm based on the above-mentioned bag-of-words tree method (for specific steps, please refer to the above-mentioned content related to the bag-of-words tree method, which will not be repeated here). It should be noted that the above-mentioned image feature matching method and the above-mentioned similarity scoring algorithm based on the above-mentioned bag-of-words tree method are only exemplary similarity scoring algorithms. In practical applications, other algorithms for calculating similarity scores (for example, similarity scoring algorithms based on neural networks or deep learning, etc.) can also be used as the above-mentioned preset similarity scoring algorithm, which is not limited here.
[0159] After calculating the similarity score between each frame image within the loop closure image detection range and the image to be detected, the similarity score between each frame image within the loop closure image detection range and the image to be detected can be compared with a first similarity score threshold; and the images whose similarity scores reach the first similarity score threshold are formed into a loop closure image candidate set corresponding to the image to be detected.
[0160] So far, the loop image candidate set corresponding to the above-mentioned image to be detected has been determined through step S201.
[0161] After the loop image candidate set corresponding to the image to be detected is determined, S202-S203 may be continued to determine whether the loop image candidate set corresponding to the image to be detected has a common image with the loop image candidate sets corresponding to at least one consecutive frame of image before the image to be detected. If so, the common image is determined as the loop image corresponding to the image to be detected.
[0162] In one embodiment, when executing the above S202, the candidate sets of loop closure images corresponding to at least one continuous frame image before the above image to be detected can be first obtained. For example, in one case, the candidate sets of loop closure images corresponding to the above at least one continuous frame image are pre-stored in the storage medium of the loop detection system. At this time, when obtaining the above set, the above set can be read from the above medium. In another case, the candidate sets of loop closure images corresponding to the above at least one continuous frame image need to be calculated. At this time, when obtaining the above set, the above set corresponding to at least one continuous frame image can be calculated based on the algorithm (image feature matching method or other algorithm) for calculating the similarity score used in the above S201.
[0163] After obtaining the loop closure image candidate sets corresponding to the at least one continuous frame of images, the common images between the loop closure image candidate sets corresponding to the image to be detected and the loop closure image candidate sets corresponding to the at least one continuous frame of images can be further determined.
[0164] In practical applications, two loop image candidate sets can be arbitrarily selected first, and the similarity scores between the images included in the two loop image candidate sets can be calculated based on a preset similarity scoring algorithm. Then, the images whose calculated similarity scores reach the second similarity scoring threshold are formed into a new set. After forming the new set, the new set and other loop image candidate sets can be subjected to the aforementioned steps until it is determined that the loop image candidate set corresponding to the image to be detected and the loop image candidate set corresponding to at least one continuous frame of images have a common image.
[0165] Here, it can be understood by those skilled in the art that when the second similarity score threshold is the full score of similarity that can be calculated by the similarity algorithm, the shared image is the same image shared by the loop image candidate set corresponding to the image to be detected and the loop image candidate set corresponding to the at least one continuous frame of image. For example, when the preset similarity algorithm is the image feature matching algorithm, the full score of similarity that can be calculated by the similarity algorithm is 1. At this time, when the second similarity score threshold is 1, the image selected based on the threshold is the same image shared by several image sets.
[0166] When determining whether the loop closure image candidate set corresponding to the above-mentioned image to be detected and the loop closure image candidate sets corresponding to at least one consecutive frame of images before the above-mentioned image to be detected include a common image, if the loop closure image candidate set corresponding to the above-mentioned image to be detected and the loop closure image candidate sets corresponding to at least one consecutive frame of images before the above-mentioned image to be detected include a common image, then the above-mentioned common image is determined as the loop closure image corresponding to the above-mentioned image to be detected.
[0167] For example, assuming that the image to be detected is the 52nd frame image, its corresponding loop image candidate set includes {1, 2, 3, 4, 5}, the loop image candidate set corresponding to the 51st frame includes {1, 2, 3, 4}, and the loop image candidate set corresponding to the 50th frame includes {3, 4}. At this time, based on the method described in the above embodiment, the common images included in the loop image candidate set corresponding to the 50th-52nd frames are {3, 4}, and the loop image corresponding to the 52nd frame image is determined to be {3, 4}.
[0168] In another embodiment, the loop detection system may maintain a common image set for storing common images included in the loop image candidate set corresponding to at least one continuous frame image before the current frame image to be detected, and a counter indicating the number of iterations of the common image set. Figure 3 , Figure 3 A method flow chart of a loop detection method shown in this application is as follows: Figure 3 As shown, the above steps S202-S203 may include:
[0169] S2021, determine whether the above-mentioned common image set includes any image. If not, the image in the loop image candidate set corresponding to the current image to be detected can be added to the above-mentioned common image set, and the count of the above-mentioned counter is updated to 0 (indicating that the current is the first calculation, and the number of iterations is 0). Then the loop detection process for the current image to be detected is terminated, and the above-mentioned loop detection step is performed on the next frame image of the frame. Here, it is not difficult for those skilled in the art to understand that if the above-mentioned common image set is an empty set, it can be explained that the current frame may be the first frame in the image sequence to be detected. Therefore, the loop image candidate set corresponding to the current frame image can be used as the above-mentioned common image set, thereby ensuring that the scheme can continue to be executed.
[0170] If, when executing S2021, the common image set includes a plurality of images, S2022 may be continued to be executed to determine whether the common image set and the loop image candidate set corresponding to the image to be detected include a common image.
[0171] If the common image set and the loop image candidate set corresponding to the image to be detected do not include any common image, S2023 can be continued to be executed, the image in the common set is deleted, and then the image in the loop image candidate set corresponding to the current image to be detected is added to the common image set, and the count of the counter is updated to 0, and then the loop detection process for the current image to be detected is terminated, and the loop detection is performed on the next frame image of this frame.
[0172] If the common image set and the loop image candidate set corresponding to the image to be detected include common images, S2024 may be executed to overwrite the original image of the common image set with the included common image to update the common image set. In addition, the count of the counter may be increased by 1.
[0173] Then, S2025 is further performed to determine whether the count of the counter exceeds the preset number of iterations. If so, the image in the common image set is determined as the loop image corresponding to the current frame image.
[0174] If not, the image to be detected is determined to be the next frame image of the current frame image, and S201 - S203 are continued.
[0175] It can be seen from the above technical solution that the method determines the common image of the loop image candidate set corresponding to the current frame image (for example: at least the first frame image) and the loop image candidate sets corresponding to at least one consecutive frame image before the frame image (for example: the N-1th frame image, the N-2th frame image, and the N-3th frame image) as the loop image corresponding to the current frame image.
[0176] Therefore, on the one hand, if the current frame image itself is abnormal, its corresponding loop image candidate set will not have a common image with the loop image candidate set corresponding to at least one frame image before the frame image. At this time, the loop relationship of the current abnormal frame will not be introduced in the process of calculating the camera trajectory, thereby avoiding the introduction of an erroneous loop relationship due to the abnormality of the current frame itself, and improving the accuracy of the loop detection result.
[0177] On the other hand, when determining the above-mentioned loop closure image, the correlation relationship between the current image to be detected and at least one frame of image before it can be combined to determine a more accurate loop closure image, so that a more accurate camera pose and camera motion trajectory can be determined based on the above-mentioned loop closure image, thereby improving the accuracy and robustness of three-dimensional reconstruction.
[0178] Embodiment 2
[0179] In the second embodiment, a method for determining an adaptive first similarity score threshold is provided for the first similarity score threshold disclosed in the first embodiment. The method determines the first similarity score threshold based on the similarity score of each frame image in the image neighborhood corresponding to the image to be detected, so that the determined first similarity score can be more accurate, so that when the loop image corresponding to the image to be detected is screened based on the first similarity score threshold, a more accurate loop image can be screened, further increasing the accuracy and robustness of three-dimensional reconstruction.
[0180] See also Figure 4 , Figure 4 This is a flow chart of a method for determining an adaptive similarity score threshold method shown in this application. Figure 4 As shown, S401, determine the highest similarity score among the similarity scores between each frame image in the vicinity of the above image and the above image to be detected.
[0181] S402: Calculate the product of the highest similarity score and a preset first scoring coefficient to obtain the first similarity scoring threshold, wherein the first scoring coefficient is a natural number between 0 and 1.
[0182] The above-mentioned image proximity range specifically refers to the range of at least one continuous image sequence before and after the above-mentioned image to be detected. In practical applications, the image proximity range can be formulated based on development experience. For example, assuming that the above-mentioned sequence to be detected is a sequence of 100 consecutive frames, and the image to be detected is the 50th frame image. At this time, when determining the image proximity range corresponding to the above-mentioned image to be detected, the range of the 5-frame image sequence before and after the above-mentioned frame image to be detected can be used as the above-mentioned image proximity range. That is, the 45th-49th and 51st-55th frame image sequences are the image proximity range.
[0183] The first scoring coefficient may be a natural number between 0 and 1 manually specified based on development experience, or may be derived by the loop detection system based on machine learning, which is not limited here.
[0184] The execution steps of S401 - S402 are described in detail below.
[0185] When executing S401, the image proximity range corresponding to the image to be detected may be confirmed first. In practical applications, the image sequence range of 5 frames before and after the image to be detected may be used as the image proximity range.
[0186] After determining the image proximity range, the similarity scores between the images within the image proximity range and the image to be detected may be obtained.
[0187] In practical applications, the similarity score may be pre-calculated and stored in the storage medium of the loop detection system. In this case, when obtaining the similarity score, it can be read from the storage medium. For example, when executing S201, the similarity score between the image in the vicinity of the image and the image to be detected can also be calculated and stored in the storage medium. In this case, when obtaining the similarity score, it can be read from the storage medium.
[0188] In one case, if the similarity score is not stored in advance, when obtaining the similarity score, the similarity score between the image in the vicinity of the image and the image to be detected can be directly calculated based on a preset similarity scoring algorithm.
[0189] After obtaining the similarity scores between the images within the vicinity of the image and the image to be detected, the highest similarity score among the similarity scores may be determined.
[0190] In practical applications, the above similarity scores may be sorted from large to small, and the similarity score ranked first may be used as the above highest similarity score.
[0191] After the highest similarity score is determined, S402 may be executed to calculate the product of the highest similarity score and a preset first score coefficient to obtain the first similarity score threshold.
[0192] The first similarity score threshold determined based on the above technical solution is determined based on the similarity scores of images in the vicinity of the current image to be detected, so as to be more adaptable to the actual situation. The candidate loop images screened by the similarity score will also be more accurate, further increasing the accuracy and robustness of 3D reconstruction.
[0193] It should be noted that the adaptive scoring threshold determination method disclosed in the above-mentioned embodiment 2 can be used together with any embodiment disclosed in the present application, and will not be described in detail here.
[0194] When the above-mentioned adaptive scoring threshold determination method is applied to the loop detection method shown in the first embodiment, it is also possible to determine whether the current image to be detected is an abnormal image by determining the above-mentioned highest similarity score. If the above-mentioned image to be detected is determined to be an abnormal image, the loop detection of the above-mentioned image to be detected can be terminated, thereby avoiding the introduction of erroneous loop relationships and affecting the three-dimensional reconstruction results.
[0195] In practical applications, after calculating the highest similarity score within the image neighborhood corresponding to the current image to be detected through S401, it can be further determined whether the above-mentioned highest similarity score reaches a preset threshold (which can be a value preset based on development experience or machine learning). If the above-mentioned highest similarity score does not reach the above-mentioned preset threshold, the loop detection for the above-mentioned image to be detected is terminated, and the next frame image of the image to be detected is used as the image to be detected to perform the corresponding loop detection step. If the above-mentioned highest similarity score reaches the above-mentioned preset threshold, the above-mentioned S402 is continued.
[0196] Based on this method, if the highest similarity score does not reach the preset threshold, it can be determined that the current frame image is not similar to at least one frame before and after it, and it may be an abnormal image. At this time, terminating the loop detection of the frame image can effectively avoid introducing an erroneous loop relationship, thereby improving the accuracy of the loop detection.
[0197] Embodiment 3
[0198] In the process of loop closure detection (including loop closure detection using related technologies or the technical solution disclosed in this application), after screening out images whose similarity scores with the images to be detected reach a similarity score threshold, and forming the above images into a loop closure image candidate set, in order to obtain more accurate loop closure images to increase the accuracy and robustness of the three-dimensional reconstruction results, the images in the above loop closure image candidate set can be further screened with higher accuracy.
[0199] See also Figure 5 , Figure 5 This is a flow chart of a method for loop closure image screening shown in this application. Figure 5 As shown, S501, the images satisfying continuity in each frame image included in the above loop image candidate set are respectively combined to divide each frame image included in the above loop image candidate set into a plurality of groups. The above images satisfying the continuity condition refer to a group of images satisfying that the number of image feature matching pairs between the images reaches a preset threshold.
[0200] S502, filtering out images in each group whose similarity scores reach a third similarity score threshold, and replacing the images in the above loop image candidate set with the filtered images.
[0201] The above-mentioned images satisfying continuity specifically refer to a group of images satisfying that the number of image feature matching pairs between the images reaches a preset threshold. In practical applications, if the images in a group of images are sorted according to the number of frames, and the number of image feature matching pairs between any two consecutive frames reaches a preset threshold, then the group of images can be called images satisfying continuity.
[0202] For example, assuming that the preset threshold is 70, and assuming that a group of images sorted by frame size includes 5 images {1, 2, 3, 4, 5}. At this time, if the number of matching image feature pairs calculated by the image feature matching method between the four pairs of images {1, 2}, {2, 3}, {3, 4}, and {4, 5} reaches 70, then the group of images is considered to meet the continuity requirement.
[0203] The third similarity scoring threshold can be a fixed threshold pre-specified based on development experience; or it can be a self-adaptive threshold calculated based on a certain algorithm. For example, when determining the third similarity scoring threshold, a fixed threshold (for example, 60) can be used as the third similarity scoring threshold based on development experience. It is also possible to design an algorithm (the algorithm is described in the subsequent content) so that the third similarity scoring threshold can be determined based on the images in each group to adapt to the third similarity scoring threshold for each group, thereby more accurately screening the images in each group to determine more accurate loop image candidate images.
[0204] When loop closure detection is performed on the image to be detected (including loop closure detection using related technologies or the technical solution disclosed in the present application), after images whose similarity scores with the image to be detected reach a similarity score threshold are screened out and the above images are formed into a loop closure image candidate set, S501 can be executed.
[0205] When performing the above S501 to group images, the images in the loop image candidate set can be sorted according to the frame number. After the sorting is completed, the image with the smallest (or largest) sequence number can be used as the first image of the first group (for example, image A). Then, the number of matching image feature pairs corresponding to the image in the next order (for example, image B) is calculated based on the image feature matching method.
[0206] After calculating the number of matching image feature pairs, the number of matching image feature pairs can be compared with a preset threshold to determine whether the number of matching image feature pairs reaches the preset threshold. If so, it can be determined that the image A and the image B meet the continuity condition. At this time, the image B can be added to the first group, and the number of matching image feature pairs between the image B and the image in the next order (for example, image C) can be calculated.
[0207] When the number of matching image feature pairs is calculated, it can be determined whether the number of matching image feature pairs reaches a preset threshold. If so, it can be determined that the image B and the image C meet the continuity condition, and the image C is added to the first group, and it is continued to be determined whether the subsequent images meet the continuity condition.
[0208] If the number of matching image feature pairs corresponding to the above image B and the above image C does not reach the above preset threshold, it can be considered that image B and image C do not meet the continuity condition. At this time, it can be determined that the above first grouping has been completed, and a new group (for example, the second group) can be added, and the above image C is used as the first image of the above second group, and it is continued to determine whether the image in the next order (for example, image D) meets the continuity condition. And so on, until the images in the above loop image candidate set are grouped.
[0209] For example, suppose the loop image candidate set includes {A, B, C, D, E, F}, where A and B meet the above continuity condition, B and C do not meet the above continuity condition, C, D, and E meet the above continuity condition, and E and F do not meet the above continuity condition. At this time, the grouping results according to the above technical solution are three groups: {A, B}, {C, D, E}, and {F}.
[0210] After the grouping of the above loop closure image candidate set is completed, S502 may be continued to be executed to perform more accurate screening on the above groups.
[0211] When executing S502, the third similarity score threshold may be obtained first. In one case, the third similarity score threshold may be a static threshold preset based on development experience. At this time, when obtaining the third similarity score threshold, the threshold may be read from a storage medium storing the third similarity score threshold.
[0212] In another case, the third similarity score threshold is an adaptive threshold, and when obtaining the third similarity score threshold, it can be calculated based on an algorithm preset in the loop detection system. In one embodiment, the preset algorithm can be to first determine the highest similarity score among the similarity scores of each frame image in each of the above groups and the image to be detected. Then, the product of the highest similarity score and the preset second score coefficient is calculated respectively to obtain the third similarity score threshold corresponding to each group. Among them, the second score coefficient is a natural number between 0 and 1.
[0213] The second scoring coefficient may be a natural number between 0 and 1 manually specified based on development experience, or may be derived by the loop detection system based on machine learning, which is not limited here.
[0214] After determining the third similarity score threshold, S502 may be continued to screen out images in each group whose similarity scores reach the third similarity score threshold, and replace the images in the loop image candidate set with the screened images.
[0215] When executing the above steps, the similarity scores between the images in each group and the current image to be detected can be compared with the above third similarity score threshold corresponding to each group, and the images that reach the third similarity score are used as screened images to replace the images in the above loop image candidate set.
[0216] It can be seen from the above technical solution that since the third similarity score threshold is calculated based on the similarity score between the images within each group and the current image to be detected, it is more in line with the actual situation, thereby achieving a more accurate screening of the images in the loop image candidate set. Therefore, the above solution can obtain a more accurate loop image, increasing the accuracy and robustness of the 3D reconstruction result.
[0217] In one case, there may still be an erroneous candidate image in the loop image candidate set corresponding to the image to be detected. At this time, although the similarity score between the erroneous image and the image to be detected reaches the first similarity score threshold, the images before and after the erroneous image are not selected into the loop image candidate set. This means that the erroneous image may be an image that happens to meet the similarity score that reaches the first similarity score threshold, but is actually not closely related to the image to be detected.
[0218] In order to delete such erroneous images, in one embodiment, after the images in the loop image candidate set are grouped, the number of images in each group corresponding to the above group can be counted; and the number of images in each group corresponding to the above group can be compared with the preset first safety threshold one by one. If the number of images in the above group corresponding to any group does not reach the above first safety threshold, all images in the group are deleted.
[0219] The first safety threshold may be a threshold determined based on development experience or a machine learning algorithm. If the number of images in a group corresponding to a certain group is lower than the first safety threshold (for example, 2), it means that there is no image in the loop image candidate set that meets the continuity condition with the image in the group, which means that the image may be an erroneous loop image and needs to be deleted.
[0220] In another embodiment, when executing S502, if the number of remaining images in any group after filtering out images whose similarity scores reach the third similarity score threshold is lower than the preset second safety threshold, the images of the entire group are deleted.
[0221] The second safety threshold may be a threshold determined based on development experience or a machine learning algorithm. If the number of images remaining in a group after filtering out images whose similarity scores reach the third similarity score threshold is lower than the second safety threshold (e.g., 2), it means that the number of images that meet the continuity condition in the group is not large enough, and they may be wrong candidate images and need to be deleted.
[0222] It can be seen that the above method can be used to further screen the images in the above loop image candidate set with higher accuracy, so as to obtain more accurate loop images to increase the accuracy and robustness of the three-dimensional reconstruction results.
[0223] It should be noted that the method disclosed in the above-mentioned embodiment 3 can be used together with any embodiment disclosed in the present application, and will not be described in detail here.
[0224] Embodiment 4
[0225] In order to further obtain a more accurate loop closure image, a collective verification may be performed on the common images determined when executing S202, and the common images that have successfully been verified may be determined as the loop closure images corresponding to the above-mentioned image to be detected.
[0226] Specifically, if the loop image candidate set corresponding to the image to be detected and the loop image candidate sets corresponding to at least one continuous frame of image before the image to be detected respectively include a common image, the common image and the image to be detected can be geometrically checked;
[0227] If the verification is successful, it is determined that the shared image is a loop image corresponding to the image to be detected.
[0228] In the above technical solution, since the determined common image is geometrically checked and the successfully verified common image is used as the loop image corresponding to the image to be detected, the determined loop image is more accurate, thereby increasing the accuracy and robustness of the three-dimensional reconstruction result.
[0229] In practical applications, the following steps may be performed one by one on the shared images determined in step S202:
[0230] A number of matching image feature pairs corresponding to the common image and the image to be detected are randomly extracted, and based on the extracted matching image feature pairs, a relative posture transformation matrix (R, T matrix) corresponding to the common image and the image to be detected is calculated.
[0231] Then, based on the relative posture transformation matrix, determine whether the ratio of the number of image features that can be described by the relative posture transformation between the two images to the number of feature points included in the current frame image reaches the reference threshold. If so, it can be determined that the current shared image verification has passed; otherwise, it can be determined that the current shared image verification has failed.
[0232] It can be seen from the above scheme that since the determined common image is geometrically checked and the successfully verified common image is used as the loop image corresponding to the image to be detected, the determined loop image is more accurate, thereby increasing the accuracy and robustness of the three-dimensional reconstruction result.
[0233] It should be noted that the method disclosed in the above-mentioned fourth embodiment can be used together with any embodiment disclosed in the present application, and will not be described in detail here.
[0234] Embodiment 5
[0235] In the fifth embodiment, a loop detection method is shown, which can be applied to a loop detection system, in which a common image set and a counter can be maintained, wherein the counter indicates the number of iterations of the common image set.
[0236] Assume that the image sequence to be detected output in the SfM process includes 100 frames of images. Among them, the last 50 frames of the sequence are subjected to loop detection. At this time, when determining the loop image of the image to be detected, the above-mentioned common image set can be cleared first, and the above-mentioned counter is cleared to 0.
[0237] Then, starting from the 50th frame image, the current frame image is determined as the image to be detected, and the following steps are performed.
[0238] S601, determining an image neighborhood range and a loop detection range corresponding to the image to be detected.
[0239] S602, calculating the similarity score between each image in the image neighborhood range and the loop detection range and the image to be detected based on a similarity scoring algorithm in a bag-of-words tree manner.
[0240] S603: Determine the highest similarity score within the vicinity of the above image.
[0241] S604, determining whether the highest similarity score reaches a preset reference threshold. If not, terminating the loop detection operation of the current image to be detected, clearing the count of the common image set and the counter, and performing the loop detection operation of the next frame of image.
[0242] S605: If yes, then multiply the determined highest similarity score by a preset first score coefficient to obtain a first similarity score threshold.
[0243] S606: Screen out images whose similarity scores reach the first similarity score threshold in the loop detection range, and form a loop image candidate set corresponding to the image to be detected.
[0244] S607: For the images in the loop image candidate set, group the images that meet the continuity condition.
[0245] S608: For each group, determine the highest similarity score in each group, and multiply the highest similarity score by a preset second score coefficient to obtain a third similarity score threshold corresponding to each group.
[0246] S609: Delete the images in each group whose similarity scores reach the third similarity score threshold.
[0247] S610, determining whether the number of images remaining in each group reaches a safety threshold; if not, deleting the group of images.
[0248] S611: The images in the above loop image candidate set are replaced by the remaining images in the above groups.
[0249] S612, determining whether the common image set maintained by the current loop detection system includes any image. If not, adding the image in the above loop image candidate set to the above common image set, and updating the count in the above counter to 0, terminating the loop detection process of the current image to be detected.
[0250] S613: If the common image set includes any image, further determine whether the common image set and the loop image candidate set include a common image.
[0251] If not, the common image set is cleared, and the images in the loop image candidate set are added to the common image set. Then, the count in the counter is updated to 0, and the loop detection process of the current image to be detected is terminated;
[0252] S614: If the common image set and the loop image candidate set include common images, replace the images in the common image set with the included common images, and increase the count of the counter by 1.
[0253] S615, determining whether the count of the counter reaches a preset number of iterations. If not, continue to execute the above steps using the next frame of the current image to be detected as the image to be detected.
[0254] S616, if the count of the counter reaches the preset number of iterations, two-view set verification is performed on the images in the common image set and the current image to be detected, and the image that succeeds the verification is used as the loop image corresponding to the image to be detected.
[0255] At this point, the above loop detection method is completed.
[0256] In the above steps, on the one hand, the similarity scoring threshold preset based on development experience in the related art is replaced by the adaptive first similarity scoring threshold, so that the screened similar images are more accurate.
[0257] On the other hand, continuous images are grouped based on the determined loop image candidate set, and each group is screened more accurately to obtain more accurate candidate images.
[0258] On the other hand, since the above method can perform more accurate screening for each group, the images of the group whose remaining images are lower than the safety threshold can be deleted, thereby filtering out the wrong loop images.
[0259] On the other hand, since the method determines the loop image corresponding to the current frame image as the common image of the loop image candidate set corresponding to the current frame image and the loop image candidate sets corresponding to at least one consecutive frame image before the frame image, it can avoid introducing abnormal loop relationships and determine a more accurate loop image.
[0260] In summary, through the technical solution recorded in Example 5, an accurate loop closure image can be obtained, so that a more accurate camera pose and camera motion trajectory can be determined based on the above loop closure image, thereby improving the accuracy and robustness of three-dimensional reconstruction.
[0261] This application also proposes a loop detection device, see Figure 6 , Figure 6 FIG. 1 is a structural diagram of a loop detection device shown in this application. Figure 6 As shown, the device 600 includes,
[0262] The first screening module 610 screens out images whose similarity scores with the image to be detected reach a first similarity score threshold from images preceding the image to be detected in the image sequence to be detected, and creates a loop image candidate set corresponding to the image to be detected based on the screened images.
[0263] The loop image determination module 620 determines whether the loop image candidate set corresponding to the image to be detected has a common image with the loop image candidate set corresponding to at least one consecutive frame of image before the image to be detected, wherein the common image is an image whose similarity score reaches a second similarity score threshold.
[0264] If there is a common image, the common image is determined as a loop image corresponding to the image to be detected.
[0265] In one embodiment shown, the apparatus 600 further includes:
[0266] The similarity scoring module determines the first similarity scoring threshold based on the similarity scores of each frame image in the image proximity range corresponding to the image to be detected, wherein the image proximity range is a range of at least one frame image sequence before and after the image to be detected.
[0267] In an embodiment shown, the first similarity score threshold is determined based on the similarity score of each frame image in the image neighborhood corresponding to the image to be detected, including:
[0268] Determine the highest similarity score among the similarity scores between each frame image in the vicinity of the image and the image to be detected.
[0269] The product of the highest similarity score and a preset first scoring coefficient is calculated to obtain the first similarity scoring threshold, wherein the first scoring coefficient is a natural number between 0 and 1.
[0270] In one embodiment shown, the apparatus 600 further includes:
[0271] It is determined whether the highest similarity score reaches a preset threshold.
[0272] If the highest similarity score does not reach the preset threshold, the loop detection for the image to be detected is terminated.
[0273] In an illustrated embodiment, the step of selecting, from the images preceding the image to be detected in the image sequence, an image whose similarity score with the image to be detected reaches a first similarity score threshold, includes:
[0274] From the images in the image sequence that are located in the loop image detection range corresponding to the image to be detected, images whose similarity scores with the image to be detected reach the first similarity score threshold are screened out. The loop image detection range is a sequence range from the first frame image in the image sequence to the image in the image sequence that is located before the image to be detected and whose distance from the image to be detected exceeds a preset number of frames.
[0275] In an embodiment shown, determining the loop closure image candidate set corresponding to the image to be detected, and determining whether the loop closure image candidate set corresponding to at least one continuous frame of image before the image to be detected includes the image before the common image, further includes:
[0276] The images satisfying the continuity condition in each frame image included in the above loop image candidate set are respectively combined to divide each frame image included in the above loop image candidate set into a plurality of groups. The above continuity condition refers to images in which the number of matching pairs of image features between the images reaches a preset threshold.
[0277] Images whose similarity scores in each group reach a third similarity score threshold are screened out, and images in the above loop image candidate set are replaced with the screened images.
[0278] In one embodiment shown, the apparatus 600 further includes:
[0279] Determine the highest similarity score among the similarity scores between each frame image in each of the above groups and the above image to be detected.
[0280] The product of the highest similarity score and the preset second scoring coefficient is calculated respectively to obtain the third similarity score threshold corresponding to each group, wherein the second scoring coefficient is a natural number between 0 and 1.
[0281] In one embodiment shown, the apparatus 600 further includes:
[0282] The statistical module counts the number of images in each group corresponding to the above grouping.
[0283] The comparison module compares the number of images in each group corresponding to each group with a preset first security threshold one by one.
[0284] The deleting module deletes all images in any group if the number of images in the group corresponding to the group does not reach the first safety threshold.
[0285] In one embodiment shown, the device further comprises:
[0286] If, after filtering out images whose similarity scores reach the third similarity score threshold, the number of remaining images in any group is lower than the preset second safety threshold, the entire group of images of the group is deleted.
[0287] In an illustrated embodiment, a system applying the method includes a common image set for storing common images included in a loop image candidate set corresponding to at least one continuous frame image before a current frame image to be detected;
[0288] The loop image determination module 620 includes:
[0289] determining whether the common image set includes any image;
[0290] If the common image set includes any image, determining whether the common image set and the loop image candidate set corresponding to the image to be detected include the common image;
[0291] If the common image set and the loop image candidate set corresponding to the image to be detected include any common image, it is determined that the loop image candidate set corresponding to the image to be detected and the loop image candidate sets corresponding to at least one continuous frame of image before the image to be detected have common images.
[0292] In an illustrated embodiment, the system further comprises a counter indicating the number of times the common image set is updated;
[0293] The loop image determination module 620 further includes:
[0294] Using the common images in the common image set and the loop image candidate set corresponding to the image to be detected to cover the original images in the common image set, so as to update the common image set;
[0295] Increasing the count of the counter by 1;
[0296] Determine whether the count of the counter reaches a preset number of iterations;
[0297] If the count of the counter reaches a preset number of iterations, the image included in the common image set is determined as the loop image corresponding to the image to be detected.
[0298] In an embodiment shown, determining the common image as a loop image corresponding to the image to be detected includes:
[0299] The common image and the image to be detected are geometrically checked.
[0300] If the verification is successful, it is determined that the shared image is a loop image corresponding to the image to be detected.
[0301] The embodiments of the loop detection device shown in this application can be applied to loop detection equipment. The device embodiments can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the electronic device in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, such as Figure 7 As shown, it is a hardware structure diagram of a loop detection device shown in this application, except Figure 7 In addition to the processor, memory, network interface, and non-volatile memory shown, the electronic device in which the device in the embodiment is located may also include other hardware according to the actual function of the electronic device, which will not be described in detail.
[0302] Please refer to Figure 7 A loop detection device is shown, and the device includes: a processor.
[0303] Memory used to store processor-executable instructions.
[0304] The processor executes the executable instructions to implement the loop detection method as described in any of the above embodiments.
[0305] The present application proposes a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the loop detection method shown in any of the above embodiments.
[0306] Those skilled in the art will appreciate that one or more embodiments of the present application may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0307] The term “and / or” used in the present application indicates at least one of the two. For example, “A and / or B” includes three options: A, B, and “A and B”.
[0308] Each embodiment in the present application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the data processing device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0309] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0310] The embodiments of the subject matter and functional operations described in this application can be implemented in the following: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this application and their structural equivalents, or a combination of one or more of them. The embodiments of the subject matter described in this application can be implemented as one or more computer programs, i.e., one or more modules in computer program instructions encoded on a tangible non-temporary program carrier to be executed by a data processing device or to control the operation of the data processing device. Alternatively or additionally, the program instructions can be encoded on an artificially generated propagation signal, such as a machine-generated electrical, optical or electromagnetic signal, which is generated to encode information and transmit it to a suitable receiver device for execution by a data processing device. The computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
[0311] The processes and logic flows described in this application can 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 above processes and logic flows can also be performed by special-purpose logic circuits, such as FPGAs (field programmable gate arrays) or ASICs (application-specific integrated circuits), and the apparatus can also be implemented as special-purpose logic circuits.
[0312] Computers suitable for executing computer programs include, for example, general and / or special microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive 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 memory devices for storing instructions and data. Typically, the computer will also include one or more large-capacity storage devices for storing data, such as magnetic disks, magneto-optical disks, or optical disks, or the computer will be operably coupled to this large-capacity storage device to receive data from it or to transmit data to it, or both. However, the computer does not necessarily have such a device. In addition, the computer can be embedded in another device, such as 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 drive, to name a few.
[0313] Computer readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including, for example, semiconductor memory 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 processor and memory may be supplemented by, or incorporated in, special purpose logic circuitry.
[0314] Although the application includes many specific implementation details, these should not be interpreted as limiting any disclosed scope or the scope of protection claimed, but are mainly used to describe the features of specific disclosed specific embodiments. Certain features described in multiple embodiments in the application can also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment can also be implemented separately in multiple embodiments or implemented with any suitable sub-combination. In addition, although the feature can work as above-mentioned in some combinations and even initially claim protection, one or more features from the claimed combination can be removed from the combination in some cases, and the claimed combination can point to a variation of a sub-combination or a sub-combination.
[0315] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or requiring that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.
[0316] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired results. In some implementations, multitasking and parallel processing may be advantageous.
[0317] The above is only a preferred embodiment of one or more embodiments of the present application and is not intended to limit one or more embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present application should be included in the scope of protection of one or more embodiments of the present application.
Claims
1. A loop detection method, characterized in that: The method comprises: Screening out images whose similarity scores with the image to be detected reach a first similarity score threshold from images preceding the image to be detected in the image sequence to be detected, and creating a loop image candidate set corresponding to the image to be detected based on the screened images; Determine whether the loop image candidate set corresponding to the image to be detected has a common image with the loop image candidate sets corresponding to at least one consecutive frame of image before the image to be detected; wherein the common image is an image included in several image sets and whose similarity score reaches a second similarity score threshold; If there is a common image, the common image is determined as a loop image corresponding to the image to be detected.
2. The method according to claim 1, characterized in that The method further comprises: The first similarity score threshold is determined based on the similarity score of each frame image in the image neighborhood range corresponding to the image to be detected; wherein the image neighborhood range is a range of at least one frame image sequence continuous before and after the image to be detected.
3. The method according to claim 2, characterized in that The determining the first similarity score threshold based on the similarity score of each frame image in the image neighborhood range corresponding to the image to be detected includes: Determine the highest similarity score among similarity scores between each frame image in the image neighborhood and the image to be detected; The product of the highest similarity score and a preset first scoring coefficient is calculated to obtain the first similarity scoring threshold; wherein the first scoring coefficient is a natural number between 0 and 1.
4. The method according to claim 3, characterized in that The method further comprises: Determining whether the highest similarity score reaches a preset threshold; If the highest similarity score does not reach the preset threshold, the loop detection for the image to be detected is terminated.
5. The method according to any one of claims 1 to 4, characterized in that: The step of screening out, from images preceding the image to be detected in the sequence of images to be detected, images having a similarity score reaching a first similarity score threshold with the image to be detected comprises: From the images in the image sequence that are within the loop image detection range corresponding to the image to be detected, images whose similarity scores with the image to be detected reach the first similarity score threshold are screened out; wherein the loop image detection range is a sequence range from the first frame image in the image sequence to the image in the image sequence that is located before the image to be detected and has a frame number that exceeds a preset number with the image to be detected.
6. The method according to claim 1, characterized in that Determining the loop image candidate set corresponding to the image to be detected, and whether the loop image candidate set corresponding to at least one continuous frame of image before the image to be detected includes the image before the common image, further comprising: The images satisfying the continuity condition in each frame image included in the loop image candidate set are respectively combined to divide each frame image included in the loop image candidate set into a plurality of groups; wherein the continuity condition refers to images having a number of matching pairs of image features that match each other that reaches a preset threshold; Images whose similarity scores reach a third similarity score threshold in each group are screened out, and images in the loop image candidate set are replaced with the screened out images.
7. The method according to claim 6, characterized in that The method further comprises: Determine the highest similarity score among the similarity scores between each frame image in each group and the image to be detected; The product of the highest similarity score and a preset second scoring coefficient is calculated respectively to obtain the third similarity scoring threshold corresponding to each group; wherein the second scoring coefficient is a natural number between 0 and 1.
8. The method according to claim 6, characterized in that The method further comprises: Count the number of images in each group; Comparing the number of images in each group corresponding to each group with a preset first security threshold one by one; If the number of images in the group corresponding to any group does not reach the first safety threshold, all images in the group are deleted.
9. The method according to claim 6, characterized in that The method further comprises: If, after filtering out images whose similarity scores reach the third similarity score threshold, the number of remaining images in any group is lower than the preset second safety threshold, the entire group of images of the group is deleted.
10. The method according to claim 1, characterized in that The system applying the method comprises a common image set for storing common images included in a loop image candidate set corresponding to at least one continuous frame image before a current frame image to be detected; The determining whether the loop closure image candidate set corresponding to the image to be detected has a common image with the loop closure image candidate sets corresponding to at least one continuous frame of image before the image to be detected, comprises: determining whether the common image set includes any image; If the common image set includes any image, determining whether the common image set and the loop image candidate set corresponding to the image to be detected include the common image; If the common image set and the loop image candidate set corresponding to the image to be detected include any common image, it is determined that the loop image candidate set corresponding to the image to be detected and the loop image candidate sets corresponding to at least one continuous frame of image before the image to be detected have common images.
11. The method according to claim 10, characterized in that The system further comprises a counter indicating the number of times the common image set is updated; If there is a common image, determining the common image as a loop image corresponding to the image to be detected includes: Using the common images in the common image set and the loop image candidate set corresponding to the image to be detected to cover the original images in the common image set, so as to update the common image set; Add 1 to the count of the counter; Determine whether the count of the counter reaches a preset number of iterations; If the count of the counter reaches a preset number of iterations, the image included in the common image set is determined as the loop image corresponding to the image to be detected.
12. The method according to claim 1, characterized in that Determining the shared image as a loop image corresponding to the image to be detected includes: Performing geometric verification on the shared image and the image to be detected; If the verification is successful, it is determined that the shared image is a loop image corresponding to the image to be detected.
13. A loop detection device, characterized in that: The device comprises: A first screening module is configured to screen out images whose similarity scores with the image to be detected reach a first similarity score threshold from images preceding the image to be detected in the image sequence to be detected, and to create a loop image candidate set corresponding to the image to be detected based on the screened images; A loop closure image determination module is used to determine whether a loop closure image candidate set corresponding to the image to be detected has a common image with a loop closure image candidate set corresponding to at least one consecutive frame of image before the image to be detected; wherein the common image is an image whose similarity score reaches a second similarity score threshold; If there is a common image, the common image is determined as a loop image corresponding to the image to be detected.
14. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the loop detection method according to any one of claims 1 to 12.
15. An electronic device, characterized in that: The device comprises: processor; a memory for storing instructions executable by the processor; The processor is configured to call the executable instructions stored in the memory to implement the loop detection method according to any one of claims 1 to 12.
