A terminal device positioning method and related equipment

By constructing a matching error objective function for multiple image frames and optimizing the pose of the terminal device, the problem of low accuracy of positioning results in the existing technology is solved, and higher positioning accuracy and robustness are achieved.

CN113239072BActive Publication Date: 2024-09-06HUAWEI TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202110460636.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-27
Publication Date
2024-09-06
Estimated Expiration
2041-04-27

AI Technical Summary

Technical Problem

Existing terminal device positioning methods consider a single factor, resulting in low accuracy of positioning results.

Method used

By obtaining the matching error between the feature points of the current image frame and other image frames and the vector map points, an objective function is constructed to optimize the pose of the terminal device, consider the correlation between the current image frame and other image frames, and improve the positioning results. accuracy.

Benefits of technology

The accuracy of the terminal device positioning results is improved. Through the joint optimization of multiple image frames, the sparsity and overlap of map points are reduced, and the robustness and convergence speed of pose adjustment are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113239072B
    Figure CN113239072B
Patent Text Reader

Abstract

The present application provides a terminal device positioning method and related devices, which can improve the accuracy of the positioning result of the terminal device. The method of the present application includes: obtaining a first map point matching the first feature point of the current image frame shot by the terminal device from a vector map; obtaining a second map point matching the second feature point of other image frames before the current image frame from the vector map; adjusting the posture of the terminal device when shooting the current image frame according to an objective function, and obtaining the posture of the terminal device when shooting the current image frame after the current adjustment as the positioning result of the terminal device, the objective function including a first matching error between the first feature point and the first map point, and a second matching error between the second feature point and the second map point.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a terminal device positioning method and related equipment. Background Art

[0002] At present, intelligent terminal devices such as self-driving cars, drones and robots have been widely used in daily life. For these mobile terminal devices, in order to accurately obtain the real-time location of the terminal devices, high-precision positioning technology has emerged.

[0003] In the process of positioning the terminal device, the current image frame taken by the terminal device can be obtained, and map points matching the feature points used to present the objects in the traffic environment in the current image frame can be obtained from a preset vector map (in this map, objects in the traffic environment can be represented by map points, for example, lamp poles are represented by straight lines formed by map points, signboards are represented by rectangular boxes formed by map points, etc.), and finally, the positioning result of the terminal device in the vector map is determined based on the matching result between the feature points and the map points.

[0004] However, the factors considered in the positioning process of the above terminal device are relatively simple, resulting in low accuracy of the positioning result of the terminal device. Summary of the invention

[0005] The embodiments of the present application provide a terminal device positioning method and related devices, which can improve the accuracy of the positioning result of the terminal device.

[0006] A first aspect of an embodiment of the present application provides a terminal device positioning method, the method comprising:

[0007] When the terminal device is moving, it can use the camera to shoot the traffic environment at the current moment to obtain the current image frame. Furthermore, the terminal device can also obtain other image frames before the current image frame. Then, the terminal device can locate itself according to the current image frame and other image frames.

[0008] Specifically, the terminal device first obtains a first map point that matches a first feature point of the current image frame from the vector map. For example, a feature point used to present a traffic light in the current image frame and a map point used to represent a traffic light in the vector map are matched points, a feature point used to present a lane line in the current image frame and a map point used to represent a lane line in the vector map are matched points, and so on. Similarly, the terminal device can also obtain a second map point that matches a second feature point of another image frame before the current image frame from the vector map.

[0009] Since there is a certain matching error between the first feature point and the first map point, and there is also a certain matching error between the second feature point and the second map point, it is necessary to make these two matching errors as small as possible to improve the accuracy of the positioning result of the terminal device.

[0010] Based on this, the terminal device can construct an objective function according to the first matching error between the first feature point and the first map point, and the second matching error between the second feature point and the second map point, and adjust the posture of the terminal device when shooting the current image frame according to the objective function, that is, optimize the posture of the terminal device when shooting the current image frame according to the objective function until the objective function converges, thereby obtaining the posture of the terminal device when shooting the current image frame after the current adjustment (optimization), and use it as the positioning result of the terminal device in the vector map. Among them, the posture of the terminal device when shooting the current image frame generally refers to the posture of the terminal device in the three-dimensional coordinate system corresponding to the vector map when shooting the current image frame.

[0011] It can be seen from the above method that after obtaining the current image frame and other image frames before the current image frame, the first map point matching the first feature point of the current image frame and the second map point matching the second feature point of other image frames before the current image frame can be obtained from the vector map. Then, according to the objective function constructed by the first matching error between the first feature point and the first map point and the second matching error between the second feature point and the second map point, the position and posture of the terminal device when shooting the current image frame can be adjusted to obtain the position and posture of the terminal device when shooting the current image frame after the current adjustment. In the above process, since the objective function includes both the matching error between the feature points of the current image frame and the map points of the vector map, and the matching error between the feature points of other image frames and the map points of the vector map, the posture of the terminal device when shooting the current image frame is adjusted through the objective function, which not only considers the influence of the current image frame on the optimization process of the posture of the terminal device when shooting the current image frame, but also considers the influence of other image frames on the optimization process of the posture of the terminal device when shooting the current image frame, that is, considers the correlation between the current image frame and other image frames, and the factors considered are more comprehensive. Therefore, the positioning result of the terminal device obtained in this way has higher accuracy.

[0012] In a possible implementation, the method further includes: obtaining the posture of the terminal device when shooting the current image frame and the posture of the terminal device when shooting other image frames after the last adjustment, and performing semantic detection on the current image frame and other image frames before the current image frame, so as to obtain the first feature point of the current image frame and the second feature point of other image frames before the current image frame. Then, according to the posture of the terminal device when shooting the current image frame, the first map point matching the first feature point can be obtained from the vector map, and according to the posture of the terminal device when shooting other image frames after the last adjustment, the second map point matching the second feature point can be obtained from the vector map. In this way, the association matching between the feature point and the map point can be completed.

[0013] In a possible implementation, the posture of the terminal device when shooting the current image frame is adjusted according to the objective function, and the posture of the terminal device when shooting the current image frame after the current adjustment is obtained, including: after obtaining the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system, the distance between the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system is calculated, and the initial value of the first matching error can be obtained. Then, after obtaining the position of the second feature point in the second coordinate system and the position of the second map point in the second coordinate system, the distance between the position of the second feature point in the second coordinate system and the position of the second map point in the second coordinate system is calculated, and the initial value of the second matching error can be obtained. Finally, according to the initial value of the first matching error and the initial value of the second matching error, the objective function is iteratively solved until the preset iteration condition is met, and the posture of the terminal device when shooting the current image frame after the current adjustment is obtained. In the aforementioned implementation, after completing the matching between the first feature point and the first map point, and the matching between the second feature point and the second map point, the initial value of the first matching error between the first feature point and the first map point, and the initial value of the second matching error between the second feature point and the second map point can be calculated, so as to iteratively solve the objective function in combination with these two initial values, which is equivalent to adjusting the posture of the terminal device when taking the current image frame according to the current image frame and other image frames. The factors considered are more comprehensive, so as to accurately obtain the positioning result of the terminal device.

[0014] In a possible implementation, the distance between the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system includes at least one of the following: (1) the position of the first feature point in the current image frame and the distance between the position of the first map point in the current image frame, wherein the position of the first map point in the current image frame is obtained based on the position of the first map point in the three-dimensional coordinate system corresponding to the vector map and the posture of the terminal device when shooting the current image frame. (2) the position of the first feature point in the three-dimensional coordinate system corresponding to the vector map and the distance between the position of the first map point in the three-dimensional coordinate system corresponding to the vector map, wherein the position of the first feature point in the three-dimensional coordinate system corresponding to the vector map is obtained based on the position of the first feature point in the current image frame and the posture of the terminal device when shooting the current image frame. (3) The position of the first feature point in the three-dimensional coordinate system corresponding to the terminal device, and the distance between the position of the first map point in the three-dimensional coordinate system corresponding to the terminal device, wherein the position of the first feature point in the three-dimensional coordinate system corresponding to the terminal device is obtained according to the position of the first feature point in the current image frame and the posture of the terminal device when shooting the current image frame, and the position of the first map point in the three-dimensional coordinate system corresponding to the terminal device is obtained according to the position of the first map point in the three-dimensional coordinate system corresponding to the vector map and the posture of the terminal device when shooting the current image frame.

[0015] In a possible implementation, the distance between the position of the second feature point in the second coordinate system and the position of the second map point in the second coordinate system includes at least one of the following: (1) the position of the second feature point in other image frames, and the distance between the position of the second map point in other image frames, wherein the position of the second map point in other image frames is obtained based on the position of the second map point in the three-dimensional coordinate system corresponding to the vector map and the posture of the terminal device when the other image frames were last adjusted. (2) the position of the second feature point in the three-dimensional coordinate system corresponding to the vector map, and the distance between the position of the second map point in the three-dimensional coordinate system corresponding to the vector map, wherein the position of the second feature point in the three-dimensional coordinate system corresponding to the vector map is obtained based on the position of the second feature point in other image frames and the posture of the terminal device when the other image frames were last adjusted. (3) The position of the second feature point in the three-dimensional coordinate system corresponding to the terminal device, and the distance between the position of the second map point in the three-dimensional coordinate system corresponding to the terminal device, wherein the position of the second feature point in the three-dimensional coordinate system corresponding to the terminal device is obtained based on the position of the second feature point in other image frames and the last adjusted position and posture of the terminal device when shooting other image frames, and the position of the second map point in the three-dimensional coordinate system corresponding to the terminal device is obtained based on the position of the second map point in the three-dimensional coordinate system corresponding to the vector map and the last adjusted position and posture of the terminal when shooting other image frames.

[0016] In one possible implementation, the iteration condition is: for any iteration, if the difference between the inter-frame pose difference obtained in the iteration and the inter-frame pose difference calculated by the terminal device is less than a preset threshold, the iteration is stopped, and the inter-frame pose difference obtained in the iteration is determined according to the pose of the terminal device when taking the current image frame obtained in the iteration and the pose of the terminal device when taking other image frames obtained in the iteration, and the inter-frame pose difference is the pose difference between two adjacent image frames taken by the terminal device in the current image frame and other image frames; if the difference is greater than or equal to the threshold, the next iteration is executed until the number of iterations is equal to the preset number.

[0017] In a possible implementation, the number of other image frames may vary as the motion state of the terminal device changes. Specifically, the number of other image frames may be determined according to the speed of the terminal device.

[0018] In a possible implementation, obtaining the posture of the terminal device when shooting the current image frame includes: calculating the predicted posture of the terminal device when shooting the current image frame based on the posture of the terminal device when shooting other image frames after the last adjustment and the inter-frame posture difference calculated by the terminal device; performing layered sampling on the predicted posture of the terminal device when shooting the current image frame to obtain the posture of the terminal device when shooting the current image frame. In the aforementioned implementation, the posture of the terminal device when shooting the current image frame obtained by layered sampling can be used as the initial posture of the current adjustment, thereby improving the convergence speed and robustness of the current adjustment.

[0019] In one possible implementation, if the posture of the terminal device when shooting the current image frame includes a horizontal coordinate, a vertical coordinate and a heading angle, the predicted posture of the terminal device when shooting the current image frame is layered sampled to obtain the posture of the terminal device when shooting the current image frame, including: obtaining the position of the third map point in the three-dimensional coordinate system corresponding to the vector map and the position of the first feature point in the current image frame; keeping the heading angle of the predicted posture of the terminal device when shooting the current image frame unchanged, changing the horizontal coordinate and the vertical coordinate of the predicted posture of the terminal device when shooting the current image frame, and obtaining a first candidate posture; according to the first candidate posture, the three-dimensional coordinate system corresponding to the third map point in the vector map is calculated. The position of the first feature point in the image coordinate system is transformed to obtain the position of the third map point in the preset image coordinate system; the horizontal and vertical coordinates of the predicted posture when the terminal device shoots the current image frame remain unchanged, and the heading angle of the predicted posture when the terminal device shoots the current image frame is changed to obtain the second candidate posture; the position of the first feature point in the current image frame is transformed according to the second candidate posture to obtain the position of the first feature point in the image coordinate system; according to the distance between the position of the third map point in the image coordinate system and the position of the first feature point in the image coordinate system, the posture of the terminal device when shooting the current image frame is determined from the combination of the first candidate posture and the second candidate posture. The aforementioned posture sampling method can effectively reduce the amount of calculation required in the posture sampling process.

[0020] In one possible implementation, if the posture of the terminal device when shooting the current image frame includes a horizontal coordinate, a vertical coordinate, a heading angle, a rolling angle, and a pitch angle, then the predicted posture of the terminal device when shooting the current image frame is layered sampled to obtain the posture of the terminal device when shooting the current image frame, including: obtaining the position of the third map point in the three-dimensional coordinate system corresponding to the vector map and the position of the first feature point in the current image frame; keeping the heading angle, rolling angle, pitch angle, and vertical coordinate of the predicted posture of the terminal device when shooting the current image frame unchanged, changing the horizontal coordinate and vertical coordinate of the predicted posture of the terminal device when shooting the current image frame, and obtaining a first candidate posture; transforming the position of the third map point in the three-dimensional coordinate system corresponding to the vector map according to the first candidate posture, and obtaining the position of the third map point in a preset image coordinate system; keeping the horizontal coordinate, vertical coordinate, rolling angle, and pitch angle of the predicted posture of the terminal device when shooting the current image frame unchanged, and changing the horizontal coordinate and vertical coordinate of the predicted posture of the terminal device when shooting the current image frame. The heading angle of the predicted posture when shooting the current image frame is obtained to obtain the second candidate posture; according to the second candidate posture, the position of the first feature point in the current image frame is transformed to obtain the position of the first feature point in the image coordinate system; according to the distance between the position of the third map point in the image coordinate system and the position of the first feature point in the image coordinate system, the third candidate posture is determined from the combination of the first candidate posture and the second candidate posture; the horizontal coordinate, vertical coordinate, heading angle and roll angle of the predicted posture of the third candidate posture are kept unchanged, and the pitch angle and vertical coordinate of the third candidate posture are changed to obtain the fourth candidate posture; according to the fourth candidate posture, the position of the third map point in the three-dimensional coordinate system corresponding to the vector map is transformed to obtain the position of the third map point in the current image frame; according to the distance between the position of the first feature point in the current image frame and the position of the third map point in the current image frame, the posture of the terminal device when shooting the current image frame is determined from the fourth candidate posture. Through the aforementioned posture sampling method, the amount of calculation required in the posture sampling process can be effectively reduced.

[0021] A second aspect of an embodiment of the present application provides a terminal device positioning device, which includes: a first matching module, used to obtain a first map point that matches a first feature point of a current image frame from a vector map; a second matching module, used to obtain a second map point that matches a second feature point of other image frames before the current image frame from the vector map; an optimization module, used to adjust the posture of the terminal device when shooting the current image frame according to an objective function, and obtain the posture of the terminal device when shooting the current image frame after the current adjustment as the positioning result of the terminal device, the objective function including a first matching error between the first feature point and the first map point, and a second matching error between the second feature point and the second map point.

[0022] It can be seen from the above device that after obtaining the current image frame and other image frames before the current image frame, the first map point matching the first feature point of the current image frame and the second map point matching the second feature point of other image frames before the current image frame can be obtained from the vector map. Then, according to the objective function constructed by the first matching error between the first feature point and the first map point and the second matching error between the second feature point and the second map point, the position and posture of the terminal device when shooting the current image frame can be adjusted to obtain the position and posture of the terminal device when shooting the current image frame after the current adjustment. In the above process, since the objective function includes both the matching error between the feature points of the current image frame and the map points of the vector map, and the matching error between the feature points of other image frames and the map points of the vector map, the posture of the terminal device when shooting the current image frame is adjusted through the objective function, which not only considers the influence of the current image frame on the optimization process of the posture of the terminal device when shooting the current image frame, but also considers the influence of other image frames on the optimization process of the posture of the terminal device when shooting the current image frame, that is, considers the correlation between the current image frame and other image frames, and the factors considered are more comprehensive. Therefore, the positioning result of the terminal device obtained in this way has higher accuracy.

[0023] In a possible implementation, the device also includes: an acquisition module, used to acquire the first feature point of the current image frame, the second feature point of other image frames before the current image frame, the posture of the terminal device when shooting the current image frame, and the posture of the terminal device when shooting other image frames after the last adjustment; a first matching module, used to acquire a first map point matching the first feature point from a vector map according to the posture of the terminal device when shooting the current image frame; and a second matching module, used to acquire a second map point matching the second feature point from a vector map according to the posture of the terminal device when shooting other image frames after the last adjustment.

[0024] In one possible implementation, the optimization module is used to: calculate an initial value of a first matching error based on a distance between a position of a first feature point in a first coordinate system and a position of a first map point in the first coordinate system; calculate an initial value of a second matching error based on a distance between a position of a second feature point in a second coordinate system and a position of a second map point in the second coordinate system; iteratively solve an objective function based on the initial value of the first matching error and the initial value of the second matching error until a preset iteration condition is met, thereby obtaining the posture of the terminal device after the current adjustment when shooting the current image frame.

[0025] In a possible implementation, the distance between the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system includes at least one of the following: the distance between the position of the first feature point in the current image frame and the position of the first map point in the current image frame; the distance between the position of the first feature point in the three-dimensional coordinate system corresponding to the vector map and the position of the first map point in the three-dimensional coordinate system corresponding to the vector map; the distance between the position of the first feature point in the three-dimensional coordinate system corresponding to the terminal device and the position of the first map point in the three-dimensional coordinate system corresponding to the terminal device.

[0026] In one possible implementation, the distance between the position of the second feature point in the second coordinate system and the position of the second map point in the second coordinate system includes at least one of the following: the distance between the position of the second feature point in other image frames and the position of the second map point in other image frames; the distance between the position of the second feature point in the three-dimensional coordinate system corresponding to the vector map and the position of the second map point in the three-dimensional coordinate system corresponding to the vector map; the distance between the position of the second feature point in the three-dimensional coordinate system corresponding to the terminal device and the position of the second map point in the three-dimensional coordinate system corresponding to the terminal device.

[0027] In one possible implementation, the iteration condition is: for any iteration, if the difference between the inter-frame pose difference obtained in the iteration and the inter-frame pose difference calculated by the terminal device is less than a preset threshold, the iteration is stopped, and the inter-frame pose difference obtained in the iteration is determined according to the pose of the terminal device when taking the current image frame obtained in the iteration and the pose of the terminal device when taking other image frames obtained in the iteration, and the inter-frame pose difference is the pose difference between two adjacent image frames taken by the terminal device in the current image frame and other image frames; if the difference is greater than or equal to the threshold, the next iteration is executed until the number of iterations is equal to the preset number.

[0028] In a possible implementation manner, the number of other image frames is determined according to the speed of the terminal device.

[0029] In one possible implementation, the acquisition module is used to: calculate the predicted posture of the terminal device when shooting the current image frame based on the posture of the terminal device when shooting other image frames after the last adjustment and the inter-frame posture difference calculated by the terminal device; perform stratified sampling on the predicted posture of the terminal device when shooting the current image frame to obtain the posture of the terminal device when shooting the current image frame.

[0030] In a possible implementation, if the posture of the terminal device when shooting the current image frame includes a horizontal coordinate, a vertical coordinate and a heading angle, the acquisition module is used to: obtain the position of the third map point in the three-dimensional coordinate system corresponding to the vector map and the position of the first feature point in the current image frame; keep the heading angle of the predicted posture of the terminal device when shooting the current image frame unchanged, change the horizontal coordinate and the vertical coordinate of the predicted posture of the terminal device when shooting the current image frame, and obtain a first candidate posture; transform the position of the third map point in the three-dimensional coordinate system corresponding to the vector map according to the first candidate posture, and obtain the heading angle of the third map point in the predicted posture The position of the first feature point in the image coordinate system is set; the horizontal and vertical coordinates of the predicted posture when the terminal device shoots the current image frame remain unchanged, and the heading angle of the predicted posture when the terminal device shoots the current image frame is changed to obtain the second candidate posture; according to the second candidate posture, the position of the first feature point in the current image frame is transformed to obtain the position of the first feature point in the image coordinate system; according to the distance between the position of the third map point in the image coordinate system and the position of the first feature point in the image coordinate system, the posture of the terminal device when shooting the current image frame is determined from the combination of the first candidate posture and the second candidate posture. The aforementioned posture sampling method can effectively reduce the amount of calculation required in the posture sampling process.

[0031] In one possible implementation, if the posture of the terminal device when shooting the current image frame includes horizontal coordinates, vertical coordinates, vertical coordinates, heading angles, roll angles and pitch angles, the acquisition module is used to: obtain the position of the third map point in the three-dimensional coordinate system corresponding to the vector map and the position of the first feature point in the current image frame; keep the heading angle, roll angle, pitch angle and vertical coordinates of the predicted posture of the terminal device when shooting the current image frame unchanged, change the horizontal coordinates and vertical coordinates of the predicted posture of the terminal device when shooting the current image frame, and obtain the first candidate posture; transform the position of the third map point in the three-dimensional coordinate system corresponding to the vector map according to the first candidate posture, and obtain the position of the third map point in the preset image coordinate system; keep the horizontal coordinates, vertical coordinates, roll angles and pitch angles of the predicted posture of the terminal device when shooting the current image frame unchanged, change the heading angle of the predicted posture of the terminal device when shooting the current image frame, and obtain to the second candidate pose; transform the position of the first feature point in the current image frame according to the second candidate pose to obtain the position of the first feature point in the image coordinate system; determine the third candidate pose from the combination of the first candidate pose and the second candidate pose according to the distance between the position of the third map point in the image coordinate system and the position of the first feature point in the image coordinate system; keep the horizontal coordinate, vertical coordinate, heading angle and roll angle of the predicted pose of the third candidate pose unchanged, change the pitch angle and vertical coordinate of the third candidate pose, and obtain the fourth candidate pose; transform the position of the third map point in the three-dimensional coordinate system corresponding to the vector map according to the fourth candidate pose to obtain the position of the third map point in the current image frame; determine the pose of the terminal device when shooting the current image frame from the fourth candidate pose according to the distance between the position of the first feature point in the current image frame and the position of the third map point in the current image frame. Through the aforementioned pose sampling method, the amount of calculation required in the pose sampling process can be effectively reduced.

[0032] A third aspect of an embodiment of the present application provides a terminal device positioning device, which includes a memory and a processor; the memory stores code, and the processor is configured to execute the code. When the code is executed, the terminal device positioning device executes the method described in the first aspect or any possible implementation method of the first aspect.

[0033] A fourth aspect of an embodiment of the present application provides a vehicle, which includes the terminal equipment positioning device as described in the third aspect.

[0034] A fifth aspect of the embodiments of the present application provides a computer storage medium, which stores a computer program. When the program is executed by a computer, the computer implements the method described in the first aspect or any possible implementation of the first aspect.

[0035] A sixth aspect of the embodiments of the present application provides a computer program product, which stores instructions. When the instructions are executed by a computer, the computer implements the method described in the first aspect or any possible implementation of the first aspect.

[0036] In the embodiment of the present application, after obtaining the current image frame and other image frames before the current image frame, a first map point matching the first feature point of the current image frame and a second map point matching the second feature point of other image frames before the current image frame can be obtained from the vector map. Then, according to the objective function constructed by the first matching error between the first feature point and the first map point and the second matching error between the second feature point and the second map point, the position and posture of the terminal device when shooting the current image frame can be adjusted to obtain the position and posture of the terminal device when shooting the current image frame after the current adjustment. In the above process, since the objective function includes both the matching error between the feature points of the current image frame and the map points of the vector map, as well as the matching error between the feature points of other image frames and the map points of the vector map, the posture of the terminal device when shooting the current image frame is adjusted through the objective function, which not only considers the influence of the current image frame on the optimization process of the posture of the terminal device when shooting the current image frame, but also considers the influence of other image frames on the optimization process of the posture of the terminal device when shooting the current image frame (that is, the correlation between the current image frame and other image frames is considered). The factors considered are more comprehensive, so the positioning result of the terminal device obtained in this way has higher accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a schematic diagram of a vector map;

[0038] Figure 2 A schematic diagram of a flow chart of a method for locating a terminal device provided in an embodiment of the present application;

[0039] Figure 3 A schematic diagram of a three-dimensional coordinate system corresponding to a terminal device provided in an embodiment of the present application;

[0040] Figure 4 A schematic diagram of the inter-frame pose difference provided in an embodiment of the present application;

[0041] Figure 5 A schematic diagram of a first feature point of a current image frame provided by an embodiment of the present application;

[0042] Figure 6 A schematic diagram of calculating the degree of overlap provided in an embodiment of the present application;

[0043] Figure 7 A schematic diagram of the structure of a terminal device positioning device provided in an embodiment of the present application;

[0044] Figure 8 Another structural schematic diagram of the terminal equipment positioning device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The embodiments of the present application provide a terminal device positioning method and related devices, which can improve the accuracy of the positioning result of the terminal device.

[0046] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0047] The embodiments of the present application can be implemented through a terminal device, for example, an on-board device on a car, a drone, a robot, etc. For ease of explanation, the on-board device on a car is referred to as a car below, and a moving car is used as an example for introduction.

[0048] When a car is driving, if the user wants to determine the location of the car, high-precision positioning of the car is required. In related technologies, a complete vector map is usually pre-installed inside the car. Figure 1 A schematic diagram of a vector map, such as Figure 1 As shown, the vector map can display the virtual traffic environment in which the car is currently located, and the traffic environment includes various objects around the car, such as traffic lights, lamp poles, signs, lane lines, etc. These objects can be represented by pixel points on the vector map, that is, by map points in the vector map. For example, a lamp pole can be represented by a straight line formed by a plurality of map points, and a sign can be represented by a rectangular box formed by a plurality of map points, and so on. It is worth noting that the virtual traffic environment displayed by the vector map is drawn according to the traffic environment in the real world, and the posture of the car displayed by the vector map is generally obtained by the car through calculation, which may be different from the real posture of the car in the real world. Therefore, it is necessary to correct and optimize the posture of the car in the vector map to improve the accuracy of the positioning result of the car. It can be understood that the posture of the car usually includes the position of the car and the orientation of the car, which will not be repeated later.

[0049] Specifically, during driving, the car can capture the current image frame to present the real traffic environment where the car is located at the current moment. Then, the car can match the feature points of the current image frame with the map points of the vector map, which is equivalent to matching the real traffic environment where the car is located with the virtual traffic environment where the car is located. Finally, according to the matching results between the feature points of the current image frame and the map points of the vector map, for example, the matching error between the two, etc., the posture of the car in the vector map is adjusted, and the optimized posture of the car is used as the positioning result of the car.

[0050] However, the positioning result of the car is determined only through the current image frame, and the factors considered are relatively single, resulting in low accuracy of the positioning result of the car.

[0051] Based on this, in order to improve the accuracy of the positioning result of the terminal device, an embodiment of the present application provides a positioning method for a terminal device. For the sake of convenience, the posture of the terminal device when shooting any image frame is referred to as the posture of the image frame. For example, the posture of the terminal device when shooting the current image frame can be referred to as the posture of the current image frame. For example, the posture of the terminal device when shooting other image frames before the current image frame can be referred to as the posture of other image frames, etc. For example, after the posture of the terminal device when shooting the current image frame is optimized (adjusted) for the current time, the posture of the terminal device when shooting the current image frame after the current optimization (adjustment) can be obtained, that is, the posture of the current image frame after the current optimization, etc., which will not be repeated later. Figure 2 A flow chart of a method for locating a terminal device provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the method includes:

[0052] 201. Obtain a first feature point of a current image frame, a second feature point of other image frames before the current image frame, a position and posture of the current image frame, and a position and posture of other image frames after last optimization.

[0053] In this embodiment, the terminal device has a camera. During the movement, the terminal device can shoot the current traffic environment through the camera to obtain the current image frame. Furthermore, the terminal device can also obtain other image frames before the current image frame, and the number of other image frames can be determined according to the speed of the terminal device, as shown in formula (1):

[0054]

[0055] In the above formula, t is the number of the current image frame and other image frames, t-1 is the number of other image frames, t0 is the preset threshold, α is the preset adjustment coefficient, and v is the speed of the terminal device at the current moment. In this way, after obtaining the current image frame and other image frames, the terminal device can locate itself according to the current image frame and other image frames.

[0056] After the terminal device obtains the current image frame and other image frames, it can obtain the pose of the current image frame and the poses of other image frames after the last optimization. It should be noted that, for the pose of the current image frame, the pose of the current image frame can be optimized for the current time based on the current image frame and other image frames to obtain the pose of the current image frame after the current optimization and the poses of other image frames after the current optimization. It can be seen that the pose of other image frames after the last optimization is the result obtained after the pose of other image frames is optimized for the last time based on other image frames.

[0057] The pose of the current image frame can be obtained in the following way: first, the predicted pose of the current image frame is calculated based on the poses of other image frames after the last optimization and the inter-frame pose difference calculated by the terminal device. Then, the predicted pose of the current image frame is layered sampled to obtain the pose of the current image frame.

[0058] Specifically, the terminal device may also have an odometer, and the odometer may construct a three-dimensional coordinate system corresponding to the terminal device, for example, a vehicle body coordinate system and the like. Figure 3 A schematic diagram of a three-dimensional coordinate system corresponding to a terminal device provided in an embodiment of the present application, such as Figure 3 As shown, in this three-dimensional coordinate system, the origin is the starting point of the terminal device, the X-axis points to the front of the terminal device at the starting point of the movement, the Y-axis points to the left of the terminal device at the starting point of the movement, and the Z-axis can be defaulted to zero. Then, when the terminal device starts to move from the origin, its position and orientation are constantly changing (i.e., rotation and translation occur). During the movement of the terminal device, the odometer can calculate the posture difference corresponding to the terminal device when shooting two adjacent image frames. This posture difference is the posture difference between the two adjacent image frames, which can also be called the inter-frame posture difference. The inter-frame posture difference can be expressed by formula (2): ΔT = {ΔR, Δt} (2)

[0059] In the above formula, ΔT is the inter-frame pose difference, ΔR is the rotation between two adjacent image frames, and Δt is the translation between two adjacent image frames.

[0060] In order to further understand the inter-frame pose difference, the following Figure 4 Give further introduction to it. Figure 4 A schematic diagram of the inter-frame pose difference provided in the embodiment of the present application is shown in FIG. Figure 4As shown, suppose the current image frame and the other image frames before the current image frame are t frames in total. Among them, F1 represents the first image frame among the other image frames, F2 represents the second image frame among the other image frames, ..., F t-1 Indicates the last image frame among other image frames (i.e., the image frame before the current image frame), F t Represents the current image frame. The odometer can calculate the pose difference between F1 and F2 as ΔT t-1 ,…,get F t-1 and F t The posture difference between them is ΔT t-1 Then, the predicted pose of the current image frame can be calculated by formula (3):

[0061] P t =P t-1 *ΔT t-1 (3)

[0062] In the above formula, P t is the predicted pose of the current image frame, P t-1 is the pose of the previous image frame after the last optimization. Based on formula (3), the predicted pose of the current image frame can also be calculated by formula (4):

[0063] P t =(ΔT t-0 *ΔT t-2 *…*ΔT t-m )*P t-m (4)

[0064] In the above formula, P t-m is the pose of the tmth image frame among the other image frames after the last optimization.

[0065] After obtaining the predicted pose of the current image frame, the predicted pose can be layered sampled to obtain the pose of the current image frame, that is, the initial pose value used for the current optimization. Specifically, the predicted pose of the current image frame can be layered sampled in a variety of ways, which will be introduced below:

[0066] In a possible implementation, if the pose of the current image frame is a three-degree-of-freedom quantity, that is, it includes abscissa, ordinate and heading angle, the stratified sampling process includes: (i) some map points can be arbitrarily selected within the range pre-defined in the vector map as the third map point, and the position of the third map point in the three-dimensional coordinate system corresponding to the vector map and the position of the first feature point in the current image frame are obtained. It can be understood that the position of the third map point in the three-dimensional coordinate system corresponding to the vector map is a three-dimensional coordinate, and the position of the first feature point in the current image frame is a two-dimensional coordinate. (ii) Keeping the heading angle of the predicted pose of the current image frame unchanged, changing the abscissa and ordinate of the predicted pose of the current image frame, and obtaining the first candidate pose. (iii) According to the first candidate pose, the position of the third map point in the three-dimensional coordinate system corresponding to the vector map is transformed to obtain the position of the third map point in the preset image coordinate system. This process is equivalent to projecting the third map point into the image coordinate system. (iv) Keeping the horizontal and vertical coordinates of the predicted pose of the current image frame unchanged, change the heading angle of the predicted pose of the current image frame to obtain the second candidate pose. (v) Transforming the position of the first feature point in the current image frame according to the second candidate pose to obtain the position of the first feature point in the image coordinate system. This process is equivalent to projecting the first feature point into the image coordinate system. (vi) Determining the pose of the current image frame from the combination of the first candidate pose and the second candidate pose based on the distance between the position of the third map point in the image coordinate system and the position of the first feature point in the image coordinate system. The aforementioned pose sampling method can effectively reduce the amount of calculation required in the pose sampling process.

[0067] In order to further understand the above sampling process, the following is an introduction combined with an example, which includes: (a) determining the first feature point of the current image frame and the third map point used for layered sampling in the vector map. (b) keeping the heading angle of the current image frame unchanged, sampling N1 times based on the original value of the horizontal coordinate, and sampling N2 times based on the original value of the vertical coordinate, to obtain N1×N2 first candidate poses. (c) according to each first candidate pose, projecting the third map point in the vector map to the preset image coordinate system to obtain N1×N2 groups of new third map points. (d) keeping the horizontal and vertical coordinates of the predicted pose of the current image frame unchanged, sampling N3 times based on the original value of the heading angle, to obtain N3 second candidate poses. (e) according to each second candidate pose, projecting the first feature point of the current image frame to the preset image coordinate system to obtain N3 groups of new first feature points. (vi) In the preset image coordinate system, N1×N2×N3 new pose combinations are formed based on N1×N2 groups of new third map points and N3 groups of new first feature points. The distance between the third map point and the first feature point in each combination is calculated to obtain N1×N2×N3 distances, from which the smallest distance is selected, and the pose of the current image frame is formed using the horizontal and vertical coordinates of the first candidate pose corresponding to the distance and the heading angle of the second candidate pose corresponding to the distance.

[0068] In another possible implementation, if the pose of the current image frame is a six-degree-of-freedom quantity, that is, it includes abscissa, ordinate, ordinate, heading angle, roll angle and pitch angle, then the process of stratified sampling includes: (i) obtaining the position of the third map point in the three-dimensional coordinate system corresponding to the vector map and the position of the first feature point in the current image frame. (ii) keeping the heading angle, roll angle, pitch angle and ordinate of the predicted pose of the current image frame unchanged, changing the abscissa and ordinate of the predicted pose of the current image frame, and obtaining the first candidate pose. (iii) transforming the position of the third map point in the three-dimensional coordinate system corresponding to the vector map according to the first candidate pose, and obtaining the position of the third map point in the preset image coordinate system. (iv) keeping the abscissa, ordinate, ordinate, roll angle and pitch angle of the predicted pose of the current image frame unchanged, changing the heading angle of the predicted pose of the current image frame, and obtaining the second candidate pose. (v) transforming the position of the first feature point in the current image frame according to the second candidate pose, and obtaining the position of the first feature point in the image coordinate system. (six) Determine the third candidate pose from the combination of the first candidate pose and the second candidate pose based on the distance between the position of the third map point in the image coordinate system and the position of the first feature point in the image coordinate system. (seven) Keep the horizontal coordinate, vertical coordinate, heading angle and roll angle of the predicted pose of the third candidate pose unchanged, change the pitch angle and vertical coordinate of the third candidate pose, and obtain the fourth candidate pose. (eight) Transform the position of the third map point in the three-dimensional coordinate system corresponding to the vector map according to the fourth candidate pose to obtain the position of the third map point in the current image frame. (nine) Determine the pose of the current image frame from the fourth candidate pose based on the distance between the position of the first feature point in the current image frame and the position of the third map point in the current image frame. The aforementioned pose sampling method can effectively reduce the amount of calculation required in the pose sampling process.

[0069] In order to further understand the above sampling process, the following is an introduction in conjunction with an example, which includes steps (i) to (ix), wherein steps (i) to (v) can refer to steps (i) to (v) in the above example, and will not be repeated here. (vi) In the preset image coordinate system, according to N1×N2 groups of new third map points and N3 groups of new first feature points, N1×N2×N3 new combinations are formed, and the distance between the third map point and the first feature point in each combination is calculated to obtain N1×N2×N3 distances, from which the smallest distance is selected, and the abscissa and ordinate of the first candidate pose corresponding to the distance, and the heading angle of the second candidate pose corresponding to the distance are used to form the third candidate pose. (vii) Keeping the abscissa, ordinate, heading angle and roll angle of the predicted pose of the third candidate pose unchanged, sample N4 times based on the original value of the pitch angle, and sample N5 times based on the original value of the ordinate, to obtain N4×N5 fourth candidate poses. (VIII) According to each fourth candidate pose, the third map point in the vector map is projected to the current image frame to obtain N4×N5 sets of new third map points. (IX) In the current image frame, according to the N4×N5 sets of new third map points and the first feature point in the current image frame, N4×N5 new combinations are constructed, and the distance between the third map point and the first feature point in each combination is calculated to obtain N4×N5 distances, from which the smallest distance is selected, and the pitch angle and vertical coordinate of the fourth candidate pose corresponding to the distance, as well as the horizontal coordinate, vertical coordinate, heading angle and roll angle of the third candidate pose, are used to form the pose of the current image frame.

[0070] After obtaining the pose of the current image frame and the pose of other image frames after the last optimization, semantic detection can be performed on the current image frame and other image frames to obtain the first feature point of the current image frame and the second feature point of other image frames. Specifically, semantic detection processing can be performed on the current image frame and other image frames respectively through a neural network, that is, feature extraction can be performed to obtain the first feature point of the current image frame and the second feature point of other image frames. The first feature point and the second feature point can be understood as semantic identifiers on the image. It should be noted that the first feature point of the current image frame includes the feature points of various objects in the traffic environment. Figure 5 A schematic diagram of the first feature point of the current image frame provided in an embodiment of the present application, such as Figure 5 As shown, the feature points of the lamp pole and the lane line can be the pixels at the two ends, the feature points of the traffic light and the sign can be a rectangular frame (i.e., an outer bounding box) formed by a plurality of pixels, etc. Similarly, the second feature points of other image frames are also the same, which will not be described here.

[0071] It should be understood that the aforementioned neural network is a trained neural network model. The following is a brief introduction to the training process of the neural network:

[0072] Before model training, a batch of image frames to be trained is obtained, and the real feature points in each image frame to be trained are determined in advance. After the training starts, each image frame to be trained can be input into the model to be trained. Then, the feature points of each image frame to be trained are obtained through the model to be trained, and these feature points are predicted feature points. Finally, the gap between the feature points of each image frame to be trained and the real feature points of the corresponding image frame is calculated by the target loss function. If the gap between the two parts of the feature points corresponding to a certain image frame to be trained is within the qualified range, it is regarded as a qualified image frame to be trained. If it is outside the qualified range, it is regarded as an unqualified image frame to be trained. If there are only a small number of qualified image frames to be trained in the batch of image frames to be trained, the parameters of the model to be trained are adjusted, and another batch of image frames to be trained are used for retraining until there are a large number of qualified image frames to be trained, so as to obtain a neural network for semantic detection.

[0073] It should also be understood that in this embodiment, the posture of the current image frame generally refers to the posture of the terminal device in the three-dimensional coordinate system corresponding to the vector map when the current image frame is taken. Similarly, the posture of other image frames refers to the posture of the terminal device in the three-dimensional coordinate system corresponding to the vector map when the other image frames are taken, and so on.

[0074] It should also be understood that the process of the previous optimization can refer to the process of the current optimization. Similarly, the process of the next optimization can also refer to the process of the current optimization, and so on.

[0075] It should also be understood that, among all the image frames captured by the terminal device, the position and posture of the first image frame can be obtained through the global positioning system (GPS) of the terminal device to serve as the object of the first optimization.

[0076] 202. Acquire a first map point matching the first feature point from a vector map according to the position and posture of the current image frame.

[0077] After the pose of the current image frame is obtained in step 201, the initial pose value of the current image frame for the current optimization is obtained, and the first map point matching the first feature point can be obtained from the vector map preset in the terminal device based on the pose. Specifically, the first map point matching the first feature point can be obtained in a variety of ways, which will be introduced below:

[0078] In a possible implementation, an area including terminal devices may be delineated in a vector map, for example, a range of 150m×150m, and coordinate transformation calculations may be performed on the positions of multiple map points in the area in the three-dimensional coordinate system corresponding to the vector map according to the position of the current image frame, thereby obtaining the positions of these map points in the current image frame. This process is equivalent to projecting the multiple map points in the area into the current image frame according to the position of the current image frame. Since the first feature point of the current image frame includes feature points of various objects, and the multiple map points in the area also include map points of various objects, the positions of the first feature point and these map points in the current image frame may be calculated by a nearest neighbor algorithm, so as to match the first feature point with these map points as objects of the same type, thereby determining the first map point that matches the first feature point in these map points. For example, in a vector map, an object such as a lamp pole may be represented by a straight line formed by a plurality of map points, and the straight line is still a straight line when projected into the current image frame, which is subsequently referred to as a projection straight line. Objects such as lamp poles are represented by feature points at the two ends in the current image frame, and the feature points at the ends are subsequently referred to as endpoints. Then, when lamp poles A, B, and C are projected to the current image frame in the vector map, in order to determine which lamp pole matches lamp pole D in the current image frame, the average value of the distances from the two endpoints of lamp pole D to the projected straight line of lamp pole A, the average value of the distances from the two endpoints of lamp pole D to the projected straight line of lamp pole B, and the average value of the distances from the two endpoints of lamp pole D to the projected straight line of lamp pole C can be calculated, and the lamp pole with the smallest average value is determined as the lamp pole that matches lamp pole D, and the map point of the lamp pole matches the feature point of lamp pole D. For another example, in a vector map, objects such as signboards (or traffic lights) can be represented by a rectangular box formed by a plurality of map points, and the rectangular box is still a rectangular box when projected to the current image frame, and objects such as signboards are also represented by a rectangular box formed by a plurality of feature points in the current image frame. Then, when there are signboards X and Y in the vector map projected to the current image frame, in order to determine which signboard matches the signboard Z in the current image frame, the average value of the distances from the four vertices on the rectangular frame of signboard Z to the projection lines of the two parallel sides of the rectangular frame of signboard X, and the average value of the distances from the four vertices on the rectangular frame of signboard Z to the projection lines of the two parallel sides of the rectangular frame of signboard Y can be calculated, and the signboard with the smallest average value is determined as the signboard that matches signboard Z, and the map point of the signboard matches the feature point of signboard Z. For another example, in a vector map, objects such as lane lines can be represented by a straight line formed by a plurality of map points, and the straight line is still a straight line when projected to the current image frame, while objects such as lane lines are represented by the feature points at both ends in the current image frame.Then, when lane lines E and lane lines F are projected to the current image frame in the vector map, in order to determine which lane line matches lane line G in the current image frame, the average value of the distances from the two end points of lane line G to the projected straight line of lane line E and the degree of overlap between the projected straight lines of lane line G and lane line E can be calculated, and the average value of the distances from the two end points of lane line G to the projected straight line of lane line F and the degree of overlap between the projected straight lines of lane line G and lane line F can be calculated. The distance and the degree of overlap are used as the comprehensive distance, and the lane line with the smallest comprehensive distance (for example, if the degree of overlap of lane line E is the same as that of lane line F, the lane line with the smaller distance is the lane line with the smaller comprehensive distance, and so on) is determined as the lane line that matches lane line G, and the map point of this lane line matches the feature point of lane line G.

[0079] Specifically, the calculation process of the overlap degree is as follows: Figure 6 As shown, Figure 6 A schematic diagram of calculating the degree of overlap provided in an embodiment of the present application is provided. Suppose the lane line JK of the current image frame and the projection line PQ of the lane line of the vector map, the foot of the perpendicular of the endpoint J on the projection line PQ is U, and the foot of the perpendicular of the endpoint K on the projection line PQ is V. Therefore, the degree of overlap between the lane line JK and the projection line PQ is as shown in formula (5):

[0080]

[0081] In the above formula, l overlap is the degree of overlap, d UV is the length of the line segment UV, d UV∩PQ is the length of the overlapping part between line segment UV and line segment PQ. Based on formula (5), Figure 6 The overlap degrees from left to right are 1, d PV / d UV d PQ / d UV and 0.

[0082] In another possible implementation, an area including terminal devices may be delineated in the vector map. Then, according to the position of the current image frame, the position of the first feature point of the current image frame in the current image frame is subjected to coordinate transformation calculation, thereby obtaining the position of the first feature point in the three-dimensional coordinate system corresponding to the vector map. This process is equivalent to projecting the first feature point of the current image frame to the three-dimensional coordinates corresponding to the vector map according to the position of the current image frame. Since the first feature point of the current image frame includes feature points of various objects, the multiple map points in the area of ​​the vector map also include map points of various objects. Therefore, the positions of the first feature point and this part of the map points in the three-dimensional coordinates corresponding to the vector map may be calculated by the nearest neighbor algorithm, so as to match the first feature point with this part of the map points as objects of the same type, thereby determining the first map point that matches the first feature point in this part of the map points.

[0083] In another possible implementation, an area including the terminal device may be delineated in the vector map, and coordinate transformation calculations may be performed on the positions of multiple map points in the area in the three-dimensional coordinate system corresponding to the vector map according to the position of the current image frame, thereby obtaining the positions of these map points in the three-dimensional coordinate system corresponding to the terminal device. At the same time, coordinate transformation calculations may also be performed on the position of the first feature point of the current image frame in the current image frame according to the position of the current image frame, thereby obtaining the position of the first feature point in the three-dimensional coordinate system corresponding to the terminal device. Since the first feature point of the current image frame includes feature points of various objects, and multiple map points in the area of ​​the vector map also include map points of various objects, the positions of the first feature point and these map points in the three-dimensional coordinates corresponding to the terminal device may be calculated by a nearest neighbor algorithm, so as to match the first feature point with these map points as objects of the same type, thereby determining the first map point that matches the first feature point in these map points.

[0084] In the above three implementations, the feature points of all objects in the current image frame and the map points of all objects in the divided area of ​​the vector map are set in a certain coordinate system to complete the matching between the feature points and the map points. In addition, the feature points and map points of certain categories of objects (for example, traffic lights, light poles, signboards, etc.) can be set in a certain coordinate system (for example, the current image frame) for matching, and the feature points and map points of other categories of objects (for example, lane lines) can be set in another coordinate system (for example, the three-dimensional coordinate system corresponding to the terminal device) for matching.

[0085] It is worth noting that after obtaining the first map point that matches the first feature point, it is equivalent to obtaining the distance between the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system, and the distance includes at least one of the following: 1. The distance between the position of the first feature point in the current image frame and the position of the first map point in the current image frame. 2. The distance between the position of the first feature point in the three-dimensional coordinate system corresponding to the vector map and the position of the first map point in the three-dimensional coordinate system corresponding to the vector map. 3. The distance between the position of the first feature point in the three-dimensional coordinate system corresponding to the terminal device and the position of the first map point in the three-dimensional coordinate system corresponding to the terminal device.

[0086] To further understand the above description, an example is given below. Assume that the current image frame contains a lamp pole W1, a sign W2, a lane line W3, and a lane line W4. The lamp pole W5 in the vector map matches the lamp pole W1, the sign W6 in the vector map matches the sign W2, the lane line W7 in the vector map matches the lane line W3, and the lane line W8 in the vector map matches the lane line W4. When the meaning of the first coordinate system is different, there will be the following situations:

[0087] Case 1: When the first coordinate system is the current image frame, the distance between the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system is the distance between the position of the first feature point in the current image frame and the position of the first map point in the current image frame, including: after projecting to the current image frame, the average value of the distances from the two end points of the lamp pole W1 to the projection straight line of the lamp pole W5, the average value of the distances from the four vertices on the rectangular frame of the sign W2 to the projection straight lines of the two parallel sides in the rectangular frame of the sign W6, the comprehensive distance between lane line W3 and lane line W7, and the comprehensive distance between lane line W4 and lane line W8.

[0088] Case 2: When the first coordinate system includes the current image frame and the three-dimensional coordinate system corresponding to the terminal device, the distance between the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system includes: the distance between the position of the first feature point in the current image frame and the position of the first map point in the current image frame, and the distance between the position of the first feature point in the three-dimensional coordinate system corresponding to the terminal device and the position of the first map point in the three-dimensional coordinate system corresponding to the terminal device. Among them, the distance between the position of the first feature point in the current image frame and the position of the first map point in the current image frame includes: the average value of the distances from the two end points of the lamp pole W1 to the projection straight line of the lamp pole W5 after being projected to the current image frame, and the average value of the distances from the four vertices on the rectangular frame of the sign W2 to the projection straight lines of the two parallel sides in the rectangular frame of the sign W6. The distance between the position of the first feature point in the three-dimensional coordinate system corresponding to the terminal device and the position of the first map point in the three-dimensional coordinate system corresponding to the terminal device includes: the comprehensive distance between lane line W3 and lane line W7 after being projected to the three-dimensional coordinate system corresponding to the terminal device, and the comprehensive distance between lane line W4 and lane line W8.

[0089] Similarly, there are also situation three (when the first coordinate system is the three-dimensional coordinate system corresponding to the vector map), situation four (when the first coordinate system is the three-dimensional coordinate system corresponding to the terminal device), situation five (when the first coordinate system includes the current image frame and the three-dimensional coordinate system corresponding to the vector map), situation six (when the first coordinate system includes the three-dimensional coordinate system corresponding to the terminal device and the three-dimensional coordinate system corresponding to the vector map), and situation seven (when the first coordinate system includes the current image frame, the three-dimensional coordinate system corresponding to the terminal device, and the three-dimensional coordinate system corresponding to the vector map). You can also refer to the relevant instructions of situation one and situation two, which will not be repeated here.

[0090] 203. According to the positions and postures of other image frames after the last optimization, obtain a second map point matching the second feature point from the vector map.

[0091] After obtaining the posture of other image frames after the previous optimization in step 201, the initial posture value of other image frames for the current optimization is obtained, and the second map point matching the second feature point can be obtained from the internal vector map of the terminal device based on the posture.

[0092] After obtaining the second map point that matches the second feature point, it is equivalent to obtaining the distance between the position of the second feature point in the second coordinate system and the position of the second map point in the second coordinate system, and the distance includes at least one of the following: 1. The distance between the position of the second feature point in other image frames and the position of the second map point in other image frames. 2. The distance between the position of the second feature point in the three-dimensional coordinate system corresponding to the vector map and the position of the second map point in the three-dimensional coordinate system corresponding to the vector map. 3. The distance between the position of the second feature point in the three-dimensional coordinate system corresponding to the terminal device and the position of the second map point in the three-dimensional coordinate system corresponding to the terminal device.

[0093] It should be noted that the description of the process of obtaining the second map point can refer to the description of the process of obtaining the first map point in step 202, which will not be repeated here. Further, the distance between the position of the second feature point in the second coordinate system and the position of the second map point in the second coordinate system can also refer to the description of the distance between the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system in step 202, which will not be repeated here.

[0094] 204. Adjust the posture of the current image frame according to the objective function to obtain the posture of the current image frame after the current optimization as the positioning result of the terminal device. The objective function includes a first matching error between the first feature point and the first map point, and a second matching error between the second feature point and the second map point.

[0095] After obtaining the first map point that matches the first feature point and the second map point that matches the second feature point, the pose of the current image frame can be adjusted based on an objective function constructed based on a first matching error between the first feature point and the first map point and a second matching error between the second feature point and the second map point, that is, the pose of the current image frame is optimized to obtain the pose of the current image frame after the current optimization as the positioning result of the terminal device.

[0096] Specifically, the initial value of the first matching error can be obtained based on the distance between the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system. Still using the above example to illustrate, the initial value of the first matching error can be obtained by formula (6):

[0097] Huber ε1 (d pp +d pl )+β*Huber ε2 (d pH )

[0098]

[0099]

[0100]

[0101]

[0102]

[0103]

[0104]

[0105] In the above formula, the first matching error is obtained by Huber ε1 and Huber ε2 OK, Huber ε1 is the Huber loss function with parameter ε1, Huber ε2 is the Huber loss function with parameter ε2, β is the preset parameter, d pp is the distance corresponding to objects such as light poles in the current image frame, is the distance between the i-th light pole and the matching light pole in the current image frame, is the distance from the two endpoints of the ith light pole to the projection line of the matching light pole, d pl is the distance between the two objects of traffic lights (or signs) in the current image frame, is the distance between the i-th traffic light (or sign) and the matching traffic light (or sign) in the current image frame, and is the distance from the four vertices of the i-th traffic light (or sign) to the projection lines of the two parallel sides in the rectangular box of the matching traffic light, d pH is the comprehensive distance corresponding to objects such as lane lines in the current image frame, is the comprehensive distance between the i-th lane line and the matching lane line in the current image frame, is the distance between the ith lane line and the matching lane line, is the degree of overlap between the ith lane line and the matching lane line, is the distance from the two endpoints of the i-th lane line to the projection line of the matching lane line.

[0106] Furthermore, the initial value of the second matching error can be obtained by calculating the distance between the position of the second feature point in the second coordinate system and the position of the second map point in the second coordinate system. As in the above example, the initial value of the second matching error can also be obtained by formula (6), which will not be repeated here.

[0107] After obtaining the initial value of the first matching error and the initial value of the second matching error, these initial values ​​can be input into the objective function, and the objective function is iteratively solved until the preset iteration condition is met, and the pose of the current image frame after the current optimization is obtained. Based on formula (6), the objective function can be expressed by formula (7):

[0108]

[0109] In the above formula, in the current image frame and other image frames, is the distance corresponding to objects such as light poles in the i-th image frame, is the distance between the two types of objects, the traffic lights (or signs) in the i-th image frame, is the distance corresponding to objects such as lane lines in the i-th image frame.

[0110] It should be understood that this embodiment is only schematically illustrated with formula (6) and formula (7), and does not limit the calculation method of the matching error and the expression method of the objective function.

[0111] In the process of iteratively solving the objective function, after the first iteration is completed, the initial value of the first matching error and the initial value of the second matching error are input into the objective function for solving, and the pose of the current image frame obtained in the first iteration and the poses of other image frames obtained in the first iteration can be obtained. Then, according to the pose of the current image frame obtained in the first iteration and the poses of other image frames obtained in the first iteration, the inter-frame pose difference obtained in the first iteration is calculated. If the difference between the inter-frame pose difference and the inter-frame pose difference calculated by the odometer of the terminal device is less than a preset threshold, it is equivalent to the convergence of the objective function, then the iteration is stopped, and the pose of the current image frame obtained in the first iteration is used as the pose of the current image frame after the current optimization. If the difference between the inter-frame pose difference and the inter-frame pose difference calculated by the odometer of the terminal device is greater than or equal to the preset threshold, the second iteration is performed.

[0112] When performing the second iteration, the first map point that matches the first feature point can be re-determined based on the position and posture of the current image frame obtained in the first iteration (i.e., re-execute step 202), and the second map point that matches the second feature point can be re-determined based on the position and posture of the other image frames obtained in the first iteration (i.e., re-execute step 203). Then, the first iteration value of the first matching error between the first feature point and the first map point and the first iteration value of the second matching error between the second feature point and the second map point are calculated. Subsequently, the first iteration value of the first matching error and the first iteration value of the second matching error are output to the objective function for solution, and the position and posture of the current image frame obtained in the second iteration and the position and posture of the other image frames obtained in the second iteration can be obtained. Next, calculation is performed based on the pose of the current image frame obtained in the second iteration and the poses of other image frames obtained in the second iteration to obtain the inter-frame pose difference obtained in the second iteration. If the difference between the inter-frame pose difference and the inter-frame pose difference calculated by the odometer of the terminal device is less than a preset threshold, the iteration is stopped, and the pose of the current image frame obtained in the second iteration is used as the pose of the current image frame after the current optimization. If the difference between the inter-frame pose difference and the inter-frame pose difference calculated by the odometer of the terminal device is greater than or equal to the preset threshold, a third iteration is performed until the number of iterations is equal to the preset number. At this time, it is also considered that the objective function has converged, and the pose of the current image frame obtained in the last iteration is used as the pose of the current image frame after the current optimization.

[0113] In this embodiment, after obtaining the current image frame and other image frames before the current image frame, the first map point matching the first feature point of the current image frame and the second map point matching the second feature point of other image frames before the current image frame can be obtained from the vector map. Then, the position and posture of the current image frame can be adjusted according to the objective function constructed by the first matching error between the first feature point and the first map point and the second matching error between the second feature point and the second map point to obtain the position and posture of the current image frame after the current optimization. In the above process, since the objective function includes the matching error between the feature point of the current image frame and the map point of the vector map, and the matching error between the feature point of other image frames and the map point of the vector map, the position and posture of the current image frame is adjusted by the objective function, which not only considers the influence of the current image frame on the optimization process of the position and posture of the current image frame, but also considers the influence of other image frames on the optimization process of the position and posture of the current image frame, that is, the correlation between the current image frame and other image frames is considered, and the factors considered are more comprehensive, so the positioning result of the terminal device obtained in this way has higher accuracy.

[0114] Furthermore, in the related art, the objective function is constructed only by the matching error between the feature points of the current image frame and the map points of the vector map. Since the current image frame can present limited content, when selecting map points that match the feature points of the current image frame, the map points are often sparse and overlapped. Therefore, when the objective function is iteratively solved, the matching error between the feature points and the map points cannot be made small enough, thereby affecting the accuracy of the positioning result. In this embodiment, the objective function is constructed by the first matching error between the first feature point of the current image frame and the first map point of the vector map, and the second matching error between the second feature point of other image frames and the second map point of the vector map. Since the content presented by multiple image frames usually has a large degree of difference, the map points are sparse and overlapped. Therefore, when the objective function is iteratively solved (jointly optimizing the postures of multiple image frames), the first matching error and the second matching error can be made small enough, thereby improving the accuracy of the positioning result.

[0115] Furthermore, the pose of the current image frame obtained by layered sampling can be used as the initial value of the pose of the current image frame of the current sub-optimization, thereby improving the convergence speed and robustness of the current sub-optimization.

[0116] The above is a detailed description of the terminal device positioning method provided in the embodiment of the present application. The following will introduce the terminal device positioning device provided in the embodiment of the present application. Figure 7 A schematic diagram of a terminal device positioning device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the device comprises:

[0117] A first matching module 701 is used to obtain, from the vector map, a first map point that matches a first feature point of a current image frame captured by the terminal device;

[0118] The second matching module 702 is used to obtain, from the vector map, a second map point that matches a second feature point of other image frames before the current image frame;

[0119] The adjustment module 703 is used to adjust the posture of the terminal device when shooting the current image frame according to the objective function, and obtain the posture of the terminal device when shooting the current image frame after the current adjustment as the positioning result of the terminal device. The objective function includes a first matching error between the first feature point and the first map point, and a second matching error between the second feature point and the second map point.

[0120] In a possible implementation, the device also includes: an acquisition module 700, used to acquire a first feature point of a current image frame, a second feature point of other image frames before the current image frame, a posture of the terminal device when shooting the current image frame, and a posture of the terminal device when shooting other image frames after the last adjustment; a first matching module 701, used to acquire a first map point matching the first feature point from a vector map according to the posture of the terminal device when shooting the current image frame; and a second matching module 702, used to acquire a second map point matching the second feature point from a vector map according to the posture of the terminal device when shooting other image frames after the last adjustment.

[0121] In one possible implementation, the adjustment module 703 is used to: calculate an initial value of a first matching error based on a distance between a position of a first feature point in a first coordinate system and a position of a first map point in the first coordinate system; calculate an initial value of a second matching error based on a distance between a position of a second feature point in a second coordinate system and a position of a second map point in the second coordinate system; iteratively solve an objective function based on the initial value of the first matching error and the initial value of the second matching error until a preset iteration condition is met, thereby obtaining the posture of the terminal device after the current adjustment when shooting the current image frame.

[0122] In one possible implementation, the distance between the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system includes at least one of the following: the distance between the position of the first feature point in the current image frame and the position of the first map point in the current image frame; the distance between the position of the first feature point in the three-dimensional coordinate system corresponding to the vector map and the position of the first map point in the three-dimensional coordinate system corresponding to the vector map; or the distance between the position of the first feature point in the three-dimensional coordinate system corresponding to the terminal device and the position of the first map point in the three-dimensional coordinate system corresponding to the terminal device.

[0123] In one possible implementation, the distance between the position of the second feature point in the second coordinate system and the position of the second map point in the second coordinate system includes at least one of the following: the distance between the position of the second feature point in other image frames and the position of the second map point in other image frames; the distance between the position of the second feature point in the three-dimensional coordinate system corresponding to the vector map and the position of the second map point in the three-dimensional coordinate system corresponding to the vector map; or the distance between the position of the second feature point in the three-dimensional coordinate system corresponding to the terminal device and the position of the second map point in the three-dimensional coordinate system corresponding to the terminal device.

[0124] In one possible implementation, the iteration condition is: for any iteration, if the difference between the inter-frame pose difference obtained in the iteration and the inter-frame pose difference calculated by the terminal device is less than a preset threshold, the iteration is stopped, and the inter-frame pose difference obtained in the iteration is determined based on the pose of the terminal device when taking the current image frame and the pose of the terminal device when taking other image frames obtained in the iteration; if the difference is greater than or equal to the threshold, the next iteration is executed until the number of iterations is equal to the preset number.

[0125] In a possible implementation manner, the number of other image frames is determined according to the speed of the terminal device.

[0126] In one possible implementation, the acquisition module 700 is used to: calculate the predicted posture of the terminal device when shooting the current image frame based on the posture of the terminal device when shooting other image frames after the last adjustment and the inter-frame posture difference calculated by the terminal device; perform stratified sampling on the predicted posture of the terminal device when shooting the current image frame to obtain the posture of the terminal device when shooting the current image frame.

[0127] In one possible implementation, if the posture of the terminal device when shooting the current image frame includes a horizontal coordinate, a vertical coordinate and a heading angle, the acquisition module 700 is used to: obtain the position of the third map point in the three-dimensional coordinate system corresponding to the vector map and the position of the first feature point in the current image frame; keep the heading angle of the predicted posture of the terminal device when shooting the current image frame unchanged, change the horizontal coordinate and the vertical coordinate of the predicted posture of the terminal device when shooting the current image frame, and obtain a first candidate posture; transform the position of the third map point in the three-dimensional coordinate system corresponding to the vector map according to the first candidate posture, and obtain the third map point The position of the first feature point in the preset image coordinate system; keep the horizontal and vertical coordinates of the predicted posture of the terminal device when shooting the current image frame unchanged, change the heading angle of the predicted posture of the terminal device when shooting the current image frame, and obtain the second candidate posture; transform the position of the first feature point in the current image frame according to the second candidate posture, and obtain the position of the first feature point in the image coordinate system; according to the distance between the position of the third map point in the image coordinate system and the position of the first feature point in the image coordinate system, determine the posture of the terminal device when shooting the current image frame from the combination of the first candidate posture and the second candidate posture. The aforementioned posture sampling method can effectively reduce the amount of calculation required in the posture sampling process.

[0128] In one possible implementation, if the posture of the terminal device when shooting the current image frame includes horizontal coordinates, vertical coordinates, vertical coordinates, heading angles, roll angles and pitch angles, the acquisition module 700 is used to: obtain the position of the third map point in the three-dimensional coordinate system corresponding to the vector map and the position of the first feature point in the current image frame; keep the heading angle, roll angle, pitch angle and vertical coordinate of the predicted posture of the terminal device when shooting the current image frame unchanged, change the horizontal coordinate and vertical coordinate of the predicted posture of the terminal device when shooting the current image frame, and obtain the first candidate posture; transform the position of the third map point in the three-dimensional coordinate system corresponding to the vector map according to the first candidate posture, and obtain the position of the third map point in the preset image coordinate system; keep the horizontal coordinate, vertical coordinate, roll angle and pitch angle of the predicted posture of the terminal device when shooting the current image frame unchanged, and change the heading angle of the predicted posture of the terminal device when shooting the current image frame , obtain the second candidate pose; transform the position of the first feature point in the current image frame according to the second candidate pose, and obtain the position of the first feature point in the image coordinate system; determine the third candidate pose from the combination of the first candidate pose and the second candidate pose according to the distance between the position of the third map point in the image coordinate system and the position of the first feature point in the image coordinate system; keep the horizontal coordinate, vertical coordinate, heading angle and roll angle of the predicted pose of the third candidate pose unchanged, change the pitch angle and vertical coordinate of the third candidate pose, and obtain the fourth candidate pose; transform the position of the third map point in the three-dimensional coordinate system corresponding to the vector map according to the fourth candidate pose, and obtain the position of the third map point in the current image frame; determine the pose of the terminal device when shooting the current image frame from the fourth candidate pose according to the distance between the position of the first feature point in the current image frame and the position of the third map point in the current image frame. Through the aforementioned pose sampling method, the amount of calculation required in the pose sampling process can be effectively reduced.

[0129] It should be noted that the information interaction, execution process, etc. between the modules / units of the above-mentioned device are based on the same concept as the method embodiment of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown above in the embodiment of the present application, and will not be repeated here.

[0130] Figure 8 Another structural diagram of the terminal device positioning device provided in the embodiment of the present application. Figure 8 As shown, an embodiment of a computer in the embodiment of the present application may include one or more central processing units 801 , a memory 802 , an input and output interface 803 , a wired or wireless network interface 804 , and a power supply 805 .

[0131] The memory 802 may be a temporary storage or a permanent storage. Furthermore, the CPU 801 may be configured to communicate with the memory 802 and execute a series of instruction operations in the memory 802 on the computer.

[0132] In this embodiment, the CPU 801 may execute the aforementioned Figure 2 The method steps in the illustrated embodiment will not be described in detail here.

[0133] In this embodiment, the specific functional module division in the central processing unit 801 can be the same as the above Figure 7 The division method of the acquisition module, the first matching module, the second matching module and the optimization module described in is similar and will not be repeated here.

[0134] The embodiment of the present application also relates to a computer storage medium, including computer readable instructions. When the computer readable instructions are executed, the following is implemented: Figure 2 The method described.

[0135] The present application also relates to a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute Figure 2 The method described.

[0136] 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.

[0137] 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 device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0138] 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.

[0139] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0140] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

Claims

1. A terminal device positioning method, It is characterized in that The method comprises: Obtaining, from the vector map, a first map point that matches a first feature point of a current image frame captured by the terminal device; Acquire, from the vector map, a second map point that matches a second feature point of another image frame before the current image frame; adjusting the posture of the terminal device when shooting the current image frame according to the objective function, and obtaining the posture of the terminal device when shooting the current image frame after the current adjustment as the positioning result of the terminal device, wherein the objective function includes a first matching error between the first feature point and the first map point, and a second matching error between the second feature point and the second map point; The method further comprises: Calculate the predicted posture of the terminal device when shooting the current image frame according to the posture of the terminal device when shooting the other image frames after the last adjustment and the inter-frame posture difference calculated by the terminal device; The predicted posture of the terminal device when shooting the current image frame is sampled in layers to obtain the posture of the terminal device when shooting the current image frame.

2. The method according to claim 1, It is characterized in that The method further comprises: Acquire the first feature point of the current image frame, the second feature point of other image frames before the current image frame, the position and posture of the terminal device when shooting the current image frame, and the position and posture of the terminal device when shooting the other image frames after the last adjustment; The acquiring, from the vector map, a first map point matching the first feature point comprises: Acquire, from a vector map, a first map point matching the first feature point according to the posture of the terminal device when shooting the current image frame; The acquiring, from the vector map, a second map point matching the second feature point comprises: According to the last adjusted posture of the terminal device when shooting the other image frames, a second map point matching the second feature point is obtained from the vector map.

3. The method according to claim 1 or 2, It is characterized in that The adjusting the posture of the terminal device when shooting the current image frame according to the objective function to obtain the posture of the terminal device when shooting the current image frame after the current adjustment comprises: Calculating according to the distance between the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system to obtain an initial value of the first matching error; Calculating according to the distance between the position of the second feature point in the second coordinate system and the position of the second map point in the second coordinate system to obtain an initial value of the second matching error; According to the initial value of the first matching error and the initial value of the second matching error, the objective function is iteratively solved until a preset iteration condition is met, and the posture of the terminal device when shooting the current image frame after the current adjustment is obtained.

4. The method according to claim 3, It is characterized in that The distance between the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system includes at least one of the following: a distance between a position of the first feature point in the current image frame and a position of the first map point in the current image frame; a distance between a position of the first feature point in the three-dimensional coordinate system corresponding to the vector map and a position of the first map point in the three-dimensional coordinate system corresponding to the vector map; or The distance between the position of the first feature point in the three-dimensional coordinate system corresponding to the terminal device and the position of the first map point in the three-dimensional coordinate system corresponding to the terminal device.

5. The method according to claim 3, It is characterized in that The distance between the position of the second feature point in the second coordinate system and the position of the second map point in the second coordinate system includes at least one of the following: a distance between a position of the second feature point in the other image frame and a position of the second map point in the other image frame; a distance between a position of the second feature point in the three-dimensional coordinate system corresponding to the vector map and a position of the second map point in the three-dimensional coordinate system corresponding to the vector map; or The distance between the position of the second feature point in the three-dimensional coordinate system corresponding to the terminal device and the position of the second map point in the three-dimensional coordinate system corresponding to the terminal device.

6. The method according to claim 3, It is characterized in that The iteration condition is: for any iteration, if the difference between the inter-frame pose difference obtained in the iteration and the inter-frame pose difference calculated by the terminal device is less than a preset threshold, the iteration is stopped, and the inter-frame pose difference obtained in the iteration is determined according to the pose of the terminal device when shooting the current image frame obtained in the iteration and the pose of the terminal device when shooting the other image frames obtained in the iteration, and the inter-frame pose difference is the pose difference between two adjacent image frames shot by the terminal device in the current image frame and the other image frames; If the difference is greater than or equal to the threshold, the next iteration is performed until the number of iterations is equal to a preset number.

7. The method according to any one of claims 1 to 2, It is characterized in that The number of the other image frames is determined according to the speed of the terminal device.

8. A terminal equipment positioning device, It is characterized in that The device comprises: A first matching module, used to obtain, from the vector map, a first map point that matches a first feature point of a current image frame captured by the terminal device; A second matching module, used for acquiring, from the vector map, a second map point that matches a second feature point of other image frames before the current image frame; an adjustment module, configured to adjust the posture of the terminal device when shooting the current image frame according to an objective function, and obtain the posture of the terminal device when shooting the current image frame after the current adjustment as the positioning result of the terminal device, wherein the objective function includes a first matching error between the first feature point and the first map point, and a second matching error between the second feature point and the second map point; An acquisition module, used to calculate the predicted posture of the terminal device when shooting the current image frame according to the posture of the terminal device when shooting the other image frames after the last adjustment and the inter-frame posture difference calculated by the terminal device; The predicted posture of the terminal device when shooting the current image frame is sampled in layers to obtain the posture of the terminal device when shooting the current image frame.

9. The device according to claim 8, It is characterized in that The acquisition module is further used to acquire the first feature point of the current image frame, the second feature point of other image frames before the current image frame, the posture of the terminal device when shooting the current image frame, and the posture of the terminal device when shooting the other image frames after the last adjustment; The device also includes: The first matching module is used to obtain a first map point matching the first feature point from a vector map according to the posture of the terminal device when shooting the current image frame; The second matching module is used to obtain a second map point matching the second feature point from the vector map according to the last adjusted posture of the terminal device when shooting the other image frames.

10. The device according to claim 8 or 9, It is characterized in that The adjustment module is used for: Calculating according to the distance between the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system to obtain an initial value of the first matching error; Calculating according to the distance between the position of the second feature point in the second coordinate system and the position of the second map point in the second coordinate system to obtain an initial value of the second matching error; According to the initial value of the first matching error and the initial value of the second matching error, the objective function is iteratively solved until a preset iteration condition is met, and the posture of the terminal device when shooting the current image frame after the current adjustment is obtained.

11. The device according to claim 10, It is characterized in that The distance between the position of the first feature point in the first coordinate system and the position of the first map point in the first coordinate system includes at least one of the following: a distance between a position of the first feature point in the current image frame and a position of the first map point in the current image frame; a distance between a position of the first feature point in the three-dimensional coordinate system corresponding to the vector map and a position of the first map point in the three-dimensional coordinate system corresponding to the vector map; or The distance between the position of the first feature point in the three-dimensional coordinate system corresponding to the terminal device and the position of the first map point in the three-dimensional coordinate system corresponding to the terminal device.

12. The device according to claim 10, It is characterized in that The distance between the position of the second feature point in the second coordinate system and the position of the second map point in the second coordinate system includes at least one of the following: a distance between a position of the second feature point in the other image frame and a position of the second map point in the other image frame; a distance between a position of the second feature point in the three-dimensional coordinate system corresponding to the vector map and a position of the second map point in the three-dimensional coordinate system corresponding to the vector map; or The distance between the position of the second feature point in the three-dimensional coordinate system corresponding to the terminal device and the position of the second map point in the three-dimensional coordinate system corresponding to the terminal device.

13. The device according to claim 10, It is characterized in that The iteration condition is: for any iteration, if the difference between the inter-frame pose difference obtained in the iteration and the inter-frame pose difference calculated by the terminal device is less than a preset threshold, the iteration is stopped, and the inter-frame pose difference obtained in the iteration is determined according to the pose of the terminal device when shooting the current image frame obtained in the iteration and the pose of the terminal device when shooting the other image frames obtained in the iteration, and the inter-frame pose difference is the pose difference between two adjacent image frames shot by the terminal device in the current image frame and the other image frames; If the difference is greater than or equal to the threshold, the next iteration is performed until the number of iterations is equal to a preset number.

14. The device according to any one of claims 8 to 9, It is characterized in that The number of the other image frames is determined according to the speed of the terminal device.

15. A terminal equipment positioning device, It is characterized in that It comprises a memory and a processor; the memory stores codes, the processor is configured to execute the codes, and when the codes are executed, the terminal equipment positioning device executes the method according to any one of claims 1 to 7.

16. A computer storage medium, It is characterized in that The computer storage medium stores a computer program, which, when executed by a computer, enables the computer to implement the method according to any one of claims 1 to 7.

17. A computer program product, It is characterized in that The computer program product stores instructions, and when the instructions are executed by a computer, the computer implements the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Terminal device positioning method and related device therefor

    WO2022228391A1