Mobile device positioning method and device
By mounting a camera on a mobile device to obtain multi-time images and measuring the position change amount with the odometer module, the positioning inaccurate problem caused by limited camera resolution is solved, and a higher precision mobile device positioning is achieved.
Patent Information
- Application Number
- CN202210446053.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-26
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2042-04-26
AI Technical Summary
When the camera is far away from the graphics code or the size of the graphics code is small, due to the limited resolution of the camera, the position calculation of the graphics code in the camera coordinate system is not accurate enough, which in turn affects the positioning accuracy of the mobile device.
The camera mounted on a mobile device acquires images containing graphics codes at multiple moments, analyzes the image and acquires position information of the graphics code, and calculates the position of the camera in the world coordinate system based on the position of the configured graphics code in the world coordinate system. The odometer module is used to measure the camera's posture change amount, and the measured and calculated data are used to determine the position of the camera's posture under the world coordinate system, thereby accurately positioning the mobile device.
The accuracy of mobile device positioning is improved, especially when the camera is far away from the graphics code or the graphics code size is small. Through the analysis and optimization calculation of multi-time data, the position of the camera and mobile device can be determined more accurately.
Smart Images

Figure CN114882104B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of information processing, and particularly to a method and device for positioning a mobile device. Background Art
[0002] Currently, graphic codes are a general term for a class of visual positioning marker graphic codes, mainly including Apriltag codes, two-dimensional codes, barcodes, etc. After using a camera to capture an image containing a graphic code, the pose of the graphic code in the camera coordinate system can be calculated through steps such as decoding and pose calculation, and the mobile device is positioned based on the camera and the mobile device carrying the camera.
[0003] In the process of implementing the present application, the inventors found that when the camera is far from the graphic code or the size of the graphic code is small, due to the limited resolution of the camera, the pose of the camera coordinate system calculated based on the graphic code is not accurate enough, resulting in inaccurate positioning of the mobile device. Summary of the Invention
[0004] In view of this, the present application provides a method and device for positioning a mobile device, which can improve the accuracy of mobile device positioning.
[0005] To solve the above technical problems, the technical solution of the present application is implemented as follows:
[0006] In one embodiment, a method for positioning a mobile device is provided, and the method includes:
[0007] Obtaining images containing graphic codes at multiple moments through a camera mounted on a mobile device; and analyzing the position information of the measured graphic code in the camera coordinate system from the images;
[0008] Calculating the position information of the graphic code in the camera coordinate system according to the configured pose of the corresponding graphic code in the world coordinate system;
[0009] Measuring and obtaining the pose change amount of the camera in the world coordinate system between adjacent moments corresponding to the multiple moments through an odometer module;
[0010] Determining the pose of the camera in the world coordinate system according to the measured position information of the graphic code in the camera coordinate system, the calculated position information of the graphic code in the camera coordinate system, and the measured pose change amount of the camera in the world coordinate system;
[0011] Positioning the mobile device according to the determined pose of the camera in the world coordinate system.
[0012] In another embodiment, a device for positioning a mobile device is provided, and the device includes: a first acquisition unit, a second acquisition unit, a third acquisition unit, a calculation unit, and a positioning unit;
[0013] The first acquisition unit is configured to acquire images containing graphic codes at multiple moments through a camera mounted on a mobile device; and analyze the position information of the graphic codes measured from the acquired images in the camera coordinate system;
[0014] The second acquisition unit is configured to calculate the position information of the graphic code in the camera coordinate system according to the pose of the corresponding graphic code in the world coordinate system configured;
[0015] The third acquisition unit is configured to measure and obtain the pose change amount of the camera in the world coordinate system between adjacent moments corresponding to the multiple moments through an odometer module;
[0016] The calculation unit is configured to determine the pose of the camera in the world coordinate system according to the position information of the measured graphic code in the camera coordinate system acquired by the first acquisition unit, the position information of the graphic code in the camera coordinate system calculated by the second acquisition unit, and the pose change amount of the camera in the world coordinate system measured by the third acquisition unit;
[0017] The positioning unit is configured to locate the mobile device according to the determined pose of the camera in the world coordinate system.
[0018] In another embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the mobile device positioning method are implemented.
[0019] In another embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the steps of the mobile device positioning method are implemented.
[0020] As can be seen from the above technical solutions, in the above embodiments, images containing graphic codes at multiple moments are acquired through a camera mounted on a mobile device; and the position information of the graphic codes measured from the acquired images is analyzed; the position information of the graphic code in the camera coordinate system is calculated according to the pose of the corresponding graphic code in the world coordinate system configured; the pose change amount of the camera in the world coordinate system between adjacent moments corresponding to the multiple moments is measured and obtained through an odometer module; the pose of the camera in the world coordinate system is determined according to the position information of the measured graphic code in the camera coordinate system, the position information of the graphic code in the camera coordinate system calculated, and the pose change amount of the camera in the world coordinate system measured; and the mobile device is located according to the determined pose of the camera in the world coordinate system. This method can improve the positioning accuracy of the mobile device. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0022] Figure 1 It is a schematic diagram of the system for positioning a mobile device in an embodiment of the present application;
[0023] Figure 2 It is a schematic diagram of the mobile device positioning process in an embodiment of the present application;
[0024] Figure 3 It is a schematic diagram of the mobile device positioning process in another embodiment of the present application;
[0025] Figure 4 It is a schematic diagram of the device structure for positioning a mobile device in an embodiment of the present application;
[0026] Figure 5 It is a schematic diagram of the physical structure of the electronic device provided in an embodiment of the present invention. Specific Embodiments
[0027] The following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0028] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above accompanying drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0029] The following will detail the technical solutions of the present invention with specific embodiments. The following several specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0030] In an embodiment of the present application, a method for positioning a mobile device is provided, which is applied to a system for positioning a mobile device and can improve the accuracy of mobile device positioning.
[0031] This application involves two coordinate systems: the camera coordinate system and the world coordinate system; the positioning of the mobile device is to determine the position of the mobile device in the world coordinate system; in the embodiment of this application, the pose of the camera mounted on the mobile device in the world coordinate system is first positioned; the mobile device is positioned according to the determined pose of the camera in the world coordinate system. This method can improve the accuracy of mobile device positioning.
[0032] See Figure 1 , Figure 1 which is a schematic diagram of the system for positioning a mobile device in an embodiment of the present application. The system further includes: a mobile device positioning device, a camera, and an odometer (module).
[0033] The camera is mounted on the mobile device to be positioned and is used to acquire images containing graphic codes at multiple set moments; the images containing graphic codes are hereinafter simply referred to as graphic code images.
[0034] The odometer (module) acquires the pose change amount of the camera in the world coordinate system between adjacent moments corresponding to multiple moments; the odometer module can be an inertial measurement unit or other odometer modules;
[0035] The mobile device positioning device has the functions of acquiring data, analyzing data, and calculating data;
[0036] The mobile device positioning device also needs to acquire a graphic code position information configuration file, which can be pre-configured on the mobile device positioning device or acquired when needed.
[0037] Since the camera is loaded on the mobile device, the positioning of the camera is realized, and thus the positioning of the mobile device can be realized.
[0038] Next, with reference to the accompanying drawings, the process of positioning a mobile device in an embodiment of the present application will be described in detail.
[0039] See Figure 2 , Figure 2 which is a schematic diagram of the mobile device positioning process in an embodiment of the present application. The specific steps are as follows:
[0040] Step 201, acquire images containing graphic codes at multiple moments through the camera mounted on the mobile device; and analyze the acquired images to obtain the position information of the measured graphic codes in the camera coordinate system.
[0041] In specific implementation, a period for acquiring images will be set for the camera, that is, one image is acquired per period, or the moments for acquiring images can also be directly set.
[0042] When the number of acquired images accumulates to K, mobile device positioning is performed based on the current moment and the previous consecutive K - 1 moments; thereafter, each time an image is acquired, mobile device positioning is performed once.
[0043] K among them can be 3, 5, 8, etc., and there is no limitation on this.
[0044] Based on a specified period or moment, K images containing graphic codes are acquired through a camera, and each image is searched for and decoded to finally determine the pose of the graphic code in each image.
[0045] Due to the influence of the shooting distance and camera resolution, the angle information in the pose of the acquired graphic code is inaccurate. In this application, the angle information is not considered, and only the position information in the pose is used.
[0046] In specific implementation, the position information of the graphic code can be directly obtained from the graphic code image, or the pose can be obtained first, and then the position information can be obtained from the pose.
[0047] The position information obtained each time is K. The graphic codes corresponding to the K position information can be the same or different; the k-th position information is denoted as meas_square_posi k , where k = 1…K, and meas_square_posi k is a 2D vector.
[0048] Step 202, calculate the position information of the graphic code in the camera coordinate system according to the pose of the corresponding graphic code in the world coordinate system configured. Execute step 204.
[0049] Each graphic code has a corresponding graphic code identifier. When parsing the graphic code image, the identifier of the graphic code can be obtained simultaneously, and then the corresponding graphic code can be found in the configuration file, and the position information of the graphic code in the camera coordinate system is calculated according to the pose of the corresponding graphic code in the world coordinate system configured.
[0050] Step 201 is to measure the position information of the acquired graphic code in the camera coordinate system, and in step 202, it is the position information of the graphic code in the camera coordinate system obtained by calculation according to the configuration information.
[0051] Step 203, measure and obtain the pose change amount of the camera in the world coordinate system between adjacent moments corresponding to the multiple moments through the odometer module.
[0052] Measure and obtain K - 1 pose change amounts through the odometer module, where the i-th pose change amount is denoted as: control k , k = 1…K, using a 3D vector representation
[0053] Step 204: Determine the pose of the camera in the world coordinate system based on the position information of the measured graphic code in the camera coordinate system, the calculated position information of the graphic code in the camera coordinate system, and the measured pose change amount of the camera in the world coordinate system.
[0054] In specific implementation, an optimization function can be established with the pose of the camera to be determined in the world coordinate system as a variable based on the position information of the measured graphic code in the camera coordinate system, the calculated position information of the graphic code in the camera coordinate system, and the measured pose change amount of the camera in the world coordinate system. The pose of the camera to be determined in the world coordinate system that minimizes the value of the optimization function is used as the determined pose of the camera in the world coordinate system.
[0055] Step 205: Locate the mobile device according to the determined pose of the camera in the world coordinate system.
[0056] In specific implementation, the mobile device is located according to the pose of the camera in the world coordinate system and the relative position between the mobile device and the camera.
[0057] In the embodiments of the present application, the pose of the camera in the world coordinate system is determined based on the data obtained by the camera, the data obtained by the odometer, and the pose of the configured graphic code, and then the mobile device equipped with the camera is located. This solution can improve the accuracy of mobile device positioning.
[0058] See Figure 3 , Figure 3 which is a schematic diagram of the camera positioning process in another embodiment of the present application. The specific steps are as follows:
[0059] Step 301: Obtain images containing graphic codes at multiple moments through the camera mounted on the mobile device; and analyze the images to obtain the position information of the measured graphic code in the camera coordinate system.
[0060] In specific implementation, a period for obtaining images will be set for the camera, that is, one image is obtained per period, or the moments for obtaining images can be set in a periodic manner.
[0061] When the cumulative number of obtained images reaches K, camera positioning is performed based on the current moment and the previous consecutive K - 1 moments; thereafter, each time an image is obtained, camera positioning is performed once.
[0062] K among them can be 3, 5, 8, etc., and there is no limit to this.
[0063] Based on a specified period or moment, K images containing graphic codes are obtained through the camera, and each image is searched for and decoded respectively, and finally the pose of the graphic code in each image is determined.
[0064] Due to the influence of the shooting distance and the camera resolution, the angle information in the pose of the graphic code obtained here is inaccurate. In this application, the angle information is not considered, and only the position information in the pose is used.
[0065] In specific implementation, the position information of the graphic code can be directly obtained from the graphic code image, or the pose can be obtained first, and then the position information can be obtained from the pose.
[0066] Each time, K pieces of position information are obtained. The graphic codes corresponding to the K pieces of position information can be the same or different; the k-th piece of position information is denoted as meas_square_posi k , where k = 1...K, and meas_square_posi k is a 2D vector.
[0067] Due to problems such as measurement noise, there are also minor inaccuracies in the position information. The inaccuracy of meas_square_posi k can be represented by the first covariance matrix M, that is, the inaccuracy of the position information of each measured graphic code in the camera coordinate system is represented by the first covariance matrix; among them, the first covariance matrix corresponding to the position information of each measured graphic code in the camera coordinate system can be the same or different; and the first covariance matrix is a diagonal matrix;
[0068] In the embodiment of this application, the matrix M is a diagonal matrix, and each diagonal element represents the variance of the corresponding position data. The values of the diagonal elements are set according to historical measurement data, manual experience, etc.; the diagonal matrices set for the K pieces of position information can be the same or different. In the embodiment of this application, taking the same as an example, they are all M. The values of different elements of the matrix M can be the same or different. Below, taking the same diagonal values as an example:
[0069] An example is as follows: M = diag(0.01, 0.01). Among them, diag() represents constructing a diagonal matrix according to the elements, that is
[0070]
[0071] Here, the element value of the diagonal matrix M is taken as 0.01 as an example, and there is no limitation on this in practical applications.
[0072] Step 302, calculate the position information of the graphic code in the camera coordinate system according to the pose of the corresponding graphic code in the world coordinate system configured. Execute step 304.
[0073] Each graphic code has a corresponding graphic code identifier. When parsing the graphic code image, the identifier of the graphic code can be obtained simultaneously, and then the corresponding graphic code can be found in the configuration file. According to the pose of the corresponding graphic code configured in the world coordinate system, the position information of the graphic code in the camera coordinate system is calculated.
[0074] When specifically implemented, calculating the position information of the graphic code in the camera coordinate system according to the pose of the corresponding graphic code configured in the world coordinate system includes:
[0075] Calculating the position information of the graphic code in the camera coordinate system according to the pose of the corresponding graphic code configured in the world coordinate system and the pose of the camera to be determined in the world coordinate system.
[0076] Among them, the pose of the camera to be determined in the world coordinate system can be represented by an element in the two-dimensional rigid body motion group.
[0077] There are a total of K poses of the camera to be determined in the world coordinate system, denoted as pose k , where k = 1...K, and the pose of the camera to be determined in the world coordinate system is a series of elements in the two-dimensional rigid body motion group SE(2). The elements in the two-dimensional rigid body motion group SE(2) are three-dimensional real matrices that satisfy certain conditions That is
[0078]
[0079] Among them, x and y represent the position coordinates of the camera, and θ represents the orientation angle of the camera.
[0080] Usually, the poses of the configured graphic codes in the world coordinate system are stored in the graphic code position information configuration file. These poses of the graphic codes in the world coordinate system can usually be obtained by manual measurement or simultaneous localization and mapping (SLAM). Denote the pose of the graphic code in the world coordinate system as posi_world_tagid, which is a two-dimensional vector, and the subscript id represents the identity id of the graphic code, such as 0, 1, 2.
[0081] When specifically implemented, the position information of the graphic code in the camera coordinate system is calculated by the following formula:
[0082] square_posi k (pose k ) = pose k .inv().act(posi_world_tagid);
[0083] Among them, pose k .inv() represents taking the inverse of pose k , that is, pose k.inv() represents the pose of the world coordinate system in the camera coordinate system; then the inverse result is applied to the 2D vector posi_world_tagid, that is, the rotation and translation (R*posi_world_tagid + t) operations are performed on posi_world_tagid to obtain the 2D vector square_posi k . The operations "inv" and "act" are operations owned by the elements in the two-dimensional rigid body motion group SE(2).
[0084] Step 301 is to measure the position information of the acquired graphic code in the camera coordinate system, and step 302 is to calculate the position information of the graphic code in the camera coordinate system according to the configuration information.
[0085] Step 303, measure and obtain the pose change amount of the camera in the world coordinate system between adjacent moments corresponding to the multiple moments through the odometer module.
[0086] Measure and obtain K - 1 pose change amounts through the odometer module. The i-th pose change amount is denoted as: control k, k = 1…K, and a 3D vector is used to represent.
[0087] Obtain K - 1 pose change amounts control k , k = 1…K - 1, through the odometer, and use a 3D vector to represent.
[0088] The pose change amount obtained through the odometer is not completely accurate. Assume the real pose change amount is real_control k . In this embodiment, the covariance of the difference between the measured pose change amount and the real pose change amount can measure the inaccuracy of the obtained pose change amount.
[0089] Therefore, the inaccuracy of the obtained pose change amount can be represented by the second covariance matrix Q, that is, the inaccuracy based on each measured pose change amount of the camera in the world coordinate system is represented by the second covariance matrix; the second covariance matrices corresponding to each measured pose change amount of the camera in the world coordinate system are the same or different, and the second covariance matrix is a diagonal matrix; the values of the diagonal elements are set according to actual applications or experience, and the values of the matrix Q for x and y can be the same or different. For example, in the following, the diagonal values of x and y are the same:
[0090] An example is as follows: Q = diag(0.0001, 0.0001, 0.000001).
[0091] Here, the element values of the diagonal matrix Q are taken as 0.0001, 0.0001, 0.000001 as an example, and there is no restriction on this in practical applications.
[0092] Step 304: Construct a function with the pose of the camera to be determined in the world coordinate system as a variable; wherein, the function is the sum of a first variable and a second variable; the first variable is the deviation degree between the position information of the calculated graphic code in the camera coordinate system and the position information of the measured graphic code in the camera coordinate system; the second variable is the deviation between the pose change amount of the camera to be determined in the world coordinate system and the pose change amount of the measured camera in the world coordinate system.
[0093] Step 305: Solve for the pose of the camera to be determined in the world coordinate system when the function reaches its minimum value; and take the solved pose of the camera to be determined in the world coordinate system as the pose of the camera in the world coordinate system.
[0094] Among them, the deviation degree between the position information is obtained based on the position information of each calculated graphic code in the camera coordinate system, the position information of each measured graphic code in the camera coordinate system, and the corresponding first covariance matrix; it can be expressed by the following formula:
[0095]
[0096] Among them, the deviation between the pose change amounts is obtained based on the pose change amount of each camera to be determined in the world coordinate system, the pose change amount of each measured camera in the world coordinate system, and the corresponding second covariance matrix, and can be expressed by the following formula:
[0097]
[0098] M and Q are diagonal matrices. Here, it is taken as an example that M is the same for the pose of each graphic code in the camera coordinate system, and Q is the same for each pose change amount. If they are different, M k can be used to replace M, and Q k can be used to replace Q.
[0099] Among them, and control k are represented by a 2D vector ; the operator represents the subtraction operation of the two-dimensional rigid body movement group, specifically the right subtraction operation in this application instead of simple matrix subtraction;
[0100] represents the calculation of the two-norm, that is represents the two-norm, that is
[0101] In specific implementation, an optimization function can be established with the pose of the camera in the world coordinate system to be determined as a variable based on the position information of the measured graphic code in the camera coordinate system, the calculated position information of the graphic code in the camera coordinate system, and the measured pose change amount of the camera in the world coordinate system. The pose of the camera in the world coordinate system to be determined that minimizes the value of the optimization function is used as the pose of the camera in the world coordinate system that is determined.
[0102] The established function, that is, based on the sum of the first variable and the second variable of pose k and solve for the pose that minimizes the following function k :
[0103]
[0104] In specific implementation, the pose that minimizes the sum of the first variable and the second variable can be obtained through solution methods such as the Gauss-Newton method, the Levenberg-Marquardt method (LM), the dog-leg method, etc. k , which is the pose of the camera in the world coordinate system. This application embodiment does not limit this.
[0105] Step 305, locate the mobile device according to the determined pose of the camera in the world coordinate system.
[0106] The specific implementation of this step is: locate the mobile device according to the determined pose of the camera in the world coordinate system and the position relationship between the camera and the mobile device carrying the camera.
[0107] In the embodiment of this application, a function is established based on the data obtained by the camera, the data obtained by the odometer, and the pose of the configured graphic code to solve the pose of the camera in the world coordinate system, and then the mobile device is located. This solution can improve the accuracy of mobile device positioning.
[0108] Based on the same inventive concept, an apparatus for locating a mobile device is also provided in the embodiment of this application. Refer to Figure 4 , Figure 4 is a schematic structural diagram of the apparatus for locating a mobile device in the embodiment of this application. The apparatus includes: a first acquisition unit 401, a second acquisition unit 402, a third acquisition unit 403, a calculation unit 404, and a positioning unit 405;
[0109] The first acquisition unit 401 is configured to acquire images containing graphic codes at multiple moments through a camera mounted on the mobile device; and analyze the images to obtain the position information of the measured graphic code in the camera coordinate system;
[0110] A second acquisition unit 402, configured to calculate position information of the graphic code in the camera coordinate system according to the pose of the corresponding graphic code configured in the world coordinate system;
[0111] A third acquisition unit 403, configured to measure and obtain the pose change amount of the camera in the world coordinate system between adjacent moments corresponding to the multiple moments through an odometer module;
[0112] A calculation unit 404, configured to determine the pose of the camera in the world coordinate system according to the position information of the measured graphic code in the camera coordinate system acquired by the first acquisition unit 401, the position information of the graphic code in the camera coordinate system calculated by the second acquisition unit 402, and the pose change amount of the measured camera in the world coordinate system acquired by the third acquisition unit 403;
[0113] The positioning unit 405 is configured to position the mobile device according to the determined pose of the camera in the world coordinate system.
[0114] In another embodiment,
[0115] The calculation unit 504 is specifically configured to construct a function with the pose of the camera to be determined in the world coordinate system as a variable when determining the pose of the camera in the world coordinate system according to the position information of the measured graphic code in the camera coordinate system, the position information of the graphic code in the camera coordinate system calculated, and the pose change amount of the measured camera in the world coordinate system; wherein, the function is the sum of a first variable and a second variable; wherein, the first variable is the deviation degree between the position information of the graphic code in the camera coordinate system calculated and the position information of the measured graphic code in the camera coordinate system; the second variable is the deviation between the pose change amount of the camera to be determined in the world coordinate system and the pose change amount of the measured camera in the world coordinate system; solve for the pose of the camera to be determined in the world coordinate system when the function is at a minimum; and use the solved pose of the camera to be determined in the world coordinate system as the pose of the camera in the world coordinate system.
[0116] In another embodiment,
[0117] The second acquisition unit 402 is specifically configured to calculate the position information of the graphic code in the camera coordinate system according to the pose of the corresponding graphic code configured in the world coordinate system and the pose of the camera to be determined in the world coordinate system.
[0118] In another embodiment,
[0119] The calculation unit 404 is specifically configured to represent the inaccuracy degree of the position information of each measured graphic code in the camera coordinate system through a first covariance matrix; wherein, the first covariance matrix corresponding to the position information of each measured graphic code in the camera coordinate system may be the same or different; and the first covariance matrix is a diagonal matrix; the inaccuracy degree of the pose change amount of each measured camera in the world coordinate system is represented through a second covariance matrix; the second covariance matrix corresponding to the pose change amount of each measured camera in the world coordinate system may be the same or different, and the second covariance matrix is a diagonal matrix; the deviation degree between the position information is calculated based on the position information of each calculated graphic code in the camera coordinate system, the position information of each measured graphic code in the camera coordinate system, and the corresponding first covariance matrix; the deviation between the pose change amounts is calculated based on the pose change amount of each camera to be determined in the world coordinate system, the pose change amount of each measured camera in the world coordinate system, and the corresponding second covariance matrix.
[0120] In another embodiment,
[0121] The calculation unit 404 is specifically configured to represent the pose of the camera to be determined in the world coordinate system by an element in the rigid body transformation group SE(2) of a two-dimensional plane.
[0122] In another embodiment,
[0123] The positioning unit 405 is specifically configured to position the mobile device according to the determined pose of the camera in the world coordinate system and the position relationship between the camera and the mobile device carrying the camera.
[0124] The units in the above embodiments can be integrated into one body or deployed separately; they can be combined into one unit or further split into multiple sub-units.
[0125] In another embodiment, an electronic device is further provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the mobile device positioning method are implemented.
[0126] In another embodiment, a computer-readable storage medium is further provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps in the mobile device positioning method can be implemented.
[0127] Figure 5 This is a schematic diagram of the physical structure of the electronic device provided by the embodiments of the present invention. As Figure 5As shown in the figure, the electronic device may include: a processor 510, a communications interface 520, a memory 530, and a communication bus 540. Among them, the processor 510, the communications interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logical instructions in the memory 530 to execute the following methods:
[0128] Obtain images containing graphic codes at multiple moments through a camera mounted on the mobile device; and analyze the images to obtain the position information of the measured graphic codes in the camera coordinate system;
[0129] Calculate the position information of the graphic codes in the camera coordinate system according to the configured pose of the corresponding graphic codes in the world coordinate system;
[0130] Measure and obtain the pose change amount of the camera in the world coordinate system between adjacent moments corresponding to the multiple moments through an odometer module;
[0131] Determine the pose of the camera in the world coordinate system according to the measured position information of the graphic codes in the camera coordinate system, the calculated position information of the graphic codes in the camera coordinate system, and the measured pose change amount of the camera in the world coordinate system;
[0132] Locate the mobile device according to the determined pose of the camera in the world coordinate system.
[0133] In addition, when the logical instructions in the above-mentioned memory 530 are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0134] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative work.
[0135] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0136] The above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A method for positioning a mobile device, characterized in that, The method includes: Obtaining images containing graphic codes at multiple moments through a camera mounted on a mobile device; and analyzing the images to obtain the position information of the measured graphic codes in the camera coordinate system; Calculating the position information of the graphic codes in the camera coordinate system according to the configured pose of the corresponding graphic codes in the world coordinate system; Measuring and obtaining the pose change amount of the camera in the world coordinate system between adjacent moments corresponding to the multiple moments through an odometer module; Determining the pose of the camera in the world coordinate system according to the measured position information of the graphic codes in the camera coordinate system, the calculated position information of the graphic codes in the camera coordinate system, and the measured pose change amount of the camera in the world coordinate system; wherein, constructing a function with the pose of the camera to be determined in the world coordinate system as a variable; wherein, the function is the sum of a first variable and a second variable; wherein, the first variable is the deviation degree between the calculated position information of the graphic codes in the camera coordinate system and the measured position information of the graphic codes in the camera coordinate system; the second variable is the deviation between the pose change amount of the camera to be determined in the world coordinate system and the measured pose change amount of the camera in the world coordinate system; solving for the pose of the camera to be determined in the world coordinate system when the function is at its minimum; taking the solved pose of the camera to be determined in the world coordinate system as the pose of the camera in the world coordinate system; Locating the mobile device according to the determined pose of the camera in the world coordinate system.
2. The method according to claim 1, characterized in that, The calculating the position information of the graphic codes in the camera coordinate system according to the configured pose of the corresponding graphic codes in the world coordinate system includes: Calculating the position information of the graphic codes in the camera coordinate system according to the configured pose of the corresponding graphic codes in the world coordinate system and the pose of the camera to be determined in the world coordinate system.
3. The method according to claim 1, characterized in that, The method further includes: The inaccuracy degree of each measured position information of the graphic codes in the camera coordinate system is represented by a first covariance matrix; wherein, the first covariance matrices corresponding to the position information of each measured graphic code in the camera coordinate system are the same or different; and the first covariance matrix is a diagonal matrix; The inaccuracy degree of each measured pose change amount of the camera in the world coordinate system is represented by a second covariance matrix; the second covariance matrices corresponding to the pose change amount of each measured camera in the world coordinate system are the same or different, and the second covariance matrix is a diagonal matrix; The deviation degree between the position information is calculated based on each calculated position information of the graphic codes in the camera coordinate system, each measured position information of the graphic codes in the camera coordinate system, and the corresponding first covariance matrix; The deviation between the pose change amounts is calculated based on each pose change amount of the camera to be determined in the world coordinate system, each measured pose change amount of the camera in the world coordinate system, and the corresponding second covariance matrix.
4. The method according to claim 1, characterized in that, Using the elements in the rigid body transformation group SE(2) of the two-dimensional plane to represent the pose of the camera to be determined in the world coordinate system.
5. The method according to any one of claims 1-4, characterized in that, The locating the mobile device according to the determined pose of the camera in the world coordinate system includes: Locate the mobile device according to the determined pose of the camera in the world coordinate system and the positional relationship between the camera and the mobile device carrying the camera.
6. A device for positioning a mobile device, characterized in that, The device includes: a first acquisition unit, a second acquisition unit, a third acquisition unit, a calculation unit, and a positioning unit; The first acquisition unit is configured to acquire images containing graphic codes at multiple moments through a camera mounted on the mobile device; and analyze the acquired images to obtain the position information of the measured graphic codes in the camera coordinate system; The second acquisition unit is configured to calculate the position information of the graphic codes in the camera coordinate system according to the configured pose of the corresponding graphic codes in the world coordinate system; The third acquisition unit is configured to measure and obtain the pose change amount of the camera in the world coordinate system between adjacent moments corresponding to the multiple moments through an odometer module; The calculation unit is configured to determine the pose of the camera in the world coordinate system according to the position information of the measured graphic codes in the camera coordinate system acquired by the first acquisition unit, the position information of the graphic codes in the camera coordinate system calculated by the second acquisition unit, and the pose change amount of the measured camera in the world coordinate system acquired by the third acquisition unit; wherein, when determining the pose of the camera in the world coordinate system according to the position information of the measured graphic codes in the camera coordinate system, the calculated position information of the graphic codes in the camera coordinate system, and the pose change amount of the measured camera in the world coordinate system, construct a function with the pose of the camera to be determined in the world coordinate system as a variable; wherein, the function is the sum of a first variable and a second variable; wherein, the first variable is the deviation degree between the calculated position information of the graphic codes in the camera coordinate system and the measured position information of the graphic codes in the camera coordinate system; the second variable is the deviation between the pose change amount of the camera to be determined in the world coordinate system and the measured pose change amount of the camera in the world coordinate system; solve for the pose of the camera to be determined in the world coordinate system when the function is at its minimum value; and use the solved pose of the camera to be determined in the world coordinate system as the pose of the camera in the world coordinate system; The positioning unit is configured to locate the mobile device according to the determined pose of the camera in the world coordinate system.
7. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method according to any one of claims 1-5.
8. A computer-readable storage medium, on which a computer program is stored, characterized in that, When the program is executed by the processor, it implements the method according to any one of claims 1-5.
Citation Information
Patent Citations
Monocular camera pose estimation method and system
CN113256711A
Robot, indoor positioning method and device and readable storage medium
CN113587934A