Visual positioning method, device, electronic device and storage medium

By visually positioning based on the rendered first rendered image and the reference image in the pre-constructed database, the problem of visual positioning in the prior art without manual image shooting is solved, and a higher positioning accuracy and a more flexible image acquisition process are achieved.

CN119741369APending Publication Date: 2025-04-01SHICHEN INFORMATION TECH SHANGHAI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411708017.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The prior art requires manual shooting of a large number of basic images when performing visual positioning, which leads to the inability to visual positioning in scenes where manual images cannot be obtained. The number and diversity of manually photographed images are limited and the positioning accuracy is low.

Method used

By visually positioning based on the rendering, the position of the user equipment is solved by using the reference image in the pre-constructed database that matches the global features of the target image. This method breaks the limitation of not being able to obtain manual images, and improves positioning accuracy by flexibly adjusting the rendering angle and camera parameters.

Benefits of technology

Visual positioning is achieved in scenes where manual images are not available, positioning accuracy is improved, and image acquisition and processing are simplified.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741369A_ABST
    Figure CN119741369A_ABST
Patent Text Reader

Abstract

The present application provides a visual positioning method, device, electronic device and storage medium. Among them, the target image is obtained by photographing the real object corresponding to the three-dimensional model; when performing visual positioning, the existing three-dimensional model is rendered in multiple visual subspaces of the three-dimensional area where the three-dimensional model is located, that is, the first rendered image under different rendering positions, different rendering angles and different camera parameters can be obtained, so as to perform visual positioning of the target image based on the first rendered image; on the one hand, in a scene where the basic image required for visual positioning by artificial photography cannot be obtained, visual positioning can be performed based on the rendered first rendered image, breaking the limitation that visual positioning cannot be performed in this scene; on the other hand, the regulation of the rendering angle and the camera position is more flexible and simple than the regulation of the angle and the camera parameters of artificial photography, and the obtained rendered image is more diverse than the basic image taken by artificial photography, which can improve the accuracy of visual positioning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a visual positioning method, device, electronic device and storage medium. Background Art

[0002] Visual positioning is a positioning technology that obtains images based on visual sensors (such as cameras) and performs corresponding calculations based on the images to obtain information such as the position and posture of the user device equipped with the visual sensor.

[0003] Visual positioning can be applied to fields such as virtual reality (VR), augmented reality (AR), and visual navigation. For example, in a visual navigation scenario, the user device calculates the real-time position of the user device based on the images collected in real time by the visual sensor, and then determines the correct direction of travel based on the real-time position of the user device, so that the user device arrives at the destination in the correct direction.

[0004] In the prior art, when performing visual positioning, it is necessary to capture a large number of basic images within the positioning range, process the basic images to construct a visual map, and then determine the position and posture of the user device that captured the image based on the visual map. However, the above visual positioning method has certain limitations. Summary of the invention

[0005] The present application provides a visual positioning method, device, electronic device and storage medium. On the one hand, in a scenario where the basic image required for visual positioning taken manually cannot be obtained, visual positioning can be performed based on a first rendered image obtained by rendering, breaking the limitation that visual positioning cannot be performed in this scenario; on the other hand, the regulation of the rendering angle and camera parameters is more flexible and simple than the regulation of the angle and camera parameters of manually taken images, and the obtained rendered images are more diverse than those taken manually, which can improve the positioning accuracy.

[0006] In a first aspect, the present application provides a visual positioning method, comprising: obtaining a target image captured by a user device; the target image is obtained based on capturing a real object corresponding to an existing three-dimensional model; querying a pre-constructed database for a reference image that matches the global features of the target image; wherein the database comprises a plurality of first rendered images, and the plurality of first rendered images are obtained by rendering an existing three-dimensional model based on a plurality of rendering postures and one or more camera parameters; wherein the rendering posture comprises a first rendering position, and the first rendering position is located in a visible subspace of a three-dimensional region where the three-dimensional model is located; the three-dimensional region comprises an region where the user device is located; based on the correspondence between the feature points of the reference image and the feature points of the target image, solving the posture of the user device when capturing the target image.

[0007] In some embodiments, the three-dimensional model is represented by a grid; the method further includes: dividing the three-dimensional area into multiple subspaces based on a first distance along a horizontal direction and a vertical direction; for each facet on the grid, based on the center position and normal of the facet, performing visibility analysis on the multiple subspaces of the three-dimensional area by means of line of sight projection to obtain a visible subspace corresponding to the facet in the multiple subspaces; determining multiple first rendering positions in all visible subspaces, and determining multiple first rendering angles corresponding to each first rendering position; rendering the three-dimensional model based on the multiple first rendering angles at each first rendering position and the one or more camera parameters to obtain the multiple first rendered images; and constructing the database based on the multiple first rendered images.

[0008] In some embodiments, among all the visible subspaces, at least one connected visible subspace constitutes a visible subspace set, and determining a plurality of the first rendering positions in all the visible subspaces includes: for each visual subspace set, determining a second rendering position corresponding to the visual subspace set based on a second distance along a horizontal direction and a vertical direction; and determining a plurality of the first rendering positions based on an overlap degree of second rendering images corresponding to each two adjacent second rendering positions among all the second rendering positions.

[0009] In some embodiments, determining a plurality of first rendering positions based on the overlap of second rendering images corresponding to each two adjacent second rendering positions in all second rendering positions includes: for each second rendering position, rendering the three-dimensional model based on a preset rendering angle and preset camera parameters to obtain a second rendering image corresponding to each second rendering position; for each two adjacent second rendering positions, determining the overlap of second rendering images corresponding to the two second rendering positions; when the overlap corresponding to each two adjacent second rendering positions is greater than a first threshold, determining all second rendering positions as a plurality of first rendering positions; when the overlap corresponding to each two adjacent second rendering positions is not greater than the first threshold, inserting a rendering position between each two adjacent second rendering positions whose overlap is less than or equal to the first threshold to obtain all updated second rendering positions; for all updated second rendering positions, returning to execute to obtain a second rendering image corresponding to each second rendering position, determining the corresponding overlap for each two adjacent second rendering positions until the overlap corresponding to each two adjacent second rendering positions is greater than the first threshold; determining all second rendering positions whose overlap is greater than the first threshold as a plurality of first rendering positions.

[0010] In some embodiments, for each facet, multiple visual subspaces corresponding to the facet respectively correspond to a first direction; the first direction is opposite to the normal of the facet; determining multiple first rendering angles respectively corresponding to each first rendering position includes: for each first rendering position, obtaining first directions respectively corresponding to multiple second visual subspaces adjacent to the first visual subspace; wherein the first visual subspace is the visual subspace where the first rendering position is located; based on the first directions respectively corresponding to the multiple second visual subspaces and the first direction corresponding to the first visual subspace, determining the main direction corresponding to the first visual subspace; based on the main direction corresponding to the first visual subspace, determining multiple first rendering angles corresponding to the first rendering position.

[0011] In some embodiments, based on the main direction corresponding to the first visual subspace, multiple first rendering angles corresponding to the first rendering position are determined, including: adding a second direction every preset angle along the clockwise direction and the counterclockwise direction until a preset number of second directions are obtained; based on the main direction and the preset number of second directions, multiple first rendering angles corresponding to the first rendering position are determined.

[0012] In some embodiments, the database also includes first position information of the first rendering positions corresponding to the multiple first rendered images respectively; the query for a reference image that matches all features of the target image in a pre-constructed database includes: determining, from the multiple first position information, multiple third position information that matches the second position information when the target image is captured by the user device; and determining, from the first rendered images corresponding to the multiple third position information, a reference image that matches the global features of the target image.

[0013] In a second aspect, the present application provides a visual positioning device, comprising a module for executing the method described in the first aspect.

[0014] In a third aspect, the present application provides a chip comprising an interface circuit and a logic circuit, wherein the interface circuit is used to receive signals from other chips outside the chip and transmit them to the logic circuit, or to send signals from the logic circuit to other chips outside the chip, and the logic circuit is used to implement the method of the first aspect.

[0015] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements the method of the first aspect.

[0016] In a fifth aspect, the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the processor executes the program, the method described in the first aspect is implemented.

[0017] In a sixth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the steps in the method provided in the first aspect.

[0018] The present application provides a visual positioning method, device, electronic device and storage medium. Among them, the target image is obtained by photographing the real object corresponding to the three-dimensional model; when performing visual positioning, the existing three-dimensional model is rendered in multiple visual subspaces of the three-dimensional area where the three-dimensional model is located, that is, the first rendered image under different rendering positions, different rendering angles and different camera parameters can be obtained, so as to perform visual positioning of the target image based on the first rendered image; on the one hand, in a scene where the basic image required for visual positioning by artificial photography cannot be obtained, visual positioning can be performed based on the rendered first rendered image, breaking the limitation that visual positioning cannot be performed in this scene; on the other hand, the regulation of the rendering angle and the camera position is more flexible and simple than the regulation of the angle and the camera parameters of artificial photography, and the obtained rendered image is more diverse than the basic image taken by artificial photography, which can improve the accuracy of visual positioning. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A flowchart for implementing the visual positioning method provided in the embodiment of the present application;

[0020] Figure 2 A flowchart for implementing the visual positioning method provided in the embodiment of the present application;

[0021] Figure 3 A flowchart for implementing the visual positioning method provided in the embodiment of the present application;

[0022] Figure 4 A flowchart for implementing the visual positioning method provided in the embodiment of the present application;

[0023] Figure 5 A flowchart for implementing the visual positioning method provided in the embodiment of the present application;

[0024] Figure 6 A flowchart for implementing the visual positioning method provided in the embodiment of the present application;

[0025] Fig. 7A A structural diagram of a visual positioning device provided in an embodiment of the present application;

[0026] Figure 7B A structural diagram of a visual positioning device provided in an embodiment of the present application;

[0027] Figure 8 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In this application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c alone can represent: a, b, c, a and b, a and c, or a, b, and c, where a, b, and c can be single or multiple. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

[0029] The directions or positional relationships indicated by terms such as "center", "longitudinal", "lateral", "up", "down", "left", "right", "front", and "back" are based on the directions or positional relationships shown in the accompanying drawings and are only for the convenience of describing the present application and simplifying the description. They do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present application.

[0030] The terms "connected" and "connected" should be understood in a broad sense. For example, the "connected" or "connected" of a circuit structure can refer to not only physical connection, but also electrical connection or signal connection. For example, it can be directly connected, that is, physically connected, or indirectly connected through at least one intermediate element, as long as the circuit is connected, or it can be the internal connection of two elements; signal connection can refer to signal connection through a circuit or through a media medium, such as radio waves. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0031] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the present application are subject to the following interpretations.

[0032] 3D model: A 3D object in a 3D space to be rendered. Since rendering usually focuses only on the visual features of the model, that is, the interior of the 3D object is not the object of attention, the 3D model also usually refers to the surface of the 3D object.

[0033] Mesh: A discrete representation of the surface of a three-dimensional model in a computer, which represents the surface of a three-dimensional model as a combination of vertices, edges, and faces. Among them, a vertex is a point in three-dimensional space, an edge is a straight line connecting two vertices, and a face is a polygon surrounded by edges.

[0034] Triangular mesh: A mesh where all faces are triangles.

[0035] Quad Mesh: A mesh where all faces are quadrilaterals.

[0036] Texture: Mesh information stored in a two-dimensional plane, such as color, normal, etc. Usually in the form of an image.

[0037] Global image features (or global features): refers to the features that represent the entire image. Global features are relative to local features of the image and are used to describe overall features such as color and shape of an image or target.

[0038] Local image features (or local features): Local image features are local expressions of image features, which reflect the local characteristics of the image and are suitable for image matching, retrieval and other applications. They can include: the two-dimensional coordinates of image feature points and the corresponding feature descriptors.

[0039] Image feature point (or feature point): In image processing, a feature point can be a point where the grayscale value of an image changes dramatically. Image feature points can reflect the essential characteristics of an image, such as identifying a target object recorded in an image. Matching between different images can be accomplished by matching feature points.

[0040] Visual positioning is a positioning technology that obtains images based on visual sensors (such as cameras) and performs corresponding calculations based on the images to obtain information such as the position and posture of the device equipped with the visual sensor.

[0041] In the existing visual positioning technology, it is necessary to first shoot a large number of basic images within the positioning range, extract global features and local features from the basic images, and generate a positioning map based on the extracted features and images. When performing visual positioning, when a target image is captured within the positioning range, a reference image matching the target image is queried in the positioning map, and then the local features of the reference image in the positioning map are associated with the local features of the target image to obtain the correspondence between the feature points (2D points) of the target image and the corresponding three-dimensional position coordinates (3D points) in the geographic coordinate system, and the position and posture of the electronic device in the geographic coordinate system is determined based on the correspondence.

[0042] The above positioning method requires a large number of manually taken basic images. However, in actual use, as the most basic raw data, the manually taken reference images may not be easily sold, so it may not be possible to build a positioning map based on the manually taken images to achieve visual positioning. In addition, the number and diversity of manually taken images are relatively limited, and the positioning accuracy is low.

[0043] Although the basic images taken manually may not be sold easily, the three-dimensional models built based on the original data are easy to sell or provide for free. Based on this, the present application provides a visual positioning method, which can realize the positioning of the user device by using the existing three-dimensional model without the basic images taken manually, and can ensure the positioning accuracy.

[0044] Figure 1 The following is a flowchart of the visual positioning method provided in the embodiment of the present application. Figure 1 As shown, the method includes:

[0045] S101: Acquire a target image captured by a user device.

[0046] The user device is equipped with a visual sensor (such as a camera) capable of capturing images.

[0047] In the present application, the execution entity may be a user device, or a server deployed in the cloud that can transmit data with the user device.

[0048] The visual positioning method of the present application can be applied to the field of navigation. The visual sensor on the user device collects images in real time. After each image is acquired by the user device, it is used as the target image to execute the solution of the present application. Alternatively, after each image acquired by the visual sensor, the target device sends it to the server as the target image so that the server executes the solution of the present application.

[0049] This application uses the execution subject as a user device as an example to exemplify the visual positioning method.

[0050] S102: Query a reference image that matches the global features of the target image from a pre-built database.

[0051] The database contains a plurality of first rendered images.

[0052] Before executing S102 , for each first rendered image, the user equipment may extract a global feature of the first rendered image to obtain a first global feature of each first rendered image, and store the first global feature corresponding to each rendered image in a database.

[0053] S102 can be specifically implemented in the following manner: the user device extracts global features from the target image to obtain a second global feature of the target image, and searches a database for a reference image whose first global feature matches the second global feature of the target image. The number of reference images can be one or more.

[0054] The multiple first rendered images in the database are obtained by rendering an existing three-dimensional model based on multiple rendering postures and one or more camera parameters. The existing three-dimensional model can be constructed based on multiple data sources. Among them, the multiple data sources of the present application include: visible light images collected by high-altitude high-resolution satellites, images collected by low-altitude drones through orthographic or oblique projection, and videos or images collected by ground panoramic cameras, mobile phones, cameras, etc. In addition to image data, optional data include Lidar, Global Navigation Satellite System (GNSS), geomagnetic information, data obtained by other sensors such as gyroscopes and accelerometers.

[0055] A rendering posture includes a first rendering position and a plurality of first rendering angles.

[0056] The camera parameters include: focal length, principal point, distortion parameters, camera model, etc.; among them, the camera model includes pinhole model, fisheye model, etc.

[0057] In the present application, the 3D model is constructed based on more than one 3D object. For example, the 3D model is constructed based on a street scene within a certain geographical range, and the street scene may specifically include: trees, buildings, roads, shops, clouds in the sky, etc.

[0058] As mentioned above, a three-dimensional model generally refers to the surface of a three-dimensional object, but does not include the interior of the three-dimensional object or the space between two three-dimensional objects.

[0059] Based on this, the present application introduces the concept of a three-dimensional region. A three-dimensional region refers to a virtual representation of a continuous three-dimensional space within the geographical range where one or more three-dimensional objects corresponding to a three-dimensional model are located. The three-dimensional space includes the space inside and outside the three-dimensional object. In other words, the virtual three-dimensional model is within the above virtual three-dimensional region.

[0060] The three-dimensional region can be as follows Figure 2 As described in the embodiment, it is divided into a plurality of subspaces.

[0061] The visible subspace of a three-dimensional area is the space that light or sight can penetrate (such as the space where air is located). Figure 2 How to determine the visible subspace is specifically described, and this application will not go into details here.

[0062] In this application, a 3D model is represented by a 3D mesh, which is a three-dimensional mesh composed of multiple triangular facets or quadrilateral facets, each of which has a texture. Therefore, the texture on the facets of the 3D model can be rendered to obtain an image of the real object corresponding to the 3D model.

[0063] In the present application, the three-dimensional area includes the area where the user equipment is located and the target image is obtained based on the shooting of the real object corresponding to the three-dimensional model.

[0064] It can be understood that the present application is based on matching the first rendered image and the target image to achieve visual positioning, and the first rendered image is obtained by rendering the three-dimensional model. Then, the target image captured by the user device must also be obtained by capturing the real object corresponding to the three-dimensional model. This ensures that a rendered image matching the target image can be found.

[0065] Since the rendering position is located in the visible subspace of the three-dimensional area where the three-dimensional model is located, the real area where the user device is located must also be mapped in the virtual three-dimensional area, specifically, in the visible subspace in the three-dimensional area.

[0066] S103: Calculate the posture of the user device when shooting the target image based on the correspondence between the feature points of the target image and the feature points of the reference image.

[0067] The posture of the user equipment includes the position and posture of the user equipment. The position of the user equipment can be represented by the latitude and longitude information of the user equipment.

[0068] First, local feature extraction is performed on the target image to obtain local features of the target image and feature points corresponding to the local features of the target image; local feature extraction is performed on the reference image to obtain local features of the reference image and feature points corresponding to the local features of the reference image. The above feature points are pixel points (2D points).

[0069] Next, the feature points of the target image are matched with the feature points of the reference image to obtain the correspondence between the feature points of the target image and the feature points of the reference image (for example, point A on the target image and point B on the reference image have the same features and can be considered to be the same point).

[0070] The existing 3D model carries the 3D position coordinates (3D points) of the feature points (2D points) of the reference image in the real scene. The user device can determine the 2D-3D correspondence of the target image based on the correspondence between the feature points of the reference image and the 3D position coordinates (i.e., 2D-3D correspondence). Then, based on the 2D-3D correspondence, the user device can calculate the pose when shooting the target image by combining the perspective-n-point (PnP) algorithm and the Ransac (Random Sample Consensus) algorithm.

[0071] In some embodiments, to improve positioning accuracy, after executing S103, corresponding rendering parameters can be determined based on the calculated posture, the three-dimensional model can continue to be rendered, and a new posture can be calculated based on the image after rendering again and the target image, and the above operations are performed repeatedly until the difference between the new posture obtained and the posture obtained last time is less than a certain threshold. The obtained new posture is determined as the final posture of the target image captured by the positioning device.

[0072] The present application provides a visual positioning method, wherein a target image is obtained based on photographing a real object corresponding to a three-dimensional model; when performing visual positioning, the existing three-dimensional model is rendered in multiple visual subspaces of a three-dimensional region where the three-dimensional model is located, that is, a first rendered image under different rendering positions, different rendering angles and different camera parameters can be obtained, thereby performing visual positioning of the target image based on the first rendered image; on the one hand, in a scenario where a basic image required for visual positioning taken manually cannot be obtained, visual positioning can be performed based on the rendered first rendered image, breaking the limitation that visual positioning cannot be performed in this scenario; on the other hand, the regulation of the rendering angle and the camera position is easier, more flexible and simpler than the regulation of the angle and the camera parameters taken manually, and the obtained rendered image is more diverse than the basic image taken manually, thereby improving the positioning accuracy.

[0073] As mentioned above, the database is pre-built before executing S101. Figure 2 The embodiment describes the implementation process of building a database.

[0074] It should be noted that the execution entity for constructing the database in the present application may be a user device or other devices different from the user device, and the present application does not limit this.

[0075] Figure 2 This is a flowchart of the implementation of the visual positioning method provided in the embodiment of the present application. Figure 2 As shown, before S101, the method includes:

[0076] S201 . Divide a three-dimensional area into a plurality of subspaces based on a first distance along a horizontal direction and a vertical direction.

[0077] The first distance can be preset according to actual needs.

[0078] Specifically, the three-dimensional area may be divided vertically at a first distance along the horizontal direction until it is outside the three-dimensional area; and then the three-dimensional area may be divided horizontally at a first distance along the vertical direction until it is outside the three-dimensional area.

[0079] Exemplarily, assuming that the first distance is b, the three-dimensional area will be divided into a large number of b*b*b cubes, and each cube corresponds to a subspace.

[0080] S202. For each facet on the mesh of the three-dimensional model, based on the center position and normal of the facet, visibility analysis is performed on multiple subspaces of the three-dimensional region by means of line of sight projection to obtain multiple visible subspaces corresponding to the facet in the multiple subspaces of the three-dimensional region.

[0081] Specifically, the center position of the patch is used as the starting point of the light beam emission, and the normal is used as the light beam emission direction to simulate the emission of the first light beam, and the subspace that the first light beam can penetrate is determined as the visible subspace corresponding to the patch. The subspace that the first light beam cannot penetrate is determined as the invisible subspace corresponding to the patch.

[0082] It can be understood that if a simulated light source is set on the surface of object 1 (corresponding to the patch) and a light beam is emitted in a specific direction, and the light beam propagates in the specific direction to reach the surface of object 2, the light beam will be reflected by object 2 and thus cannot continue to propagate in the specific direction. The subspaces that the light beam passes through before reaching object 2 are all visible subspaces, and the subspace where object 2 is located is the invisible subspace.

[0083] After performing the visibility analysis operation for each face patch in S202, the visible subspace corresponding to each face patch can be obtained, wherein one face patch corresponds to one or more visible subspaces.

[0084] After the visible subspace is obtained, the opposite direction of the facet normal is determined as the visible direction of the visible subspace, which means that the facet can be seen along the visible direction in the visible subspace.

[0085] It can be understood that each patch may correspond to multiple visual subspaces, and the visual subspaces of different patches may have the same situation. In other words, one visual subspace may correspond to multiple visual directions.

[0086] Exemplarily, patch 1 corresponds to visible subspace 1, visible subspace 2 and visible subspace 3, and the opposite direction of the normal of patch 1 is direction 1; patch 2 corresponds to visual subspace 1, visible subspace 2 and visible subspace 4, and the opposite direction of the normal of patch 2 is direction 2; patch 3 corresponds to visual subspace 1, visible subspace 3 and visible subspace 4, and the opposite direction of the normal of patch 3 is direction 3.

[0087] The visible directions corresponding to the visible subspace 1 include: direction 1, direction 2, and direction 3.

[0088] The visible directions corresponding to the visible subspace 2 include: direction 1 and direction 2.

[0089] The visible directions corresponding to the visible subspace 3 include: direction 1 and direction 3.

[0090] The visible directions corresponding to the visible subspace 4 include: direction 2 and direction 3.

[0091] The visual direction corresponding to each visual subspace is also saved in the database. The visual direction can also be described as a first direction, which is used when determining the rendering angle later.

[0092] S203: Determine a plurality of first rendering positions in all visible subspaces, and determine a plurality of first rendering angles corresponding to each first rendering position.

[0093] Here, the entire visible subspace refers to the visible subspace corresponding to all the faces of the three-dimensional model.

[0094] Different first rendering positions have corresponding multiple first rendering angles. The first rendering position and the multiple first rendering angles under the first rendering position are determined as follows: Figure 3 The embodiments are described in detail and will not be described in detail here.

[0095] S204: Render the three-dimensional model based on a plurality of first rendering angles and one or more camera parameters at each first rendering position to obtain a plurality of first rendered images.

[0096] The number of the first rendered images is related to the number of the first rendering positions, the first rendering angles, and the camera parameters.

[0097] Specifically, a first rendering position, a first rendering angle, and a camera parameter can be used to render a first rendering image.

[0098] The number of first rendering angles corresponding to each first rendering position may be the same or different.

[0099] Exemplarily, there are c first rendering positions, the number of first rendering angles corresponding to each first rendering position is d, and there are e camera parameters, then the number of first rendered images is: c*d*e.

[0100] S205: Building a database based on the multiple first rendered images.

[0101] In some embodiments, as described above, operations such as global feature extraction and local feature extraction may be performed on each first rendered image, and the global features and local features of the first rendered image may also be added to the database.

[0102] This embodiment illustrates the process of building a database. First, it is necessary to determine the entire visible subspace of the three-dimensional area, and then determine multiple first rendering positions based on the entire visible subspace, and render the three-dimensional model based on the multiple first rendering positions to obtain multiple first rendered images. In this application, the visible subspace corresponds to the space that light can penetrate. There are no objects in the space, so the position points in the space can simulate the camera for shooting as the first rendering position.

[0103] Next, through Figure 3 The embodiment illustrates how to determine a plurality of first rendering positions in the entire subspace.

[0104] The present application embodiment provides a visual positioning method. Figure 3 Flowchart for implementing the visual positioning method provided in the embodiment of the present application; Figure 3 As shown, S203 determines a plurality of first rendering positions in all visible subspaces, which can be achieved by the following steps:

[0105] S2031 . For each visible subspace set, determine a second rendering position corresponding to the visible subspace set based on a second distance along a horizontal direction and a vertical direction.

[0106] When determining the first rendering position, the second rendering position is determined first, and then the first rendering position is determined based on the second rendering position.

[0107] The number of the second rendering position is at least one.

[0108] As described above, after executing S202, all visible subspaces can be obtained. After that, all visible subspaces are preliminarily divided, and at least one connected visible subspace is determined as a visible subspace set, so all visible subspaces include one or more visible subspace sets.

[0109] If a visible subspace set includes multiple connected visible subspaces, only the edge subspaces in the multiple visible subspaces are adjacent to the invisible subspace.

[0110] It can be understood that the visual subspace set is composed of multiple visual subspaces stacked together. The present application does not limit the method of determining the second rendering position. In some embodiments, any multiple positions on multiple visual subspaces can be selected as the second rendering position.

[0111] In some other embodiments, for each visible subspace set, a second rendering position corresponding to the visible subspace set may be determined based on the second distance along the horizontal direction and the vertical direction.

[0112] Specifically, the connected area formed by the set of visible subspaces can be divided according to the second distance into multiple new visible subspaces; if the shape of the connected area is a cube or a cuboid, the shape of each new visible subspace is a cube, and the side length of each new visible subspace is the second distance; then the center of each new visible subspace is determined as the second rendering position. The distance between each second rendering position is also the second distance.

[0113] It should be noted that, in the present application, the new visible subspace is only used to determine the second rendering position. In the present application, unless otherwise specified, the visible subspace refers to the one obtained after performing visibility analysis on multiple subspaces of the three-dimensional area.

[0114] S2032: Determine a plurality of first rendering positions based on the degree of overlap of second rendering images corresponding to every two adjacent second rendering positions among all the second rendering positions.

[0115] The overlap degree of two second rendered images is used to characterize the overlap degree or overlap ratio of the two second rendered images. In actual operation, it is necessary to ensure that the overlap ratio of the first rendered images corresponding to two adjacent first rendered positions is greater than a preset threshold, so that as many first rendered images as possible can be obtained. Therefore, the first rendering position can be determined based on the overlap degree of the second rendered images.

[0116] If the overlap between two adjacent second rendering positions is low, it indicates that the current second rendering position is too sparse, the diversity of the first rendering image obtained based on the current second rendering position is insufficient, and it is necessary to add a second rendering position. If the overlap between two adjacent second rendering positions is high, it indicates that the image obtained based on the current second rendering position has good diversity, and there is no need to add a second rendering position.

[0117] Figure 4 The embodiment specifically describes how to determine a plurality of first rendering positions, which will not be elaborated here.

[0118] In this embodiment, all visible subspaces are divided into multiple visible subspace sets, each of which is formed by stacking multiple visible subspaces. Then, for each visible subspace set, a second rendering position is preliminarily determined based on the second distance, and a first rendering position whose rendering image satisfies diversity is further determined based on the overlap of the second rendering images corresponding to two adjacent second rendering positions.

[0119] Next, through Figure 4 The embodiment specifically describes how to determine a plurality of first rendering positions based on the degree of overlap.

[0120] Figure 4 Flowchart for implementing the visual positioning method provided in the embodiment of the present application; Figure 4 As shown, S2032 can be implemented by executing Sa1 to Sa5 as follows multiple times:

[0121] Sa1. For each second rendering position, render the three-dimensional model based on a preset rendering angle and preset camera parameters to obtain a second rendering image corresponding to each second rendering position.

[0122] The preset rendering angle and the preset camera parameters are preset according to the requirements. The preset rendering angle and the preset camera parameters corresponding to each second rendering position are all the same.

[0123] Sa2. For each two adjacent second rendering positions, determine the overlap degree of the second rendering images respectively corresponding to the two adjacent second rendering positions.

[0124] It can be understood that all the second rendering positions include at least one group of two adjacent second rendering positions, wherein one of the two groups of second rendering positions may be the same; or the two groups of second rendering positions may be completely different.

[0125] Exemplarily, the second rendering position 1 is adjacent to the second rendering position 2; the second rendering position 2 is adjacent to the second rendering position 3; the second rendering position 3 is adjacent to the second rendering position 4. Then the second rendering position 1 and the second rendering position 2 may constitute a group of adjacent second rendering positions; the second rendering position 2 and the second rendering position 3 may constitute a group of adjacent second rendering positions, and the second rendering position 3 and the second rendering position 4 may constitute a group of adjacent second rendering positions.

[0126] The overlap degree of the two second rendered images is calculated, that is, the overlap degree of the two second rendered images is determined, that is, the ratio of the same pixel area in the two second rendered images to the total pixel area is determined.

[0127] Sa3, determining whether the overlap degree of the second rendering images corresponding to each two adjacent second rendering positions is greater than a first threshold; if so, executing Sa4; otherwise, executing Sa5.

[0128] Sa4. Determine all second rendering positions as multiple first rendering positions of all visible subspaces.

[0129] If the overlap of the second rendering images corresponding to each two adjacent second rendering positions is greater than the first threshold, it means that all current second rendering positions are reasonably set, and all second rendering positions are determined as multiple first rendering positions of the entire visible subspace.

[0130] Sa5. For each two adjacent second rendering positions whose overlap degree is less than or equal to the first threshold, insert a rendering position between the two second rendering positions to obtain a plurality of updated second rendering positions.

[0131] It can be understood that the overlap degree of the second rendering images corresponding to each two adjacent second rendering positions is not all greater than the first threshold. There are two situations:

[0132] Case 1: the overlap degree of the second rendering images corresponding to each group of two adjacent second rendering positions is less than or equal to the first threshold.

[0133] Case 2: One is that the overlap degree corresponding to two partially adjacent second rendering positions is greater than the first threshold, and the overlap degree corresponding to another partially adjacent second rendering positions is less than or equal to the first threshold.

[0134] In case 1 and case 2, the interpolation operation of the rendering positions is not performed for each group of adjacent second rendering positions; instead, the interpolation operation of the rendering positions is performed for two second rendering positions whose overlap is less than or equal to the first threshold.

[0135] The inserted rendering position may be any position between the two second rendering positions; for example, the midpoint of the line connecting the two second rendering positions.

[0136] After executing Sa5, the updated plurality of second rendering positions include: all second rendering positions before the interpolation process, and all inserted rendering positions.

[0137] Next, for the updated plurality of second rendering positions, return to execute Sa1 until the overlap corresponding to each two adjacent second rendering positions is greater than the first threshold. Then all second rendering positions with overlap greater than the first threshold are the plurality of first rendering positions of the entire visible subspace.

[0138] In this embodiment, it is specifically described how to cyclically perform the interpolation operation on multiple second rendering positions based on the overlap of the second rendering images corresponding to two adjacent second rendering positions. In this way, among the obtained multiple first rendering positions, the rendering images corresponding to the two adjacent first rendering positions have a high overlap ratio. In this way, the positioning accuracy can be improved.

[0139] As described above, for each rendering position, a plurality of corresponding first rendering angles are set. Figure 5 The embodiment exemplarily illustrates how to determine the first rendering angle.

[0140] This application provides a visual positioning method. Figure 5 This is a flowchart of the implementation of the visual positioning method provided in the embodiment of the present application. Figure 5 As shown, determining the multiple first rendering angles corresponding to each first rendering position in S203 can be implemented by the following S2033 to S2035:

[0141] Among them, S2033 to S2035 can be executed after S2031 to S2032.

[0142] S2033. For each first rendering position, obtain at least one first direction corresponding to a plurality of second visible subspaces adjacent to the first visible subspace.

[0143] The first visible subspace is the visible subspace where the first rendering position is located.

[0144] As described above, the database stores the visible direction corresponding to each visible subspace, and the visible direction is the first direction.

[0145] The second visible subspace may be a visible subspace adjacent to the first visible subspace on the horizontal plane. The number of the second visible subspaces is 8, namely: the visible subspaces in front, behind, left, right, right front, left front, right back, and left back of the first visible subspace.

[0146] The number of first directions corresponding to one second visible subspace is greater than or equal to 1. The first directions corresponding to different second visible subspaces may be the same or different.

[0147] S2034: Determine a main direction corresponding to the first visual subspace based on at least one first direction corresponding to each of the plurality of second visual subspaces and the first direction corresponding to the first visual subspace.

[0148] Specifically, according to the preset first angle, the preset angle range is divided to obtain multiple angle ranges. Exemplarily, the angle range of 0° to 360° is divided according to 10°, and the multiple angle ranges obtained include: [0°, 10°]; [10°, 20°]; [20°, 30°]; ...; [350°, 360°].

[0149] The angle between the first direction and the preset reference plane is the first angle corresponding to the first direction.

[0150] Determine the angle range of the first angle corresponding to each first direction of multiple second visual subspaces and all first directions of the first visual subspace; determine the angle range containing the most first angles among the multiple angle ranges as the target angle range of the first visual subspace; determine the direction corresponding to the central angle in the target angle range as the main direction of the first visual subspace.

[0151] S2035. Determine a plurality of first rendering angles corresponding to the first rendering position based on a main direction corresponding to the first visible subspace.

[0152] Specifically, based on the main direction, a second direction is added every preset angle along the clockwise direction and the counterclockwise direction until a preset number of second directions are obtained. Based on the main direction and the preset number of second directions, multiple first rendering angles corresponding to the first rendering position are determined.

[0153] The preset number can be set according to actual needs. Among the obtained preset number of second directions and main directions, the angle between any two adjacent directions is the preset angle.

[0154] For example, the main direction is direction 0, and the preset angle is angle a. The number of second directions is 2M; M is a positive integer less than 180 / a. If the number of second directions added in the clockwise direction and in the counterclockwise direction is the same, both are M; then in the clockwise direction, the angle range corresponding to the added second direction is: (0°, M*a°]; where the first added second direction Q 1 The angle is a°, and the second direction of the second increase is Q 2 The angle is 2*a°, and so on, the Mth increased second direction Q M The angle is M*a°.

[0155] In the counterclockwise direction, the angle ranges corresponding to the added second directions are [360°-M*a°, 360) respectively; among them, the first added second direction K 1 The angle is 360°-a°, and the second direction K 2 The angle of the second direction K is 360°-2*a°, and so on. MThe angle is 360°-M*a°.

[0156] Angles corresponding to the main direction and the second direction are determined as a plurality of first rendering angles corresponding to the first rendering position.

[0157] In this embodiment, based on the visible direction of the visual subspace where the first rendering position is located and the visible directions of multiple adjacent visual subspaces, the main direction of the visual subspace where the first rendering position is located is determined, and based on the main direction, a second direction is determined at every preset angle to increase the rendering angle, thereby obtaining more first rendering images and improving the accuracy of visual positioning.

[0158] In some embodiments, after determining the first rendering position, the first position information is also stored in a database, wherein the first position information is position information of the first rendering position obtained based on GNSS solution. The GNSS position information is used to retrieve a reference image matching the target image as quickly as possible.

[0159] Next, through Figure 6 The embodiment specifically illustrates how to quickly retrieve a reference image.

[0160] The present application embodiment provides a visual positioning method. Figure 6 This is a flowchart of the implementation of the visual positioning method provided in this application. Figure 6 As shown, S102 can be specifically implemented by the following steps:

[0161] S1021. Determine, from the multiple first location information, multiple third location information that matches the second location information when the user equipment captures the target image.

[0162] The target image captured by the user equipment carries the above-mentioned second location information.

[0163] The second location information is also GNSS location information obtained based on GNSS. GNSS positioning accuracy is low, and in severely blocked areas such as indoors, GNSS accuracy is unreliable. Therefore, this location information cannot be used as positioning information. However, a rough match of the target image can be performed based on this location information to save matching time.

[0164] Specifically, a circle may be drawn with the second position information as the center and the preset distance as the radius, and the first position information within the circle may be determined as the third position information.

[0165] S1022: Determine, from the first rendered images corresponding to the plurality of third position information, a reference image that matches the global features of the target image.

[0166] It can be understood that the farther the first position information is from the second position information, the smaller the matching degree between the corresponding first rendered image and the target image. In the present application, the first position information whose distance from the second position information is less than the preset distance is determined as the third position information, and then global feature matching is performed based on the first rendered image corresponding to the third position information, so that the matching time is reduced while ensuring that the reference image can be screened.

[0167] In some embodiments, the database further includes geomagnetic information corresponding to each first rendered image. The target image also carries geomagnetic information of the user device, which can be based on Figure 6 In a similar manner to the embodiment, multiple first rendered images are preliminarily screened based on the geomagnetic information corresponding to the first rendered images and the geomagnetic information of the user device, and then global feature matching is performed based on a smaller number of first rendered images obtained by screening, which is not described in detail in this application.

[0168] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.; or, steps in different embodiments may be combined into a new technical solution.

[0169] Based on the foregoing embodiments, an embodiment of the present application provides a visual positioning device, which includes the modules included and the units included in the modules, which can be implemented by a processor; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0170] Fig. 7A A schematic diagram of the structure of the visual positioning device provided in the embodiment of the present application is shown in FIG. Fig. 7A As shown, the visual positioning device 70 includes an acquisition module 71, a query module 72 and a solution module 73.

[0171] The acquisition module 71 is used to acquire a target image captured by a user device; wherein the target image is obtained based on capturing a real object corresponding to an existing three-dimensional model.

[0172] A query module 72 is used to query a pre-constructed database for a reference image that matches the global features of the target image; wherein the database includes a plurality of first rendered images, and the plurality of first rendered images are obtained by rendering the three-dimensional model based on a plurality of rendering postures and one or more camera parameters; wherein the rendering posture includes a first rendering position, and the first rendering position is located in a visible subspace of a three-dimensional region where the three-dimensional model is located; and the three-dimensional region includes the region where the user device is located.

[0173] The calculation module 73 is used to calculate the posture of the user equipment when shooting the target image based on the correspondence between the feature points of the reference image and the feature points of the target image.

[0174] In some embodiments, the three-dimensional model is represented by a grid, and the structure of the visual positioning device 70 is as follows: Figure 7B As shown, it also includes a database construction module 74, which is used to divide the three-dimensional area into multiple subspaces based on the first distance along the horizontal direction and the vertical direction; for each facet on the grid, based on the center position and the normal of the facet, the multiple subspaces of the three-dimensional area are subjected to visibility analysis by means of line of sight projection to obtain the visible subspace corresponding to the facet in the multiple subspaces; determine multiple first rendering positions in all visible subspaces, and determine multiple first rendering angles corresponding to each of the first rendering positions; render the three-dimensional model based on the multiple first rendering angles at each of the first rendering positions and the one or more camera parameters to obtain the multiple first rendered images; and construct the database based on the multiple first rendered images.

[0175] In some embodiments, among all the visible subspaces, at least one connected visible subspace constitutes a visible subspace set; the database construction module 74 is used to determine, for each visual subspace set, a second rendering position corresponding to the visual subspace set based on a second distance along the horizontal direction and the vertical direction; and determine a plurality of first rendering positions based on the degree of overlap of second rendering images corresponding to each two adjacent second rendering positions among all the second rendering positions.

[0176] In some embodiments, the database construction module 74 is configured to render the three-dimensional model based on a preset rendering angle and preset camera parameters for each second rendering position to obtain a second rendering image corresponding to each second rendering position; determine the overlap of the second rendering images corresponding to each two adjacent second rendering positions for each adjacent second rendering position; when the overlap corresponding to each two adjacent second rendering positions is greater than a first threshold, determine all the second rendering positions as a plurality of the first rendering positions; when the overlap corresponding to each two adjacent second rendering positions is not greater than the first threshold, insert a rendering position between each two adjacent second rendering positions whose overlap is less than or equal to the first threshold to obtain all updated second rendering positions; return to execute for all updated second rendering positions to obtain a second rendering image corresponding to each second rendering position, determine the corresponding overlap for each two adjacent second rendering positions, until the overlap corresponding to each two adjacent second rendering positions is greater than the first threshold; determine all the second rendering positions whose overlap is greater than the first threshold as a plurality of the first rendering positions.

[0177] In some embodiments, for each face patch, multiple visual subspaces corresponding to the face patch respectively correspond to the first direction; the database construction module 74 is used to obtain, for each first rendering position, the first directions respectively corresponding to multiple second visual subspaces adjacent to the first visual subspace; wherein the first visual subspace is the visual subspace where the first rendering position is located; based on the first directions respectively corresponding to the multiple second visual subspaces and the first direction corresponding to the first visual subspace, determine the main direction corresponding to the first visual subspace; based on the main direction corresponding to the first visual subspace, determine multiple first rendering angles corresponding to the first rendering position.

[0178] In some embodiments, the database construction module 74 is used to add a second direction every preset angle along the clockwise direction and the counterclockwise direction until a preset number of second directions are obtained; based on the main direction and the preset number of second directions, determine multiple first rendering angles corresponding to the first rendering position.

[0179] In some embodiments, the database also includes first position information of the first rendering positions respectively corresponding to the multiple first rendered images; the query module 72 is specifically used to determine, from the multiple first position information, multiple third position information that matches the second position information when the user device captures the target image; and determine, from the first rendered images corresponding to the multiple third position information, a reference image that matches the global features of the target image.

[0180] It should be noted that the division of modules in the visual positioning device shown in FIG. 7 in the embodiment of the present application is schematic, and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application can be integrated in a processing unit, or it can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. It can also be implemented in the form of a combination of software and hardware.

[0181] It should be noted that in the embodiment of the present application, if the above-mentioned visual positioning method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be embodied in the form of a software product in essence or in other words, the part that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable the electronic device to execute all or part of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.

[0182] An embodiment of the present application provides an electronic device, Figure 8 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application, such as Figure 8 As shown, the electronic device 80 includes a memory 801 and a processor 802, wherein the memory 801 stores a computer program that can be run on the processor 802, and when the processor 802 executes the program, the steps in the visual positioning method provided in the above embodiment are implemented.

[0183] It should be noted that the memory 801 is configured to store instructions and applications executable by the processor 802, and can also cache data to be processed or already processed by the processor 802 and various modules in the electronic device 80 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory 801 (Random Access Memory, RAM).

[0184] An embodiment of the present application provides a computer program product comprising instructions. When the instructions are executed on a computer, the computer executes the steps of the visual positioning method provided in the above method embodiment.

[0185] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium, storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0186] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0187] The features disclosed in several device embodiments provided in this application can be arbitrarily combined without conflict to obtain new device embodiments.

[0188] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A visual positioning method, characterized in that: include: Acquire a target image captured by a user device; wherein the target image is obtained by capturing a real object corresponding to an existing three-dimensional model; Querying a pre-built database for a reference image that matches the global features of the target image; wherein the database includes a plurality of first rendered images, and the plurality of first rendered images are obtained by rendering the three-dimensional model based on a plurality of rendering postures and one or more camera parameters; wherein the rendering posture includes a first rendering position, and the first rendering position is located in a visible subspace of a three-dimensional region where the three-dimensional model is located; and the three-dimensional region includes a region where the user device is located; Based on the correspondence between the feature points of the reference image and the feature points of the target image, the posture of the user equipment when shooting the target image is calculated.

2. The method according to claim 1, characterized in that The three-dimensional model is represented by a grid; the method further comprises: Dividing the three-dimensional area into a plurality of subspaces based on a first distance along a horizontal direction and a vertical direction; For each facet on the grid, based on the center position and normal direction of the facet, visibility analysis is performed on the multiple subspaces by means of line of sight projection to obtain a visible subspace corresponding to the facet in the multiple subspaces; Determine a plurality of first rendering positions in all visible subspaces, and determine a plurality of first rendering angles corresponding to each of the first rendering positions; Rendering the three-dimensional model based on the multiple first rendering angles at each of the first rendering positions and the one or more camera parameters to obtain the multiple first rendering images; The database is constructed based on the plurality of first rendered images.

3. The method according to claim 2, characterized in that Among all the visible subspaces, at least one connected visible subspace constitutes a visible subspace set, and determining a plurality of the first rendering positions in all the visible subspaces includes: For each visible subspace set, determine a second rendering position corresponding to the visible subspace set based on a second distance along a horizontal direction and a vertical direction; A plurality of first rendering positions are determined based on the overlap of the second rendering images corresponding to every two adjacent second rendering positions among all the second rendering positions.

4. The method according to claim 3, characterized in that: The determining of a plurality of first rendering positions based on the overlap of the second rendering images corresponding to each two adjacent second rendering positions among all the second rendering positions includes: For each second rendering position, the three-dimensional model is rendered based on a preset rendering angle and preset camera parameters to obtain a second rendering image corresponding to each second rendering position; For each of two adjacent second rendering positions, determining the overlap degree of the second rendering images respectively corresponding to the two second rendering positions; When the overlap degree corresponding to each two adjacent second rendering positions is greater than a first threshold, determining all the second rendering positions as a plurality of the first rendering positions; When the overlap degrees corresponding to each two adjacent second rendering positions are not all greater than the first threshold, for each two adjacent second rendering positions whose overlap degrees are less than or equal to the first threshold, insert a rendering position between the two second rendering positions to obtain all updated second rendering positions; For all the updated second rendering positions, returning to execute to obtain the second rendering image corresponding to each second rendering position, and determining the corresponding overlap degree for each two adjacent second rendering positions until the overlap degree corresponding to each two adjacent second rendering positions is greater than the first threshold; All second rendering positions whose overlap degrees are greater than the first threshold are determined as a plurality of first rendering positions.

5. The method according to claim 2, characterized in that: For each face patch, a plurality of visual subspaces corresponding to the face patch respectively correspond to the first direction; The first direction is opposite to the normal direction of the face patch; The determining a plurality of first rendering angles corresponding to each of the first rendering positions includes: For each first rendering position, obtaining first directions respectively corresponding to a plurality of second visible subspaces adjacent to the first visible subspace; wherein the first visible subspace is the visible subspace where the first rendering position is located; Determining a main direction corresponding to the first visual subspace based on the first directions respectively corresponding to the plurality of second visual subspaces and the first direction corresponding to the first visual subspace; Based on a main direction corresponding to the first visible subspace, a plurality of first rendering angles corresponding to the first rendering position are determined.

6. The method according to claim 5, characterized in that The determining, based on the main direction corresponding to the first visual subspace, a plurality of first rendering angles corresponding to the first rendering position includes: Along the clockwise direction and the counterclockwise direction, a second direction is added every preset angle until a preset number of second directions are obtained; Based on the main direction and the preset number of second directions, a plurality of first rendering angles corresponding to the first rendering position are determined.

7. The method according to claim 1, characterized in that The database also includes first position information of first rendering positions respectively corresponding to the plurality of first rendering images; The query pre-built database contains reference images that match all features of the target image, including: Determine, from the plurality of first position information, a plurality of third position information matching the second position information when the user device photographs the target image; A reference image matching the global features of the target image is determined from the first rendered images corresponding to the plurality of third position information.

8. A visual positioning device, characterized in that: include: A module for executing the method according to any one of claims 1 to 7.

9. An electronic device, characterized in that: include: Memory and processor; The memory is configured to store computer program instructions; The processor is configured to execute the computer program instructions so that the electronic device implements the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: include: Computer program instructions; The electronic device runs the computer program instructions so that the electronic device implements the method according to any one of claims 1 to 7.