Control method, control device, electronic device and medium
The control method enhances anti-shake performance by integrating focal length and real-time posture data to adjust camera module movements, addressing image blurring issues in special scenes and optimizing power usage.
Patent Information
- Application Number
- CN202210719145.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2042-06-23
AI Technical Summary
Existing optical image stabilization technologies do not effectively address image blurring caused by camera shake in special scenes, leading to poor image quality.
A control method that determines a calibration value based on the camera's focal length, combines it with real-time and filtered postures to calculate an anti-shake compensation amount, and adjusts the camera module's movement for precise compensation.
Ensures stable and consistent anti-shake performance across varying focal lengths, improving image stability and reducing power consumption by synchronizing anti-shake compensation with exposure timing.
Smart Images

Figure CN115022548B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of anti-shake shooting, and in particular to a control method, a control device, an electronic device and a medium. Background Art
[0002] During the shooting process, if the shooting device shakes, the shot image will be unclear, and it is difficult to keep the shooting device stable. Therefore, in the related art, optical image stabilization technology is used to improve the problem of blurred images caused by shooting shake. However, optical image stabilization does not take some special scenes into consideration, resulting in poor image improvement effect in special scenes. Summary of the invention
[0003] Embodiments of the present application provide a control method, a control device, an electronic device, and a medium.
[0004] The control method of the implementation mode of the present application includes: determining a calibration value according to the current focal length of the camera module; determining an anti-shake compensation amount according to the current real-time posture of the camera module and the current filtering posture of the camera module; and controlling the movement of the camera module to perform anti-shake compensation according to the calibration value and the anti-shake compensation amount.
[0005] The control device of the embodiment of the present application includes a first processing module, a second processing module and a control module. The first processing module is used to determine a calibration value according to the current focal length of the camera module; the second processing module is used to determine an anti-shake compensation amount according to the current real-time posture of the camera module and the current filtering posture of the camera module; the control module is used to control the movement of the camera module to perform anti-shake compensation according to the calibration value and the anti-shake compensation amount.
[0006] The electronic device of the embodiment of the present application includes one or more processors and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the control method described above are implemented.
[0007] The computer-readable storage medium of the embodiment of the present application stores a computer program thereon, and when the program is executed by a processor, the steps of the control method described in the above embodiment are implemented.
[0008] The above-mentioned control method, control device, electronic device and medium can control the movement of the camera module in combination with the current focal length of the camera module, can adapt to the anti-shake compensation requirements under different focus states, ensure stable and consistent shake compensation under different current focal lengths, and ensure the anti-shake effect.
[0009] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0011] Figure 1 It is a flow chart of a control method according to an embodiment of the present application;
[0012] Figure 2 is a schematic diagram of a control device according to an embodiment of the present application;
[0013] Figure 3 It is a schematic diagram of the principle of the control method of the implementation mode of the present application;
[0014] Figure 4 It is a flow chart of a control method according to an embodiment of the present application;
[0015] Figure 5 is a schematic diagram of a control device according to an embodiment of the present application;
[0016] Figure 6 is a schematic diagram of an electronic device according to an embodiment of the present application;
[0017] Figure 7 is another schematic diagram of an electronic device according to an embodiment of the present application;
[0018] Figure 8 is another schematic diagram of an electronic device according to an embodiment of the present application;
[0019] Fig. 9 It is a flow chart of a control method according to an embodiment of the present application;
[0020] Fig.10 is a schematic diagram of a control device according to an embodiment of the present application;
[0021] Fig.11 is another principle schematic diagram of the control method of an embodiment of the present application;
[0022] Fig.12 is a schematic diagram of a control device according to an embodiment of the present application;
[0023] Fig.13 It is a flow chart of a control method according to an embodiment of the present application;
[0024] Fig.14 is a schematic diagram of a control device according to an embodiment of the present application;
[0025] Fig.15 It is a flow chart of a control method according to an embodiment of the present application;
[0026] Fig.16is a schematic diagram of a control device according to an embodiment of the present application;
[0027] Fig.17 It is a flow chart of a control method according to an embodiment of the present application;
[0028] Fig.18 is a schematic diagram of a control device according to an embodiment of the present application;
[0029] Fig.19 It is a flow chart of a control method according to an embodiment of the present application;
[0030] Fig. 20 is a schematic diagram of a control device according to an embodiment of the present application;
[0031] Fig.21 It is a flow chart of a control method according to an embodiment of the present application;
[0032] Fig. 22 is a schematic diagram of an electronic device according to an embodiment of the present application.
[0033] Description of main component symbols:
[0034] Electronic device 100, camera module 10, lens 111, lens barrel 1111, image sensor 113, first driving member 115, first magnetic member 1151, first coil 1153, first magnetic induction sensor 1155, first iron shell 1157, first ball bearing 1159, second driving member 117, second magnetic member 1171, second coil 1173, second magnetic induction sensor 1175, second iron shell 1177, second ball bearing 1179, image processor 119, anti-shake driving circuit 121, focus driving circuit 123, memory 40, processor 50;
[0035] Control device 200, first processing module 21, first determination unit 211, second determination unit 213, second processing module 23, control module 25, first processing unit 251, second processing unit 253, first processing sub-unit 2531, control sub-unit 2533, third processing unit 255, second processing sub-unit 2551, third processing sub-unit 2553, focus module 27, third processing module 29, fourth processing module 28. DETAILED DESCRIPTION
[0036] The embodiments of the present application are described in detail below, and the embodiments of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0037] In the description of the embodiments of the present application, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0038] See also Figure 1 , control methods include:
[0039] 01: Determine a calibration value according to the current focal length of the camera module 10;
[0040] 03: Determine the anti-shake compensation amount according to the current real-time posture of the camera module 10 and the current filtering posture of the camera module 10;
[0041] 05: According to the calibration value and the anti-shake compensation amount, the camera module 10 is controlled to move to perform anti-shake compensation.
[0042] See also Figure 2 , the control method of the embodiment of the present application can be implemented by the control device 200 of the embodiment of the present application, wherein step 01 can be implemented by the first processing module 21, step 03 can be implemented by the second processing module 23, and step 05 can be implemented by the control module 25. That is to say, the first processing module 21 can be used to determine the calibration value according to the current focal length of the camera module 10. The second processing module 23 can be used to determine the anti-shake compensation amount according to the current real-time posture of the camera module 10 and the current filtering posture of the camera module 10. The control module 25 can be used to control the movement of the camera module 10 to perform anti-shake compensation according to the calibration value and the anti-shake compensation amount.
[0043] The control method and control device 200 of the implementation mode of the present application can control the movement of the camera module 10 in combination with the current focal length of the camera module 10, can adapt to the anti-shake compensation requirements under different focus states, ensure stable and consistent shake compensation under different current focal lengths, and ensure the anti-shake effect.
[0044] Specifically, taking the compensation correction of the moving image sensor 113 as an example, the moving distance of the image sensor 113 is related to the focal length of the camera module 10. In the related art, the anti-shake compensation is not combined with the focal length of the camera module 10, which makes the anti-shake effect poor. This application combines the current focal length to perform anti-shake compensation, which can achieve a better anti-shake compensation effect in the scene where the focal length changes. For example, please combine Figure 3To compensate for the same angle θ, when the focal length is f1, the image sensor 113 needs to move a distance X, and when the focal length is f2, the image sensor 113 needs to move a distance X+△x. Therefore, by combining the focal length of the camera module 10 for anti-shake compensation, a better anti-shake compensation effect can be achieved in the scene where the focal length changes.
[0045] The camera module 10 can be applied to an electronic device 100. The electronic device 100 may include a smart phone, a tablet computer, a smart watch, a smart bracelet, etc., which are not specifically limited here. The electronic device 100 of the embodiment of the present application is illustrated by taking a smart phone as an example, which cannot be understood as a limitation of the present application.
[0046] The control device 200 can be applied to the electronic device 100, and the control device 200 can be used to control the camera module 10 to perform anti-shake compensation. The control device 200 can be integrated in the camera module 10, which is not specifically limited here.
[0047] The current real-time posture is used to characterize the current posture of the camera module 10 after shaking. The current real-time posture can be obtained by a motion sensor. Specifically, the electronic device 100 may include a motion sensor. The motion sensor may include an accelerometer (Acc), which may be used to detect acceleration data of the camera module 10. The motion sensor may also include a gyroscope (Gyro), which may be used to detect and obtain angular velocity data of the camera module 10. Of course, the motion sensor may also include other motion sensors, which are not specifically limited here.
[0048] The anti-shake compensation amount can represent the difference between the current real-time posture and the current filtering posture, that is, the anti-shake compensation amount can be understood as the distance of the shake. Specifically, △Q = Q i -Qfilter, where △Q is the anti-shake compensation amount, Q i The current real-time posture, Qfilter is the current filter posture. Among them, △Q is a vector (△x, △y, △z). △x, △y, △z represent the anti-shake compensation amount on the XYZ axis respectively.
[0049] It is worth noting that the camera module 10 may include a lens 111 and an image sensor 113. When controlling the camera module 10 to move for anti-shake compensation, the lens 111 may be controlled to move for anti-shake compensation, the image sensor 113 may be controlled to move for anti-shake compensation, or the lens 111 and the image sensor 113 may be controlled to move for anti-shake compensation. This application does not impose any specific restrictions. For example, when the camera module 10 shakes vertically upward as a whole, the lens 111 may be controlled to move vertically downward for anti-shake compensation, the image sensor 113 may be controlled to move vertically upward for anti-shake compensation, or the lens 111 may be controlled to move vertically downward and the image sensor 113 may be controlled to move vertically upward for anti-shake compensation.
[0050] Taking controlling the movement of the image sensor 113 to perform anti-shake compensation as an example, there are many methods for controlling the movement of the image sensor 113. For example, in a certain implementation, please combine Figure 8 The electronic device 100 includes an image sensor 113 and a second driving member 117. The second driving member 117 can drive the image sensor 113 to move under the action of a second driving current. Specifically, the second driving member 117 can be a voice coil motor. The second driving member 117 includes a second magnetic member 1171, a second coil 1173 (Coil), a second magnetic induction sensor 1175, a second iron shell 1177 and a second ball bearing 1179. The second magnetic member 1171 is fixedly mounted on the image sensor 113. The second coil 1173 and the second magnetic induction sensor 1175 are fixedly mounted on the second iron shell 1177. The second coil 1173 can drive the image sensor 113 to move under the action of the second driving current. The second magnetic induction sensor 1175 can measure the position of the image sensor 113 based on the change of magnetic flux when the image sensor 113 moves. The second ball bearing 1179 is arranged on the side of the image sensor 113 to control the stability of the image sensor 113 when it moves along the side direction. The second magnetic induction sensor 1175 may include a Hall sensor (Hall).
[0051] See also Figure 4 In some embodiments, the control method further comprises:
[0052] 07: When receiving the shooting command, perform the focus operation;
[0053] 09: When the focusing operation is completed, the current focal length of the camera module 10 is obtained.
[0054] See also Figure 5In some embodiments, the control device 200 further includes a focusing module 27 and a third processing module 29. Step 01 can be implemented by the focusing module 27, and step 09 can be implemented by the third processing module 29. In other words, the focusing module 27 can be used to perform a focusing operation when receiving a shooting command. The third processing module 29 can be used to obtain the current focal length of the camera module 10 when the focusing operation is completed.
[0055] In this way, anti-shake compensation can be performed after the focus operation is completed, providing a basis for anti-shake compensation according to the focal length, and avoiding the degradation of the jitter compensation effect caused by signal asynchrony when the focus control and anti-shake compensation work independently.
[0056] In some embodiments, when the camera module 10 is controlled to move to perform anti-shake compensation, the image sensor 113 is exposed.
[0057] In this way, the influence of response delay in the anti-shake compensation process can be reduced through strict synchronization timing. In addition, taking OIS (Optical Image Stabilization) as an example, since the anti-shake compensation frequency is high and the compensation range is small, it is usually used to suppress motion blur rather than image stabilization during video shooting. Therefore, there is no need for anti-shake in the frame interval period and readout period before the image sensor 113 is exposed. That is, combining anti-shake compensation with exposure timing can avoid unnecessary power consumption overhead of anti-shake compensation and improve the efficiency of anti-shake compensation.
[0058] For details, please combine Figure 7 In a certain embodiment, the electronic device 100 includes an image processor 119, an image sensor 113, an anti-shake drive circuit 121 and a focus drive circuit 123. After the focus drive circuit 123 returns a focus completion signal, the image processor 119 can send an anti-shake enable command to the anti-shake drive circuit 121 to perform anti-shake compensation, and send an exposure enable command to the image sensor 113 to expose the image sensor 113.
[0059] There are many ways to perform focus operation. In a certain implementation, please combine Figure 6 and Figure 7The electronic device 100 includes a lens 111 and an image sensor 113. The lens 111 includes a lens barrel 1111. The electronic device 100 also includes a first driving member 115. The first driving member 115 can drive the lens 111 to move along the axis direction of the lens barrel 1111 to achieve focusing. The lens 111 also includes a lens, which is fixedly mounted on the lens barrel 1111. Specifically, the first driving member 115 may include a ball-type voice coil motor, a spring-type voice coil motor, a piezoelectric motor, etc. The first driving member 115 may include a first magnetic member 1151, a first coil 1153 (Coil), a first magnetic induction sensor 1155, a first iron shell 1157 and a first ball bearing 1159. The first magnetic member 1151 is fixedly mounted on the lens barrel 1111. The first coil 1153 and the first magnetic induction sensor 1155 are fixedly mounted on the first iron shell 1157. The first coil 1153 can drive the lens 111 to move under the action of the first driving current. The first magnetic induction sensor 1155 can measure the position of the lens 111 based on the change of magnetic flux when the lens 111 moves. The first ball bearing 1159 is provided on the lens barrel 1111 to control the stability of the lens 111 when it moves along the axis direction of the lens barrel 1111. When the first coil 1153 passes the changing first driving current, a Lorentz force can be generated. After the Lorentz force acts on the first magnetic member 1151, the first magnetic member 1151 drives the lens 111 to move. Since the data measured by the first magnetic induction sensor 1155 is transmitted to the focus driving circuit 123 in real time, the first driving current can be continuously adjusted to ensure that the lens 111 reaches an accurate focus position.
[0060] It should be noted that the shooting command may be initiated by the user through the electronic device 100, for example, the user may initiate the shooting command through a key, touch, or voice command. The shooting command may also be initiated by an application (Application, APP) installed on the electronic device 100. The shooting command may include a photo shooting request or a video recording request.
[0061] The focusing operation can be understood as moving the lens 111 to change the focal length of the lens 111 so that when the light reflected by the photographed object passes through the lens 111 and is captured by the image sensor 113, a high-definition original image can be generated. The focusing operation can be automatic focusing or manual focusing by the user, which is not limited here. It can be understood that the current focal length of the lens 111 can be automatically determined after the focusing operation is completed.
[0062] In certain embodiments, see Fig. 9 , step 01 includes:
[0063] 011: determining the current object distance according to the current focal length and a preset lookup table, wherein the preset lookup table includes a corresponding relationship between the current focal length and the current object distance;
[0064] 013: Determine the calibration value based on the current focal length and the current object distance.
[0065] See also Fig.10 In some embodiments, the first processing module 21 includes a first determining unit 211 and a second determining unit 213. Step 011 can be implemented by the first determining unit 211, and step 013 can be implemented by the second determining unit 213. That is, the first determining unit 211 can be used to determine the current object distance according to the current focal length and the preset lookup table, wherein the preset lookup table includes the corresponding relationship between the current focal length and the current object distance. The second determining unit 213 can be used to determine the calibration value according to the current focal length and the current object distance.
[0066] In this way, a calibration value can be determined according to the current focal length, providing a basis for performing anti-shake compensation considering the current focal length.
[0067] Specifically, taking the anti-shake compensation of the moving image sensor 113 as an example, the calibration value can be used to represent the correspondence between the anti-shake compensation amount and the distance that the image sensor 113 needs to move. The calibration value can be obtained by experiments, calculations, etc., and this application does not impose specific restrictions. It can be understood that the focal length has a corresponding relationship with the object distance, and a preset lookup table can be set according to different af (AutoFocus, auto focus) values to facilitate the determination of the current object distance through the focal length and the preset lookup table. When the object distance and focal length are known, the Gaussian imaging formula can be substituted to obtain the image distance.
[0068] The calibration value can be expressed by the formula: F / (X+F), where F represents the image distance and X represents the object distance.
[0069] Furthermore, the calibration value is the ratio of the current focal length to the current object distance.
[0070] This makes it easier to calculate the calibration value.
[0071] Specifically, when the calibration value is calculated using the formula F / (X+F), it is necessary to obtain the object distance through the focal length, and then calculate the image distance through the focal length and the object distance, which is a relatively cumbersome step. In this embodiment, the Gaussian imaging formula is introduced into F / (X+F), the image distance is approximated, and the calculation formula f0 / X of the calibration value is obtained, where f0 represents the focal length. In this way, the calibration value can be obtained quickly.
[0072] It is worth noting that, because the focal length and the object distance have the same corresponding relationship under the same AF value, the calibration value is the same when the AF value is the same. In a certain embodiment, the calibration value table is set according to the AF value. In this way, the calibration value can be quickly found in the calibration value table according to the AF value to obtain the calibration value, thereby speeding up the calculation speed of the anti-shake compensation.
[0073] For easier understanding, an example is given below. Fig.11 , Fig.11 The left side in the middle shows the imaging state when the camera module 10 is not shaking. Fig.11 The upper right side shows the imaging state after the camera module 10 is shaken upward by △L. Fig.11 The lower right side shows the imaging state after anti-shake compensation. Substituting the Gaussian imaging formula into h = △L*[F / (X+F)], we get h = △L*(f0 / X), where F represents the image distance, X represents the object distance, f0 represents the focal length, f0 = EFL, and EFL (Effective Focal Length) represents the effective focal length. In one embodiment, in order to compensate for the shaken △L, the lens 111 moves down by h, and the calibration value can be used to represent Fig.11 It is worth noting that, in other implementations, anti-shake compensation can be achieved by moving the image sensor 113 upward by h.
[0074] In some embodiments, the control method further comprises:
[0075] The current filtering posture of the camera module 10 is determined according to the current real-time posture, the preset anti-shake strength value and the previous filtering posture of the camera module 10 .
[0076] See also Fig.12 In some embodiments, the control device 200 further includes a fourth processing module 28, and the above steps can be implemented by the fourth processing module 28. That is, the fourth processing module 28 can be used to determine the current filtering posture of the camera module 10 according to the current real-time posture, the preset anti-shake strength value and the previous filtering posture of the camera module 10.
[0077] In this way, the current filtering posture of the camera module 10 can be accurately determined according to the current real-time posture, the preset anti-shake strength value and the previous filtering posture, and the appropriate anti-shake compensation amount can be determined according to the current real-time posture and the current filtering posture.
[0078] Specifically, the current real-time posture and the preceding filter posture can be fused based on a preset anti-shake strength value to obtain the current filter posture. In some embodiments, the preset anti-shake strength value can be used as the weight information of the current real-time posture, and the weight information corresponding to the preceding filter posture can be determined according to the preset anti-shake strength value. The current filter posture can be obtained by fusion processing based on the current real-time posture, the preceding filter posture and their respective weight information. For example, the current real-time posture and the preceding filter posture can be weighted summed based on their respective weight information to obtain the current filter posture. In one embodiment, Qfilter=F(alpha,Q i , Qfilter i-1 ), where Qfilter is the current filtering posture, F is the fusion processing algorithm, alpha is the preset anti-shake strength value, Qi is the current posture, Qfilter i-1 is the preceding filtering posture. The preceding filtering posture may refer to the filtering posture of the preceding moment, and the preceding moment may refer to the moment before the current moment, and may be the moment before the current moment, or multiple moments before the current moment, such as the previous two moments, the previous three moments, etc. The preceding filtering posture may be obtained by filtering the posture information of the preceding moment, for example, by Kalman filtering. Kalman filtering is an algorithm that uses the linear system state equation to optimally estimate the system state through the system input and output observation data.
[0079] See also Fig.13 In some embodiments, step 05 includes:
[0080] 051: Determine an anti-shake compensation stroke of the camera module 10 according to the anti-shake compensation amount and the calibration value;
[0081] 053: According to the current stroke position and anti-shake compensation stroke of the lens 111 of the camera module 10, the lens 111 is controlled to move to perform anti-shake compensation.
[0082] In certain embodiments, see Fig.14 The control module 25 includes a first processing unit 251 and a second processing unit 253. Step 051 can be implemented by the first processing unit 251, and step 053 can be implemented by the second processing unit 253. That is, the first processing unit 251 can be used to determine the anti-shake compensation stroke of the camera module 10 according to the anti-shake compensation amount and the calibration value. The second processing unit 253 can be used to control the movement of the lens 111 of the camera module 10 to perform anti-shake compensation according to the current stroke position and the anti-shake compensation stroke of the lens 111.
[0083] In this way, the anti-shake compensation stroke can be obtained according to the anti-shake compensation amount and the calibration value, and according to the anti-shake compensation stroke and the current stroke position of the lens 111 , the movement of the lens 111 can be controlled to achieve anti-shake compensation.
[0084] Specifically, optical image stabilization is achieved by controlling the movement of the lens 111. The lens 111 can be pushed in a first direction and a second direction, and the first direction and the second direction are perpendicular to each other. For example, the first direction is the X direction, and the second direction is the Y direction. The lens 111 can be pushed in the X direction and the Y direction, and the unit of the pushed stroke is code. The anti-shake compensation stroke refers to the stroke pushed in the X direction or the Y direction when the camera module 10 shakes. The anti-shake compensation stroke is used to compensate for the shake of the camera module 10.
[0085] The stroke center position of the camera module 10 is usually a linear stroke, and the stroke center position can be used as a reference position to easily achieve accurate anti-shake compensation for the lens 111. The anti-shake compensation stroke of the camera module 10 can be calculated based on the anti-shake compensation amount, the calibration value, and the stroke center position. In one embodiment, the anti-shake compensation stroke of the camera module 10 can be obtained by summing the product of the anti-shake compensation amount and the calibration value with the stroke center position. Among them, the anti-shake compensation stroke of the present application mainly refers to the anti-shake compensation stroke in the X direction and the Y direction, and △z may not be involved in the calculation. For example, the anti-shake compensation stroke of the camera module 10 includes the anti-shake compensation stroke △code_x in the X direction and the anti-shake compensation stroke △code_y in the Y direction, the anti-shake compensation amount includes the anti-shake compensation amount △x in the X direction and the anti-shake compensation amount △y in the Y direction, the calibration value includes the calibration value gain_x in the X direction and the calibration value gain_y in the Y direction, the stroke center position includes the stroke center position center_code_x in the X direction and the stroke center position center_code_y in the Y direction, and the calculation formula can be specifically: △code_x=(△x*gain_x)+center_code_x; △code_y=(△y*gain_y)+center_code_y.
[0086] The current stroke position refers to the actual position of the lens 111 in the current stroke. The current stroke position of the lens 111 of the camera module 10 can be detected by a Hall sensor (Hall), and the lens 111 is pushed from the current stroke position to the anti-shake compensation stroke, thereby achieving anti-shake compensation.
[0087] For further information, see Fig.15 , step 053 further includes:
[0088] 0531: Determine a target travel position of the lens 111 according to the current travel position and anti-shake compensation travel of the lens 111 of the camera module 10;
[0089] 0533: Control the lens 111 to move to the target stroke position to achieve anti-shake compensation.
[0090] See also Fig.16 In some embodiments, the second processing unit 253 includes a first processing subunit 2531 and a control subunit 2533. Step 0531 can be implemented by the first processing subunit 2531, and step 0533 can be implemented by the control subunit 2533. In other words, the first processing subunit 2531 can be used to determine the target stroke position of the lens 111 according to the current stroke position and the anti-shake compensation stroke of the lens 111 of the camera module 10. The control subunit 2533 can be used to control the lens 111 to move to the target stroke position to achieve anti-shake compensation.
[0091] In this way, the lens 111 can be controlled to reach a target stroke position to achieve precise optical image stabilization.
[0092] Specifically, the target stroke position refers to the position of the lens 111 after anti-shake compensation. Adjusting the lens 111 from the current stroke position to the target stroke position can offset the shake. In one embodiment, the current stroke position includes the current stroke position Hall_x in the X direction and the current stroke position Hall_y in the Y direction, the anti-shake compensation stroke includes the anti-shake compensation stroke △code_x in the X direction and the anti-shake compensation stroke △code_y in the Y direction, and the target stroke position includes the target stroke position target_Hall_x in the X direction and the target stroke position target_Hall_y in the Y direction. The target stroke position target_Hall_x in the X direction can be calculated based on the current stroke position Hall_x in the X direction and the anti-shake compensation stroke △code_x in the X direction, and the target stroke position target_Hall_y in the Y direction can be calculated based on the current stroke position Hall_y in the Y direction and the anti-shake compensation stroke △code_y in the Y direction. The lens 111 is controlled to move to the target stroke position target_Hall_x in the X direction and the target stroke position target_Hall_y in the Y direction to achieve anti-shake compensation. In one embodiment, target_Hall_x=f(△code_x, Hall_x); target_Hall_y=f(△code_y, Hall_y). f is a fusion algorithm, which may be a Kalman filter algorithm or other algorithms, which are not specifically limited here.
[0093] In certain embodiments, see Fig.17 , step 05, comprising:
[0094] 051: Determine an anti-shake compensation stroke of the camera module 10 according to the anti-shake compensation amount and the calibration value;
[0095] 055: According to the current stroke position and anti-shake compensation stroke of the image sensor 113 of the camera module 10, the image sensor 113 is controlled to move to perform anti-shake compensation.
[0096] In certain embodiments, see Fig.18 The control module 25 includes a first processing unit 251 and a third processing unit 255. Step 051 can be implemented by the first processing unit 251, and step 055 can be implemented by the third processing unit 255. That is, the first processing unit 251 can be used to determine the anti-shake compensation stroke of the camera module 10 according to the anti-shake compensation amount and the calibration value. The third processing unit 255 can be used to control the image sensor 113 to move for anti-shake compensation according to the current stroke position and anti-shake compensation stroke of the image sensor 113 of the camera module 10.
[0097] In this way, the anti-shake compensation stroke can be obtained according to the anti-shake compensation amount and the calibration value, and according to the anti-shake compensation stroke and the current stroke position of the lens 111 , the image sensor 113 is controlled to move to achieve anti-shake compensation.
[0098] For further information, see Fig.19 In some embodiments, step 055 includes:
[0099] Step 0551: Determine a target stroke position of the image sensor 113 according to the current stroke position and the anti-shake compensation stroke of the image sensor 113 of the camera module 10;
[0100] Step 0553: Control the image sensor 113 to move to the target stroke position to achieve anti-shake compensation.
[0101] See also Fig. 20 In some embodiments, the third processing unit 255 includes a second processing subunit 2551 and a third processing subunit 2553, step 0551 can be implemented by the second processing subunit 2551, and step 0553 can be implemented by the third processing subunit 2553. In other words, the second processing subunit 2551 can be used to determine the target stroke position of the image sensor 113 according to the current stroke position and anti-shake compensation stroke of the image sensor 113 of the camera module 10. The third processing subunit 2553 can be used to control the image sensor 113 to move to the target stroke position to achieve anti-shake compensation.
[0102] Specifically, the principle of controlling the movement of the image sensor 113 to achieve anti-shake compensation is similar to the principle of controlling the movement of the lens 111 to achieve anti-shake compensation, and is not described in detail in this application.
[0103] See also Fig.21 , Fig.21 The above is a schematic flow chart of an anti-shake compensation method in an embodiment. The anti-shake compensation method includes:
[0104] According to the value measured by the acceleration sensor, the current real-time posture Q is obtained i , where Qi is a vector representing the posture in the X, Y, and Z axis directions;
[0105] According to the current real-time posture Q i , preset anti-shake strength value alpha and the pre-filter posture Qfilter of the camera module 10 i-1 , determine the current filtering posture Qfilter of the camera module 10, the formula is as follows:
[0106] Qfilter=f(Q i , alpha)
[0107] Qfilter for Q i and Qfilter i-1 The result of posture fusion, where alpha determines the real-time posture Q during the fusion process i And the filtering posture Qfilter at the previous moment i-1 The respective weights.
[0108] Through real-time gesture Q i And the current filtering posture Qfilter calculates the anti-shake compensation amount △Q:
[0109] △Q=Q i -Qfilter
[0110] The anti-shake compensation amount △Q is a vector, which can be a translation compensation amount or a fusion of an angle compensation amount and a translation compensation amount.
[0111] The anti-shake compensation △Q includes the compensation of translation on the XYZ axis (△x,△y,△z), where △x,△y,△z represent the compensation in the XYZ direction respectively. △z is not involved in the calculation of target_Hall value for the time being, because target_Hall is the value in the XY direction.
[0112] The current object distance X is obtained through the current focal length f0, and the calibration values gain_x and gain_y are obtained according to the current focal length f0 and the current object distance X. The formula is as follows:
[0113] gain_x = f0 / X;
[0114] gain_y=f0 / X.
[0115] According to the calibration value (gain_x, gain_y), the target travel position target_Hall is calculated:
[0116] △code_x=(△x*gain_x)+center_code_x;
[0117] △code_y=(△y*gain_y)+center_code_y;
[0118] target_Hall_x=f(△code_x,Hall_x);
[0119] target_Hall_y=f(△code_y,Hall_y);
[0120] Among them, center_code_x and center_code_y are the middle positions of the full stroke of the image sensor 113, and f is the fusion of the current stroke position Hall_x and Hall_y of the current image sensor 113 and the calculated anti-shake compensation stroke △code_x and △code_y. The fusion method can be Kalman filtering or other fusion algorithms.
[0121] The target stroke position target_Hall is sent to the driving circuit, so that the motor VCM pushes the image sensor 113 to the target stroke positions target_Hall_x and target_Hall_y to complete the current anti-shake compensation.
[0122] Repeating the above operations can realize the processing flow of anti-shake compensation to overcome the problem of unclear images caused by camera shaking.
[0123] See also Fig. 22 The control method of the embodiment of the present application can be implemented by the electronic device 100 of the embodiment of the present application. Specifically, the electronic device 100 includes one or more processors 50 and a memory 40. The memory 40 stores a computer program. When the computer program is executed by the processor 50, the steps of the control method of any of the above embodiments are implemented.
[0124] For example, when the computer program is executed by the processor 50, the following steps of the control method are implemented:
[0125] 01: Determine a calibration value according to the current focal length of the camera module 10;
[0126] 03: Determine the anti-shake compensation amount according to the current real-time posture of the camera module 10 and the current filtering posture of the camera module 10;
[0127] 05: According to the calibration value and the anti-shake compensation amount, the camera module 10 is controlled to move to perform anti-shake compensation.
[0128] The computer-readable storage medium of the embodiment of the present application stores a computer program thereon, and when the program is executed by a processor, the steps of the control method of any of the above-mentioned embodiments are implemented.
[0129] For example, when the program is executed by a processor, the following steps of the control method are implemented:
[0130] 01: Determine a calibration value according to the current focal length of the camera module 10;
[0131] 03: Determine the anti-shake compensation amount according to the current real-time posture of the camera module 10 and the current filtering posture of the camera module 10;
[0132] 05: According to the calibration value and the anti-shake compensation amount, the camera module 10 is controlled to move to perform anti-shake compensation.
[0133] It is understood that a computer program includes computer program code. The computer program code may be in source code form, object code form, executable file or some intermediate form, etc. Computer readable storage media may include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), and software distribution medium, etc. The processor may be a central processing unit, or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
[0134] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0135] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0136] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A control method, characterized in that: The control method comprises: Determine the calibration value according to the current focal length of the camera module; Determining an anti-shake compensation amount according to a current real-time posture of the camera module and a current filtering posture of the camera module; According to the calibration value and the anti-shake compensation amount, the camera module is controlled to move to perform anti-shake compensation, wherein the calibration value is determined according to the current focal length of the camera module, including: Determine the current object distance according to the current focal length and a preset lookup table, wherein the preset lookup table includes a corresponding relationship between the current focal length and the current object distance; The calibration value is determined according to the current focal length and the current object distance, where the calibration value is a ratio of the current focal length to the current object distance.
2. The control method according to claim 1, characterized in that: The control method further comprises: When receiving a shooting command, performing a focusing operation; When the focusing operation is completed, the current focal length of the camera module is obtained.
3. The control method according to claim 1, characterized in that: The control method further comprises: The current filtering posture of the camera module is determined according to the current real-time posture, the preset anti-shake strength value and the preceding filtering posture of the camera module.
4. The control method according to claim 1, characterized in that: The step of controlling the camera module to move to perform anti-shake compensation according to the calibration value and the anti-shake compensation amount includes: Determining an anti-shake compensation stroke of the camera module according to the anti-shake compensation amount and the calibration value; According to the current stroke position of the lens of the camera module and the anti-shake compensation stroke, the movement of the lens is controlled to perform anti-shake compensation.
5. The control method according to claim 4, characterized in that: The step of controlling the movement of the lens to perform anti-shake compensation according to the current stroke position of the lens of the camera module and the anti-shake compensation stroke comprises: Determining a target stroke position of the lens according to a current stroke position of the lens of the camera module and the anti-shake compensation stroke; The lens is controlled to move to the target travel position to achieve anti-shake compensation.
6. The control method according to claim 1, characterized in that: The step of controlling the camera module to move to perform anti-shake compensation according to the calibration value and the anti-shake compensation amount includes: Determining an anti-shake compensation stroke of the camera module according to the anti-shake compensation amount and the calibration value; According to the current stroke position of the image sensor of the camera module and the anti-shake compensation stroke, the image sensor is controlled to move to perform anti-shake compensation.
7. The control method according to claim 6, characterized in that: The step of controlling the image sensor to move to perform anti-shake compensation according to the current stroke position of the image sensor of the camera module and the anti-shake compensation stroke includes: Determining a target stroke position of the image sensor according to a current stroke position of the image sensor of the camera module and the anti-shake compensation stroke; The image sensor is controlled to move to the target stroke position to achieve anti-shake compensation.
8. A control device, characterized in that: The control device comprises: A first processing module, used for determining a calibration value according to a current focal length of the camera module; A second processing module, used for determining an anti-shake compensation amount according to a current real-time posture of the camera module and a current filtering posture of the camera module; A control module, used for controlling the movement of the camera module to perform anti-shake compensation according to the calibration value and the anti-shake compensation amount, wherein the first processing module includes a first determination unit and a second determination unit, the first determination unit determines the current object distance according to the current focal length and a preset lookup table, the preset lookup table includes the corresponding relationship between the current focal length and the current object distance, the calibration value is determined according to the current focal length and the current object distance, and the calibration value is the ratio of the current focal length to the current object distance.
9. An electronic device, characterized in that: The electronic device includes one or more processors and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the control method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the control method described in any one of claims 1 to 7 are implemented.
