WO2024083082A1 - 指南针校准方法及装置、电子设备和可读存储介质 - Google Patents

指南针校准方法及装置、电子设备和可读存储介质 Download PDF

Info

Publication number
WO2024083082A1
WO2024083082A1 PCT/CN2023/124769 CN2023124769W WO2024083082A1 WO 2024083082 A1 WO2024083082 A1 WO 2024083082A1 CN 2023124769 W CN2023124769 W CN 2023124769W WO 2024083082 A1 WO2024083082 A1 WO 2024083082A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
time
information
sun
relative
Prior art date
Application number
PCT/CN2023/124769
Other languages
English (en)
French (fr)
Inventor
韩桐
余梓玲
Original Assignee
维沃移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 维沃移动通信有限公司 filed Critical 维沃移动通信有限公司
Publication of WO2024083082A1 publication Critical patent/WO2024083082A1/zh

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C17/00Compasses; Devices for ascertaining true or magnetic north for navigation or surveying purposes
    • G01C17/38Testing, calibrating, or compensating of compasses

Definitions

  • the present application belongs to the field of electronic technology, and specifically relates to a compass calibration method and device, an electronic device and a readable storage medium.
  • an electronic compass in the electronic device such as a magnetoresistive sensor, is usually used to sense the geomagnetic field information, and then the direction is indicated by converting the geomagnetic field information into a digital signal and setting the direction of the analog pointer according to the digital signal.
  • the terminal compass is greatly affected by the environmental magnetic field when indicating the direction and calibrating the indicated direction.
  • the terminal compass is interfered by the environmental magnetic field, and the accuracy of its indicated direction is reduced.
  • the calibration results of traditional calibration methods such as moving the electronic device along a preset trajectory are also interfered by the environmental magnetic field, and the accuracy of the calibration results is low, and the terminal compass cannot correctly indicate the direction.
  • the purpose of the embodiments of the present application is to provide a compass calibration method and device, an electronic device and a readable storage medium, which can avoid the influence of the environmental magnetic field on the compass calibration result and improve the accuracy of the compass calibration result and the indicated direction.
  • an embodiment of the present application provides a compass calibration method, the method comprising: acquiring a target image, the target image including the sun, and the shooting time of the target image being a first time; determining first relative position information of the sun relative to the electronic device at the first time based on the target image; obtaining first actual position information of the sun at the first time and the geographical location based on the geographical location of the electronic device and the first time; determining the posture information of the electronic device based on the first actual position information and the first relative position information, and calibrating the indicated direction of the compass based on the posture information.
  • an embodiment of the present application provides a compass calibration device, which includes: an acquisition module, used to acquire a target image, the target image includes the sun, and the shooting time of the target image is a first time; a first determination module, used to determine, based on the target image, a first relative position information of the sun relative to the electronic device at the first time; a second determination module, used to obtain, based on the geographical location of the electronic device and the first time, a first actual position information of the sun at the first time and the geographical location; a calculation module, used to determine the posture information of the electronic device based on the first actual position information and the first relative position information; a calibration module, used to calibrate the indicated position of the compass based on the posture information.
  • 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 run on the processor, and when the programs or instructions are executed by the processor, the steps of the compass calibration method of the first aspect are implemented.
  • 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 compass calibration method of the first 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 compass calibration method of the first 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 compass calibration method of the first aspect.
  • a target image is obtained, the target image includes the sun, and the shooting time of the target image is the first time, and then the first relative azimuth information of the sun relative to the electronic device at the first time is determined according to the target image.
  • the first actual azimuth information of the sun at the first time and the geographical location is obtained according to the geographical location of the electronic device and the first time.
  • the posture information of the electronic device is determined according to the first actual azimuth information and the first relative azimuth information, and then the indicated azimuth of the compass is calibrated according to the posture information.
  • the first relative azimuth information of the sun at the first time relative to the electronic device is determined by the target image of the sun captured at the first time, and the first actual azimuth information of the sun relative to the geographical location where the electronic device is located when the target image is captured is determined.
  • the posture information of the electronic device at the first time is determined according to the association relationship between the above-mentioned first actual azimuth information and the first relative azimuth information, and then the indicated azimuth of the compass is calibrated according to the posture information.
  • the compass's indicated direction is calibrated based on the actual direction information of the sun and the relative direction information of the sun to the electronic device obtained by taking pictures of the sun, avoiding the influence of the ambient magnetic field on the compass's calibration results, thereby ensuring the accuracy of the compass's calibration results and the accuracy of the compass's indicated direction.
  • FIG1 is a flow chart of a compass calibration method provided in an embodiment of the present application.
  • FIG2 is one of the operation interface diagrams of the compass calibration method provided in an embodiment of the present application.
  • FIG3 is a second operation interface diagram of the compass calibration method provided in an embodiment of the present application.
  • FIG4 is a third operation interface diagram of the compass calibration method provided in an embodiment of the present application.
  • FIG5 is a fourth operation interface diagram of the compass calibration method provided in an embodiment of the present application.
  • FIG6 is a fifth operation interface diagram of the compass calibration method provided in an embodiment of the present application.
  • FIG7 is one of the principle diagrams of the compass calibration method provided in an embodiment of the present application.
  • FIG8 is a second schematic diagram of the compass calibration method provided in an embodiment of the present application.
  • FIG9 is a third schematic diagram of the compass calibration method provided in an embodiment of the present application.
  • FIG10 is a structural block diagram of a compass calibration device provided in an embodiment of the present application.
  • FIG11 is a structural block diagram of an electronic device provided in an embodiment of the present application.
  • FIG. 12 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
  • first, second, etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first”, “second”, etc. are generally of one type, and the number of objects is not limited.
  • the first object can be one or more.
  • “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.
  • the embodiment of the first aspect of the present application proposes a compass calibration method.
  • the technical solution of the compass calibration method provided in the embodiment of the present application can be implemented by a compass calibration device, which can be determined according to actual use requirements and is not limited in the embodiment of the present application.
  • the following method embodiment uses the implementation of the compass calibration method as a compass calibration device for exemplary description.
  • an embodiment of the present application provides a compass calibration method, which may include the following S102 to S108:
  • the compass calibration method proposed in the embodiment of the present application is applied to an electronic device, and the electronic device includes a compass application program, namely, a terminal compass.
  • the shooting time of the above-mentioned target image is the first time.
  • the main object of the target image is the sun.
  • the sun may be located in the target area of the target image.
  • the coordinate position of the target area in the system coordinate system of the electronic device is known. In this way, the step of determining the position coordinates of the sun in the target image during the calibration process can be reduced, thereby reducing the amount of calculation in the process of calibrating the indicated direction of the compass, thereby improving the timeliness of the calibration of the compass.
  • the user when calibrating the indicated direction of the compass, the user takes a photo of the sun through an electronic device.
  • the user adjusts the electronic device to a target posture so that the sun image is located at a target position on the shooting interface, so that in the captured target image containing the sun, the sun image is located within the target area of the target image.
  • the electronic equipment should remain stable to avoid shaking of the electronic equipment to ensure the clarity of the captured solar image, thereby ensuring the accuracy of the data to be analyzed when the target image is subsequently analyzed and processed.
  • S104 Determine first relative position information of the sun relative to the electronic device at a first time according to the target image.
  • the first relative azimuth angle, solar altitude angle and other information in the target image are analyzed to determine the first relative azimuth information of the sun relative to the electronic device when the target image is captured, i.e., at the first time.
  • S106 Obtain first actual position information of the sun at the first time and the geographical location according to the geographical location of the electronic device and the first time.
  • the first time is the time when the user calibrates the compass application in the electronic device, that is, the time when the user takes the target image of the sun.
  • the first time may specifically include the date information and the time information when the user takes the target image of the sun.
  • a positioning device is provided in the electronic device, and the geographical location of the electronic device can be determined by obtaining the longitude and latitude information of the area where the user carries the electronic device when the user takes a target image of the sun through the electronic device through the positioning device.
  • an electronic device that includes a compass application, i.e., a terminal compass, in the process of calibrating the indicated direction of the terminal compass, when a user's calibration operation on the compass application in the electronic device is received, that is, when a target image of the sun is captured by the electronic device, the geographic location information of the electronic device is acquired in real time, and then combined with the time when the target image is captured, i.e., the first time, and the geographic location information of the electronic device, the first actual direction information of the sun relative to the geographic location of the electronic device at the first time is determined, so that the indicated direction of the compass in the electronic device can be calibrated subsequently according to the first actual direction information.
  • a compass application i.e., a terminal compass
  • S108 Determine the posture information of the electronic device according to the first actual orientation information and the first relative orientation information, and calibrate the indicated orientation of the compass according to the posture information.
  • the first actual position information is the actual position information of the sun relative to the geographical location of the electronic device at the first time, and the first actual position information can be used to indicate the actual position of the sun relative to the earth.
  • the first relative position information is the relative position information of the sun relative to the electronic device at the first time, and the first relative position information can be used to indicate the relative position of the sun relative to the electronic device.
  • the above-mentioned first actual position information and the above-mentioned first relative position information can be converted to each other.
  • the conversion relationship can represent the position information of the electronic device relative to the surface of the earth at the above-mentioned first time, that is, the posture information of the electronic device when shooting the above-mentioned target image.
  • the four directions of east, west, south and north in the electronic device at the first time can be determined, and then the indicated direction of the compass in the electronic device can be calibrated according to the determined four directions of east, west, south and north.
  • the first relative direction information of the sun relative to the electronic device at the first time is determined by the target image of the sun captured at the first time.
  • the first actual direction information of the sun relative to the geographical location of the electronic device at the first time is obtained.
  • the posture information of the electronic device at the first time is determined, and the four directions of east, west, south, and north in the electronic device at the above-mentioned first time are determined according to the posture information, and then the indicated direction of the compass in the electronic device is calibrated by the determined four directions of east, west, south, and north in the electronic device.
  • the electronic device is provided with a gyroscope, a gravity sensor and other parts that can be used to determine the rotation angle, tilt angle, moving distance and other movement information of the electronic device.
  • the parts can record the movement information of the electronic device in real time.
  • the four directions of the electronic device can be adjusted in real time according to the four directions of the electronic device at the first time and the movement information of the electronic device, and then the indicated direction of the compass in the electronic device can be calibrated in real time through the four directions of the electronic device.
  • the first relative azimuth information of the sun relative to the electronic device at the first time is determined by the target image of the sun captured at the first time, and the first actual azimuth information of the sun relative to the geographical location of the electronic device when the target image is captured is determined.
  • the posture information of the electronic device at the first time is determined, and then the indicated azimuth of the compass is calibrated according to the posture information.
  • the indicated azimuth of the compass is calibrated based on the actual azimuth information of the sun and the relative azimuth information of the sun to the electronic device obtained by capturing the sun image, so as to avoid the calibration result of the compass being affected by the environmental magnetic field, thereby ensuring the accuracy of the calibration result of the compass and the accuracy of the indicated azimuth of the compass.
  • the above S104 may specifically include the following S104a
  • the above S106 may specifically include the following S106a:
  • S104a Determine a relative altitude angle and a relative azimuth angle of the sun relative to the electronic device at a first time according to the target image, and determine the relative altitude angle and the relative azimuth angle as first relative azimuth information.
  • the relative position of the sun relative to the electronic device at the above-mentioned first time is determined by analyzing and processing the target image.
  • the information such as the solar azimuth angle and the solar altitude angle in the target image is analyzed to determine the relative solar altitude angle and the relative solar azimuth angle of the sun relative to the electronic device at the first time, and the relative solar altitude angle and the relative solar azimuth angle are used to determine the above-mentioned first relative orientation information.
  • S106a Obtain the actual altitude angle and actual azimuth angle of the sun at the first time and the geographical location according to the geographical location of the electronic device and the first time, and determine the actual altitude angle and the actual azimuth angle as first actual azimuth information.
  • the measured solar altitude angle, solar azimuth angle and other information are related to the longitude and latitude of the position, the test date and the test time. Specifically, for the same position, the solar altitude angle and the solar azimuth angle at the position measured on different dates or at different times are different; for the same time on the same date, the solar altitude angle and the solar azimuth angle measured at different positions are different. Therefore, in combination with the longitude and latitude information of the measurement position, the measurement date, the measurement time and other information, the solar altitude angle and the solar azimuth angle and other information in the measurement area can be determined.
  • the longitude and latitude information of the geographical location of the electronic device is obtained in real time by the positioning device in the electronic device, and at the same time, the date information and time information when the user captures the target image are obtained.
  • the actual solar altitude angle and actual solar azimuth angle of the sun at the geographical location of the electronic device at the first time are determined according to the acquired longitude and latitude information, date information and time information, and the actual solar altitude angle and actual solar azimuth angle are determined as the above-mentioned first actual azimuth information.
  • the association between the three information of longitude and latitude information, date information and time information and the solar altitude angle and solar azimuth angle can be pre-stored in the electronic device, so that the electronic device can directly retrieve the association relationship to determine the actual solar altitude angle and the actual solar azimuth angle of the sun relative to the geographical location of the electronic device at the first time.
  • the networking function of the electronic device when determining the actual solar altitude angle and the actual solar azimuth angle, the networking function of the electronic device can also be turned on. After obtaining the longitude and latitude information, date information and time information when the user takes the target image, the actual solar altitude angle and the actual solar azimuth angle corresponding to the longitude and latitude information, date information and time information can be searched in real time.
  • the above-mentioned embodiment provided by the present application determines the relative altitude angle and relative azimuth angle of the sun relative to the electronic device at the first time according to the target image, and determines the relative altitude angle and relative azimuth angle as the first relative orientation information. Further, the actual altitude angle and actual azimuth angle of the sun at the first time and the geographical location are obtained according to the geographical location of the electronic device and the first time, and the actual altitude angle and actual azimuth angle are determined as the first actual orientation information.
  • the first relative orientation information of the sun relative to the electronic device at the first time is determined by analyzing the target image of the sun captured at the first time, and the first actual orientation information of the sun at the first time is determined according to the date information, time information and longitude and latitude information of the electronic device when the target image is captured, thereby ensuring the accuracy of the determination of the above-mentioned first actual orientation information and the first relative orientation information, avoiding the interference of the environmental magnetic field with the subsequent calibration result of the compass, thereby ensuring the accuracy of the calibration of the indicated orientation of the compass.
  • the step of determining the posture information of the electronic device according to the first actual position information and the first relative position information may specifically include the following S110 to S114:
  • S110 Determine, according to the first actual position information, a first position coordinate of the sun in the target coordinate system at the first time.
  • the above-mentioned target coordinate system is a navigation coordinate system.
  • the above-mentioned target coordinate system can be specifically a northeast celestial coordinate system, a northeast terrestrial coordinate system, etc.
  • Technical personnel in this field can set the specific type of the above-mentioned target coordinate system according to actual conditions, and no specific limitation is made here.
  • the first actual orientation information includes the actual altitude angle and actual azimuth angle of the sun relative to the geographical location where the electronic device is located at the first time.
  • the actual altitude angle and the actual azimuth angle are used to represent the position coordinates of the sun in the target coordinate system.
  • the target coordinate system is a three-dimensional coordinate system with the geographical location where the electronic device is located as the origin.
  • the actual altitude angle and the actual azimuth angle of the sun relative to the geographical location where the electronic device is located at the first time are used to represent the X-axis coordinate, Y-axis coordinate and Z-axis coordinate of the sun's position in the target coordinate system, respectively, thereby obtaining the first orientation coordinates.
  • S112 Determine, according to the first relative orientation information, a second orientation coordinate of the sun in the system coordinate system of the electronic device at the first time.
  • the system coordinate system is the carrier coordinate system of the electronic device itself, which is also a three-dimensional coordinate system.
  • the formats of the system coordinate systems of electronic devices of different models may be the same or different, and no specific restrictions are imposed here.
  • the first relative orientation information includes the relative altitude angle and relative azimuth angle of the sun relative to the electronic device at the first time.
  • the relative altitude angle and relative azimuth angle are used to represent the position coordinates of the sun in the system coordinate system of the electronic device.
  • the relative altitude angle and relative azimuth angle of the sun relative to the electronic device at the first time are used to represent the X-axis coordinate, Y-axis coordinate, and Z-axis coordinate of the sun's position in the system coordinate system of the electronic device, respectively, so as to obtain the second orientation coordinates.
  • S114 Determine the posture and position information of the electronic device at the first time according to the first orientation coordinate and the second orientation coordinate.
  • the first azimuth coordinate contains three variables: the distance between the sun's position and the origin of the target coordinate system, the actual azimuth angle and the actual altitude angle.
  • the first azimuth coordinate contains three variables: the distance between the sun's position and the origin of the target coordinate system, the actual azimuth angle and the actual altitude angle.
  • the above-mentioned second azimuth coordinates contain three variables: the distance between the sun's position and the origin of the system coordinate system, the relative azimuth angle and the relative altitude angle.
  • a coefficient matrix containing only the above-mentioned two variables of relative azimuth angle and relative altitude angle can be disassembled from the second azimuth coordinates, which is recorded as the second coefficient matrix.
  • the target coordinate system and the system coordinate system of the electronic device can be converted to each other, that is, the first actual position information and the first relative position information can be converted to each other, that is, the first position coordinates and the second position coordinates can be converted to each other, that is, the first coefficient matrix and the second coefficient matrix
  • the Xb'-Yb'-Zb' coordinate system of the electronic device and the Xb-Yb-Zb coordinate system have an associated relationship, and the two can be converted to each other.
  • the conversion coefficient between the first orientation coordinates and the second orientation coordinates can be determined. That is, by analyzing and processing the first coefficient matrix and the second coefficient matrix, the conversion matrix between the first coefficient matrix and the second coefficient matrix can be determined, and the conversion matrix can represent the posture information of the electronic device at the first time.
  • the first coefficient matrix is determined according to the first azimuth coordinates
  • the second coefficient matrix is determined according to the second azimuth coordinates.
  • the first coefficient matrix and the second coefficient matrix are analyzed and processed to determine the conversion matrix between the first coefficient matrix and the second coefficient matrix, thereby determining the rotation Euler angle when converting between the target coordinate system and the system coordinate system of the electronic device.
  • the attitude angle information such as the pitch angle, roll angle and heading angle required for the target coordinate system to rotate is determined.
  • the pitch angle is the angle of rotation of the target coordinate system around its Y axis
  • the roll angle is the angle of rotation of the target coordinate system around its X axis
  • the heading angle is the angle of rotation of the target coordinate system around its Z axis.
  • the above-mentioned target coordinate system takes the user's location as the origin, and takes the axis parallel to the longitude and latitude of the earth and the axis pointing to the center of the earth as the coordinate axis
  • the system coordinate system of the electronic device takes a certain point in the electronic device, such as the center point of the electronic device, as the origin, and takes the axis parallel to the boundary of the electronic device and the axis perpendicular to the plane where the electronic device is located as the coordinate axis. Therefore, by processing the attitude angle information such as the pitch angle, roll angle and heading angle required to rotate the above-mentioned target coordinate system, the attitude information of the electronic device in the above-mentioned target coordinate system at the first time can be determined.
  • the target coordinate system is established with the user's location as the origin O, the due north direction as the ordinate axis Y (N), the due east direction as the abscissa axis X (E), and the vertical axis Z (U) perpendicular to the earth's surface upward.
  • the position coordinates of point G in the target coordinate system i.e., the above-mentioned first azimuth coordinates
  • G R ⁇ cosAg ⁇ cosa g , R ⁇ cosAg ⁇ sina g , R ⁇ sinAg
  • the above-mentioned first coefficient matrix can be determined according to the first azimuth coordinates as follows:
  • the position coordinate of point B in the system coordinate system i.e., the above-mentioned second azimuth coordinate
  • the above-mentioned second coefficient matrix can be determined according to the second azimuth coordinate as follows:
  • the Euler transformation matrix M corresponding to the Northeast Sky Coordinate System can be set as:
  • is the roll angle of the northeast celestial coordinate system
  • is the pitch angle of the northeast celestial coordinate system
  • the first orientation coordinates of the sun in the target coordinate system at the first time are determined according to the first actual orientation information
  • the second orientation coordinates of the sun in the system coordinate system of the electronic device at the first time are determined according to the first relative orientation information
  • the posture information of the electronic device at the first time is determined according to the first orientation coordinates and the second orientation coordinates.
  • the posture information of the electronic device at the first time is determined according to the position coordinates of the sun in the target coordinate system and the position coordinates of the sun in the system coordinate system of the electronic device.
  • the calibration result of the compass can be prevented from being affected by the environmental magnetic field, thereby ensuring the accuracy of the calibration result of the compass and the accuracy of the indicated direction of the compass.
  • the step of calibrating the indicated direction of the compass according to the posture information may specifically include the following S116 and S118:
  • S116 Determine device orientation parameters of the electronic device at the first time according to the posture information.
  • the target coordinate system takes the geographical location of the electronic device as the origin, and the axes parallel to the longitude and latitude of the earth and the axes pointing to the center of the earth as the coordinate axes.
  • the indicated orientation of the compass in the electronic device is calibrated according to the four orientations of east, west, south and north in the electronic device at the first time, the tilt angle of the electronic device relative to the ground, and the rotation angle of the electronic device.
  • the electronic device is provided with a gyroscope, a gravity sensor and other parts that can be used to determine the rotation angle, tilt angle, moving distance and other movement information of the electronic device.
  • the parts can record the movement information of the electronic device in real time.
  • the indicated direction of the compass in the electronic device is calibrated directly according to the four orientations of the electronic device at the first time.
  • the four orientations in the electronic device are adjusted in real time in combination with the four orientations of the electronic device at the first time and the movement information of the electronic device, and then the indicated direction of the compass in the electronic device is calibrated in real time through the four orientations in the electronic device.
  • the device direction parameter of the electronic device at the first time is determined according to the posture information of the electronic device at the first time, and then the indicated direction of the compass is calibrated according to the device direction parameter.
  • the posture information of the electronic device at the above-mentioned first time is determined, and then the indicated direction of the compass in the electronic device is calibrated according to the posture information, which avoids the calibration result of the compass from being affected by the environmental magnetic field, thereby ensuring the accuracy of the calibration result of the compass and the accuracy of the indicated direction of the compass.
  • the first time is within the target period, and at the first time, the solar altitude angle of the sun at the geographical location where the electronic device is located is less than the target angle value.
  • the target period is the sunshine period of the geographical location where the electronic device is located on the corresponding date of the first time.
  • the above-mentioned first time is the moment when the user performs the calibration operation on the compass in the electronic device, that is, when the user takes a target image of the sun, the shooting time should be within the sunshine period of the shooting day to ensure that the sun image in the captured target image has high clarity, thereby ensuring the accuracy of the data to be analyzed when the target image is subsequently analyzed and processed, and further ensuring the accuracy of the calibration of the compass in the electronic device.
  • the solar altitude angle measured at the geographical location where the electronic device is located is smaller than the target angle value.
  • the above-mentioned target angle value can be specifically 85°, 86°, 87°, 88°, 89°, 90° and other values.
  • Technical personnel in this field can set the specific values of the above-mentioned target angle values according to actual conditions, and no specific restrictions are made here.
  • the sun altitude angle measured at the geographical location of the electronic device at the time of capturing the target image is not too large, that is, it should be ensured that the sun does not directly or nearly directly shine on the geographical location of the electronic device at the time of capturing the target image.
  • the availability of the data to be analyzed is guaranteed, thereby ensuring the accuracy of calibrating the compass in the electronic device.
  • the shooting time i.e., the above first time
  • the sun altitude angle measured at the geographical location of the electronic device is less than the target angle value.
  • the compass calibration method provided in the embodiment of the present application may further include the following S120 and S122:
  • the second time is separated from the first time by a target duration
  • the target duration is the effective duration of the first actual position information and the first relative position information.
  • the target duration may be 150 seconds, 3 minutes, 200 seconds, etc.
  • Those skilled in the art may set the specific value of the target duration according to actual conditions, and no specific limitation is made here.
  • the sun is constantly moving.
  • the first actual orientation information and the first relative orientation information obtained at the first time are no longer applicable to calibrate the indicated direction of the compass at the current moment.
  • new sun orientation information needs to be obtained to calibrate the indicated direction of the compass again.
  • the working accuracy of the compass of the electronic device is detected, that is, the pointing accuracy of the compass of the electronic device at the second time is detected.
  • the target value is the basis for judging whether the indicated direction of the compass is accurate. If the working accuracy of the compass is less than the target value, it means that the working accuracy of the compass is low, that is, the indicated direction of the compass is not accurate enough.
  • the relative altitude angle and relative azimuth angle of the sun relative to the electronic device at the second time are determined by taking a solar image and analyzing the taken solar image, and then the second relative orientation information of the sun relative to the electronic device at the second time is determined.
  • the shooting date and shooting time the actual altitude angle and actual azimuth angle of the sun at the actual geographical location of the electronic device when the solar image is taken are determined, and then the second actual orientation information of the sun at the second time is determined.
  • the second actual orientation information the third orientation coordinates of the sun in the target coordinate system at the second time are determined, and the third coefficient matrix is determined according to the third orientation coordinates.
  • the fourth orientation coordinates of the sun in the system coordinate system of the electronic device at the second time are determined, and the fourth coefficient matrix is determined according to the fourth orientation coordinates.
  • the posture information of the electronic device at the second time is determined, and then the device orientation parameters of the electronic device at the second time are determined according to the posture information, and the compass in the electronic device is calibrated again according to the device orientation parameters to update the indicated orientation of the compass.
  • the working accuracy of the compass at the second time is also obtained.
  • the indicated azimuth of the compass is updated according to the second relative azimuth information of the sun relative to the electronic device at the second time, and the second actual azimuth information of the sun at the second time and the actual geographical location.
  • the new sun azimuth information i.e., the second actual azimuth information and the second relative azimuth information
  • the indicated azimuth of the compass is calibrated again according to the obtained second actual azimuth information and the second relative azimuth information, thereby ensuring the timeliness and accuracy of the calibration of the indicated azimuth of the compass.
  • the compass calibration method calibrates the indicated direction of the compass based on the actual direction information of the sun and the relative direction information of the sun to the electronic device, thereby avoiding the influence of the ambient magnetic field on the calibration result of the compass, thereby ensuring the accuracy of the calibration result of the compass and the accuracy of the indicated direction of the compass.
  • the user opens the compass application in the electronic device 200, and the electronic device 200 displays the first interface 202, which is a compass interface.
  • the user can identify the direction according to the indicated direction of the compass in the first interface 202.
  • the electronic device 200 displays the second interface 204, which is a compass manual calibration interface. The user can manually calibrate the indicated direction of the compass in the second interface 204 according to the indication information.
  • the electronic device 200 displays the third interface 206, and the third interface 206 includes a target control 208.
  • the electronic device 200 receives and responds to the user's touch input to the target control 208.
  • the electronic device 200 displays a fourth interface 210, which is a compass automatic calibration interface.
  • a target circular frame 212 is displayed in the fourth interface 210, and the user can shoot the target image of the sun according to the instruction information in the fourth interface 210.
  • the electronic device 200 will send a prompt message to the user to reshoot the sun image until the user shoots the target image with a clear sun image in the fourth interface 210.
  • the electronic device 200 will obtain the longitude and latitude information of the user's location when the user shoots the target image and the shooting time.
  • the electronic device 200 determines the actual position information of the sun relative to the user's location area when the user shoots the target image according to the longitude and latitude information of the user's location when the user shoots the target image and the shooting time. At the same time, the electronic device 200 determines the relative position information of the sun relative to the electronic device 200 when the user shoots the target image by analyzing and processing the target image shot by the user. On this basis, the electronic device 200 analyzes and processes the actual orientation information and relative orientation information determined above to determine the four orientations of east, west, south and north in the electronic device 200 when the user takes the target image, and calibrates the indicated orientation of the compass in real time based on the determined four orientations and its own movement information.
  • the compass calibration method provided in the embodiment of the first aspect of the present application may be executed by a compass calibration device.
  • the compass calibration device performing the above compass calibration method is taken as an example to illustrate the compass calibration device provided in the embodiment of the second aspect of the present application.
  • an embodiment of the present application provides a compass calibration device 1000 , which may include the following acquisition module 1002 , a first determination module 1004 , a second determination module 1006 , a calculation module 1008 , and a calibration module 1010 .
  • An acquisition module 1002 is used to acquire a target image, where the target image includes the sun and the shooting time of the target image is a first time;
  • a first determining module 1004 is used to determine first relative position information of the sun relative to the electronic device at a first time according to the target image;
  • the second determining module 1006 is used to obtain first actual position information of the sun at the first time and the geographical location according to the geographical location of the electronic device and the first time;
  • a calculation module 1008 configured to determine the posture information of the electronic device according to the first actual position information and the first relative position information
  • the calibration module 1010 is used to calibrate the indicated direction of the compass according to the posture information.
  • the first relative direction information of the sun relative to the electronic device at the first time is determined by the target image of the sun captured at the first time, and the first actual direction information of the sun relative to the geographical location of the electronic device when the target image is captured is determined.
  • the posture information of the electronic device at the first time is determined, and then the indicated direction of the compass is calibrated according to the posture information.
  • the compass's indicated direction is calibrated based on the actual direction information of the sun and the relative direction information of the sun to the electronic device obtained by taking an image of the sun, thereby avoiding the influence of the environmental magnetic field on the calibration result of the compass, thereby ensuring the accuracy of the calibration result of the compass and the accuracy of the compass' indicated direction.
  • the first determination module 1004 is specifically used to: determine the relative altitude angle and relative azimuth angle of the sun relative to the electronic device at a first time based on the target image, and determine the relative altitude angle and relative azimuth angle as the first relative orientation information;
  • the second determination module 1006 is specifically used to: obtain the actual altitude angle and actual azimuth angle of the sun at the first time and geographical location based on the geographical location of the electronic device and the first time, and determine the actual altitude angle and actual azimuth angle as the first actual orientation information.
  • the above-mentioned embodiment provided by the present application determines the relative altitude angle and relative azimuth angle of the sun relative to the electronic device at the first time according to the target image, and determines the relative altitude angle and relative azimuth angle as the first relative orientation information. Further, the actual altitude angle and actual azimuth angle of the sun at the first time and the geographical location are obtained according to the geographical location of the electronic device and the first time, and the actual altitude angle and actual azimuth angle are determined as the first actual orientation information.
  • the first relative orientation information of the sun relative to the electronic device at the first time is determined by analyzing the target image of the sun captured at the first time, and the first actual orientation information of the sun at the first time is determined according to the date information, time information and longitude and latitude information of the electronic device when the target image is captured, thereby ensuring the accuracy of the determination of the above-mentioned first actual orientation information and the first relative orientation information, avoiding the interference of the environmental magnetic field with the subsequent calibration result of the compass, thereby ensuring the accuracy of the calibration of the indicated orientation of the compass.
  • the calculation module 1008 is specifically used to: determine the first azimuth coordinates of the sun in the target coordinate system at the first time based on the first actual azimuth information; determine the second azimuth coordinates of the sun in the system coordinate system of the electronic device at the first time based on the first relative azimuth information; determine the posture information of the electronic device at the first time based on the first azimuth coordinates and the second azimuth coordinates.
  • the first orientation coordinates of the sun in the target coordinate system at the first time are determined according to the first actual orientation information
  • the second orientation coordinates of the sun in the system coordinate system of the electronic device at the first time are determined according to the first relative orientation information
  • the posture information of the electronic device at the first time is determined according to the first orientation coordinates and the second orientation coordinates.
  • the posture information of the electronic device at the first time is determined according to the position coordinates of the sun in the target coordinate system and the position coordinates of the sun in the system coordinate system of the electronic device.
  • the calibration result of the compass can be prevented from being affected by the environmental magnetic field, thereby ensuring the accuracy of the calibration result of the compass and the accuracy of the indicated direction of the compass.
  • the calibration module 1010 is specifically used to: determine the device orientation parameters of the electronic device at the first time according to the posture information; and calibrate the indicated orientation of the compass according to the device orientation parameters.
  • the device direction parameter of the electronic device at the first time is determined according to the posture information of the electronic device at the first time, and then the indicated direction of the compass is calibrated according to the device direction parameter.
  • the position coordinates of the mark and the sun in the system coordinate system of the electronic device are used to determine the posture information of the electronic device at the above-mentioned first time, and then the indicated direction of the compass in the electronic device is calibrated according to the posture information, thereby avoiding the calibration result of the compass from being affected by the ambient magnetic field, thereby ensuring the accuracy of the calibration result of the compass and the accuracy of the direction indicated by the compass.
  • the first time is within the target time period, and at the first time, the solar altitude angle of the sun at the geographical location of the electronic device is less than the target angle value; wherein the target time period is the sunshine period of the corresponding date at the geographical location of the electronic device at the first time.
  • the shooting time i.e., the above first time
  • the sun altitude angle measured at the geographical location of the electronic device is less than the target angle value.
  • the acquisition module 1002 is also used to: obtain the working accuracy of the compass at the second time; when the working accuracy is less than the target value, obtain the actual geographical location of the electronic device at the second time; the calibration module 1010 is also used to: update the indicated direction of the compass according to the second relative direction information of the sun relative to the electronic device at the second time, and the second actual direction information of the sun at the second time and the actual geographical location.
  • the working accuracy of the compass at the second time is also obtained.
  • the indicated azimuth of the compass is updated according to the second relative azimuth information of the sun relative to the electronic device at the second time, and the second actual azimuth information of the sun at the second time and the actual geographical location.
  • the new sun azimuth information i.e., the second actual azimuth information and the second relative azimuth information
  • the indicated azimuth of the compass is calibrated again according to the obtained second actual azimuth information and the second relative azimuth information, thereby ensuring the timeliness and accuracy of the calibration of the indicated azimuth of the compass.
  • the compass calibration device 1000 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 other devices other than a terminal.
  • 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.
  • NAS Network Attached Storage
  • PC personal computer
  • TV television
  • teller machine a self-service machine
  • the compass calibration device 1000 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.
  • the compass calibration device 1000 provided in the embodiment of the second aspect of the present application can implement each process implemented by the method embodiment of Figure 1, and will not be described again here to avoid repetition.
  • an embodiment of the present application also provides an electronic device 1100, including a processor 1102 and a memory 1104, and the memory 1104 stores programs or instructions that can be executed on the processor 1102.
  • the program or instructions are executed by the processor 1102
  • the various steps of the compass calibration method embodiment of the above-mentioned first aspect are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • FIG. 12 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
  • the electronic device 1200 includes but is not limited to: a radio frequency unit 1201, a network module 1202, an audio output unit 1203, an input unit 1204, a sensor 1205, a display unit 1206, a user input unit 1207, an interface unit 1208, a memory 1209, and a processor 1210 and other components.
  • the electronic device 1200 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 1210 through a power management system, so that the power management system can manage charging, discharging, and power consumption management.
  • a power source such as a battery
  • the electronic device structure shown in FIG12 does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown, or combine certain components, or arrange components differently, which will not be described in detail here.
  • the electronic device 1200 of the embodiment of the present application can be used to implement the various steps of the embodiment of the compass calibration method of the first aspect mentioned above.
  • the user input unit 1207 is used to obtain a target image, the target image includes the sun, and the shooting time of the target image is the first time.
  • the processor 1210 is configured to determine first relative position information of the sun relative to the electronic device at a first time according to the target image.
  • the processor 1210 is further configured to obtain first actual position information of the sun at the first time and the geographical location according to the geographical location of the electronic device and the first time.
  • the processor 1210 is further used to determine the posture information of the electronic device according to the first actual orientation information and the first relative orientation information, and calibrate the indicated orientation of the compass according to the posture information.
  • the first relative direction information of the sun relative to the electronic device at the first time is determined by using the target image of the sun captured at the first time, and the first actual direction information of the sun relative to the geographical location of the electronic device when the target image is captured is determined.
  • the posture information of the electronic device at the first time is determined, and then the indicated direction of the compass is calibrated according to the posture information.
  • the indicated direction of the compass is calibrated based on the actual direction information of the sun and the relative direction information of the sun to the electronic device obtained by capturing the sun image.
  • the calibration result of the compass is prevented from being affected by the environmental magnetic field, thereby ensuring the accuracy of the calibration result of the compass and the accuracy of the direction indicated by the compass.
  • processor 1210 is specifically used to: determine the relative altitude angle and relative azimuth angle of the sun relative to the electronic device at a first time based on the target image, and determine the relative altitude angle and relative azimuth angle as first relative orientation information; obtain the actual altitude angle and actual azimuth angle of the sun at the first time and geographical location based on the geographical location of the electronic device and the first time, and determine the actual altitude angle and actual azimuth angle as first actual orientation information.
  • the above-mentioned embodiment provided by the present application determines the relative altitude angle and relative azimuth angle of the sun relative to the electronic device at the first time according to the target image, and determines the relative altitude angle and relative azimuth angle as the first relative orientation information. Further, the actual altitude angle and actual azimuth angle of the sun at the first time and the geographical location are obtained according to the geographical location of the electronic device and the first time, and the actual altitude angle and actual azimuth angle are determined as the first actual orientation information.
  • the first relative orientation information of the sun relative to the electronic device at the first time is determined by analyzing the target image of the sun captured at the first time, and the first actual orientation information of the sun at the first time is determined according to the date information, time information and longitude and latitude information of the electronic device when the target image is captured, thereby ensuring the accuracy of the determination of the above-mentioned first actual orientation information and the first relative orientation information, avoiding the interference of the environmental magnetic field with the subsequent calibration result of the compass, thereby ensuring the accuracy of the calibration of the indicated orientation of the compass.
  • processor 1210 is specifically used to: determine a first azimuth coordinate of the sun in a target coordinate system at a first time based on the first actual azimuth information; determine a second azimuth coordinate of the sun in a system coordinate system of the electronic device at the first time based on the first relative azimuth information; and determine the position information of the electronic device at the first time based on the first azimuth coordinate and the second azimuth coordinate.
  • the first position coordinates of the sun in the target coordinate system at the first time are determined according to the first actual position information
  • the second position coordinates of the sun in the system coordinate system of the electronic device at the first time are determined according to the first relative position information
  • the position and posture information of the electronic device at the first time is determined according to the first position coordinates and the second position coordinates.
  • the position and posture information of the electronic device at the first time determined at the above-mentioned first time is determined, and when the indicated direction of the compass in the electronic device is subsequently calibrated according to the posture information, the calibration result of the compass can be prevented from being affected by the environmental magnetic field, thereby ensuring the accuracy of the calibration result of the compass and the accuracy of the indicated direction of the compass.
  • the processor 1210 is specifically used to: determine a device orientation parameter of the electronic device at a first time according to the posture information; and calibrate the indicated orientation of the compass according to the device orientation parameter.
  • the device direction parameter of the electronic device at the first time is determined according to the posture information of the electronic device at the first time, and then the indicated direction of the compass is calibrated according to the device direction parameter.
  • the posture information of the electronic device at the first time is determined, and then the indicated direction of the compass in the electronic device is calibrated according to the posture information, so as to avoid
  • the calibration result of the compass is affected by the environmental magnetic field, thereby ensuring the accuracy of the calibration result of the compass and the accuracy of the direction indicated by the compass.
  • the first time is within the target time period, and at the first time, the solar altitude angle of the sun at the geographical location of the electronic device is less than the target angle value; wherein the target time period is the sunshine time period of the geographical location of the electronic device on the corresponding date of the first time.
  • the shooting time i.e., the above first time
  • the sun altitude angle measured at the geographical location where the electronic device is located is less than the target angle value.
  • processor 1210 is also used to: obtain the working accuracy of the compass at the second time; when the working accuracy is less than the target value, obtain the actual geographical location of the electronic device at the second time, and update the indicated direction of the compass according to the second relative position information of the sun relative to the electronic device at the second time, and the second actual position information of the sun at the second time and the actual geographical location.
  • the working accuracy of the compass at the second time is also obtained.
  • the indicated azimuth of the compass is updated according to the second relative azimuth information of the sun relative to the electronic device at the second time, and the second actual azimuth information of the sun at the second time and the actual geographical location.
  • the new sun azimuth information i.e., the second actual azimuth information and the second relative azimuth information
  • the indicated azimuth of the compass is calibrated again according to the obtained second actual azimuth information and the second relative azimuth information, thereby ensuring the timeliness and accuracy of the calibration of the indicated azimuth of the compass.
  • the input unit 1204 may include a graphics processing unit (GPU) 12041 and a microphone 12042, and the graphics processor 12041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode.
  • the display unit 1206 may include a display panel 12061, and the display panel 12061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc.
  • the user input unit 1207 includes a touch panel 12071 and at least one of other input devices 12072.
  • the touch panel 12071 is also called a touch screen.
  • the touch panel 12071 may include two parts: a touch detection device and a touch controller.
  • Other input devices 12072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
  • the memory 1209 can be used to store software programs and various data.
  • the memory 1209 can mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area can store an operating system, an application program or instruction required for at least one function (such as a sound playback function, an image playback function, etc.).
  • the memory 1209 can include a volatile memory or a non-volatile memory, or the memory 1209 can include both volatile and non-volatile memories.
  • the non-volatile memory can be a read-only memory (ROM), Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM) or Flash memory.
  • Volatile memory can be Random Access Memory (RAM), Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM) and Direct Rambus RAM (DRRAM).
  • RAM Random Access Memory
  • SRAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Synchronous DRAM
  • DDRSDRAM Double Data Rate SDRAM
  • ESDRAM Enhanced SDRAM
  • SLDRAM Synchronous Link DRAM
  • DRRAM Direct Rambus RAM
  • the memory 1209 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
  • the processor 1210 may include one or more processing units; optionally, the processor 1210 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 1210.
  • An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored.
  • a program or instruction is stored.
  • each process of the above-mentioned first aspect of the compass calibration method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
  • 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.
  • An embodiment of the present application further provides a chip, which includes a processor and a communication interface.
  • 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 compass calibration method embodiment of the first aspect above, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
  • 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.
  • 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 compass calibration method embodiment of the first aspect mentioned above, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
  • the technical solution of the present application 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.
  • a storage medium such as ROM/RAM, a disk, or an optical disk
  • a terminal which can be a mobile phone, a computer, a server, or a network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Navigation (AREA)

Abstract

本申请公开了一种指南针校准方法及装置、电子设备和可读存储介质,属于电子技术领域。指南针校准方法包括:获取目标图像,目标图像包括太阳,目标图像的拍摄时间为第一时间;根据目标图像确定太阳在第一时间相对于电子设备的第一相对方位信息;根据电子设备的地理位置和第一时间得到太阳在第一时间和地理位置的第一实际方位信息;根据第一实际方位信息和第一相对方位信息,确定电子设备的姿态信息,根据姿态信息校准指南针的指示方位。

Description

指南针校准方法及装置、电子设备和可读存储介质
相关申请的交叉引用
本申请要求在2022年10月21日提交中国专利局、申请号为202211292116.8、名称为“指南针校准方法及装置、电子设备和可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于电子技术领域,具体涉及一种指南针校准方法及装置、电子设备和可读存储介质。
背景技术
对于智能电子设备中的终端指南针,通常使用电子设备中的电子罗盘如磁阻传感器感应地磁场信息,进而通过将地磁场信息转化为数字信号,并根据数字信号设置模拟指针的指向的方式来指示方位。
然而,对于上述终端指南针,在其指示方位以及在对其指示方位进行校准时,均受环境磁场的影响较大。在环境磁场较强的情况下,如在周围环境存在磁性物品的情况下,终端指南针因受环境磁场的干扰,其指示方位的精确度降低。此时,沿预设轨迹移动电子设备等传统的校准方式的校准结果亦受环境磁场的干扰,校准结果的准确性较低,终端指南针无法正确指示方位。
发明内容
本申请实施例的目的是提供一种指南针校准方法及装置、电子设备和可读存储介质,能够避免环境磁场对指南针校准结果的影响,提升指南针校准结果以及指示方位的准确性。
第一方面,本申请实施例提供了一种指南针校准方法,该方法包括:获取目标图像,目标图像包括太阳,目标图像的拍摄时间为第一时间;根据目标图像确定太阳在第一时间相对于电子设备的第一相对方位信息;根据电子设备的地理位置和第一时间得到太阳在第一时间和地理位置的第一实际方位信息;根据第一实际方位信息和第一相对方位信息,确定电子设备的姿态信息,根据姿态信息校准指南针的指示方位。
第二方面,本申请实施例提供了一种指南针校准装置,该装置包括:获取模块,用于获取目标图像,目标图像包括太阳,目标图像的拍摄时间为第一时间;第一确定模块,用于根据目标图像确定太阳在第一时间相对于电子设备的第一相对方位信息;第二确定模块,用于根据电子设备的地理位置和第一时间得到太阳在第一时间和地理位置的第一实际方位信息;计算模块,用于根据第一实际方位信息和第一相对方位信息,确定电子设备的姿态信息;校准模块,用于根据姿态信息校准指南针的指示方位。
第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器和存储器,存储器存储可在处理器上运行的程序或指令,程序或指令被处理器执行时实现如第一方面的指南针校准方法的步骤。
第四方面,本申请实施例提供了一种可读存储介质,该可读存储介质上存储有程序或指令,程序或指令被处理器执行时实现如第一方面的指南针校准方法的步骤。
第五方面,本申请实施例提供了一种芯片,该芯片包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行程序或指令,实现如第一方面的指南针校准方法的步骤。
第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面的指南针校准方法的步骤。
在本申请实施例提供的指南针校准方法中,在校准电子设备中的指南针的指示方位时,获取目标图像,该目标图像包括太阳,且目标图像的拍摄时间为第一时间,进而根据目标图像确定太阳在第一时间相对于电子设备的第一相对方位信息。同时,根据电子设备的地理位置和第一时间得到太阳在第一时间和地理位置的第一实际方位信息。在此基础上,再根据第一实际方位信息和第一相对方位信息,确定电子设备的姿态信息,进而根据姿态信息校准指南针的指示方位。通过上述指南针校准方法,对于包括指南针应用程序即终端指南针的电子设备,在对该终端指南针的指示方位进行校准的过程中,通过在第一时间拍摄到的太阳的目标图像确定太阳在第一时间相对于电子设备的第一相对方位信息,同时确定拍摄目标图像时太阳相对于电子设备所在的地理位置处的第一实际方位信息。在此基础上,再根据上述第一实际方位信息与第一相对方位信息之间的关联关系,对电子设备在第一时间的姿态信息进行确定,进而在根据该姿态信息对指南针的指示方位进行校准。这样,基于太阳的实际方位信息以及通过拍摄太阳图像得到的太阳对电子设备的相对方位信息对指南针的指示方位进行校准,避免了指南针的校准结果受环境磁场的影响,从而保证了指南针的校准结果的准确性,保证了指南针指示方位的精确性。
附图说明
图1为本申请实施例提供的指南针校准方法的流程示意图;
图2为本申请实施例提供的指南针校准方法的操作界面图之一;
图3为本申请实施例提供的指南针校准方法的操作界面图之二;
图4为本申请实施例提供的指南针校准方法的操作界面图之三;
图5为本申请实施例提供的指南针校准方法的操作界面图之四;
图6为本申请实施例提供的指南针校准方法的操作界面图之五;
图7为本申请实施例提供的指南针校准方法的原理图之一;
图8为本申请实施例提供的指南针校准方法的原理图之二;
图9为本申请实施例提供的指南针校准方法的原理图之三;
图10为本申请实施例提供的指南针校准装置的结构框图;
图11为本申请实施例提供的电子设备的结构框图;
图12为本申请实施例提供的电子设备的硬件结构示意图。
具体实施例
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。
本申请第一方面的实施例提出了一种指南针校准方法,本申请实施例提供的指南针校准方法的技术方案的执行主体可以为指南针校准装置,具体可以根据实际使用需求确定,本申请实施例不作限定。为了更加清楚地描述本申请实施例提供的指南针校准方法,下面方法实施例中以指南针校准方法的执行主体为指南针校准装置进行示例性地说明。
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的指南针校准方法进行详细地说明。
如图1所示,本申请实施例提供一种指南针校准方法,该方法可以包括下述S102至S108:
S102:获取目标图像。
本申请实施例提出的指南针校准方法应用于电子设备,该电子设备中包括指南针应用程序即终端指南针。
其中,上述目标图像的拍摄时间为第一时间。
进一步地,上述目标图像的主体对象为太阳,在实际的应用过程中,太阳可位于上述目标图像中的目标区域。其中,目标区域在电子设备的系统坐标系中的坐标位置已知。如此,能够减少校准过程中对太阳在目标图像中的位置坐标进行确定的步骤,从而减少对指南针的指示方位进行校准的过程中的计算量,从而提升对指南针进行校准的及时性。
具体地,在本申请实施例所提供的指南针校准方法中,在对指南针的指示方位进行校准时,用户通过电子设备拍摄太阳的照片。在拍摄过程中,用户通过调整电子设备至目标姿态,使得太阳图像位于拍摄界面的目标位置,从而使得在拍摄得到的包含太阳的目标图像中,太阳图像位于该目标图像的目标区域内。
另外,需要说明的是,在拍摄上述目标图像的过程中,电子设备应保持稳定,避免电子设备抖动,以保证拍摄得到的太阳图像的清晰度,从而保证后续对目标图像进行分析处理时,待分析数据的准确性。
S104:根据目标图像确定太阳在第一时间相对于电子设备的第一相对方位信息。
具体地,在本申请实施例所提供的指南针校准方法中,在拍摄得到太阳的目标图像之后,通过对目标图像中太阳方位角、太阳高度角度等信息进行分析,对在拍摄上述目标图像时即在上述第一时间时,太阳相对于电子设备的第一相对方位信息进行确定。
S106:根据电子设备的地理位置和第一时间得到太阳在第一时间和地理位置的第一实际方位信息。
其中,第一时间为用户对电子设备中的指南针应用程序进行校准操作的时间,即用户拍摄太阳的目标图像的时间。第一时间具体可包括用户拍摄太阳的目标图像时的日期信息以及时刻信息。
进一步地,电子设备中设置有定位装置,上述电子设备的地理位置具体可通过该定位装置获取用户在通过电子设备拍摄太阳的目标图像时,用户携带电子设备所处的区域位置的经纬度信息来进行确定。
具体地,对于包括指南针应用程序即终端指南针的电子设备,在对该终端指南针的指示方位进行校准的过程中,在接收到用户对电子设备中的指南针应用程序的校准操作时,也即在通过电子设备拍摄太阳的目标图像时,实时获取电子设备的地理位置信息,进而结合拍摄目标图像的时间即第一时间以及电子设备的地理位置信息,对太阳在第一时间时相对于电子设备所在的地理位置的第一实际方位信息进行确定,以便后续根据该第一实际方位信息对电子设备中的指南针的指示方位进行校准。
S108:根据第一实际方位信息和第一相对方位信息,确定电子设备的姿态信息,根据姿态信息校准指南针的指示方位。
其中,上述第一实际方位信息为在上述第一时间时,太阳相对于电子设备所在的地理位置的实际方位信息,该第一实际方位信息可用于表示太阳相对于地球的实际位置。上述第一相对方位信息为在上述第一时间时,太阳相对于电子设备的相对方位信息,该第一相对方位信息可用于表示太阳相对于电子设备的相对位置。
可以理解的是,在同一时刻,太阳相对于电子设备所在的地理位置的第一实际方位信息,以及太阳相对于电子设备的第一相对方位信息之间具有关联关系,在一定情况下,上述第一实际方位信息和上述第一相对方位信息之间能够相互转换。通过对上述第一实际方位信息以及第一相对方位信息进行分析处理,能够确定上述第一实际方位信息以及第一相对方位信息之间的转换关系,该转换关系可表示电子设备在上述第一时间时相对于地球表面的方位信息,也即表示电子设备在拍摄上述目标图像时的姿态信息。在此基础上,通过对电子设备在上述第一时间相对于地球表面的方位信息即电子设备的姿态信息进行分析, 即可确定在第一时间时电子设备中的东西南北四个方位,进而可通过确定的东西南北四个方位对电子设备中的指南针的指示方位进行校准。
因此,在本申请实施例所提供的指南针校准方法中,对于包括指南针应用程序即终端指南针的电子设备,在对该终端指南针的指示方位进行校准时,通过在第一时间拍摄到的太阳的目标图像,对太阳在第一时间相对于电子设备的第一相对方位信息进行确定。同时,根据拍摄目标图像的时间即上述第一时间以及拍摄目标图像时电子设备的地理位置,对太阳在第一时间相对于电子设备所在的地理位置的第一实际方位信息。在此基础上,通过对上述第一实际方位信息以及第一相对方位信息进行分析,对电子设备在第一时间的姿态信息进行确定,并根据该姿态信息确定在上述第一时间时电子设备中的东西南北四个方位,进而通过确定的电子设备中的东西南北四个方位对电子设备中的指南针的指示方位进行校准。
其中,需要说明的是,上述电子设备中设置有陀螺仪、重力传感器等可用于确定电子设备的转动角度、倾斜角度、移动距离等移动信息的零件,在电子设备的移动过程中,上述零件可实时记录电子设备的移动信息。在此基础上,在电子设备的移动过程中,便可根据电子设备在上述第一时间的东西南北四个方位以及电子设备的移动信息,对电子设备中的四个方位进行实时调整,进而通过电子设备中的四个方位对电子设备中的指南针的指示方位进行实时校准。
通过本申请实施例提供的上述指南针校准方法,对于包括指南针应用程序即终端指南针的电子设备,在对该终端指南针的指示方位进行校准的过程中,通过在第一时间拍摄到的太阳的目标图像确定太阳在第一时间相对于电子设备的第一相对方位信息,同时确定拍摄目标图像时太阳相对于电子设备所在的地理位置处的第一实际方位信息。在此基础上,再根据上述第一实际方位信息与第一相对方位信息之间的关联关系,对电子设备在第一时间的姿态信息进行确定,进而在根据该姿态信息对指南针的指示方位进行校准。这样,基于太阳的实际方位信息以及通过拍摄太阳图像得到的太阳对电子设备的相对方位信息对指南针的指示方位进行校准,避免了指南针的校准结果受环境磁场的影响,从而保证了指南针的校准结果的准确性,保证了指南针指示方位的精确性。
在本申请实施例中,上述S104具体可包括下述的S104a,上述S106具体可包括下述的S106a:
S104a:根据目标图像确定太阳在第一时间相对于电子设备的相对高度角和相对方位角,将相对高度角和相对方位角确定为第一相对方位信息。
具体地,在本申请实施例所提供的指南针校准方法中,在拍摄得到太阳的目标图像之后,通过对目标图像进行分析处理,对在上述第一时间时,太阳相对于电子设备的相对位置进行确定。具体地,结合电子设备的系统坐标系,对目标图像中太阳方位角、太阳高度角度等信息进行分析,以对太阳在第一时间相对于电子设备的相对太阳高度角、相对太阳方位角进行确定,并将该相对太阳高度角以及相对太阳方位角确定上述第一相对方位信息。
S106a:根据电子设备的地理位置和第一时间得到太阳在第一时间和地理位置的实际高度角和实际方位角,将实际高度角和实际方位角确定为第一实际方位信息。
可以理解的是,在测量太阳相对于地球上某一位置的太阳高度角、太阳方位角等太阳实际方位信息时,测得的太阳高度角、太阳方位角等信息与该位置的经纬度、测试日期以及测试时刻相关。具体地,对于同一位置,在不同日期或不同时刻测得的该位置处的太阳高度角以及太阳方位角不同;对于同一日期的同一时刻,在不同位置处测得的太阳高度角以及太阳方位角不同。因此,结合测量位置的经纬度信息、测量日期、测量时刻等信息,能够对测量区域内的太阳高度角以及太阳方位角等信息进行确定。
具体地,在本申请实施例所提供的指南针校准方法中,在通过电子设备拍摄太阳的目标图像时,通过电子设备中的定位装置实时获取电子设备所在的地理位置处的经纬度信息,同时,获取用户拍摄目标图像时的日期信息以及时刻信息。在此基础上,再根据获取到的经纬度信息、日期信息以及时刻信息,对太阳在第一时间相对于电子设备所在的地理位置处的实际太阳高度角以及实际太阳方位角进行确定,并将该实际太阳高度角以及实际太阳方位角确定为上述第一实际方位信息。
其中,在实际的应用过程中,在确定实际太阳高度角以及实际太阳方位角时,可将经纬度信息、日期信息以及时刻信息这三个信息与太阳高度角、太阳方位角之间的关联关系预存储在电子设备,以供电子设备直接调取该关联关系对太阳在第一时间相对于电子设备所在的地理位置处的实际太阳高度角以及实际太阳方位角进行确定。
另外,在实际的应用过程中,在确定实际太阳高度角以及实际太阳方位角时,还可开启电子设备的联网功能,在获取到用户拍摄目标图像时的经纬度信息、日期信息以及时刻信息之后,实时查找与该经纬度信息、日期信息以及时刻信息相对应的实际太阳高度角以及实际太阳方位角。
本申请提供的上述实施例,根据目标图像确定太阳在第一时间相对于电子设备的相对高度角和相对方位角,并将该相对高度角和相对方位角确定为第一相对方位信息。进一步地,根据电子设备的地理位置和第一时间得到太阳在第一时间和地理位置的实际高度角和实际方位角,并将该实际高度角和实际方位角确定为第一实际方位信息。这样,通过对在第一时间拍摄到的太阳的目标图像进行分析的方式,对太阳在第一时间相对于电子设备的第一相对方位信息进行确定,以及根据拍摄目标图像时的日期信息、时刻信息以及电子设备的经纬度信息,对太阳在第一时间的第一实际方位信息进行确定,保证了上述第一实际方位信息以及第一相对方位信息确定的准确性,避免了环境磁场干扰后续指南针的校准结果,从而保证了对指南针的指示方位进行校准的准确性。
在本申请实施例中,上述根据第一实际方位信息和第一相对方位信息,确定电子设备的姿态信息的步骤,具体可包括下述的S110至S114:
S110:根据第一实际方位信息,确定太阳在第一时间在目标坐标系下的第一方位坐标。
其中,上述目标坐标系为导航坐标系,在实际的应用过程中,上述目标坐标系具体可为东北天坐标系、北东地坐标系等,本领域技术人员可根据实际情况对上述目标坐标系的具体类型进行设置,在此不作具体限制。
具体地,上述第一实际方位信息包括太阳在第一时间时相对于电子设备所在的地理位置的实际高度角和实际方位角。在确定上述第一实际方位信息之后,通过实际高度角以及实际方位角表示太阳在目标坐标系下的位置坐标。具体地,上述目标坐标系为以电子设备所在的地理位置为原点的三维坐标系,通过太阳在第一时间相对于电子设备所在的地理位置的实际高度角和实际方位角,分别表示太阳所在位置在上述目标坐标系中的X轴坐标、Y轴坐标以及Z轴坐标,从而得到上述第一方位坐标。
S112:根据第一相对方位信息,确定太阳在第一时间在电子设备的系统坐标系下的第二方位坐标。
其中,上述系统坐标系为电子设备自身的载体坐标系,该载体坐标系亦为三维坐标系,不同型号的电子设备的系统坐标系的格式相同或不相同,在此不作具体限制。
具体地,上述第一相对方位信息包括太阳在第一时间时相对于电子设备的相对高度角和相对方位角。在确定上述第一相对方位信息之后,通过相对高度角以及相对方位角表示太阳在电子设备的系统坐标系下的位置坐标。具体地,通过太阳在第一时间相对于电子设备的相对高度角和相对方位角,分别表示太阳所在位置在电子设备的系统坐标系中的X轴坐标、Y轴坐标以及Z轴坐标,从而得到上述第二方位坐标。
S114:根据第一方位坐标和第二方位坐标,确定电子设备在第一时间的姿态位姿信息。
可以理解的是,在确定太阳所在位置在上述目标坐标系中的X轴坐标、Y轴坐标以及Z轴坐标,从而得到上述第一方位坐标的过程中,需要结合太阳所在位置与目标坐标系原点之间的距离,来对太阳在目标坐标系下的位置坐标进行确定,也即,上述第一方位坐标中包含太阳所在位置与目标坐标系原点之间的距离、实际方位角以及实际高度角三个变量。在此基础上,通过对上述第一方位坐标进行分析处理,即可从第一方位坐标中拆解出仅包含上述实际方位角以及实际高度角两个变量的系数矩阵,记作第一系数矩阵。
进一步地,在确定太阳所在位置在电子设备的系统坐标系中的X轴坐标、Y轴坐标以及Z轴坐标,从而得到上述第二方位坐标阵的过程中,需要结合太阳所在位置与电子设备的系统坐标系原点之间的距离,来对太阳在该系统坐标系下的位置坐标进行确定,也即,上述第二方位坐标中包含太阳所在位置与系统坐标系原点之间的距离、相对方位角以及相对高度角三个变量。在此基础上,通过对上述第二方位坐标进行分析处理,即可从第二方位坐标中拆解出仅包含上述相对方位角以及相对高度角两个变量的系数矩阵,记作第二系数矩阵。
进一步地,可以理解的是,上述目标坐标系与电子设备的系统坐标系之间能够互相转化,也即上述第一实际方位信息和上述第一相对方位信息之间能够相互转换,也即上述第一方位坐标和上述第二方位坐标之间能够相互转换,也即上述第一系数矩阵和第二系数矩 阵之间能够相互转换。例如,如图9所示,在电子设备200的姿态发生变化后,基于电子设备的Xb’-Yb’-Zb’坐标系与Xb-Yb-Zb坐标系之间具备关联关系,二者之间能够相互转换。
在此基础上,通过对上述第一方位坐标以及第二方位坐标进行分析处理,即可确定上述第一方位坐标以及第二方位坐标之间的转换系数。也即,通过对上述第一系数矩阵以及第二系数矩阵进行分析处理,即可确定上述第一系数矩阵以及第二系数矩阵之间的转换矩阵,该转换矩阵可表示电子设备在上述第一时间的姿态信息。
因此,在本申请实施例所提出的指南针校准方法中,在确定上述第一方位坐标以及第二方位坐标之后,根据第一方位坐标确定第一系数矩阵,以及根据第二方位坐标确定第二系数矩阵。在此基础上,对上述第一系数矩阵以及第二系数矩阵进行分析处理,确定上述第一系数矩阵以及第二系数矩阵之间的转换矩阵,从而确定目标坐标系与电子设备的系统坐标系之间进行转换时的旋转欧拉角。
具体地,根据第一系数矩阵以及第二系数矩阵之间的转换矩阵,对目标坐标系转换为电子设备的系统坐标系时,目标坐标系所需转动的俯仰角、横滚角以及航向角等姿态角信息进行确定。其中,俯仰角为目标坐标系绕其Y轴转动的角度,横滚角为目标坐标系绕其X轴转动的角度,航向角为目标坐标系绕其Z轴转动的角度。
在此基础上,可以理解的是,上述目标坐标系以用户所在位置为原点,以平行于地球经纬线的轴线以及指向地心的轴线为坐标轴,电子设备的系统坐标系以电子设备中的某一点如电子设备的中心点为原点,以平行于电子设备的边界的轴线以及垂直于电子设备所在平面的轴线为坐标轴。因此,通过对上述目标坐标系所需转动的俯仰角、横滚角以及航向角等姿态角信息进行处理,即可确定电子设备在第一时间时在上述目标坐标系中的姿态信息。
示例性地,以目标坐标系为东北天坐标系为例,如图7所示,以用户所在位置为原点O,以正北方向为纵坐标轴Y(N),以正东方向为横坐标轴X(E),以垂直于地球表面向上的方向为竖坐标轴Z(U)建立目标坐标系。此时,在太阳即点G与目标坐标系的原点O之间的距离为R,点G相对于原点O的实际高度角为Ag,点G相对于原点O的方位角为ag的情况下,点G在目标坐标系中的位置坐标即上述第一方位坐标可表示为G(R×cosAg×cosag,R×cosAg×sinag,R×sinAg)。在此基础上,根据第一方位坐标即可确定上述第一系数矩阵为:
进一步地,如图8所示,在电子设备的系统坐标系中,在太阳即点B与系统坐标系的原点O’之间的距离为r,点B相对于原点O’的相对高度角为Ab,点B相对于原点O’的方位角为ab的情况下,点B在系统坐标系中的位置坐标即上述第二方位坐标可表示为B(-r×cosAb×sinab,r×sinAb,r×cosAb×cosab)。在此基础上,根据第二方位坐标即可确定上述第二系数矩阵为:
在此基础上,基于东北天坐标系的转换原理可知,在东北天坐标系按照Z-Y-X的转动顺序进行旋转的情况下,东北天坐标系对应的欧拉转换矩阵M可设定为:
其中,为东北天坐标系的偏航角,θ为东北天坐标系的横滚角,ψ为东北天坐标系的俯仰角。
在此基础上,可通过下述公式对上述第一系数矩阵以及第二系数矩阵之间的欧拉转换矩阵M中的各元素的具体数值进行确定,即对目标坐标系转换为电子设备的系统坐标系时,目标坐标系所需转动的俯仰角、横滚角以及航向角的具体角度值进行确定:
Nb=Ng·M。
本申请提供的上述实施例,在根据第一实际方位信息和第一相对方位信息,确定电子设备的姿态信息的过程中,具体地,根据第一实际方位信息,确定太阳在第一时间在目标坐标系下的第一方位坐标,以及根据第一相对方位信息,确定太阳第一时间在电子设备的系统坐标系下的第二方位坐标,进而再根据第一方位坐标和第二方位坐标,确定电子设备在第一时间的姿态位姿信息。这样,根据太阳在目标坐标系中的位置坐标以及太阳在电子设备的系统坐标系中的位置坐标,对电子设备在第一时间的姿态信息进行确定,在后续根据该姿态信息对电子设备中的指南针的指示方向进行校准时,能够避免指南针的校准结果受环境磁场的影响,从而保证了指南针的校准结果的准确性,保证了指南针指示方位的精确性。
在本申请实施例中,上述根据姿态信息校准指南针的指示方位的步骤,具体可包括下述的S116和S118:
S116:根据姿态信息确定电子设备在第一时间的设备方位参数。
具体地,上述目标坐标系以电子设备所在的地理位置为原点,以平行于地球经纬线的轴线以及指向地心的轴线为坐标轴。在确定电子设备在第一时间的姿态信息之后,通过对该姿态信息进行分析,即可确定在第一时间时电子设备中的东西南北四个方位、电子设备相对于地面的倾斜角度以及电子设备的转动角度,也即确定电子设备在第一时间的设备方位参数,以便根据确定的设备方位参数对电子设备中的指南针的指示方位进行校准。
S118:根据设备方位参数校准指南针的指示方位。
具体地,在确定电子设备在第一时间的设备方位参数之后,根据第一时间时电子设备中的东西南北四个方位、电子设备相对于地面的倾斜角度、电子设备的转动角度,对电子设备中的指南针的指示方位进行校准。
具体地,上述电子设备中设置有陀螺仪、重力传感器等可用于确定电子设备的转动角度、倾斜角度、移动距离等移动信息的零件,在电子设备的移动过程中,上述零件可实时记录电子设备的移动信息。在此基础上,在确定电子设备在第一时间的设备方位参数之后,在用户握持电子设备的姿势不变的情况下,也即在电子设备的姿态信息不变的情况下,直接根据电子设备在第一时间时的东西南北四个方位,对电子设备中的指南针的指示方向进行校准。而在电子设备的位置发生移动的情况下,则结合电子设备在上述第一时间时的东西南北四个方位以及电子设备的移动信息,对电子设备中的四个方位进行实时调整,进而通过电子设备中的四个方位对电子设备中的指南针的指示方位进行实时校准。
本申请提供的上述实施例,在根据电子设备的姿态信息校准指南针的指示方位的过程中,具体地,根据电子设备在第一时间的姿态信息确定电子设备在第一时间的设备方位参数,进而根据设备方位参数校准指南针的指示方位。这样,基于太阳在目标坐标系中的位置坐标以及太阳在电子设备的系统坐标系中的位置坐标,对电子设备在上述第一时间的姿态信息进行确定,进而根据该姿态信息对电子设备中的指南针的指示方向进行校准,避免了指南针的校准结果受环境磁场的影响,从而保证了指南针的校准结果的准确性,保证了指南针指示方位的精确性。
在本申请实施例中,上述第一时间位于目标时段之内,且在第一时间,太阳在电子设备所在的地理位置处的太阳高度角小于目标角度值。其中,目标时段为电子设备所在的地理位置在第一时间的对应日期的日照时段。
具体地,上述第一时间也即用户在对电子设备中的指南针执行校准操作的时刻,也即用户在拍摄太阳的目标图像时,拍摄时间应位于拍摄当天的日照时段内,以保证拍摄得到的目标图像中的太阳图像具有较高的清晰度,从而保证后续对目标图像进行分析处理时,待分析数据的准确性,进而保证对电子设备中的指南针进行校准的准确性。
进一步地,在上述第一时间时,应保证在电子设备所在的地理位置处测量得到的太阳高度角小于目标角度值。
其中,在实际的应用过程中,上述目标角度值具体可为85°、86°、87°、88°、89°、90°等数值,本领域技术人员可根据实际情况对上述目标角度值的具体数值进行设置,在此不作具体限制。
也就是说,在本申请实施例所提供的指南针校准方法中,在用户通过电子设备拍摄太阳的目标图像时,应保证拍摄目标图像的时刻,在电子设备所在的地理位置处测量得到的太阳高度角不会过大,也即保证在拍摄目标图像的时刻太阳并不会直射或接近直射电子设备所在的地理位置。如此,在对目标图像进行分析处理时,保证了待分析数据的可用性,进而保证了对电子设备中的指南针进行校准的准确性。
本申请提供的上述实施例,用户在拍摄太阳的目标图像时,拍摄时间即上述第一时间应位于拍摄当天的日照时段内,并且,在第一时间时,在电子设备所在的地理位置处测得的太阳高度角小于目标角度值。这样,保证了拍摄得到的目标图像中的太阳图像具有较高的清晰度,保证了对目标图像进行分析处理时,待分析数据的准确性以及可用性,从而保证了对电子设备中的指南针进行校准的准确性。
在本申请实施例中,在上述S108之后,本申请实施例提供的指南针校准方法具体还可包括下述的S120和S122:
S120:获取指南针在第二时间的工作精度。
其中,上述第二时间与第一时间相隔目标时长,该目标时长为上述第一实际方位信息以及第一相对方位信息的有效时长。在实际的应用过程中,上述目标时长具体可为150秒、3分钟、200秒等数值,本领域技术人员可根据实际情况对上述目标时长的具体数值进行设置,在此不作具体限制。
可以理解的是,太阳处于不断地移动过程中,在太阳的移动距离过大,或者在用户的移动距离较大的情况下,上述在第一时间获取到的第一实际方位信息以及第一相对方位信息,便不再适用于对当前时刻的指南针的指示方向进行校准。此时,若指南针的指示方位仍然有偏差,则需获取新的太阳方位信息,以再次对指南针的指示方位进行校准。
具体地,在上述获取到的第一实际方位信息以及第一相对方位信息失效的情况下,也即在上述第二时间,检测电子设备的指南针的工作精度,也即检测电子设备的指南针在第二时间的指向精确度。
S122:在工作精度小于目标数值的情况下,获取电子设备在第二时间的实际地理位置,根据太阳在第二时间相对于电子设备的第二相对方位信息,以及太阳在第二时间和实际地理位置的第二实际方位信息,更新指南针的指示方位。
其中,上述目标数值为判断指南针的指示方向是否精准的依据。在指南针的工作精度小于上述目标数值的情况下,说明指南针的工作精度较小,也即说明指南针的指示方向不够准确。
在实际的应用过程中,本领域技术人员可根据实际情况对上述目标数值的具体数值进行设置,在此不作具体限制。
具体地,在检测到电子设备的指南针在第二时间的指向精确度即工作进度小于目标数值的情况下,通过拍摄太阳图像并对拍摄得到的太阳图像进行分析的方式,对太阳在第二时间相对于电子设备的相对高度角和相对方位角进行确定,进而对太阳在第二时间相对于电子设备的第二相对方位信息进行确定。同时,根据拍摄太阳图像时电子设备的实际经纬度信息、拍摄日期以及拍摄时刻,对拍摄太阳图像时太阳在电子设备的实际地理位置处的实际高度角以及实际方位角进行确定,进而对太阳在第二时间的第二实际方位信息进行确定。
在此基础上,根据第二实际方位信息,确定太阳在第二时间在目标坐标系下的第三方位坐标,并根据该第三方位坐标确定第三系数矩阵。并且,根据第二相对方位信息,确定太阳在第二时间在电子设备的系统坐标系下的第四方位坐标,并根据该第四方位坐标确定第四系数矩阵。进一步地,通过对第三系数矩阵以及第四系数矩阵进行分析处理,确定电子设备在第二时间的姿态信息,进而根据该姿态信息确定电子设备在第二时间的设备方位参数,并根据该设备方位参数对电子设备中的指南针再次进行校准,以更新指南针的指示方位。
本申请提供的上述实施例,在根据第一实际方位信息和第一相对方位信息,校准指南针的指示方位之后,还会获取指南针在第二时间的工作精度。在工作精度小于目标数值的情况下,再根据太阳在第二时间相对于电子设备的第二相对方位信息,以及太阳在第二时间和实际地理位置的第二实际方位信息,更新指南针的指示方位。这样,在上述获取到的第一实际方位信息以及第一相对方位信息失效的情况下,若指南针的指示方位仍然有偏差,则获取新的太阳方位信息即上述第二实际方位信息以及第二相对方位信息,并根据获取到的第二实际方位信息以及第二相对方位信息,再次对指南针的指示方位进行校准,保证了对指南针的指示方位进行校准的及时性以及准确性。
综上所述,本申请实施例所提供的指南针校准方法,基于太阳的实际方位信息以及太阳对电子设备的相对方位信息对指南针的指示方位进行校准,避免了对指南针的校准结果受环境磁场的影响,从而保证了指南针的校准结果的准确性,保证了指南针指示方位的精确性。
示例性地,如图2所示,用户打开电子设备200中的指南针应用程序,电子设备200显示第一界面202,第一界面202为指南针罗盘界面,用户可根据第一界面202中的指南针的指示方位来辨别方向。在此基础上,在电子设备200检测到指南针的工作精度小于目标数值的情况下,如图3所示,电子设备200显示第二界面204,该第二界面204为指南针手动校准界面,用户可在第二界面204内,根据指示信息对指南针的指示方位进行手动校准。在此基础上,在用户对指南针进行手动校准之后,指南针的工作精度仍小于目标数值的情况下,或者在电子设备200检测到周围环境的磁场信息存在异常且持续一定时间如5秒的情况下,若当前时刻位于一天之中的光照时段,且太阳不会直射用户所在位置区域,此时,如图4所示,电子设备200显示第三界面206,第三界面206中包括目标控件208。电子设 备200接收并响应于用户对目标控件208的触控输入,如图5所示,电子设备200显示第四界面210,该第四界面210为指南针自动校准界面。
进一步地,如图5所示,第四界面210中显示有目标圆框212,用户可在第四界面210内根据指示信息拍摄太阳的目标图像。其中,在拍摄太阳的目标图像的过程中,如图6所示,在太阳图像未完整显示在目标圆框212之内的情况下,或者在拍摄得到的目标图像不清晰的情况下,电子设备200会向用户发送重新拍摄太阳图像的提示信息,直至用户在第四界面210内拍摄到太阳图像清晰显示的目标图像。同时,在用户拍摄目标图像的同时,电子设备200会获取用户拍摄目标图像时用户所在位置的经纬度信息以及拍摄时间。在此基础上,电子设备200根据用户拍摄目标图像时用户所在位置的经纬度信息以及拍摄时间,对用户拍摄目标图像时太阳相对于用户所在位置区域的实际方位信息进行确定。同时,电子设备200通过对用户拍摄到的目标图像进行分析处理,对用户拍摄目标图像时太阳相对于电子设备200的相对方位信息进行确定。在此基础上,电子设备200对上述确定的实际方位信息以及相对方位信息进行分析处理,以确定用户拍摄目标图像时电子设备200中的东西南北四个方位,并根据确定的四个方位以及自身的移动信息,对指南针的指示方位进行实时校准。
本申请第一方面的实施例提供的指南针校准方法,执行主体可以为指南针校准装置。本申请实施例中以指南针校准装置执行上述指南针校准方法为例,说明本申请第二方面实施例提供的指南针校准装置。
如图10所示,本申请实施例提供一种指南针校准装置1000,该装置可以包括下述的获取模块1002、第一确定模块1004、第二确定模块1006、计算模块1008以及校准模块1010。
获取模块1002,用于获取目标图像,目标图像包括太阳,目标图像的拍摄时间为第一时间;
第一确定模块1004,用于根据目标图像确定太阳在第一时间相对于电子设备的第一相对方位信息;
第二确定模块1006,用于根据电子设备的地理位置和第一时间得到太阳在第一时间和地理位置的第一实际方位信息;
计算模块1008,用于根据第一实际方位信息和第一相对方位信息,确定电子设备的姿态信息;
校准模块1010,用于根据姿态信息校准指南针的指示方位。
通过本申请实施例提供的指南针校准装置1000,对于包括指南针应用程序即终端指南针的电子设备,在对该终端指南针的指示方位进行校准的过程中,通过在第一时间拍摄到的太阳的目标图像确定太阳在第一时间相对于电子设备的第一相对方位信息,同时确定拍摄目标图像时太阳相对于电子设备所在的地理位置处的第一实际方位信息。在此基础上,再根据上述第一实际方位信息与第一相对方位信息之间的关联关系,对电子设备在第一时间的姿态信息进行确定,进而在根据该姿态信息对指南针的指示方位进行校准。这样,基 于太阳的实际方位信息以及通过拍摄太阳图像得到的太阳对电子设备的相对方位信息对指南针的指示方位进行校准,避免了对指南针的校准结果受环境磁场的影响,从而保证了指南针的校准结果的准确性,保证了指南针指示方位的精确性。
在本申请实施例中,第一确定模块1004具体用于:根据目标图像确定太阳在第一时间相对于电子设备的相对高度角和相对方位角,将相对高度角和相对方位角确定为第一相对方位信息;第二确定模块1006具体用于:根据电子设备的地理位置和第一时间得到太阳在第一时间和地理位置的实际高度角和实际方位角,将实际高度角和实际方位角确定为第一实际方位信息。
本申请提供的上述实施例,根据目标图像确定太阳在第一时间相对于电子设备的相对高度角和相对方位角,并将该相对高度角和相对方位角确定为第一相对方位信息。进一步地,根据电子设备的地理位置和第一时间得到太阳在第一时间和地理位置的实际高度角和实际方位角,并将该实际高度角和实际方位角确定为第一实际方位信息。这样,通过对在第一时间拍摄到的太阳的目标图像进行分析的方式,对太阳在第一时间相对于电子设备的第一相对方位信息进行确定,以及根据拍摄目标图像时的日期信息、时刻信息以及电子设备的经纬度信息,对太阳在第一时间的第一实际方位信息进行确定,保证了上述第一实际方位信息以及第一相对方位信息确定的准确性,避免了环境磁场干扰后续指南针的校准结果,从而保证了对指南针的指示方位进行校准的准确性。
在本申请实施例中,计算模块1008具体用于:根据第一实际方位信息,确定太阳在第一时间在目标坐标系下的第一方位坐标;根据第一相对方位信息,确定太阳第一时间在电子设备的系统坐标系下的第二方位坐标;根据第一方位坐标和第二方位坐标,确定电子设备在第一时间的位姿信息。
本申请提供的上述实施例,在根据第一实际方位信息和第一相对方位信息,确定电子设备的姿态信息的过程中,具体地,根据第一实际方位信息,确定太阳在第一时间在目标坐标系下的第一方位坐标,以及根据第一相对方位信息,确定太阳第一时间在电子设备的系统坐标系下的第二方位坐标,进而再根据第一方位坐标和第二方位坐标,确定电子设备在第一时间的姿态位姿信息。这样,根据太阳在目标坐标系中的位置坐标以及太阳在电子设备的系统坐标系中的位置坐标,对电子设备在第一时间的姿态信息进行确定,在后续根据该姿态信息对电子设备中的指南针的指示方向进行校准时,能够避免指南针的校准结果受环境磁场的影响,从而保证了指南针的校准结果的准确性,保证了指南针指示方位的精确性。
在本申请实施例中,校准模块1010具体用于:根据姿态信息确定电子设备在第一时间的设备方位参数;根据设备方位参数校准指南针的指示方位。
本申请提供的上述实施例,在根据电子设备的姿态信息校准指南针的指示方位的过程中,具体地,根据电子设备在第一时间姿态信息确定电子设备在第一时间的设备方位参数,进而根据设备方位参数校准指南针的指示方位。这样,基于太阳在目标坐标系中的位置坐 标以及太阳在电子设备的系统坐标系中的位置坐标,对电子设备在上述第一时间的姿态信息进行确定,进而根据该姿态信息对电子设备中的指南针的指示方向进行校准,避免了指南针的校准结果受环境磁场的影响,从而保证了指南针的校准结果的准确性,保证了指南针指示方位的精确性。
在本申请实施例中,第一时间位于目标时段之内,且在第一时间,太阳在电子设备所在的地理位置处的太阳高度角小于目标角度值;其中,目标时段为电子设备所在的地理位置在第一时间的对应日期的日照时段。
本申请提供的上述实施例,用户在拍摄太阳的目标图像时,拍摄时间即上述第一时间应位于拍摄当天的日照时段内,并且,在第一时间时,在电子设备所在的地理位置处测得的太阳高度角小于目标角度值。这样,保证了拍摄得到的目标图像中的太阳图像具有较高的清晰度,保证了对目标图像进行分析处理时,待分析数据的准确性以及可用性,从而保证了对电子设备中的指南针进行校准的准确性。
在本申请实施例中,获取模块1002还用于:获取指南针在第二时间的工作精度;在工作精度小于目标数值的情况下,获取电子设备在第二时间的实际地理位置;校准模块1010还用于:根据太阳在第二时间相对于电子设备的第二相对方位信息,以及太阳在第二时间和实际地理位置的第二实际方位信息,更新指南针的指示方位。
本申请提供的上述实施例,在根据第一实际方位信息和第一相对方位信息,校准指南针的指示方位之后,还会获取指南针在第二时间的工作精度。在工作精度小于目标数值的情况下,再根据太阳在第二时间相对于电子设备的第二相对方位信息,以及太阳在第二时间和实际地理位置的第二实际方位信息,更新指南针的指示方位。这样,在上述获取到的第一实际方位信息以及第一相对方位信息失效的情况下,若指南针的指示方位仍然有偏差,则获取新的太阳方位信息即上述第二实际方位信息以及第二相对方位信息,并根据获取到的第二实际方位信息以及第二相对方位信息,再次对指南针的指示方位进行校准,保证了对指南针的指示方位进行校准的及时性以及准确性。
本申请实施例中的指南针校准装置1000可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。
本申请实施例中的指南针校准装置1000可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为iOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。
本申请第二方面实施例提供的指南针校准装置1000能够实现图1的方法实施例实现的各个过程,为避免重复,这里不再赘述。
可选地,如图11所示,本申请实施例还提供一种电子设备1100,包括处理器1102和存储器1104,存储器1104上存储有可在处理器1102上运行的程序或指令,该程序或指令被处理器1102执行时实现上述第一方面的指南针校准方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,本申请实施例中的电子设备包括上述的移动电子设备和非移动电子设备。
图12为实现本申请实施例的一种电子设备的硬件结构示意图。
该电子设备1200包括但不限于:射频单元1201、网络模块1202、音频输出单元1203、输入单元1204、传感器1205、显示单元1206、用户输入单元1207、接口单元1208、存储器1209、以及处理器1210等部件。
本领域技术人员可以理解,电子设备1200还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1210逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图12中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。
本申请实施例的电子设备1200可用于实现上述第一方面指南针校准方法实施例的各个步骤。
其中,用户输入单元1207,用于获取目标图像,目标图像包括太阳,目标图像的拍摄时间为第一时间。
处理器1210,用于根据目标图像确定太阳在第一时间相对于电子设备的第一相对方位信息。
处理器1210,还用于根据电子设备的地理位置和第一时间得到太阳在第一时间和地理位置的第一实际方位信息。
处理器1210,还用于根据第一实际方位信息和第一相对方位信息,确定电子设备的姿态信息,根据姿态信息校准指南针的指示方位。
在本申请实施例中,对于包括指南针应用程序即终端指南针的电子设备,在对该终端指南针的指示方位进行校准的过程中,通过在第一时间拍摄到的太阳的目标图像确定太阳在第一时间相对于电子设备的第一相对方位信息,同时确定拍摄目标图像时太阳相对于电子设备所在的地理位置处的第一实际方位信息。在此基础上,再根据上述第一实际方位信息与第一相对方位信息之间的关联关系,对电子设备在第一时间的姿态信息进行确定,进而在根据该姿态信息对指南针的指示方位进行校准。这样,基于太阳的实际方位信息以及通过拍摄太阳图像得到的太阳对电子设备的相对方位信息对指南针的指示方位进行校准, 避免了对指南针的校准结果受环境磁场的影响,从而保证了指南针的校准结果的准确性,保证了指南针指示方位的精确性。
可选地,处理器1210具体用于:根据目标图像确定太阳在第一时间相对于电子设备的相对高度角和相对方位角,将相对高度角和相对方位角确定为第一相对方位信息;根据电子设备的地理位置和第一时间得到太阳在第一时间和地理位置的实际高度角和实际方位角,将实际高度角和实际方位角确定为第一实际方位信息。
本申请提供的上述实施例,根据目标图像确定太阳在第一时间相对于电子设备的相对高度角和相对方位角,并将该相对高度角和相对方位角确定为第一相对方位信息。进一步地,根据电子设备的地理位置和第一时间得到太阳在第一时间和地理位置的实际高度角和实际方位角,并将该实际高度角和实际方位角确定为第一实际方位信息。这样,通过对在第一时间拍摄到的太阳的目标图像进行分析的方式,对太阳在第一时间相对于电子设备的第一相对方位信息进行确定,以及根据拍摄目标图像时的日期信息、时刻信息以及电子设备的经纬度信息,对太阳在第一时间的第一实际方位信息进行确定,保证了上述第一实际方位信息以及第一相对方位信息确定的准确性,避免了环境磁场干扰后续指南针的校准结果,从而保证了对指南针的指示方位进行校准的准确性。
可选地,处理器1210具体用于:根据第一实际方位信息,确定太阳在第一时间在目标坐标系下的第一方位坐标;根据第一相对方位信息,确定太阳第一时间在电子设备的系统坐标系下的第二方位坐标;根据第一方位坐标和第二方位坐标,确定电子设备在第一时间的位姿信息。
本申请提供的上述实施例,在根据第一实际方位信息和第一相对方位信息,确定电子设备在第一时间的位姿信息的过程中,具体地,根据第一实际方位信息,确定太阳在第一时间在目标坐标系下的第一方位坐标,以及根据第一相对方位信息,确定太阳第一时间在电子设备的系统坐标系下的第二方位坐标,进而再根据第一方位坐标和第二方位坐标,确定电子设备在第一时间的位姿信息。这样,根据太阳在目标坐标系中的位置坐标以及太阳在电子设备的系统坐标系中的位置坐标,对电子设备在上述第一时间确定电子设备在第一时间的位姿信息进行确定,在后续根据该姿态信息对电子设备中的指南针的指示方向进行校准时,能够避免指南针的校准结果受环境磁场的影响,从而保证了指南针的校准结果的准确性,保证了指南针指示方位的精确性。
可选地,处理器1210具体用于:根据姿态信息确定电子设备在第一时间的设备方位参数;根据设备方位参数校准指南针的指示方位。
本申请提供的上述实施例,在根据电子设备的姿态信息校准指南针的指示方位的过程中,具体地,根据电子设备在第一时间的姿态信息确定电子设备在第一时间的设备方位参数,进而根据设备方位参数校准指南针的指示方位。这样,基于太阳在目标坐标系中的位置坐标以及太阳在电子设备的系统坐标系中的位置坐标,对电子设备在上述第一时间的姿态信息进行确定,进而根据该姿态信息对电子设备中的指南针的指示方向进行校准,避免 了指南针的校准结果受环境磁场的影响,从而保证了指南针的校准结果的准确性,保证了指南针指示方位的精确性。
可选地,第一时间位于目标时段之内,且在第一时间,太阳在电子设备所在的地理位置处的太阳高度角小于目标角度值;其中,目标时段为电子设备所在的地理位置在第一时间的对应日期的日照时段。
本申请提供的上述实施例,用户在拍摄太阳的目标图像时,拍摄时间即上述第一时间应位于拍摄当天的日照时段内,并且,在第一时间时,在电子设备所在的地理位置处测得的太阳高度角小于目标角度值。这样,保证了拍摄得到的目标图像中的太阳图像具有较高的清晰度,保证了对目标图像进行分析处理时,待分析数据的准确性以及可用性,从而保证了对电子设备中的指南针进行校准的准确性。
可选地,处理器1210还用于:获取指南针在第二时间的工作精度;在工作精度小于目标数值的情况下,获取电子设备在第二时间的实际地理位置,根据太阳在第二时间相对于电子设备的第二相对方位信息,以及太阳在第二时间和实际地理位置的第二实际方位信息,更新指南针的指示方位。
本申请提供的上述实施例,在根据第一实际方位信息和第一相对方位信息,校准指南针的指示方位之后,还会获取指南针在第二时间的工作精度。在工作精度小于目标数值的情况下,再根据太阳在第二时间相对于电子设备的第二相对方位信息,以及太阳在第二时间和实际地理位置的第二实际方位信息,更新指南针的指示方位。这样,在上述获取到的第一实际方位信息以及第一相对方位信息失效的情况下,若指南针的指示方位仍然有偏差,则获取新的太阳方位信息即上述第二实际方位信息以及第二相对方位信息,并根据获取到的第二实际方位信息以及第二相对方位信息,再次对指南针的指示方位进行校准,保证了对指南针的指示方位进行校准的及时性以及准确性。
应理解的是,本申请实施例中,输入单元1204可以包括图形处理器(Graphics Processing Unit,GPU)12041和麦克风12042,图形处理器12041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元1206可包括显示面板12061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板12061。用户输入单元1207包括触控面板12071以及其他输入设备12072中的至少一种。触控面板12071,也称为触摸屏。触控面板12071可包括触摸检测装置和触摸控制器两个部分。其他输入设备12072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。
存储器1209可用于存储软件程序以及各种数据。存储器1209可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器1209可以包括易失性存储器或非易失性存储器,或者,存储器1209可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、 可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器1209包括但不限于这些和任意其它适合类型的存储器。
处理器1210可包括一个或多个处理单元;可选的,处理器1210集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器1210中。
本申请实施例还提供一种可读存储介质,可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述第一方面指南针校准方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
其中,处理器为上述实施例中的电子设备中的处理器。可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。
本申请实施例另提供了一种芯片,芯片包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行程序或指令,实现上述第一方面指南针校准方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。
本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述第一方面指南针校准方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。

Claims (13)

  1. 一种指南针校准方法,包括:
    获取目标图像,所述目标图像包括太阳,所述目标图像的拍摄时间为第一时间;
    根据所述目标图像确定太阳在所述第一时间相对于电子设备的第一相对方位信息;
    根据电子设备的地理位置和所述第一时间得到太阳在所述第一时间和所述地理位置的第一实际方位信息;
    根据所述第一实际方位信息和所述第一相对方位信息,确定所述电子设备的姿态信息,根据所述姿态信息校准指南针的指示方位。
  2. 根据权利要求1所述的指南针校准方法,其中,所述根据目标图像确定太阳在第一时间相对于所述电子设备的第一相对方位信息,包括:
    根据所述目标图像确定太阳在所述第一时间相对于所述电子设备的相对高度角和相对方位角,将所述相对高度角和所述相对方位角确定为所述第一相对方位信息;
    所述根据电子设备的地理位置和所述第一时间得到太阳在所述第一时间和所述地理位置的第一实际方位信息,包括:
    根据所述电子设备的地理位置和所述第一时间得到太阳在所述第一时间和所述地理位置的实际高度角和实际方位角,将所述实际高度角和所述实际方位角确定为所述第一实际方位信息。
  3. 根据权利要求1所述的指南针校准方法,其中,所述根据所述第一实际方位信息和所述第一相对方位信息,确定所述电子设备的姿态信息,包括:
    根据所述第一实际方位信息,确定太阳在所述第一时间在目标坐标系下的第一方位坐标;
    根据所述第一相对方位信息,确定太阳所述第一时间在所述电子设备的系统坐标系下的第二方位坐标;
    根据所述第一方位坐标和所述第二方位坐标,确定所述电子设备在所述第一时间的姿态信息。
  4. 根据权利要求3所述的指南针校准方法,其中,所述根据所述姿态信息校准指南针的指示方位,包括:
    根据所述姿态信息确定所述电子设备在所述第一时间的设备方位参数;
    根据所述设备方位参数校准所述指南针的指示方位。
  5. 一种指南针校准装置,包括:
    获取模块,用于获取目标图像,所述目标图像包括太阳,所述目标图像的拍摄时间为第一时间;
    第一确定模块,用于根据所述目标图像确定太阳在所述第一时间相对于电子设备的第一相对方位信息;
    第二确定模块,用于根据电子设备的地理位置和所述第一时间得到太阳在所述第一时间和所述地理位置的第一实际方位信息;
    计算模块,用于根据所述第一实际方位信息和所述第一相对方位信息,确定所述电子设备的姿态信息;
    校准模块,用于根据所述姿态信息校准指南针的指示方位。
  6. 根据权利要求5所述的指南针校准装置,其中,所述第一确定模块具体用于:
    根据所述目标图像确定太阳在所述第一时间相对于所述电子设备的相对高度角和相对方位角,将所述相对高度角和所述相对方位角确定为所述第一相对方位信息;
    所述第二确定模块具体用于:
    根据所述电子设备的地理位置和所述第一时间得到太阳在所述第一时间和所述地理位置的实际高度角和实际方位角,将所述实际高度角和所述实际方位角确定为所述第一实际方位信息。
  7. 根据权利要求5或6所述的指南针校准装置,其中,所述计算模块具体用于:
    根据所述第一实际方位信息,确定太阳在所述第一时间在目标坐标系下的第一方位坐标;
    根据所述第一相对方位信息,确定太阳所述第一时间在所述电子设备的系统坐标系下的第二方位坐标;
    根据所述第一方位坐标和所述第二方位坐标,确定所述电子设备在所述第一时间的姿态信息。
  8. 根据权利要求7所述的指南针校准装置,其中,所述校准模块具体用于:
    根据所述姿态信息确定所述电子设备在所述第一时间的设备方位参数;
    根据所述设备方位参数校准所述指南针的指示方位。
  9. 一种电子设备,包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1至4中任一项所述的指南针校准方法的步骤。
  10. 一种可读存储介质,所述可读存储介质上存储有程序或指令,所述程序或指令被处理器执行时实现如权利要求1至4中任一项所述的指南针校准方法的步骤。
  11. 一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1-4任一项所述的方法的步骤。
  12. 一种计算机程序产品,所述计算机程序产品被至少一个处理器执行以实现如权利要求1-4任一项所述的方法的步骤。
  13. 一种电子设备,所述电子设备被配置成用于执行如权利要求1-4任一项所述的方法。
PCT/CN2023/124769 2022-10-21 2023-10-16 指南针校准方法及装置、电子设备和可读存储介质 WO2024083082A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211292116.8A CN115655249A (zh) 2022-10-21 2022-10-21 指南针校准方法及装置、电子设备和可读存储介质
CN202211292116.8 2022-10-21

Publications (1)

Publication Number Publication Date
WO2024083082A1 true WO2024083082A1 (zh) 2024-04-25

Family

ID=84989476

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/124769 WO2024083082A1 (zh) 2022-10-21 2023-10-16 指南针校准方法及装置、电子设备和可读存储介质

Country Status (2)

Country Link
CN (1) CN115655249A (zh)
WO (1) WO2024083082A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020241130A1 (ja) * 2019-05-29 2020-12-03 古野電気株式会社 情報処理システム、方法、及びプログラム
CN115655249A (zh) * 2022-10-21 2023-01-31 维沃移动通信有限公司 指南针校准方法及装置、电子设备和可读存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1298091A (zh) * 2000-12-08 2001-06-06 中国科学院紫金山天文台 方位的精确测定方法
CN101241010A (zh) * 2007-10-25 2008-08-13 杭州米特科技有限公司 磁罗经自差自动校正方法及其装置
CN102884398A (zh) * 2010-05-07 2013-01-16 高通股份有限公司 取向传感器校准
WO2016151574A1 (en) * 2015-03-26 2016-09-29 Israel Aerospace Industries Ltd. Celestial compass and methods of use and calibration
WO2018055619A1 (en) * 2016-09-25 2018-03-29 Israel Aerospace Industries Ltd. Celestial compass and method of calibrating
CN111093266A (zh) * 2019-12-20 2020-05-01 维沃移动通信有限公司 一种导航校准方法及电子设备
CN115655249A (zh) * 2022-10-21 2023-01-31 维沃移动通信有限公司 指南针校准方法及装置、电子设备和可读存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1298091A (zh) * 2000-12-08 2001-06-06 中国科学院紫金山天文台 方位的精确测定方法
CN101241010A (zh) * 2007-10-25 2008-08-13 杭州米特科技有限公司 磁罗经自差自动校正方法及其装置
CN102884398A (zh) * 2010-05-07 2013-01-16 高通股份有限公司 取向传感器校准
WO2016151574A1 (en) * 2015-03-26 2016-09-29 Israel Aerospace Industries Ltd. Celestial compass and methods of use and calibration
WO2018055619A1 (en) * 2016-09-25 2018-03-29 Israel Aerospace Industries Ltd. Celestial compass and method of calibrating
CN111093266A (zh) * 2019-12-20 2020-05-01 维沃移动通信有限公司 一种导航校准方法及电子设备
CN115655249A (zh) * 2022-10-21 2023-01-31 维沃移动通信有限公司 指南针校准方法及装置、电子设备和可读存储介质

Also Published As

Publication number Publication date
CN115655249A (zh) 2023-01-31

Similar Documents

Publication Publication Date Title
WO2024083082A1 (zh) 指南针校准方法及装置、电子设备和可读存储介质
CA2981382C (en) Method of determining a direction of an object on the basis of an image of the object
US9219858B2 (en) Generating a composite field of view using a plurality of oblique panoramic images of a geographic area
KR101600741B1 (ko) 배향 센서 캘리브레이션
US8933986B2 (en) North centered orientation tracking in uninformed environments
US6587788B1 (en) Integrated position and direction system with radio communication for updating data
EP2312330A1 (en) Graphics-aided remote position measurement with handheld geodesic device
CN110986930B (zh) 设备定位方法、装置、电子设备及存储介质
US8684745B2 (en) Hand-held personal planetarium
CN113345028B (zh) 一种确定目标坐标变换信息的方法与设备
CN113295174B (zh) 一种车道级定位的方法、相关装置、设备以及存储介质
US20160041268A1 (en) Gnss device with proximity sensor for initiating data collection
JP2006295827A (ja) 携帯端末装置
WO2022098803A2 (en) Methods of and systems for remotely monitoring stationary systems using gnss-based technologies
CN115827906B (zh) 目标标注方法、装置、电子设备及计算机可读存储介质
CN115439528B (zh) 一种获取目标对象的图像位置信息的方法与设备
JP4111211B2 (ja) 方位データ生成方法、方位センサユニット、記憶媒体および携帯電子機器
CN115439531A (zh) 一种获取目标对象的目标空间位置信息的方法与设备
CN109813300B (zh) 一种定位方法及终端设备
CN101616225B (zh) 一种为数码相片提供地理信息标签的终端服务方法
CN111093266B (zh) 一种导航校准方法及电子设备
CN111443365A (zh) 一种定位方法及电子设备
CN115542277A (zh) 一种雷达法线标定方法、装置、系统、设备和存储介质
US20190197694A1 (en) Apparatuses, methods, and storage medium for preventing a person from taking a dangerous selfie
US11391596B2 (en) System and method for converging mediated reality positioning data and geographic positioning data