Position calculation method and device

By screening feature points with high correlation with interior points in VPS for pose calculation, the problem of low VPS positioning accuracy is solved and the accuracy and experience of AR navigation are improved.

CN117152245BActive Publication Date: 2024-09-03HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310145332.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-31
Publication Date
2024-09-03
Estimated Expiration
2043-01-31

AI Technical Summary

Technical Problem

Based on the visual positioning system (VPS), there is a problem of low positioning accuracy in some scenes, especially when weak texture areas and repeated objects exist, resulting in inaccurate feature point matching, affecting the accuracy of pose calculation and positioning navigation. Accuracy.

Method used

Through the terminal device or cloud device, the feature points with high similarity and clarity to the environment image are screened out from the preset image collection, and the preset threshold is used to screen out the feature points with higher correlation with the interior points, and the pose calculation is performed to improve the The accuracy of feature matching and the accuracy of pose calculation.

Benefits of technology

It improves the accuracy of pose calculation and positioning navigation, solves the problem of inaccurate feature point matching caused by weak texture areas and repeated objects, and enhances the AR navigation experience and positioning reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117152245B
    Figure CN117152245B
Patent Text Reader

Abstract

The embodiments of the present application provide a method and device for posture calculation, which relate to the field of terminal technology. The method includes: the terminal device can screen the first feature point based on a trained preset threshold to obtain a second feature point with a higher correlation with the internal point. Since the preset threshold can screen out the fourth feature point from the third feature point corresponding to the training data, the similarity between the real postures of the third feature points satisfies the third preset condition. Therefore, when the first feature point is screened using the preset threshold, the second feature point with a higher posture calculation accuracy can be screened out from the first feature point, thereby solving the problem of inaccurate feature point matching caused by the presence of weak texture areas and / or repeated objects in the scene, and improving the accuracy of posture calculation and the accuracy of positioning or navigation based on posture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a posture calculation method and device. Background Art

[0002] The emergence of extended reality (XR) technologies such as augmented reality (AR) and virtual reality (VR) has led to the rapid development of positioning technology. Positioning technology is the underlying core technology in the XR field. Common positioning technologies include: ultra-wideband (UWB) positioning technology, Bluetooth positioning technology, wireless fidelity (WIFI) positioning technology, visual positioning system (VPS), etc.

[0003] Generally, in the positioning method based on VPS, the terminal device can achieve positioning by comparing the environment image captured by the camera with the image in the preset map database. And VPS has the advantages of low deployment cost, short positioning time, and low power consumption.

[0004] However, in some scenarios where positioning is performed based on VPS, the positioning accuracy may be low. Summary of the invention

[0005] The embodiments of the present application provide a posture calculation method and device to improve the positioning accuracy in the VPS posture calculation method.

[0006] In a first aspect, an embodiment of the present application provides a posture calculation method, the method comprising: a terminal device captures a first image; the terminal device obtains N second images from a preset image set, the N second images include images whose similarity with the first image meets a first preset condition, and / or, images whose clarity with the first image meets a second preset condition, and N is a positive integer; the terminal device determines a plurality of first feature points in each of the N second images, the first feature points include feature points that are the same as features in the first image; the terminal device calculates a target value for each first feature point, and the target value for each first feature point is matched with a parameter used to reflect the feature matching of the first feature point, and a parameter used to reflect the feature matching of the first feature point. The terminal device selects a second feature point from multiple first feature points, and the second feature point includes feature points whose target values ​​are greater than a preset threshold value among the multiple first feature points, and the preset threshold value is obtained by pre-training. The preset threshold value makes the similarity between the pose calculated based on the fourth feature point among the third feature points and the true pose of the third feature point satisfy a third preset condition; wherein the third feature point is a feature point with the same features in the training data and multiple images corresponding to the training data, and the fourth feature point includes feature points whose target values ​​are greater than the preset threshold value among the third feature points; the terminal device uses the second feature point to calculate the pose to obtain the first pose.

[0007] Among them, the preset threshold can be the target evaluation parameter described in the embodiment of the present application; the target value can be the evaluation parameter described in the embodiment of the present application; the first feature point or the second feature point can be understood as the matching point described in the embodiment of the present application; the first preset condition is that the image similarity is greater than the preset image similarity threshold, the second preset condition is that the clarity is greater than the preset clarity threshold, and the third preset condition is that the posture similarity is greater than the preset posture similarity threshold.

[0008] The parameters used to reflect the feature matching status of the first feature point may include: any one or more parameters in the parameter set consisting of the retrieval score and the target parameter described in the embodiment of the present application.

[0009] In this way, the terminal device can filter the first feature point based on the trained preset threshold to obtain the second feature point with a higher correlation with the internal point. Since the preset threshold can filter out the fourth feature point from the third feature point corresponding to the training data, the similarity between the actual postures of the third feature points satisfies the third preset condition. Therefore, when the first feature point is filtered using the preset threshold, the second feature point with higher posture calculation accuracy can be filtered out from the first feature point, thereby solving the problem of inaccurate feature point matching caused by the presence of weak texture areas and / or repeated objects in the scene, and improving the accuracy of posture calculation and the accuracy of positioning or navigation based on posture.

[0010] In one possible implementation, the parameters used to reflect the feature matching situation include one or more of the following: parameters used to indicate the similarity or clarity between the second image where the first feature point is located and the first image, parameters used to indicate the number of feature points in the second image, parameters used to indicate the number of first feature points, parameters used to indicate the proportion of the number of feature points in the second image, parameters used to indicate the number of clusters obtained by clustering the first feature points, parameters used to indicate the distribution of the cluster where the first feature point is located in the second image, or parameters used to indicate the probability that the feature point in the second image is the first feature point; the parameters used to reflect the inlier situation may include one or more of the following: parameters used to indicate whether the first feature point is an inlier, or parameters used to indicate the distribution of the cluster where the inlier is located in the second image.

[0011] Among them, the similarity or clarity between the second image and the first image where the first feature point is located can be the retrieval score described in the embodiment of the present application; the number of feature points in the second image can be the number of feature points described in the embodiment of the present application; the number of first feature points can be the number of matching points described in the embodiment of the present application; the proportion of feature points in the second image can be the proportion of feature points described in the embodiment of the present application; the number of clusters obtained by clustering the first feature point can be the number of matching point clusters described in the embodiment of the present application; the parameter used to indicate the distribution of the cluster where the first feature point is located in the second image can be the discrete value of the matching point category described in the embodiment of the present application; the parameter used to indicate the probability that the feature point in the second image is the first feature point can be the matching point score described in the embodiment of the present application. The parameter used to indicate the distribution of the cluster where the inlier point is located in the second image can be the inlier point distribution described in the embodiment of the present application.

[0012] In this way, the terminal device can determine the correlation between the first feature point and the inner point through parameters used to reflect the feature matching situation and parameters used to reflect the inner point situation, and use a preset threshold to judge the correlation between the first feature point and the inner point, so that the terminal device can filter out feature points that are more relevant to the inner point.

[0013] In one possible implementation, when the parameter used to reflect the feature matching situation of the first feature point is: the probability used to indicate that the feature point in the second image is the first feature point, and the parameter used to reflect the interior point situation is: the parameter used to indicate whether the first feature point is an interior point, then the target value of each first feature point is: the product of the support and confidence of the first item set corresponding to each first feature point calculated by the terminal device based on the a priori aprior algorithm, and the probability in the first item set used to indicate that the feature point in the second image is the first feature point; wherein the first item set is an item set composed of the probability used to indicate that the feature point in the second image is the first feature point, and the parameter used to indicate whether the first feature point is an interior point.

[0014] In a possible implementation, the method also includes: the terminal device obtains an initial threshold, and uses the initial threshold to screen out a fifth feature point from the third feature points whose target value is greater than the initial threshold; when the terminal device determines that the similarity between the posture calculated based on the fifth feature point and the actual posture does not meet the third preset condition, the terminal device adjusts the initial threshold using a preset step size to obtain a preset threshold; wherein the fifth feature point includes a feature point among the third feature points whose target value is less than or equal to the preset threshold.

[0015] Among them, the initial threshold value can be the initial value of the target evaluation parameter described in the embodiments of the present application.

[0016] In this way, the terminal device can obtain the second feature points with higher accuracy in posture calculation from the first feature points through a training process for a preset threshold, thereby ensuring the accuracy of posture calculation.

[0017] In a possible implementation, the terminal device collects the first image, including: the terminal device performs augmented reality AR navigation in a preset indoor scene; when the terminal device receives an operation for indicating positioning, the terminal device collects the first image. In this way, the terminal device can perform AR navigation in the indoor scene based on the collected first image, thereby improving the user's experience of using AR navigation.

[0018] In a possible implementation, the method further includes: when the terminal device determines that the first posture meets the preset position range, the terminal device determines the navigation route based on the first posture and the destination position; the terminal device displays a first interface in AR navigation, and the first interface includes: a digital person indicating the navigation route, and a mark indicating the direction. In this way, the user can view the digital person and the mark in the interface displayed by the terminal device, and the navigation route indicated by the digital person and the mark is more conducive to the user's use of the navigation function.

[0019] In a second aspect, an embodiment of the present application provides a posture calculation device, which includes: an acquisition unit and a processing unit; the acquisition unit is used to acquire a first image; the processing unit is used to obtain N second images from a preset image set, the N second images include images whose similarity with the first image meets a first preset condition, and / or images whose clarity with the first image meets a second preset condition, and N is a positive integer; the processing unit is also used to determine multiple first feature points in each of the N second images, the first feature points include feature points that are the same as features in the first image; the processing unit is also used to calculate a target value for each first feature point, and the target value for each first feature point is a feature matching condition used to reflect the first feature point. The processing unit is further used to select a second feature point from multiple first feature points, the second feature point including feature points whose target values ​​are greater than a preset threshold value among multiple first feature points, the preset threshold value is obtained by pre-training, and the preset threshold value makes the similarity between the pose calculated based on the fourth feature point among the third feature points and the true pose of the third feature point satisfy a third preset condition; wherein the third feature point is a feature point with the same features in the training data and multiple images corresponding to the training data, and the fourth feature point includes a feature point whose target value is greater than the preset threshold value among the third feature points; the processing unit is further used to perform pose calculation using the second feature point to obtain the first pose.

[0020] In one possible implementation, the parameters used to reflect the feature matching situation include one or more of the following: parameters used to indicate the similarity or clarity between the second image where the first feature point is located and the first image, parameters used to indicate the number of feature points in the second image, parameters used to indicate the number of first feature points, parameters used to indicate the proportion of the number of feature points in the second image, parameters used to indicate the number of clusters obtained by clustering the first feature points, parameters used to indicate the distribution of the cluster where the first feature point is located in the second image, or parameters used to indicate the probability that the feature point in the second image is the first feature point; the parameters used to reflect the inlier situation may include one or more of the following: parameters used to indicate whether the first feature point is an inlier, or parameters used to indicate the distribution of the cluster where the inlier is located in the second image.

[0021] In one possible implementation, when the parameter used to reflect the feature matching situation of the first feature point is: the probability used to indicate that the feature point in the second image is the first feature point, and the parameter used to reflect the interior point situation is: the parameter used to indicate whether the first feature point is an interior point, then the target value of each first feature point is: the product of the support and confidence of the first item set corresponding to each first feature point calculated by the processing unit based on the prior aprior algorithm, and the probability in the first item set used to indicate that the feature point in the second image is the first feature point; wherein the first item set is an item set composed of the probability used to indicate that the feature point in the second image is the first feature point, and the parameter used to indicate whether the first feature point is an interior point.

[0022] In one possible implementation, the processing unit is used to obtain an initial threshold, and use the initial threshold to filter out a fifth feature point from the third feature points whose target value is greater than the initial threshold; when the terminal device determines that the similarity between the posture calculated based on the fifth feature point and the actual posture does not meet the third preset condition, the processing unit is also used to adjust the initial threshold using a preset step size to obtain a preset threshold; wherein the fifth feature point includes a feature point among the third feature points whose target value is less than or equal to the preset threshold.

[0023] In a possible implementation, the processing unit is used to perform augmented reality (AR) navigation in a preset indoor scene; when the terminal device receives an operation for indicating positioning, the processing unit is also used to capture a first image.

[0024] In one possible implementation, when the processing unit determines that the first posture satisfies a preset position range, the processing unit is used to determine a navigation route based on the first posture and the destination position; the display unit is used to display a first interface in AR navigation, and the first interface includes: a digital person for indicating the navigation route, and an identification for indicating the direction.

[0025] In a third aspect, an embodiment of the present application provides a posture calculation method, which is applied to a posture calculation system, the system comprising: a terminal device and a cloud device, and the method comprising: the terminal device captures a first image and sends the first image to the cloud device; the cloud device obtains N second images from a preset image set, the N second images include images whose similarity with the first image meets a first preset condition, and / or, images whose clarity meets a second preset condition with the first image, and N is a positive integer; the cloud device determines multiple first feature points in each of the N second images, the first feature points include feature points that are the same as the features in the first image; the cloud device calculates a target value for each first feature point, and the target value for each first feature point is the same as the value used to reflect the first feature point The cloud device selects a second feature point from multiple first feature points, and the second feature point includes feature points whose target values ​​are greater than a preset threshold value among multiple first feature points. The preset threshold value is obtained by pre-training, and the preset threshold value makes the similarity between the posture calculated based on the fourth feature point among the third feature points and the true posture of the third feature point meet the third preset condition; wherein the third feature point is a feature point with the same features in the training data and multiple images corresponding to the training data, and the fourth feature point includes a feature point whose target value is greater than the preset threshold value among the third feature points; the cloud device calculates the posture using the second feature point to obtain the first posture, and sends the first posture to the terminal device.

[0026] In this way, since cloud devices usually have strong data computing capabilities, executing the pose calculation method in the cloud device can avoid memory usage of the terminal device and improve the running speed of the pose calculation method.

[0027] In a possible implementation, the method also includes: the terminal device receives the first posture from the cloud device, and when the terminal device determines that the first posture meets the preset position range, the terminal device determines the navigation route based on the first posture and the destination position; the terminal device displays a first interface in the AR navigation, and the first interface includes: a digital person for indicating the navigation route, and an identification for indicating the direction.

[0028] In a fourth aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the terminal device executes the method described in the first aspect or any possible implementation of the first aspect.

[0029] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is run on a computer, the computer executes the method described in the first aspect or any possible implementation of the first aspect.

[0030] In a sixth aspect, an embodiment of the present application provides a computer program product comprising a computer program, which, when executed on a computer, enables the computer to execute the method described in the first aspect or any possible implementation manner of the first aspect.

[0031] It should be understood that the second aspect, and the fourth to sixth aspects of the present application correspond to the technical solution of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 A schematic diagram of a scenario provided for an embodiment of the present application;

[0033] Figure 2 It is a flowchart of a posture calculation method;

[0034] Figure 3 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application;

[0035] Figure 4 A flowchart of a posture calculation method provided in an embodiment of the present application;

[0036] Figure 5 A schematic diagram of feature matching provided in an embodiment of the present application;

[0037] Figure 6 A schematic diagram of the principle of a priori algorithm provided in an embodiment of the present application;

[0038] Figure 7 A schematic diagram of an interface for displaying a digital human provided in an embodiment of the present application;

[0039] Figure 8 A schematic diagram of a process for obtaining target evaluation parameters provided in an embodiment of the present application;

[0040] Fig. 9 Another posture calculation method is provided for the embodiment of the present application;

[0041] Fig.10 A schematic diagram of the structure of a posture calculation device provided in an embodiment of the present application;

[0042] Fig.11A schematic diagram of the hardware structure of another terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] The following is an explanation of the vocabulary described in the embodiments of the present application. It should be understood that the explanation is for a clearer explanation of the embodiments of the present application and does not necessarily constitute a limitation on the embodiments of the present application.

[0044] Aprior algorithm: Aprior algorithm can be an association rule learning algorithm, which is a method for discovering associations between variables in a large database. Aprior algorithm is used to identify strong rules found in a database using some interestingness measure. Association analysis is a task of finding interesting relationships in a large data set. These relationships can be in two forms: frequent item sets or association rules. Frequent item sets are sets of variables that often appear together, and association rules suggest that there may be a strong relationship between two variables.

[0045] In the aprior algorithm, the relationship between two variables can be described by support and / or confidence.

[0046] Support: support(X=>Y)=P(X∪Y), which indicates the probability of X and Y appearing at the same time, or can be understood as the ratio of the number of times X and Y appear at the same time to the total number of records. For example, a shopping receipt may include an item set consisting of multiple commodities. When X is diapers and Y is beer, support(X=>Y) can be understood as the ratio of diapers and beer appearing at the same time in the item set.

[0047] Confidence: confidence(X=>Y)=support(X∪Y) / support(X), which means the ratio of the probability of X and Y appearing at the same time to the probability of X appearing, or it can also be understood as the probability of B appearing when A appears. For example, when X is diapers and Y is beer, confidence(X=>Y) can be understood as the probability of beer appearing when diapers appear.

[0048] In possible implementations, in addition to support and confidence, the relationship between multiple variables can also be determined based on lift. For example, lift (X=>Y) = confidence (X=>Y) / P (Y), which represents the ratio of the probability of containing Y under the condition of containing X to the probability of Y occurring overall. Among them, when lift (X=>Y)>1, it can be determined that there is a strong correlation between X and Y.

[0049] In the aprior algorithm described in the embodiment of the present application, X can be any parameter variable in the parameter set consisting of the search score and the target parameter, and Y can be an interior point variable. The meaning of the search score and the target parameter can be found in Figure 4 The corresponding embodiments.

[0050] Perspective-n-point (PNP): refers to the problem of estimating the camera pose given a set of n 3D points and their corresponding 2D projections in the image. For example, given the known coordinates of n 3D points (such as relative to a specified coordinate system A) and their 2D projection positions, estimate the camera pose (such as the camera pose in coordinate system A). The camera pose may include the camera direction and the position of the camera optical center.

[0051] Feature points: can be used to reflect the features of an image. For example, feature points can be points in an image that have distinct characteristics, can effectively reflect the essential features of an image, or can identify a target object in an image. For example, the feature points can be corner points, edge points, bright spots in darker areas, and dark spots in brighter areas.

[0052] Matching points: can be understood as points with the same features. For example, by performing feature matching on two images, matching points with the same features can be found from the matching points. The number of matching points is less than or equal to the number of feature points.

[0053] Among them, the feature extraction and feature matching methods may include one or more of the following, for example: features from accelerated segment test (FAST) feature point detection algorithm, Harris feature point detection algorithm, scale-invariant feature transform (SIFT) algorithm, or speeded up robust features (SURF) algorithm, etc.

[0054] Inliers: They can be understood as points used in pose calculation. The number of inliers can be less than or equal to the number of matching points.

[0055] The pose calculation method may include one or more of the following, for example: PNP algorithm, direct linear transform (DLT), P3P, or Epnp.

[0056] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first value and the second value are only used to distinguish different values, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0057] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0058] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c can be single or multiple.

[0059] For example, Figure 1 A schematic diagram of a scenario provided in an embodiment of the present application. Figure 1 In the corresponding embodiments, a mobile phone as the terminal device is used as an example for illustration, and this example does not constitute a limitation on the embodiments of the present application.

[0060] The terminal device can perform AR navigation based on VPS. For example, in an airport terminal, the user can use the AR navigation function in the terminal device to indicate the route from the current location to a certain destination. When the terminal device receives a signal from the user that the AR navigation function is turned on and the AR navigation is used to indicate the route from the current location to location B, the terminal device can display the route from the current location to location B by locating the user's current location and planning the path from the current location to location B. Figure 1 The interface shown in the figure. Figure 1 As shown, the interface may include an identifier for indicating the user's current location such as user 101, multiple arrows for indicating the navigation route, location A 102, location B 103, an identifier 105 for indicating that the user is currently in the AR navigation interface, and a prompt message 104 for textually indicating the navigation route. The prompt message 104 may be displayed as turning right after going straight for 100 meters.

[0061] In a possible implementation, when a user uses AR navigation to indicate a route, the terminal device can be based on the following: Figure 2 The posture calculation method described in the corresponding embodiment obtains the current environment image based on the camera, and determines the posture corresponding to the environment image based on the environment image and the preset image set, thereby obtaining the user's current location information. As the environment image obtained by the terminal device based on the camera continues to change, the terminal device can continue to adjust the navigation route, such as the terminal device changes from Figure 1 The interface shown in a in the figure switches to Figure 1 The interface shown in b in FIG. 1 is displayed until the user reaches the destination location B103.

[0062] For example, Figure 2 Figure 1 is a flow chart of a pose calculation method. Figure 2 As shown, the terminal device can obtain the environment image based on the camera, and perform image retrieval based on the preset image set, such as determining multiple feature images with high similarity (and / or clarity) with the environment map from the preset image set. The terminal device extracts feature points from the environment image and the multiple feature images respectively, and performs feature matching on the environment image and each of the multiple feature images, calculates the pose based on the matching points obtained in the feature matching process, and then obtains the pose corresponding to the environment image. Subsequently, the terminal device can determine the user's current location based on the pose corresponding to the environment image, and plan the route from the user's current location to the destination.

[0063] It is understandable that the terminal device can be based on Figure 2 The posture calculation method described in the corresponding embodiment is Figure 1The environment image corresponding to the interface shown in a in the figure is obtained, and the posture corresponding to the environment image is calculated to determine the current location of the user 101. Further, the terminal device performs path planning based on the current location of the user 101 and the location of the location B103, and uses the AR navigation function to indicate the route from the user 101 to the location B103.

[0064] However, when the navigation scene contains weak texture areas and / or repeated objects, the complex objects in the scene will affect the feature matching process, reducing the accuracy of feature matching. Furthermore, when the terminal device calculates the pose based on the feature matching with low accuracy, the large number of redundant and invalid feature points will reduce the accuracy of pose calculation, resulting in inaccurate positioning.

[0065] In view of this, an embodiment of the present application provides a posture calculation method, and the terminal device can filter the first feature point based on a trained preset threshold to obtain a second feature point with a higher correlation with the internal point. Since the preset threshold can filter out the fourth feature point from the third feature point corresponding to the training data, the similarity between the actual postures of the third feature points satisfies the third preset condition. Therefore, when the first feature point is filtered using the preset threshold, the second feature point with higher posture calculation accuracy can be filtered out from the first feature point, thereby solving the problem of inaccurate feature point matching caused by the presence of weak texture areas and / or repeated objects in the scene, and improving the accuracy of posture calculation and the accuracy of positioning or navigation based on posture.

[0066] It is understandable that the application scenario of the posture calculation method provided in the embodiment of the present application is not limited to Figure 1 The corresponding embodiments can also be applied to indoor scenes such as shopping mall navigation scenes, factory navigation scenes, exhibition hall navigation scenes, hotel navigation scenes, hospital navigation scenes, and parking lot navigation scenes. Alternatively, they can also be applied to indoor navigation scenes including digital humans, where digital humans can be understood as virtual characters used to indicate navigation routes in AR navigation.

[0067] For example, Figure 2 When the posture positioning method described in the corresponding embodiment is applied to an indoor navigation scene involving a digital human, due to an inaccurate feature matching process, the digital human may not be displayed normally in the interface of the terminal device, for example, the digital human is displayed in an abnormal form such as tilted or inverted.

[0068] In possible implementations, a posture calculation method provided in an embodiment of the present application can also be applied to large-scale visual positioning technology scenarios, such as autonomous driving, or outdoor scenes such as drones. The application scenario can include other content based on actual conditions, which is not limited in the embodiments of the present application.

[0069] It is understandable that the above terminal devices may also be referred to as terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. The terminal devices may be mobile phones with cameras, smart TVs, wearable devices, tablet computers (Pad), computers with wireless transceiver functions, virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc. The embodiments of the present application do not limit the specific technology and specific device form adopted by the terminal devices.

[0070] Therefore, in order to better understand the embodiment of the present application, the structure of the terminal device of the embodiment of the present application is introduced below. Figure 3 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application.

[0071] The terminal device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, an indicator 192, a camera 193, and a display screen 194. The sensor module 180 may include one or more of the following sensors, for example: a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, or a bone conduction sensor.

[0072] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0073] The processor 110 may include one or more processing units. Different processing units may be independent devices or integrated into one or more processors. The processor 110 may also be provided with a memory for storing instructions and data.

[0074] The USB interface 130 is an interface that complies with the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the terminal device, and can also be used to transfer data between the terminal device and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0075] The charging management module 140 is used to receive charging input from a charger, which may be a wireless charger or a wired charger. The power management module 141 is used to connect the charging management module 140 to the processor 110 .

[0076] The wireless communication function of the terminal device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.

[0077] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The antenna in the terminal device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antenna.

[0078] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to terminal devices. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.

[0079] The wireless communication module 160 can provide wireless communication solutions applied to terminal devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), etc.

[0080] The terminal device realizes the display function through the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.

[0081] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the terminal device may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0082] The terminal device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0083] The camera 193 is used to capture static images or videos. In some embodiments, the terminal device may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0084] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.

[0085] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 can include a program storage area and a data storage area.

[0086] The terminal device can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.

[0087] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Speaker 170A, also known as "speaker", is used to convert audio electrical signals into sound signals. The terminal device can listen to music or listen to hands-free calls through speaker 170A. Receiver 170B, also known as "earpiece", is used to convert audio electrical signals into sound signals. When the terminal device answers a call or voice message, the voice can be answered by placing receiver 170B close to the human ear. Headphone interface 170D is used to connect wired headphones. Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. In an embodiment of the present application, the terminal device may have a microphone 170C.

[0088] The button 190 includes a power button, a volume button, etc. The button 190 may be a mechanical button. It may also be a touch button. The terminal device may receive the button input and generate a key signal input related to the user settings and function control of the terminal device. The indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, message, missed call, notification, etc.

[0089] The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture, etc., which will not be elaborated here.

[0090] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be implemented independently or in combination with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0091] For example, Figure 4 A flow chart of a posture calculation method provided in an embodiment of the present application. Figure 4 As shown, the posture calculation method may include the following steps:

[0092] S401. The terminal device obtains an environment image.

[0093] The environment image (or referred to as the first image) is an image captured by a camera of a terminal device, and the environment image may be one image or multiple images.

[0094] Exemplarily, the terminal device may periodically acquire an environmental image, for example, once every 0.5 seconds or 1 second; or, the terminal device may automatically acquire a new environmental image upon detecting that the similarity between the current environment and the environmental image at the previous moment (for example, the previous frame) is greater than a preset similarity threshold; or, the terminal device may also acquire the environmental image based on a user triggering the terminal device, etc.

[0095] In an embodiment of the present application, when the terminal device receives a signal from a user that a VR navigation function is turned on and triggers an operation for indicating positioning, the terminal device begins to acquire environmental images in response to the user's operation.

[0096] S402: The terminal device uses the environment image to filter out a target image set from a preset image set, and obtains a retrieval score corresponding to each image in the target image set.

[0097] The target image set may include N second images.

[0098] Exemplarily, the terminal device can screen out N images whose similarity (and / or clarity) exceeds a certain threshold by matching the similarity (and / or clarity) between the environment image and each image in the preset image set, so as to form a target image set. Wherein, N is a positive integer, any image in the N images corresponds to a retrieval score, the N images can correspond to N retrieval scores, and any retrieval score in the N retrieval scores can be used to indicate the similarity (and / or clarity) between any image in the N images and the environment image. For example, when the similarity between a certain image in the N images and the environment image is 0.1, it can be determined that the retrieval score corresponding to the certain image in the N images is 0.1.

[0099] S403: The terminal device performs feature extraction and feature matching on the environment image and each image in the target image set, and determines the target parameters corresponding to each feature point in the target image set.

[0100] The terminal device can use the environmental image to determine matching points in each image in the target image set through feature extraction and feature matching methods. The matching points determined based on the feature matching method can be called first matching points (or first feature points).

[0101] For example, Figure 5 A schematic diagram of feature matching provided in an embodiment of the present application. Figure 5 The a in can be the environment image, Figure 5 The b in can be any image in the target image set. Figure 5 a or Figure 5 Any point in b in is used to indicate a feature point obtained based on feature extraction, such as Figure 5 From a in the above, we can extract the feature points of location A and its surroundings. Figure 5 The b in the figure can extract feature points of location B and its surroundings, and feature points of location A and its surroundings.

[0102] Should Figure 5 a in Figure 5The line segments between b in are used to indicate points with the same features matched based on the feature matching method. For example, Figure 5 a in Figure 5 The same location A and the intersections around location A can be matched in b.

[0103] In the embodiment of the present application, the target parameter may include: matching point score. Alternatively, the target parameter may also include one or more of the following, such as: number of feature points, number of matching points, feature point ratio, discrete value of matching point category, number of matching point clusters, and other parameters.

[0104] The matching point score is used to indicate the score (or probability) of a feature point being a matching point. For example, when a feature point determined based on any feature matching method has an 80% probability of becoming a matching point, the matching point score corresponding to the feature point may be 80% or 80. It is understood that in the feature matching method, a feature point whose matching point score is greater than a preset matching point score threshold may be a matching point.

[0105] The feature point ratio can be: The feature point ratio is used to indicate the ratio of the area where the feature point is located relative to the environment image.

[0106] The discrete values ​​of matching point categories can be: The discrete values ​​of the matching point categories can be used to characterize the clustering of the matching points (or matching point distribution).

[0107] Specifically, the environment image is divided into m*n grids of the same size, which can be rectangular, circular, or triangular, etc.; the total number of grids with feature points is recorded as A; the matching points are clustered to obtain q classes; the number of grids with matching points is recorded, and the number of grids corresponding to different classes is determined based on the clustering situation, such as recording the number of grids as B1, ..., Bq; recording the total number of grids as C; the variance of the coordinates of the q cluster centers is v; the variance of the feature point coordinates is V. Among them, The smaller the value of , the more concentrated the multiple classes are, or The larger the value of , the more discrete the multiple classes are. It can be understood as the proportion of a cluster in all clusters. Can also be replaced by

[0108] The number of matching point clusters may be used to indicate the clustering status of the matching points. For example, the number of matching point clusters may be q.

[0109] For example, when there are N second images in the target image, the terminal device can obtain N groups of feature points and N groups of matching points through feature extraction and feature matching methods, and then determine the target parameters corresponding to each matching point (or feature point) in the target image set based on the above N groups of feature points and N groups of matching points.

[0110] S404: The terminal device calculates the pose of the environment image and each image in the target image set, and determines the inner point corresponding to each image in the target image set.

[0111] Exemplarily, the terminal device can determine the matching points between the environment image and each image in the target image set based on the feature extraction and feature matching method described in the step S403, and obtain the poses determined based on the environment image and each image in the target image set through pose calculation, and then obtain the inner points corresponding to each image in the target image set. For example, when there are N second images in the target image, the terminal device can calculate N poses and the inner points corresponding to any of the N poses.

[0112] In a possible implementation, the terminal device may also calculate the discrete value of the interior point category (or called the interior point distribution), and the discrete value of the interior point category may also be used to calculate the evaluation parameter. The discrete value of the interior point category is used to characterize the clustering of the interior points, and the calculation method of the discrete value of the interior point category may be similar to the calculation method of the discrete value of the feature point category described above, which will not be repeated here.

[0113] S405: The terminal device determines evaluation parameters using the retrieval score, target parameters and internal points.

[0114] The evaluation parameter (or target value) can be used to reflect whether any matching point allows pose calculation, and the evaluation parameter can be related to the parameter used to reflect the feature matching of the first feature point, and the parameter used to reflect the inlier situation in the first feature point. The parameter used to reflect the feature matching of the first feature point can include: any one or more parameters in the parameter set consisting of the retrieval score and the target parameter, and the parameter used to reflect the inlier situation in the first feature point can include one or more of the following: a parameter used to indicate whether the first feature point is an inlier, or a parameter used to indicate the distribution of the cluster to which the inlier belongs in the second image (or called inlier distribution).

[0115] In an embodiment of the present application, the terminal device can determine a second matching point in the first matching that has an association relationship with the inner point based on the aprior algorithm. The association relationship can be determined by a target item set composed of parameters reflecting the feature matching situation of the first feature point and parameters used to reflect the inner point situation in the first feature point.

[0116] Among them, the support of the target item set may include one or more of the following, for example: the support S1 between the retrieval score and the inlier, the support S2 between the matching point score and the inlier, the support S3 between the number of image matching points and the inlier, the support S4 between the number of image feature points and the inlier, the support S5 between the discrete value of the matching point category and the inlier, the support S6 between the number of categories of the matching point clustering and the inlier, and the support S7 between the matching point score and the inlier.

[0117] The confidence of the target item set may include one or more of the following, for example: the confidence C1 between the retrieval score and the inliers, the confidence C2 between the matching point score and the inliers, the confidence C3 between the number of image matching points and the inliers, the confidence C4 between the number of image feature points and the inliers, the confidence C5 between the discrete values ​​of the matching point categories and the inliers, the confidence C6 between the number of categories of the matching point clustering and the inliers, and the confidence C7 between the matching point score and the inliers.

[0118] For example, support (retrieval score => inlier) can be understood as: the data support ratio used to indicate the dependency relationship between the retrieval score variable and the inlier variable, such as the data ratio of the item set in which the retrieval score corresponding to a certain point is a certain value and the point is an inlier in the total item set; confidence (retrieval score => inlier) can be understood as: the ratio of a point that can be determined to be an inlier when the retrieval score corresponding to a certain point is a certain value, such as when the confidence (retrieval score => inlier) is 0.6, it can be understood that when the image retrieval score is a certain value, there is a 0.6 ratio that determines that the point is an inlier.

[0119] It can be understood that the smaller the value of support (retrieval score => inlier), the lower the reliability of the value of confidence (retrieval score => inlier); or, the larger the value of support (retrieval score => inlier), the higher the reliability of the value of confidence (retrieval score => inlier). Therefore, in the aprior algorithm, both support and confidence are more important.

[0120] Taking the support S1 of the first item set consisting of {retrieval score, inlier} and the confidence C1 of the first item set determined based on the aprior algorithm as an example for illustration. For example, the terminal device can obtain the retrieval scores corresponding to the 10 images in the target image set, and whether each point in the 10 images is an inlier (such as 0 can be understood as a non-inlier, and 1 can be understood as an inlier), and the 10 images can contain a total of 1000 feature points, as shown in Table 1.

[0121] Table 1 Schematic diagram of retrieval scores and internal points

[0122] Search score Interior point situation Fig.101 0.1 0 … … 0.1 1 Fig.102 0.3 1 … … 0.3 0 … … … Fig.110 0.7 1 … … 0.7 1

[0123] The retrieval score and inlier situation indicated in any row in Table 1 may correspond to an item set, and the terminal device may determine the support and confidence corresponding to any item set from the data shown in Table 1 based on the aprior algorithm. For example, when the terminal device determines that the corresponding inlier situation when the retrieval score is greater than 0.5 is 1, the number of {retrieval score greater than 0.5, inlier} accounts for 50% of the total number of item sets, and the number of points corresponding to the retrieval score greater than 0.5 is 50% of the total number of points, then it can be determined that support (retrieval score greater than 0.5=> inlier) is 0.5 (ie, S1=0.5), and confidence (retrieval score greater than 0.5=> inlier) is 1 (ie, C1=1).

[0124] Suitably, the terminal device can obtain the retrieval score and any parameter variable in the target parameter, and the support and confidence of the internal point. The values ​​of the support and confidence can be used to determine the credibility of the posture.

[0125] In a possible implementation, the evaluation parameter Sc may be:

[0126] Sc=Pi×Si×Ci or, Among them, when i is 1, P1 can be 0.1; when i is 2, P2 can be 0.2; when i is 3, P3 can be a value obtained by normalizing the values ​​corresponding to the number of image matching points. For example, when the number of image matching points is 1000, P3 can be 1000 / Z, and Z can be a value greater than 1000, such as Z can be 2000; other values ​​of Pi are similar to P3 and will not be repeated here.

[0127] In a possible implementation, the evaluation parameter Sc may also be:

[0128]

[0129] Among them, menaS can be the average value of S1-S7, menaC can be the average value of C1-C7; e, h, j and can be understood as offsets, Si can also be replaced by the square of Si, Ci can also be replaced by the square root of Ci, etc., f, g, k can all be constants, and the possible deformation of the evaluation parameters is not specifically limited in the embodiments of the present application.

[0130] For example, when it is determined that the retrieval score of a certain image is 0.1, the number of image matching points is 1000, and the matching point score corresponding to a certain point in the image is 0.2, the evaluation parameter Sc corresponding to the certain point may be:

[0131]

[0132] In a possible implementation, the evaluation parameter Sc may also be: Sc=P2×S2×C2. In this case, the terminal device may calculate the evaluation parameter using only the matching point scores in the target parameters, which is not limited in the embodiments of the present application.

[0133] Similarly, the terminal device can calculate the evaluation parameters corresponding to the matching points of any image in the target image set, so that it can subsequently determine whether the matching points need to be calculated based on the evaluation parameters.

[0134] S406: The terminal device uses the evaluation parameters to select second matching points from the first matching points, and uses the second matching points to perform posture calculation.

[0135] In the embodiment of the present application, the number of the second matching points (or second feature points) is less than the number of the first matching points, and the second matching points can be understood as matching points in the first matching points that have a strong correlation with the inner points. Exemplarily, when the terminal device determines that the evaluation parameter corresponding to any point in the first matching points is greater than the target evaluation parameter, the point whose evaluation parameter is greater than the pre-target evaluation parameter can be used as the second matching point, and the second matching point is used for posture calculation.

[0136] The target evaluation parameter may be a value obtained by pre-training. The target evaluation parameter is used to select matching points that are more likely to be used for pose calculation from the first matching point. The process of obtaining the target evaluation parameter can be found in Figure 8 The corresponding embodiments.

[0137] In a possible implementation, after S406, when the terminal device obtains the posture corresponding to the environment image, the terminal device can determine the current location of the user based on the posture, and plan a path between the current location of the user and the destination so that the terminal device displays the navigation route between the current location of the user and the destination, for example, the terminal device displays the following Figure 1 Furthermore, as the environment image changes, the navigation route also changes, so that the terminal device can be Figure 1 The interface shown in a in the figure changes to Figure 1 The interface shown in b.

[0138] In the embodiment of the present application, the pose calculation method may be a PNP method or the like. For example, a three-dimensional point cloud corresponding to any two-dimensional image in the target image set may be set in the terminal device; after the terminal device screens and obtains the second matching point, the three-dimensional point corresponding to the second matching point may be obtained, and the pose calculation is performed based on the two-dimensional matching point and the three-dimensional point.

[0139] Based on this, the terminal device can filter out second matching points that have a strong correlation with the internal points from the first matching points by sorting out the feature matching between the environment image and each image in the target image set, as well as the internal point conditions, so that the terminal device can calculate a more accurate posture based on the second matching points.

[0140] The terminal device may use an aprior algorithm to determine the association relationship between any parameter in the target parameter and the inlier point, and determine a matching point that is more likely to become an inlier point based on the association relationship. Figure 6 The schematic diagram of the principle of a priori algorithm provided in the embodiment of the present application is as follows. Figure 6 As shown, the terminal device can determine the support and confidence between the intermediate result statistics (or called retrieval scores and target parameters) in the positioning process and the internal points used for positioning calculation based on the aprior algorithm.

[0141] exist Figure 4 Based on the corresponding embodiment, in a possible implementation, the terminal device may also be based on Figure 4 The posture calculation method described in the corresponding embodiment displays the digital human in AR navigation. Figure 7 A schematic diagram of an interface for displaying a digital human provided in an embodiment of the present application.

[0142] For example, a user utilizes the AR navigation function of a terminal device to locate in an indoor scene. To increase the fun of AR navigation, more terminal devices may support the display of a digital human in AR navigation, so that the digital human can indicate the navigation route.

[0143] The terminal device can display Figure 7 The interface shown in a in the figure can display the environment image collected by the camera. When the terminal device receives an operation for indicating positioning, the terminal device can Figure 4 When it is determined that the current posture meets the preset position range, such as when it is determined that the current position is in an airport terminal, the terminal device can determine the navigation route based on the current posture and the destination, and then display the following information: Figure 7 The interface shown in b in the figure. Figure 7 The interface shown in b in FIG. 1 may include a digital human 701 and a mark 702 for indicating the navigation direction.

[0144] Furthermore, as the terminal device moves, the images collected by the terminal device are constantly changing, so the digital human can also guide the user step by step, so that the user can reach the destination from the current location. Figure 7 The interface shown in b in the figure switches to Figure 7The interface shown in c.

[0145] Based on this, the terminal device can not only provide accurate positioning based on the posture positioning method, but also use digital humans to provide users with more intuitive route guidance, thereby improving the user experience of using AR navigation.

[0146] exist Figure 4 Based on the corresponding embodiment, the process of obtaining the target evaluation parameters can be seen in Figure 8 Corresponding embodiments. Exemplarily, Figure 8 A schematic diagram of a process for obtaining target evaluation parameters provided in an embodiment of the present application.

[0147] like Figure 8 As shown, the process of obtaining the target evaluation parameters may include the following steps:

[0148] S801: The terminal device performs image retrieval on a preset image set using training data to obtain a target image set and a retrieval score corresponding to each image in the target image set.

[0149] S802: The terminal device performs feature extraction and feature matching on the training data and each image in the target image set to obtain the number of feature points, matching point scores, matching point category discrete values, and the number of categories of matching point clusters.

[0150] The method of obtaining the number of feature points, matching point scores, matching point category discrete values, and the number of categories of matching point clusters may refer to the step shown in S403.

[0151] S803: The terminal device calculates the position and posture using the matching points and determines the inner points.

[0152] The matching point described in step S803 may be the third matching point.

[0153] S804: The terminal device determines the support and confidence of an item set consisting of any parameter among the parameters consisting of the retrieval score and the target parameter and the internal point based on the aprior algorithm.

[0154] S805. The terminal device calculates the evaluation parameters corresponding to each matching point.

[0155] S806. The terminal device inputs the evaluation parameters corresponding to each matching point into the model for training, and obtains the target evaluation parameters when the pose calculation results converge.

[0156] Among them, the convergence of the pose calculation result can be understood as the pose calculated during the training process is consistent with the true pose. For example, the initial value of the target evaluation parameter (or called the initial threshold) is determined to be 0. When the initial value of the target evaluation parameter is 0, all matching points obtained by feature matching are used to perform pose calculation, and the loss function is used to compare the pose calculation result and the true pose. Further, when the accuracy of the pose calculation result is low, u is used as the preset step size, the second value of the target evaluation parameter is determined to be u, and the matching points corresponding to the evaluation parameters corresponding to all matching points are screened out when the evaluation parameters are greater than u, and pose calculation is performed based on the new matching points, and then the new pose calculation result and the true pose are compared again based on the loss function. Repeat the above iterative process of the target evaluation parameter until the output pose calculation result is consistent with the true pose, corresponding to the target evaluation parameter (or called the preset threshold).

[0157] exist Figure 4 On the basis of the corresponding embodiments, in order to more clearly describe the posture calculation method described in the embodiments of this application. For example, Fig. 9 Another posture calculation method is provided for the embodiment of the present application.

[0158] like Fig. 9 As shown, the posture calculation method may include the following steps:

[0159] S901: The terminal device performs image retrieval using an environment image and a preset image set to obtain a target image set and a retrieval score corresponding to each image in the target image set.

[0160] S902: The terminal device performs feature extraction and feature matching on the environment image and each image in the preset image set to obtain the number of feature points, matching point scores, matching point category discrete values, and the number of categories of matching point clusters.

[0161] The matching points described in S902 can be understood as Figure 4 The first matching point described in .

[0162] S903: The terminal device performs posture calculation to determine the interior points.

[0163] S904: The terminal device determines the support and confidence of an item set consisting of any parameter among the parameters consisting of the retrieval score and the target parameter and the interior point based on the aprior algorithm.

[0164] S905. The terminal device calculates the evaluation parameters corresponding to each matching point.

[0165] S906. The terminal device determines whether the evaluation parameter exceeds the target evaluation parameter, and selects the matching points whose evaluation parameters exceed the target evaluation parameter from the first matching points to obtain the second matching points, and then uses the second feature points to update the posture.

[0166] Based on this, the terminal device can filter out second matching points that have a strong correlation with the internal points from the first matching points by sorting out the feature matching between the environment image and each image in the target image set, as well as the distribution of the internal points, so that the terminal device can calculate a more accurate posture based on the second matching points.

[0167] In a possible implementation, after S407, the terminal device may also perform path planning based on the posture information of the environment image, and display the planned route in the interface of the terminal device.

[0168] It can be understood that when a preset image set is preset in the terminal device, the posture calculation method provided in the embodiment of the present application can be implemented in the terminal device.

[0169] In a possible implementation, when a preset image set is preset in the cloud, the posture calculation method provided in the embodiment of the present application can be implemented in the terminal device and the cloud device. Among them, the terminal device can be used to obtain the environment image, and use the posture corresponding to the environment image for path planning; the cloud device can be used to extract features from the environment image uploaded by the terminal device, and perform feature matching and posture calculation based on the environment image and the feature image. It can be understood that since cloud devices usually have strong data computing capabilities, executing the above steps in the posture calculation method in the cloud device can avoid memory usage when the terminal device executes the above steps, and improve the running speed of the posture calculation method.

[0170] In a possible implementation, the above-mentioned terminal device and the cloud device can establish a communication connection. For example, the terminal device and the cloud device can establish a communication connection through protocols such as Hypertext Transfer Protocol (HTTP) or Hypertext Transfer Protocol over Secure Socket Layer (HTTPS). There is no limitation on this in the embodiments of the present application.

[0171] It should be understood that the interface provided in the embodiment of the present application is merely an example and does not constitute a limitation on the embodiment of the present application.

[0172] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0173] Combined with the above Figure 4-Figure 9 , the method provided in the embodiment of the present application is explained, and the device for executing the above method provided in the embodiment of the present application is described below.

[0174] like Fig.10 As shown, Fig.10 A structural schematic diagram of a posture calculation device provided in an embodiment of the present application. The posture calculation device can be a terminal device in an embodiment of the present application, or a chip or chip system in the terminal device.

[0175] like Fig.10 As shown, the posture calculation device 1000 can be used in a communication device, a circuit, a hardware component or a chip, and the posture calculation device includes: a collection unit 1001 and a processing unit 1002. Among them, the collection unit 1001 is used to support the posture calculation device 1000 to perform the collection step, and the processing unit 1002 is used to support the posture calculation device 1000 to perform the data processing step.

[0176] Specifically, the embodiment of the present application provides a posture calculation device 1000, which includes: an acquisition unit 1001 and a processing unit 1002; the acquisition unit 1001 is used to acquire a first image; the processing unit 1002 is used to obtain N second images in a preset image set, the N second images include images whose similarity with the first image meets a first preset condition, and / or, images whose clarity with the first image meets a second preset condition, and N is a positive integer; the processing unit 1002 is also used to determine a plurality of first feature points in each of the N second images, the first feature points include feature points that are the same as features in the first image; the processing unit 1002 is also used to calculate a target value for each first feature point, and the target value for each first feature point is the same as the target value for reflecting the first feature point. The processing unit 1002 is also used to select a second feature point from multiple first feature points, the second feature point includes feature points whose target values ​​are greater than a preset threshold value among multiple first feature points, the preset threshold value is obtained by pre-training, and the preset threshold value makes the similarity between the posture calculated based on the fourth feature point among the third feature points and the true posture of the third feature point meet the third preset condition; wherein the third feature point is a feature point with the same features in the training data and multiple images corresponding to the training data, and the fourth feature point includes a feature point whose target value is greater than the preset threshold value among the third feature points; the processing unit 1002 is also used to use the second feature point to perform posture calculation to obtain the first posture.

[0177] In a possible implementation, the posture calculation device 1000 may also include a communication unit 1003. Specifically, the communication unit 1003 is used to support the posture calculation device 1000 to perform the steps of sending data and receiving data. The communication unit 1003 may be an input or output interface, a pin or a circuit.

[0178] In a possible embodiment, the posture calculation device 1000 may further include: a storage unit 1004. The processing unit 1002 and the storage unit 1004 are connected via a line. The storage unit 1004 may include one or more memories, and the memory may be a device used to store programs or data in one or more devices or circuits. The storage unit 1004 may exist independently and be connected to the processing unit 1002 of the posture calculation device via a communication line. The storage unit 1004 may also be integrated with the processing unit 1002.

[0179] The storage unit 1004 can store computer-executable instructions of the method in the terminal device so that the processing unit 1002 executes the method in the above embodiment. The storage unit 1004 can be a register, a cache, or a RAM, etc. The storage unit 1004 can be integrated with the processing unit 1002. The storage unit 1004 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, and the storage unit 1004 can be independent of the processing unit 1002.

[0180] Fig.11 A schematic diagram of the hardware structure of another terminal device provided in an embodiment of the present application is shown in FIG. Fig.11 As shown, the terminal device includes a processor 1101, a communication line 1104 and at least one communication interface ( Fig.11 The communication interface 1103 is used as an example for explanation).

[0181] The processor 1101 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.

[0182] Communications link 1104 may include circuitry to transmit information between the above-described components.

[0183] The communication interface 1103 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, wireless local area networks (WLAN), etc.

[0184] Possibly, the terminal device may further include a memory 1102 .

[0185] The memory 1102 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor via a communication line 1104. The memory may also be integrated with the processor.

[0186] The memory 1102 is used to store computer-executable instructions for executing the solution of the present application, and the execution is controlled by the processor 1101. The processor 1101 is used to execute the computer-executable instructions stored in the memory 1102, thereby implementing the method provided by the embodiment of the present application.

[0187] Possibly, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, and the embodiments of the present application do not specifically limit this.

[0188] In a specific implementation, as an embodiment, the processor 1101 may include one or more CPUs, such as Fig.11 CPU0 and CPU1 in.

[0189] In a specific implementation, as an embodiment, the terminal device may include multiple processors, such as Fig.11 1 and 1105. Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0190] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium can include a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a digital versatile disc (digital versatiledisc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0191] The embodiments of the present application also provide a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium that can be accessed by a computer.

[0192] As a possible design, the computer readable medium may include a compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; the computer readable medium may include a magnetic disk storage or other magnetic disk storage device. Moreover, any connection line may also be appropriately referred to as a computer readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while optical discs reproduce data optically using lasers.

[0193] The above combinations should also be included in the scope of computer-readable media. The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A posture calculation method, characterized in that: The method comprises: The terminal device collects a first image, where the first image is an environment image; The terminal device obtains N second images from a preset image set, wherein the N second images include images whose similarity to the first image satisfies a first preset condition, and / or images whose clarity to the first image satisfies a second preset condition, and N is a positive integer; The terminal device determines a plurality of first feature points in each of the N second images, wherein the first feature points include feature points that are the same as features in the first image; The terminal device calculates a target value of each of the first feature points, where the target value of each of the first feature points is related to a parameter used to reflect a feature matching situation of the first feature point and a parameter used to reflect an interior point situation in the first feature point, and the target value is used to reflect whether any matching point is allowed to perform pose calculation; The terminal device selects a second feature point from the multiple first feature points, the second feature point includes a feature point whose target value is greater than a preset threshold value among the multiple first feature points, the preset threshold value is obtained through pre-training, and the preset threshold value makes the similarity between the posture calculated based on the fourth feature point among the third feature points and the real posture of the third feature point satisfy a third preset condition; wherein the third feature point is a feature point having the same feature in the training data and the multiple images corresponding to the training data, and the fourth feature point includes a feature point whose target value is greater than the preset threshold value among the third feature points; The terminal device uses the second feature point to calculate the posture and obtain the first posture to obtain the user's current position information.

2. The method according to claim 1, characterized in that: The parameter used to reflect the feature matching situation includes one or more of the following: a parameter used to indicate the similarity or clarity between the second image where the first feature point is located and the first image, a parameter used to indicate the number of feature points in the second image, a parameter used to indicate the number of the first feature points, a parameter used to indicate the proportion of the number of feature points in the second image, a parameter used to indicate the number of clusters obtained by clustering the first feature points, a parameter used to indicate the distribution of the cluster where the first feature point is located in the second image, or a parameter used to indicate the probability that a feature point in the second image is the first feature point; The parameter for reflecting the inlier situation includes one or more of the following: a parameter for indicating whether the first feature point is an inlier, or a parameter for indicating the distribution of the cluster to which the inlier belongs in the second image.

3. The method according to claim 2, characterized in that When the parameter used to reflect the feature matching situation of the first feature point is: the probability used to indicate that the feature point in the second image is the first feature point, and the parameter used to reflect the interior point situation is: the parameter used to indicate whether the first feature point is an interior point, then the target value of each first feature point is: the product of the support and confidence of the first item set corresponding to each first feature point calculated by the terminal device based on the prior aprior algorithm, and the probability in the first item set used to indicate that the feature point in the second image is the first feature point; wherein the first item set is an item set composed of the probability used to indicate that the feature point in the second image is the first feature point, and the parameter used to indicate whether the first feature point is an interior point.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: The terminal device obtains an initial threshold, and uses the initial threshold to filter out a fifth feature point whose target value of the third feature point is greater than the initial threshold from the third feature point; When the terminal device determines that the similarity between the posture calculated based on the fifth feature point and the actual posture does not meet the third preset condition, the terminal device adjusts the initial threshold using a preset step size to obtain the preset threshold; wherein the fifth feature point includes a feature point among the third feature points whose target value is less than or equal to the preset threshold.

5. The method according to any one of claims 1 to 4, characterized in that: The terminal device collects a first image, including: The terminal device performs augmented reality (AR) navigation in a preset indoor scene; When the terminal device receives an operation for instructing positioning, the terminal device captures the first image.

6. The method according to claim 5, characterized in that The method further comprises: When the terminal device determines that the first posture meets a preset position range, the terminal device determines a navigation route based on the first posture and the destination position; The terminal device displays a first interface in the AR navigation, and the first interface includes: a digital person for indicating the navigation route, and an identification for indicating the direction.

7. A posture calculation device, characterized in that: The posture calculation device comprises: a collection unit and a processing unit; The acquisition unit is used to acquire a first image, where the first image is an environment image; The processing unit is configured to obtain N second images from a preset image set, wherein the N second images include images whose similarity to the first image satisfies a first preset condition, and / or images whose clarity to the first image satisfies a second preset condition, and N is a positive integer; The processing unit is further configured to determine a plurality of first feature points in each of the N second images, wherein the first feature points include feature points having the same features as those in the first image; The processing unit is further used to calculate a target value of each of the first feature points, where the target value of each of the first feature points is related to a parameter used to reflect a feature matching situation of the first feature point and a parameter used to reflect an interior point situation in the first feature point, and the target value is used to reflect whether any matching point is allowed to perform pose calculation; The processing unit is further used to screen out second feature points from the multiple first feature points, the second feature points including feature points whose target values ​​are greater than a preset threshold value among the multiple first feature points, the preset threshold value being obtained through pre-training, and the preset threshold value being such that the similarity between a pose calculated based on a fourth feature point among the third feature points and a true pose of the third feature point satisfies a third preset condition; wherein the third feature point is a feature point having the same feature in the training data and the multiple images corresponding to the training data, and the fourth feature point includes a feature point whose target value is greater than the preset threshold value among the third feature points; The processing unit is further used to calculate the posture using the second feature point to obtain the first posture, so as to obtain the current position information of the user.

8. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the terminal device executes the method according to any one of claims 1 to 7.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the computer is caused to perform the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The method comprises a computer program which, when being executed, causes a computer to execute the method according to any one of claims 1 to 7.