Map updating method, device, terminal and storage medium
By using image feature matching and location information to update the map in indoor positioning technology, the problem of insufficient accuracy of point cloud normal features is solved and the accuracy and robustness of the map are improved.
Patent Information
- Application Number
- CN201910578745.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-28
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2039-06-28
AI Technical Summary
In existing indoor positioning technology, the accuracy of the normal features of point clouds is not high, resulting in low map accuracy and errors in calculating angular offsets and translation offsets.
By obtaining image features in the first map, matching corresponding feature points from the second map based on these features, and determining the location information of the image collection device, thereby adding key frame images in the first map to the second map , update the map to improve accuracy.
The accuracy and fusion accuracy of the map are improved, errors are reduced, and the robustness of map updates is enhanced.
Smart Images

Figure CN112148742B
Abstract
Description
Technical Field
[0001] The present application relates to indoor positioning technology, and is related to but not limited to a map updating method and device, a terminal, and a storage medium. Background Art
[0002] In the related art, a global map is constructed by the histogram correlation of two local maps, but the calculation of the angle offset and translation offset of the histogram depends on the normal phase feature of the point cloud; thus, since the phase feature of the point cloud is not accurate, errors are prone to occur, resulting in low accuracy of the obtained map. Summary of the invention
[0003] In view of this, embodiments of the present application provide a map updating method and device, a terminal, and a storage medium to solve at least one problem existing in the related art.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] The present application provides a map updating method, the method comprising:
[0006] Obtaining a first image feature in a first map;
[0007] According to the first image feature, matching a second image feature from a second map; wherein the scene information corresponding to the first map and the second map is partially the same;
[0008] According to the first image feature and the second image feature, each key frame image in the first map is added to the second map to obtain an updated second map.
[0009] In the above method, the step of obtaining the first image feature in the first map includes:
[0010] Extracting the key frame image to be matched in the first map to obtain a first image feature; wherein the key frame image to be matched is a key frame image in the first map;
[0011] Correspondingly, matching the second image feature from the second map according to the first image feature includes:
[0012] The second image feature is matched from image features of key frame images in the second map according to the first image feature.
[0013] In the above method, adding each key frame image in the first map to the second map according to the first image feature and the second image feature to obtain an updated second map includes:
[0014] Acquire first position information of an image acquisition device used to acquire the key frame image to be matched in a first coordinate system of the first map;
[0015] Determine second position information of the image acquisition device in a second coordinate system where the second map is located according to the first image feature and the second image feature;
[0016] According to the first position information and the second position information, each key frame image in the first map is added to the second map to obtain an updated second map.
[0017] In the above method, adding each key frame image in the first map to the second map according to the first position information and the second position information to obtain an updated second map includes:
[0018] Determining a conversion relationship between the first coordinate system and the second coordinate system according to the first position information and the second position information;
[0019] According to the conversion relationship, the coordinates of the image acquisition device corresponding to each key frame image in the first map in the first coordinate system are adjusted so that the adjusted coordinates of the image acquisition device corresponding to each key frame image match the second coordinate system;
[0020] The key frame image corresponding to each image acquisition device after the coordinates are adjusted is added to the second map to obtain the updated second map.
[0021] In the above method, the scene information corresponding to the first map and the second map are at least partially the same.
[0022] In the above method, the first image feature includes: two-dimensional (2-Dimensional, 2D) position information, (3-Dimensional, 3D) position information and identification information of feature points of the key frame image in the first map;
[0023] The second image features include: two-dimensional position information, three-dimensional position information and identification information of feature points of the key frame image in the second map; wherein the three-dimensional position information is obtained by mapping the two-dimensional position information into a coordinate system where the two-dimensional position information is located.
[0024] In the above method, extracting the key frame image in the first map to obtain the first image feature includes:
[0025] Extracting feature points of each key frame image in the first map to obtain a feature point set;
[0026] Determine identification information of each feature point in the feature point set and two-dimensional position information of each feature point in the key frame image;
[0027] Each two-dimensional position information is mapped into the coordinate system of the first map to obtain the three-dimensional position information of each feature point.
[0028] In the above method, matching the second image feature from the image features of the key frame image in the second map according to the first image feature includes:
[0029] Determine the ratios of different sample feature points in the feature point set respectively to obtain a first ratio vector;
[0030] Obtaining a second ratio vector, where the second ratio vector is a ratio of the plurality of sample feature points to the feature points contained in the key frame image in the second map;
[0031] According to the first image feature, the first ratio vector and the second ratio vector, a second image feature is matched from the image features of the key frame image in the second map.
[0032] In the above method, matching the second image feature from the image features of the key frame image in the second map according to the first image feature, the first ratio vector and the second ratio vector includes:
[0033] Determine, from the image features of the key frame images in the second map, a similar image feature whose similarity to the first image feature is greater than a second threshold value, according to the first ratio vector and the second ratio vector;
[0034] Determine similar key frame images to which the similar image features belong, and obtain a set of similar key frame images;
[0035] A second image feature whose similarity to the first image feature meets a preset similarity threshold is selected from the image features of the similar key frame images.
[0036] In the above method, selecting, from the image features of the similar key frame images, a second image feature whose similarity to the first image feature satisfies a preset similarity threshold, comprises:
[0037] Determine a time difference between acquisition times of at least two of the similar key frame images, and a similarity difference between image features of the at least two similar key frame images and the first image feature;
[0038] Combine similar key frame images whose time difference is less than a third threshold and whose similarity difference is less than a fourth threshold to obtain a combined frame image;
[0039] A second image feature whose similarity with the first image feature meets a preset similarity threshold is selected from the image features of the combined frame image.
[0040] In the above method, selecting, from the image features of the combined frame image, a second image feature whose similarity with the first image feature satisfies a preset similarity threshold, comprises:
[0041] respectively determining the sum of similarities between the image features of each key frame image included in the plurality of joint frame images and the first image features;
[0042] The combined frame image with the largest sum of similarities is determined as the target combined frame image with the highest similarity to the key frame image to be matched;
[0043] According to the identification information of the feature points of the target joint frame image and the identification information of the feature points of the key frame image to be matched, a second image feature whose similarity with the first image feature meets a preset similarity threshold is selected from the image features of the target joint frame image.
[0044] In the above method, before determining the second position information of the image acquisition device in the second coordinate system of the second map according to the first image feature and the second image feature, the method further includes:
[0045] Determine a target Euclidean distance between any two feature points contained in the key frame image corresponding to the second image feature, which is less than a first threshold, to obtain a target Euclidean distance set;
[0046] Correspondingly, determining the second position information of the image acquisition device in the second coordinate system of the second map according to the first image feature and the second image feature includes:
[0047] If the number of target Euclidean distances contained in the target Euclidean distance set is greater than a fifth threshold, the second position information is determined based on the three-dimensional position information of the feature points of the key frame image corresponding to the second image feature and the two-dimensional position information of the feature points of the key frame image corresponding to the first image feature.
[0048] In the above method, before extracting the key frame image in the first map to obtain the first image feature, the method further includes:
[0049] Selecting key frame images that meet preset conditions from the sample image library to obtain a key frame image set;
[0050] Extract image features of each key frame image to obtain a key image feature set;
[0051] Extract feature points of the sample image to obtain a sample feature point set containing different feature points;
[0052] Determine the ratio of each sample feature point in the key frame image to obtain a ratio vector set;
[0053] The ratio vector set and the key image feature set are stored to obtain the first map.
[0054] In the above method, before selecting a key frame image that meets a preset condition from the sample image library to obtain a key frame image set, the method further includes:
[0055] Selecting a preset number of corner points from the sample image;
[0056] If the number of identical corner points contained in two sample images with adjacent acquisition times is greater than or equal to a sixth threshold, determining that the scenes corresponding to the sample images are continuous scenes;
[0057] If the number of identical corner points contained in two sample images with adjacent acquisition times is less than a sixth threshold, it is determined that the scene corresponding to the sample images is a discrete scene.
[0058] In the above method, key frame images that meet preset conditions are selected from the sample image library to obtain a key frame image set, including:
[0059] If the scene corresponding to the sample image is a discrete scene, selecting a key frame image from a sample image library according to an input selection instruction;
[0060] If the scene corresponding to the sample image is a continuous scene, a key frame image is selected from the sample image library according to a preset frame rate or parallax.
[0061] In the above method, the determining of the ratio of each sample feature point in the key frame image to obtain a ratio vector set includes:
[0062] Determine a first average number of times according to a first number of sample images included in the sample image library and the first number of times the i-th sample feature point appears in the sample image library; wherein i is an integer greater than or equal to 1; and the first average number of times is used to indicate the average number of times the i-th sample feature point appears in each sample image;
[0063] Determine a second average number of times according to a second number of times the i-th sample feature point appears in the j-th key frame image and a second number of sample feature points contained in the j-th key frame image; wherein j is an integer greater than or equal to 1; and the second average number of times is used to indicate the proportion of the i-th sample feature point in the sample feature points contained in the j-th key frame image;
[0064] According to the first average times and the second average times, the ratio of the sample feature points in the key frame image is obtained, and the ratio vector set is obtained.
[0065] The embodiment of the present application provides a map updating device, the device comprising: a first acquisition module, a first matching module and a first updating module, wherein:
[0066] The first acquisition module is used to acquire a first image feature in a first map;
[0067] The first matching module is used to match the second image feature from the second map according to the first image feature; wherein the scene information corresponding to the first map and the second map is partially the same;
[0068] The first updating module is used to add each key frame image in the first map to the second map according to the first image feature and the second image feature to obtain an updated second map.
[0069] In the above device, the first acquisition module includes:
[0070] A first extraction submodule is used to extract the key frame image to be matched in the first map to obtain a first image feature; wherein the key frame image to be matched is a key frame image in the first map;
[0071] Correspondingly, the first matching module includes:
[0072] The first matching submodule is used to match the second image feature from the image features of the key frame image in the second map according to the first image feature.
[0073] In the above device, the first update module includes:
[0074] A first acquisition submodule, used for acquiring first position information of an image acquisition device used for acquiring the key frame image to be matched in a first coordinate system of the first map;
[0075] A first determination submodule, configured to determine second position information of the image acquisition device in a second coordinate system where the second map is located according to the first image feature and the second image feature;
[0076] The first updating submodule is used to add each key frame image in the first map to the second map according to the first position information and the second position information to obtain an updated second map.
[0077] In the above device, the first updating submodule includes:
[0078] A first determining unit, configured to determine a conversion relationship between the first coordinate system and the second coordinate system according to the first position information and the second position information;
[0079] A first adjustment unit, configured to adjust the coordinates of the image acquisition device corresponding to each key frame image in the first map in the first coordinate system according to the conversion relationship, so that the adjusted coordinates of the image acquisition device corresponding to each key frame image match the second coordinate system;
[0080] The first adding unit is used to add the key frame image corresponding to each image acquisition device after the coordinates are adjusted to the second map to obtain the updated second map.
[0081] In the above device, the scene information corresponding to the first map and the second map are at least partially the same.
[0082] In the above device, the first image feature includes: two-dimensional position information, three-dimensional position information and identification information of feature points of the key frame image in the first map;
[0083] The second image features include: two-dimensional position information, three-dimensional position information and identification information of feature points of the key frame image in the second map; wherein the three-dimensional position information is obtained by mapping the two-dimensional position information into a coordinate system where the two-dimensional position information is located.
[0084] In the above device, the first extraction submodule includes:
[0085] A first extraction unit, used to extract feature points of each key frame image in the first map to obtain a feature point set;
[0086] A second determining unit, used to determine identification information of each feature point in the feature point set and two-dimensional position information of each feature point in the key frame image;
[0087] The first mapping unit is used to map each two-dimensional position information in the coordinate system of the first map to obtain the three-dimensional position information of each feature point.
[0088] In the above device, the first matching submodule includes:
[0089] A third determining unit is used to respectively determine the ratios of different sample feature points in the feature point set to obtain a first ratio vector;
[0090] A first acquisition unit is used to acquire a second ratio vector, where the second ratio vector is a ratio of the plurality of sample feature points to the feature points contained in the key frame image in the second map;
[0091] The first matching unit is used to match the second image feature from the image features of the key frame image in the second map according to the first image feature, the first ratio vector and the second ratio vector.
[0092] In the above device, the first matching unit includes:
[0093] a first determining subunit, configured to determine, from the image features of the key frame images in the second map, similar image features having a similarity with the first image features greater than a second threshold value, based on the first ratio vector and the second ratio vector;
[0094] A second determining subunit is used to determine the similar key frame images to which the similar image features belong, and obtain a similar key frame image set;
[0095] The first selection subunit is configured to select, from the image features of the similar key frame images, a second image feature whose similarity to the first image feature satisfies a preset similarity threshold.
[0096] In the above-mentioned device, the first selection subunit is used to: determine the time difference between the acquisition time of at least two of the similar key frame images, and the similarity difference between the image features of the at least two similar key frame images and the first image feature respectively; combine the similar key frame images whose time difference is less than a third threshold and whose similarity difference is less than a fourth threshold to obtain a combined frame image; and select, from the image features of the combined frame image, a second image feature whose similarity with the first image feature meets a preset similarity threshold.
[0097] In the above-mentioned device, the first selection subunit is used to: respectively determine the sum of similarities between the image features of each key frame image contained in multiple joint frame images and the first image features; determine the joint frame image with the largest sum of similarities as the target joint frame image with the highest similarity to the key frame image to be matched; and select, from the image features of the target joint frame image, a second image feature whose similarity with the first image feature meets a preset similarity threshold based on the identification information of the feature points of the target joint frame image and the identification information of the feature points of the key frame image to be matched.
[0098] In the above device, the device further comprises:
[0099] A first determination module is used to determine a target Euclidean distance between any two feature points contained in the key frame image corresponding to the second image feature, which is less than a first threshold, to obtain a target Euclidean distance set;
[0100] Correspondingly, the first determining submodule includes:
[0101] A fourth determination unit is used to determine the second position information based on the three-dimensional position information of the feature points of the key frame image corresponding to the second image feature and the two-dimensional position information of the feature points of the key frame image corresponding to the first image feature if the number of target Euclidean distances included in the target Euclidean distance set is greater than a fifth threshold.
[0102] In the above device, the device further comprises:
[0103] A first selection module is used to select key frame images that meet preset conditions from a sample image library to obtain a key frame image set;
[0104] A first extraction module is used to extract image features of each key frame image to obtain a key image feature set;
[0105] The second extraction module is used to extract feature points of the sample image to obtain a sample feature point set containing different feature points;
[0106] The second determination module is used to determine the ratio of each sample feature point in the key frame image to obtain a ratio vector set;
[0107] The first storage module is used to store the ratio vector set and the key image feature set to obtain the first map.
[0108] In the above device, the device further comprises:
[0109] A second selection module, used for selecting a preset number of corner points from the sample image;
[0110] A third determination module, configured to determine that the scenes corresponding to the sample images are continuous scenes if the number of identical corner points contained in two sample images with adjacent acquisition times is greater than or equal to a sixth threshold;
[0111] The fourth determination module is configured to determine that the scene corresponding to the sample images is a discrete scene if the number of identical corner points contained in two sample images with adjacent acquisition times is less than a sixth threshold.
[0112] In the above device, the first selection module includes:
[0113] A first selection submodule, configured to select a key frame image from a sample image library according to an input selection instruction if the scene corresponding to the sample image is a discrete scene;
[0114] The second selection submodule is used to select a key frame image from the sample image library according to a preset frame rate or parallax if the scene corresponding to the sample image is a continuous scene.
[0115] In the above device, the second determining module includes:
[0116] A second determination submodule is used to determine a first average number of times according to a first number of sample images included in the sample image library and the first number of times the i-th sample feature point appears in the sample image library; wherein i is an integer greater than or equal to 1; and the first average number of times is used to indicate the average number of times the i-th sample feature point appears in each sample image;
[0117] A third determination submodule is used to determine a second average number of times according to a second number of times the i-th sample feature point appears in the j-th key frame image and a second number of sample feature points contained in the j-th key frame image; wherein j is an integer greater than or equal to 1; and the second average number of times is used to indicate the proportion of the i-th sample feature point in the sample feature points contained in the j-th key frame image;
[0118] The fourth determination submodule is used to obtain the ratio of the sample feature points in the key frame image according to the first average number of times and the second average number of times, and obtain the ratio vector set.
[0119] An embodiment of the present application provides a terminal, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the above-mentioned map updating method are implemented.
[0120] An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned map updating method are implemented.
[0121] The embodiments of the present application provide a map updating method and device, a terminal, and a storage medium, wherein, first, a first image feature in a first map is obtained; then, based on the first image feature, a second image feature is matched from a second map; finally, based on the first image feature and the second image feature, each key frame image in the first map is added to the second map to obtain an updated second map; in this way, by extracting the image feature of the key frame image in the local map first map, and then matching the image feature with the image feature of the key frame image in another map, the key frame image corresponding to the second image feature can be obtained, thereby merging multiple maps based on the matching image features in different maps, thereby realizing the update of the map and improving the accuracy of the updated map. BRIEF DESCRIPTION OF THE DRAWINGS
[0122] Figure 1A This is a schematic diagram of the process flow of implementing the map updating method in the embodiment of the present application;
[0123] Figure 1B This is another implementation flow diagram of the map updating method according to the embodiment of the present application;
[0124] Figure 2A This is a schematic diagram of the implementation process of the map updating method of the embodiment of the present application;
[0125] Figure 2B A schematic diagram of another implementation process of creating a preset map in an embodiment of the present application;
[0126] Figure 2C This is another schematic diagram of the implementation process of the map updating method according to the embodiment of the present application;
[0127] Figure 3 This is another implementation flow diagram of the map updating method according to the embodiment of the present application;
[0128] Figure 4 This is a schematic diagram of the structure of the ratio vector of an embodiment of the present application;
[0129] Figure 5A An application scenario diagram for determining a key frame image corresponding to a second image feature in an embodiment of the present application;
[0130] Figure 5B A schematic diagram of a structure for determining the location information of a collection device in an embodiment of the present application;
[0131] Figure 6 This is a schematic diagram of the structure of the map updating device according to an embodiment of the present application. DETAILED DESCRIPTION
[0132] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0133] The present application embodiment provides a map updating method. Figure 1A This is a schematic diagram of the map updating method implementation process of the present application embodiment. Figure 1A As shown, the method comprises the following steps:
[0134] Step S101, obtaining a first image feature in a first map.
[0135] Here, the first map can be understood as a part of the global map. For example, if the global map contains key frame images corresponding to 100 indoor scenes, then the first map may contain key frame images corresponding to some of the indoor scenes. The first image features include: 2D position information, 3D position information and identification information of the feature points of the key frame images in the first map. In step S101, first, the feature points of each key frame image in the first map are extracted to obtain a feature point set; then, the identification information of each feature point in the feature point set and the 2D position information of each feature point in the key frame image are determined; wherein the identification information of the feature point can be understood as the descriptor information that can uniquely identify the feature point; finally, each 2D position information is respectively mapped in the coordinate system of the first map to obtain the 3D position information of each feature point.
[0136] Step S102: matching a second image feature from a second map according to the first image feature.
[0137] Here, the first map and the second map are two different maps, and the scene information corresponding to the first map and the second map is partially the same, so that the second image feature with a high similarity to the first image feature of the key frame image in the first map can be matched from the second map; the second map can also be understood as a part of the global map. For example, the global map contains key frame images corresponding to 100 indoor scenes, and the second map can be a key frame image corresponding to a part of the indoor scenes. The scene information corresponding to the first map and the second map is at least partially the same; that is, there is a small overlap between the first map and the second map. The second image feature includes: the second image feature includes: 2D position information, 3D position information and identification information of the feature point of the key frame image in the second map; wherein the 3D position information is obtained by mapping the 2D position information in the coordinate system where the 2D position information is located. The step S102 can be understood as selecting a second image feature with a high degree of matching with the first image feature from the image features of the key frame image stored in the second map.
[0138] Step S103: adding each key frame image in the first map to the second map according to the first image feature and the second image feature to obtain an updated second map.
[0139] Here, based on the 3D position information of the feature points of the key frame image corresponding to the second image feature and the 2D position information of the feature points of the key frame image corresponding to the first image feature, the position information of the image acquisition device of the key frame image corresponding to the first image feature is determined. For example, first, the 2D position information of the feature points of the key frame image corresponding to the first image feature is converted into 3D position information, and then the 3D position information is compared with the 3D position information of the feature points of the key frame image in the second coordinate system where the second map is located, so as to determine the position information of the image acquisition device of the key frame image corresponding to the first image feature. In this way, the 2D position information and the 3D position information of the feature points are considered at the same time. Then, when the key frame image corresponding to the first image feature is positioned, the 2D position information of the image acquisition device of the key frame image to be matched corresponding to the first image feature can be obtained, and the 3D position information of the image acquisition device of the key frame image corresponding to the first image feature can also be obtained. It can also be understood that both the planar spatial position of the image acquisition device and the stereoscopic spatial position of the image acquisition device can be obtained; in this way, based on these rich position information, multiple local maps can be more accurately fused together.
[0140] In an embodiment of the present application, for any key frame image in the first map, by extracting image features, first, a second image feature matching the image feature is found from the second map, and secondly, based on the position information of the feature points of the two image features, finally, based on the position information of the image features and the conversion relationship between the coordinate systems corresponding to the two maps, each key frame image in the first map is added to the second map, thereby completing the update of the second map and ensuring good map fusion accuracy.
[0141] The present application embodiment provides a map updating method. Figure 1B FIG. 1 is another implementation flow diagram of the map updating method according to an embodiment of the present application. Figure 1B As shown, the method comprises the following steps:
[0142] Step S121, extracting the key frame image to be matched in the first map to obtain the first image feature.
[0143] Here, the key frame image to be matched is a key frame image in the first map.
[0144] Step S122: Match a second image feature from image features of a key frame image in a second map according to the first image feature.
[0145] Here, a preset bag-of-words model is used to retrieve second image features having a high similarity to the first image features from the image features of the key frame images stored in the second map.
[0146] Step S123: obtaining first position information of an image acquisition device used to acquire the key frame image to be matched in a first coordinate system of the first map.
[0147] Here, the first coordinate system may be a three-dimensional coordinate system, and the first position information may be understood as the three-dimensional coordinate value of the image acquisition device of the key frame image to be matched in the first coordinate system.
[0148] Step S124: Determine second position information of the image acquisition device in a second coordinate system of the second map according to the first image feature and the second image feature.
[0149] Here, firstly, the second coordinate system where the second map is located is obtained, and the second coordinate system is a three-dimensional coordinate system. Then, based on the 3D position information of the feature points of the key frame image corresponding to the second image feature and the 2D position information of the feature points of the key frame image corresponding to the first image feature, the second position information is determined. The second position information can be understood as the three-dimensional coordinate value of the image acquisition device of the key frame image to be matched in the second coordinate system. For example, the 3D position information of the feature points of the key frame image corresponding to the second image feature and the 2D position information of the feature points corresponding to the first image feature are used as the input of the front-end posture tracking algorithm (Perspectives-n-Point, PnP) algorithm, and the 2D position information (for example, 2D coordinates) of the feature points in the key frame image to be matched and the 3D position information (for example, 3D coordinates) of the feature points in the first coordinate system are first obtained, and then the position information of the image acquisition device of the key frame image to be matched can be solved according to the 3D position information of the feature points corresponding to the second feature in the second coordinate system and the 3D position information of the feature points in the key frame image to be matched in the first coordinate system.
[0150] Step S125: adding each key frame image in the first map to the second map according to the first position information and the second position information to obtain an updated second map.
[0151] Here, the updated second map may be a global map or a part of the global map. Step S125 may be implemented by the following process:
[0152] The first step is to determine a conversion relationship between the first coordinate system and the second coordinate system according to the first position information and the second position information.
[0153] Here, the conversion relationship between the first coordinate system and the second coordinate system may be a rotation matrix and a translation vector of the first coordinate system relative to the second coordinate system.
[0154] In the second step, according to the conversion relationship, the coordinates of the image acquisition device corresponding to each key frame image in the first map in the first coordinate system are adjusted so that the adjusted coordinates of the image acquisition device corresponding to each key frame image match the second coordinate system.
[0155] Here, according to the conversion relationship, the process of adjusting the coordinates of the image acquisition device corresponding to each key frame image in the first map in the first coordinate system can be: first, using the rotation matrix, the coordinates of the image acquisition device corresponding to each key frame image in the first coordinate system are rotated; then using the translation vector, the rotated coordinates of the image acquisition device corresponding to each key frame image in the first coordinate system are translated to obtain the adjusted coordinates of the image acquisition device corresponding to each key frame image.
[0156] The third step is to add the key frame image corresponding to each image acquisition device after the coordinates are adjusted to the second map to obtain the updated second map.
[0157] Here, since the coordinates of the image acquisition device corresponding to each key frame image in the first coordinate system have been adjusted to coordinates matching the second coordinate system, each key frame image in the first map can be added to the second map based on this, so as to achieve the fusion of the two maps and obtain an updated second map (i.e., a global map). In other embodiments, three or more maps can also be fused to obtain a global map.
[0158] The above steps S123 to S125 provide a method for implementing "adding each key frame image in the first map to the second map according to the first image features and the second image features to obtain an updated second map". In this method, the conversion relationship between the first coordinate system and the second coordinate system is determined based on the position information of the image acquisition device of the key frame to be matched in the first coordinate system and the second coordinate system respectively, and then, the coordinates of the image acquisition device corresponding to each key frame image in the first map in the first coordinate system are adjusted according to the conversion relationship, so that the coordinates of the image acquisition device corresponding to each key frame image in the first map in the first coordinate system match the second coordinate system, so that the key frame image corresponding to the adjusted image acquisition device is added to the second map, so that the two maps are accurately fused together.
[0159] In the embodiment of the present application, multiple local maps are fused through the image features of the key frame images in the two layout maps to achieve the purpose of map updating, so that the updated map fusion has higher accuracy and stronger robustness.
[0160] The present application embodiment provides a map updating method. Figure 2A Schematic diagram of the implementation process of the map updating method of the present application embodiment. Figure 2A As shown, the method comprises the following steps:
[0161] Step S201: extract feature points of each key frame image in the first map to obtain a feature point set.
[0162] Here, feature points of each key frame image in the first map are extracted to obtain a feature point set.
[0163] Step S202: determining identification information of each feature point in the feature point set and 2D position information of each feature point in the key frame image.
[0164] Here, for each feature point in the feature point set, the descriptor information of the feature point, ie, (identification information), is determined, and the 2D position information can be considered as the 2D coordinate of the feature point.
[0165] Step S203: Map each 2D position information into the coordinate system of the first map to obtain 3D position information of each feature point.
[0166] The above steps S201 to S203 provide a method for implementing "extracting the key frame image in the first map to obtain the first image features", in which the 2D coordinates of each feature point of the key frame image in the first map, the descriptor information and the 3D coordinates of the feature point are obtained.
[0167] Step S204, respectively determining the ratios of different sample feature points in the feature point set to obtain a first ratio vector.
[0168] Here, the first ratio vector may be pre-stored in a preset word bag model corresponding to the first map. When it is necessary to match the image features of the key frame image to be matched in the first map, the first ratio vector is obtained from the preset word bag model. The multiple sample feature points are different from each other. The preset word bag model contains multiple different sample feature points and the ratio of the multiple sample feature points to the feature points contained in the key frame image. The first ratio vector may be determined based on the number of sample images, the number of times the sample feature points appear in the sample images, the number of times the sample feature points appear in the key frame images to be matched, and the total number of sample feature points appearing in the key frame images to be matched; as shown in formula (1):
[0169]
[0170] Wherein, N is the number of sample images (i.e., the first number), n i is the sample feature point w i The number of times it appears in the sample image (i.e. the first time), I t is the image I collected at time t, is the sample feature point w i The key frame image I collected at time t The number of times it appears in (i.e. the second number), is the key frame image I t The total number of sample feature points appearing in (ie, the second number). By scoring the sample feature points, a w-dimensional floating point vector of each key frame image, ie, a ratio vector, is obtained. The ratio vector can also be used as feature information of a preset bag-of-words model.
[0171] Step S205, obtaining a second ratio vector.
[0172] Here, the second ratio vector is the ratio of the plurality of sample feature points to the feature points contained in the key frame image in the second map; the second ratio vector is pre-stored in a preset word bag model, so when it is necessary to match the image features of the key frame image to be matched, the second ratio vector is obtained from the preset word bag model. The determination process of the second ratio vector is similar to the determination process of the first ratio vector, and both can be determined using formula (1); and the first ratio vector and the second ratio vector have the same dimension.
[0173] Step S206: Match a second image feature from the image features of the key frame image according to the first image feature, the first ratio vector, and the second ratio vector.
[0174] Here, step S205 can be implemented by the following process:
[0175] In the first step, based on the first ratio vector and the second ratio vector, similar image features whose similarity to the first image features is greater than a second threshold are determined from image features of the key frame images in the second map.
[0176] Here, the first ratio vector v1 of the key frame image to be matched is compared with the second ratio vector v2 of each key frame image in the second map one by one, and the two ratio vectors are used to perform calculations as shown in formula (2) to determine the similarity between each key frame image in the second map and the key frame image to be matched, thereby screening out similar key frame images whose similarity is greater than or equal to the second threshold, and obtaining a set of similar key frame images.
[0177] The second step is to determine the similar key frame images to which the similar image features belong, and obtain a set of similar key frame images.
[0178] The third step is to select, from the image features of the similar key frame images, a second image feature whose similarity to the first image feature meets a preset similarity threshold.
[0179] Here, from the image features contained in the similar key frame images, the second image feature with the highest similarity to the first image feature is selected; for example, first, the time difference between the acquisition time of at least two of the similar key frame images and the similarity difference between the image features of the at least two similar key frame images and the first image feature are determined; then, the similar key frame images whose time difference is less than the third threshold and whose similarity difference is less than the fourth threshold are combined to obtain a combined frame image; that is, multiple similar key frame images with close acquisition time and close similarity to the key frame image to be matched are selected, indicating that these key frame images may be continuous pictures, so such multiple similar key frame images are combined together to form a combined frame image (which can also be called an island), so as to obtain multiple combined frame images; finally, from the image features of the combined frame images, the second image feature whose similarity to the first image feature meets the preset similarity threshold is selected. For example, the sum of the similarities between the image features of each key frame image contained in the multiple combined frame images and the first image feature is determined respectively; in this way, the sum of the similarities between the image features of the multiple key frame images contained in the multiple combined frame images and the first image feature is determined one by one. Then, the joint frame image with the largest sum of similarities is determined as the target joint frame image with the highest similarity to the key frame image to be matched; finally, according to the identification information of the feature points of the target joint frame image and the identification information of the feature points of the key frame image to be matched, a second image feature whose similarity to the first image feature meets a preset similarity threshold is selected from the image features of the target joint frame image. In this way, since the identification information of the feature points of the target joint frame image and the identification information of the feature points of the key frame image to be matched can uniquely identify the feature points of the target joint frame image and the feature points of the key frame image to be matched, respectively, based on these two identification information, the second image feature with the highest similarity to the first image feature can be very accurately selected from the image features of the target joint frame image. Thus, the accuracy of matching the second image feature with the first image feature of the key frame image to be matched is guaranteed, and the similarity between the selected second image feature and the first image feature is guaranteed to be extremely high. In this embodiment, the key frame image containing the second image feature indicates that the key frame image is very similar to the key frame image to be matched, and can be considered as the image most similar to the key frame image to be matched.
[0180] The above steps S204 to S206 provide a method for implementing "matching the second image feature from the image features of the key frame image in the second map according to the first image feature." In this method, the second image feature matching the first image feature is retrieved from the image features of the key frame image in the second map by using a preset bag of words model, thereby ensuring the similarity between the second image feature and the first image feature.
[0181] Step S207: determine a target Euclidean distance between any two feature points contained in the key frame image corresponding to the second image feature that is less than a first threshold, and obtain a target Euclidean distance set.
[0182] Here, first, the Euclidean distance between any two feature points contained in the key frame image corresponding to the second image feature is determined, and then the Euclidean distance less than the first threshold is selected as the target Euclidean distance to obtain a target Euclidean distance set; this is to process a feature point in the key frame image to be matched, and a target Euclidean distance set can be obtained, then multiple feature points in the key frame image to be matched are processed, and multiple Euclidean distance sets can be obtained. The target Euclidean distance less than the first threshold can also be considered as first determining the minimum Euclidean distance from multiple Euclidean distances, and then judging whether the minimum Euclidean distance is less than the first threshold. If it is less than, the minimum Euclidean distance is determined as the target Euclidean distance, and then the target Euclidean distance set is a set with the smallest Euclidean distance among multiple Euclidean distance sets.
[0183] Step S208, if the number of target Euclidean distances contained in the target Euclidean distance set is greater than a fifth threshold, the second position information is determined based on the 3D position information of the feature points of the key frame image corresponding to the second image feature and the 2D position information of the feature points of the key frame image corresponding to the first image feature.
[0184] Here, if the number of target Euclidean distances contained in the target Euclidean distance set is greater than the fifth threshold, it means that the number of target Euclidean distances is large enough, and it also means that there are enough feature points matching the first image feature, which means that the key frame image containing the second image feature and the key frame image to be matched have a high enough similarity. Then, the 3D position information of the feature points of the key frame image of the second image feature and the 2D position information of the feature points of the key frame image to be matched corresponding to the first image feature are used as inputs of the PnP algorithm, and the 2D coordinates of the feature points in the current frame of the key frame image to be matched and the 3D coordinates of the feature points in the current coordinate system are first calculated, and then the position information of the image acquisition device can be solved according to the 3D position information of the feature points of the key frame image in the map coordinate system and the 3D position information of the feature points in the current frame of the key frame image to be matched in the current coordinate system.
[0185] The above steps S206 to S208 provide a method for implementing "determining the second position information of the image acquisition device in the second coordinate system of the second map based on the first image features and the second image features". In this method, the 2D and 3D position information of the key frame image are simultaneously considered, and the position and posture can be provided simultaneously in the positioning result, thereby improving the accuracy of determining the position of the image acquisition device, thereby effectively converting the coordinates of the image acquisition device of the key frame image in the first map, and better integrating the key frame image in the first map into the second map, thereby ensuring the map fusion accuracy and robustness.
[0186] Step S209: obtaining first position information of an image acquisition device used to acquire the key frame image to be matched in a first coordinate system of the first map.
[0187] Here, the image acquisition device corresponding to each key frame image in the first map has a first position information. The first position information can be understood as the coordinate value of the image acquisition device in the first coordinate system.
[0188] Step S210: adding each key frame image in the first map to the second map according to the first position information and the second position information to obtain an updated second map.
[0189] In an embodiment of the present application, a key frame image to be matched is obtained through an image acquisition device, a preset map is loaded, and a preset bag-of-words model is used to retrieve a key frame image corresponding to a second image feature corresponding to the key frame image to be matched. Finally, the 2D position information of the feature points of the key frame image to be matched and the 3D position information of the feature points of the key frame image are used as inputs of the PnP algorithm to obtain the position of the current camera of the key frame image to be matched in the second map, so that the coordinates of the image acquisition device corresponding to the key frame image in the first map are converted into coordinates matching the second coordinate system of the second map, and then the key frame image in the first map is accurately fused into the second map; in this way, the coordinates of the image acquisition device corresponding to the key frame image in the first map in the second coordinate system of the second map can be determined through the key frame image, so that the two maps can be more accurately fused together to obtain an updated second map, without requiring a large number of repeated areas in the two local maps, and good map fusion accuracy can be guaranteed. When the map is updated by crowdsourcing or multiple people create a map, the stability of the map fusion is improved, and the efficiency of constructing the local map is also improved.
[0190] The present application embodiment provides a map updating method. Figure 2B Another implementation flow diagram of creating a preset map in an embodiment of the present application is shown in FIG. Figure 2B As shown, the method comprises the following steps:
[0191] Step S221, selecting key frame images that meet preset conditions from the sample image library to obtain a key frame image set.
[0192] Here, first, determine whether the scene corresponding to the sample image is a continuous scene or a discrete scene. If it is a discrete scene, the process is as follows:
[0193] The first step is to select a preset number of corner points from the sample image; the corner points are pixel points in the sample image that are significantly different from a preset number of surrounding pixel points; for example, 150 corner points are selected.
[0194] In the second step, if the number of identical corner points contained in two sample images with adjacent acquisition times is greater than or equal to the sixth threshold, it is determined that the scene corresponding to the sample image is a continuous scene; the acquisition time of two sample images is adjacent, which can also be understood as two continuous sample images, and the number of identical corner points contained in the two sample images is determined. The larger the number, the higher the correlation between the two sample images, which also indicates that the two sample images are from continuous scenes. Continuous scenes, for example, a single indoor environment, such as a bedroom, a living room, or a single conference room.
[0195] In the third step, if the number of identical corner points contained in two sample images with adjacent acquisition times is less than a sixth threshold, it is determined that the scene corresponding to the sample image is a discrete scene. The smaller the number of identical corner points contained in the two sample images, the lower the correlation between the two sample images, which also indicates that the two sample images are images from discrete scenes. Discrete scenes, for example, in multiple indoor environments, such as multiple rooms in a building or multiple meeting rooms on a floor, etc.
[0196] Then, if the scene corresponding to the sample image is a discrete scene, a key frame image is selected from the sample image library according to the input selection instruction; that is, if the sample image belongs to a discrete scene, it means that the multiple sample images do not correspond to the same scene, so the user manually selects the key frame image, thus ensuring the validity of the selected key image in different environments.
[0197] If the scene corresponding to the sample image is a continuous scene, a key frame image is selected from the sample image library according to a preset frame rate or parallax; that is, if the sample image belongs to a continuous scene, it means that multiple sample images correspond to the same scene, then by setting a preset frame rate or a preset parallax in advance, a sample image that meets the preset frame rate or the preset parallax is automatically selected as the key frame image. In this way, both the effectiveness of the selected key image and the efficiency of selecting the key frame image are improved.
[0198] Step S222: extract image features of each key frame image to obtain a key image feature set.
[0199] Here, the image features of the key frame include: 2D position information, 3D position information and identification information that can uniquely identify the feature point of the key frame image. A key image feature set is obtained so as to match a second image feature that is highly similar to the first image feature from the key image feature set, thereby obtaining a key frame image corresponding to the corresponding second image feature.
[0200] Step S223, determining the ratio of each sample feature point in the key frame image, and obtaining a ratio vector set.
[0201] Here, after obtaining the ratio vector set, different sample feature points and the ratio vector set are stored in a preset word bag model, so that the preset word bag model is used to retrieve the key frame image corresponding to the second image feature of the key frame image to be matched from the key frame image. The step S223 can be implemented by the following process:
[0202] First, according to the first number of sample images contained in the sample image library and the first number of times the i-th sample feature point appears in the sample image library, a first average number of times is determined. i is an integer greater than or equal to 1; the first average number of times is used to indicate the average number of times the i-th sample feature point appears in each sample image; for example, the first number of sample images is N, and the first number of times the i-th sample feature point appears in the sample image library is n. i , the first average frequency idf(i) can be obtained through formula (1).
[0203] Secondly, according to the second number of times the i-th sample feature point appears in the j-th key frame image and the second number of sample feature points contained in the j-th key frame image, a second average number is determined; j is an integer greater than or equal to 1; the second average number is used to indicate the proportion of the i-th sample feature point to the sample feature points contained in the j-th key frame image; for example, the second number is The second quantity is The second average number tf(i,I t ).
[0204] Finally, according to the first average number and the second average number, the ratio of the sample feature points in the key frame image is obtained, and the ratio vector set is obtained. For example, according to formula (1), the first average number and the second average number are multiplied to obtain the ratio vector
[0205] Step S224, storing the ratio vector set and the key image feature set to obtain the first map.
[0206] Here, the ratio vector set and the key image feature set corresponding to the key frame image are stored in the first map, so that when the image acquisition device is positioned, the ratio vector set is compared with the ratio vector set corresponding to the key frame image to be matched determined by using the preset bag-of-words model, so as to determine the key frame image corresponding to the second image feature that is highly similar to the key frame image to be matched from the key image feature set.
[0207] The above steps S221 to S224 provide a process for constructing a local map, such as a first map and a second map. By repeating the above steps S221 to S224, the second map can be obtained, and a map corresponding to any scene can also be obtained.
[0208] In an embodiment of the present application, for discrete or continuous scenes of sample images, different key frame image selection methods are used to ensure the validity of the selected key frame images. Then, image features are extracted from the key frame images to construct a first map, thereby ensuring the accuracy of the first map.
[0209] The present application embodiment provides a map updating method. Figure 2C This is another implementation flow diagram of the map updating method according to the embodiment of the present application. Figure 2C As shown, the method comprises the following steps:
[0210] Step S231, selecting key frame images that meet preset conditions from a sample image library to obtain a key frame image set.
[0211] Step S232: extract image features of each key frame image to obtain a key image feature set.
[0212] Step S233: extract feature points of the sample image to obtain a sample feature point set containing different feature points.
[0213] Step S234, determining the ratio of each sample feature point in the key frame image, and obtaining a ratio vector set.
[0214] Step S235, storing the ratio vector set and the key image feature set to obtain the first map and the second map.
[0215] The above steps S231 to S235 complete the creation process of the preset map, and store the image features and ratio vector set of the key frame image in the preset map, so that the second image features that match the image features of the key frame image to be matched can be searched from the image features of the key frame image in the second map according to the ratio vector set.
[0216] Step S236: extracting the first image feature of the key frame image to be matched from the image features of the key frame image to be matched in the first map.
[0217] Here, when positioning the image acquisition device, the first map and the second map need to be loaded first.
[0218] Step S237: Match a second image feature from the image features of the key frame image in the second map according to the first image feature.
[0219] Step S238: Determine the second position information of the image acquisition device in the second coordinate system of the second map according to the first image feature and the second image feature.
[0220] The above steps S236 to S238 provide a process for realizing positioning of the image acquisition device. In this process, a second image feature that is highly similar to the first image feature is matched from the key frame image stored in the preset map, and then the second position information of the acquisition device in the second coordinate system is finally determined by utilizing the 2D position information and 3D position information in these two image features.
[0221] Step S239: obtaining first position information of an image acquisition device used to acquire the key frame image to be matched in a first coordinate system of the first map.
[0222] Step S240: adding each key frame image in the first map to the second map according to the first position information and the second position information to obtain an updated second map.
[0223] In the embodiment of the present application, the 2D and 3D position information of the key frame image are used simultaneously to ensure the accuracy of the positioning results of the acquisition device, high positioning success rate and strong robustness. In this way, the key frame image in the first map is fused into the second map to ensure the fusion accuracy of the fused map.
[0224] The present application embodiment provides a map updating method. Figure 3 FIG. 1 is another implementation flow chart of the map updating method according to an embodiment of the present application. Figure 3 As shown, the method comprises the following steps:
[0225] Step S301, selecting different key frame image selection methods according to the scene to which the sample image belongs.
[0226] Here, the scene to which the sample image belongs includes: discrete scene or continuous scene; the key frame image selection method includes two types: manual selection and automatic selection. Manual selection requires the map builder to manually select the key frame image to be included in the map, while automatic selection is a method of automatically selecting images as key frame images based on frame rate or parallax. In the process of image feature extraction for key frame images, 150 FAST feature corner points are extracted from each key frame image, and the proportion of the same corner points in two consecutive key frame images is defined as the corner tracking rate. In the embodiment of the present application, a scene with an ordered sequence of key frame images and an average corner tracking rate greater than 30% is defined as a continuous scene, otherwise it is a discrete scene. The key frame image selection method for continuous scenes uses an automatic selection method; while the key frame image selection method for discrete scenes uses a manual selection method. Continuous scenes are suitable for single indoor environments, such as bedrooms, living rooms, single conference rooms, etc.; discrete scenes are more suitable for use in multiple indoor environments, such as multiple rooms in a building, or multiple conference rooms on a floor, etc. In the process of map construction, the key frame image selection strategies for continuous scenes and discrete scenes are different, and the applicable scenarios are different. In this way, for discrete or continuous indoor scenes, different key frame image selection methods are used to extract image features for map construction. In this way, the positioning process does not rely on external base station equipment, has low cost, high positioning accuracy and strong robustness.
[0227] Step S302: using a camera to collect key frame images.
[0228] Here, the camera can be a monocular camera or a binocular camera.
[0229] Step S303: extracting image features from the key frame images in real time during the acquisition process.
[0230] Here, image feature extraction is a process of interpreting and annotating keyframe images. In step S303, it is necessary to extract the 2D position information, 3D position information and identification information (i.e., the descriptor information of the feature points) of the keyframe images; wherein, the 3D position information of the feature points of the keyframe images is obtained by mapping the 2D position information of the feature points of the keyframe images in the three-dimensional coordinate system where the preset map is located. For example, multiple 2D feature points are extracted from the keyframe images, and the number of extracted points is 150 (150 is an empirical value, too few feature points will result in a high tracking failure rate, and too many feature points will affect the efficiency of the algorithm) for image tracking; and the descriptors of the feature points are extracted for feature point matching; secondly, the 3D position information (i.e., depth information) of the feature points is calculated by the triangulation method to determine the position of the acquisition camera.
[0231] Step S304, during the acquisition process, the ratio of each sample feature point in the key frame image is determined in real time to obtain a ratio vector.
[0232] Here, step S304 can be understood as extracting the ratio vector of the key frame image in real time for the current frame image during the key frame image acquisition process, such as Figure 4 As shown, the bag-of-words model is described in the form of a vocabulary tree. The bag-of-words model includes a sample image library 41, which is the root node of the vocabulary tree; sample images 42, 43 and 44, which are leaf nodes 42 and 43; sample feature points 1 to 3 are different sample feature points in sample image 42, feature points 4 to 6 are different sample feature points in sample image 43, and feature points 7 to 9 are different sample feature points in sample image 44. In the bag-of-words model, it is assumed that there are w types of sample feature points, that is, w is the number of feature point types extracted from the sample image of the bag-of-words model. Therefore, there are a total of w sample feature points in the bag-of-words model. Each sample feature point will score the key frame image, and the score value is a floating point number of 0 to 1, so that each key frame image can be represented by a w-dimensional floating point number. This w-dimensional vector is the ratio vector output by the bag-of-words model. The scoring process is shown in formula (1).
[0233] The above steps S301 to S304 construct an offline local map that depends on the key frame image, namely the first map and the second map. The first map and the second map store the image features of the key frame image in binary format (including: 2D position information, 2D position information and identification information, such as 2D coordinates, 3D coordinates, and descriptor information) to the local device. When the image acquisition device needs to be operated, the first map and the second map will be loaded and used.
[0234] Step S305: load the constructed first map and second map.
[0235] Here, the second coordinate system of the second map is used as the global coordinate system.
[0236] Step S306: extracting image features of the key frame image to be matched in the first map to obtain first image features.
[0237] Here, the key frame image to be matched is any one of the key frame images in the first map.
[0238] Step S307 , searching the key frame image corresponding to the second image feature in the second map for the current frame of the key frame image to be matched by using the bag-of-words model.
[0239] Here, the retrieval of the key frame image corresponding to the second image feature of the current frame of the key frame image to be matched in the second map through the bag-of-words model can be understood as utilizing the feature information of the bag-of-words model, i.e., the ratio vector set, to retrieve the key frame image corresponding to the second image feature of the current frame of the key frame image to be matched in the second map.
[0240] The step S307 can be implemented by the following process:
[0241] The first step is to find the similarity between the current frame of the key frame image to be matched and each key frame image in the second map. The calculation method of the similarity s(v1, v2) is shown in formula (2).
[0242]
[0243] Wherein, v1 and v2 represent the first ratio vector of each sample feature point contained in the bag-of-words model in the current frame of the key frame image to be matched, and the second ratio vector of each sample feature point in the key frame image in the second map. If the bag-of-words model contains w kinds of sample feature points, then the first ratio vector and the second ratio vector are both w-dimensional vectors. By adopting the method of screening out similar key frame images whose similarity reaches the second threshold in the key frame images in the second map, a set of similar key frame images is obtained.
[0244] In the second step, similar key frame images whose timestamp difference is less than the third threshold and whose similarity difference is less than the fourth threshold are selected from the similar key frame image set and combined together to obtain a combined frame image (or called an island).
[0245] Here, the second step can be understood as selecting similar key frame images with close timestamps and similarity matching scores from the similar key frame image set and combining them together to be called islands; in this way, the similar key frame image set is divided into multiple joint frame images (i.e., multiple islands). The similarity ratio between the first key frame image and the last key frame image in the joint frame image is very small. As shown in formula (3):
[0246]
[0247] in, and s(v t ,v t-△t ) respectively represent the similarity between the two key frame images one before and one after and the key frame image to be matched with the current frame.
[0248] The third step is to determine the sum of similarities between the image features of each key frame image contained in the multiple joint frame images and the first image features, as shown in formula (4):
[0249]
[0250] In the fourth step, the joint frame image with the largest sum of similarities is determined as the target joint frame image with the highest similarity to the key frame image to be matched, and the key frame image corresponding to the second image feature with the highest similarity to the current frame of the key frame image to be matched is found from the target joint frame image.
[0251] Step S308: using the PnP algorithm, determine the position information in the map coordinate system of the second position information of the image acquisition device corresponding to the key frame image to be matched in the second coordinate system of the second map.
[0252] Here, step S308 can be implemented by the following steps:
[0253] The first step is to treat the current frame X that matches the key frame image C The Nth feature point F CN , traverse all feature points of the key frame image X3 corresponding to the second image feature, and determine the Euclidean distance between any two feature points in the key frame image corresponding to the second image feature. Figure 5A As shown, the current frame X of the key frame image to be matched c 51, and the current frame X c 51 matches the key frame image X352 corresponding to the second image feature. Calculate the Euclidean distance between feature points X053 and X154 to obtain the Euclidean distance F0501; calculate the Euclidean distance between feature points X154 and X255 to obtain the Euclidean distance F1502; calculate the Euclidean distance between feature points X255 and X352 to obtain the Euclidean distance F2503; calculate the Euclidean distance between feature points X c The Euclidean distance between 51 and X456 is obtained, and the Euclidean distance F3504 is obtained.
[0254] In the second step, the set with the smallest Euclidean distance (i.e., the target Euclidean distance set) is selected for threshold judgment. If it is less than the first threshold, it is determined to be the target Euclidean distance, and the target Euclidean distance set is formed. Otherwise, the target Euclidean distance set is not formed, and the process jumps to the first step until X is traversed. C All feature points of , go to the third step. For example, Figure 5A As shown, by comparing multiple Euclidean distances, a set of minimum Euclidean distance combinations {F1, F2, F3} is obtained.
[0255] The third step is to form a target Euclidean distance set, which can be expressed as {F1, F2, F3}. If the number of elements in the target Euclidean distance set is greater than the fifth threshold, the fourth step is performed, otherwise the algorithm ends and the position information of the matching frame X3 is output.
[0256] The fourth step is to call the function in PnP to solve X based on the target Euclidean distance set. C Location information in the map coordinate system. The process of the PnP algorithm is as follows:
[0257] The input of the PnP algorithm is the 3D coordinates of the feature points in the key frame image containing the second image features and the 2D coordinates of the feature points in the current frame of the key frame image to be matched. The output of the algorithm is the position of the image acquisition device corresponding to the current frame of the key frame image to be matched in the second coordinate system of the second map.
[0258] The PnP algorithm does not directly calculate the camera pose matrix based on the matching pair sequence, but first calculates the 2D coordinates of the feature points in the current frame of the key frame image to be matched in the current coordinate system, and then solves the camera pose based on the 3D coordinates of the feature points in the current frame of the key frame image to be matched in the current coordinate system. The solution of the PnP algorithm starts with the cosine theorem, assuming that the center of the current coordinate system is point O, and A, B, and C are three feature points in the current frame of the key frame image to be matched, such as Figure 5B As shown:
[0259] According to the law of cosines, the relationship between A, B and C is shown in formula (5):
[0260]
[0261] Eliminate the above equation and divide it by OC 2 , and another Then we can get formula (6):
[0262]
[0263] Then replace it, Then we can get formula (7):
[0264]
[0265] Substituting formula (4) into formula (6) and (7), we can obtain formula (8) and (9):
[0266] (1-w)x 2 -w·y 2 -2 x cos<a,c> +2 w x y cos<a,b> +1=0 (8);
[0267] (1-v)y 2 -v·x 2 -2·y·cos<b,c> +2·v·x·y·cos<a,b> +1=0 (9);
[0268] Among them, since the 2D coordinates of A, B and C are known, w, v, cos<a,c> ,cos<b,c> ,cos<a,b> All are known quantities, so there are only two unknown quantities, x and y. The values of x and y can be obtained by formulas (8) and (9), and thus the values of OA, OB and OC can be solved, as shown in formula (10):
[0269]
[0270] Finally, the 3D coordinates of the three feature points A, B and C in the current three-dimensional coordinate system can be obtained, which can be obtained by formula (11):
[0271]
[0272] After obtaining the 3D coordinates of the three feature points A, B and C in the current three-dimensional coordinate system, the position of the acquisition device is determined by transforming the map coordinate system to the current coordinate system.
[0273] In the above steps S305 to S308, the constructed offline map is loaded for the key frame images to be matched collected by the image acquisition device, and the key frame images corresponding to the second image features of the key frame images to be matched are retrieved from the key frame images in the second map through the bag-of-words model. Finally, the PnP algorithm is used to solve the precise position and posture of the current camera in the second map to determine the position and posture of the device in the second coordinate system, so that the key frame images in the first map can be added to the second map more accurately to achieve map update.
[0274] Step S309, adjust the coordinates of the image acquisition device corresponding to each key frame image in the first map in the first coordinate system so that the adjusted coordinates match the second coordinate system, and add the key frame image corresponding to the image acquisition device with adjusted coordinates to the second map to obtain an updated second map.
[0275] Here, first, the first position information of the image acquisition device in the first coordinate system is determined, and secondly, the second position information of the image acquisition device in the second coordinate system is determined; thirdly, based on the first position information and the second position information, the rotation matrix and translation vector of the first coordinate system relative to the second coordinate system are determined; and the coordinates of the image acquisition device in the first coordinate system are adjusted using the rotation matrix and the translation vector so that the adjusted coordinates of the image acquisition device match the second coordinate system.
[0276] After step S309, steps S305 to S309 are repeatedly performed to fuse other local maps into the second coordinate system (ie, the global coordinate system) to complete the fusion of the global map.
[0277] In the application embodiment, the 2D coordinates and 3D coordinates of the key frame image are considered at the same time, and the 3D coordinates of the acquisition device can be provided in the positioning result, thereby improving the positioning accuracy of the image acquisition device. This ensures the fusion accuracy of the key frame image in the first map into the second map, making the updated map more robust.
[0278] An embodiment of the present application provides a map updating device, which includes various modules included and various units included in each module, and can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0279] Figure 6 Schematic diagram of the structure of the map updating device according to the embodiment of the present application. Figure 6 As shown, the device 600 includes: a first acquisition module 601, a first matching module 602 and a first updating module 603, wherein:
[0280] The first acquisition module 601 is used to acquire a first image feature in a first map;
[0281] The first matching module 602 is used to match the second image feature from the second map according to the first image feature;
[0282] The first updating module 603 is used to add each key frame image in the first map to the second map according to the first image feature and the second image feature to obtain an updated second map.
[0283] In the above device, the first acquisition module 601 includes:
[0284] A first extraction submodule is used to extract the key frame image to be matched in the first map to obtain a first image feature; wherein the key frame image to be matched is a key frame image in the first map;
[0285] Correspondingly, the first matching module 602 includes:
[0286] The first matching submodule is used to match the second image feature from the image features of the key frame image in the second map according to the first image feature.
[0287] In the above device, the first updating module 603 includes:
[0288] A first acquisition submodule, used for acquiring first position information of an image acquisition device used for acquiring the key frame image to be matched in a first coordinate system of the first map;
[0289] A first determination submodule, configured to determine second position information of the image acquisition device in a second coordinate system where the second map is located according to the first image feature and the second image feature;
[0290] The first updating submodule is used to add each key frame image in the first map to the second map according to the first position information and the second position information to obtain an updated second map.
[0291] In the above device, the first updating submodule includes:
[0292] A first determining unit, configured to determine a conversion relationship between the first coordinate system and the second coordinate system according to the first position information and the second position information;
[0293] A first adjustment unit, configured to adjust the coordinates of the image acquisition device corresponding to each key frame image in the first map in the first coordinate system according to the conversion relationship, so that the adjusted coordinates of the image acquisition device corresponding to each key frame image match the second coordinate system;
[0294] The first adding unit is used to add the key frame image corresponding to each image acquisition device after the coordinates are adjusted to the second map to obtain the updated second map.
[0295] In the above device, the scene information corresponding to the first map and the second map are at least partially the same.
[0296] In the above device, the first image feature includes: 2D position information, 3D position information and identification information of feature points of the key frame image in the first map;
[0297] The second image features include: 2D position information, 3D position information and identification information of feature points of the key frame image in the second map; wherein the 3D position information is obtained by mapping the 2D position information into a coordinate system where the 2D position information is located.
[0298] In the above device, the first extraction submodule includes:
[0299] A first extraction unit, used to extract feature points of each key frame image in the first map to obtain a feature point set;
[0300] A second determining unit, configured to determine identification information of each feature point in the feature point set and 2D position information of each feature point in the key frame image;
[0301] The first mapping unit is used to map each 2D position information in the coordinate system of the first map to obtain the 3D position information of each feature point.
[0302] In the above device, the first matching submodule includes:
[0303] A third determining unit is used to respectively determine the ratios of different sample feature points in the feature point set to obtain a first ratio vector;
[0304] A first acquisition unit is used to acquire a second ratio vector, where the second ratio vector is a ratio of the plurality of sample feature points to the feature points contained in the key frame image in the second map;
[0305] The first matching unit is used to match the second image feature from the image features of the key frame image in the second map according to the first image feature, the first ratio vector and the second ratio vector.
[0306] In the above device, the first matching unit includes:
[0307] a first determining subunit, configured to determine, from the image features of the key frame images in the second map, similar image features having a similarity with the first image features greater than a second threshold value, based on the first ratio vector and the second ratio vector;
[0308] A second determining subunit is used to determine the similar key frame images to which the similar image features belong, and obtain a similar key frame image set;
[0309] The first selection subunit is configured to select, from the image features of the similar key frame images, a second image feature whose similarity to the first image feature satisfies a preset similarity threshold.
[0310] In the above-mentioned device, the first selection subunit is used to: determine the time difference between the acquisition time of at least two of the similar key frame images, and the similarity difference between the image features of the at least two similar key frame images and the first image feature respectively; combine the similar key frame images whose time difference is less than a third threshold and whose similarity difference is less than a fourth threshold to obtain a combined frame image; and select, from the image features of the combined frame image, a second image feature whose similarity with the first image feature meets a preset similarity threshold.
[0311] In the above-mentioned device, the first selection subunit is used to: respectively determine the sum of similarities between the image features of each key frame image contained in multiple joint frame images and the first image features; determine the joint frame image with the largest sum of similarities as the target joint frame image with the highest similarity to the key frame image to be matched; and select, from the image features of the target joint frame image, a second image feature whose similarity with the first image feature meets a preset similarity threshold based on the identification information of the feature points of the target joint frame image and the identification information of the feature points of the key frame image to be matched.
[0312] In the above device, the device further comprises:
[0313] A first determination module is used to determine a target Euclidean distance between any two feature points contained in the key frame image corresponding to the second image feature, which is less than a first threshold, to obtain a target Euclidean distance set;
[0314] Correspondingly, the first determining submodule includes:
[0315] a fourth determination unit, for determining the second position information based on the 3D position information of the feature points of the key frame image corresponding to the second image feature and the 2D position information of the feature points of the key frame image corresponding to the first image feature, if the number of target Euclidean distances included in the target Euclidean distance set is greater than a fifth threshold.
[0316] In the above device, the device further comprises:
[0317] A first selection module is used to select key frame images that meet preset conditions from a sample image library to obtain a key frame image set;
[0318] A first extraction module is used to extract image features of each key frame image to obtain a key image feature set;
[0319] The second extraction module is used to extract feature points of the sample image to obtain a sample feature point set containing different feature points;
[0320] The second determination module is used to determine the ratio of each sample feature point in the key frame image to obtain a ratio vector set;
[0321] The first storage module is used to store the ratio vector set and the key image feature set to obtain the first map.
[0322] In the above device, the device further comprises:
[0323] A second selection module, used for selecting a preset number of corner points from the sample image;
[0324] A third determination module, configured to determine that the scenes corresponding to the sample images are continuous scenes if the number of identical corner points contained in two sample images with adjacent acquisition times is greater than or equal to a sixth threshold;
[0325] The fourth determination module is configured to determine that the scene corresponding to the sample images is a discrete scene if the number of identical corner points contained in two sample images with adjacent acquisition times is less than a sixth threshold.
[0326] In the above device, the first selection module includes:
[0327] A first selection submodule, configured to select a key frame image from a sample image library according to an input selection instruction if the scene corresponding to the sample image is a discrete scene;
[0328] The second selection submodule is used to select a key frame image from the sample image library according to a preset frame rate or parallax if the scene corresponding to the sample image is a continuous scene.
[0329] In the above device, the second determining module includes:
[0330] A second determination submodule is used to determine a first average number of times according to a first number of sample images included in the sample image library and the first number of times the i-th sample feature point appears in the sample image library; wherein i is an integer greater than or equal to 1; and the first average number of times is used to indicate the average number of times the i-th sample feature point appears in each sample image;
[0331] A third determination submodule is used to determine a second average number of times according to a second number of times the i-th sample feature point appears in the j-th key frame image and a second number of sample feature points contained in the j-th key frame image; wherein j is an integer greater than or equal to 1; and the second average number of times is used to indicate the proportion of the i-th sample feature point in the sample feature points contained in the j-th key frame image;
[0332] The fourth determination submodule is used to obtain the ratio of the sample feature points in the key frame image according to the first average number of times and the second average number of times, and obtain the ratio vector set.
[0333] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0334] It should be noted that in the embodiments of the present application, if the above-mentioned map update method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling the automatic test line of the device containing the storage medium to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk.
[0335] Correspondingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the map updating method provided in the above embodiment are implemented.
[0336] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0337] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0338] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0339] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0340] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment of the present application.
[0341] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0342] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0343] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for the automatic test line of the device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks or optical disks.
[0344] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A map updating method, characterized in that: The method comprises: Obtaining a first image feature in a first map; According to the first image feature, matching a second image feature from a second map; wherein the scene information corresponding to the first map and the second map is partially the same; adding each key frame image in the first map to the second map according to the first image feature and the second image feature to obtain an updated second map; Before acquiring the first image feature in the first map, the method further includes: Selecting key frame images that meet preset conditions from the sample image library to obtain a key frame image set; Extract image features of each key frame image to obtain a key image feature set; Extract feature points of the sample image to obtain a sample feature point set containing different feature points; Determine the ratio of each sample feature point in the key frame image to obtain a ratio vector set; storing the ratio vector set and the key image feature set to obtain the first map; The matching a second image feature from a second map according to the first image feature includes: Respectively determine the ratios of different sample feature points in the sample feature point set to obtain a first ratio vector; Obtaining a second ratio vector, where the second ratio vector is a ratio of a plurality of sample feature points to feature points contained in the key frame image in the second map; Determine, from the image features of the key frame images in the second map, a similar image feature whose similarity to the first image feature is greater than a second threshold value, according to the first ratio vector and the second ratio vector; Determine similar key frame images to which the similar image features belong, and obtain a set of similar key frame images; Determine a time difference between acquisition times of at least two of the similar key frame images, and a similarity difference between image features of the at least two similar key frame images and the first image feature; Combine similar key frame images whose time difference is less than a third threshold and whose similarity difference is less than a fourth threshold to obtain a combined frame image; A second image feature whose similarity with the first image feature meets a preset similarity threshold is selected from the image features of the combined frame image.
2. The method according to claim 1, characterized in that The obtaining of the first image feature in the first map includes: Extract the key frame image to be matched in the first map to obtain the first image feature; wherein the key frame image to be matched is the key frame image in the first map.
3. The method according to claim 2, characterized in that According to the first image feature and the second image feature, each key frame image in the first map is added to the second map to obtain an updated second map, including: Acquire first position information of an image acquisition device used to acquire the key frame image to be matched in a first coordinate system of the first map; Determine second position information of the image acquisition device in a second coordinate system where the second map is located according to the first image feature and the second image feature; According to the first position information and the second position information, each key frame image in the first map is added to the second map to obtain an updated second map.
4. The method according to claim 3, characterized in that The step of adding each key frame image in the first map to the second map according to the first position information and the second position information to obtain an updated second map includes: Determining a conversion relationship between the first coordinate system and the second coordinate system according to the first position information and the second position information; According to the conversion relationship, the coordinates of the image acquisition device corresponding to each key frame image in the first map in the first coordinate system are adjusted so that the adjusted coordinates of the image acquisition device corresponding to each key frame image match the second coordinate system; The key frame image corresponding to each image acquisition device after the coordinates are adjusted is added to the second map to obtain the updated second map.
5. The method according to claim 1, characterized in that The first image feature includes: two-dimensional position information, three-dimensional position information and identification information of feature points of the key frame image in the first map; The second image features include: two-dimensional position information, three-dimensional position information and identification information of feature points of the key frame image in the second map; wherein the three-dimensional position information is obtained by mapping the two-dimensional position information into a coordinate system where the two-dimensional position information is located.
6. The method according to claim 2, characterized in that The step of extracting the key frame image to be matched in the first map to obtain the first image feature includes: Extracting feature points of each key frame image in the first map to obtain a feature point set; Determine identification information of each feature point in the feature point set and two-dimensional position information of each feature point in the key frame image; Each two-dimensional position information is mapped into the coordinate system of the first map to obtain the three-dimensional position information of each feature point.
7. The method according to claim 1, characterized in that The selecting, from the image features of the combined frame image, a second image feature whose similarity with the first image feature meets a preset similarity threshold, comprises: respectively determining the sum of similarities between the image features of each key frame image included in the plurality of joint frame images and the first image features; The combined frame image with the largest sum of similarities is determined as the target combined frame image with the highest similarity to the key frame image to be matched; According to the identification information of the feature points of the target joint frame image and the identification information of the feature points of the key frame image to be matched, a second image feature whose similarity with the first image feature meets a preset similarity threshold is selected from the image features of the target joint frame image.
8. The method according to claim 3, characterized in that Before determining the second position information of the image acquisition device in the second coordinate system of the second map according to the first image feature and the second image feature, the method further includes: Determine a target Euclidean distance between any two feature points contained in the key frame image corresponding to the second image feature, which is less than a first threshold, to obtain a target Euclidean distance set; Correspondingly, determining the second position information of the image acquisition device in the second coordinate system of the second map according to the first image feature and the second image feature includes: If the number of target Euclidean distances contained in the target Euclidean distance set is greater than a fifth threshold, the second position information is determined based on the three-dimensional position information of the feature points of the key frame image corresponding to the second image feature and the two-dimensional position information of the feature points of the key frame image corresponding to the first image feature.
9. The method according to claim 1, characterized in that: Before selecting a key frame image satisfying a preset condition from the sample image library to obtain a key frame image set, the method further includes: Selecting a preset number of corner points from the sample image; If the number of identical corner points contained in two sample images with adjacent acquisition times is greater than or equal to a sixth threshold, determining that the scenes corresponding to the sample images are continuous scenes; If the number of identical corner points contained in two sample images with adjacent acquisition times is less than a sixth threshold, it is determined that the scene corresponding to the sample images is a discrete scene.
10. The method according to claim 1, characterized in that The step of selecting key frame images that meet preset conditions from the sample image library to obtain a key frame image set includes: If the scene corresponding to the sample image is a discrete scene, selecting a key frame image from a sample image library according to an input selection instruction; If the scene corresponding to the sample image is a continuous scene, a key frame image is selected from the sample image library according to a preset frame rate or parallax.
11. The method according to claim 1, characterized in that: The determining of the ratio of each sample feature point in the key frame image to obtain a ratio vector set includes: Determine a first average number of times according to a first number of sample images included in the sample image library and the first number of times the i-th sample feature point appears in the sample image library; wherein i is an integer greater than or equal to 1; and the first average number of times is used to indicate the average number of times the i-th sample feature point appears in each sample image; Determine a second average number of times according to a second number of times the i-th sample feature point appears in the j-th key frame image and a second number of sample feature points contained in the j-th key frame image; wherein j is an integer greater than or equal to 1; and the second average number of times is used to indicate the proportion of the i-th sample feature point in the sample feature points contained in the j-th key frame image; According to the first average times and the second average times, the ratio of the sample feature points in the key frame image is obtained, and the ratio vector set is obtained.
12. A map updating device, characterized in that: The device comprises: a first acquisition module, a first matching module and a first updating module, wherein: The first acquisition module is used to acquire a first image feature in a first map; The first matching module is used to match the second image feature from the second map according to the first image feature; The first updating module is used to add each key frame image in the first map to the second map according to the first image feature and the second image feature to obtain an updated second map; The device also includes: A first selection module is used to select key frame images that meet preset conditions from a sample image library to obtain a key frame image set; A first extraction module is used to extract image features of each key frame image to obtain a key image feature set; The second extraction module is used to extract feature points of the sample image to obtain a sample feature point set containing different feature points; A second determination module is used to determine the ratio of each sample feature point in the key frame image to obtain a ratio vector set; A first storage module, used for storing the ratio vector set and the key image feature set to obtain the first map; The first matching module includes a first matching submodule; the first matching submodule includes: a third determining unit, a first acquiring unit, and a first matching unit; The third determination unit is used to respectively determine the ratios of different sample feature points in the sample feature point set to obtain a first ratio vector; the first acquisition unit is used to acquire a second ratio vector, where the second ratio vector is the ratios of multiple sample feature points in the feature points contained in the key frame image in the second map; The first matching unit includes: a first determining subunit, a second determining subunit and a first selecting subunit; The first determining subunit is used to determine, from the image features of the key frame images in the second map, similar image features having a similarity with the first image features greater than a second threshold value according to the first ratio vector and the second ratio vector; The second determining subunit is used to determine the similar key frame images to which the similar image features belong, and obtain a similar key frame image set; The first selection subunit is used to determine the time difference between the acquisition times of at least two of the similar key frame images, and the similarity difference between the image features of the at least two similar key frame images and the first image feature; combine the similar key frame images whose time difference is less than a third threshold and whose similarity difference is less than a fourth threshold to obtain a combined frame image; and select, from the image features of the combined frame image, a second image feature whose similarity with the first image feature satisfies a preset similarity threshold.
13. A terminal comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps in the method according to any one of claims 1 to 11 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
