CN110620871B - Video shooting method and electronic equipment - Google Patents

Video shooting method and electronic equipment Download PDF

Info

Publication number
CN110620871B
CN110620871B CN201810629254.8A CN201810629254A CN110620871B CN 110620871 B CN110620871 B CN 110620871B CN 201810629254 A CN201810629254 A CN 201810629254A CN 110620871 B CN110620871 B CN 110620871B
Authority
CN
China
Prior art keywords
image
shake
camera
information
motion vector
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
CN201810629254.8A
Other languages
Chinese (zh)
Other versions
CN110620871A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201810629254.8A priority Critical patent/CN110620871B/en
Publication of CN110620871A publication Critical patent/CN110620871A/en
Application granted granted Critical
Publication of CN110620871B publication Critical patent/CN110620871B/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)
  • Adjustment Of Camera Lenses (AREA)

Abstract

The disclosure provides a video shooting method and electronic equipment. The method comprises the following steps: after the first image is shot by the camera, the compensating lens group in the camera is moved to a preset position; the optical anti-shake module acquires shake information of the camera through the gyroscope, adjusts the position of the compensation lens group from a preset position according to the shake information, and shoots a second image through the adjusted camera; the optical anti-shake module sends a second image to the electronic anti-shake module; the electronic anti-shake module receives the second image and acquires the shake information through the gyroscope; the electronic anti-shake module compensates the second image according to the shake information of the second image and the shake information of the first image acquired by the camera when shooting the first image. This is disclosed at the shooting in-process, and optics anti-shake module need not send the compensation information of compensation lens group to electron anti-shake module, has reduced the calculated amount, has avoided extra resource consumption, avoids appearing the information jam between optics anti-shake module and the electron anti-shake module.

Description

Video shooting method and electronic equipment
Technical Field
The present disclosure relates to the field of electronic technologies, and in particular, to a video shooting method and an electronic device.
Background
With the continuous development of terminal technology, electronic devices such as mobile phones and tablet computers have strong processing capability, and are deeply integrated into the work and life of people. At present, people increasingly use electronic devices to shoot videos in daily life. In the shooting process, people often blur the shot image due to hand shake or camera shake, so that anti-shake processing is required to be performed during shooting so as to improve the image quality.
In the related art, the electronic device includes a camera, a gyroscope, an optical anti-shake module and an electronic anti-shake module, and in the process of shooting a video, the electronic device continues to shoot a next image after the first image is shot. At the moment, the optical anti-shake module acquires shake information of the camera through the gyroscope, adjusts the position of the compensation lens group according to the shake information, shoots a second image, and sends the second image and the compensation information of the compensation lens group to the electronic anti-shake module. The electronic anti-shake module also acquires shake information of the camera through the gyroscope, determines a relative motion vector between the first image and the second image according to the shake information, the shake information when the first image is shot and compensation information sent by the optical anti-shake module, and compensates the second image according to the relative motion vector so as to compensate shake difference between the second image and the first image.
Disclosure of Invention
The embodiment of the disclosure provides a video shooting method and electronic equipment, which can solve the problems in the related art. The technical scheme is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a video shooting method applied in an electronic device, where the electronic device includes a camera, a gyroscope, an optical anti-shake module, and an electronic anti-shake module, the method includes:
after a first image is shot by the camera, moving a compensation lens group in the camera to a preset position;
the optical anti-shake module acquires shake information of the camera through the gyroscope, adjusts the position of the compensation lens group from the preset position according to the shake information, and shoots a second image through the adjusted camera;
the optical anti-shake module sends the second image to the electronic anti-shake module under the condition that the compensation information of the compensation lens group is not sent;
the electronic anti-shake module receives the second image and acquires the shake information through the gyroscope;
the electronic anti-shake module compensates the second image according to the shake information of the second image and the shake information of the first image acquired by the camera when shooting the first image.
In a possible implementation manner, the compensating the second image according to shake information obtained by the camera when the camera takes the first image and shake information of the second image includes:
determining a relative motion vector between the second image and the first image according to the jitter information acquired by the camera when the first image is shot and the jitter information of the second image;
and compensating the second image according to the relative motion vector.
In a possible implementation manner, the determining, according to shake information obtained by the camera when the camera takes the first image and shake information of the second image, a relative motion vector between the second image and the first image includes:
determining a first motion vector corresponding to shaking information acquired by the camera when the camera shoots the first image and a second motion vector corresponding to shaking information of the second image;
and calculating the difference value of the second motion vector and the first motion vector to obtain the relative motion vector.
In one possible implementation manner, the compensating the second image according to the relative motion vector includes:
and according to the opposite direction of the relative motion direction, moving the second image by the displacement indicated by the relative motion displacement so as to compensate the second image.
In one possible implementation, the moving the compensating lens group in the camera to a preset position includes:
and moving the compensation lens group to the preset position every a preset time length from the beginning of shooting a first image by the camera, wherein the preset time length is a shooting time interval when the camera shoots any two adjacent images.
According to a second aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including a camera, a gyroscope, an optical anti-shake module, and an electronic anti-shake module;
the camera is used for moving the compensation lens group to a preset position after shooting a first image;
the optical anti-shake module is used for acquiring shake information of the camera through the gyroscope, adjusting the position of the compensation lens group from the preset position according to the shake information, and the camera is used for shooting a second image;
the optical anti-shake module is used for sending the second image to the electronic anti-shake module under the condition that the compensation information of the compensation lens group is not sent;
the electronic anti-shake module is used for receiving the second image and acquiring the shake information through the gyroscope;
the electronic anti-shake module is used for compensating the second image according to the shake information of the second image and the shake information of the first image acquired by the camera when shooting the first image.
In one possible implementation, the electronic anti-shake module is configured to:
the determining submodule is used for determining a relative motion vector between the second image and the first image according to the shake information acquired by the camera when the first image is shot and the shake information of the second image;
and the compensation sub-module is used for compensating the second image according to the relative motion vector.
In a possible implementation manner, the electronic anti-shake module is further configured to:
determining a first motion vector corresponding to shaking information acquired by the camera when the camera shoots the first image and a second motion vector corresponding to shaking information of the second image;
and calculating the difference value of the second motion vector and the first motion vector to obtain the relative motion vector.
In a possible implementation manner, the relative motion vector includes a relative motion direction and a relative motion displacement, and the electronic anti-shake module is further configured to:
and according to the opposite direction of the relative motion direction, moving the second image by the displacement indicated by the relative motion displacement so as to compensate the second image.
In a possible implementation, the camera is further configured to:
and moving the compensation lens group to the preset position every a preset time length from the beginning of shooting the first image, wherein the preset time length is a shooting time interval when the camera shoots any two adjacent images.
The technical scheme provided by the embodiment of the disclosure has the following beneficial effects: in the shooting process, after the camera shoots a first image, the compensation lens group in the camera is moved to a preset position. And the optical anti-shake module starts to adjust the position of the compensation lens group from a preset position according to the acquired shake information of the camera, so that when the adjusted camera shoots a second image, the optical anti-shake module sends the second image to the electronic anti-shake module, and the electronic anti-shake module compensates the second image according to the shake information of the second image and the shake information of the shake information acquired by the camera when shooting the first image. The compensation information of the compensation lens group is not required to be sent to the electronic anti-shake module by the optical anti-shake module, so that the calculation amount is reduced, the extra resource consumption is avoided, and the information blockage between the optical anti-shake module and the electronic anti-shake module is avoided.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, 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 only some embodiments of the present disclosure, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure;
fig. 2 is a flowchart of a video shooting method provided by an embodiment of the present disclosure;
FIG. 3 is a flow chart of another video capture method provided by embodiments of the present disclosure;
fig. 4 is a schematic diagram of a camera position during shooting according to the present disclosure;
fig. 5 is a flowchart of another video shooting method provided by the embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of another electronic device provided in the embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of electronic devices and methods consistent with certain aspects of the present disclosure as recited in the claims appended hereto.
For ease of understanding, before explaining the embodiments of the present disclosure in detail, structures of the embodiments of the present disclosure relating to application scenarios and electronic devices will be described.
At present, with the continuous development of electronic device technology, electronic devices such as mobile phones, tablet computers, video cameras and the like play more and more important roles in the work and life of people. People also increasingly use electronic devices to capture video in everyday life. In the shooting process, hand shake or camera shake often occurs to cause the situation of blurred shot images, so that videos can be shot by the video shooting method provided by the embodiment of the disclosure, anti-shake processing can be performed during shooting, and the shooting quality is improved.
For example, when a user takes a small video with a mobile phone, the user may shake his hand for a long time, which may easily cause the camera to shake and the taken image to be blurred. In order to avoid the above situation, shooting can be performed by the video shooting method provided by the embodiment of the disclosure, so that shake of the camera can be compensated, and a clear image can be shot.
For another example, when a user places a camera at a fixed position to shoot a video, the camera may shake due to collision of external factors, and at this time, shooting may be performed by the video shooting method provided by the embodiment of the present disclosure, so as to eliminate an influence caused by shaking of the camera, thereby shooting a high-quality video.
Of course, the embodiment of the present disclosure may be applied to not only the two application scenarios, but also other application scenarios in practical application.
Fig. 1 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. As shown in fig. 1, the electronic device 100 includes: a camera 101, a gyroscope 102, an optical anti-shake module 103, and an electronic anti-shake module 104.
The camera 101 is configured to capture a video, the gyroscope 102 is configured to detect shaking information of the camera, the optical anti-shake module 103 is configured to compensate shaking caused by capturing each frame of image through optical anti-shake processing, and the electronic anti-shake module 104 is configured to compensate shaking caused by capturing any two frames of images through electronic anti-shake processing. The optical anti-shake module 103 and the electronic anti-shake module 104 may be connected by a bus.
After the camera 101 shoots a first image, the compensation lens group is moved to a preset position, the optical anti-shake module 103 obtains shake information of the camera 101 through the gyroscope 102, and starts to adjust the position of the compensation lens group from the preset position according to the shake information, after the adjustment, the camera 101 shoots a second image, the optical anti-shake module 103 sends the second image to the electronic anti-shake module 104 under the condition that the compensation information of the compensation lens group is not sent, and the electronic anti-shake module 104 receives the second image and obtains shake information through the gyroscope 102. The electronic anti-shake module 104 compensates the second image according to the shake information of the second image and the shake information of the first image acquired when the camera 101 captures the first image.
In a possible implementation manner, the camera 101 may further include a Voice Coil Motor (VCM), a compensation lens set, and an image sensor. The voice coil motor is used for adjusting the position of the compensation lens group, the compensation lens group is used for collecting light, and the image sensor is used for collecting images according to the light collected by the compensation lens group. After the camera 101 captures the first image, the voice coil motor may be driven to move the compensation lens set to the preset position. The optical anti-shake module 103 obtains shake information of the camera 101 through the gyroscope 102, drives the voice coil motor to adjust the position of the compensation lens group from a preset position according to the shake information, and after adjustment, the camera 101 shoots a second image. The optical anti-shake module 103 then sends the second image to the electronic anti-shake module 104, and the electronic anti-shake module 104 compensates the second image.
It should be noted that, in practical applications, the electronic device may further include a main board, the gyroscope is disposed in the main board, and of course, other portions may also be included, and fig. 1 illustrates that the electronic device includes a camera, a gyroscope, an optical anti-shake module, and an electronic anti-shake module, and does not limit the embodiment of the present disclosure.
In the related art, the optical anti-shake module is required to send the compensation information of the compensation lens group to the electronic anti-shake module in the shooting process, so that a large amount of calculation is required, and extra resource consumption is brought. In addition, in the shooting process, every time one frame of image is shot, the optical anti-shake module needs to send compensation information for shooting the frame of image to the electronic anti-shake module. Because the frequency of shooting images in the shooting process is high, and the operation frequency of anti-shake processing through the optical anti-shake module is high, when multi-frame images are shot, the optical anti-shake module needs to transmit compensation information of the multi-frame images to the electronic anti-shake module, the data volume is large, and information blockage between the optical anti-shake module and the electronic anti-shake module is easily caused. Accordingly, the present disclosure provides a video photographing method that can solve the problems in the related art. The video shooting method proposed by the present disclosure will be described below with reference to two embodiments, respectively.
Fig. 2 is a flowchart of a video shooting method provided in an embodiment of the present disclosure, and is applied to an electronic device, where the electronic device includes a camera, a gyroscope, an optical anti-shake module, and an electronic anti-shake module. As shown in fig. 2, the method includes the following steps.
In step 201, after the first image is captured by the camera, the compensation lens set in the camera is moved to the preset position.
In step 202, the optical anti-shake module obtains shake information of the camera through the gyroscope, adjusts the position of the compensation lens group from a preset position according to the shake information, and captures a second image through the adjusted camera.
In step 203, the optical anti-shake module sends a second image to the electronic anti-shake module without sending the compensation information of the compensation lens group.
In step 204, the electronic anti-shake module receives the second image and obtains the shake information through the gyroscope.
In step 205, the electronic anti-shake module compensates the second image according to the shake information of the second image and the shake information of the first image acquired by the camera when the camera takes the first image.
In summary, in the shooting process, after the camera shoots the first image, the compensation lens group in the camera is moved to the preset position. The optical anti-shake module starts to adjust the position of the compensation lens group from a preset position according to the acquired shake information of the camera, so that when the adjusted camera shoots a second image, the optical anti-shake module sends the second image to the electronic anti-shake module, and the electronic anti-shake module compensates the second image according to the shake information acquired by the camera when shooting a first image and the shake information of the second image. The compensation information of the compensation lens group is not required to be sent to the electronic anti-shake module by the optical anti-shake module, so that the calculation amount is reduced, the extra resource consumption is avoided, and the information blockage between the optical anti-shake module and the electronic anti-shake module is avoided.
In one possible implementation manner, compensating the second image according to shake information obtained by the camera when the camera takes the first image and shake information of the second image includes:
determining a relative motion vector between a second image and a first image according to the jitter information of the second image and the jitter information acquired by a camera when the first image is shot;
the second image is compensated according to the relative motion vector.
In one possible implementation manner, determining a relative motion vector between a second image and a first image according to shake information acquired by a camera when the camera takes the first image and shake information of the second image includes:
determining a first motion vector corresponding to the shake information acquired by the camera when shooting the first image and a second motion vector corresponding to the shake information of the second image;
and calculating the difference value of the second motion vector and the first motion vector to obtain the relative motion vector.
In one possible implementation, the compensating the second image according to the relative motion vector includes:
and according to the direction opposite to the relative motion direction, the second image is moved by the displacement indicated by the relative motion displacement so as to compensate the second image.
In one possible implementation, moving the compensation lens set in the camera to a preset position includes:
and moving the compensation lens group to a preset position every preset time length from the beginning of shooting a first image by the camera, wherein the preset time length is the shooting time interval of any two adjacent images shot by the camera.
All the above optional technical solutions can be combined arbitrarily to form optional embodiments of the present disclosure, and the embodiments of the present disclosure are not described in detail again.
Fig. 3 is a flowchart of a video shooting method according to an embodiment of the present disclosure, and is applied to an electronic device including a camera, a gyroscope, an optical anti-shake module, and an electronic anti-shake module. The embodiments of the present disclosure will now be described with reference to the embodiment shown in fig. 2. As shown in fig. 3, the method includes the following steps.
In step 301, after the first image is captured by the camera, the compensation lens set in the camera is moved to a preset position.
The embodiment of the disclosure provides a video shooting method, wherein a plurality of images can be shot in sequence in the process of shooting a video. The first image is any one shot image.
It should be noted that, shooting the video may be that the electronic device starts shooting when detecting a shooting operation after turning on the camera. In practical implementation, after the electronic device may detect that the user opens the camera when performing the click operation on the shooting application, if the click operation on the shooting button is detected, the electronic device starts shooting, and of course, the electronic device may also start shooting when receiving a voice message sent by the user to instruct to open the camera, and start shooting when receiving a voice message sent by the user to instruct to start shooting, which is not limited by the embodiment of the present disclosure.
The compensation lens group is a movable lens group located in the camera, and the electronic equipment can adjust collected light rays through the movable compensation lens group to keep the stability of a light path. In addition, the preset position is the initial position of the compensation lens group. The preset position is any specific position, for example, the preset position may be a central position of the camera, and may also be other specific positions, which is not limited to the embodiment of the present disclosure.
When the compensation lens group in the camera is moved to a preset position, the compensation lens group can be moved to the preset position at the interval of preset time length from the beginning of shooting a first image by the camera, and the preset time length is the shooting time interval when the camera shoots any two adjacent images.
It should be noted that, in the embodiment of the present disclosure, the compensation lens group is periodically moved to the preset position by using the preset time period as a period, so that the frequency of moving the compensation lens group is consistent with the frequency of shooting the image by the electronic device, thereby ensuring that the compensation lens group can be located at the preset position before shooting the next image after the electronic device shoots the image every time.
In step 302, the optical anti-shake module obtains shake information of the camera through the gyroscope, adjusts the position of the compensation lens group from a preset position according to the shake information, and captures a second image through the adjusted camera.
The gyroscope is an angular motion detection device for detecting a current shake of the camera and outputting shake information of the camera. The shake information detected by the gyroscope comprises a shake direction and an angular velocity of the camera, and the angular velocity is used for representing the shake angle of the camera in unit time.
When the gyroscope detects the shake information of the camera, the gyroscope sends the shake information to the optical anti-shake module and the electronic anti-shake module. In the shooting process, the light collected by the camera when shaking can incline, so that the shot image becomes fuzzy, the optical anti-shake module can determine the target position of the compensation lens group according to the shaking information, and then the position of the compensation lens group is adjusted from the preset position, so that the compensation lens group is positioned at the target position. At the moment, the compensation lens group located at the target position can correct collected light, so that a light path with shaking is compensated, the situation that an image shot in the shooting process is fuzzy is prevented, then, the second image is shot through the adjusted camera, shaking compensation is achieved when the second image is shot, and the shot image is clearer.
Wherein the target position can be calculated according to the acquired shake information of the camera. In fact, the angular velocity obtained from the gyroscope and the detection period of the gyroscope may be obtained first, and then the angle at which the camera shakes in the detection period of the gyroscope is multiplied by the focal length of the compensation lens group to obtain the displacement corresponding to the angular velocity. The target position can then be determined from the shake direction of the camera and the resulting displacement.
In practical applications, the compensation lens set can only move with unit displacement due to the limitation of the hardware structure of the compensation lens set, so that the camera shake cannot be completely compensated by adjusting the position of the compensation lens set, i.e., a slight error exists between the compensation information of the compensation lens set and the shake information acquired when the second image is captured.
In step 303, the optical anti-shake module sends the second image to the electronic anti-shake module without sending the compensation information of the compensation lens group.
The optical anti-shake module and the electronic anti-shake module can be connected through a bus, and then the optical anti-shake module sends a second image to the electronic anti-shake module through the bus. The bus may be an Inter-Integrated Circuit (IIC) bus, but in practical applications, the bus may also be other buses, such as a Serial Peripheral Interface (SPI) bus, and the like, which is not limited to the embodiment of the present disclosure.
Because the optical anti-shake module directly sends the shot second image to the electronic anti-shake module without sending the compensation information of the compensation lens group in the step 302, the additional resource consumption caused by data transmission between the optical anti-shake module and the electronic anti-shake module can be reduced, and meanwhile, the information blockage between the optical anti-shake module and the electronic anti-shake module is avoided.
In step 304, the electronic anti-shake module receives the second image and obtains the shake information through the gyroscope.
After the electronic anti-shake module receives the second image through step 304 and acquires the shake information through the gyroscope, the electronic anti-shake module may compensate the second image through the following step 304-305.
In step 305, the electronic anti-shake module determines a relative motion vector between the second image and the first image according to the shake information acquired by the camera when shooting the first image and the shake information of the second image.
The electronic anti-shake module can determine a first motion vector corresponding to shake information acquired by the camera when the camera shoots a first image and a second motion vector corresponding to shake information of a second image; then, the difference between the second motion vector and the first motion vector is calculated to obtain the relative motion vector.
It should be noted that, for each frame of image, the motion vector corresponding to the dithering information of the image includes a motion direction and a motion displacement. The moving direction is the same as the shaking direction in the shaking information of the image. And the movement displacement needs to be obtained through calculation, and because the distance between the preset position and the central position of the photosensitive surface of the image sensor is fixed, the movement displacement of the image can be calculated according to the angular speed in the shake information of the image and the fixed distance.
In step 306, the electronic anti-shake module compensates the second image according to the relative motion vector.
When the second image is compensated according to the relative motion vector, the second image may be moved by a displacement amount indicated by the relative motion displacement in a direction opposite to the relative motion direction to compensate the second image.
In practical applications, the shake information detected by the gyroscope may be inaccurate, and may have a slight error from the actual shake of the camera. Thus, after step 306, a motion vector between the first image and the compensated second image may be determined by comparing the first image and the compensated second image, determining a region of match between the first image and the compensated second image, and image information in the matching region, based on a difference between the image information in the matching region. And then, the compensated second image is compensated for the second time according to the motion vector to eliminate the error between the jitter information detected by the gyroscope and the actual jitter information of the camera, so that the jitter compensation between the first image and the second image can be more accurately performed, and the problem of inaccurate compensation of the second image caused by the error possibly existing in the jitter information detected by the gyroscope is solved.
It should be noted that the motion vector between the first image and the compensated second image may be determined by a grayscale projection method, a block matching method, an edge matching method, or a feature point matching method.
The gray projection method comprises the following steps: and calculating the gray level projection images respectively corresponding to the first image and the adjusted second image, determining the moving direction and the moving displacement of the adjusted second image when the difference between the two gray level projection images is minimum, and then obtaining a motion vector according to the determined moving direction and the moving displacement.
Block matching method: respectively acquiring first histogram statistical values and second histogram statistical values of a plurality of pixel points of a first image and an adjusted second image in a preset histogram statistical window, determining that the first histogram statistical values and the second histogram statistical values are equal, adjusting the direction of the second image needing to move and the displacement of the second image needing to move, and then obtaining a motion vector according to the determined moving direction and the movement displacement.
Edge matching method: respectively detecting edge information of the first image and the adjusted second image, determining the direction and displacement of the adjusted second image which need to move when the edge information in the first image is matched with the edge information of the adjusted second image, and then obtaining a motion vector according to the determined moving direction and the determined moving displacement.
Feature point matching method: directly obtaining the coordinate of at least one characteristic point in the first image and the coordinate of at least one characteristic point in the adjusted second image, determining the direction in which the at least one characteristic point in the first image is located and the displacement in which the second image is required to move when the position of the at least one characteristic point in the first image is coincident with the position of the at least one characteristic point in the adjusted second image, and then obtaining a motion vector according to the determined moving direction and the moving displacement.
As shown in fig. 4, assuming that the position of the compensation lens group in the camera is at the initial position oa, that is, the camera shake angle is 0, when the first image is started, the gyroscope detects that the shake information of the camera is α with reference to the initial position of the camera1And the dithering information alpha of the first image is converted into the dithering information alpha1And sending the data to the optical anti-shake module and the electronic anti-shake module. The optical anti-shake module is used for shaking information alpha1The position of a compensation lens group in the camera is adjusted, and then a first image is shot. Wherein, the compensation information of the compensation lens group is beta1At this time, the position of the compensation lens group in the camera is located at OB. When a second image is taken, the gyroscope detects the shake information of the camera as alpha with reference to OB2And the dithering information alpha of the second image is converted into the dithering information alpha2And sending the data to the optical anti-shake module and the electronic anti-shake module. Therefore, the optical anti-shake module needs to be a compensating mirrorCompensation information beta of slice groups1The compensation information beta is sent to the electronic anti-shake module which can send the compensation information beta according to the optical anti-shake module1Jitter information alpha of the first image1And the dithering information alpha of the second image2Calculating the actual dithering information of the second image as alpha211. Then, the electronic anti-shake module can only obtain the shake information α of the first image1And actual shaking information alpha of the second image211A relative motion vector between the first image and the second image is determined, and the second image is compensated according to the relative motion vector to compensate for a shaking difference between the second image and the first image.
The video shooting method provided by the disclosure moves the compensation lens group in the camera to a preset position, namely an initial position OA, every preset time length, so that before shooting a second image, when the gyroscope detects the shaking information of the camera, the shaking information is always detected by taking the initial position OA as a reference, and if the shaking information detected by the gyroscope is alpha3Then the jitter information alpha3The actual jitter information of the second image is obtained, the optical anti-jitter module sends the second image to the electronic anti-jitter module, and the electronic anti-jitter module can directly obtain the jitter information alpha obtained when the first image is shot1And the dithering information alpha of the second image3A relative motion vector between the first image and the second image is determined and the second image is compensated for according to the amount of relative motion.
Therefore, according to the video shooting method provided by the embodiment of the disclosure, the optical anti-shake module does not need to send the compensation information of the compensation lens group when shooting the first image to the electronic anti-shake module, so that the calculation amount can be reduced, the extra resource consumption is reduced, and the information blockage between the optical anti-shake module and the electronic anti-shake module is avoided. Meanwhile, the optical anti-shake module does not need to send the compensation information of the compensation lens group when the first image is shot to the electronic anti-shake module, the electronic anti-shake module does not need to align the compensation information of the compensation lens group sent by the optical anti-shake module with the system time of the electronic anti-shake module in time, and the alignment precision does not affect the compensation effect of the electronic anti-shake module.
To sum up, in the video shooting method provided by the embodiment of the disclosure, after the camera shoots the first image, the compensation lens group in the camera is moved to the preset position, so that when the gyroscope detects the shake information, the compensation lens group of the camera is always located at the initial position. The optical anti-shake module starts to adjust the position of the compensation lens group from a preset position according to the acquired shake information of the camera, so that when the adjusted camera shoots a second image, the optical anti-shake module can send the second image to the electronic anti-shake module, and the electronic anti-shake module can compensate the second image only according to the shake information acquired by the electronic anti-shake module when the camera shoots a first image and the shake information of the second image detected by the gyroscope when the compensation lens group of the camera is located at an initial position. The compensation information of the electronic anti-shake module which does not need to compensate the lens group is realized, the second image can be compensated, the calculated amount is reduced, extra resource consumption is avoided, information blockage occurs between the optical anti-shake module and the electronic anti-shake module, time alignment is carried out between the compensation information of the compensation lens group and the system time of the electronic anti-shake module, the influence of the precision on the anti-shake result does not need to be considered, and the anti-shake quality is improved.
Fig. 5 is a flowchart of another video shooting method provided by the embodiment of the present disclosure. The electronic equipment comprises a camera, a gyroscope, an optical anti-shake module and an electronic anti-shake module. Next, a method of video capture provided by the embodiment of the present disclosure will be described by taking the captured image A, B, C as an example. As shown in fig. 5, the method includes the following steps.
Step 501: after the image A is shot through the camera, the compensation lens group is moved to the preset position through the camera.
The compensation lens group can be moved to a preset position every preset time length from the beginning of shooting a first image by the camera, wherein the preset time length is the shooting time interval when the camera shoots any two adjacent images.
Step 502: when the camera is to shoot the next image, the optical anti-shake module performs optical shake compensation, that is, shake information of the camera is obtained through the gyroscope, and the position of the compensation lens group is adjusted from a preset position according to the shake information.
Step 503: after the camera performs the optical shake compensation, the camera takes an image B and executes step 504 and step 506.
Step 504: the camera sends the image B to the optical anti-shake module, and the optical anti-shake module sends the image B to the electronic anti-shake module.
Step 505: when receiving the image B, the electronic anti-shake module performs electronic shake compensation on the image B, namely, the electronic anti-shake module determines a relative motion vector between the image A and the image B according to shake information acquired by a camera when shooting the image A and shake information of the image B, and compensates the image B according to the relative motion vector between the image A and the image B.
Step 506: and after the image B is shot by the camera, the compensation lens group is moved to the preset position again.
Step 507: when the camera is to shoot the next image, the optical anti-shake module carries out optical shake compensation.
Step 508: after the camera performs the optical shake compensation, the camera takes an image C and executes step 509 and step 511.
Step 509: the camera sends the image C to the optical anti-shake module, and the optical anti-shake module sends the image C to the electronic anti-shake module.
Step 510: and when receiving the image C, the electronic anti-shake module carries out electronic shake compensation on the image C.
Step 511: and after the image C is shot by the camera, the compensation lens group is moved to the preset position again.
In summary, in the shooting process, after the camera shoots each frame of image, the compensation lens group in the camera is moved to the preset position. The optical anti-shake module carries out optical shake compensation, shoots the current frame image through the camera, and later the optical anti-shake module only needs to send this image to the electron anti-shake module, and the electron anti-shake module compensates this image. And the optical anti-shake module is not required to send the compensation information of the compensation lens group to the electronic anti-shake module, so that the calculation amount is reduced, the extra resource consumption is avoided, and the information blockage between the optical anti-shake module and the electronic anti-shake module is avoided.
Fig. 6 is a schematic structural diagram of a video capture electronic device according to an embodiment of the present disclosure. The electronic device is applied to an electronic device, and the electronic device comprises a camera 601, a gyroscope 602, an optical anti-shake module 603 and an electronic anti-shake module 604.
The camera 601 is used for moving the compensation lens group to a preset position after shooting a first image;
the optical anti-shake module 603 is configured to obtain shake information of the camera through the gyroscope 602, and start adjusting the position of the compensation lens group from a preset position according to the shake information; the camera 601 is used for shooting a second image through the adjusted camera;
the optical anti-shake module 603 is configured to send a second image to the electronic anti-shake module 604 without sending the compensation information of the compensation lens group;
the electronic anti-shake module 604 is configured to receive the second image and obtain shake information through the gyroscope;
the electronic anti-shake module 604 is configured to compensate the second image according to shake information of the second image and shake information of the first image acquired by the camera when the camera takes the first image.
In one possible implementation, the electronic anti-shake module 604 is configured to:
determining a relative motion vector between a second image and a first image according to the shake information of the second image and the shake information of the first image acquired by the camera 601 when shooting the first image;
the second image is compensated according to the relative motion vector.
In one possible implementation, the electronic anti-shake module 604 is configured to:
determining a first motion vector corresponding to the shake information acquired by the camera 601 when shooting the first image and a second motion vector corresponding to the shake information of the second image;
and calculating the difference value of the second motion vector and the first motion vector to obtain the relative motion vector.
In one possible implementation, the relative motion vector includes a relative motion direction and a relative motion displacement, and the electronic anti-shake module 604 is further configured to:
and shifting the second image by the displacement indicated by the relative motion displacement according to the direction opposite to the relative motion direction so as to compensate the second image.
In one possible implementation, the camera 601 is further configured to:
and moving the compensation lens group to a preset position every preset time length from the beginning of shooting the first image, wherein the preset time length is the shooting time interval when the camera shoots any two adjacent images.
In summary, in the video shooting method provided by the embodiment of the disclosure, after the camera shoots the first image, the compensation lens group in the camera is moved to the preset position. The optical anti-shake module starts to adjust the position of the compensation lens group from a preset position according to the acquired shake information of the camera, so that when the adjusted camera shoots a second image, the optical anti-shake module can send the second image to the electronic anti-shake module, and the electronic anti-shake module can compensate the second image only according to the shake information acquired by the electronic anti-shake module when the camera shoots a first image and the shake information of the second image. The compensation information of the compensation lens group is not required to be sent to the electronic anti-shake module by the optical anti-shake module, so that the calculation amount is reduced, the extra resource consumption is avoided, and the information blockage between the optical anti-shake module and the electronic anti-shake module is avoided.
With regard to the electronic device in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. For example, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 7, the electronic device 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and a communication component 716.
The processing component 702 generally controls overall operation of the electronic device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 702 may include one or more processors 720 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 702 may include one or more modules that facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operations at the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phonebook data, messages, pictures, videos, and the like. The memory 704 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 706 provides power to the various components of the electronic device 700. The power components 707 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 700.
The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 700 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 710 is configured to output and/or input audio signals. For example, the audio component 710 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 704 or transmitted via the communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
The I/O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 714 includes one or more sensors for providing status assessment of various aspects of the electronic device 700. For example, the sensor assembly 714 may detect an open/closed state of the electronic device 700, the relative positioning of components, such as a display and keypad of the electronic device 700, the sensor assembly 714 may also detect a change in the position of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, the orientation or acceleration/deceleration of the electronic device 700, and a change in the temperature of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the methods provided by the embodiments shown in fig. 2 or fig. 3 and described above.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 704 comprising instructions, executable by the processor 720 of the electronic device 700 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (8)

1. A video shooting method is applied to electronic equipment, wherein the electronic equipment comprises a camera, a gyroscope, an optical anti-shake module and an electronic anti-shake module, and the method comprises the following steps:
after a first image is shot by the camera, moving a compensation lens group to a preset position every a preset time length from the beginning of shooting the first image by the camera, wherein the preset time length is a shooting time interval when the camera shoots any two adjacent images, and the preset position is an initial position of the compensation lens group;
the optical anti-shake module acquires shake information of the camera through the gyroscope, adjusts the position of the compensation lens group from the preset position according to the shake information, and shoots a second image through the adjusted camera;
the optical anti-shake module sends the second image to the electronic anti-shake module under the condition that the compensation information of the compensation lens group is not sent;
the electronic anti-shake module receives the second image and acquires the shake information through the gyroscope;
the electronic anti-shake module compensates the second image according to the shake information of the second image and the shake information of the first image acquired by the camera when shooting the first image.
2. The method according to claim 1, wherein the compensating the second image according to the shake information acquired by the camera when the first image is captured and the shake information of the second image comprises:
determining a relative motion vector between the second image and the first image according to the jitter information acquired by the camera when the first image is shot and the jitter information of the second image;
and compensating the second image according to the relative motion vector.
3. The method according to claim 2, wherein the determining the relative motion vector between the second image and the first image according to the shake information acquired by the camera when the first image is captured and the shake information of the second image comprises:
determining a first motion vector corresponding to shaking information acquired by the camera when the camera shoots the first image and a second motion vector corresponding to shaking information of the second image;
and calculating the difference value of the second motion vector and the first motion vector to obtain the relative motion vector.
4. The method of claim 2, wherein the relative motion vector comprises a relative motion direction and a relative motion displacement, and wherein the compensating the second image according to the relative motion vector comprises:
and according to the opposite direction of the relative motion direction, moving the second image by the displacement indicated by the relative motion displacement so as to compensate the second image.
5. An electronic device, comprising a camera, a gyroscope, an optical anti-shake module, and an electronic anti-shake module;
the camera is used for moving the compensation lens group to a preset position every preset time length from the beginning of shooting a first image after shooting the first image, wherein the preset time length is a shooting time interval when the camera shoots any two adjacent images, and the preset position is an initial position of the compensation lens group;
the optical anti-shake module is used for acquiring shake information of the camera through the gyroscope, adjusting the position of the compensation lens group from the preset position according to the shake information, and the camera is used for shooting a second image;
the optical anti-shake module is used for sending the second image to the electronic anti-shake module under the condition that the compensation information of the compensation lens group is not sent;
the electronic anti-shake module is used for receiving the second image and acquiring the shake information through the gyroscope;
the electronic anti-shake module is used for compensating the second image according to the shake information of the second image and the shake information of the first image acquired by the camera when shooting the first image.
6. The electronic device of claim 5, wherein the electronic anti-shake module is to:
determining a relative motion vector between the second image and the first image according to the jitter information acquired by the camera when the first image is shot and the jitter information of the second image;
and compensating the second image according to the relative motion vector.
7. The electronic device of claim 6, wherein the electronic anti-shake module is further to:
determining a first motion vector corresponding to shaking information acquired by the camera when the camera shoots the first image and a second motion vector corresponding to shaking information of the second image;
and calculating the difference value of the second motion vector and the first motion vector to obtain the relative motion vector.
8. The electronic device of claim 6, wherein the relative motion vector comprises a relative motion direction and a relative motion displacement, the electronic anti-shake module further to:
and according to the opposite direction of the relative motion direction, moving the second image by the displacement indicated by the relative motion displacement so as to compensate the second image.
CN201810629254.8A 2018-06-19 2018-06-19 Video shooting method and electronic equipment Active CN110620871B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810629254.8A CN110620871B (en) 2018-06-19 2018-06-19 Video shooting method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810629254.8A CN110620871B (en) 2018-06-19 2018-06-19 Video shooting method and electronic equipment

Publications (2)

Publication Number Publication Date
CN110620871A CN110620871A (en) 2019-12-27
CN110620871B true CN110620871B (en) 2021-01-26

Family

ID=68920213

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810629254.8A Active CN110620871B (en) 2018-06-19 2018-06-19 Video shooting method and electronic equipment

Country Status (1)

Country Link
CN (1) CN110620871B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113364978B (en) * 2021-05-27 2022-07-05 艾酷软件技术(上海)有限公司 Image processing method and device, electronic equipment and readable storage medium
CN113473027B (en) * 2021-07-09 2023-09-05 Oppo广东移动通信有限公司 Image processing method, electronic device, and storage medium
WO2023005355A1 (en) * 2021-07-30 2023-02-02 荣耀终端有限公司 Image anti-shake method and electronic device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1598681A (en) * 2003-09-18 2005-03-23 佳能株式会社 Optical apparatus provided with image-shake correction function
CN101419318A (en) * 2007-10-25 2009-04-29 鸿富锦精密工业(深圳)有限公司 Camera module
CN108881703A (en) * 2017-05-09 2018-11-23 杭州海康威视数字技术股份有限公司 Stabilization control method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104349039B (en) * 2013-07-31 2017-10-24 展讯通信(上海)有限公司 Video anti-fluttering method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1598681A (en) * 2003-09-18 2005-03-23 佳能株式会社 Optical apparatus provided with image-shake correction function
CN101419318A (en) * 2007-10-25 2009-04-29 鸿富锦精密工业(深圳)有限公司 Camera module
CN108881703A (en) * 2017-05-09 2018-11-23 杭州海康威视数字技术股份有限公司 Stabilization control method and device

Also Published As

Publication number Publication date
CN110620871A (en) 2019-12-27

Similar Documents

Publication Publication Date Title
US9674395B2 (en) Methods and apparatuses for generating photograph
CN110557547B (en) Lens position adjusting method and device
CN110858873B (en) Electronic device and photographing method
CN106210496B (en) Photo shooting method and device
CN110769147B (en) Shooting method and electronic equipment
EP3544286B1 (en) Focusing method, device and storage medium
CN112114765A (en) Screen projection method and device and storage medium
CN110620871B (en) Video shooting method and electronic equipment
CN111756989A (en) Method and device for controlling focusing of lens
CN112884809A (en) Target tracking method and device, electronic equipment and storage medium
CN114430453B (en) Camera anti-shake system, control method, equipment and medium
CN110769146B (en) Shooting method and electronic equipment
CN113315903B (en) Image acquisition method and device, electronic equipment and storage medium
CN114765663A (en) Anti-shake processing method and device, mobile device and storage medium
CN114430457A (en) Shooting method, shooting device, electronic equipment and storage medium
CN112203015B (en) Camera control method, device and medium system
CN115134505B (en) Preview picture generation method and device, electronic equipment and storage medium
CN110458962B (en) Image processing method and device, electronic equipment and storage medium
CN114339015B (en) Photographing processing method, photographing processing device and storage medium
CN109447929B (en) Image synthesis method and device
CN113141482B (en) Video generation method, device and storage medium
CN109862252B (en) Image shooting method and device
CN117241141A (en) Lens shake compensation method, compensation device, electronic equipment and storage medium
CN115550538A (en) Tracking shooting method, device and medium
CN117522942A (en) Depth distance measuring method, depth distance measuring device, electronic equipment and readable 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