Calibration method and device of electronic compass, electronic equipment and readable storage medium

By obtaining the orientation and acceleration information of electronic devices and combining the geomagnetic calculation rotation matrix, hard magnetic calibration of the electronic compass is realized, solving the problems of calibration difficulties and high calculations in the prior art, and achieving accuracy in the non-motion state Calibration and calculations are reduced.

CN119289955APending Publication Date: 2025-01-10VIVO MOBILE COMM CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411096606.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently calibrate the electronic compass without the electronic device moving, and hard magnetic interference calibration requires a large amount of calculation, and the motion amplitude does not match the motion required for calibration, resulting in difficulty in calibration.

Method used

By obtaining the orientation information, acceleration information, first geomagnetic quantity and magnetic field measurement values ​​of the electronic device, the rotation matrix of the system coordinate system converted from the earth coordinate system to the electronic device is determined, the hard magnetic interference value is calculated, and the hard magnetic interference value pair is used based on the hard magnetic interference value. The electronic compass is calibrated to reduce the calculation amount.

Benefits of technology

Accurate hard magnetic calibration of the electronic compass without the electronic device moving is realized, reducing the calculation amount required for hard magnetic calibration, and avoiding real-time sensor data acquisition and large-scale movement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119289955A_ABST
    Figure CN119289955A_ABST
Patent Text Reader

Abstract

The invention discloses a calibration method and device of an electronic compass, electronic equipment and a readable storage medium, and belongs to the technical field of sensors. The calibration method of the electronic compass comprises the following steps: acquiring azimuth information, acceleration information, a first geomagnetic quantity and a magnetic field measurement value of electronic equipment; determining a rotation matrix for converting from an earth coordinate system to a system coordinate system of the electronic equipment according to the azimuth information and the acceleration information; determining a hard magnetic interference value corresponding to the electronic equipment according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value; calibrating an electronic compass in the electronic equipment according to the hard magnetic interference value; wherein the first geomagnetic quantity is an earth magnetic field vector of the electronic equipment in the geographic position, and the magnetic field measurement value is a magnetic field value acquired by a magnetic field sensor in the electronic equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of sensor technology, and specifically relates to a calibration method and device for an electronic compass, an electronic device, and a readable storage medium. Background Art

[0002] Electronic compasses play an important role in the navigation of electronic devices. The basic principle of an electronic compass is to use a magnetometer to measure the earth's magnetic field, and then obtain the actual orientation of the electronic device based on the projection of the earth's magnetic field in the coordinate system of the electronic device. In the actual use of electronic devices, since there are various easily magnetized materials inside the electronic devices, when the electronic devices are close to some relatively large magnetic field interference sources such as headphones, magnets, electrical appliances, and subway gates, the above materials inside the electronic devices are easily magnetized, and then generate magnetic field interference that follows the movement of the electronic device, also known as hard magnetic interference.

[0003] In order to eliminate the hard magnetic interference of electronic devices, it is usually necessary to use sensors such as magnetometers and gyroscopes to collect data, and calculate and eliminate the hard magnetic interference of electronic devices by performing large-scale movements of the electronic devices.

[0004] However, for the above-mentioned method of eliminating hard magnetic interference of electronic devices, on the one hand, it is necessary to use sensors such as magnetometers and gyroscopes to collect data in real time, which requires a large amount of calculation; on the other hand, the electronic device needs to perform large-scale movements for calibration, and the movement amplitude of the electronic device during daily use is often inconsistent with the movement amplitude required for calculating hard magnetic interference, and there may even be a situation where there are no suitable calibration conditions. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a calibration method and device for an electronic compass, an electronic device and a readable storage medium, which can realize hard magnetic calibration of the electronic compass when the electronic device is not moving and reduce the amount of calculation required for hard magnetic calibration.

[0006] In a first aspect, an embodiment of the present application provides a method for calibrating an electronic compass, the method comprising: obtaining orientation information, acceleration information, a first geomagnetic quantity and a magnetic field measurement value of the electronic device; determining a rotation matrix for converting from the earth coordinate system to the system coordinate system of the electronic device based on the orientation information and the acceleration information; determining a hard magnetic interference value corresponding to the electronic device based on the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value; calibrating the electronic compass in the electronic device based on the hard magnetic interference value; wherein the first geomagnetic quantity is the earth's magnetic field vector of the electronic device at its geographical location, and the magnetic field measurement value is the magnetic field value obtained by the magnetic field sensor in the electronic device.

[0007] In a second aspect, an embodiment of the present application provides a calibration device for an electronic compass, the device comprising: an acquisition unit, for acquiring orientation information, acceleration information, a first geomagnetic quantity and a magnetic field measurement value of the electronic device; a processing unit, for determining a rotation matrix for converting from the earth coordinate system to the system coordinate system of the electronic device based on the orientation information and the acceleration information; the processing unit, for determining a hard magnetic interference value corresponding to the electronic device based on the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value; the processing unit, for calibrating the electronic compass in the electronic device based on the hard magnetic interference value; wherein the first geomagnetic quantity is the earth's magnetic field vector of the electronic device at its geographical location, and the magnetic field measurement value is the magnetic field value acquired by the magnetic field sensor in the electronic device.

[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be executed on the processor, and when the programs or instructions are executed by the processor, the steps of the electronic compass calibration method of the first aspect are implemented.

[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a program or instruction stored thereon, which, when executed by a processor, implements the steps of the electronic compass calibration method of the first aspect.

[0010] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the steps of the electronic compass calibration method as in the first aspect.

[0011] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the electronic compass calibration method of the first aspect.

[0012] In the calibration method of the electronic compass provided in the embodiment of the present application, the orientation information, acceleration information, first geomagnetic quantity and magnetic field measurement value of the electronic device are obtained; according to the orientation information and acceleration information, the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system is determined; according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value, the hard magnetic interference value corresponding to the electronic device is determined; according to the hard magnetic interference value, the electronic compass in the electronic device is calibrated; wherein the first geomagnetic quantity is the earth magnetic field vector of the electronic device at the geographical location, and the magnetic field measurement value is the magnetic field value obtained by the magnetic field sensor in the electronic device. Through the above-mentioned calibration method of the electronic compass, based on the orientation information, acceleration information, first geomagnetic quantity and magnetic field measurement value of the electronic device, the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system is determined, and then the hard magnetic interference value corresponding to the electronic device is determined, and the electronic compass in the electronic device is calibrated based on the hard magnetic interference value. In this way, the hard magnetic interference corresponding to the electronic device can be determined by combining the orientation information and geomagnetic information of the electronic device. It is not necessary to rely on real-time sensor data of the electronic device during movement. It can achieve accurate hard magnetic calibration of the electronic compass when the electronic device is not moving, and reduce the amount of calculation required for hard magnetic calibration. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 A schematic diagram of a flow chart of a method for calibrating an electronic compass provided in an embodiment of the present application;

[0014] Figure 2 One of the principle diagrams of the electronic compass calibration method provided in the embodiment of the present application;

[0015] Figure 3 The second schematic diagram of the electronic compass calibration method provided in the embodiment of the present application;

[0016] Figure 4 A structural block diagram of a calibration device for an electronic compass provided in an embodiment of the present application;

[0017] Figure 5 A structural block diagram of an electronic device provided in an embodiment of the present application;

[0018] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0020] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0021] The electronic compass calibration method and device, electronic device and readable storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0022] like Figure 1 As shown, the embodiment of the present application provides a method for calibrating an electronic compass, which may include the following S102 to S108:

[0023] S102: Acquire orientation information, acceleration information, a first geomagnetic quantity, and a magnetic field measurement value of the electronic device.

[0024] The electronic compass calibration method proposed in the embodiment of the present application is executed by an electronic device, and the electronic device may specifically be an intelligent electronic device such as a smart phone, a tablet computer, a laptop computer, and a smart watch, and is not specifically limited here.

[0025] The orientation information of the electronic device may specifically be the heading angle of the electronic device.

[0026] In actual application, the orientation information of the electronic device, i.e., the heading angle information, can be determined by image matching. Specifically, a three-dimensional digital image library, i.e., a geographic image library, similar to a street view is established. When a user uses an electronic device, Figure 2 As shown, the user is guided to use the camera 202 of the electronic device 200 to take a photo, and the photo 204 is stored. Further, in combination with the GPS (Global Positioning System) geographical location information of the electronic device 200, the photo 204 taken is compared with the image in the three-dimensional digital image library, and the image corresponding to the electronic device 200 is matched and searched in the three-dimensional digital image library. After the image corresponding to the electronic device 200 is matched, since the three-dimensional digital image library already contains the orientation information of the image, the orientation information of the electronic device 200 at the time of taking the photo can be obtained, that is, the heading angle of the electronic device 200 at the time of taking the photo can be obtained.

[0027] Furthermore, the above acceleration information is a three-axis acceleration value of the electronic device measured by a three-axis acceleration sensor inside the electronic device.

[0028] Furthermore, the first geomagnetic quantity is the earth's magnetic field vector of the electronic device at its geographical location, and the first geomagnetic quantity is represented by a coordinate value in the earth's coordinate system. In actual application, since the earth's magnetic field on the earth's surface is a fixed model, the first magnetic field quantity can be specifically obtained by querying from a known earth's magnetic field model according to the GPS geographical location information of the electronic device.

[0029] Furthermore, the magnetic field measurement value is a magnetic field value acquired by a magnetic field sensor such as a magnetometer inside the electronic device, and the magnetic field measurement value is represented by a coordinate value in a system coordinate system of the electronic device.

[0030] S104: Determine a rotation matrix for converting from the earth coordinate system to the system coordinate system of the electronic device according to the orientation information and the acceleration information.

[0031] The rotation matrix is ​​a transformation matrix for transforming the earth coordinate system to the system coordinate system of the electronic device. The transformation of the coordinate values ​​in the earth coordinate system to the system coordinate system of the electronic device can be realized based on the rotation matrix.

[0032] Furthermore, the system coordinate system of the electronic device can be used to indicate the spatial position of other objects relative to the electronic device, and the system coordinate system is a three-dimensional coordinate system. In actual application, the system coordinate system can be a three-dimensional coordinate system established based on the screen of the electronic device. For example, the system coordinate system can be a three-dimensional coordinate system established with the top left corner of the screen of the electronic device as the coordinate origin, the direction from the coordinate origin to the right as the positive direction of the X axis, the direction from the coordinate origin to the downward direction as the positive direction of the Y axis, and the direction from the coordinate origin and perpendicular to the screen from the inside to the outside as the positive direction of the Z axis.

[0033] In actual application, the system coordinate system may also be a three-dimensional coordinate system with the geometric center of the electronic device as the coordinate origin, the axes parallel to the boundary of the electronic device as the X-axis and the Y-axis, and the axis perpendicular to the horizontal and vertical coordinate planes as the Z-axis. For the specific form of the system coordinate system, those skilled in the art may set it according to actual conditions, and no specific limitation is made here.

[0034] S106: Determine a hard magnetic interference value corresponding to the electronic device according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value.

[0035] Among them, the above-mentioned hard magnetic interference value is the magnetic field interference value that follows the movement of the electronic device when the electronic device is close to some relatively large magnetic field interference sources such as headphones, magnets, electrical appliances, and subway gates. The easily magnetized materials inside the electronic device are magnetized, and the magnetic field interference value is generated.

[0036] Specifically, in the calibration method of the electronic compass provided in the embodiment of the present application, during the operation of the electronic device, the heading angle of the electronic device, the three-axis acceleration value, the earth's magnetic field vector of the electronic device at the position it is processing, i.e., the first geomagnetic quantity, and the magnetic field value obtained by the magnetic field sensor inside the electronic device, i.e., the magnetic field measurement value, are obtained. Further, based on the heading angle and the three-axis acceleration value of the electronic device, the rotation matrix of the system coordinate system of the electronic device from the earth's coordinate system is determined. Further, according to the determined rotation matrix and the above-mentioned first geomagnetic quantity and magnetic field measurement value, the hard magnetic interference value corresponding to the electronic device is determined. In this way, the hard magnetic interference corresponding to the electronic device is determined in combination with the orientation information and geomagnetic information of the electronic device, without having to rely on the sensor data of the electronic device during the movement, so there is no need to collect sensor data in real time, and there is no need for the electronic device to move significantly, which reduces the amount of calculation in the hard magnetic interference calculation process, and can achieve accurate hard magnetic calibration of the electronic compass without the electronic device moving.

[0037] S108: Calibrate the electronic compass in the electronic device according to the hard magnetic interference value.

[0038] Specifically, in the electronic compass calibration method provided in the embodiment of the present application, after determining the hard magnetic interference value corresponding to the electronic device, the hard magnetic interference value is removed from the measurement data of the electronic compass of the electronic device to calibrate the electronic compass and improve the accuracy of the electronic compass.

[0039] The calibration method of the electronic compass provided in the embodiment of the present application obtains the orientation information, acceleration information, first geomagnetic quantity and magnetic field measurement value of the electronic device; determines the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system according to the orientation information and acceleration information; determines the hard magnetic interference value corresponding to the electronic device according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value; calibrates the electronic compass in the electronic device according to the hard magnetic interference value; wherein the first geomagnetic quantity is the earth magnetic field vector of the electronic device at the geographical location, and the magnetic field measurement value is the magnetic field value obtained by the magnetic field sensor in the electronic device. Through the calibration method of the electronic compass, based on the orientation information, acceleration information, first geomagnetic quantity and magnetic field measurement value of the electronic device, the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system is determined, and then the hard magnetic interference value corresponding to the electronic device is determined. In this way, the hard magnetic interference corresponding to the electronic device is determined in combination with the orientation information and geomagnetic information of the electronic device, without relying on the real-time sensor data of the electronic device during the movement, and can realize the accurate hard magnetic calibration of the electronic compass when the electronic device is not moving, and reduce the calculation amount required for hard magnetic calibration.

[0040] In the embodiment of the present application, the above S104 may specifically include the following S104a to S104c:

[0041] S104a: Determine attitude angle information of the electronic device according to the acceleration information.

[0042] The above-mentioned attitude angle information may specifically be the pitch angle and roll angle of the electronic device.

[0043] In actual application, the acceleration information of the electronic device is the three-axis acceleration value of the electronic device measured by the three-axis acceleration sensor inside the electronic device. The acceleration information of the electronic device can be specifically recorded as acc=[accX, accY, accZ], wherein accX is the acceleration value of the electronic device in the X-axis direction of its system coordinate system, accY is the acceleration value of the electronic device in the Y-axis direction of its system coordinate system, and accZ is the acceleration value of the electronic device in the Z-axis direction of its system coordinate system.

[0044] On this basis, the pitch angle of the electronic device can be specifically determined by the following formula (1):

[0045]

[0046] Among them, pitch represents the pitch angle of the electronic device, and atan2 is a C language (a process-oriented, abstract general-purpose programming language) library function.

[0047] Furthermore, the roll angle of the electronic device can be determined by the following formula (2):

[0048]

[0049] Here, roll represents the roll angle of the electronic device.

[0050] S104b: Determine multiple attitude matrices of the electronic device according to the attitude angle information and the orientation information.

[0051] Among them, the attitude angle information is the pitch angle and roll angle of the electronic device, the azimuth information is the heading angle of the electronic device, and the multiple attitude matrices of the electronic device are specifically attitude matrices corresponding to the heading angle, roll angle and pitch angle of the electronic device respectively.

[0052] In actual application, the attitude matrix of the electronic device corresponding to its heading angle can be specifically expressed by the following formula (3):

[0053]

[0054] Among them, R yaw Represents the attitude matrix of the electronic device corresponding to its heading angle.

[0055] Furthermore, the attitude matrix of the electronic device corresponding to its roll angle can be specifically expressed by the following formula (4):

[0056]

[0057] Among them, R roll Represents the attitude matrix of the electronic device corresponding to its roll angle.

[0058] Furthermore, the attitude matrix of the electronic device corresponding to its pitch angle can be specifically expressed by the following formula (5):

[0059]

[0060] Among them, R pitch Represents the attitude matrix of the electronic device corresponding to its pitch angle.

[0061] S104c: Determine a rotation matrix for converting from the earth coordinate system to the system coordinate system of the electronic device according to the product of the plurality of attitude matrices.

[0062] Specifically, in the calibration method of the electronic compass provided in an embodiment of the present application, after calculating multiple attitude matrices corresponding to the heading angle, roll angle and pitch angle of the electronic device respectively, the rotation matrix of the electronic device corresponding to its heading angle, the attitude matrix of the electronic device corresponding to its roll angle, and the attitude matrix of the electronic device corresponding to its pitch angle are multiplied in sequence to obtain the rotation matrix converted from the earth coordinate system to the system coordinate system of the electronic device.

[0063] That is, the rotation matrix converted from the earth coordinate system to the system coordinate system of the electronic device can be specifically determined by the following formula (6):

[0064]

[0065] in, Represents the rotation matrix from the earth coordinate system to the system coordinate system of the electronic device, R yaw Represents the attitude matrix of the electronic device corresponding to its heading angle, R roll Represents the attitude matrix of the electronic device corresponding to its roll angle, R pitch Represents the attitude matrix of the electronic device corresponding to its pitch angle.

[0066] In the above-mentioned embodiment provided by the present application, in the process of determining the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system according to the orientation information and the acceleration information, the attitude angle information of the electronic device is determined according to the acceleration information; multiple attitude matrices of the electronic device are determined according to the attitude angle information and the orientation information; and the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system is determined according to the product of the multiple attitude matrices. In this way, the attitude of the electronic device is solved in combination with the orientation information and the acceleration information of the electronic device, so as to obtain the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system, thereby ensuring the accuracy of the determined rotation matrix, thereby ensuring the accuracy of the hard magnetic interference corresponding to the electronic device determined based on the rotation matrix.

[0067] In the embodiment of the present application, the above S106 may specifically include the following S106a and S106b:

[0068] S106a: Determine a second geomagnetic quantity of the electronic device according to the product of the rotation matrix and the first geomagnetic quantity.

[0069] The rotation matrix is ​​a transformation matrix for converting the earth coordinate system to the system coordinate system of the electronic device.

[0070] Furthermore, the first geomagnetic quantity is the earth's magnetic field vector of the electronic device at its geographical location, and the first geomagnetic quantity is represented by a coordinate value in the earth's coordinate system.

[0071] Furthermore, the second geomagnetic quantity is a magnetic field value that a magnetic field sensor inside the electronic device should theoretically obtain, and the second geomagnetic quantity is represented by a coordinate value in a system coordinate system of the electronic device.

[0072] S106b: Determine a hard magnetic interference value corresponding to the electronic device according to a difference between the magnetic field measurement value and the second geomagnetic quantity.

[0073] The magnetic field measurement value is the magnetic field value actually acquired by the magnetic field sensor inside the electronic device, and the magnetic field measurement value is represented by a coordinate value in the system coordinate system of the electronic device.

[0074] Specifically, in the calibration method of the electronic compass provided in the embodiment of the present application, after obtaining the earth's magnetic field vector of the electronic device at its geographical location, i.e., the first geomagnetic quantity, the magnetic field value actually obtained by the magnetic field sensor inside the electronic device, i.e., the magnetic field measurement value, and the rotation matrix converted from the earth coordinate system to the system coordinate system of the electronic device, the earth's magnetic field vector, i.e., the second geomagnetic quantity, which the magnetic field sensor inside the electronic device should theoretically obtain, is calculated based on the product of the rotation matrix and the first geomagnetic quantity. Furthermore, based on the perfect circle model of hard magnetic calibration, the hard magnetic interference value corresponding to the electronic device is determined according to the difference between the magnetic field measurement value and the second geomagnetic quantity. In this way, the hard magnetic interference corresponding to the electronic device is determined in combination with the posture of the electronic device and the geomagnetic information, without having to rely on the real-time sensor data of the electronic device during movement, so that the electronic compass can be accurately calibrated hard magnetically without moving the electronic device, and the amount of calculation required for hard magnetic calibration can be reduced.

[0075] In the above-mentioned embodiments provided by the present application, in the process of determining the hard magnetic interference value corresponding to the electronic device according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value, the second geomagnetic quantity of the electronic device is determined according to the product of the rotation matrix and the first geomagnetic quantity; the hard magnetic interference value corresponding to the electronic device is determined according to the difference between the magnetic field measurement value and the second geomagnetic quantity. In this way, the hard magnetic interference corresponding to the electronic device is determined in combination with the posture of the electronic device and the geomagnetic information, without having to rely on the real-time sensor data of the electronic device during the movement, so that the electronic compass can be accurately calibrated without moving the electronic device, and the amount of calculation required for hard magnetic calibration can be reduced.

[0076] In the embodiment of the present application, the hard magnetic interference value corresponding to the electronic device can be determined according to the following formula (7):

[0077]

[0078] Among them, B offset Indicates the hard magnetic interference value corresponding to the electronic equipment, B measure represents the magnetic field measurement value, represents the rotation matrix from the earth coordinate system to the system coordinate system of the electronic device, B earth Represents the first geomagnetic quantity.

[0079] It can be understood that the core principle of the perfect circle model of hard magnetic calibration is: the spherical center offset caused by the fixed magnetic field interference in the electronic device, namely the hard magnetic interference value, is superimposed with the earth's magnetic field vector that the magnetic field sensor inside the electronic device should theoretically obtain, and together constitutes the magnetic field value actually obtained by the magnetic field sensor inside the electronic device. That is, the magnetic field value actually obtained by the magnetic field sensor inside the electronic device, namely the magnetic field measurement value, is the sum of the hard magnetic interference value corresponding to the electronic device and the magnetic field value that the magnetic field sensor inside the electronic device should theoretically obtain, namely the second geomagnetic quantity.

[0080] That is, the magnetic field value actually acquired by the magnetic field sensor inside the electronic device, i.e., the magnetic field measurement value, can be specifically expressed by the following formula (8):

[0081]

[0082] Among them, B earth =[B 1 , B 2 , B 3 ], B 1 Represents the magnetic field vector in the X-axis direction of the earth coordinate system, B 2 Represents the magnetic field vector in the Y-axis direction of the earth coordinate system, B 3 Represents the magnetic field vector in the Z-axis direction of the earth coordinate system.

[0083] On this basis, given the known magnetic field measurement value B measure , rotation matrix and the first geomagnetic quantity B earth In the case of, the hard magnetic interference value B corresponding to the electronic device can be calculated by the above formula (7) offset .

[0084] In the above embodiments provided in the present application, the hard magnetic interference value corresponding to the electronic device is determined according to the following formula: Among them, B offset Indicates the hard magnetic interference value corresponding to the electronic equipment, B measure represents the magnetic field measurement value, represents the rotation matrix from the earth coordinate system to the system coordinate system of the electronic device, B earth In this way, the hard magnetic interference corresponding to the electronic device is determined by combining the posture of the electronic device and the geomagnetic information, without having to rely on the real-time sensor data of the electronic device during movement. When the electronic device is not moving, accurate hard magnetic calibration of the electronic compass can be achieved, and the amount of calculation required for hard magnetic calibration can be reduced.

[0085] In summary, if Figure 3As shown, the system framework of the electronic compass calibration method provided in the embodiment of the present application may specifically include a three-dimensional digital image library 302, an image matching module 304, a posture calculation module 306, and a hard magnetic interference solution module 308. In the process of determining the hard magnetic interference corresponding to the electronic device, such as Figure 3 As shown, the user is guided to use the camera of the electronic device to take pictures, and the image matching module 304 matches and searches for the image corresponding to the electronic device in the three-dimensional digital image library 302 according to the photographed photo, and then obtains the heading angle of the electronic device at the time of taking the photo according to the image corresponding to the electronic device. Further, the attitude calculation module 306 solves the attitude of the electronic device according to the heading angle and acceleration information of the electronic device, and obtains the rotation matrix converted from the earth coordinate system to the system coordinate system of the electronic device. Further, based on the perfect circle model of hard magnetic calibration, the hard magnetic interference solving module 308 determines the hard magnetic interference value corresponding to the electronic device according to the calculated rotation matrix, the earth magnetic field vector of the electronic device at its geographical location, and the magnetic field value obtained by the magnetic field sensor inside the electronic device.

[0086] Based on this, the electronic compass calibration method provided in the embodiment of the present application calculates the posture information of the electronic device by image matching, and then calculates the hard magnetic interference size corresponding to the electronic device by using the posture information of the electronic device and the geomagnetic information. In this way, there is no need to rely on the real-time sensor data of the electronic device for motion fitting, and it is possible to achieve accurate hard magnetic calibration of the electronic compass when the electronic device is not moving, and reduce the amount of calculation required for hard magnetic calibration.

[0087] The electronic compass calibration method provided in the embodiment of the present application can be executed by an electronic compass calibration device. In the embodiment of the present application, the electronic compass calibration device performing the electronic compass calibration method is taken as an example to illustrate the electronic compass calibration device provided in the embodiment of the present application.

[0088] like Figure 4 As shown, an embodiment of the present application provides a calibration device 400 for an electronic compass, and the device may include the following acquisition unit 402 and processing unit 404.

[0089] An acquisition unit 402 is used to acquire the orientation information, acceleration information, first geomagnetic quantity and magnetic field measurement value of the electronic device;

[0090] The processing unit 404 is used to determine a rotation matrix for converting from the earth coordinate system to the system coordinate system of the electronic device according to the orientation information and the acceleration information;

[0091] The processing unit 404 is further used to determine a hard magnetic interference value corresponding to the electronic device according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value;

[0092] The processing unit 404 is further used to calibrate the electronic compass in the electronic device according to the hard magnetic interference value;

[0093] The first geomagnetic quantity is the earth's magnetic field vector at the geographical location of the electronic device, and the magnetic field measurement value is the magnetic field value obtained by the magnetic field sensor in the electronic device.

[0094] The electronic compass calibration device 400 provided in the embodiment of the present application obtains the orientation information, acceleration information, first geomagnetic quantity and magnetic field measurement value of the electronic device; determines the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system according to the orientation information and acceleration information; determines the hard magnetic interference value corresponding to the electronic device according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value; calibrates the electronic compass in the electronic device according to the hard magnetic interference value; wherein the first geomagnetic quantity is the earth magnetic field vector of the electronic device at the geographical location, and the magnetic field measurement value is the magnetic field value obtained by the magnetic field sensor in the electronic device. Through the above-mentioned electronic compass calibration device 400, based on the orientation information, acceleration information, first geomagnetic quantity and magnetic field measurement value of the electronic device, the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system is determined, and then the hard magnetic interference value corresponding to the electronic device is determined, and the electronic compass in the electronic device is calibrated based on the hard magnetic interference value. In this way, the hard magnetic interference corresponding to the electronic device can be determined by combining the orientation information and geomagnetic information of the electronic device. It is not necessary to rely on real-time sensor data of the electronic device during movement. It can achieve accurate hard magnetic calibration of the electronic compass when the electronic device is not moving, and reduce the amount of calculation required for hard magnetic calibration.

[0095] In an embodiment of the present application, the processing unit 404 is specifically used to: determine the attitude angle information of the electronic device based on the acceleration information; determine multiple attitude matrices of the electronic device based on the attitude angle information and the orientation information; and determine the rotation matrix for converting from the earth coordinate system to the system coordinate system of the electronic device based on the product of multiple attitude matrices.

[0096] In the above-mentioned embodiment provided by the present application, in the process of determining the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system according to the orientation information and the acceleration information, the attitude angle information of the electronic device is determined according to the acceleration information; multiple attitude matrices of the electronic device are determined according to the attitude angle information and the orientation information; and the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system is determined according to the product of the multiple attitude matrices. In this way, the attitude of the electronic device is solved in combination with the orientation information and the acceleration information of the electronic device, so as to obtain the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system, thereby ensuring the accuracy of the determined rotation matrix, thereby ensuring the accuracy of the hard magnetic interference corresponding to the electronic device determined based on the rotation matrix.

[0097] In the embodiment of the present application, the processing unit 404 is specifically used to: determine the second geomagnetic quantity of the electronic device according to the product of the rotation matrix and the first geomagnetic quantity; determine the hard magnetic interference value corresponding to the electronic device according to the difference between the magnetic field measurement value and the second geomagnetic quantity.

[0098] In the above-mentioned embodiment provided by the present application, in the process of determining the hard magnetic interference value corresponding to the electronic device according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value, the second geomagnetic quantity of the electronic device is determined according to the product of the rotation matrix and the first geomagnetic quantity; the hard magnetic interference value corresponding to the electronic device is determined according to the difference between the magnetic field measurement value and the second geomagnetic quantity. In this way, the hard magnetic interference corresponding to the electronic device is determined in combination with the posture of the electronic device and the geomagnetic information, without having to rely on the real-time sensor data of the electronic device during the movement, so that the electronic compass can be accurately calibrated without moving the electronic device, and the amount of calculation required for hard magnetic calibration can be reduced.

[0099] In the embodiment of the present application, the hard magnetic interference value corresponding to the electronic device is determined according to the following formula: Among them, B offset Indicates the hard magnetic interference value corresponding to the electronic equipment, B measure represents the magnetic field measurement value, represents the rotation matrix from the earth coordinate system to the system coordinate system of the electronic device, B earth Represents the first geomagnetic quantity.

[0100] In the above embodiments provided in the present application, the hard magnetic interference value corresponding to the electronic device is determined according to the following formula: Among them, B offset Indicates the hard magnetic interference value corresponding to the electronic equipment, B measure represents the magnetic field measurement value, represents the rotation matrix from the earth coordinate system to the system coordinate system of the electronic device, B earth In this way, the hard magnetic interference corresponding to the electronic device is determined by combining the posture of the electronic device and the geomagnetic information, without having to rely on the real-time sensor data of the electronic device during movement. When the electronic device is not moving, accurate hard magnetic calibration of the electronic compass can be achieved, and the amount of calculation required for hard magnetic calibration can be reduced.

[0101] The calibration device 400 of the electronic compass in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0102] The electronic compass calibration device 400 in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0103] The electronic compass calibration device 400 provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0104] Alternatively, if Figure 5 As shown, an embodiment of the present application further provides an electronic device 500, including a processor 502 and a memory 504, wherein the memory 504 stores programs or instructions that can be executed on the processor 502, and when the program or instructions are executed by the processor 502, the various steps of the above-mentioned electronic compass calibration method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0105] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0106] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0107] The electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610 and other components.

[0108] Those skilled in the art will appreciate that the electronic device 600 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 610 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0109] The processor 610 is used to obtain the orientation information, acceleration information, first geomagnetic quantity and magnetic field measurement value of the electronic device.

[0110] The processor 610 is further configured to determine a rotation matrix for converting from the earth coordinate system to the system coordinate system of the electronic device according to the orientation information and the acceleration information.

[0111] The processor 610 is further configured to determine a hard magnetic interference value corresponding to the electronic device according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value.

[0112] The processor 610 is further configured to calibrate an electronic compass in the electronic device according to the hard magnetic interference value.

[0113] The first geomagnetic quantity is the earth's magnetic field vector at the geographical location of the electronic device, and the magnetic field measurement value is the magnetic field value obtained by the magnetic field sensor in the electronic device.

[0114] In an embodiment of the present application, the orientation information, acceleration information, first geomagnetic quantity and magnetic field measurement value of the electronic device are obtained; according to the orientation information and acceleration information, the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system is determined; according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value, the hard magnetic interference value corresponding to the electronic device is determined; according to the hard magnetic interference value, the electronic compass in the electronic device is calibrated; wherein the first geomagnetic quantity is the earth magnetic field vector of the electronic device at the geographical location, and the magnetic field measurement value is the magnetic field value obtained by the magnetic field sensor in the electronic device. In an embodiment of the present application, based on the orientation information, acceleration information, first geomagnetic quantity and magnetic field measurement value of the electronic device, the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system is determined, and then the hard magnetic interference value corresponding to the electronic device is determined, and the electronic compass in the electronic device is calibrated based on the hard magnetic interference value. In this way, the hard magnetic interference corresponding to the electronic device is determined in combination with the orientation information and geomagnetic information of the electronic device, without relying on the real-time sensor data of the electronic device during the movement, and can realize the accurate hard magnetic calibration of the electronic compass when the electronic device is not moving, and reduce the calculation amount required for hard magnetic calibration.

[0115] Optionally, the processor 610 is specifically used to: determine the attitude angle information of the electronic device according to the acceleration information; determine multiple attitude matrices of the electronic device according to the attitude angle information and the orientation information; and determine the rotation matrix for converting from the earth coordinate system to the system coordinate system of the electronic device according to the product of multiple attitude matrices.

[0116] In the above-mentioned embodiment provided by the present application, in the process of determining the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system according to the orientation information and the acceleration information, the attitude angle information of the electronic device is determined according to the acceleration information; multiple attitude matrices of the electronic device are determined according to the attitude angle information and the orientation information; and the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system is determined according to the product of the multiple attitude matrices. In this way, the attitude of the electronic device is solved in combination with the orientation information and the acceleration information of the electronic device, so as to obtain the rotation matrix of the system coordinate system of the electronic device from the earth coordinate system, thereby ensuring the accuracy of the determined rotation matrix, thereby ensuring the accuracy of the hard magnetic interference corresponding to the electronic device determined based on the rotation matrix.

[0117] Optionally, the processor 610 is specifically used to: determine the second geomagnetic quantity of the electronic device according to the product of the rotation matrix and the first geomagnetic quantity; determine the hard magnetic interference value corresponding to the electronic device according to the difference between the magnetic field measurement value and the second geomagnetic quantity.

[0118] In the above-mentioned embodiments provided by the present application, in the process of determining the hard magnetic interference value corresponding to the electronic device according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value, the second geomagnetic quantity of the electronic device is determined according to the product of the rotation matrix and the first geomagnetic quantity; the hard magnetic interference value corresponding to the electronic device is determined according to the difference between the magnetic field measurement value and the second geomagnetic quantity. In this way, the hard magnetic interference corresponding to the electronic device is determined in combination with the posture of the electronic device and the geomagnetic information, without having to rely on the real-time sensor data of the electronic device during the movement, so that the electronic compass can be accurately calibrated without moving the electronic device, and the amount of calculation required for hard magnetic calibration can be reduced.

[0119] Optionally, the hard magnetic interference value corresponding to the electronic device is determined according to the following formula: Among them, B offset Indicates the hard magnetic interference value corresponding to the electronic equipment, B measure represents the magnetic field measurement value, represents the rotation matrix from the earth coordinate system to the system coordinate system of the electronic device, B earth Represents the first geomagnetic quantity.

[0120] In the above embodiments provided in the present application, the hard magnetic interference value corresponding to the electronic device is determined according to the following formula: Among them, B offset Indicates the hard magnetic interference value corresponding to the electronic equipment, B measure represents the magnetic field measurement value, represents the rotation matrix from the earth coordinate system to the system coordinate system of the electronic device, B earth In this way, the hard magnetic interference corresponding to the electronic device is determined by combining the posture of the electronic device and the geomagnetic information, without having to rely on the real-time sensor data of the electronic device during movement. When the electronic device is not moving, accurate hard magnetic calibration of the electronic compass can be achieved, and the amount of calculation required for hard magnetic calibration can be reduced.

[0121] It should be understood that in the embodiment of the present application, the input unit 604 may include a graphics processor (GPU) 6041 and a microphone 6042, and the graphics processor 6041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes a touch panel 6071 and at least one of other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0122] The memory 609 can be used to store software programs and various data. The memory 609 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 609 may include a volatile memory or a non-volatile memory, or the memory 609 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 609 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0123] The processor 610 may include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 610.

[0124] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned electronic compass calibration method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0125] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0126] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned electronic compass calibration method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0127] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0128] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned electronic compass calibration method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0129] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0130] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0131] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for calibrating an electronic compass, characterized in that: include: Acquiring orientation information, acceleration information, a first geomagnetic quantity, and a magnetic field measurement value of the electronic device; Determine a rotation matrix for converting from an earth coordinate system to a system coordinate system of the electronic device according to the orientation information and the acceleration information; Determining a hard magnetic interference value corresponding to the electronic device according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value; Calibrate the electronic compass in the electronic device according to the hard magnetic interference value; The first geomagnetic quantity is the earth's magnetic field vector at the geographical location of the electronic device, and the magnetic field measurement value is the magnetic field value obtained by the magnetic field sensor in the electronic device.

2. The electronic compass calibration method according to claim 1, characterized in that: The step of determining a rotation matrix for converting from an earth coordinate system to a system coordinate system of the electronic device according to the orientation information and the acceleration information comprises: Determining attitude angle information of the electronic device according to the acceleration information; Determine a plurality of attitude matrices of the electronic device according to the attitude angle information and the orientation information; The rotation matrix for converting from the earth coordinate system to the system coordinate system of the electronic device is determined according to the product of a plurality of the posture matrices.

3. The electronic compass calibration method according to claim 1, characterized in that: The step of determining the hard magnetic interference value corresponding to the electronic device according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value comprises: Determine a second geomagnetic quantity of the electronic device according to the product of the rotation matrix and the first geomagnetic quantity; The hard magnetic interference value corresponding to the electronic device is determined according to the difference between the magnetic field measurement value and the second geomagnetic quantity.

4. The method for calibrating an electronic compass according to any one of claims 1 to 3, characterized in that: The hard magnetic interference value corresponding to the electronic device is determined according to the following formula: Among them, B offset represents the hard magnetic interference value corresponding to the electronic device, B measure represents the magnetic field measurement value, represents the rotation matrix converted from the earth coordinate system to the system coordinate system of the electronic device, B earth represents the first geomagnetic quantity.

5. A calibration device for an electronic compass, characterized in that: include: An acquisition unit, used to acquire the orientation information, acceleration information, first geomagnetic quantity and magnetic field measurement value of the electronic device; A processing unit, configured to determine a rotation matrix for converting from an earth coordinate system to a system coordinate system of the electronic device according to the orientation information and the acceleration information; The processing unit is further used to determine a hard magnetic interference value corresponding to the electronic device according to the rotation matrix, the first geomagnetic quantity and the magnetic field measurement value; The processing unit is further used to calibrate the electronic compass in the electronic device according to the hard magnetic interference value; The first geomagnetic quantity is the earth's magnetic field vector at the geographical location of the electronic device, and the magnetic field measurement value is the magnetic field value obtained by the magnetic field sensor in the electronic device.

6. The electronic compass calibration device according to claim 5, characterized in that: The processing unit is specifically used for: Determining attitude angle information of the electronic device according to the acceleration information; Determine a plurality of attitude matrices of the electronic device according to the attitude angle information and the orientation information; The rotation matrix for converting from the earth coordinate system to the system coordinate system of the electronic device is determined according to the product of a plurality of the posture matrices.

7. The electronic compass calibration device according to claim 5, characterized in that: The processing unit is specifically used for: Determine a second geomagnetic quantity of the electronic device according to the product of the rotation matrix and the first geomagnetic quantity; The hard magnetic interference value corresponding to the electronic device is determined according to the difference between the magnetic field measurement value and the second geomagnetic quantity.

8. The electronic compass calibration device according to any one of claims 5 to 7, characterized in that: The hard magnetic interference value corresponding to the electronic device is determined according to the following formula: Among them, B offset represents the hard magnetic interference value corresponding to the electronic device, B measure represents the magnetic field measurement value, represents the rotation matrix converted from the earth coordinate system to the system coordinate system of the electronic device, B earth represents the first geomagnetic quantity.

9. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the electronic compass calibration method according to any one of claims 1 to 4 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the electronic compass calibration method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Local real-time calibration method and device for electronic compass

    CN108426571A

  • Magnetic sensor calibration method and device, electronic equipment and computer storage medium

    CN111982155A

  • Geomagnetic sensor real-time correction algorithm introducing GPS auxiliary information

    CN116878539A

  • Method and system for obtaining river flow velocity based on unmanned aerial vehicle, and electronic equipment

    CN117968645A

  • Magnetic deviation determination using mobile devices

    US20120155770A1