CN108111761B - Anti-shake processing method, terminal and computer readable storage medium - Google Patents

Anti-shake processing method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN108111761B
CN108111761B CN201711447002.5A CN201711447002A CN108111761B CN 108111761 B CN108111761 B CN 108111761B CN 201711447002 A CN201711447002 A CN 201711447002A CN 108111761 B CN108111761 B CN 108111761B
Authority
CN
China
Prior art keywords
camera
image
lens
angle
adjusting
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
CN201711447002.5A
Other languages
Chinese (zh)
Other versions
CN108111761A (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.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201711447002.5A priority Critical patent/CN108111761B/en
Publication of CN108111761A publication Critical patent/CN108111761A/en
Application granted granted Critical
Publication of CN108111761B publication Critical patent/CN108111761B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
    • H04N23/682Vibration or motion blur correction
    • H04N23/685Vibration or motion blur correction performed by mechanical compensation
    • H04N23/687Vibration or motion blur correction performed by mechanical compensation by shifting the lens or sensor position
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
    • H04N23/681Motion detection
    • H04N23/6812Motion detection based on additional sensors, e.g. acceleration sensors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
    • H04N23/682Vibration or motion blur correction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
    • H04N23/682Vibration or motion blur correction
    • H04N23/683Vibration or motion blur correction performed by a processor, e.g. controlling the readout of an image memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the invention discloses an anti-shake processing method, which comprises the following steps: if a camera of the terminal is in a working state and a first angle of the camera for first movement is larger than a preset angle, acquiring a first direction and a first displacement when the camera moves at the first angle; adjusting the lens of the camera to a first position along a second direction, and adjusting the first image to a second position along a direction opposite to the second direction; adjusting the lens from the first position to the first target position along the direction opposite to the second direction, and adjusting the first image from the second position to the second target position along the second direction; and displaying the first image on a display screen of the terminal based on the second target position. The embodiment of the invention also discloses a terminal and a computer readable storage medium, which solve the problem that if the camera of the intelligent terminal shakes more than a preset angle, the lens of the camera cannot perform corresponding compensation action, so that the output image drifts.

Description

Anti-shake processing method, terminal and computer readable storage medium
Technical Field
The present invention relates to computer processing technologies, and in particular, to an anti-shake processing method, a terminal, and a computer-readable storage medium.
Background
At present, with the popularization of intelligent terminals, cameras become standard configurations of the intelligent terminals, and shooting functions are provided for users. In the video shooting process, particularly under the condition that the intelligent terminal is held for shooting, if a camera of the intelligent terminal slightly moves, a lens of the camera can compensate for the slight movement; however, if the camera of the intelligent terminal moves greatly, the lens of the camera cannot perform corresponding compensation actions, so that the output image has a drift phenomenon.
Disclosure of Invention
In view of this, embodiments of the present invention are expected to provide an anti-shake processing method, a terminal, and a computer-readable storage medium, so as to solve the problem in the prior art that if a camera of an intelligent terminal shakes more than a preset angle, a lens of the camera cannot perform corresponding compensation actions, so that an output image drifts; the output image drift phenomenon caused by camera shake is effectively avoided, the display effect of the terminal is improved, and meanwhile, the intelligence of the terminal is improved.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
in a first aspect, an anti-shake processing method is provided, the method including:
if a camera of a terminal is in a working state and a first angle of the camera for first movement is larger than a preset angle, acquiring a first direction and a first displacement when the camera moves at the first angle;
adjusting a lens of the camera to a first position along a second direction, and adjusting a first image to a second position along a direction opposite to the second direction; the first image is an output image of an image sensor of a camera, and the second direction is different from the first direction;
adjusting the lens from the first position to a first target position along a direction opposite to the second direction, and adjusting the first image from the second position to a second target position along the second direction; wherein the first target position and the second target position have a corresponding relationship;
and displaying the first image on a display screen of the terminal based on the second target position.
Optionally, adjusting the lens to the first position along the second direction, and adjusting the first image to the second position along the opposite direction of the second direction includes:
adjusting a second displacement of the lens to the first position along the second direction, and adjusting the second displacement of the first image to the second position along the direction opposite to the second direction; wherein the second displacement amount is greater than or equal to the first displacement amount.
Optionally, the adjusting the lens from the first position to a first target position along a direction opposite to the second direction, and adjusting the first image from the second position to a second target position along the second direction includes:
adjusting a third displacement amount of the lens from the first position to the first target position along the direction opposite to the second direction, and adjusting the third displacement amount of the first image from the second position to the second target position along the second direction; wherein the third displacement amount is less than the second displacement amount.
Optionally, if the camera at the terminal is in a working state and the first angle at which the camera moves for the first time is greater than the preset angle, the first direction and the first displacement when the lens of the camera moves for the first angle are obtained, including:
if the camera is in a working state, acquiring a third position of the first image when the camera does not move for the first time;
if the camera moves for the first time, acquiring a fourth position of the first image and a first direction corresponding to the first movement when the first movement occurs;
and obtaining the first displacement amount based on the third position and the fourth position.
Optionally, after the adjusting the first image from the second position to the second target position along the second direction, the method includes:
if the second angle of the camera for the second movement is smaller than the preset angle, acquiring a third direction and a fourth displacement of the lens when the lens moves at the second angle; wherein the fourth displacement amount is less than the first displacement amount;
adjusting the fourth displacement amount of the lens from the first target position to a third target position along a fourth direction, and adjusting the fourth displacement amount of the first image from the second target position to a fourth target position along a reverse direction of the fourth direction; wherein the third direction is different from the fourth direction;
displaying the first image on the display screen based on the fourth target position.
Optionally, if the second angle of the second movement of the camera is smaller than the preset angle, obtaining a third direction and a fourth displacement of the lens when the lens moves at the second angle includes:
if the camera moves for the second time and the second angle is smaller than the preset angle, acquiring a fifth position of the first image and a third direction corresponding to the second movement when the lens moves at the second angle;
and obtaining the fourth displacement based on the second target position and the fifth position.
Optionally, the second direction is opposite to the first direction.
In a second aspect, a terminal is provided, which includes: the system comprises a display screen, a processor, a memory and a communication bus;
the communication bus is used for realizing communication connection among the first display screen, the processor and the memory;
the processor is used for executing the anti-shake processing program in the memory to realize the following steps:
if a camera of a terminal is in a working state and a first angle of the camera for first movement is larger than a preset angle, acquiring a first direction and a first displacement when the camera moves at the first angle;
adjusting a lens of the camera to a first position along a second direction, and adjusting a first image to a second position along a direction opposite to the second direction; the first image is an output image of an image sensor of a camera, and the second direction is different from the first direction;
adjusting the lens from the first position to a first target position along a direction opposite to the second direction, and adjusting the first image from the second position to a second target position along the second direction; wherein the first target position and the second target position have a corresponding relationship;
and displaying the first image on a display screen of the terminal based on the second target position.
Optionally, the processor is configured to execute the following steps in the anti-shake processing program in the memory, if the camera of the terminal is in the working state and the first angle at which the camera moves for the first time is greater than the preset angle, and when the first direction and the first displacement amount of the lens of the camera moving at the first angle are obtained:
if the camera is in a working state, acquiring a third position of the first image when the camera does not move for the first time;
if the camera moves for the first time, acquiring a fourth position of the first image and a first direction corresponding to the first movement when the first movement occurs;
and obtaining the first displacement amount based on the third position and the fourth position.
In a third aspect, a computer readable storage medium is provided, which stores one or more programs, which are executable by one or more processors to implement the steps of the anti-shake processing method according to the first aspect.
According to the anti-shake processing method, the terminal and the computer-readable storage medium provided by the embodiment of the invention, if the camera of the terminal is in a working state and the first angle of the first movement of the camera is larger than the preset angle, the first direction and the first displacement when the camera moves at the first angle are obtained; adjusting the lens of the camera to a first position along a second direction, and adjusting the first image to a second position along a direction opposite to the second direction; the first image is an output image of an image sensor of the camera, and the second direction is different from the first direction; adjusting the lens from the first position to the first target position along the direction opposite to the second direction, and adjusting the first image from the second position to the second target position along the second direction; the first target position and the second target position have a corresponding relation; and displaying the first image on a display screen of the terminal based on the second target position. That is to say, if the camera is in a working state, and the camera moves for the first time and the first angle is larger than the preset angle, the terminal controls the lens of the camera to perform shake compensation for the motion, and simultaneously performs corresponding adjustment on the position of the first image, so that the position of the first image is correspondingly adjusted along with the movement of the lens, and thus the first image output on the display screen of the terminal does not drift; the problem that in the prior art, if the camera of the intelligent terminal shakes by more than a preset angle, the lens of the camera cannot perform corresponding compensation action, so that the output image drifts is solved; the output image drift phenomenon caused by camera shake is effectively avoided, the display effect of the terminal is improved, and meanwhile, the intelligence of the terminal is improved.
Drawings
Fig. 1 is a schematic hardware configuration diagram of an alternative mobile terminal implementing various embodiments of the present invention;
fig. 2 is a schematic structural diagram of a communication system in which a mobile terminal according to an embodiment of the present invention can operate;
fig. 3 is a schematic flow chart of an anti-shake processing method according to an embodiment of the present invention;
fig. 4 is a first image displayed on the terminal when the lens is not shaken according to the embodiment of the present invention;
FIG. 5 is a first image displayed on the terminal when the lens is shaken upwards according to the embodiment of the present invention;
FIG. 6 is a first image displayed on the terminal when the lens is multi-directionally dithered according to the embodiment of the present invention;
fig. 7 is a schematic flowchart of another anti-shake processing method according to an embodiment of the present invention;
fig. 8 is a schematic flowchart of another anti-shake processing method according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: a Radio Frequency (RF) unit 101, a Wi-Fi module 102, an audio output unit 103, an a/V (audio/video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access 2000(Code Division Multiple Access 2000, CDMA2000), Wideband Code Division Multiple Access (WCDMA), Time Division-Synchronous Code Division Multiple Access (TD-SCDMA), Frequency Division duplex Long Term Evolution (FDD-LTE), and Time Division duplex Long Term Evolution (TDD-LTE), etc.
Wi-Fi belongs to a short-distance wireless transmission technology, and a mobile terminal can help a user to receive and send emails, browse webpages, access streaming media and the like through a Wi-Fi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the Wi-Fi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the Wi-Fi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphics processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the Wi-Fi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a User Equipment (UE) 201, an Evolved UMTS Terrestrial radio access Network (E-UTRAN) 202, an Evolved Packet Core (EPC) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include a Mobility Management Entity (MME) 2031, a Home Subscriber Server (HSS) 2032, other MMEs 2033, a Serving GateWay (SGW) 2034, a packet data network GateWay (PDN GateWay, PGW)2035, and a Policy and Charging Rules Function (PCRF) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IP Multimedia Subsystem (IMS), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and communication system, various embodiments of the present invention are proposed.
An embodiment of the present invention provides an anti-shake processing method, which, as shown in fig. 3, includes the following steps:
step 301, if the camera of the terminal is in a working state and the first angle of the first movement of the camera is greater than the preset angle, acquiring a first direction and a first displacement when the camera moves at the first angle.
Here, the terminal may be a mobile terminal having a photographing function, a video monitoring apparatus, a handheld video camera, a digital camera, or the like. The camera includes a motion Sensor, a Central Processing Unit (CPU), an Image Sensor (IS), and an Image Signal Processor (ISP). The anti-shake processing method provided by the embodiment of the invention is a picture compensation mode which can cause unstable and drifting of an output image due to large-amplitude shake of a lens in the video shooting process or the preview process of a camera.
In order to compensate the camera shake, the camera of the terminal firstly acquires the motion information of the camera through a motion sensor, so that the camera determines to correspondingly compensate the output of a video picture, namely an output image according to the motion information, and further avoids the output image from drifting.
The motion sensor acquires motion information of the camera in real time, and the CPU acquires the motion information acquired by the motion sensor in real time. For example, the motion information includes: the angle of the camera, the direction of motion of the camera, etc. Of course, the motion information may also include other information, and the embodiment of the present invention is not particularly limited to this.
The preset angle may represent a field angle of a lens of the camera as 1 degree. Of course, the preset angle may be set according to actual conditions, so as to implement the anti-shake processing method provided by the present invention.
In an embodiment of the present invention, the motion sensor may include: acceleration sensors and gyroscope sensors, in which case the motion sensor can determine the angle of the camera in the following manner.
The method comprises the steps that a CPU obtains the acceleration of a first preset sampling point in a first preset time, wherein the acceleration is collected by an acceleration sensor, and whether a camera is in a static state or not is judged according to the acceleration of the first preset sampling point and a preset static threshold; if the acceleration of the first preset sampling point is larger than the preset static threshold value, the CPU obtains the angular velocity of a second preset sampling point within second preset time collected by the gyroscope sensor, multiplies the angular velocity of the second preset sampling point by the second preset time, and determines the angle of the camera, namely the rotation angle.
In the embodiment of the invention, from the direction of motion, the lens of the camera can move up, down, left, right, rotation and the like, the CPU obtains the acceleration of a first preset sampling point in a first preset time collected by an acceleration sensor, and judges whether the camera is in a static state or not by comparing the acceleration of the first preset sampling point with a preset static threshold; if the acceleration of the first preset sampling point is smaller than the preset static threshold, the CPU determines that the motion of the camera is very weak and the jitter generated on the video picture is small, and at the moment, the camera is determined to be approximately in a static state; if the acceleration of the first preset sampling point is larger than the preset static threshold, the CPU determines that the motion of the camera can cause the shake generated by the video picture to be larger, and at the moment, determines that the camera is in a non-static state; it should be noted that the preset static threshold is an empirical value.
Further, the CPU obtains the angular velocity of a second preset sampling point in second preset time collected by the gyroscope sensor, multiplies the angular velocity of the second preset sampling point in the second preset time by the second preset time, and determines the rotation angle of the camera in the second preset time. For example, the rotation angle includes a rotation angle Ax along the X-axis and a rotation angle Ay along the Y-axis, which may be expressed as (Ax, Ay).
The method comprises the steps that a camera is collected at a terminal to move, and when a first angle corresponding to the movement is larger than a preset angle, the terminal obtains a first direction and a first displacement when the camera moves.
In practical application, for example, taking a terminal as a mobile phone with a shooting function, as shown in fig. 4, in a process that a user uses the mobile phone to shoot a shooting object such as a person in fig. 4, the user first starts a camera function of the mobile phone, and at this time, the shooting object can be seen on a display screen of the terminal, that is, a shooting interface. Assuming that the mobile phone IS not moving at this time, the user can see a clearer image from the shooting interface, where the image IS an output image of the IS, and the output image may be a partial image of the current frame image.
Further, when the user's hand is unintentionally shaken, and if the user shakes the camera upward, the lens of the camera correspondingly shakes upward, for example, the lens rotates upward by 2 degrees, and since the angle is larger than a preset angle, for example, 1 degree, the lens performs a downward compensation action. As shown in fig. 5, the user can see the output image drifting downward from the shooting interface.
As the lens of the camera can move up, down, left, right, and rotate, for example, as shown in fig. 6, when the hand of the user shakes unconsciously, assuming that the camera shakes in all four directions, i.e., up, down, left, right, and left directions, in the vertical plane, the lens of the camera also shakes correspondingly in all four directions, i.e., up, down, left, and right, and the shake angle is greater than the preset angle, then the lens performs the maximum compensation for the shake, and at this time, the user can see that the output image drifts in the four directions, i.e., up, down, left, and right.
The anti-shake processing method provided by the invention is just for the shake of which the angle of the lens of the camera is larger than the preset angle, and the phenomenon that the output image drifts when the lens performs larger compensation action is inhibited, so that the mobile phone can control the stable display effect of the output image in the shooting interface even if the angle of the lens of the camera is larger than the shake of the preset angle.
Step 302, adjusting the lens of the camera to a first position along a second direction, and adjusting the first image to a second position along a direction opposite to the second direction.
The first image is an output image of an image sensor of the camera, and the second direction is different from the first direction.
Here, the second direction is opposite to the first direction. After the terminal acquires the first direction and the first displacement, the lens of the camera is adjusted to a first position in a second direction opposite to the first direction, such as downward, the first position being a maximum position at which the lens is deflected downward. That is, at this time, the lens of the terminal makes the maximum inverse compensation for the motion corresponding to the first angle that occurs. Meanwhile, the terminal controls the first image to move upwards so as to make the maximum upward compensation, so that the phenomenon that the first image drifts downwards due to the large-amplitude rotation of the lens is avoided.
Step 303, adjusting the lens from the first position to the first target position along the direction opposite to the second direction, and adjusting the first image from the second position to the second target position along the second direction.
The first target position and the second target position have a corresponding relation.
Here, after the terminal controls the lens to make the reverse maximum compensation in the second direction, the terminal further adjusts the lens, adjusts the lens from the first position to the first target position in the direction opposite to the second direction, and adjusts the first image from the second position to the second target position in the second direction, where the second target position refers to the central region position of the lens field.
And 304, displaying the first image on a display screen of the terminal based on the second target position.
Here, the first image is displayed at the second target position, i.e., the central region position of the lens field of view, on the display screen of the terminal.
According to the anti-shake processing method provided by the embodiment of the invention, if the camera of the terminal is in a working state and the first angle of the camera is larger than the preset angle, the first direction and the first displacement when the camera moves at the first angle are obtained; adjusting the lens of the camera to a first position along a second direction, and adjusting the first image to a second position along a direction opposite to the second direction; the first image is an output image of an image sensor of the camera, and the second direction is different from the first direction; adjusting the lens from the first position to the first target position along the direction opposite to the second direction, and adjusting the first image from the second position to the second target position along the second direction; the first target position and the second target position have a corresponding relation; and displaying the first image on a display screen of the terminal based on the second target position. That is to say, if the camera is in a working state, and the camera moves and the angle of the camera is greater than the preset angle, the terminal controls the lens of the camera to perform shake compensation for the motion, and simultaneously performs corresponding adjustment on the position of the first image, so that the position of the first image is correspondingly adjusted along with the movement of the lens, and thus the first image output on the display screen of the terminal cannot drift; the problem that in the prior art, if the camera of the intelligent terminal shakes by more than a preset angle, the lens of the camera cannot perform corresponding compensation action, so that the output image drifts is solved; the output image drift phenomenon caused by camera shake is effectively avoided, the display effect of the terminal is improved, and meanwhile, the intelligence of the terminal is improved.
Based on the foregoing embodiments, an embodiment of the present invention provides an anti-shake processing method, which is shown in fig. 7 and includes the following steps:
step 701, if the camera of the terminal is in a working state and a first angle of the camera moving for the first time is larger than a preset angle, acquiring a first direction and a first displacement when the camera moves at the first angle.
Here, step 701 may include:
step one, if the camera is in a working state, acquiring a third position of the first image when the camera does not move for the first time.
Here, the third position of the first image generally refers to the central region position of the lens field of view when the first motion of the camera has not occurred.
And secondly, if the camera moves for the first time, acquiring a fourth position of the first image and a first direction corresponding to the first movement when the first movement occurs.
Here, the moving direction of the lens of the camera may be detected by the gyro sensor.
In an embodiment of the present invention, the motion sensor may include: a gyroscope sensor. And the CPU acquires the angular velocity of a third preset sampling point within third preset time acquired by the gyroscope sensor, multiplies the angular velocity of the third preset sampling point by the third preset time, and determines the rotation angle of the camera.
In the embodiment of the invention, a CPU directly obtains the angular velocity of a third preset sampling point in a third preset time acquired by a gyroscope sensor, multiplies the angular velocity of the third preset sampling point in the third preset time by the third preset time, determines the rotation angle of the camera in the third preset time, and if the rotation angular velocity of the camera in the third preset time is 0, the CPU determines that the camera is static in the third preset time; if the rotational angular speed of the camera in the third preset time is not 0, the CPU determines that the camera has rotated in the third preset time, and the rotational angle comprises a rotational angle Ax along the X axis and a rotational angle Ay along the Y axis, and the rotational angle can be expressed as (Ax, Ay).
It can be seen that the motion sensor in the embodiment of the present invention may include an acceleration sensor and a gyroscope sensor, or only include a gyroscope sensor, which may both acquire the angle when the camera moves.
And thirdly, obtaining a first displacement amount based on the third position and the fourth position.
Here, the CPU acquires the real-time position of the IS output image. For example, a third position when no movement has occurred and a fourth position after movement has occurred. Further, the CPU calculates a displacement amount of the first image, that is, a first displacement amount, based on the third position and the fourth position.
Step 702, adjusting the second displacement of the lens to the first position along the second direction, and adjusting the second displacement of the first image to the second position along the opposite direction of the second direction.
Wherein the second displacement amount is greater than or equal to the first displacement amount.
Here, the second displacement amount may be a maximum displacement amount by which the lens is moved to the second direction, that is, the terminal controls the lens to make a maximum reverse compensation for the occurrence of the first motion.
Step 703, adjusting the third displacement of the lens from the first position to the first target position along the direction opposite to the second direction, and adjusting the third displacement of the first image from the second position to the second target position along the second direction.
Wherein the third displacement is less than the second displacement.
Here, the third displacement amount is a displacement amount for indicating that the lens is returned to the center position. That is, the terminal controls the lens to return to the center position after controlling the lens to make the maximum reverse compensation for the first motion that occurs, i.e., the position of the lens when it is in a stationary state before the motion occurs.
And step 704, displaying the first image on a display screen of the terminal based on the second target position.
It should be noted that, for the descriptions of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the descriptions in other embodiments, which are not described herein again.
The anti-shake processing method provided by the embodiment of the invention solves the problem that in the prior art, if the camera of the intelligent terminal shakes by more than a preset angle, the lens of the camera cannot perform corresponding compensation action, so that the output image drifts; the output image drift phenomenon caused by camera shake is effectively avoided, the display effect of the terminal is improved, and meanwhile, the intelligence of the terminal is improved.
Based on the foregoing embodiments, an embodiment of the present invention provides an anti-shake processing method, which is shown in fig. 8 and includes the following steps:
step 801, if a camera of the terminal is in a working state and a first angle of the camera moving for the first time is larger than a preset angle, acquiring a first direction and a first displacement when the camera moves at the first angle.
Step 802, adjusting the lens of the camera to a first position along a second direction, and adjusting the first image to a second position along a direction opposite to the second direction.
The first image is an output image of an image sensor of the camera, and the second direction is different from the first direction.
Step 803, adjusting the lens from the first position to the first target position along the direction opposite to the second direction, and adjusting the first image from the second position to the second target position along the second direction.
Wherein the first target position and the second target position have corresponding relationship
And step 804, displaying the first image on a display screen of the terminal based on the second target position.
When the terminal detects that the lens shakes greatly, namely the angle of the camera IS larger than the preset angle, and the lens has a large reverse compensation action for the large-amplitude shake, in order to avoid the output image of the IS from drifting, the terminal controls the output image to carry out maximum compensation in the direction opposite to the lens, and after the terminal IS stabilized, the lens and the output image are controlled to return to the central position, namely the position of the output image before the shake occurs. In this way, the terminal can compensate for the large jitter.
And 805, if the second angle of the second movement of the camera is smaller than the preset angle, acquiring a third direction and a fourth displacement when the lens moves at the second angle.
Wherein the fourth displacement is less than the first displacement.
Here, after the lens largely shakes and the shake is suppressed, if the terminal detects that the camera shakes again, that is, moves for the second time, and the second angle corresponding to the shake is smaller than the preset angle, then the terminal does not need to control the lens to perform the maximum reverse compensation, and only needs to control the lens and the output image to perform the motion compensation corresponding to the second motion, so that the current small-amplitude shake can be suppressed.
Step 806, adjusting the fourth displacement of the lens from the first target position to the third target position along the fourth direction, and adjusting the fourth displacement of the first image from the second target position to the fourth target position along the reverse direction of the fourth direction.
Wherein the third direction is different from the fourth direction.
Step 807 displays the first image on the display screen based on the fourth target position.
Here, after the terminal suppresses the shake of a small amplitude, the output position of the first image, that is, the fourth target position is determined, and the first image is displayed on the display screen based on the fourth target position.
It should be noted that, for the descriptions of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the descriptions in other embodiments, which are not described herein again.
Based on the foregoing embodiments, an embodiment of the present invention provides a terminal 9, which can be applied to an anti-shake processing method provided in embodiments corresponding to fig. 3, 7, and 8, and as shown in fig. 9, the terminal includes: display screen 91, processor 92, communication bus 93 and memory 94, wherein:
the communication bus 93 is used for realizing communication connection among the display screen 91, the processor 92 and the memory 94;
the processor 92 is configured to execute the anti-shake processing program in the memory 94 to implement the following steps:
if a camera of the terminal is in a working state and a first angle of the camera for first movement is larger than a preset angle, acquiring a first direction and a first displacement when the camera moves at the first angle;
adjusting the lens of the camera to a first position along a second direction, and adjusting the first image to a second position along a direction opposite to the second direction; the first image is an output image of an image sensor of the camera, and the second direction is different from the first direction;
adjusting the lens from the first position to the first target position along the direction opposite to the second direction, and adjusting the first image from the second position to the second target position along the second direction; the first target position and the second target position have a corresponding relation;
and displaying the first image on a display screen of the terminal based on the second target position.
In other embodiments of the present invention, when the processor 92 is configured to execute the adjusting of the lens to the first position along the second direction and the adjusting of the first image to the second position along the reverse direction of the second direction in the anti-shake processing program in the memory 94, the following steps may be further implemented:
adjusting the second displacement of the lens to the first position along the second direction, and adjusting the second displacement of the first image to the second position along the opposite direction of the second direction; wherein the second displacement amount is greater than or equal to the first displacement amount.
In other embodiments of the present invention, when the processor 92 is configured to execute the anti-shake processing program in the memory 94 to adjust the lens from the first position to the first target position along the direction opposite to the second direction, and to adjust the first image from the second position to the second target position along the second direction, the following steps can be further implemented:
adjusting the third displacement amount of the lens from the first position to the first target position along the direction opposite to the second direction, and adjusting the third displacement amount of the first image from the second position to the second target position along the second direction; wherein the third displacement is less than the second displacement.
In another embodiment of the present invention, if the camera of the terminal is in the working state and the first angle of the first movement of the camera is greater than the preset angle in the anti-shake processing program in the memory 94, and the first direction and the first displacement when the lens of the camera moves at the first angle are obtained, the following steps may be further implemented:
if the camera is in a working state, acquiring a third position of the first image when the camera does not move for the first time;
if the camera moves for the first time, acquiring a fourth position of the first image when the camera moves for the first time and a first direction corresponding to the first movement;
based on the third position and the fourth position, a first displacement amount is obtained.
In other embodiments of the present invention, when the processor 92 is configured to execute the anti-shake processing program stored in the memory 94, the following steps may be further implemented:
if the second angle of the camera for the second movement is smaller than the preset angle, acquiring a third direction and a fourth displacement when the lens moves at the second angle; wherein the fourth displacement is less than the first displacement;
adjusting the fourth displacement amount of the lens from the first target position to the third target position along the fourth direction, and adjusting the fourth displacement amount of the first image from the second target position to the fourth target position along the reverse direction of the fourth direction; wherein the third direction is different from the fourth direction;
the first image is displayed on the display screen based on the fourth target position.
In another embodiment of the present invention, if the second angle of the second movement of the camera in the anti-shake processing program in the memory 94 is smaller than the preset angle, and the third direction and the fourth displacement when the lens moves at the second angle are obtained, the processor 92 may further implement the following steps:
if the camera moves for the second time and the second angle is smaller than the preset angle, acquiring a fifth position of the first image and a third direction corresponding to the second movement when the lens moves at the second angle;
and obtaining a fourth displacement based on the second target position and the fifth position.
In other embodiments of the present invention, the second direction is opposite to the first direction when the processor 92 is used to execute the anti-shake processing program in the memory 94.
It should be noted that, for a specific implementation process of the step executed by the processor in this embodiment, reference may be made to the implementation processes in the anti-shake processing method provided in the embodiments corresponding to fig. 3, 7, and 8, and details are not described here again.
The terminal provided by the embodiment of the invention solves the problem that in the prior art, if the camera of the intelligent terminal shakes by more than a preset angle, the lens of the camera cannot perform corresponding compensation action, so that the output image drifts; the output image drift phenomenon caused by camera shake is effectively avoided, the display effect of the terminal is improved, and meanwhile, the intelligence of the terminal is improved.
Based on the foregoing embodiments, embodiments of the invention provide a computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of:
if a camera of the terminal is in a working state and a first angle of the camera for first movement is larger than a preset angle, acquiring a first direction and a first displacement when the camera moves at the first angle;
adjusting the lens of the camera to a first position along a second direction, and adjusting the first image to a second position along a direction opposite to the second direction; the first image is an output image of an image sensor of the camera, and the second direction is different from the first direction;
adjusting the lens from the first position to the first target position along the direction opposite to the second direction, and adjusting the first image from the second position to the second target position along the second direction; the first target position and the second target position have a corresponding relation;
and displaying the first image on a display screen of the terminal based on the second target position.
In other embodiments of the present invention, the one or more programs are executable by the one or more processors to adjust the lens to the first position in the second direction and to adjust the first image to the second position in a direction opposite to the second direction, and further implement the following steps:
adjusting the second displacement of the lens to the first position along the second direction, and adjusting the second displacement of the first image to the second position along the opposite direction of the second direction; wherein the second displacement amount is greater than or equal to the first displacement amount.
In other embodiments of the present invention, the one or more programs are executable by the one or more processors to adjust the lens from the first position to the first target position in a direction opposite to the second direction, and to adjust the first image from the second position to the second target position in the second direction, and further implement the following steps:
adjusting the third displacement amount of the lens from the first position to the first target position along the direction opposite to the second direction, and adjusting the third displacement amount of the first image from the second position to the second target position along the second direction; wherein the third displacement is less than the second displacement.
In other embodiments of the present invention, if the camera of the terminal is in the working state and the first angle of the first movement of the camera is greater than the preset angle, and the first direction and the first displacement of the lens of the camera when the first angle of the first movement occurs are obtained, the one or more programs may further implement the following steps:
if the camera is in a working state, acquiring a third position of the first image when the camera does not move for the first time;
if the camera moves for the first time, acquiring a fourth position of the first image when the camera moves for the first time and a first direction corresponding to the first movement;
based on the third position and the fourth position, a first displacement amount is obtained.
In other embodiments of the invention, the one or more programs are executable by the one or more processors to perform the steps of:
if the second angle of the camera for the second movement is smaller than the preset angle, acquiring a third direction and a fourth displacement when the lens moves at the second angle; wherein the fourth displacement is less than the first displacement;
adjusting the fourth displacement amount of the lens from the first target position to the third target position along the fourth direction, and adjusting the fourth displacement amount of the first image from the second target position to the fourth target position along the reverse direction of the fourth direction; wherein the third direction is different from the fourth direction;
the first image is displayed on the display screen based on the fourth target position.
In other embodiments of the present invention, if the second angle of the second movement of the camera is smaller than the preset angle, and the third direction and the fourth displacement of the lens moving at the second angle are obtained, the one or more programs may further implement the following steps:
if the camera moves for the second time and the second angle is smaller than the preset angle, acquiring a fifth position of the first image and a third direction corresponding to the second movement when the lens moves at the second angle;
and obtaining a fourth displacement based on the second target position and the fifth position.
In other embodiments of the present invention, the second direction is opposite to the first direction.
It should be noted that, for a specific implementation process of the step executed by the processor in this embodiment, reference may be made to the implementation processes in the anti-shake processing method provided in the embodiments corresponding to fig. 3, 7, and 8, and details are not described here again.
The computer-readable storage medium may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read Only Memory (EPROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a magnetic Random Access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical Disc, or a Compact Disc Read-Only Memory (CD-ROM); and may be various electronic devices such as mobile phones, computers, tablet devices, personal digital assistants, etc., including one or any combination of the above-mentioned memories.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method described in the embodiments of the present invention.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An anti-shake processing method, characterized in that the method comprises:
if a camera of a terminal is in a working state and a first angle of the camera for first movement is larger than a preset angle, acquiring a first direction and a first displacement when the camera moves at the first angle;
adjusting a lens of the camera to a first position along a second direction, and adjusting a first image to a second position along a direction opposite to the second direction; wherein the first image is an output image of an image sensor of a camera, and the second direction is opposite to the first direction;
adjusting the lens from the first position to a first target position along a direction opposite to the second direction, and adjusting the first image from the second position to a second target position along the second direction; wherein the first target position and the second target position have a corresponding relationship;
and displaying the first image on a display screen of the terminal based on the second target position.
2. The method of claim 1, wherein adjusting the lens to a first position in a second direction and adjusting the first image to a second position in a direction opposite the second direction comprises:
adjusting a second displacement of the lens to the first position along the second direction, and adjusting the second displacement of the first image to the second position along the direction opposite to the second direction; wherein the second displacement amount is greater than or equal to the first displacement amount.
3. The method of claim 2, wherein the adjusting the lens from the first position to a first target position in a direction opposite the second direction and the first image from the second position to a second target position in the second direction comprises:
adjusting a third displacement amount of the lens from the first position to the first target position along the direction opposite to the second direction, and adjusting the third displacement amount of the first image from the second position to the second target position along the second direction; wherein the third displacement amount is less than the second displacement amount.
4. The method according to claim 1, wherein if a camera of the terminal is in an operating state and a first angle of the camera moving for the first time is greater than a preset angle, acquiring a first direction and a first displacement of a lens of the camera moving at the first angle, comprises:
if the camera is in a working state, acquiring a third position of the first image when the camera does not move for the first time;
if the camera moves for the first time, acquiring a fourth position of the first image and a first direction corresponding to the first movement when the first movement occurs;
and obtaining the first displacement amount based on the third position and the fourth position.
5. The method of claim 1, wherein after the adjusting the first image from the second position to a second target position along a second direction, the method comprises:
if the second angle of the camera for the second movement is smaller than the preset angle, acquiring a third direction and a fourth displacement of the lens when the lens moves at the second angle; wherein the fourth displacement amount is less than the first displacement amount;
adjusting the fourth displacement amount of the lens from the first target position to a third target position along a fourth direction, and adjusting the fourth displacement amount of the first image from the second target position to a fourth target position along a reverse direction of the fourth direction; wherein the third direction is different from the fourth direction;
displaying the first image on the display screen based on the fourth target position.
6. The method of claim 5, wherein if a second angle of the second movement of the camera is smaller than the preset angle, acquiring a third direction and a fourth displacement of the lens when the lens moves at the second angle comprises:
if the camera moves for the second time and the second angle is smaller than the preset angle, acquiring a fifth position of the first image and a third direction corresponding to the second movement when the lens moves at the second angle;
and obtaining the fourth displacement based on the second target position and the fifth position.
7. The method of claim 1, wherein the second direction is opposite the first direction.
8. A terminal, characterized in that the terminal comprises: the system comprises a display screen, a processor, a memory and a communication bus;
the communication bus is used for realizing communication connection among the first display screen, the processor and the memory;
the processor is used for executing the anti-shake processing program in the memory to realize the following steps:
if a camera of a terminal is in a working state and a first angle of the camera for first movement is larger than a preset angle, acquiring a first direction and a first displacement when the camera moves at the first angle;
adjusting a lens of the camera to a first position along a second direction, and adjusting a first image to a second position along a direction opposite to the second direction; wherein the first image is an output image of an image sensor of a camera, and the second direction is opposite to the first direction;
adjusting the lens from the first position to a first target position along a direction opposite to the second direction, and adjusting the first image from the second position to a second target position along the second direction; wherein the first target position and the second target position have a corresponding relationship;
and displaying the first image on a display screen of the terminal based on the second target position.
9. The terminal according to claim 8, wherein if the camera of the terminal is in an operating state and a first angle of the first movement of the camera is greater than a preset angle, and a first direction and a first displacement of the lens of the camera when the lens of the camera moves at the first angle are obtained, the processor is further configured to execute the anti-shake processing program to implement the following steps:
if the camera is in a working state, acquiring a third position of the first image when the camera does not move for the first time;
if the camera moves for the first time, acquiring a fourth position of the first image and a first direction corresponding to the first movement when the first movement occurs;
and obtaining the first displacement amount based on the third position and the fourth position.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores one or more programs, which are executable by one or more processors, to implement the steps of the anti-shake processing method according to any one of claims 1 to 7.
CN201711447002.5A 2017-12-27 2017-12-27 Anti-shake processing method, terminal and computer readable storage medium Active CN108111761B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711447002.5A CN108111761B (en) 2017-12-27 2017-12-27 Anti-shake processing method, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711447002.5A CN108111761B (en) 2017-12-27 2017-12-27 Anti-shake processing method, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108111761A CN108111761A (en) 2018-06-01
CN108111761B true CN108111761B (en) 2020-07-07

Family

ID=62213651

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711447002.5A Active CN108111761B (en) 2017-12-27 2017-12-27 Anti-shake processing method, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108111761B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112904996B (en) * 2019-12-04 2023-05-12 上海交通大学 Picture compensation method and device for vehicle-mounted head-up display equipment, storage medium and terminal
CN113518178B (en) * 2021-04-22 2022-09-20 中煤科工集团重庆研究院有限公司 Video image acquisition device for slope safety monitoring
CN114125266B (en) * 2021-10-20 2024-04-09 武汉旷视金智科技有限公司 Rotation detection method, rotation detection device, rotation detection apparatus, rotation detection device, rotation detection medium, and rotation detection program product
CN114401341B (en) * 2022-01-12 2023-08-29 Oppo广东移动通信有限公司 Camera control method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1685272A (en) * 2002-09-24 2005-10-19 西健尔 Image display unit and projection optical system
CN101662582A (en) * 2009-09-08 2010-03-03 长春理工大学 Method for compensating image dithering of airborne imaging equipment
CN106254771A (en) * 2016-07-29 2016-12-21 广东欧珀移动通信有限公司 Shooting anti-fluttering method, device and mobile terminal
CN106713770A (en) * 2017-03-27 2017-05-24 联想(北京)有限公司 Photographing processing method and electronic device
CN107181914A (en) * 2017-05-31 2017-09-19 广东欧珀移动通信有限公司 Stabilization stroke adjustment method and apparatus, mobile device and computer-readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6562773B2 (en) * 2015-08-26 2019-08-21 キヤノン株式会社 Imaging apparatus, control method therefor, program, and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1685272A (en) * 2002-09-24 2005-10-19 西健尔 Image display unit and projection optical system
CN101662582A (en) * 2009-09-08 2010-03-03 长春理工大学 Method for compensating image dithering of airborne imaging equipment
CN106254771A (en) * 2016-07-29 2016-12-21 广东欧珀移动通信有限公司 Shooting anti-fluttering method, device and mobile terminal
CN106713770A (en) * 2017-03-27 2017-05-24 联想(北京)有限公司 Photographing processing method and electronic device
CN107181914A (en) * 2017-05-31 2017-09-19 广东欧珀移动通信有限公司 Stabilization stroke adjustment method and apparatus, mobile device and computer-readable storage medium

Also Published As

Publication number Publication date
CN108111761A (en) 2018-06-01

Similar Documents

Publication Publication Date Title
CN109151169B (en) Camera authority management method, mobile terminal and computer readable storage medium
CN108111761B (en) Anti-shake processing method, terminal and computer readable storage medium
CN108196922B (en) Method for opening application, terminal and computer readable storage medium
CN113179370B (en) Shooting method, mobile terminal and readable storage medium
CN109144441B (en) Screen adjusting method, terminal and computer readable storage medium
CN108198150B (en) Method for eliminating image dead pixel, terminal and storage medium
CN112667181A (en) Screen projection method, screen projection equipment, screen projection control system and storage medium
CN108076221B (en) Terminal control method, terminal and computer readable storage medium
CN108984063B (en) Desktop interaction regulation and control method and device and computer readable storage medium
CN108563388B (en) Screen operation method, mobile terminal and computer-readable storage medium
CN111190559A (en) Screen projection control synchronization method, mobile terminal and computer readable storage medium
CN110278481B (en) Picture-in-picture implementation method, terminal and computer readable storage medium
CN109683778B (en) Flexible screen control method and device and computer readable storage medium
CN110058767B (en) Interface operation method, wearable terminal and computer-readable storage medium
CN111324407A (en) Animation display method, terminal and computer readable storage medium
CN108762709B (en) Terminal control method, terminal and computer readable storage medium
CN111158617A (en) Screen-casting content synchronization method, mobile terminal and computer-readable storage medium
CN108196768B (en) Mobile terminal turnover detection method, mobile terminal and computer readable storage medium
CN107340958B (en) Horizontal and vertical screen switching method and mobile terminal
CN112604281A (en) Game visual field control method, mobile terminal and computer readable storage medium
CN110083294B (en) Screen capturing method, terminal and computer readable storage medium
CN109561221B (en) Call control method, device and computer readable storage medium
CN111787234A (en) Shooting control method and device and computer readable storage medium
CN108228302B (en) Information processing method, terminal and storage medium
CN107728789B (en) Starting method of one-hand operation mode, terminal and storage 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
GR01 Patent grant
GR01 Patent grant