CN108495039B - Camera angle correction method and terminal - Google Patents

Camera angle correction method and terminal Download PDF

Info

Publication number
CN108495039B
CN108495039B CN201810307005.7A CN201810307005A CN108495039B CN 108495039 B CN108495039 B CN 108495039B CN 201810307005 A CN201810307005 A CN 201810307005A CN 108495039 B CN108495039 B CN 108495039B
Authority
CN
China
Prior art keywords
camera
value
angle value
angle
terminal
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201810307005.7A
Other languages
Chinese (zh)
Other versions
CN108495039A (en
Inventor
张强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810307005.7A priority Critical patent/CN108495039B/en
Publication of CN108495039A publication Critical patent/CN108495039A/en
Application granted granted Critical
Publication of CN108495039B publication Critical patent/CN108495039B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention discloses a camera angle correction method and a terminal, wherein the method comprises the following steps: receiving a camera rotation angle correction instruction, and starting the camera to rotate continuously; when detecting that the distance between the camera and a reference point on the terminal is equal to a reference value, acquiring an angle value of the camera; acquiring a preset reference angle value corresponding to the reference value, and calculating a difference value between the angle value of the camera and the reference angle value; and correcting the mapping relation between the prestored Hall value and the angle value according to the difference value. The method and the device can ensure that the terminal can correctly identify the angle value of the rotary camera in the environment with magnetic interference, and improve the accuracy of the terminal in identifying the angle of the rotary camera.

Description

Camera angle correction method and terminal
Technical Field
The invention relates to the technical field of terminals, in particular to a camera angle correction method and a terminal.
Background
With the continuous development of communication technology, functions integrated on the terminal are more and more abundant to enable the terminal to become an indispensable part in daily life, and particularly, a photographing function provided by the terminal enables a user to record and share own living state and beautiful scenery anytime and anywhere without additionally carrying a camera, so that the terminal is deeply loved by the majority of users. At present, many terminal manufacturers have introduced an electric rotary camera, such as a schematic structural diagram of a rotatable camera on a terminal shown in fig. 6, and the principle of the electric rotary camera is as follows: the camera is internally provided with a micro electric motor so that the camera can rotate, in addition, the camera is provided with a magnet, a digital Hall sensor is also arranged at a position, corresponding to the magnet on the camera, on a terminal body where the camera is located, when the camera rotates, the angle of the camera changes, the distance between the magnet on the camera and the digital Hall sensor also changes, and the Hall value of the digital Hall sensor also changes along with the change of the distance between the digital Hall sensor and the magnet, so that the rotating angle of the camera can be judged according to the Hall value.
However, the magnetic field is easily interfered by an external electromagnetic field, when the terminal is in different electromagnetic fields, even if the distances between the Hall sensors and the magnets are the same, the Hall values are different, and the service cycle of the rotary camera is prolonged along with the time, so that the hardware mechanical loss is generated, the angle identification of the rotary camera is inaccurate due to the reasons, and if the reasons are not solved for a long time, the deviation between the reading value of the camera inside the terminal and the actual value of the camera is larger and larger, so that the use of a user is influenced.
Disclosure of Invention
The embodiment of the invention provides a camera angle correction method and a terminal, which can enable the terminal to correctly identify the angle value of a rotary camera in an environment with magnetic interference and correct the problem of inaccurate identification of the angle value of the rotary camera caused by mechanical loss.
The embodiment of the invention provides a camera angle correction method, which comprises the following steps:
receiving a camera rotation angle correction instruction, and starting the camera to rotate continuously;
when detecting that the distance between the camera and a reference point on the terminal is equal to a reference value, acquiring an angle value of the camera;
acquiring a preset reference angle value corresponding to the reference value, and calculating a difference value between the angle value of the camera and the reference angle value;
and correcting the mapping relation between the prestored Hall value and the angle value according to the difference value.
Correspondingly, an embodiment of the present invention provides a terminal, where the terminal includes:
the camera control unit is used for receiving a camera rotation angle correction instruction and starting the camera to rotate continuously;
the angle value acquisition unit is used for acquiring the angle value of the camera when detecting that the distance between the camera and a reference point on the terminal is equal to a reference value;
the difference value calculating unit is used for acquiring a preset reference angle value corresponding to the reference value and calculating the difference value between the angle value of the camera and the reference angle value;
and the mapping correction unit is used for correcting the mapping relation between the pre-stored Hall value and the angle value according to the difference value.
According to the embodiment of the invention, a camera rotation angle correction instruction can be received, and the camera is started to rotate continuously; when detecting that the distance between the camera and a reference point on the terminal is equal to a reference value, acquiring an angle value of the camera; a preset reference angle value corresponding to the reference value can be obtained, and the difference value between the angle value of the camera and the reference angle value is calculated; and correcting the mapping relation between the prestored Hall value and the angle value according to the difference value. The terminal can correctly identify the angle value of the rotary camera in the environment with magnetic interference, the problem of inaccurate identification of the angle value of the rotary camera caused by mechanical loss can be corrected, and the accuracy of the terminal in identifying the angle of the rotary camera is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a camera angle correction method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of another camera angle correction method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an angle value obtaining unit according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a difference calculating unit according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a rotatable camera on a terminal according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In specific implementation, the terminal mentioned in the embodiment of the present invention includes but is not limited to: smart phones (such as Android phones and IOS phones), tablet computers, notebook computers, palmtop computers, wearable smart devices, and other electronic devices.
A camera angle correction method and a terminal according to an embodiment of the present invention will be described in detail with reference to fig. 1 to 6.
Referring to fig. 1, which is a schematic flow chart of a camera angle correction method according to an embodiment of the present invention, the camera angle correction method shown in the drawing may include the following steps:
and S101, receiving a camera rotation angle correction instruction, and starting the camera to rotate continuously.
In the specific implementation, the terminal can provide a user camera rotation angle correction option, and when the user uses the rotary camera to take a picture in an environment with magnetic interference or the user wants to correct the problem that the angle identification between the terminal and the rotary camera is inaccurate due to the mechanical loss of the rotary camera, the option can be opened so that the terminal can correctly identify the angle value formed between the camera and the terminal body.
The camera rotation angle correction option may also be automatically turned on by a terminal system when the terminal starts the camera application to take a picture or record a video and detects that the terminal is in a certain degree of magnetic interference environment, or a time period is preset in the terminal, and the terminal automatically turns on the option whenever the time period is reached, for example, the time period is 30 days, the time is calculated from the factory start of the terminal, and the terminal automatically turns on the option whenever the time reaches 30 days.
When the terminal starts the camera rotation angle correction option, it is determined to trigger a camera rotation angle correction instruction, and according to the foregoing, the camera rotation angle correction instruction may be automatically triggered by the terminal system under a certain condition, or may be triggered by a user through an input device (such as a physical keyboard and a touch screen) of the terminal, and the terminal receives the camera rotation angle correction instruction and executes step S102 to step S104.
S102, when the distance between the camera and a reference point on the terminal is detected to be equal to a reference value, the angle value of the camera is obtained.
In the concrete implementation, a camera rotation angle correction instruction is received at the terminal, and when the camera is started to rotate, the distance between the camera and a reference point on the terminal body starts to be detected. Referring to fig. 6, fig. 6 is a schematic structural diagram of a rotatable camera on a terminal according to an embodiment of the present invention, a distance sensor may be installed on a rotation module where the camera is located, and when the camera starts to rotate, the distance sensor is started at the same time, and a distance value between the camera and a reference point on a terminal body is continuously detected in a rotation process of the camera. And when the distance between the camera and the reference point on the terminal is detected to be equal to the reference value, acquiring the angle value of the camera. The reference value may be a specific distance value, for example, the distance value when the camera is closest to the reference point on the terminal is used as the reference value. The angle value of the camera can be obtained by judging the rotation direction of the camera and reading the Hall value of the Hall sensor on the terminal body.
The distance sensor includes but is not limited to: ultrasonic ranging sensors, laser ranging sensors, radar ranging sensors, and infrared ranging sensors. When a plurality of reference points are provided, the camera can stop rotating only when detecting that the distance between the camera and one of the reference points is equal to the corresponding reference value in the rotating process, so that the power resource of the terminal is saved, and the time is also saved. In this embodiment, if there are multiple reference points, the reference values corresponding to the distances between the reference points and the camera should be different, so as to prevent the terminal from being unable to correctly determine the angle between the current camera and the terminal body through the corresponding reference values.
S103, acquiring a preset reference angle value corresponding to the reference value, and calculating a difference value between the angle value of the camera and the reference angle value.
In specific implementation, when the distance between the camera and the reference point is equal to the reference value, an angle value between the camera and the terminal body is preset in the terminal, and the angle value is the reference angle value. For example, two reference points are set as reference point No. 1 and reference point No. 2, respectively, when the distance between the camera and the reference point No. 1 is 3cm, the angle between the camera and the terminal body is 60 degrees, and when the reference value of the distance between the camera and the reference point No. 2 is 1cm, the angle between the camera and the terminal body is 90 degrees. In the rotation process of the camera, when the distance between the camera and the reference point No. 2 is detected to be 1cm, a preset reference angle value corresponding to the preset reference angle value is obtained by 90 degrees, and then the difference value between the angle value of the camera obtained by the terminal in the step S102 and the reference angle value can be calculated.
And S104, correcting the mapping relation between the prestored Hall value and the angle value according to the difference value.
In specific implementation, when the terminal is in a magnetic interference environment to a certain extent or the rotary camera is frequently used to cause mechanical loss, the terminal often has a deviation in the angle identification problem of the rotary camera, and especially when the terminal is in the magnetic interference environment, the hall value output by the hall sensor has an overall deviation, for example, the overall output value is 5 units larger or 5 units smaller, and the overall camera angle value obtained at this time may be 10 degrees larger or 10 degrees smaller. In this embodiment, if the difference is calculated by subtracting the reference angle value from the angle value of the camera, the mapping relationship between the pre-stored hall values and the angle values is corrected by subtracting the difference from the angle value corresponding to each hall value; if the difference is calculated by subtracting the angle value of the camera from the reference angle value, the mapping relation between the pre-stored Hall value and the angle value is corrected, and the correction can be realized by adding the difference to the angle value corresponding to each Hall value. Optionally, after this step is performed, the camera may be reset, for example, rotated to a rear position.
In another optional embodiment, after performing step S104, the method further comprises: receiving a camera rotation instruction, and acquiring an initial angle value and an input target angle value of the camera; determining the rotation direction of the camera according to the difference value between the target angle value and the starting angle value; and controlling the camera to rotate to the target angle value in the clockwise or anticlockwise direction according to the corrected mapping relation between the Hall value and the angle value and the rotation direction of the camera.
In specific implementation, after the correction of the camera angle recognition is performed, the user can directly perform the angle adjustment of the camera to take pictures or record videos. For example, when the terminal is started in a camera application, when the terminal is detected to be in a strong magnetic interference environment, a camera rotation angle correction option is automatically started, after the camera angle identification and correction are successfully performed, a camera rotation instruction input by a user is received, the rotation direction (clockwise or counterclockwise direction) of the camera is determined according to the initial angle value of the camera and the target angle value input by the user at the moment, the current angle value of the camera is identified according to the mapping relation between the corrected Hall value and the angle value in the rotation process, and the camera is controlled to rotate to the target angle value for shooting.
In yet another optional embodiment, the method further comprises: collecting locked-rotor sound of the camera in the rotating process through a microphone; and if the continuous occurrence frequency of the locked-rotor sound reaches a preset value, controlling the camera to rotate in the opposite direction.
In a specific implementation, since the position where the camera starts to rotate is not necessarily a proper position, there is a possibility that the camera rotates to the minimum angle or the maximum angle, and the distance from the reference point is not detected to be equal to the reference value, and the camera is locked up, the method for correcting the angle of the camera in this embodiment cannot be executed any more. In order to prevent the situation, the locked-rotor sound can be stored in the terminal in advance, when the camera is started to rotate, the microphone is started, the sound recognition device is started, the locked-rotor sound of the camera in the rotating process is collected, when the continuous occurrence frequency of the locked-rotor sound reaches a preset value, the camera is confirmed to be locked-rotor, the camera rotates in the opposite direction at the moment, and the distance between the camera and a reference point on the terminal is continuously detected in the rotating process.
In a further optional embodiment, after performing step S104, the method further comprises: and receiving a Hall value and angle value mapping relation recovery instruction, deleting the corrected Hall value and angle value mapping relation, and recovering the pre-stored Hall value and angle value mapping relation before correction.
In the concrete realization, the environment that the user used the terminal is constantly changing, can not be in the magnetic interference environment for a long time usually to the service environment of terminal is all normal in most times, can not have too strong magnetic interference, consequently only need correct the camera angle temporarily under the environment that has magnetic interference. Therefore, the terminal can provide the option for the user to recover the mapping relation between the Hall value and the angle value before correction, so that the terminal only adopts the camera angle correction method under the environment with magnetic interference, and the camera angle identification of the terminal under the normal environment is not influenced.
According to the embodiment of the invention, a camera rotation angle correction instruction can be received, and the camera is started to rotate continuously; when detecting that the distance between the camera and a reference point on the terminal is equal to a reference value, acquiring an angle value of the camera; a preset reference angle value corresponding to the reference value can be obtained, and the difference value between the angle value of the camera and the reference angle value is calculated; and correcting the mapping relation between the prestored Hall value and the angle value according to the difference value. The terminal can correctly identify the angle value of the rotary camera in the environment with magnetic interference, the problem of inaccurate identification of the angle value of the rotary camera caused by mechanical loss can be corrected, and the accuracy of the terminal in identifying the angle of the rotary camera is improved.
Referring to fig. 2, which is a schematic flow chart of another camera angle correction method provided in the embodiment of the present invention, the camera angle correction method shown in the drawing may include the following steps:
s201, receiving a camera rotation angle correction instruction, and starting the camera to rotate continuously.
In specific implementation, the terminal can provide a user with a camera rotation angle correction option, and when the option is turned on, the option is regarded as a camera rotation angle correction triggering instruction. The camera rotation angle correction option is turned on, that is, a camera rotation angle correction instruction is triggered, which may be automatically triggered by a terminal system under a certain condition or triggered by a user through an input device (such as a physical keyboard and a touch screen) of the terminal, and the terminal receives the camera rotation angle correction instruction and executes step S202 to step S207.
S202, starting a distance sensor on the terminal, and detecting the distance between the camera and a reference point on the terminal through the distance sensor in the continuous rotation process of the camera.
In specific implementation, referring to fig. 6, fig. 6 is a schematic structural diagram of a rotatable camera on a terminal according to an embodiment of the present invention, a distance sensor may be installed on a rotation module where the camera is located, when the camera is started to start rotating, the distance sensor is started at the same time, and a distance value between the camera and a reference point on a terminal body is continuously detected in a rotation process of the camera. The distance sensor includes but is not limited to: ultrasonic ranging sensors, laser ranging sensors, radar ranging sensors, and infrared ranging sensors.
And S203, when the camera is detected to be closest to the reference point, acquiring a Hall value output by the digital Hall sensor on the terminal.
In specific implementation, for example, referring to fig. 6, the distance sensor may be installed on an opposite surface of a surface where the camera is located, when the camera is started to rotate, the distance sensor is simultaneously started to detect a distance between the camera and a reference point on the terminal body, the reference point may be set to the terminal body itself, at this time, when the camera is detected to be closest to the reference point, an actual angle value between the camera and the terminal body is 90 degrees, and due to the influence of magnetic interference or mechanical loss, the angle value of the camera read by the hall value output by the hall sensor at this time is not necessarily 90 degrees.
If the distance sensor is installed on the opposite surface of the surface where the camera is located, when the camera is placed backwards, the distance sensor is placed forwards. Therefore, when the distance sensor is arranged in the front and a user is in communication, when the distance between the terminal and the face of the person is detected to be smaller than a preset value, screen locking operation is further performed, misoperation of the user is prevented, and the use scene of the distance sensor can be enriched.
And S204, acquiring an angle value of the camera according to the Hall value.
In specific implementation, before leaving the factory, the angle value between the camera and the terminal corresponding to each hall value output by the hall sensor in the rotation process of the camera is usually set in advance through experiments, and the mapping between each hall value and the angle value is stored, so that a subsequent user can judge the angle value of the current camera through the hall value in the rotation process of the camera when using the rotary camera of the terminal.
S205, acquiring a reference angle value of the camera when the preset camera is closest to the reference point.
In a specific implementation, as described in step S203, if the distance sensor is installed on the opposite surface of the surface where the camera is located, and the angle value between the camera and the terminal when the camera is located at the rear is considered to be 0 degree, when the camera is closest to the reference point, the reference angle value (actual angle value) between the camera and the terminal should be 90 degrees.
S206, calculating the difference value between the angle value of the camera and the reference angle value.
In specific implementation, when the distance between the camera and the reference point is the shortest, an angle value between the camera and the terminal body can be preset in the terminal, and the angle value is a reference angle value. For example, two reference points are set as reference point No. 1 and reference point No. 2, respectively, when the distance between the camera and the reference point No. 1 is the closest, the angle value between the camera and the terminal body is 60 degrees, and when the distance between the camera and the reference point No. 2 is the closest, the angle value between the camera and the terminal body is 90 degrees. In the rotation process of the camera, when the camera detects that the camera is closest to the reference point No. 2, a preset reference angle value 90 degrees corresponding to the camera is obtained, and then the difference between the angle value of the camera obtained by the terminal in the step S204 and the reference angle value can be calculated.
And S207, correcting the mapping relation between the prestored Hall value and the angle value according to the difference value.
In specific implementation, when the terminal is in a magnetic interference environment to a certain extent or the rotary camera is frequently used to cause mechanical loss, the angle identification problem of the terminal on the rotary camera often deviates, especially when the terminal is in the magnetic interference environment, the hall value output by the hall sensor may deviate integrally at this time, for example, the output value is wholly larger by 5 units or smaller by 5 units, and the camera angle value obtained at this time may be wholly larger by 10 degrees or smaller by 10 degrees. In this embodiment, if the difference is calculated by subtracting the reference angle value from the angle value of the camera, the mapping relationship between the pre-stored hall values and the angle values is corrected by subtracting the difference from the angle value corresponding to each hall value; if the difference is calculated by subtracting the angle value of the camera from the reference angle value, the mapping relation between the pre-stored Hall value and the angle value is corrected, and the correction can be realized by adding the difference to the angle value corresponding to each Hall value.
According to the embodiment of the invention, the distance sensor is arranged on the terminal to detect the distance between the rotary camera and the reference point of the terminal body, the distance between the rotary camera and the reference point of the terminal is taken as the reference value of the distance between the rotary camera and the terminal, and the preset reference angle value of the rotary camera corresponding to the reference value is further obtained, so that the difference value between the angle value of the rotary camera and the reference angle value is calculated, and the mapping relation between the prestored Hall value and the angle value is corrected according to the difference value. The terminal can correctly identify the angle value of the rotary camera in the environment with magnetic interference, the problem of inaccurate identification of the angle value of the rotary camera caused by mechanical loss can be corrected, and the accuracy of the terminal in identifying the angle of the rotary camera is improved.
Referring to fig. 3, a schematic structural diagram of a terminal according to an embodiment of the present invention is shown, where the terminal at least includes: a camera control unit 301, an angle value acquisition unit 302, a difference calculation unit 303, and a mapping correction unit 304.
And the camera control unit 301 is configured to receive a camera rotation angle correction instruction and start the camera to rotate continuously.
In the specific implementation, the terminal can provide a user camera rotation angle correction option, and when the user uses the rotary camera to take a picture in an environment with magnetic interference or the user wants to correct the problem that the angle identification between the terminal and the rotary camera is inaccurate due to the mechanical loss of the rotary camera, the option can be opened so that the terminal can correctly identify the angle value formed between the camera and the terminal body.
The camera rotation angle correction option may also be automatically turned on by a terminal system when the terminal starts the camera application to take a picture or record a video and detects that the terminal is in a certain degree of magnetic interference environment, or a time period is preset in the terminal, and the terminal automatically turns on the option whenever the time period is reached, for example, the time period is 30 days, the time is calculated from the factory start of the terminal, and the terminal automatically turns on the option whenever the time reaches 30 days.
When the terminal starts the camera rotation angle correction option, it is regarded as triggering a camera rotation angle correction instruction, and according to the above, the camera rotation angle correction instruction may be automatically triggered by the terminal system under a certain condition, or may be triggered by a user through an input device (such as a physical keyboard and a touch screen) of the terminal, and the camera control unit 301 starts the camera to rotate after receiving the camera rotation angle correction instruction.
An angle value obtaining unit 302, configured to obtain an angle value of the camera when detecting that a distance between the camera and a reference point on the terminal is equal to a reference value.
In specific implementation, when the camera control unit 301 receives a camera rotation angle correction instruction and starts the camera to rotate, the distance between the camera and a reference point on the terminal body starts to be detected. When detecting that the distance between the camera and the reference point on the terminal is equal to the reference value, the angle value obtaining unit 302 obtains the angle value of the camera. The reference value may be a specific distance value, for example, the distance value when the camera is closest to the reference point on the terminal is used as the reference value. The angle value of the camera can be obtained by judging the rotation direction of the camera and reading the Hall value of the Hall sensor on the terminal body.
When a plurality of reference points are provided, the camera can stop rotating only when detecting that the distance between the camera and one of the reference points is equal to the corresponding reference value in the rotating process, so that the power resource of the terminal is saved, and the time is also saved. In this embodiment, if there are multiple reference points, the reference values corresponding to the distances between the reference points and the camera should be different, so as to prevent the terminal from being unable to correctly determine the angle between the current camera and the terminal body through the corresponding reference values.
Further, referring to fig. 4, fig. 4 is a schematic structural diagram of an angle value obtaining unit according to an embodiment of the present invention, where the angle value obtaining unit 302 as shown in the figure may include: a distance detection subunit 3201, a hall value acquisition subunit 3202, and an angle value acquisition subunit 3203.
A distance detecting subunit 3201, configured to start a distance sensor on the terminal, and detect a distance between the camera and a reference point on the terminal through the distance sensor in a process that the camera continuously rotates.
A hall value obtaining subunit 3202, configured to, when the distance detecting subunit detects that the camera is closest to the reference point, obtain a hall value output by the digital hall sensor on the terminal.
And an angle value obtaining subunit 3203, configured to obtain an angle value of the camera according to the hall value.
In a specific implementation, the distance detecting subunit 3201 may be embodied as a distance sensor, which includes but is not limited to: ultrasonic ranging sensors, laser ranging sensors, radar ranging sensors, and infrared ranging sensors. Referring to fig. 6, fig. 6 is a schematic structural diagram of a rotatable camera on a terminal according to an embodiment of the present invention, the distance sensor may be installed on an opposite surface of a surface where the camera is located, and when the camera is started to rotate, the distance sensor is started to detect a distance between the camera and a reference point on the terminal body. The reference point is set as the terminal body itself, and when it is detected that the camera is closest to the reference point, the actual angle value (i.e., the reference angle value) between the camera and the terminal body is 90 degrees, and due to the influence of magnetic interference or mechanical loss, the camera angle value read by the hall value acquired by the hall value acquiring subunit 3202 and the hall value acquiring subunit 3203 is not necessarily 90 degrees.
A difference calculating unit 303, configured to obtain a preset reference angle value corresponding to the reference value, and calculate a difference between the angle value of the camera and the reference angle value.
In specific implementation, when the distance between the camera and the reference point is equal to the reference value, an angle value between the camera and the terminal body is preset in the terminal, and the angle value is the reference angle value. For example, two reference points are set as reference point No. 1 and reference point No. 2, respectively, when the distance between the camera and the reference point No. 1 is 3cm, the angle between the camera and the terminal body is 60 degrees, and when the reference value of the distance between the camera and the reference point No. 2 is 1cm, the angle between the camera and the terminal body is 90 degrees. In the rotation process of the camera, when the distance between the camera and the No. 2 reference point is detected to be 1cm, a preset reference angle value corresponding to the distance is acquired by 90 degrees, and then the difference value calculating unit 303 calculates the difference value between the angle value of the camera acquired by the terminal and the reference angle value.
Further, referring to fig. 5, fig. 5 is a schematic structural diagram of a difference calculating unit according to an embodiment of the present invention; the difference calculation unit 303 as shown may include: a reference angle acquisition sub-unit 3301 and a difference value calculation sub-unit 3302.
A reference angle obtaining subunit 3301, configured to obtain a reference angle value of the camera when the preset camera is closest to the reference point.
A difference operator unit 3302, configured to calculate a difference between the angle value of the camera and the reference angle value.
In specific implementation, when the distance between the camera and the reference point is the shortest, an angle value between the camera and the terminal body can be preset in the terminal, and the angle value is a reference angle value. For example, two reference points are set as reference point No. 1 and reference point No. 2, respectively, when the distance between the camera and the reference point No. 1 is the closest, the angle value between the camera and the terminal body is 60 degrees, and when the distance between the camera and the reference point No. 2 is the closest, the angle value between the camera and the terminal body is 90 degrees. In the rotation process of the camera, when the camera detects that the camera is closest to the reference point No. 2, the reference angle obtaining subunit 3301 obtains a preset reference angle value 90 degrees corresponding to the reference angle value, and then the difference value calculating subunit 3302 can calculate the difference value between the angle value of the camera obtained by the terminal and the reference angle value.
And the mapping correction unit 304 is configured to correct the mapping relationship between the pre-stored hall value and the angle value according to the difference.
In specific implementation, when the terminal is in a magnetic interference environment to a certain extent or the rotary camera is frequently used to cause mechanical loss, the terminal often has a deviation in the angle identification problem of the rotary camera, and especially when the terminal is in the magnetic interference environment, the hall value output by the hall sensor has an overall deviation, for example, the overall output value is 5 units larger or 5 units smaller, and the overall camera angle value obtained at this time may be 10 degrees larger or 10 degrees smaller. In this embodiment, if the difference is calculated by subtracting the reference angle value from the angle value of the camera, the mapping correction unit 304 corrects the mapping relationship between the pre-stored hall values and the angle values by subtracting the difference from the angle value corresponding to each hall value; if the difference is calculated by subtracting the angle value of the camera from the reference angle value, the mapping correction unit 304 corrects the mapping relationship between the pre-stored hall values and the angle values by adding the difference to the angle values corresponding to the hall values.
In another optional embodiment, the angle value obtaining unit 302 is further configured to, after the mapping correcting unit 304 corrects the mapping relationship between the pre-stored hall value and the angle value according to the difference, receive a camera rotation instruction, and obtain a start angle value and an input target angle value of the camera;
correspondingly, the terminal further comprises: a direction determining unit 305, configured to determine a rotation direction of the camera according to a difference between the target angle value and the start angle value;
the camera control unit 301 is further configured to control the camera to rotate clockwise or counterclockwise to the target angle value according to the corrected mapping relationship between the hall value and the angle value and the rotation direction of the camera.
In specific implementation, after the correction of the camera angle recognition is performed, the user can directly perform the angle adjustment of the camera to take pictures or record videos. For example, when the terminal is started in a camera application, when it is detected that the terminal is in a strong magnetic interference environment, the camera rotation angle correction option is automatically started, after the camera angle identification and correction are successfully performed, a camera rotation instruction input by a user is received, the direction determining unit 305 determines the rotation direction (clockwise or counterclockwise) of the camera according to the initial angle value of the camera obtained by the angle value obtaining unit 302 and the target angle value input by the user, and the camera control unit 301 identifies the current angle value of the camera according to the mapping relationship between the corrected hall value and the angle value in the rotation process, so as to control the camera to rotate to the target angle value and perform photographing.
In yet another optional embodiment, the terminal further includes: and the sound acquisition unit 306 is used for acquiring locked-rotor sound of the camera in the rotation process through a microphone.
The camera control unit 301 is further configured to control the camera to rotate in the opposite direction when the continuous occurrence frequency of the locked-rotor sound reaches a preset value.
In a specific implementation, since the position where the camera starts to rotate is not necessarily a proper position, there is a possibility that the camera rotates to the minimum angle or the maximum angle, and the distance from the reference point is not detected to be equal to the reference value, and the camera is locked up, the method for correcting the angle of the camera in this embodiment cannot be executed any more. In order to prevent the occurrence of such a situation, a lock-up sound may be stored in the terminal in advance, when the camera is started to rotate, the sound collection unit 306 (which may be specifically a microphone) is turned on and the sound recognition device is started to collect the lock-up sound of the camera in the rotation process, when the number of times that the lock-up sound continuously occurs reaches a preset value, it is determined that the lock-up has occurred in the camera, at this time, the camera control unit 301 controls the camera to rotate in the opposite direction, and the terminal continues to detect the distance between the camera and the reference point on the terminal in the rotation process.
In yet another optional embodiment, the terminal further includes: a mapping recovering unit 307, configured to receive a hall value and angle value mapping relationship recovering instruction after the mapping correcting unit 304 corrects the mapping relationship between the pre-stored hall value and angle value according to the difference, delete the corrected mapping relationship between the hall value and angle value, and recover the mapping relationship between the pre-stored hall value and angle value before correction.
In the concrete realization, the environment that the user used the terminal is constantly changing, can not be in the magnetic interference environment for a long time usually to the service environment of terminal is all normal in most times, can not have too strong magnetic interference, consequently only need correct the camera angle temporarily under the environment that has magnetic interference. Therefore, the terminal can provide the option for the user to recover the mapping relation between the Hall value and the angle value before correction, so that the terminal only adopts the camera angle correction method under the environment with magnetic interference, and the camera angle identification of the terminal under the normal environment is not influenced.
In the embodiment of the present invention, the camera control unit 301, the angle value obtaining unit 302, the difference value calculating unit 303, and the mapping correcting unit 304 described above may be respectively used to receive a camera rotation angle correcting instruction, and start the camera to rotate continuously; when detecting that the distance between the camera and a reference point on the terminal is equal to a reference value, acquiring an angle value of the camera; acquiring a preset reference angle value corresponding to the reference value, and calculating a difference value between the angle value of the camera and the reference angle value; and correcting the mapping relation between the prestored Hall value and the angle value according to the difference value. The terminal can correctly identify the angle value of the rotary camera in the environment with magnetic interference, the problem of inaccurate identification of the angle value of the rotary camera caused by mechanical loss can be corrected, and the accuracy of the terminal in identifying the angle of the rotary camera is improved.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs.
The units in the terminal of the embodiment of the invention can be merged, divided and deleted according to actual needs.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The camera angle correction method and the terminal disclosed in the embodiments of the present invention have been described in detail, and the above disclosure is only for the preferred embodiments of the present invention, but certainly not for limiting the scope of the present invention, and therefore, the equivalent changes made in the claims of the present invention still belong to the scope covered by the present invention.

Claims (12)

1. A camera angle correction method, comprising:
receiving a camera rotation angle correction instruction, starting the camera to continuously rotate and starting a distance sensor on a terminal;
when the distance between the camera and a reference point on the terminal body is detected to be equal to a reference value through the distance sensor, acquiring an angle value of the camera;
acquiring a preset reference angle value corresponding to the reference value, and calculating a difference value between the angle value of the camera and the reference angle value;
correcting the mapping relation between the prestored Hall value and the angle value according to the difference value, and the correcting method comprises the following steps: if the difference is calculated by subtracting the reference angle value from the angle value of the camera, subtracting the difference from the angle value corresponding to each Hall value in the mapping relation, and if the difference is calculated by subtracting the angle value of the camera from the reference angle value, adding the difference to the angle value corresponding to each Hall value in the mapping relation.
2. The method according to claim 1, wherein the obtaining of the angle value of the camera when detecting that the distance between the camera and the reference point on the terminal is equal to the reference value comprises:
starting a distance sensor on a terminal, and detecting the distance between the camera and a reference point on the terminal through the distance sensor in the continuous rotation process of the camera;
when the camera is detected to be closest to the reference point, acquiring a Hall value output by a digital Hall sensor on the terminal;
and acquiring the angle value of the camera according to the Hall value.
3. The method according to claim 2, wherein the obtaining of a preset reference angle value corresponding to the reference value, and the calculating of the difference between the angle value of the camera and the reference angle value comprises:
acquiring a reference angle value of the camera when the preset camera is closest to the reference point;
calculating a difference between the angle value of the camera and the reference angle value.
4. The method of claim 1, wherein after correcting the pre-stored mapping between hall values and angle values based on the difference, the method further comprises:
receiving a camera rotation instruction, and acquiring an initial angle value and an input target angle value of the camera;
determining the rotation direction of the camera according to the difference value between the target angle value and the starting angle value;
and controlling the camera to rotate to the target angle value in the clockwise or anticlockwise direction according to the corrected mapping relation between the Hall value and the angle value and the rotation direction of the camera.
5. The method of claim 1, further comprising:
collecting locked-rotor sound of the camera in the rotating process through a microphone;
and if the continuous occurrence frequency of the locked-rotor sound reaches a preset value, controlling the camera to rotate in the opposite direction.
6. The method of claim 1, wherein after correcting the pre-stored mapping between hall values and angle values based on the difference, the method further comprises:
and receiving a Hall value and angle value mapping relation recovery instruction, deleting the corrected Hall value and angle value mapping relation, and recovering the pre-stored Hall value and angle value mapping relation before correction.
7. A terminal, comprising:
the camera control unit is used for receiving a camera rotation angle correction instruction, starting the camera to continuously rotate and starting a distance sensor on the terminal;
the angle value acquisition unit is used for acquiring the angle value of the camera when the distance between the camera and a reference point on the terminal body is detected to be equal to a reference value through the distance sensor;
the difference value calculating unit is used for acquiring a preset reference angle value corresponding to the reference value and calculating the difference value between the angle value of the camera and the reference angle value;
and the mapping correction unit is used for correcting the mapping relation between the prestored Hall values and the angle values according to the difference value, and is also used for subtracting the difference value from the angle value corresponding to each Hall value in the mapping relation if the difference value is calculated by subtracting the reference angle value from the angle value of the camera, and adding the difference value to the angle value corresponding to each Hall value in the mapping relation if the difference value is calculated by subtracting the angle value of the camera from the reference angle value.
8. The terminal according to claim 7, wherein the angle value obtaining unit comprises:
the distance detection subunit is used for starting a distance sensor on the terminal and detecting the distance between the camera and a reference point on the terminal through the distance sensor in the continuous rotation process of the camera;
the Hall value acquisition subunit is used for acquiring a Hall value output by a digital Hall sensor on the terminal when the distance detection subunit detects that the camera is closest to the reference point;
and the angle value acquisition subunit is used for acquiring the angle value of the camera according to the Hall value.
9. The terminal of claim 8, wherein the difference calculation unit comprises:
the reference angle acquiring subunit is configured to acquire a reference angle value of the camera when the preset camera is closest to the reference point;
and the difference value calculating subunit is used for calculating the difference value between the angle value of the camera and the reference angle value.
10. The terminal according to claim 7, wherein the angle value obtaining unit is further configured to, after the mapping correcting unit corrects the mapping relationship between the pre-stored hall value and the angle value according to the difference, receive a camera rotation instruction, and obtain a start angle value and an input target angle value of the camera;
the terminal further comprises:
the direction determining unit is used for determining the rotation direction of the camera according to the difference value between the target angle value and the starting angle value;
the camera control unit is further configured to control the camera to rotate clockwise or counterclockwise to the target angle value according to the corrected mapping relationship between the hall value and the angle value and the rotation direction of the camera.
11. The terminal of claim 7, further comprising:
the sound acquisition unit is used for acquiring locked-rotor sound of the camera in the rotation process through a microphone;
the camera control unit is further used for controlling the camera to rotate in the opposite direction when the continuous occurrence frequency of the locked-rotor sound reaches a preset value.
12. The terminal of claim 7, further comprising:
and the mapping recovery unit is used for receiving a Hall value and angle value mapping relationship recovery instruction after the mapping correction unit corrects the mapping relationship between the prestored Hall value and the angle value according to the difference, deleting the corrected mapping relationship between the Hall value and the angle value, and recovering the mapping relationship between the prestored Hall value and the angle value before correction.
CN201810307005.7A 2015-05-19 2015-05-19 Camera angle correction method and terminal Active CN108495039B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810307005.7A CN108495039B (en) 2015-05-19 2015-05-19 Camera angle correction method and terminal

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510260759.8A CN104902171B (en) 2015-05-19 2015-05-19 A kind of camera angle correcting method and terminal
CN201810307005.7A CN108495039B (en) 2015-05-19 2015-05-19 Camera angle correction method and terminal

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201510260759.8A Division CN104902171B (en) 2015-05-19 2015-05-19 A kind of camera angle correcting method and terminal

Publications (2)

Publication Number Publication Date
CN108495039A CN108495039A (en) 2018-09-04
CN108495039B true CN108495039B (en) 2020-05-08

Family

ID=54034537

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201810307005.7A Active CN108495039B (en) 2015-05-19 2015-05-19 Camera angle correction method and terminal
CN201510260759.8A Active CN104902171B (en) 2015-05-19 2015-05-19 A kind of camera angle correcting method and terminal

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201510260759.8A Active CN104902171B (en) 2015-05-19 2015-05-19 A kind of camera angle correcting method and terminal

Country Status (1)

Country Link
CN (2) CN108495039B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110312058B (en) * 2018-03-27 2020-09-11 华为技术有限公司 Three-camera device and terminal device
CN111381607B (en) * 2018-12-29 2021-11-30 华为技术有限公司 Method and device for calibrating direction of shooting equipment
CN109951702B (en) * 2019-03-29 2024-04-05 荣耀终端有限公司 Position detection mechanism, mobile terminal and position detection method
US11477385B2 (en) 2019-05-15 2022-10-18 Asustek Computer Inc. Electronic device with rotatable camera for protecting privacy
US11375125B2 (en) 2019-05-15 2022-06-28 Asustek Computer Inc. Electronic device
US10911593B2 (en) 2019-05-15 2021-02-02 Asustek Computer Inc. Electronic device having a rotatable camera module
US11546451B2 (en) 2019-05-15 2023-01-03 Asustek Computer Inc. Electronic device
US11240357B2 (en) 2019-05-15 2022-02-01 Asustek Computer Inc. Electronic device
CN111654633B (en) * 2020-06-22 2021-10-26 四川酷比通信设备有限公司 Camera-based lifting motor calibration method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104238579A (en) * 2014-09-26 2014-12-24 广东欧珀移动通信有限公司 Camera rotation control method applied to mobile terminal and mobile terminal
CN104618634A (en) * 2015-02-12 2015-05-13 深圳市欧珀通信软件有限公司 Mobile terminal and method for calibrating rotating angle of camera

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100716818B1 (en) * 2005-12-29 2007-05-09 삼성전기주식회사 Device for sensing position of camera and mobile phone comprising the same
KR101694797B1 (en) * 2010-12-21 2017-01-11 삼성전자주식회사 Method of operating a three-dimensional image sensor
CN103837169B (en) * 2014-02-28 2016-05-11 哈尔滨工业大学 For self-correcting apparatus and method and the magnetism encoder of magnetism encoder
CN104567652B (en) * 2014-12-19 2017-06-06 广东欧珀移动通信有限公司 Rotation angle of camera acquisition methods and device
CN104580906B (en) * 2014-12-31 2017-11-10 广东欧珀移动通信有限公司 A kind of method and device for correcting the rotating camera anglec of rotation

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104238579A (en) * 2014-09-26 2014-12-24 广东欧珀移动通信有限公司 Camera rotation control method applied to mobile terminal and mobile terminal
CN104618634A (en) * 2015-02-12 2015-05-13 深圳市欧珀通信软件有限公司 Mobile terminal and method for calibrating rotating angle of camera

Also Published As

Publication number Publication date
CN104902171B (en) 2018-05-01
CN104902171A (en) 2015-09-09
CN108495039A (en) 2018-09-04

Similar Documents

Publication Publication Date Title
CN108495039B (en) Camera angle correction method and terminal
US9116001B2 (en) Adaptive estimation of frame time stamp latency
CN108288044B (en) Electronic device, face recognition method and related product
CN109167877B (en) Terminal screen control method and device, terminal equipment and storage medium
CN111369590A (en) Multi-target tracking method and device, storage medium and electronic equipment
CN108055459B (en) Shooting method based on rotary camera and related product
EP3525135A1 (en) Methods and devices for updating fingerprint template
WO2017071050A1 (en) Mistaken touch prevention method and device for terminal with touch screen
CN104660907A (en) Shooting method and device as well as mobile terminal
US10325134B2 (en) Method and system for calibration of an optical fingerprint sensing device
CN104469167A (en) Automatic focusing method and device
CN108134904B (en) Method and terminal for preventing camera from idling
US10824891B2 (en) Recognizing biological feature
CN107135351B (en) Photographing method and photographing device
CN111583118B (en) Image stitching method and device, storage medium and electronic equipment
CN107623899B (en) Information processing method, information processing apparatus, storage medium, and electronic device
RU2638762C2 (en) Method and device for sending messages
CN105069426A (en) Similar picture determining method and apparatus
CN107133577B (en) Fingerprint identification method and device
JP2018029237A5 (en)
TW201741927A (en) Unlocking system and method
CN110738078A (en) face recognition method and terminal equipment
CN113506551A (en) Image orientation based on face orientation detection
CN110751685A (en) Depth information determination method, determination device, electronic device and vehicle
CN108600628B (en) Image capturing method and device, terminal and readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant