A method, system, device and medium for visual positioning combined with map information
By matching and clustering with the map database, combined with the PnP algorithm to calculate the 6DoF pose of the image, the problems of inaccurate positioning and low matching efficiency in the existing technology are solved, and efficient and accurate positioning in complex scenes is achieved.
Patent Information
- Application Number
- CN202111087441.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-16
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-09-16
AI Technical Summary
The existing technology has problems such as inaccurate positioning, low matching efficiency and high time cost when visual positioning of images. It is especially difficult to obtain accurate 6DoF poses when the scene is complex or has multiple textures.
By obtaining the feature vectors and key points of the image to be located, matching it with the map database, clustering the candidate location images, selecting the closest set for feature matching, combining 2D-3D matching, using the PnP algorithm to calculate the pose, and through multi-level Verify the final result.
It improves positioning accuracy and matching efficiency, reduces computing resource overhead, eliminates error interference, and ensures the accuracy of positioning results, especially in complex scenarios, which effectively improves positioning accuracy.
Smart Images

Figure CN113963188B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method, system, device and medium for visual positioning in combination with map information. Background Art
[0002] 3D visual positioning refers to calculating the position and posture of the camera when a certain image was taken based on a pre-built 3D model and related information. This is a very important technology in 3D vision and can be used to help achieve personnel positioning and navigation. The conventional method of visual positioning is to input image information, and output the 6DoF posture of the image through feature extraction, feature matching, and PnP calculation.
[0003] However, in the related art, when visually positioning an image, on the one hand, if the scene and the image to be positioned have multiple similar features and the correct position cannot be distinguished, then an erroneous positioning result is usually obtained, or the positioning result cannot be calculated. On the other hand, when matching features, the entire scene is matched, but because the database is too large, not only is the matching speed slow, but it is also easy to introduce too much noise; or, there may be some erroneous images that are mistakenly introduced, and feature matching on them not only wastes time, but also easily introduces too much noise points, resulting in biased results or inability to solve.
[0004] Currently, no effective solution has been proposed for the problems of inaccurate positioning, low matching efficiency and high time cost when performing visual positioning of images in related technologies. Summary of the invention
[0005] The embodiments of the present application provide a method, system, device and medium for visual positioning in combination with map information, so as to at least solve the problems of inaccurate positioning, low matching efficiency and high time cost when visually positioning images in the related art.
[0006] In a first aspect, an embodiment of the present application provides a method for visual positioning in combination with map information, the method comprising:
[0007] Acquire an image to be located, extract a feature vector, key points and key point descriptors of the image to be located, and match the feature vector with an image feature vector in a map database to obtain a candidate location image set;
[0008] According to the image pose, the candidate location image set is sorted, two sets with the closest distance to the feature vector of the image to be located are selected, and according to the custom algorithm, a first close set is selected from the two sets, and the key point descriptors of the image to be located are feature matched with the key point descriptors of the images in the first close set to obtain key point matching point pairs;
[0009] According to the key point matching point pairs, or the 2D-3D matching pairs between the image to be located and the map, the images in the first close set are sorted by association, the initial value of the pose of the image to be located is estimated, and the final 6DoF pose of the image to be located is calculated by the PnP algorithm;
[0010] By comparing the distance and angle between the final 6DoF pose and the initial pose value, the final 6DoF pose is verified to obtain a positioning result.
[0011] In some embodiments, before matching the feature vector with an image feature vector in a map database to obtain a candidate location image set, the method includes:
[0012] Acquire the map database, wherein the map database includes a map scene image, a feature vector of the image, key points and key point descriptors of the image, 6DoF pose information of the image, and a map scene image. Figure 3 The information of point D, and the key points of the image and the location Figure 3 The association information between D points.
[0013] In some embodiments, matching the feature vector with an image feature vector in a map database to obtain a candidate location image set includes:
[0014] Calculating the Euclidean distance between the feature vector of the image to be located and the feature vector of the image in the map database, sorting them according to the distance, and selecting the first N images with the closest distance in the map database as candidate location images;
[0015] The candidate location images are clustered according to the image poses to obtain a plurality of candidate location image sets.
[0016] In some embodiments, selecting the first close set from the two sets according to the custom algorithm includes:
[0017] According to the distance discrimination formula, it is judged whether the image to be located has ambiguity, wherein the distance discrimination formula is: d1>αd2, α is a proportional coefficient of 0-1, d1 is the average distance between the feature vector of the image to be located and the first close set, and d2 is the average distance between the feature vector of the image to be located and the second close set;
[0018] When the distance discrimination formula is established, the image to be located is ambiguous, and the conclusion is returned and the positioning process is terminated;
[0019] When the distance discrimination formula is not valid, the image to be located does not have ambiguity, and the first close set is selected.
[0020] In some embodiments, before performing feature matching between the key point descriptors of the image to be located and the key point descriptors of the images in the first close set, the method includes:
[0021] The images in the first close set are sorted according to the feature vector distance, and M images are selected, wherein the selection method includes but is not limited to scene characteristics, image texture or distance.
[0022] In some embodiments, the step of sorting the images in the first close set by degree of association and estimating the initial value of the position and posture of the image to be located comprises:
[0023] P candidate images with the highest correlation are selected, and according to the poses of the candidate images, an initial pose value of the image to be positioned is estimated by a coarse positioning estimation method.
[0024] In some embodiments, verifying the final 6DoF pose by comparing the distance and angle between the final 6DoF pose and the initial pose value includes:
[0025] A distance deviation threshold and an angle deviation threshold are preset. When the distance deviation between the final 6DoF pose and the initial pose value exceeds the distance deviation threshold, or the angle deviation between the final 6DoF pose and the initial pose value exceeds the angle deviation threshold, the final 6DoF pose verification fails, the final 6DoF pose is discarded and the positioning process is terminated. Otherwise, the verification passes and the final 6DoF pose is returned as the positioning result.
[0026] In a second aspect, an embodiment of the present application provides a system for visual positioning in combination with map information, the system comprising:
[0027] An acquisition module is used to acquire the image to be located, and extract the feature vector, key points and key point descriptors of the image to be located;
[0028] A retrieval module, used to match the feature vector with the image feature vector in the map database to obtain a candidate location image set;
[0029] A matching module, used to sort the candidate location image set according to the image pose, select two sets with the closest distance to the feature vector of the image to be located, and select a first close set from the two sets according to a custom algorithm, and perform feature matching between the key point descriptor of the image to be located and the key point descriptor of the image in the first close set to obtain a key point matching point pair;
[0030] A positioning module, configured to sort the images in the first close set by association according to the key point matching point pairs or the 2D-3D matching pairs between the image to be positioned and the map, estimate the initial value of the pose of the image to be positioned, and calculate the final 6DoF pose of the image to be positioned through a PnP algorithm;
[0031] The verification module is used to verify the final 6DoF posture by comparing the distance and angle between the final 6DoF posture and the initial posture value to obtain a positioning result.
[0032] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for visual positioning combined with map information as described in the first aspect above is implemented.
[0033] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for visual positioning combined with map information as described in the first aspect above.
[0034] Compared with the related art, the method for visual positioning combined with map information provided in the embodiment of the present application obtains the image to be positioned, extracts the feature vector, key points and key point descriptors of the image to be positioned, and matches the feature vector with the image feature vector in the map database to obtain a set of candidate location images; then, according to the image pose, the candidate location image set is sorted, the two sets with the closest distance to the feature vector of the image to be positioned are selected, and according to the custom algorithm, the first close set is selected from the two sets, and the key point descriptors of the image to be positioned are feature matched with the key point descriptors of the images in the first close set to obtain key point matching point pairs; then, according to the key point matching point pairs, or the 2D-3D matching pairs between the image to be positioned and the map, the images in the first close set are sorted by correlation, the initial pose value of the image to be positioned is estimated, and the final 6DoF pose of the image to be positioned is calculated through the PnP algorithm; finally, by comparing the distance and angle between the final 6DoF pose and the initial pose value, the final 6DoF pose is verified to obtain the positioning result.
[0035] The beneficial effects of this application are: 1. By clustering the candidate location images, the search range is locked in a very small area, reducing the computer resource overhead of subsequent key point matching and other steps, which is conducive to improving the calculation speed. 2. This application eliminates a lot of error interference through multi-level verification and similarity comparison, which can not only improve the matching efficiency, so that the final solved positioning result can be output stably, but also ensure the accuracy of the positioning result, especially in the case of repeated textures and similar scenes, it can effectively improve the positioning accuracy. It solves the problems of inaccurate positioning, low matching efficiency and high time cost in the related technology when visually positioning images. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0037] Figure 1 is a schematic diagram of an application environment of a method for visual positioning in combination with map information according to an embodiment of the present application;
[0038] Figure 2 is a flow chart of a method for visual positioning in combination with map information according to an embodiment of the present application;
[0039] Figure 3 is a structural block diagram of a system for visual positioning in combination with map information according to an embodiment of the present application;
[0040] Figure 4 It is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means, and should not be understood as insufficient contents disclosed in the present application.
[0042] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0043] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.
[0044] The method of visual positioning combined with map information provided in this application can be applied to Figure 1 In the application environment shown, Figure 1 is a schematic diagram of an application environment of a method for visual positioning in combination with map information according to an embodiment of the present application, such as Figure 1As shown. Among them, the terminal 11 communicates with the server 10 through the network. The server 10 obtains the image to be located, extracts the feature vector, key points and key point descriptors of the image to be located, and matches the feature vector with the image feature vector in the map database to obtain a candidate location image set; then, according to the image pose, the candidate location image set is sorted, and the two sets with the closest distance to the feature vector of the image to be located are selected, and according to the custom algorithm, the first close set is selected from the two sets, and the key point descriptors of the image to be located are matched with the key point descriptors of the images in the first close set to obtain key point matching point pairs; then, according to the key point matching point pairs, or the 2D-3D matching pairs between the image to be located and the map, the images in the first close set are sorted by association, the initial pose value of the image to be located is estimated, and the final 6DoF pose of the image to be located is calculated by the PnP algorithm; finally, by comparing the distance and angle between the final 6DoF pose and the initial pose value, the final 6DoF pose is verified to obtain the positioning result, and displayed on the terminal 11. The terminal 11 may be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 10 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0045] This embodiment provides a method for visual positioning combined with map information. Figure 2 is a flow chart of a method for visual positioning in combination with map information according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0046] Step S201, obtaining an image to be located, extracting a feature vector, key points and key point descriptors of the image to be located, and matching the feature vector with an image feature vector in a map database to obtain a candidate location image set;
[0047] Preferably, before matching the feature vector with the image feature vector in the map database to obtain the candidate location image set, the present embodiment needs to obtain map data from a pre-built map database, wherein the map database includes map scene images, image feature vectors, image key points and key point descriptors, image 6DoF pose information, and location information. Figure 3 The information of point D, as well as the key points of the image and the location Figure 3 The association information between D points, etc.
[0048] Next, the present embodiment obtains the image to be located, extracts the feature vector, key points and key point descriptors of the image to be located, and matches the feature vector with the image feature vector in the map database to obtain a set of candidate location images. Optionally, the present embodiment first calculates the Euclidean distance between the feature vector of the image to be located and the image feature vector in the map database, and then sorts the images in the map database according to the calculated distance, and selects the first N images with the closest distance in the map database as candidate location images. Among them, N is generally selected from tens to thousands of values according to the size of the scene, the density of the image sampling positions in the map database, etc.; finally, the candidate location images are clustered according to the image pose, wherein the clustering method includes: k-means, DBSCAN and other algorithms, to obtain a number of candidate location image sets, for example, {S1, S2, ...}.
[0049] This embodiment selects candidate location images that are close to the image to be located from the map database through feature matching, and then locks the search range into a very small area by clustering the candidate location images, thereby reducing the computer resource overhead in subsequent key point matching steps and improving the calculation speed;
[0050] Step S202, sorting the candidate location image sets according to the image pose, selecting two sets with the closest distance to the feature vector of the image to be located, and selecting a first close set from the two sets according to a custom algorithm, and performing feature matching between the key point descriptors of the image to be located and the key point descriptors of the images in the first close set to obtain key point matching point pairs;
[0051] Preferably, this embodiment sorts the candidate location image sets according to the image pose, and selects two sets with the closest distance to the feature vector of the image to be located. Optionally, the method of selecting the set includes but is not limited to 1. selecting the set according to the image consistency classification, such as the scene characteristics of the image or the image texture; 2. selecting the set according to the custom rule, such as the regional concentration interval;
[0052] Next, the two selected sets are further verified and selected. Optionally, this embodiment determines whether there is ambiguity in the image to be located according to the distance discrimination formula, wherein the distance discrimination formula is: d1>αd2, α is a proportional coefficient of 0-1, d1 is the average distance from the feature vector of the image to be located to the first close set, and d2 is the average distance from the feature vector of the image to be located to the second close set; when the distance discrimination formula is established, there is ambiguity in the image to be located, and the conclusion is returned to the corresponding upper-layer logic, and the positioning process is terminated; when the distance discrimination formula is not established, it means that there is no ambiguity in the image to be located, then the set with the closest distance to the feature vector of the image to be located in the above two sets is selected, and the key point descriptor of the image to be located is feature matched with the key point descriptor of the image in the first close set to obtain a key point matching point pair;
[0053] Preferably, before feature matching is performed between the key point descriptors of the image to be located and the key point descriptors of the images in the first close set, the images in the first close set need to be sorted according to the feature vector distance and M images are selected, wherein the selection method includes but is not limited to image selection based on scene characteristics, image texture richness or distance, etc.
[0054] This embodiment eliminates many erroneous interference factors through multi-level verification and similarity comparison, improves matching efficiency, and enables the subsequent final positioning result to be output stably without being interfered by excessive noise;
[0055] Step S203, sorting the images in the first close set by correlation according to the key point matching pairs or the 2D-3D matching pairs between the image to be located and the map, estimating the initial pose value of the image to be located, and calculating the final 6DoF pose of the image to be located by the PnP algorithm;
[0056] Specifically, in this embodiment, the 2D-3D matching pairs between the image to be located and the map are based on the key points of the image and the map in the map database. Figure 3 The association information between the 2D key points in the image to be located and the 3D points in the map is obtained.
[0057] Preferably, this embodiment sorts the M images in the first close set obtained in step S202 by association according to key point matching pairs or 2D-3D matching pairs between the image to be located and the map.
[0058] Optionally, this embodiment selects P candidate images with the highest correlation among M images, and estimates the initial value of the pose of the image to be positioned through a rough positioning estimation method based on the pose of the candidate images. The rough positioning estimation method includes: 1. average value calculation 2. weighted average value calculation 3. centroid 4. directly selecting the pose of the most correlated image and other methods.
[0059] Furthermore, this embodiment uses different PnP algorithms to substitute the initial pose values obtained above, and iteratively calculates the final 6DoF pose of the image to be positioned;
[0060] Step S204, by comparing the distance and angle between the final 6DoF posture and the initial posture value, the final 6DoF posture is verified to obtain the positioning result.
[0061] Specifically, this embodiment presets a distance deviation threshold and an angle deviation threshold, and verifies the final 6DoF pose by comparing the distance and angle between the final 6DoF pose and the initial pose value. When the distance deviation between the final 6DoF pose and the initial pose value exceeds the distance deviation threshold, or the angle deviation between the final 6DoF pose and the initial pose value exceeds the angle deviation threshold, the final 6DoF pose verification fails, the final 6DoF pose result is discarded, and the positioning process is terminated; if both the distance and the angle are verified, the final 6DoF pose is returned as the positioning result.
[0062] This embodiment obtains the positioning result by comparing and verifying the final posture, which can effectively ensure the correctness of the positioning result, especially in the case of repeated textures and similar scenes, and can effectively improve the positioning accuracy.
[0063] Through the above steps S201 to S204, the embodiment of the present application reduces the search range by clustering locations, improves the calculation speed of key point matching, and eliminates a lot of error interference through multi-level verification and similarity comparison, which not only improves the matching efficiency, so that the final solved positioning result can be output stably, but also ensures the accuracy of the positioning result, especially in the case of repeated textures and similar scenes, which can effectively improve the positioning accuracy. The problems of inaccurate positioning, low matching efficiency and high time cost in the related art when visually positioning images are solved.
[0064] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0065] This embodiment also provides a system for visual positioning in combination with map information, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the terms "module", "unit", "subunit", etc. may be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0066] Figure 3 is a structural block diagram of a system for visual positioning in combination with map information according to an embodiment of the present application, such as Figure 3 As shown, the system includes an acquisition module 31, a retrieval module 32, a matching module 33, a positioning module 34 and a verification module 35:
[0067] The acquisition module 31 is used to acquire the image to be located, and extract the feature vector, key points and key point descriptors of the image to be located; the retrieval module 32 is used to match the feature vector with the image feature vector in the map database to obtain a candidate location image set; the matching module 33 is used to sort the candidate location image set according to the image pose, select the two sets with the closest distance to the feature vector of the image to be located, and select the first close set from the two sets according to the custom algorithm, and perform feature matching on the key point descriptors of the image to be located with the key point descriptors of the images in the first close set to obtain key point matching point pairs; the positioning module 34 is used to sort the images in the first close set according to the key point matching point pairs, or the 2D-3D matching pairs between the image to be located and the map, estimate the initial pose value of the image to be located, and calculate the final 6DoF pose of the image to be located through the PnP algorithm; the verification module 35 is used to verify the final 6DoF pose by comparing the distance and angle between the final 6DoF pose and the initial pose value to obtain the positioning result.
[0068] Through the above system, the embodiment of the present application clusters locations, narrows the search range, and improves the calculation speed of key point matching. In addition, the matching module 33 and the verification module 35 also eliminate more error interference through multi-level verification and similarity comparison, which can not only improve the matching efficiency, so that the final solved positioning result can be output stably, but also ensure the accuracy of the positioning result, especially in the case of repeated textures and similar scenes, which can effectively improve the positioning accuracy. The problems of inaccurate positioning, low matching efficiency and high time cost in the related art when visually positioning images are solved.
[0069] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0070] In addition, it should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0071] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0072] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0073] In addition, in combination with the method of visual positioning in combination with map information in the above embodiments, the present application embodiment can provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the methods of visual positioning in combination with map information in the above embodiments is implemented.
[0074] In one embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for visual positioning combined with map information is implemented. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball, or touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0075] In one embodiment, Figure 4 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application, such as Figure 4 As shown, an electronic device is provided, which may be a server, and its internal structure diagram may be as shown in Figure 4As shown. The electronic device includes a processor, a network interface, an internal memory and a non-volatile memory connected through an internal bus, wherein the non-volatile memory stores an operating system, a computer program and a database. The processor is used to provide computing and control capabilities, the network interface is used to communicate with an external terminal through a network connection, the internal memory is used to provide an environment for the operation of the operating system and the computer program, the computer program is executed by the processor to implement a method for visual positioning combined with map information, and the database is used to store data.
[0076] Those skilled in the art will understand that Figure 4 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0077] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0078] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0079] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for visual positioning combined with map information, characterized in that: The method comprises: Acquire an image to be located, extract a feature vector, key points and key point descriptors of the image to be located, and match the feature vector with an image feature vector in a map database to obtain a candidate location image set; According to the image pose, the candidate location image set is sorted, two sets with the closest distance to the feature vector of the image to be located are selected, and according to the custom algorithm, a first close set is selected from the two sets, and the key point descriptors of the image to be located are feature matched with the key point descriptors of the images in the first close set to obtain key point matching point pairs; According to the key point matching point pairs, or the 2D-3D matching pairs between the image to be located and the map, the images in the first close set are sorted by association, the initial value of the pose of the image to be located is estimated, and the final 6DoF pose of the image to be located is calculated by the PnP algorithm; By comparing the distance and angle between the final 6DoF pose and the initial pose value, the final 6DoF pose is verified to obtain a positioning result.
2. The method according to claim 1, characterized in that Before matching the feature vector with the image feature vector in a map database to obtain a candidate location image set, the method includes: Acquire the map database, wherein the map database includes a map scene image, a feature vector of the image, image key points and key point descriptors, 6DoF pose information of the image, information of map 3D points, and association information between the image key points and the map 3D points.
3. The method according to claim 1, characterized in that The step of matching the feature vector with the image feature vector in a map database to obtain a candidate location image set includes: Calculating the Euclidean distance between the feature vector of the image to be located and the feature vector of the image in the map database, sorting them according to the distance, and selecting the first N images with the closest distance in the map database as candidate location images; The candidate location images are clustered according to the image poses to obtain a plurality of candidate location image sets.
4. The method according to claim 1, characterized in that: The selecting the first close set from the two sets according to the custom algorithm comprises: According to the distance discrimination formula, it is judged whether the image to be located has ambiguity, wherein the distance discrimination formula is: d1>αd2, α is a proportional coefficient of 0-1, d1 is the average distance between the feature vector of the image to be located and the first close set, and d2 is the average distance between the feature vector of the image to be located and the second close set; When the distance discrimination formula is established, the image to be located is ambiguous, and the conclusion is returned and the positioning process is terminated; When the distance discrimination formula is not valid, the image to be located does not have ambiguity, and the first close set is selected.
5. The method according to claim 1, characterized in that Before performing feature matching between the key point descriptors of the image to be located and the key point descriptors of the images in the first close set, the method includes: The images in the first close set are sorted according to the feature vector distance, and M images are selected, wherein the selection method includes but is not limited to scene characteristics, image texture or distance.
6. The method according to claim 1, characterized in that The step of sorting the images in the first close set by degrees of association and estimating the initial value of the position and posture of the image to be located comprises: P candidate images with the highest correlation are selected, and according to the poses of the candidate images, an initial pose value of the image to be positioned is estimated by a coarse positioning estimation method.
7. The method according to claim 1, characterized in that The verifying the final 6DoF pose by comparing the distance and the angle between the final 6DoF pose and the initial pose value comprises: A distance deviation threshold and an angle deviation threshold are preset. When the distance deviation between the final 6DoF pose and the initial pose value exceeds the distance deviation threshold, or the angle deviation between the final 6DoF pose and the initial pose value exceeds the angle deviation threshold, the final 6DoF pose verification fails, the final 6DoF pose is discarded and the positioning process is terminated. Otherwise, the verification passes and the final 6DoF pose is returned as the positioning result.
8. A system combining map information with visual positioning, characterized in that: The system comprises: An acquisition module is used to acquire the image to be located, and extract the feature vector, key points and key point descriptors of the image to be located; A retrieval module, used to match the feature vector with the image feature vector in the map database to obtain a candidate location image set; A matching module, used to sort the candidate location image set according to the image pose, select two sets with the closest distance to the feature vector of the image to be located, and select a first close set from the two sets according to a custom algorithm, and perform feature matching between the key point descriptor of the image to be located and the key point descriptor of the image in the first close set to obtain a key point matching point pair; A positioning module, configured to sort the images in the first close set by association according to the key point matching point pairs or the 2D-3D matching pairs between the image to be positioned and the map, estimate the initial value of the pose of the image to be positioned, and calculate the final 6DoF pose of the image to be positioned through a PnP algorithm; The verification module is used to verify the final 6DoF posture by comparing the distance and angle between the final 6DoF posture and the initial posture value to obtain a positioning result.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the method for visual positioning combined with map information according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method for visual positioning combined with map information according to any one of claims 1 to 7 when running.
