Visual positioning method and system
By selecting an appropriate visual positioning method based on scene information, the problems of high computational consumption, increased data storage, and poor adaptability in visual positioning in the existing technology are solved, and high-precision visual positioning in all weather and all scenes is achieved, which is suitable for various applications. equipment.
Patent Information
- Application Number
- CN201911208660.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-30
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2039-11-30
AI Technical Summary
Existing visual positioning methods consume large amounts of calculations, increase data storage, and have poor adaptability in ultra-large-scale scenarios. They are unable to achieve high-precision positioning in all weather and all scenarios, especially on small devices such as mobile phones. position.
By obtaining the scene information of the positioning position, including indoor, outdoor, weak texture, rich texture, micro-scene, etc., select the corresponding positioning method and use different positioning methods such as direct method, indirect method, CNN method and point cloud registration method. Achieve all-weather, all-scenario visual positioning.
It achieves high-precision, low-power visual positioning in various scenarios, is suitable for large and small equipment, meets all-weather and all-scenario positioning requirements, and improves computing efficiency and accuracy.
Smart Images

Figure CN112884834B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a visual positioning method and system. Background Art
[0002] With the development of the new generation of communication technology, data bandwidth has been greatly expanded, latency has been reduced, and data traffic has increased significantly, enabling various types of electronic devices (mobile phones, virtual reality (VR) glasses, car head up display (HUD), etc.) to wirelessly receive ultra-large-scale data, meet the needs of visual positioning technology, and realize ultra-large-scale augmented reality applications. Its application scenarios include: navigation, augmented reality games, the Internet of Things (IOT) information, advertising display, holographic entertainment, etc. At the same time, large-scale visual positioning technology is a key capability for large-scale equipment such as autonomous driving and drones.
[0003] Visual positioning technology uses the captured images as the data source and matches them with offline maps to achieve positioning. It has the advantages of short time, low power consumption, easy maintenance, and high accuracy. Visual positioning methods include: direct method, indirect method and convolution neural network (CNN) method. However, the above visual positioning methods have the following defects:
[0004] 1. Direct method: For ultra-large-scale scenarios, the matching process of the direct method is too time-consuming. As the map size increases, the computing consumption also increases. In addition, the direct method places great demands on computing power and data organization structure during matching.
[0005] 2. Indirect method: Due to the use of intermediate structures, the indirect method increases the amount of data storage, and the effect becomes worse when the density of intermediate structure sampling becomes sparse. In addition, searching first and then matching makes the algorithm more steps and takes longer time.
[0006] 3. CNN method: The end-to-end method of directly obtaining the pose has the problem of data overfitting. In addition, after replacing the usage scenario, the CNN method may require a lot of fine-tuning work to adapt the network to the new scenario.
[0007] Therefore, any of the above-mentioned visual positioning methods cannot be adapted to all scenarios for executing positioning requests, and cannot achieve all-weather, all-scenario visual positioning.
[0008] At the same time, the indirect method in the existing methods cannot achieve high-precision positioning under the sensor conditions provided by small devices (such as mobile phones) due to data sources, matching algorithms, and calculation speed. Summary of the invention
[0009] The present application provides a visual positioning method and system to achieve high-precision, all-weather, and all-scenario visual positioning.
[0010] In a first aspect, a visual positioning method is provided, which is applied to a visual positioning system, and the method includes: obtaining scene information of a positioning position, wherein the scene information includes at least one of the following information: indoor, outdoor, weak texture, rich texture, micro scene, indoor size, day, and night; determining the scene of the positioning position according to the scene information; and selecting a corresponding positioning method according to the scene of the positioning position.
[0011] Different positioning methods can be selected according to the scenes where the positioning locations are located, so as to achieve all-weather and all-scene visual positioning.
[0012] In one implementation, the acquiring of scene information of the positioning position includes: acquiring indoor and outdoor identification of the scene of the positioning position, and determining whether the scene of the positioning position is indoor or outdoor according to the indoor and outdoor identification; or performing semantic segmentation on a first image taken at the positioning position, removing information of moving objects on the first image, extracting the edge of the first image to obtain an edge image, and calculating the number of valid pixels of the edge image, and when the number of valid pixels of the edge image is less than or equal to a first pixel number threshold, determining that the scene of the positioning position is a weak texture scene; when the number of valid pixels of the edge image is greater than or equal to a second pixel number threshold, determining that the scene of the positioning position is a scene with rich texture, wherein the first pixel number threshold is less than the second pixel number threshold; or acquiring a second image of the scene of the positioning position, the second image being a depth image of the first image, and when the distance between the scene in the depth image and the positioning position is less than or equal to a first distance threshold, determining that the scene of the positioning position is a micro scene.
[0013] The above method can accurately determine the scene information of the positioning location.
[0014] In another implementation, the corresponding positioning method is selected according to the scene where the positioning position is located, including: when the scene where the positioning position is located is a texture-rich indoor scene, selecting the first positioning method for visual positioning; or when the scene where the positioning position is located is an outdoor scene, selecting the second positioning method for visual positioning; or when the scene where the positioning position is located is an indoor large room scene with weak texture, selecting the third positioning method for visual positioning; or when the scene where the positioning position is located is an indoor small room scene with weak texture, selecting the fourth positioning method for visual positioning; or when the scene where the positioning position is located is an indoor micro scene, selecting the fifth positioning method for visual positioning; wherein the first positioning method, the second positioning method, the third positioning method, the fourth positioning method, and the fifth positioning method use different positioning methods.
[0015] By selecting the corresponding positioning method according to the scenes where the positioning positions are located, all-weather and all-scene visual positioning can be achieved.
[0016] In another implementation, when the scene where the positioning position is located is an indoor large room scene with weak texture, a third positioning method is selected for visual positioning, including: obtaining a first image taken at the positioning position; searching a database for one or more frames of images closest to the first image to obtain one or more candidate images; rendering from multiple directions with a first step length according to the shooting posture of each candidate image in the one or more candidate images to obtain rendered images in multiple directions; comparing the difference between each candidate image and the rendered images in multiple directions of each candidate image; and rendering from the direction with the smallest difference with at least one second step length, and performing the step of comparing the difference between each candidate image and the rendered images in multiple directions of each candidate image, until the difference is less than a first threshold, and the shooting posture of the candidate image obtained is the final position of the positioning position.
[0017] For indoor large room scenes with weak textures, the CNN and image comparison methods can be used to accurately obtain the positioning position.
[0018] In another implementation, when the scene where the positioning position is located is an indoor small room scene with weak texture, a fourth positioning method is selected for visual positioning, including: obtaining a first image taken at the positioning position and an initial positioning position; extracting and processing the first image through one or more candidate networks for extracting postures to obtain one or more postures; and performing weighted averaging of the one or more positions according to the center point position of the coverage area of the one or more candidate networks to obtain the final position of the positioning position.
[0019] For indoor small room scenes with weak textures, the end-to-end CNN method can accurately obtain the positioning position.
[0020] In a second aspect, a visual positioning method is provided, which is applied to a visual positioning system, wherein the visual positioning system includes a visual positioning device and a cloud server; the visual positioning device obtains a first image taken at a positioning position and extracts a feature descriptor of the first image; the visual positioning device sends index information of the feature descriptor of the first image to the cloud server; the cloud server obtains the feature descriptor corresponding to the index information based on the index information of the feature descriptor of the first image, and searches a database for a feature descriptor that is closest to the feature descriptor of the first image to obtain a candidate feature descriptor, and calculates a final position of the positioning position based on the candidate feature descriptor; and the cloud server returns the final position of the positioning position to the visual positioning device; wherein the feature descriptors include local feature descriptors and global feature descriptors.
[0021] In a third aspect, a visual positioning system is provided, the system comprising: a first acquisition unit, used to acquire scene information of a positioning position, the scene information comprising at least one of the following information: indoor, outdoor, weak texture, rich texture, micro scene, indoor size, day, and night; a determination unit, used to determine the scene of the positioning position according to the scene information; and a selection unit, used to select a corresponding positioning method according to the scene of the positioning position.
[0022] In one implementation, the first acquisition unit is used to acquire indoor and outdoor identifications of the scene where the positioning location is located; and the determination unit is used to determine whether the scene where the positioning location is located is indoor or outdoor according to the indoor and outdoor identifications.
[0023] In another implementation, the system further includes: a segmentation unit for performing semantic segmentation on a first image captured at the positioning position; a removal unit for removing information of moving objects on the first image; a first extraction unit for extracting the edge of the first image to obtain an edge image; a calculation unit for calculating the number of valid pixels of the edge image; the determination unit for determining that the scene at the positioning position is a weak-texture scene when the number of valid pixels of the edge image is less than or equal to a first pixel number threshold; and the determination unit is also for determining that the scene at the positioning position is a rich-texture scene when the number of valid pixels of the edge image is greater than or equal to a second pixel number threshold, wherein the first pixel number threshold is less than the second pixel number threshold.
[0024] In another implementation, the system also includes: a second acquisition unit, used to acquire a second image of the scene where the positioning position is located, the second image being a depth image of the first image; and the determination unit, used to determine that the scene where the positioning position is located is a micro scene when the distance between the scene in the depth image and the positioning position is less than or equal to a first distance threshold.
[0025] In another implementation, the selection unit is used to select the first positioning method for visual positioning when the scene where the positioning position is located is a texture-rich indoor scene; or the selection unit is used to select the second positioning method for visual positioning when the scene where the positioning position is located is an outdoor scene; or the selection unit is used to select the third positioning method for visual positioning when the scene where the positioning position is located is an indoor large room scene with weak texture; or the selection unit is used to select the fourth positioning method for visual positioning when the scene where the positioning position is located is an indoor small room scene with weak texture; or the selection unit is used to select the fifth positioning method for visual positioning when the scene where the positioning position is located is an indoor micro scene, wherein the first positioning method, the second positioning method, the third positioning method, the fourth positioning method, and the fifth positioning method use different positioning methods.
[0026] In another implementation, the acquisition unit is used to acquire a first image taken at the positioning position; the system also includes: a search unit, used to search for one or more frames of images closest to the first image in a database to obtain one or more candidate images; a rendering unit, used to render from multiple directions with a first step size according to the shooting posture of each candidate image in the one or more candidate images to obtain rendered images in multiple directions; a comparison unit, used to compare the difference between each candidate image and the rendered images in multiple directions of each candidate image; and the rendering unit is also used to render from the direction with the smallest difference with at least one second step size until the difference is less than a first threshold, and the shooting posture of the candidate image obtained is the final position of the positioning position.
[0027] In another implementation, the acquisition unit is used to acquire a first image taken at the positioning position and an initial positioning position; the system also includes: a second extraction unit, used to extract and process the first image through one or more candidate networks for extracting postures to obtain one or more postures; and a weighting unit, used to perform weighted averaging of the one or more positions according to the center point position of the coverage area of the one or more candidate networks to obtain the final position of the positioning position.
[0028] In a fourth aspect, a visual positioning system is provided, which includes a positioning device and a cloud server; the visual positioning device is used to obtain a first image taken at the positioning position and extract a feature descriptor of the first image; the visual positioning device is also used to send index information of the feature descriptor of the first image to the server; the cloud server is used to obtain the feature descriptor corresponding to the index information of the feature descriptor of the first image according to the index information of the feature descriptor of the first image, and search the database for the feature descriptor that is closest to the feature descriptor of the first image to obtain a candidate feature descriptor, and calculate the final position of the positioning position according to the candidate feature descriptor; and the cloud server is also used to return the final position of the positioning position to the visual positioning device; wherein the feature descriptors include local feature descriptors and global feature descriptors.
[0029] In a fifth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the method described in the first aspect, the second aspect, or any one of the first aspect and the second aspect.
[0030] In a sixth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method described in the first aspect, the second aspect, or any one of the first aspect and the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of the structure of a visual positioning system provided in an embodiment of the present application;
[0032] Figure 2 A schematic diagram of a flow chart of a visual positioning method provided in an embodiment of the present application;
[0033] Figure 3 A schematic diagram of a flow chart of a direct positioning method provided in an embodiment of the present application;
[0034] Figure 4 A schematic diagram of a flow chart of an indirect positioning method provided in an embodiment of the present application;
[0035] Figure 5 A schematic diagram of a process for visual positioning using a convolutional neural network and an image comparison method provided in an embodiment of the present application;
[0036] Figure 6 A schematic diagram of a process for an end-to-end method of visual positioning using a convolutional neural network provided in an embodiment of the present application;
[0037] Figure 7A schematic diagram of a flow chart of a method for visual positioning by point cloud registration method provided in an embodiment of the present application;
[0038] Figure 8 A schematic diagram of the module structure of a visual positioning system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The basic principle of visual positioning is to align the positions of image features (such as points, lines, etc.) with offline maps. For example, offline maps contain a large number of 3D points, and images taken by mobile phones can extract a large number of 2D points. After matching these 2D points with 3D points, the geometric relationship between the current scene and the offline map can be obtained. By solving this geometric problem, the current precise position of the mobile phone can be obtained.
[0040] Visual positioning methods are divided into three major positioning methods: direct method, indirect method and CNN method.
[0041] 1. The direct method is defined as: directly matching the descriptors of the database offline map and the image collected by the device (that is, directly matching the descriptors of the database 3D points and the 2D image descriptors). The direct method has the advantages of compact data storage and intuitive methods.
[0042] 2. The indirect method is defined as: using an intermediate structure to represent points and their descriptors (for example, compressing the entire image into a vector). Correspondingly, the database is also divided into two parts: the intermediate structure and the features. When positioning, first search the database for the corresponding intermediate structure (image) based on the current Quer (the image taken by the positioning device, such as a mobile phone camera). After that, match the query features with the features associated with the intermediate structure. The indirect method has the advantages of high efficiency, high precision, and high robustness.
[0043] 3. CNN method: Use deep learning scheme to directly obtain the pose end to end. CNN method has the advantages of high robustness and strong adaptability to changing scenes.
[0044] The present application provides a visual positioning method and system, which obtains scene information of the positioning position, wherein the scene information includes at least one of the following information: indoor, outdoor, weak texture, rich texture, micro scene, indoor size, day, and night; determines the scene of the positioning position according to the scene information; and selects a corresponding positioning method according to the scene of the positioning position. Different positioning methods can be selected for positioning according to the scenes of different positioning positions, thereby realizing all-weather and all-scene visual positioning.
[0045] Figure 1A structural diagram of a visual positioning system provided in an embodiment of the present application, the visual positioning system 1000 includes a positioning device 100 and a cloud server 110. The positioning device 100 can obtain an initial positioning position, and calculate the accurate positioning position of the positioning device based on the initial positioning position. During the positioning calculation process, the positioning algorithm requires more computing resources, and part of the calculation content needs to be completed on the cloud server 110 side. The content transmitted between the end and the cloud can be a descriptor, an image, or database data. These three end-cloud combination methods are respectively matched with corresponding compression methods, namely codebook quantization compression, image compression, and data lossless compression.
[0046] The following is described in conjunction with specific embodiments:
[0047] See also Figure 2 , is a flow chart of a visual positioning method provided in an embodiment of the present application, which is applied to a visual positioning system. The method may include:
[0048] S101. Acquire scene information of a positioning location, where the scene information includes at least one of the following information: indoor, outdoor, weak texture, rich texture, micro scene, indoor size, day, and night.
[0049] This embodiment can utilize various types of sensors on the positioning device and auxiliary systems and devices to obtain scene information of the positioning location.
[0050] The indoor and outdoor identification of the scene where the positioning location is located is obtained, and according to the indoor and outdoor identification, it is determined whether the scene where the positioning location is located is indoor or outdoor. Specifically, the indoor and outdoor identification judgment information provided by the auxiliary location-based service (location based service, LBS) system can be used to obtain whether the positioning location is indoor or outdoor. For example, the LBS system can output an indoor and outdoor judgment flag, for example, outputting "0" for indoors and outputting "1" for outdoors.
[0051] Semantic segmentation is performed based on the first image acquired by the positioning device to extract the moving objects in the first image. Then, the information of the moving objects at these positions on the original color image is removed using the result of the semantic segmentation, and then the Canny edge is extracted from the image from which the moving objects have been removed to obtain an edge image, and then the number of effective pixels at the edge is calculated. If the number of effective pixels at the edge of the image is less than or equal to the first pixel number threshold, the scene at the positioning position is a weak texture scene; conversely, if the number of effective pixels at the edge of the image is greater than or equal to the second pixel number threshold, the scene at the positioning position is a rich texture scene, wherein the first pixel number threshold is less than the second pixel number threshold.
[0052] Furthermore, after extracting the moving object in the first image, it may also include: determining whether the proportion of the moving object in the first image is greater than or equal to a set threshold. If the proportion is too large, the above operations of removing the moving object, extracting the edge, etc. may not be performed.
[0053] Using the ToF depth camera on the positioning device, a depth map can be obtained, which is the depth image of the first image. The depth map can be used to determine whether the distance between the scene in the current scene and the positioning position is less than or equal to a first distance threshold (for example, 2m). If the distance is less than or equal to 2m, the scene where the positioning position is located is a micro scene.
[0054] The light sensor can also be used to determine whether the scene at the positioning location is daytime or nighttime.
[0055] S102: Determine the scene in which the positioning position is located according to the scene information.
[0056] The scene information of the above positioning position can be combined to obtain the following specific positioning position scenes: outdoor daytime scene, outdoor night scene; indoor room with rich texture; indoor large room scene with weak texture; indoor small room scene with weak texture; and indoor micro scene.
[0057] Large rooms refer to large scenes such as train stations, shopping malls, airports, etc., with an area of more than 300m^2. Small rooms refer to indoor scenes with an area of less than 300m^2.
[0058] According to the acquired scene information, the scene where the positioning location is located can be determined. For example, if the acquired scene information is outdoor and night, then the scene where the positioning location is located can be determined to be an outdoor night scene; for another example, if the acquired scene information is indoor, weak texture, large room, then the scene where the positioning location is located can be determined to be an indoor weak texture large room scene.
[0059] S103: Select a corresponding positioning method according to the scene where the positioning position is located.
[0060] The visual positioning system stores positioning methods corresponding to multiple scenes. The details are as follows:
[0061] For rooms with rich indoor textures, the direct method is selected for positioning, that is, all descriptors are matched with the descriptors extracted from the current image, and then the position of the camera is obtained using the pose refinement algorithm. The end-cloud combination method 1 is selected to perform positioning calculations. The above direct method and the end-cloud combination algorithm can be collectively referred to as the first positioning method.
[0062] For indoor daytime scenes and outdoor night scenes, the indirect method is selected for positioning, that is, using images as intermediate structures, first searching for images in the database, then matching according to the descriptors corresponding to the images, and finally using the pose precision algorithm to obtain the camera position. The positioning algorithm requires more computing resources, and some of the computing content needs to be completed on the cloud side. For indoor daytime scenes and outdoor night scenes, the positioning calculation can be performed on the positioning device side and on the cloud side. Specifically, the end-cloud combination method 1 and the end-cloud combination method 2 can be selected. The above indirect method and the end-cloud combination algorithm can be collectively referred to as the second positioning method. For indoor weak-textured large room scenes, CNN and image comparison methods are selected for positioning, that is, image search is used to search for an image in advance, locate the initial position, and then the rendering and comparison method is used to iterate continuously until convergence to obtain the final position. And the end-cloud combination method 2 is selected to perform positioning calculations. The above CNN, image comparison method and end-cloud combination algorithm can be collectively referred to as the third positioning method.
[0063] For indoor weak-textured small room scenes, the end-to-end CNN method is selected for positioning, and the end-cloud combination method 3 is selected to perform positioning calculations. The above end-to-end CNN method and the end-cloud combination algorithm can be collectively referred to as the fourth positioning method.
[0064] For indoor micro scenes, such as a scene the size of an office desk, we use depth sensors such as ToF equipped on small electronic devices to obtain point clouds, and then perform point cloud registration and positioning. We also select the end-cloud combination method 3 to perform positioning calculations. The above point cloud registration and positioning and end-cloud combination algorithms can be collectively referred to as the fifth positioning method.
[0065] The visual positioning system can select a corresponding positioning method from the first positioning method to the fifth positioning method according to the scene in which the determined positioning position is located.
[0066] It should be noted that the correspondence between the above positioning methods and scenes may change with the drastic changes in the scenes and changes in the algorithm schemes. Different positioning methods may be applicable to another scene other than the scene corresponding to the positioning method described above. For example, the indirect method may be applicable to a scene with rich indoor textures. This application does not limit this.
[0067] Compared with traditional positioning technology, visual positioning technology uses pictures taken by positioning equipment (for example, mobile phone cameras) as data sources for positioning, which has the advantages of short time, low power consumption, easy maintenance, and high accuracy:
[0068] 1. Accuracy: The positioning accuracy of visual positioning in large outdoor scenes is at the decimeter level, and the positioning accuracy in indoor scenes is between centimeters and decimeters. The accuracy is one order of magnitude higher than that of GPS and WIFI positioning.
[0069] 2. Application scenarios: In principle, visual positioning technology is not restricted by scene, time and other conditions. It can perform high-precision positioning in large and small scenes, various weather conditions and various lighting conditions;
[0070] 3. Frame rate: Visual positioning technology is implemented using a combination of end and cloud. With the improvement of cloud server hardware quality and the iteration of algorithms, the time of visual positioning technology can be compressed to a very short time. The calculation time is expected to be reduced to less than 100ms. The frame rate is guaranteed to be above 10 frames. With the help of smoothing function, it can basically meet the requirements of real-time positioning.
[0071] 4. Robustness: The visual positioning method can ensure good consistency in the case of obvious and rich features in the scene
[0072] 5. Information integrity: The visual positioning method can calculate 6 degrees of freedom information, which are position and three angles. The traditional method can generally only calculate the position and output low-precision angle information through the magnetometer;
[0073] 6. Positioning result display method: Due to its high precision and joint output of 6-DOF information, visual positioning technology can be combined with a camera to directly display positioning results, navigation information, etc.
[0074] Traditional visual features, such as SIFT, ORB, etc., and traditional global image abstraction methods such as DBOW have too low robustness and are basically not robust to changing scenes. The emergence of deep learning has greatly improved the robustness of global and local image abstraction methods, and deep learning features can resist changes in conditions such as lighting, seasons, and weather. In addition, the emergence of CNN networks makes it possible to achieve positioning with an end-to-end structure. Using the positioning method of the embodiment of the present application, regardless of day or night, regardless of any of the above scenarios, a suitable positioning algorithm can be selected for accurate positioning, thereby achieving all-weather, full-scene visual positioning.
[0075] For example, it can meet the fifth generation (5 th The solution meets the high-precision positioning needs of 5G (5G generation) communication systems and provides positioning services for devices such as mobile phones and tablets, or smart devices such as driverless cars.
[0076] According to a visual positioning method provided in an embodiment of the present application, different positioning methods are selected for positioning according to the scenes in which different positioning positions are located, thereby achieving all-weather and all-scenario visual positioning.
[0077] The above positioning method is described in detail below:
[0078] like Figure 3 As shown, it is a schematic diagram of a flow chart of a direct positioning method provided in an embodiment of the present application, and the method may include:
[0079] S201: A positioning device acquires a first image, and determines an initial positioning position of the positioning device according to the first image.
[0080] The positioning device obtains an image of the surrounding environment, and based on the image, the position of the positioning device can be preliminarily determined. Generally speaking, the accuracy of the initial positioning position is often not enough to perform accurate positioning.
[0081] S202: The positioning device extracts a local feature descriptor of the first image.
[0082] The feature descriptor may be any form of descriptor, such as point, line, surface, point cloud, block, etc. The local feature descriptor is relative to the global feature descriptor, and the local feature descriptor may be a partial feature descriptor of the first image.
[0083] This step can be completed by the front end of the positioning device. Of course, this step can also be completed by the back end of the positioning device, and this application does not limit this.
[0084] Methods used to extract local feature descriptors of the first image include CNN networks, LSD line segment extractors, etc.
[0085] For general outdoor and indoor scenes, point features can be extracted. When extracting point features, the CNN extraction networks used in this system are D2Net and SuperPoint. Under normal circumstances, D2Net takes a long time to calculate, but has higher accuracy. Therefore, when the pressure on the cloud system is small, the D2Net descriptor is used; when the pressure on the cloud increases, the SuperPoint descriptor is used (the calculation time of the SuperPoint descriptor is half of that of the D2Net descriptor). This method can greatly reduce the computing pressure on the cloud. For outdoor weak-texture scenes, line segment features can be extracted. When extracting line segment features, the LSD line segment extractor is used to extract the line segments and their LBD descriptors.
[0086] Specifically, regarding the extraction of D2Net feature points, first, laser radar, aerial photography from the perspective of drones (oblique photography), high-definition panoramic cameras, high-definition industrial cameras and other equipment can be used to shoot, and the high-precision dense point cloud obtained after post-processing is used as a database. Then, some high-value sparse point clouds are extracted from the dense point cloud obtained by the above process and stored in the database. The extraction method is to first use the raycast method to associate the 3D points in the above point cloud with the points on the 2D image, and then extract the D2Net feature points on the image, which are the feature points on the image; since the image has been associated with the 3D points of the point cloud in the previous step, the current step is to extract the 3D points of the D2Net feature points and save them as files. During the acquisition, each point is a point on the earth, and the distance between the acquisition points is at the meter level. Each point finally synthesizes the image into a panorama. When used, the panorama is sliced into multiple pictures, each picture corresponding to a part of the 2D points and a part of the 3D points, or the 2D points and 3D points of the entire panorama are saved together. In addition to 2D points and 3D points, each image in the database also contains a NetVLAD vector as an image retrieval index.
[0087] S203 , searching the database for the nearest neighbor of the local feature descriptor of the first image, and screening out some local features that meet the geometric relationship as candidate local features.
[0088] Specifically, when searching for the nearest neighbor descriptor, GPU can be used for brute force matching, and a series of RANSAC methods based on geometric relationships can be used to eliminate outliers and screen out some local features that meet the geometric relationships as candidate local features.
[0089] In addition, you can also use the efficient p2pGravity with loRANSAC's outlier elimination solution, and perform brute force matching on the current image and multiple frames at the same time to obtain the results of multiple images at different positions of the current image. A large number of matching points can promote high-precision positioning, and by further selecting better feature points, the positioning accuracy can be further improved.
[0090] S204: Incorporate the candidate local features obtained above into a pose solving framework to obtain the final position of the positioning device.
[0091] The pose solving framework includes but is not limited to PnP, PnPL, ICP, BA, and CNN frameworks. The candidate local features obtained above are incorporated into the pose solving framework to finally obtain the accurate pose. This step can be completed by the backend of the positioning device.
[0092] Specifically, for the point matching algorithm, the PnP algorithm is used to obtain the final pose result.
[0093] By using the direct positioning method provided in the embodiment of the present application, for rooms with rich indoor textures, the matching process is direct and positioning can be performed quickly and with high precision.
[0094] It can be understood that the visual positioning system shown in this embodiment can also support the positioning of outdoor night scenes. For images taken of outdoor night scenes, a style transfer network can be used to transfer the style of night scene images to daytime images, and then local descriptors can be extracted.
[0095] like Figure 4 As shown, it is a schematic diagram of a flow chart of an indirect positioning method provided in an embodiment of the present application, and the method may include:
[0096] S301: A positioning device acquires a first image, and determines an initial positioning position of the positioning device according to the first image.
[0097] The positioning device obtains an image of the surrounding environment, and based on the image, the position of the positioning device can be preliminarily determined. Generally speaking, the accuracy of the initial positioning position is often not enough to perform accurate positioning.
[0098] S302: Extract a global feature descriptor of the first image.
[0099] This step can be completed by the front end of the positioning device.
[0100] A global feature descriptor (or global vector) of the first image is extracted, and the methods used include a CNN network, a DBoW descriptor, and the like.
[0101] The CNN descriptor is a NetVLAD descriptor, which is a 4096-dimensional vector. The specific operation of the search is to compare the spatial distance between the NetVLAD descriptor of the image in the database and the descriptor of the first image.
[0102] For the DBoW method, the local descriptor of the first image is first extracted, and then the local descriptor is put into the pre-trained DBoW dictionary to find the nearest leaf node, and then the TF-IDF method is used to obtain the final similarity.
[0103] Which solution to use in the cloud needs to be selected according to the type of cloud server. The current cloud includes two types of servers: strong GPU computing type and weak GPU computing type (stronger CPU). For CPU servers, the DBoW method is used; for strong GPU servers, the NetVLAD method is used; for weak GPU servers, the DBoW method is used; this solution plays a significant role in saving cloud resources and reducing operation and maintenance costs. S303, search the database for one or N frames of images that are closest to the first image, and use the searched images as candidate images.
[0104] Specifically, the methods used include but are not limited to KD tree search, bag-of-words vector search, CNN global feature search, etc., and the searched images are used as candidate images.
[0105] The spatial distance between two global vectors is the vector distance between the two vectors. When the vector distance between two vectors is large, it means that the two are closer. After searching for the first N candidate images (N>20), the candidate images are screened using a retrieval screening algorithm. The specific algorithm is that the first N images store the precise positions of these images (calibrated in advance), and then these images are eliminated. The elimination algorithm can use the LOF outlier algorithm.
[0106] After screening, the remaining images will be put into the next step of backend execution. A judgment mechanism is added here. If there are less than 5 images after elimination, they will not enter the backend and will directly return positioning failure.
[0107] S304: Perform a matching operation on the first image and the descriptors of the candidate image (solve the nearest neighbor of each descriptor).
[0108] The matching method may be brute force matching, FLANN matching, GPU-based accelerated matching, etc. This step may be completed by the backend of the positioning device.
[0109] When searching for the nearest neighbor descriptor, GPU is used for brute force matching, and a series of RANSAC methods based on geometric relationships are used to eliminate outliers as candidate features. For the solution of eliminating outliers, please refer to the relevant description of the direct positioning method mentioned above.
[0110] S305: Incorporate these candidate local features into the pose solving framework to obtain the final position of the positioning device.
[0111] The pose solution framework includes but is not limited to PnP, PnPL, ICP, BA, and CNN frameworks, and ultimately obtains accurate pose.
[0112] Specifically, for the point matching algorithm, the PnP algorithm is used to obtain the final pose result.
[0113] By adopting the indirect positioning method provided in the embodiment of the present application, high-precision, all-round, and all-weather positioning can be obtained for indoor daytime scenes and outdoor night scenes.
[0114] like Figure 5 As shown, it is a schematic diagram of a process of performing visual positioning using a convolutional neural network and an image comparison method provided in an embodiment of the present application. The method may include:
[0115] S401: Acquire a first image captured at a positioning position.
[0116] The first image is acquired by using the positioning device, and the initial positioning position of the positioning device is determined according to the first image. The accuracy of the initial positioning position is often not enough to perform accurate position positioning.
[0117] S402: Search a database for one or more frames of images closest to the first image to obtain one or more candidate images.
[0118] This step can be completed by the front end of the positioning device.
[0119] The database is searched for one or N frames of images that are closest to the first image, using methods including but not limited to KD tree search, bag-of-words vector search, CNN global feature search, etc. The searched images are used as candidate images.
[0120] Methods for extracting a global feature descriptor of the first image include a CNN network and a DBoW descriptor.
[0121] The CNN descriptor is a NetVLAD descriptor, which is a 4096-dimensional vector. The specific operation of the search is to compare the spatial distance between the NetVLAD descriptor of the image in the database and the first image descriptor.
[0122] For the DBoW method, the local descriptor of the image is first extracted, and then the local descriptor is put into the pre-trained DBoW dictionary to find the nearest leaf node, and then the TF-IDF method is used to obtain the final similarity.
[0123] The solution to be adopted in the cloud needs to be selected according to the type of cloud servers. Currently, the cloud has two types of servers: strong GPU computing type and weak GPU computing type (stronger CPU). For CPU servers, the DBoW method is adopted; for strong GPU servers, the NetVLAD method is adopted; for weak GPU servers, the DBoW method is adopted; this solution plays a significant role in saving cloud resources and reducing operation and maintenance costs.
[0124] The spatial distance between two global vectors is the vector distance between the two vectors. When the vector distance between two vectors is large, it means that the two are closer. After searching for the first N candidate images (N>20), the candidate images are screened using a retrieval screening algorithm. The specific algorithm is that the first N images store the precise positions of these images (calibrated in advance), and then these images are eliminated. The elimination algorithm can be the LOF outlier algorithm.
[0125] After screening, the remaining images will be put into the next step of backend execution. A judgment mechanism is added here. If there are less than 5 images after elimination, they will not enter the backend and will directly return positioning failure.
[0126] S403 . Rendering is performed from multiple directions with a first step length according to the shooting posture of each candidate image in the one or more candidate images to obtain rendered images in multiple directions.
[0127] S404: Compare the differences between each candidate image and the rendered images of each candidate image in multiple directions.
[0128] S405, rendering from the direction with the smallest difference with at least one second step size, and executing the step of comparing the difference between each candidate image and the rendered images of each candidate image in multiple directions until the difference is less than a first threshold, and the obtained shooting posture of the candidate image is the final position of the positioning position.
[0129] The above steps S403 to S405 may be completed by the back end of the positioning device.
[0130] The candidate images searched by the front end are accompanied by their shooting postures. Based on this posture, the images in various directions (26 directions) in the space are rendered using the Mesh Raycast method, and the difference between the first image and the rendered image is compared using the CNN method.
[0131] Assuming a cube, each side of which is divided into 3 parts, the cube will be divided into 3x3x3=27 parts. The small block in the middle represents the current position of the camera, and the other small blocks represent the directions in which the camera can iterate. In each iteration process, the camera is first moved a certain distance in the above 26 directions, and then the images of these 26 positions are rendered using point cloud or mesh.
[0132] After rendering is completed, the similarity between the rendered image and the current image is compared, and the image position with the highest similarity is selected as the next position for iteration. The iteration step size changes according to the change in similarity. The smaller the similarity change, the smaller the step size. When the similarity change is less than a certain threshold, or the similarity in each direction decreases, the algorithm converges and reaches the optimal position.
[0133] Select the direction with the smallest difference to continue iterating. After the initial step, use the size of the image difference between the two frames to select the size of the next step.
[0134] Continue to iterate until the algorithm converges to the minimum value, and the current pose is the accurate pose.
[0135] By using the method for visual positioning using a convolutional neural network and an image comparison method provided in an embodiment of the present application, high-precision, all-round, and all-weather positioning can be achieved for indoor large room scenes with weak textures.
[0136] like Figure 6As shown, it is a flow chart of a method for end-to-end visual positioning using a convolutional neural network provided in an embodiment of the present application. The method may include:
[0137] S501: Acquire a first image captured at a positioning position and an initial positioning position.
[0138] The first image is acquired by using the positioning device, and the initial positioning position of the positioning device is determined according to the first image. The accuracy of the initial positioning position is often not enough to perform accurate position positioning.
[0139] S502: Perform extraction processing on the first image through one or more candidate networks for extracting poses to obtain one or more poses.
[0140] At present, a candidate network corresponding to the prior position (a certain point indoors) has been obtained. Put the picture into this candidate network to get the pose.
[0141] For smaller rooms (e.g., less than or equal to 300m^2), fully collect pictures of the current room when training the network, and use a high-precision indoor positioning method (a collection vehicle equipped with a laser radar) to obtain the precise poses of all pictures. Use professional collection equipment that can provide poses (a collection vehicle equipped with a laser radar) to completely collect pictures of all positions and angles in the current room. Use these pictures to train the PoseNet network, which can directly output poses after training.
[0142] S503: Perform weighted averaging on the one or more positions according to the positions of the center points of the coverage areas of the one or more candidate networks to obtain a final position of the positioning position.
[0143] Pre-train a CNN network for a small block. The network input is a picture, and the network output is directly a 3D pose. The network uses PoseNet. PoseNet is based on GoogleNet and regresses the camera pose by modifying the final output.
[0144] According to the center point position of the candidate network coverage area and the prior position of the current image, multiple poses are weighted averaged to obtain the accurate pose
[0145] If the area of an indoor location is larger than 100m^2, or there are partitions (such as airports), then the large room will be divided into multiple small blocks. Each small block is arranged according to the indoor partition situation, and the network is trained separately in these small blocks. Finally, when the indoor positioning module locates the initial position, if there are multiple networks around, then multiple networks are used to calculate the results simultaneously, and finally weighted.
[0146] By adopting the end-to-end method for visual positioning using a convolutional neural network provided in the embodiment of the present application, high-precision, all-round, and all-weather positioning can be obtained for indoor small room scenes with weak textures.
[0147] like Figure 7 As shown, it is a flow chart of a method for performing visual positioning by point cloud registration method provided in an embodiment of the present application, and the method may include:
[0148] S601: Acquire a first image captured at a positioning position and an initial positioning position.
[0149] The first image is acquired by using the positioning device, and the initial positioning position of the positioning device is determined according to the first image. The accuracy of the initial positioning position is often not enough to perform accurate position positioning.
[0150] S602: Acquire depth data of the first image.
[0151] The depth data can be obtained by a depth sensor, including but not limited to: a TOF camera, a structured light camera, a binocular camera, etc., or directly using a monocular depth estimation method to obtain a depth map.
[0152] S603: Restore the point cloud of the current scene using the depth map and camera intrinsic parameters.
[0153] S604: Extract a partial point cloud of the scene using the initial positioning position obtained by the sensor of the positioning device.
[0154] S605: align the two point clouds to obtain relative poses. The alignment scheme may be a coarse-to-fine alignment or a direct alignment, and the method includes ICP and the like.
[0155] By adopting a method for visual positioning through point cloud registration provided in an embodiment of the present application, high-precision, all-round, and all-weather positioning can be obtained for indoor micro scenes.
[0156] The positioning algorithm requires more computing resources, and some of the computing content can be completed on the cloud side. The content transmitted between the end and the cloud can be descriptors, images, or database data. These three end-cloud combination methods can be combined with corresponding compression methods, namely codebook quantization compression, image compression, and data lossless compression.
[0157] End-cloud integration method 1:
[0158] The operations completed on the positioning device side include:
[0159] 1. Obtain the rough positioning position of the current image based on traditional sensors;
[0160] 2. Calculation of the global descriptor (quantifiable) of the image;
[0161] 3. Extraction of local descriptors (quantifiable) of images.
[0162] The operations completed on the cloud server side include:
[0163] 1. Image search based on global descriptors;
[0164] 2. Matching and pose refinement based on local descriptors.
[0165] The end-cloud combination method 1 is to divide the operations in the above-mentioned direct positioning method and indirect positioning method into two parts: the positioning device side (end side) and the cloud server side (cloud side).
[0166] Data compression scheme:
[0167] For the end-cloud integration technical solution 1, the descriptors required for communication between the end and the cloud are quantified and archived.
[0168] Perform clustering training of descriptors for the current scene in advance to obtain a dictionary tree (or data structure such as a hash table) for query. The dictionary tree (or data structure such as a hash table) is a quantization operation on the descriptors, and similar descriptors will be linked to the same leaf node.
[0169] The same dictionary tree is stored on both the client side and the cloud side.
[0170] All descriptors (global + local) extracted on the client side are linked to an object in this dictionary tree (or a hash table with key values) to obtain an index corresponding to the object one by one (usually the amount of indexed data is negligible).
[0171] Communication between the end and the cloud only requires uploading or downloading indexes to achieve descriptor correspondence, without the need to upload a large number of descriptors.
[0172] Taking the direct method combined with the end-cloud method 1 for positioning calculation as an example, the positioning device obtains the first image taken at the positioning position and extracts the local feature descriptor of the first image; the positioning device sends the index information of the local feature descriptor of the first image to the cloud server; the cloud server obtains the local feature descriptor corresponding to the index information based on the index information of the local feature descriptor of the first image, and searches the database for the local feature descriptor that is closest to the local feature descriptor of the first image to obtain the candidate feature descriptor, and calculates the final position of the positioning position based on the candidate feature descriptor.
[0173] End-cloud integration method 2:
[0174] The operations completed on the positioning device side include:
[0175] 1. Obtain the rough positioning position of the current image based on traditional sensors;
[0176] 2. Encrypt and compress the image and upload it to the cloud.
[0177] The operations completed on the cloud server side include:
[0178] Complete a set of positioning algorithms and return accurate 6Dof coordinates.
[0179] The operations in the above-mentioned indirect positioning method, CNN and image comparison positioning method can be completed by the positioning device side (end side) and the cloud server side (cloud side).
[0180] Data compression scheme:
[0181] For the end-cloud integration technical solution 2, data compression operations are performed on the images required for communication between the end and the cloud.
[0182] Compression step: Convert the raw image captured by the end-side camera into a compressed format stream; and upload or download the compressed format stream of the image during communication between the end and the cloud.
[0183] End-cloud integration method 3:
[0184] The operations completed on the positioning device side include:
[0185] 1. Obtain the rough positioning position of the current image based on traditional sensors;
[0186] 2. Download (offline) maps around the current location;
[0187] 3. Complete a set of positioning algorithms and return accurate 6Dof coordinates.
[0188] The operations completed on the cloud server side include:
[0189] Stores large maps used for positioning and provides map download services for the client side.
[0190] The operations in the above-mentioned end-to-end CNN method and point cloud registration method are divided and completed by the positioning device side (end side) and the cloud server side (cloud side).
[0191] Data compression scheme:
[0192] For the end-cloud combined technical solution 3, offline operations are performed for communication between the end and the cloud.
[0193] Compression steps:
[0194] Losslessly compress the offline map required for positioning on the cloud side. The lossless compression method may be the compression principle of formats such as ZIP.
[0195] When communicating between the end and the cloud, the offline map is uploaded or downloaded in a lossless compressed format stream.
[0196] Offline map formats include but are not limited to:
[0197] The trained CNN network;
[0198] Data packets containing key points, key lines, and key image block information;
[0199] Point cloud.
[0200] Based on the same concept of the above-mentioned visual positioning method, the embodiment of the present application also provides a visual positioning system. Figure 8 As shown, the visual positioning system 1100 includes: a first acquisition unit 11, a determination unit 12 and a selection unit 13; wherein:
[0201] The first acquisition unit 11 is used to acquire scene information of the positioning position, and the scene information includes at least one of the following information: indoor, outdoor, weak texture, rich texture, micro scene, indoor size, daytime, and night; the determination unit 12 is used to determine the scene of the positioning position according to the scene information; and the selection unit 13 is used to select a corresponding positioning method according to the scene of the positioning position.
[0202] In one implementation, the first acquisition unit 11 is used to acquire indoor and outdoor identifications of the scene where the positioning location is located; and the determination unit 12 is used to determine whether the scene where the positioning location is located is indoor or outdoor according to the indoor and outdoor identifications.
[0203] In another implementation, the system further includes: a segmentation unit for performing semantic segmentation on a first image captured at the positioning position; a removal unit for removing information of moving objects on the first image; a first extraction unit for extracting the edge of the first image to obtain an edge image; a calculation unit for calculating the number of valid pixels of the edge image; the determination unit for determining that the scene at the positioning position is a weak-texture scene when the number of valid pixels of the edge image is less than or equal to a first pixel number threshold; and the determination unit is also for determining that the scene at the positioning position is a rich-texture scene when the number of valid pixels of the edge image is greater than or equal to a second pixel number threshold, wherein the first pixel number threshold is less than the second pixel number threshold.
[0204] In another implementation, the system also includes: a second acquisition unit, used to acquire a second image of the scene where the positioning position is located, the second image being a depth image of the first image; and the determination unit, used to determine that the scene where the positioning position is located is a micro scene when the distance between the scene in the depth image and the positioning position is less than or equal to a first distance threshold.
[0205] In another implementation, the selection unit is used to select the first positioning method for visual positioning when the scene where the positioning position is located is a texture-rich indoor scene; or the selection unit is used to select the second positioning method for visual positioning when the scene where the positioning position is located is an outdoor scene; or the selection unit is used to select the third positioning method for visual positioning when the scene where the positioning position is located is an indoor large room scene with weak texture; or the selection unit is used to select the fourth positioning method for visual positioning when the scene where the positioning position is located is an indoor small room scene with weak texture; or the selection unit is used to select the fifth positioning method for visual positioning when the scene where the positioning position is located is an indoor micro scene, wherein the first positioning method, the second positioning method, the third positioning method, the fourth positioning method, and the fifth positioning method use different positioning methods.
[0206] In another implementation, the first acquisition unit is used to acquire a first image captured at the positioning position; the system also includes: a search unit, used to search the database for one or more frames of images closest to the first image to obtain one or more candidate images; a rendering unit, used to render from multiple directions with a first step size according to the shooting posture of each candidate image in the one or more candidate images to obtain rendered images in multiple directions; a comparison unit, used to compare the difference between each candidate image and the rendered images in multiple directions of each candidate image; and the rendering unit is also used to render from the direction with the smallest difference with at least one second step size until the difference is less than a first threshold, and the shooting posture of the candidate image obtained is the final position of the positioning position.
[0207] In another implementation, the first acquisition unit is used to acquire a first image taken at the positioning position and an initial positioning position; the system also includes: a second extraction unit, used to extract and process the first image through one or more candidate networks for extracting postures to obtain one or more postures; and a weighting unit, used to perform weighted averaging on the one or more positions according to the center point position of the coverage area of the one or more candidate networks to obtain the final position of the positioning position.
[0208] The functions performed by the above-mentioned units may be partially or entirely performed by the visual positioning device, and partially performed by the cloud server. Figure 2 to Figure 7 Related description in the illustrated embodiment.
[0209] According to a visual positioning system provided in an embodiment of the present application, different positioning methods can be selected for positioning according to the scenes in which different positioning positions are located, thereby achieving all-weather and all-scenario visual positioning.
[0210] In another embodiment, a visual positioning system is also provided. Figure 1 As shown, the visual positioning system includes a visual positioning device and a cloud server;
[0211] The visual positioning device is used to obtain a first image taken at the positioning position and extract a feature descriptor of the first image;
[0212] The visual positioning device is further used to send index information of the feature descriptor of the first image to the server;
[0213] The cloud server is used to obtain, according to the index information of the feature descriptor of the first image, the feature descriptor corresponding to the index information, and search in the database for the feature descriptor closest to the feature descriptor of the first image to obtain a candidate feature descriptor;
[0214] and calculating the final position of the positioning position according to the candidate feature descriptor; and the cloud server is also used to return the final position of the positioning position to the visual positioning device;
[0215] The feature descriptors include local feature descriptors and global feature descriptors.
[0216] According to a visual positioning system provided in an embodiment of the present application, different positioning methods can be selected for positioning according to the scenes in which different positioning positions are located, thereby realizing all-weather and all-scene visual positioning; and only the index information of the local feature descriptor of the first image can be transmitted between the visual positioning device and the cloud server, without the need to transmit the local feature descriptor, which can save transmission overhead and improve transmission efficiency.
[0217] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0218] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the division of the unit is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling, direct coupling, or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0219] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, 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 solution of this embodiment.
[0220] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a read-only memory (ROM), or a random access memory (RAM), or a magnetic medium, such as a floppy disk, a hard disk, a tape, a magnetic disk, or an optical medium, such as a digital versatile disc (DVD), or a semiconductor medium, such as a solid state disk (SSD), etc.
Claims
1. A visual positioning method, applied to a visual positioning system, characterized in that: The method comprises: Acquire scene information of the positioning location, where the scene information includes at least one of the following information: indoor, outdoor, weak texture, rich texture, micro scene, indoor size, daytime, and nighttime; Determining the scene where the positioning position is located according to the scene information; Selecting a corresponding positioning method according to the scene where the positioning location is located; The step of obtaining scene information of the positioning location includes: Performing semantic segmentation on a first image captured at the positioning position, removing information on moving objects on the first image, extracting edges of the first image to obtain an edge image, and calculating the number of valid pixels of the edge image, and when the number of valid pixels of the edge image is less than or equal to a first pixel number threshold, determining that the scene at the positioning position is a weak-texture scene; when the number of valid pixels of the edge image is greater than or equal to a second pixel number threshold, determining that the scene at the positioning position is a rich-texture scene, wherein the first pixel number threshold is less than the second pixel number threshold; or A second image of the scene at the positioning position is obtained, where the second image is a depth image of the first image, and when the distance between the scene in the depth image and the positioning position is less than or equal to a first distance threshold, it is determined that the scene at the positioning position is a micro scene.
2. The method according to claim 1, characterized in that The obtaining of scene information of the positioning location includes: The indoor and outdoor identifiers of the scene where the positioning position is located are obtained, and according to the indoor and outdoor identifiers, it is determined whether the scene where the positioning position is located is indoors or outdoors.
3. The method according to claim 1 or 2, characterized in that: The selecting a corresponding positioning method according to the scene where the positioning position is located includes: When the scene where the positioning position is located is an indoor scene with rich textures, selecting the first positioning mode for visual positioning; or When the scene where the positioning position is located is an outdoor scene, selecting the second positioning method for visual positioning; or When the scene where the positioning position is located is an indoor large room scene with weak texture, selecting the third positioning method for visual positioning; or When the scene where the positioning position is located is an indoor small room scene with weak texture, selecting the fourth positioning mode for visual positioning; or When the scene where the positioning position is located is an indoor micro scene, selecting the fifth positioning mode for visual positioning; The first positioning method, the second positioning method, the third positioning method, the fourth positioning method, and the fifth positioning method use different positioning methods.
4. The method according to claim 3, characterized in that When the scene where the positioning position is located is an indoor large room scene with weak texture, selecting the third positioning mode for visual positioning includes: Acquire a first image captured at the positioning position; Searching a database for one or more frames of images closest to the first image to obtain one or more candidate images; According to the shooting posture of each candidate image in the one or more candidate images, rendering is performed from multiple directions with a first step length to obtain rendered images in multiple directions; comparing the difference between each candidate image and the rendered images of each candidate image in multiple directions; Rendering is performed from the direction with the smallest difference with at least one second step length, and the step of comparing the difference between each candidate image and the rendered images in multiple directions of each candidate image is performed until the difference is less than a first threshold, and the shooting posture of the candidate image obtained is the final position of the positioning position.
5. The method according to claim 3, characterized in that: When the scene where the positioning position is located is an indoor small room scene with weak texture, selecting the fourth positioning mode for visual positioning includes: Acquire a first image captured at the positioning position and an initial positioning position; Performing extraction processing on the first image through one or more candidate networks for extracting poses to obtain one or more poses; According to the positions of the center points of the coverage areas of the one or more candidate networks, weighted averaging is performed on the one or more positions to obtain a final position of the positioning position.
6. A visual positioning method, applied to a visual positioning system, characterized in that: The visual positioning system includes a visual positioning device and a cloud server; the visual positioning system is used to implement the method according to any one of claims 1 to 5, and is also used to implement the following method: The visual positioning device acquires a first image taken at the positioning position and extracts a feature descriptor of the first image; The visual positioning device sends index information of the feature descriptor of the first image to the cloud server; The cloud server obtains the feature descriptor corresponding to the index information according to the index information of the feature descriptor of the first image, searches for the feature descriptor closest to the feature descriptor of the first image in the database to obtain the candidate feature descriptor, and calculates the final position of the positioning position according to the candidate feature descriptor; The cloud server returns the final position of the positioning position to the visual positioning device; The feature descriptors include local feature descriptors and global feature descriptors.
7. A visual positioning system, characterized in that: The system comprises: A first acquisition unit is used to acquire scene information of the positioning position, where the scene information includes at least one of the following information: indoor, outdoor, weak texture, rich texture, micro scene, indoor size, daytime, and nighttime; A determination unit, configured to determine the scene in which the positioning position is located according to the scene information; A selection unit, configured to select a corresponding positioning method according to the scene where the positioning position is located; Wherein, the system further comprises: A segmentation unit, configured to perform semantic segmentation on the first image captured at the positioning position; A removal unit, used to remove information of moving objects on the first image; A first extraction unit, configured to extract the edge of the first image to obtain an edge image; A calculation unit, used for calculating the number of effective pixels of the edge image; The determining unit is used to determine that the scene where the positioning position is located is a weak texture scene when the number of valid pixels of the edge image is less than or equal to a first pixel number threshold; The determining unit is further configured to determine that the scene where the positioning position is located is a scene with rich textures when the number of valid pixels of the edge image is greater than or equal to a second pixel number threshold, wherein the first pixel number threshold is less than the second pixel number threshold; The system further comprises: A second acquisition unit, used to acquire a second image of the scene where the positioning position is located, where the second image is a depth image of the first image; The determining unit is used to determine that the scene where the positioning position is located is a micro scene when the distance between the scene in the depth image and the positioning position is less than or equal to a first distance threshold.
8. The system according to claim 7, characterized in that: The first acquisition unit is used to acquire indoor and outdoor identification of the scene where the positioning position is located; The determining unit is used to determine whether the scene where the positioning location is located is indoors or outdoors according to the indoor and outdoor identifiers.
9. The system according to claim 7 or 8, characterized in that: The selection unit is used to select the first positioning mode for visual positioning when the scene where the positioning position is located is an indoor scene with rich textures; or The selection unit is used to select the second positioning method for visual positioning when the scene where the positioning position is located is an outdoor scene; or The selection unit is used to select the third positioning mode for visual positioning when the scene where the positioning position is located is an indoor large room scene with weak texture; or The selection unit is used to select the fourth positioning mode for visual positioning when the scene where the positioning position is located is an indoor small room scene with weak texture; or The selection unit is used to select the fifth positioning mode for visual positioning when the scene where the positioning position is located is an indoor micro scene; The first positioning method, the second positioning method, the third positioning method, the fourth positioning method, and the fifth positioning method use different positioning methods.
10. The system according to claim 7, characterized in that: The first acquisition unit is used to acquire a first image captured at the positioning position; The system further comprises: A search unit, configured to search a database for one or more frames of images closest to the first image to obtain one or more candidate images; A rendering unit, configured to render from multiple directions with a first step length according to the shooting posture of each candidate image in the one or more candidate images, to obtain rendered images in multiple directions; A comparing unit, configured to compare the difference between each candidate image and the rendered images of each candidate image in multiple directions; The rendering unit is further used to render from the direction with the smallest difference with at least one second step length until the difference is less than a first threshold, and the obtained shooting posture of the candidate image is the final position of the positioning position.
11. The system according to claim 7, characterized in that: The first acquisition unit is used to acquire a first image captured at the positioning position and an initial positioning position; The system further comprises: A second extraction unit, configured to perform extraction processing on the first image through one or more candidate networks for extracting poses, to obtain one or more poses; A weighting unit is used to perform weighted averaging on the one or more positions according to the positions of the center points of the coverage areas of the one or more candidate networks to obtain the final position of the positioning position.
12. A visual positioning system, characterized in that: The visual positioning system is used to implement the method according to any one of claims 1 to 5, and the visual positioning system includes a visual positioning device and a cloud server; The visual positioning device is used to obtain a first image taken at the positioning position and extract a feature descriptor of the first image; The visual positioning device is further used to send index information of the feature descriptor of the first image to the server; The cloud server is used to obtain, according to the index information of the feature descriptor of the first image, the feature descriptor corresponding to the index information, and search the database for the feature descriptor closest to the feature descriptor of the first image to obtain the candidate feature descriptor, and calculate the final position of the positioning position according to the candidate feature descriptor; The cloud server is also used to return the final position of the positioning position to the visual positioning device; The feature descriptors include local feature descriptors and global feature descriptors.
