Anti-shake method and device and electronic equipment

The anti-shake method improves image stabilization by calibrating gyroscope jitter using a second camera's image frame, addressing the issue of large bias errors in existing technologies.

CN119136054AActive Publication Date: 2024-12-13VIVO MOBILE COMM CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411373166.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2024-12-13
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

Existing anti-shake technologies in camera devices rely on gyroscopes that suffer from large bias errors and are affected by temperature changes, leading to poor image stabilization.

Method used

An anti-shake method that calibrates the jitter amount detected by a gyroscope using a target error value obtained from a second camera's image frame, improving the accuracy of jitter detection and stabilization.

Benefits of technology

Enhances the precision of image stabilization by correcting gyroscope errors, resulting in clearer and more stable images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119136054A_ABST
    Figure CN119136054A_ABST
Patent Text Reader

Abstract

The invention discloses an anti-shake method and device and electronic equipment, and belongs to the field of shake detection. The method comprises the following steps: in a shooting process of a first camera on target equipment, acquiring a first jitter amount detected by a gyroscope on the target equipment; obtaining a target error value of the gyroscope, wherein the target error value is obtained based on a target image frame shot by a second camera on the target equipment; calibrating the first jitter amount based on the target error value to obtain a target jitter amount; and based on the target jitter amount, carrying out anti-jitter operation on the first camera.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of jitter detection, and specifically relates to an anti-shake method, device and electronic equipment. Background Art

[0002] When using a camera device (such as a digital camera or a smartphone camera) to shoot, especially when holding the camera device, the device often shakes, which can cause blurry images. Therefore, how to prevent shaking during shooting is an important issue.

[0003] The related technology usually uses a gyroscope set on the camera equipment to detect the shake of the camera equipment during shooting, and then moves the lens accordingly to achieve anti-shake operation. However, the bias error of the gyroscope is large and is easily affected by temperature changes. There is a problem of poor anti-shake effect caused by the large gyroscope detection error. Summary of the invention

[0004] The embodiments of the present application provide an anti-shake method, an apparatus and an electronic device, which can solve the problem of poor anti-shake effect caused by large gyroscope detection error in related technologies.

[0005] In a first aspect, an embodiment of the present application provides an anti-shake method, including: During shooting by a first camera on a target device, obtaining a first jitter amount detected by a gyroscope on the target device; Obtaining a target error value of the gyroscope, where the target error value is obtained based on a target image frame captured by a second camera on the target device; Calibrate the first jitter amount based on the target error value to obtain a target jitter amount; Based on the target shake amount, an anti-shake operation is performed on the first camera.

[0006] In a second aspect, an embodiment of the present application provides an anti-shake device, including: An acquisition module is used to acquire a first jitter amount detected by a gyroscope on the target device during shooting by a first camera on the target device; and acquire a target error value of the gyroscope, wherein the target error value is obtained based on a target image frame shot by a second camera on the target device; A calibration module, configured to calibrate the first jitter amount based on the target error value to obtain a target jitter amount; The anti-shake operation module is used to perform an anti-shake operation on the first camera based on the target shake amount.

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

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed, the steps of the method described in the first aspect are implemented.

[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the method described in the first aspect.

[0010] At least one of the above technical solutions provided in the embodiments of the present application can achieve the following technical effects: In the embodiment of the present application, not only does it rely on the first jitter amount detected by the gyroscope during the shooting of the first camera on the target device, but the first jitter amount is also calibrated in combination with the target error value obtained by the target image frame shot by the second camera, to ensure that the obtained target jitter amount has a high accuracy, and the first camera is anti-shake operated with the target jitter amount with a high accuracy, thereby solving the problem of poor anti-shake effect caused by large gyroscope detection error in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0012] Figure 1 is a flow chart of an anti-shake method provided in an embodiment of the present application; Figure 2 is a flow chart of another anti-shake method provided by an embodiment of the present application; Figure 3 is a flow chart of another anti-shake method provided by an embodiment of the present application; Figure 4 A schematic diagram of a gyroscope detecting a jitter amount provided in an embodiment of the present application; Figure 5 A schematic diagram of determining a displacement vector provided in an embodiment of the present application; Figure 6 is a specific flow chart of an anti-shake method provided in an embodiment of the present application; Figure 7 is a structural block diagram of an anti-shake device provided in an embodiment of the present application; Figure 8 It is a structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0013] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

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

[0015] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0016] The anti-shake method provided in the embodiment of the present application is applied to the anti-shake situation of the camera. Specifically, during the process of shooting by the first camera on the target device, the first shake amount can be obtained by detecting the gyroscope on the target device, and the first shake amount is calibrated based on the target error value of the gyroscope to obtain the target shake amount, and the anti-shake operation is performed on the first camera based on the target shake amount. The target error value is obtained based on the target image frame shot by the second camera on the target device.

[0017] The anti-shake method provided in the embodiment of the present application can be executed by a target device, wherein the target device can be a device with an image capture function, such as a digital camera, a video camera, a smart phone, and a tablet computer.

[0018] The anti-shake method provided in the embodiment of the present application is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0019] See also Figure 1 , Figure 1 is a flow chart of an anti-shake method provided by an embodiment of the present application. Figure 1 As shown, the method comprises the following steps: Step 110: During shooting by a first camera on a target device, a first jitter amount detected by a gyroscope on the target device is obtained.

[0020] In an embodiment of the present application, the target device may be an image capture device, such as a digital camera, a video camera, a smart phone, etc. The target device has one or more cameras. For example, a device with multiple cameras usually includes multiple cameras such as an ultra-wide-angle camera, a wide-angle camera, and a telephoto camera according to different focal lengths of the cameras. The first camera is a camera on the target device, which may be a camera selected by the target user according to actual shooting needs. All cameras on the target device are in an off state by default. By detecting the camera in the on state, the camera used by the target user during the shooting process, that is, the first camera on the target device, can be determined.

[0021] In an embodiment of the present application, a gyroscope is further provided on the target device, and the gyroscope can be used to detect the amount of jitter of the target device. During the shooting process of the first camera, the gyroscope can detect the first amount of jitter of the target device during the shooting process of the first camera. In fact, when the gyroscope is used for jitter detection, the bias error of the jitter detection of the gyroscope is large, and the bias error changes with temperature, resulting in a large error in the jitter detection of the gyroscope, and the jitter detection is unstable.

[0022] It should be noted that, since the target device and the camera and gyroscope on the target device are all in a relatively static state, the jitter amount of the target device, the jitter amount of the camera on the target device, and the jitter amount of the gyroscope on the target device may be the same jitter amount.

[0023] Step 120: Obtain a target error value of the gyroscope, where the target error value is obtained based on a target image frame captured by a second camera on the target device.

[0024] In an embodiment of the present application, the target error value may be a bias error of the gyroscope. When a second camera on the target device is used for shooting, a target image frame shot by the second camera may be obtained through an image sensor on the target device. The image sensor may be located on the second camera, and is used to obtain a target image frame shot by the second camera, and the target image frame may include one or more image frames.

[0025] In one embodiment of the present application, the second camera and the first camera may be the same camera. In the case where the first camera and the second camera are the same camera, during the process of shooting by the camera, a target image frame shot by the camera in a historical time period may be obtained, and the target error value of the gyroscope may be obtained based on the target image frame.

[0026] In one embodiment of the present application, the second camera may also be a camera that is not used during the process of shooting with the first camera. That is, the first camera and the second camera may be different cameras. In fact, unless otherwise specified below, it can be considered that the first camera and the second camera are different cameras.

[0027] In the embodiment of the present application, the target device includes multiple cameras. When it is detected that the first camera is in the startup state, it can be determined that the first camera is in use, and an unused camera can be selected from the multiple cameras as the second camera. For example, the target device includes three cameras, namely, an ultra-wide-angle camera, a wide-angle camera, and a telephoto camera. When it is detected that the wide-angle camera (the first camera) is in the startup state, one camera can be selected from the ultra-wide-angle camera and the telephoto camera as the second camera.

[0028] In an embodiment of the present application, by selecting an unused camera as the second camera, the jitter amount of the first camera can be calibrated while using the first camera for shooting, so that the real-time jitter amount detection accuracy of the first camera is higher, and the image quality obtained by using the first camera is also higher.

[0029] In one embodiment of the present application, the target error value of the gyroscope can be obtained in the following manner: when the first camera is started, the target image frame captured by the second camera on the target device is obtained; based on the target image frame, the second jitter amount of the target device is determined; during the shooting process of the second camera, the third jitter amount detected by the gyroscope on the target device is obtained; based on the second jitter amount and the third jitter amount, the target error value of the gyroscope is obtained.

[0030] In the embodiment of the present application, the second jitter amount of the target device can be determined based on the target image frame captured by the second camera. In the process of capturing the target image frame by the second camera, the third jitter amount of the process of capturing the target image frame by the second camera can be detected by the gyroscope on the target device. Then, the difference between the second jitter amount and the third jitter amount can be determined as the target error value of the gyroscope.

[0031] In the process of determining the second jitter amount based on the target image frame, the second jitter amount in the process of obtaining the target image frame by shooting using the second camera of the target device can be determined based on the image condition of the target image frame. For example, in the case where the image of the target image frame has residual image or blur, the second jitter amount of the target device can be determined based on the image blur degree of the target image frame. The same entity can also be shot based on the second camera to obtain multiple target image frames, and the second jitter amount of the target device can be determined based on the image difference between the multiple target image frames (displacement vectors between the target image frames).

[0032] The anti-shake method provided in the embodiment of the present application is generally used in the process of shooting of the target user. Specifically, when it is detected that the first camera on the target device is in the startup state, the second camera on the target device is turned on, and the target image frame is obtained by shooting with the second camera. During the shooting process of the second camera, the gyroscope on the target device obtains the third jitter amount of the target device. At the same time, the second jitter amount of the target device can be determined based on the target image frame obtained by shooting with the second camera. After obtaining the second jitter amount and the third jitter amount, the target error value can be obtained based on the second jitter amount and the third jitter amount.

[0033] For example, when the target user uses the shooting function of the mobile phone (for example, the target user clicks on the camera application of the mobile phone and selects the first camera to start shooting), the gyroscope's jitter detection is calibrated, and a periodic calibration method can be used (for example, calibration every one second) to obtain a real-time target error value for the gyroscope's jitter detection. When the target user clicks to shoot (starts preparing for imaging), the gyroscope can detect the jitter amount (first jitter amount) of the target device during the target user's shooting process, and calibrate the first jitter amount based on the target error value to obtain the target jitter amount of the target device, and use the target jitter amount to perform a corresponding displacement on the first camera to achieve an anti-shake operation.

[0034] In the embodiment of the present application, since determining the second jitter amount based on the target image frame and obtaining the third jitter amount by gyroscope detection are two different jitter detection methods, a target error value of the gyroscope can be determined based on the second jitter amount and the third jitter amount, and the target error value can be used to calibrate the jitter amount obtained by gyroscope detection, thereby further improving the accuracy of jitter amount detection.

[0035] In an embodiment of the present application, an optical image stabilization system may be provided on the target device. After obtaining the target error value of the gyroscope, the target error value may be updated to the optical image stabilization system in real time. The optical image stabilization system may calibrate the jitter amount detected by the gyroscope based on the target error value.

[0036] Step 130: Calibrate the first jitter amount based on the target error value to obtain a target jitter amount.

[0037] In the embodiment of the present application, for example, the difference between the first jitter amount and the target error value may be determined as the target jitter amount.

[0038] Step 140: Based on the target shake amount, perform an anti-shake operation on the first camera.

[0039] In the embodiment of the present application, the first camera can be subjected to a corresponding displacement operation based on the target jitter amount to achieve anti-shake for the first camera. Since the target jitter amount is the jitter amount obtained after calibrating the first jitter amount based on the target error value, the target jitter amount is closer to the actual jitter amount of the target device than the first jitter amount. Therefore, the anti-shake operation performed by the target jitter amount has a better effect, and the image captured by the first camera is more stable and clear.

[0040] In an embodiment of the present application, the first camera that the user is shooting can be anti-shake operated through the target jitter amount, and the target jitter amount is obtained after calibration with the first jitter amount determined based on the target image frame. The jitter amount has higher accuracy and improves the image quality taken with the first camera.

[0041] In one embodiment of the present application, the anti-shake operation includes an optical anti-shake operation.

[0042] In an embodiment of the present application, optical image stabilization (OIS) technology is a technology that compensates for image deviation caused by hand shake or other unstable factors by physically moving the lens or image sensor. OIS technology usually relies on a gyroscope to detect the amount of shake of the target device, and then adjusts the position of the lens or sensor to keep the image stable.

[0043] The anti-shake method provided in the embodiment of the present application can be applied to OIS technology to calibrate the amount of shake detected by the gyroscope, further improve the accuracy of gyroscope shake detection, improve the anti-shake effect of optical anti-shake technology, and effectively improve the image stability using optical anti-shake technology.

[0044] It should be noted that the anti-shake method provided in the embodiment of the present application can be applied not only to OIS technology, but also to other anti-shake technologies that use gyroscopes for anti-shake, such as Electronic Image Stabilization (EIS) technology using a gyroscope. EIS technology is a technology that compensates for image jitter through a software algorithm.

[0045] Specifically, the related art usually uses a static method to calibrate the bias error of the gyroscope, and then uses the calibrated gyroscope data to calibrate the image sensor that needs to be calibrated to obtain the EIS algorithm parameters. The anti-shake method provided in the embodiment of the present application can be applied to the process of calibrating the gyroscope in the above-mentioned electronic anti-shake technology to improve the jitter detection accuracy of the gyroscope and improve the bias error of the gyroscope when using the EIS calibration algorithm in the related art.

[0046] In an embodiment of the present application, during the process of shooting with the first camera on the target device, the first jitter amount detected by the gyroscope on the target device is obtained; the target error value of the gyroscope is obtained, and the target error value is obtained based on the target image frame shot with the second camera on the target device; the first jitter amount is calibrated based on the target error value to obtain the target jitter amount; and the first camera is anti-shake operated based on the target jitter amount. In this way, not only does it rely on the first jitter amount detected by the gyroscope during the shooting with the first camera on the target device, but it also calibrates the first jitter amount in combination with the target error value obtained by the target image frame shot with the second camera, ensuring that the obtained target jitter amount has a high precision, and the first camera is anti-shake operated with the target jitter amount with a high precision, which solves the problem of poor anti-shake effect caused by large gyroscope detection error in related technologies.

[0047] See also Figure 2 , Figure 2 is a flow chart of another anti-shake method provided by an embodiment of the present application. Figure 2 As shown, the method comprises the following steps: Step 210: During shooting by a first camera on a target device, a first jitter amount detected by a gyroscope on the target device is obtained.

[0048] Step 220: when the first camera is started, a target image frame captured by a second camera on the target device is obtained, where the target image frame includes multiple image frames.

[0049] In the embodiment of the present application, the target image frame includes multiple image frames obtained by continuously shooting the same object, and if the shaking of the target device in the process of shooting the target image frame is ignored, the image contents of the multiple image frames are the same. In other words, the difference between the multiple image frames is caused by the shaking of the target device in the shooting process.

[0050] Step 230: Determine a displacement vector of a target object based on multiple image frames, where the target object is an object existing in all of the multiple image frames.

[0051] In the embodiment of the present application, the target object is an object that exists in the multiple image frames. Since the difference between the multiple image frames is caused by the jitter of the target device during the shooting process, the displacement vector of the target object in the multiple image frames can be used to indirectly indicate the amount of jitter of the target device during the process of shooting the multiple image frames. That is, the amount of jitter of the target device during the process of shooting the multiple image frames can be determined by comparing the positions of the target object in the multiple image frames.

[0052] In addition, in order to avoid interference with the jitter detection process due to the movement of the target object itself, the target object can be an object in a stationary state, for example, a table, a house, a tree or other still life in an image frame can be selected as the target object. Since the target object is in a stationary state, the displacement vector of the target object in multiple image frames is caused by the jitter of the target device. By detecting the displacement vector of the target object, the jitter of the target device can be determined.

[0053] Exemplarily, in one embodiment of the present application, the multiple image frames include an adjacent first image frame and a second image frame, and determining the displacement vector of the target object based on the multiple image frames in step 230 includes: performing feature point detection on the first image frame and the second image frame to obtain feature points of the first image frame and feature points of the second image frame; determining the target object by performing feature point matching on the feature points on the first image frame and the feature points on the second image frame, wherein the target object includes feature points that match between the first image frame and the second image frame; and determining the displacement vector of the target object based on a first position of the target object in the first image frame and a second position of the target object in the second image frame.

[0054] In the embodiment of the present application, for any two adjacent image frames in the plurality of image frames, the target object can be determined and the displacement vector of the target object in the two adjacent image frames can be determined in the following manner. It should be noted that the two adjacent image frames referred to here means that the two image frames are obtained sequentially in time and there is no other image frame between the two image frames.

[0055] In the process of determining the target object, the feature points of the two adjacent image frames may be detected first, and the feature points may be points with significant features, such as corner points or edge points, etc. At the same time, there is no restriction on the feature point detection algorithm used, such as the Harris corner point detection algorithm or the Scale-Invariant Feature Transform (SIFT) algorithm.

[0056] After determining the feature points of the two adjacent image frames, feature point matching can be performed on the feature points of the two adjacent image frames, and the feature point matching is used to match the feature points of the same object at the same position. It should be noted that the feature point matching here is to match the feature points of the two image frames, rather than internal matching of the feature points of one image frame. Specifically, the descriptors of the feature points of the two image frames can be extracted first, and then the feature points of the two image frames can be matched by calculating the similarity between the descriptors. Among them, the SIFT algorithm or the Oriented Fast and Rotated Brief (ORB) algorithm can be used for descriptor extraction.

[0057] After feature point matching is performed on the feature points of the two adjacent image frames, a pair of matching feature points of the two adjacent image frames can be obtained. Based on the matching feature point pairs, motion estimation is performed on the two adjacent image frames. Specifically, for any pair of matching feature points in the matching feature point pairs, the displacement vector of the matching feature point pair can be determined based on the first position of the matching feature point pair in the first image frame and the second position of the matching feature point pair in the second image frame. For example, image frame 1 and image frame 2 are adjacent image frames, and feature point A in image frame 1 matches feature point B in image frame 2. The displacement vector of the feature point pair (feature point A and feature point B) can be determined based on the position of feature point A in image frame 1 and the position of feature point B in image frame 2.

[0058] An optical flow method or a direct motion estimation method may be used to determine the displacement vector of the feature point pair between two image frames. The optical flow method is, for example, the Lucas-Kanade optical flow method.

[0059] In one embodiment of the present application, the target object is determined by performing feature point matching on the feature points on the first image frame and the feature points on the second image frame, including: obtaining matching feature point pairs by performing feature point matching on the feature points on the first image frame and the feature points on the second image frame; obtaining target feature point pairs that meet target conditions from the matching feature point pairs; and determining the target object based on the target feature point pairs.

[0060] In an embodiment of the present application, the target condition may include an object that is stationary during the shooting process of the second camera. Since the movement vector of the feature point is used to detect the jitter caused by the target device, the movement of the feature point itself will interfere with the detection of the jitter caused by the target device. Therefore, in order to avoid this interference, a feature point pair of an object in a stationary state can be selected from the matching feature point pairs as a target feature point pair, and the target feature point pair is determined as the target object, and the displacement vector of the target object is further determined. In this way, the interference of the jitter detection of the target device due to the movement of the feature point itself is reduced, and the jitter detection accuracy of the target device is improved.

[0061] Step 240: Determine a second jitter amount of the target device based on the displacement vector of the target object.

[0062] In the embodiment of the present application, for any two adjacent image frames, the feature point pairs that match between the two adjacent image frames may include multiple feature point pairs, wherein each feature point pair may correspond to a displacement vector. In other words, multiple feature point pairs may correspond to multiple displacement vectors. Since the multiple displacement vectors are all generated by the jitter of the target device, the multiple displacement vectors are theoretically the same, and the displacement vector may be determined as the displacement vector between the two adjacent image frames.

[0063] However, in actual application, it is impossible to completely ensure that all selected feature point pairs correspond to absolutely stationary objects, and the displacement vectors corresponding to multiple feature point pairs may have individual differences. Therefore, the displacement vector with the largest number of the same displacement vectors among the multiple displacement vectors can be selected as the displacement vector between two adjacent image frames.

[0064] In the embodiment of the present application, for any two adjacent image frames, a displacement vector may correspond between the two adjacent image frames. For example, the target image frames include image frame 1, image frame 2, and image frame 3, image frame 1 and image frame 2 are adjacent, image frame 2 and image frame 3 are adjacent, image frame 1 and image frame 2 may correspond to a displacement vector, and image frame 2 and image frame 3 may correspond to a displacement vector.

[0065] In addition, the jitter amount of the two adjacent image frames may be determined based on the displacement vector between the two adjacent image frames. For example, the displacement vector between the two adjacent image frames may be directly determined as the jitter amount of the two adjacent image frames.

[0066] Step 250: During the shooting process of the second camera, a third jitter amount detected by the gyroscope on the target device is obtained.

[0067] Step 260: Obtain a target error value of the gyroscope based on the second jitter amount and the third jitter amount.

[0068] Step 270: Calibrate the first jitter amount based on the target error value to obtain a target jitter amount.

[0069] Step 280: Based on the target shake amount, perform an anti-shake operation on the first camera.

[0070] In an embodiment of the present application, a displacement vector of a target object is determined based on multiple image frames, and the target object is an object that exists in the multiple image frames; based on the displacement vector of the target object, a first jitter amount of the target device is determined. In this way, the jitter amount of the target device can be indirectly determined by determining the displacement vector of the target object that exists in multiple image frames, providing a method for analyzing image frames to determine the jitter amount of the target device.

[0071] The present application embodiment specifically describes a method for determining the jitter amount of a target device based on a displacement vector of a target object. Figure 3 , Figure 3 is a flow chart of another anti-shake method provided by an embodiment of the present application. Figure 3 As shown, the method comprises the following steps: Step 310: During shooting by a first camera on a target device, a first jitter amount detected by a gyroscope on the target device is obtained.

[0072] Step 320: when the first camera is started, a target image frame captured by a second camera on the target device is obtained, where the target image frame includes multiple image frames.

[0073] Step 330: Based on the multiple image frames, determine a displacement vector of a target object, where the target object is an object existing in the multiple image frames, and the displacement vector includes at least one of a first displacement vector and a second displacement vector.

[0074] The first displacement vector is used to indicate the displacement of the target object in the horizontal direction, and the second displacement vector is used to indicate the displacement of the target object in the vertical direction.

[0075] Please refer to Figure 4 , Figure 4 A schematic diagram of a gyroscope detecting a jitter amount provided in an embodiment of the present application. Figure 4 As shown, the gyroscope can be used to detect the jitter amount of the target device at three angles, namely, the jitter amount of the target device at the pitch angle, yaw angle and roll angle. That is to say, when calibrating the jitter amount detected by the gyroscope, the jitter amount detected by the gyroscope can be calibrated from three aspects: the pitch angle, the yaw angle and the roll angle. Among them, since the jitter amount of the target device at the roll angle will not cause the image captured by the camera of the target device to be blurred, it is only necessary to calibrate the jitter amount of the target device detected by the gyroscope at the pitch angle and the yaw angle.

[0076] At the same time, in order to detect the jitter amount of the target device at the pitch angle and the yaw angle, the displacement vector of the target object in the horizontal direction and the vertical direction can be obtained. Specifically, the description of the following steps can be referred to. The following steps 340 and 350 are not in a particular order during the actual implementation process. Step 340 can be performed first, and then step 350, or step 350 can be performed first, and then step 340.

[0077] Step 340: When the displacement vector includes a first displacement vector, determine a first jitter component of the target device at a yaw angle based on the first displacement vector and an image distance of the second camera.

[0078] In the embodiments of this application, please refer to Figure 5 , Figure 5 The present application provides a schematic diagram of determining a displacement vector. The displacement vector may be represented as a two-dimensional vector (dx, dy), and the displacement vector may include a first displacement vector of the target object in the horizontal direction (e.g. Figure 5 dx in the vertical direction) and a second displacement vector in the vertical direction (e.g. Figure 5 Based on the first displacement vector of the target object in the horizontal direction, a first jitter component of the target device at the yaw angle may be determined.

[0079] Specifically, the image distance of the second camera may be obtained first. The image distance of the second camera is a fixed parameter of the second camera, and different cameras may correspond to different image distances. Figure 5 As shown, the first displacement vector, the image distance of the second camera, and the first jitter component of the target device at the yaw angle may have the following geometric relationship: ; Where, dx is the first displacement vector, v is the image distance of the second camera, is the first jitter component of the target device in the yaw angle.

[0080] Therefore, the inverse tangent function ATAN() can be used to determine the first jitter component of the target device at the yaw angle through the following formula based on the first displacement vector and the image distance of the second camera: ; Where, dx is the first displacement vector, v is the image distance of the second camera, is the first jitter component of the target device in the yaw angle, Used to represent the inverse tangent function.

[0081] Correspondingly, the gyroscope on the target device can detect the jitter amount of the target device at three angles: pitch angle, yaw angle and roll angle. That is, the first jitter amount includes a third jitter component and a fourth jitter component. The third jitter component is used to indicate the jitter amount of the target device detected by the gyroscope at the yaw angle, and the fourth jitter component is used to indicate the jitter amount of the target device detected by the gyroscope at the pitch angle.

[0082] Step 350: When the displacement vector includes a second displacement vector, determine a second jitter component of the target device at a pitch angle based on the second displacement vector and an image distance of the second camera.

[0083] In the embodiment of the present application, similar to the determination method of the first jitter component, as follows: Figure 5 As shown, the second displacement vector, the image distance of the second camera, and the second jitter component of the target device at the pitch angle may have the following geometric relationship: ; Where dy is the second displacement vector, v is the image distance of the second camera, It is the second jitter component of the target device at the pitch angle.

[0084] It can be seen that the inverse tangent function ATAN() can be used to determine the second jitter component of the target device at the pitch angle through the following formula based on the second displacement vector and the image distance of the second camera: ; Where dy is the second displacement vector, v is the image distance of the second camera, It is the second jitter component of the target device at the pitch angle.

[0085] Step 360: During the shooting process of the second camera, a third jitter amount detected by the gyroscope on the target device is obtained.

[0086] In an embodiment of the present application, the gyroscope on the target device can detect the amount of jitter of the target device at three angles: pitch angle, yaw angle, and roll angle. That is, the third jitter amount includes a fifth jitter component and a sixth jitter component. The fifth jitter component is used to indicate the amount of jitter of the target device detected by the gyroscope at the yaw angle, and the sixth jitter component is used to indicate the amount of jitter of the target device detected by the gyroscope at the pitch angle.

[0087] Step 370: Obtain a target error value of the gyroscope based on the second jitter amount and the third jitter amount.

[0088] In the embodiment of the present application, the target error value includes a first error value of the gyroscope detecting the jitter amount at a pitch angle, and a second error value of the gyroscope detecting the jitter amount at a yaw angle. The first error value is the error value between the first jitter component and the fifth jitter component, and the second error value is the error value between the second jitter component and the sixth jitter component.

[0089] A first error value may be obtained based on the first jitter component and a fifth jitter component detected by the gyroscope, and a second error value may be obtained based on the second jitter component and a sixth jitter component detected by the gyroscope.

[0090] In one embodiment of the present application, the number of the second jitter amount and the number of the third jitter amount are both M, where M is a positive integer greater than 1. The step 370 of obtaining the target error value of the gyroscope based on the second jitter amount and the third jitter amount includes: determining M differences between the second jitter amount and the third jitter amount based on the M second jitter amounts and the M third jitter amounts; performing derivative processing on the M differences to obtain M angular velocity values ​​of the gyroscope; and determining the average of the M angular velocity values ​​as the target error value.

[0091] In the embodiment of the present application, the second jitter amount is M second jitter amounts obtained based on multiple image frames, and the M second jitter amounts include M first jitter components and M second jitter components. The third jitter amount is M third jitter amounts detected by the gyroscope when the second camera captures multiple image frames, and the M third jitter amounts include M fifth jitter components and M sixth jitter components.

[0092] When determining the first error value of the gyroscope based on the M first jitter components and the M fifth jitter components, the following method can be used. First, determine the M differences between the M first jitter components and the M fifth jitter components. The difference here is the difference between the first jitter component and the fifth jitter component generated by the second camera during the shooting process. For example, in the process of using the second camera to shoot and obtain image frame 2, the first jitter component can be determined based on the displacement vector between the image frame 2 and the previous image frame, and the fifth jitter component of the second camera when shooting and obtaining image frame 2 obtained by the gyroscope detection can be obtained. A difference can be determined based on the first jitter component and the fifth jitter component. In other words, M differences can be determined based on the M first jitter components and the M fifth jitter components, and the following formula can be referred to.

[0093] ; in, is a data sequence consisting of M first jitter components determined based on multiple image frames, is a data sequence composed of M fifth jitter components detected by the gyroscope when the second camera obtains a plurality of image frames, wherein the data sequence can be arranged in a time sequence in which the second camera obtains the plurality of image frames. It is a data sequence consisting of M differences determined based on the M first jitter components and the M fifth jitter components.

[0094] After determining the data sequence consisting of M difference values, for each of the M difference values, the time parameter can be differentiated to obtain M angular velocity values ​​corresponding to the M difference values, where the angular velocity value is the angular velocity value of the target device at the yaw angle. Specifically, refer to the following formula: ; in, is a data sequence consisting of M differences determined based on the M first jitter components and the M fifth jitter components, It is a data sequence obtained by determining M angular velocity values ​​based on M difference values.

[0095] After determining the M angular velocity values ​​of the target device at the yaw angle, the average of the M angular velocity values ​​can be determined as the bias error of the gyroscope at the yaw angle, that is, the first error value, to filter out the high-frequency components therein. Specifically, the following formula can be referred to: ; in, is the bias error of the gyroscope at the yaw angle, It is a data sequence obtained by determining M angular velocity values ​​based on M difference values.

[0096] Accordingly, based on the M second jitter components and the M sixth jitter components, the method for determining the second error value of the gyroscope can refer to the above method. First, the M differences between the M second jitter components and the M sixth jitter components can be determined by referring to the following formula.

[0097] ; in, is a data sequence consisting of M second jitter components determined based on multiple image frames, is a data sequence composed of M sixth jitter components detected by the gyroscope when the second camera obtains multiple image frames, and the data sequence here can be arranged in the time sequence of obtaining the multiple image frames by the second camera. It is a data sequence consisting of M differences determined based on the M second jitter components and the M sixth jitter components.

[0098] After determining the data sequence consisting of M differences, for each of the M differences, the time parameter can be differentiated to obtain M angular velocity values ​​corresponding to the M differences, where the angular velocity value is the angular velocity value of the target device at the pitch angle. Specifically, refer to the following formula: ; in, is a data sequence consisting of M differences determined based on the M second jitter components and the M sixth jitter components, It is a data sequence obtained by determining M angular velocity values ​​based on M difference values.

[0099] After determining the M angular velocity values ​​of the target device at the yaw pitch angle, the average of the M angular velocity values ​​can be determined as the bias error of the gyroscope at the pitch angle, that is, the second error value, to filter out the high-frequency components therein. Specifically, the following formula can be referred to: ; in, is the bias error of the gyroscope at the pitch angle, It is a data sequence obtained by determining M angular velocity values ​​based on M difference values.

[0100] After determining the target error value (the first error value and the second error value), the jitter amount detected by the gyroscope can be calibrated based on the target error value. Specifically, when the target user uses the first camera to shoot an image, the gyroscope can detect a first jitter amount when the first camera shoots the image, and the first jitter amount includes a third jitter component of the target device at a yaw angle detected by the gyroscope when the first camera shoots the image, and a fourth jitter component of the target device at a pitch angle.

[0101] Step 380: Calibrate the first jitter amount based on the target error value to obtain a target jitter amount.

[0102] In the embodiment of the present application, the first jitter amount can be calibrated by the target error value to obtain a target jitter amount, and the target jitter amount includes the seventh jitter component of the first camera at the yaw angle when shooting an image, and the eighth jitter component of the first camera at the pitch angle when shooting an image. The difference between the third jitter component and the bias error (first error value) of the gyroscope at the yaw angle can be determined as the seventh jitter component of the first camera at the yaw angle when shooting an image; the difference between the fourth jitter component and the bias error (second error value) of the gyroscope at the pitch angle can be determined as the eighth jitter component of the first camera at the pitch angle when shooting an image.

[0103] Step 390: Based on the target shake amount, perform an anti-shake operation on the first camera.

[0104] In the embodiment of the present application, based on the seventh shake component of the first camera at the yaw angle and the eighth shake component of the first camera at the pitch angle, the first camera may be anti-shake operated at the yaw angle and the pitch angle respectively.

[0105] In an embodiment of the present application, the jitter amount of the target device is determined based on the displacement vector from two angles: the pitch angle and the yaw angle. By accurately determining the first jitter amount, the bias error detection accuracy of the gyroscope is improved, thereby achieving a better calibration effect on the jitter amount of the gyroscope.

[0106] See also Figure 6 , Figure 6 is a specific flow chart of an anti-shake method provided by an embodiment of the present application. Figure 6 As shown, the method comprises the following steps: Step 610: During shooting by a first camera on a target device, a first jitter amount detected by a gyroscope on the target device is obtained.

[0107] In an embodiment of the present application, the first jitter amount includes a third jitter component and a fourth jitter component, the third jitter component is used to indicate the jitter amount of the target device detected by the gyroscope at the yaw angle, and the fourth jitter component is used to indicate the jitter amount of the target device detected by the gyroscope at the pitch angle.

[0108] Step 615: when the first camera is activated, a target image frame captured by a second camera on the target device is obtained, where the target image frame includes adjacent first image frames and second image frames.

[0109] Step 620: Perform feature point detection on the first image frame and the second image frame to obtain feature points of the first image frame and feature points of the second image frame.

[0110] Step 625: Determine a target object by matching feature points on the first image frame with feature points on the second image frame, where the target object includes feature points that match between the first image frame and the second image frame.

[0111] In an embodiment of the present application, the target object can be determined in the following manner: by matching feature points on the first image frame with feature points on the second image frame to obtain matching feature point pairs; obtaining target feature point pairs that meet the target conditions from the matching feature point pairs; and determining the target object based on the target feature point pairs.

[0112] Step 630: Determine a displacement vector of the target object based on a first position of the target object in the first image frame and a second position of the target object in the second image frame.

[0113] In an embodiment of the present application, the displacement vector includes a first displacement vector and a second displacement vector, the first displacement vector is used to indicate the displacement of the target object in a horizontal direction, and the second displacement vector is used to indicate the displacement of the target object in a vertical direction.

[0114] Step 635: Determine a second jitter amount of the target device based on the displacement vector of the target object.

[0115] In an embodiment of the present application, the second jitter amount includes at least one of a first jitter component and a second jitter component, the first jitter component is used to indicate the jitter amount at a yaw angle, and the second jitter component is used to indicate the jitter amount at a pitch angle. The second jitter amount of the target device can be determined in the following manner.

[0116] In the case where the displacement vector includes a first displacement vector, a first jitter component of the target device at the yaw angle is determined based on the first displacement vector and the image distance of the second camera; in the case where the displacement vector includes a second displacement vector, a second jitter component of the target device at the pitch angle is determined based on the second displacement vector and the image distance of the second camera.

[0117] Step 640: During the shooting process of the second camera, a third jitter amount detected by the gyroscope on the target device is obtained.

[0118] In an embodiment of the present application, the third jitter amount includes a fifth jitter component and a sixth jitter component, the fifth jitter component is the jitter amount of the target device at the yaw angle detected by the gyroscope, and the sixth jitter component is the jitter amount of the target device at the pitch angle detected by the gyroscope.

[0119] Step 645: Obtain a target error value of the gyroscope based on the second jitter amount and the third jitter amount.

[0120] In the embodiment of the present application, the number of the second jitter amount and the number of the third jitter amount are both M, where M is a positive integer greater than 1. The target error value of the gyroscope can be determined based on the following method: based on the M second jitter amounts and the M third jitter amounts, M differences between the second jitter amount and the third jitter amount are determined; the M differences are differentiated to obtain M angular velocity values ​​of the gyroscope; and the average of the M angular velocity values ​​is determined as the target error value of the gyroscope.

[0121] The target error value includes a first error value of the gyroscope detecting the jitter amount at a pitch angle and a second error value of the gyroscope detecting the jitter amount at a yaw angle. The first error value is the error value between the first jitter component and the fifth jitter component, and the second error value is the error value between the second jitter component and the sixth jitter component.

[0122] Step 650: Calibrate the first jitter amount based on the target error value to obtain a target jitter amount.

[0123] In an embodiment of the present application, all cameras on the target device are in a closed state by default. When it is detected that a camera on the target device is in an activated state (the camera may be in an activated state to be used, for example, the target user opens the camera application but has not clicked to shoot), the camera can be determined to be the first camera. At the same time, an unused camera on the target device can be selected as the second camera, and the second camera can be used for shooting to obtain multiple target image frames. The gyroscope on the target device can simultaneously detect the third jitter amount of the target device when the second camera shoots each target image frame. The second jitter amount of the target device is determined by the displacement vector between the multiple target image frames, and the difference between the second jitter amount and the third jitter amount is determined as the target error value of the gyroscope. The target error value is used to calibrate the jitter amount detected by the gyroscope later.

[0124] When the first camera is shooting (for example, the user clicks the shooting button), the gyroscope can detect the first jitter amount of the target device when the first camera is shooting. Then, the first jitter amount can be calibrated using the target error value, that is, the difference between the first jitter amount and the target error value is determined as the target jitter amount of the target device.

[0125] Specifically, the target jitter amount includes the seventh jitter component of the first camera at the yaw angle when shooting an image, and the eighth jitter component of the first camera at the pitch angle when shooting an image. The difference between the third jitter component and the bias error (first error value) of the gyroscope at the yaw angle can be determined as the seventh jitter component of the first camera at the yaw angle when shooting an image; the difference between the fourth jitter component and the bias error (second error value) of the gyroscope at the pitch angle can be determined as the eighth jitter component of the first camera at the pitch angle when shooting an image.

[0126] Step 655: Based on the target shake amount, perform an anti-shake operation on the first camera.

[0127] In an embodiment of the present application, during the process of shooting with the first camera on the target device, the first jitter amount detected by the gyroscope on the target device is obtained; the target error value of the gyroscope is obtained, and the target error value is obtained based on the target image frame shot with the second camera on the target device; the first jitter amount is calibrated based on the target error value to obtain the target jitter amount; and the first camera is anti-shake operated based on the target jitter amount. In this way, not only does it rely on the first jitter amount detected by the gyroscope during the shooting with the first camera on the target device, but it also calibrates the first jitter amount in combination with the target error value obtained by the target image frame shot with the second camera, ensuring that the obtained target jitter amount has a high precision, and the first camera is anti-shake operated with the target jitter amount with a high precision, which solves the problem of poor anti-shake effect caused by large gyroscope detection error in related technologies.

[0128] It is important to understand that Figures 1 to 6 The explanations of the same or corresponding steps in the following can be referred to each other. Figure 1 The explanation of step 130 and step 140 in Figure 2 Steps 270 and 280 in .

[0129] At the same time, it should be understood that an anti-shake method provided in an embodiment of the present application may have the following beneficial effects: First, by using a multimodal sensor data fusion method, by combining the displacement vector of the target device detected by the camera and the jitter amount of the target device detected by the gyroscope, the gyroscope is calibrated in real time for bias error, which can effectively improve the stability, accuracy and reliability of the image captured by the target device. Second, compared with the test calibration method that the related technology relies on additional equipment (fixing the target device by a bracket or table) and asynchronous non-real-time (not calibrating the bias error of the gyroscope while shooting), the anti-shake method provided in this application has the advantages of high efficiency, low power consumption and low cost. Third, the anti-shake method provided in this application is not only for static shooting, but also suitable for achieving efficient optical image stabilization in dynamic scenes. Fourth, the anti-shake method provided in this application can be used in combination with the EIS control calibration algorithm using a gyroscope in the related technology to achieve better electronic image stabilization in the EIS control calibration algorithm.

[0130] See also Figure 7 , Figure 7 is a structural block diagram of an anti-shake device provided in an embodiment of the present application. Figure 7 As shown, an embodiment of the present application provides an anti-shake device 700 , which includes: an acquisition module 710 , a calibration module 720 and an anti-shake operation module 730 .

[0131] The acquisition module 710 is used to acquire a first jitter amount detected by a gyroscope on the target device during shooting by a first camera on the target device; and acquire a target error value of the gyroscope, wherein the target error value is obtained based on a target image frame shot by a second camera on the target device; The calibration module 720 is configured to calibrate the first jitter amount based on the target error value to obtain a target jitter amount; The anti-shake operation module 730 is used to perform an anti-shake operation on the first camera based on the target shake amount.

[0132] In an embodiment of the present application, during the process of shooting with the first camera on the target device, the first jitter amount detected by the gyroscope on the target device is obtained; the target error value of the gyroscope is obtained, and the target error value is obtained based on the target image frame shot with the second camera on the target device; the first jitter amount is calibrated based on the target error value to obtain the target jitter amount; and the first camera is anti-shake operated based on the target jitter amount. In this way, not only does it rely on the first jitter amount detected by the gyroscope during the shooting with the first camera on the target device, but it also calibrates the first jitter amount in combination with the target error value obtained by the target image frame shot with the second camera, ensuring that the obtained target jitter amount has a high precision, and the first camera is anti-shake operated with the target jitter amount with a high precision, which solves the problem of poor anti-shake effect caused by large gyroscope detection error in related technologies.

[0133] The anti-shake device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.

[0134] like Figure 8 As shown, an embodiment of the present application also provides an electronic device 800. The electronic device 800 includes: a processor 810 and a memory 820, and the memory 820 stores a program or instruction, and the program or instruction implements the steps of any of the methods described above when executed by the processor 810. For example, when the program is executed by the processor 810, the following process is implemented: during the shooting process of the first camera on the target device, a first jitter amount detected by the gyroscope on the target device is obtained; a target error value of the gyroscope is obtained, and the target error value is obtained based on the target image frame shot by the second camera on the target device; the first jitter amount is calibrated based on the target error value to obtain a target jitter amount; based on the target jitter amount, an anti-shake operation is performed on the first camera. In this way, it not only relies on the first jitter amount detected by the gyroscope during the shooting process of the first camera on the target device, but also calibrates the first jitter amount in combination with the target error value obtained by the target image frame shot by the second camera, ensuring that the obtained target jitter amount has high accuracy, and uses the target jitter amount with high accuracy to perform anti-shake operation on the first camera, thereby solving the problem of poor anti-shake effect caused by large gyroscope detection error in related technologies.

[0135] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of each embodiment of the anti-shake method are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

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

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

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

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

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

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

Claims

1. An anti-shake method, characterized in that: include: During shooting by a first camera on a target device, obtaining a first jitter amount detected by a gyroscope on the target device; Obtaining a target error value of the gyroscope, where the target error value is obtained based on a target image frame captured by a second camera on the target device; Calibrate the first jitter amount based on the target error value to obtain a target jitter amount; Based on the target shake amount, an anti-shake operation is performed on the first camera.

2. The method according to claim 1, characterized in that The obtaining of the target error value of the gyroscope comprises: When the first camera is started, obtaining a target image frame captured by a second camera on the target device; Determining a second jitter amount of the target device based on the target image frame; During the shooting process of the second camera, obtaining a third jitter amount detected by a gyroscope on the target device; A target error value of the gyroscope is obtained based on the second jitter amount and the third jitter amount.

3. The method according to claim 1 or 2, characterized in that: The second camera is a camera that is not used during the shooting process of the first camera.

4. The method according to claim 2, characterized in that: The anti-shake operation includes an optical anti-shake operation.

5. The method according to claim 2, characterized in that: The target image frame includes a plurality of image frames; and determining a second jitter amount of the target device based on the target image frame includes: Determine a displacement vector of a target object based on a plurality of image frames, wherein the target object is an object existing in the plurality of image frames; Based on the displacement vector of the target object, a second jitter amount of the target device is determined.

6. The method according to claim 5, characterized in that The multiple image frames include a first image frame and a second image frame that are adjacent to each other; and determining the displacement vector of the target object based on the multiple image frames includes: Performing feature point detection on the first image frame and the second image frame to obtain feature points of the first image frame and feature points of the second image frame; Determine a target object by performing feature point matching on feature points on the first image frame and feature points on the second image frame, wherein the target object includes feature points matched between the first image frame and the second image frame; A displacement vector of the target object is determined based on a first position of the target object in the first image frame and a second position of the target object in the second image frame.

7. The method according to claim 6, characterized in that The determining the target object by matching feature points on the first image frame with feature points on the second image frame includes: Acquire matching feature point pairs by performing feature point matching on the feature points on the first image frame and the feature points on the second image frame; Obtain target feature point pairs that meet target conditions from the matched feature point pairs; Based on the target feature point pair, a target object is determined.

8. The method according to claim 5, characterized in that The displacement vector includes at least one of a first displacement vector and a second displacement vector, the first displacement vector is used to indicate the displacement of the target object in a horizontal direction, and the second displacement vector is used to indicate the displacement of the target object in a vertical direction; the second jitter amount includes at least one of a first jitter component and a second jitter component, the first jitter component is used to indicate the jitter amount at a yaw angle, and the second jitter component is used to indicate the jitter amount at a pitch angle; The determining a second jitter amount of the target device based on the displacement vector of the target object includes: In a case where the displacement vector includes a first displacement vector, determining a first jitter component of the target device at the yaw angle based on the first displacement vector and an image distance of the second camera; In a case where the displacement vector includes a second displacement vector, a second jitter component of the target device at the pitch angle is determined based on the second displacement vector and an image distance of the second camera.

9. The method according to any one of claims 5 to 8, characterized in that: The number of the second jitter amount and the number of the third jitter amount are both M, where M is a positive integer greater than 1; and obtaining a target error value of the gyroscope based on the second jitter amount and the third jitter amount includes: Determining, based on the M second jitter amounts and the M third jitter amounts, M differences between the second jitter amounts and the third jitter amounts; Processing the M differences to obtain M angular velocity values ​​of the gyroscope; An average value of the M angular velocity values ​​is determined as a target error value of the gyroscope.

10. An anti-shake device, characterized in that: include: An acquisition module, used for acquiring a first jitter amount detected by a gyroscope on the target device during shooting by a first camera on the target device; Obtaining a target error value of the gyroscope, where the target error value is obtained based on a target image frame captured by a second camera on the target device; A calibration module, configured to calibrate the first jitter amount based on the target error value to obtain a target jitter amount; The anti-shake operation module is used to perform an anti-shake operation on the first camera based on the target shake amount.

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

12. A computer-readable storage medium, characterized in that: The medium stores a program or an instruction, and when the program or the instruction is executed, the steps of the method according to any one of claims 1 to 9 are implemented.

13. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 9 when being executed by a processor.

Citation Information

Patent Citations

  • Shooting method and device and electronic equipment

    CN113556464A

  • Optical anti-shake method and related equipment thereof

    CN117135458A

  • Photograph lens, and camera system

    JP2005043780A

  • Image shake correction device and method for controlling the same, imaging system, and program

    JP2021012259A