Camera module calibration method, camera module calibration device, medium and electronic equipment
By obtaining the optical center distance of different cameras, calibrating the camera module makes the optical anti-shake module move synchronously, solving the problem of jump distortion during image switching in the existing technology, and achieving a more stable image switching effect.
Patent Information
- Application Number
- CN202310293284.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2024-09-24
AI Technical Summary
In the existing technology, the optical anti-shake modules of the terminal equipment equipped with multiple camera modules cannot realize synchronous movement, resulting in the problem of jump and distortion of the image when switching.
By obtaining the initial and reference position distances between the optical centers of different cameras, the camera module is calibrated so that the optical anti-shake module moves synchronously to ensure the stability of image switching.
It effectively avoids the problem of jump distortion during image switching, improves the stability of image switching, simplifies the calibration process, and has a wide range of applications.
Smart Images

Figure CN118695097A
Abstract
Description
Background Art
[0002] At present, multiple camera modules are often configured in terminal devices to meet the diverse shooting needs of users. In order to improve the image shooting effect, the camera module is usually equipped with an optical image stabilization module, which can compensate for the camera shake during the shooting process, thereby overcoming the problem of blurred images caused by shooting vibrations. In the prior art, when a terminal device is equipped with multiple camera modules and has corresponding multiple optical image stabilization modules, these multiple optical image stabilization modules cannot achieve synchronous movement and affect each other during the shooting process, which often causes the image to jump and distort when switching. Summary of the invention
[0003] The present disclosure provides a camera module calibration method, a camera module calibration device, a computer-readable storage medium and an electronic device, thereby at least to a certain extent improving the problem in the prior art that multiple optical image stabilization modules influence each other, resulting in image jumps and distortions when switching.
[0004] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0005] According to a first aspect of the present disclosure, a camera module calibration method is provided, which is applied to a terminal device, wherein the terminal device includes a first camera module and a second camera module, the first camera module includes a first camera and a first optical image stabilization module, and the second camera module includes a second camera and a second optical image stabilization module; the method includes: when the first camera is in an initial position of the first optical image stabilization module and the second camera is in an initial position of the second optical image stabilization module, obtaining a first optical center distance between the optical center of the first camera and the optical center of the second camera; when the first optical image stabilization module drives the first camera to move to a reference position, obtaining a second optical center distance between the optical center of the first camera and the optical center of the second camera; and calibrating the first camera module or the second camera module according to the first optical center distance and the second optical center distance, so that the first optical image stabilization module moves synchronously with the second optical image stabilization module.
[0006] According to a second aspect of the present disclosure, there is provided a camera module calibration device, which is applied to a terminal device, wherein the terminal device includes a first camera module and a second camera module, the first camera module includes a first camera and a first optical image stabilization module, and the second camera module includes a second camera and a second optical image stabilization module; the device includes: a first distance acquisition module, which is used to obtain a first optical center distance between the optical center of the first camera and the optical center of the second camera when the first camera is in an initial position of the first optical image stabilization module and the second camera is in an initial position of the second optical image stabilization module; a second distance acquisition module, which is used to obtain a second optical center distance between the optical center of the first camera and the optical center of the second camera when the first optical image stabilization module drives the first camera to move to a reference position; and a camera module calibration module, which is used to calibrate the first camera module or the second camera module according to the first optical center distance and the second optical center distance, so that the first optical image stabilization module moves synchronously with the second optical image stabilization module.
[0007] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the camera module calibration method of the first aspect and its possible implementation methods are implemented.
[0008] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor, wherein the processor is configured to execute the camera module calibration method of the first aspect and possible implementation thereof by executing the executable instructions.
[0009] The technical solution disclosed in this disclosure has the following beneficial effects:
[0010] When the first camera is at the initial position of the first optical image stabilization module and the second camera is at the initial position of the second optical image stabilization module, the first optical center distance between the optical center of the first camera and the optical center of the second camera is obtained; when the first optical image stabilization module drives the first camera to move to the reference position, the second optical center distance between the optical center of the first camera and the optical center of the second camera is obtained; according to the first optical center distance and the second optical center distance, the first camera module or the second camera module is calibrated to make the optical centers of the first camera and the second camera move synchronously. On the one hand, this exemplary embodiment proposes a new camera module calibration method, which can calibrate the camera module according to the change of the distance between the optical center of the first camera and the optical center of the second camera under different circumstances, ensuring that the optical centers of the first camera and the second camera can achieve a relatively static state in both the working state and the non-working state, thereby improving the stability of image switching and effectively avoiding the problem of jump distortion in screen switching; on the other hand, this exemplary embodiment can calibrate the camera module through a simple and convenient process, with low operation complexity and a wide range of application.
[0011] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0013] Figure 1 A schematic diagram showing a system architecture in this exemplary embodiment;
[0014] Figure 2 A connection block diagram of a control chip in this exemplary embodiment is shown;
[0015] Figure 3 A flow chart showing a camera module calibration method in this exemplary embodiment;
[0016] Figure 4 A sub-flow chart of a camera module calibration method in this exemplary embodiment is shown;
[0017] Figure 5 A flow chart showing another camera module calibration method in this exemplary embodiment;
[0018] Figure 6A flow chart showing a method for controlling a terminal device in this exemplary embodiment;
[0019] Figure 7 A structural block diagram of a camera module calibration device in this exemplary embodiment is shown;
[0020] Figure 8 A structural diagram of an electronic device in this exemplary embodiment is shown. DETAILED DESCRIPTION
[0021] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0022] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0023] The exemplary embodiment of the present disclosure first provides a camera module calibration method. Applied to a terminal device, it can be an electronic device equipped with a camera module, such as a mobile phone, a tablet computer, a smart wearable device, etc., in which multiple camera modules can be configured, such as a camera module corresponding to a main camera, a camera module corresponding to a secondary camera such as a telephoto camera, a wide-angle camera or an ultra-wide-angle camera, or a camera module corresponding to a periscope camera, etc. Among them, any two camera modules can be used as the first camera module and the second camera module in this exemplary embodiment. For example, when the terminal device includes three camera modules, the other two camera modules except the main camera module can be used as the first camera module and the second camera module, respectively, to ensure that when the image is shot by the first camera module and switched to the second camera module to shoot the image, the image screen switching is more stable and the effect is better. The first camera module may include a first camera and a first optical image stabilization module, the second camera module may include a second camera and a second optical image stabilization module, and the first camera and the second camera may be cameras with different functions or different pixel levels, etc.
[0024] Figure 1 A system architecture block diagram in this exemplary embodiment is shown, which may specifically include a sensor module 110, a processor 120, a first camera 130, a first optical image stabilization module 140, a second camera 150, a second optical image stabilization module 160, a main camera 170, and a third optical image stabilization module 180. Among them, the sensor module 110 may include a sensor device such as a gyroscope or an accelerometer for collecting sensor data such as angular velocity and acceleration. The processor 120 is used to execute data processing related to the camera module, which may be the main processor of the terminal device, such as a CPU (Central Processing Unit) or an MPU (Micro Processing Unit). The main camera 170 refers to the camera in the terminal device that is used to perform the main shooting task, and is correspondingly configured with a third optical image stabilization module 180, so that the main camera 170 has an optical image stabilization function when acquiring images; the first camera 130 and the second camera 150 refer to other cameras configured in the terminal device, such as a periscope camera, etc., which correspondingly realize the corresponding optical image stabilization function through the first optical image stabilization module 140 and the second optical image stabilization module 160.
[0025] In this exemplary embodiment, the processor 120 can be connected to the sensor module 110 via SPI (Serial Peripheral Interface), and the first camera 130 and the second camera 150 can monitor the sensor data collected by the sensor module 110 via SPI. The processor 120 can communicate with the first camera module including the first camera 130 and the first optical image stabilization module 140, and the second camera module including the second camera 150 and the second optical image stabilization module 160 via I2C (Inter-Integrated Circuit) to control different shooting modes, wherein the shooting mode refers to different shooting configuration modes, which are different according to different scenes or shooting requirements, for example, the shooting mode can be a normal shooting mode, a night scene shooting mode, or a video recording mode, etc.
[0026] In this exemplary embodiment, the first camera module can be connected to the control chip of the second camera via I2C communication, and the first camera module can be used as a master device to control the second control chip of the second camera module via the first control chip of the first camera module to achieve master-slave control synchronization between the first camera module and the second camera module. Figure 2 As shown, Figure 2 A connection block diagram of the first control chip 210 of the first camera module and the second control chip 220 of the second camera module is shown. In this exemplary embodiment, the first control chip can be SEM1217S, and the second control chip can be SW9784. The first camera module can use the first control chip SEM1217S to connect to the processor through I2C. At the same time, the first camera module can control the second control chip DW9784 of the second optical image stabilization module of the second camera module through another group of I2C. Specifically, as shown in the figure, the pins DBG_SCK and DBG_SDA of the first control chip 210 can be connected with the pins TWI_SDA and TWI_SCL of the second control chip 220.
[0027] Combine the following Figure 3 The process of camera module calibration method is described. Figure 3 As shown, the camera module calibration method may include the following steps S310 to S340:
[0028] Step S310, when the first camera is at an initial position of the first optical image stabilization module and the second camera is at an initial position of the second optical image stabilization module, a first optical center distance between the optical center of the first camera and the optical center of the second camera is obtained.
[0029] The optical center of the camera refers to the optical center of the lens. When light from any direction passes through the optical center, the propagation direction of the light remains unchanged. Depending on the specific structure of the camera, its optical center may be different. For example, the optical center position may be different in a single lens structure and an optical system structure composed of multiple lenses.
[0030] The camera is in the initial position of the optical image stabilization module, which means the position of the camera when the optical image stabilization module is not working, or the original position of the camera without the influence of shaking. When the first camera is in the initial position of the first optical image stabilization module and the second camera is in the initial position of the second optical image stabilization module, the positions of the optical center of the first camera and the optical center of the second camera are relatively fixed. At this time, the first optical center distance between the optical center of the first camera and the optical center of the second camera can be obtained, that is, the first optical center distance can be the static distance between the optical center of the first camera and the optical center of the second camera when the optical image stabilization module is not working. This exemplary embodiment can place the terminal device in a calibration device, such as a calibration jig, and then obtain the first optical center distance.
[0031] Step S320: When the first optical image stabilization module drives the first camera to move to a reference position, a second optical center distance between the optical center of the first camera and the optical center of the second camera is obtained.
[0032] Generally, when the optical image stabilization module is working, it can drive the camera to move in a specific direction to compensate for the shaking effect of the camera shooting process. The first optical image stabilization module drives the first camera to move to the reference position, which can mean that the first optical image stabilization module drives the first camera to move to a specific position in a preset movement direction, for example, the position can be the maximum travel of the X-axis movement direction, or half of the maximum travel of the X-axis movement direction; or the maximum travel of the Y-axis movement direction, or half of the maximum travel of the Y-axis movement direction, etc.
[0033] In this exemplary embodiment, when the first optical image stabilization module drives the first camera to move to the reference position at the maximum travel of the X-axis, and the second optical image stabilization module drives the second camera to move synchronously, the second optical center distance between the optical center of the first camera and the optical center of the second camera can be obtained. When the first optical image stabilization module drives the first camera to move to the reference position at the maximum travel of the Y-axis, the second optical center distance between the optical center of the first camera and the optical center of the second camera can be obtained. The second optical center distance in this exemplary embodiment can be one or more of the above.
[0034] Step S330, calibrating the first camera module or the second camera module according to the first optical center distance and the second optical center distance, so that the first optical image stabilization module and the second optical image stabilization module move synchronously.
[0035] Furthermore, the first camera module or the second camera module can be calibrated based on the first optical center distance and the second optical center distance, for example, by comparing the difference between the first optical center distance and the second optical center distance, or by first determining an optical center parameter based on the second optical center distance, and calibrating the first camera module or the second camera module according to the difference between the optical center parameter and the first optical center distance. The optical center parameter refers to the parameter determined in this exemplary embodiment for camera calibration, which can be the second optical center distance itself, or data calculated based on the second optical center distance. For example, the second optical center distance when the first camera is at the maximum travel in the X-axis motion direction and the second optical center distance when the first camera is at the maximum travel in the Y-axis motion direction can be obtained respectively, and the optical center parameter is calculated based on these two second optical center distances.
[0036] If the first optical center distance and the second optical center distance meet certain conditions, such as the difference is less than a preset threshold, it is considered that the current first optical image stabilization module and the second optical image stabilization module move synchronously or approximately synchronously; if the first optical center distance and the second optical center distance do not meet the conditions, it is necessary to calibrate the first camera module or the second camera module. In this exemplary embodiment, the calibration can be achieved by setting the signal parameters of the camera module, and the signal parameters may include PID (proportional / integral / differential control) parameters. Specifically, during calibration, it may be to set the parameters of the first camera module; it may also be to set the parameters of the second camera module; it may also be to first adjust the parameters of the first camera module, and then synchronize the scheme of the first camera module to the parameter debugging of the second camera module, so that the second camera module adapts to the first camera module, for example, by adjusting the input signal, determining the adaptation parameters of the second camera module, so as to adjust the second camera module to adapt to the first camera module, thereby achieving image synchronization.
[0037] In summary, in this exemplary embodiment, when the first camera is at the initial position of the first optical image stabilization module and the second camera is at the initial position of the second optical image stabilization module, the first optical center distance between the optical center of the first camera and the optical center of the second camera is obtained; when the first optical image stabilization module drives the first camera to move to the reference position, the second optical center distance between the optical center of the first camera and the optical center of the second camera is obtained; according to the first optical center distance and the second optical center distance, the first camera module or the second camera module is calibrated to make the optical centers of the first camera and the second camera move synchronously. On the one hand, this exemplary embodiment proposes a new camera module calibration method, which can calibrate the camera module according to the change of the distance between the optical center of the first camera and the optical center of the second camera under different circumstances, ensuring that the optical centers of the first camera and the second camera can achieve a relatively static state in both the working state and the non-working state, improving the stability of image switching, and effectively avoiding the problem of jump distortion in screen switching; on the other hand, this exemplary embodiment can calibrate the camera module through a simple and convenient process, with low operation complexity and a wide range of application.
[0038] In an exemplary embodiment, the above step S320 may include:
[0039] When the first optical image stabilization module drives the first camera to move to a position of maximum travel in the X-axis motion direction, obtaining a second optical center distance between the optical center of the first camera and the optical center of the second camera on the X-axis;
[0040] When the first optical image stabilization module drives the first camera to move to the maximum travel position in the Y-axis motion direction, a second optical center distance between the optical center of the first camera and the optical center of the second camera on the Y-axis is obtained.
[0041] In this exemplary embodiment, the second optical center distance may include two distances. One may refer to the second optical center distance measured in the X-axis movement direction of the optical image stabilization, and the other may refer to the second optical center distance measured in the Y-axis movement direction of the optical image stabilization. Specifically, when the first optical image stabilization module drives the first camera to move to the maximum travel in the X-axis movement direction, the second optical center distance S between the optical center of the first camera and the optical center of the second camera on the X-axis can be obtained. 2X When the first optical image stabilization module drives the first camera to move to the maximum travel position in the Y-axis motion direction, obtain the second optical center distance S between the optical center of the first camera and the optical center of the second camera on the Y-axis 2Y The two second optical center distances may be subsequently compared with the first optical center distance. For example, calculation may be performed based on the two second optical center distances, and the calculation result may be compared with the first optical center distance.
[0042] Further, in an exemplary embodiment, if Figure 4 As shown, in the above step S330, calibrating the first camera module or the second camera module according to the first optical center distance and the second optical center distance may include the following steps:
[0043] Step S410, determining an optical center parameter according to the second optical center distance on the X axis and the second optical center distance on the Y axis;
[0044] Step S420, calibrating the first camera module or the second camera module based on the difference between the first optical center distance and the optical center parameter.
[0045] Among them, the optical center parameter refers to the parameter used for camera calibration. In this exemplary embodiment, the second optical center distance on the X-axis can be obtained when the first camera moves to the maximum stroke in the X-axis motion direction, and the second optical center distance on the Y-axis can be obtained when the first camera moves to the maximum stroke in the Y-axis motion direction, and the optical center parameter can be calculated based on these two second optical center distances. Specifically, the optical center parameter is determined based on the second optical center distance on the X-axis and the second optical center distance on the Y-axis. The optical center parameter can be determined based on the ratio of the second optical center distance on the X-axis to the second optical center distance on the Y-axis, or the optical center parameter can be determined based on the second optical center distance on the X-axis and the second optical center distance on the Y-axis according to a preset formula.
[0046] Specifically, in an exemplary embodiment, determining the optical center parameter according to the second optical center distance on the X-axis and the second optical center distance on the Y-axis may include:
[0047] The ratio of the second optical center distance on the Y axis to the second optical center distance on the X axis is used as the optical center parameter.
[0048] That is, the optical center parameter can be the ratio S of the second optical center distance on the Y axis to the second optical center distance on the X axis. 2Y / S 2X .
[0049] Furthermore, the first camera module or the second camera module may be calibrated based on the difference between the first optical center distance and the optical center parameter. In this exemplary embodiment, the difference between the first optical center distance and the optical center parameter can reflect, to a certain extent, the degree of change in the optical center position before and after the first camera and the second camera are driven by the optical image stabilization module. Based on this, the calibration of the first camera module or the second camera module can be performed. For example, when the difference is small, it means that the change in the distance between the optical centers of the first camera and the second camera is not much different, and the first optical image stabilization module and the second optical image stabilization module can be approximately considered to be synchronous motion, which can ensure that the relative positions of the optical centers of the cameras remain unchanged in different states, and thus, there will be no jump or distortion when switching images. When the difference is large, it means that the distance between the optical centers of the first camera and the second camera changes greatly, the first optical image stabilization module and the second optical image stabilization module cannot maintain synchronous motion, and the distance between the optical centers of the first camera and the second camera fluctuates. At this time, image switching jumps or distortions may occur. Therefore, the first camera module or the second camera module can be calibrated to keep the first optical image stabilization module and the second optical image stabilization module moving synchronously.
[0050] In an exemplary embodiment, the above step S420 may include:
[0051] If the difference between the first optical center distance and the optical center parameter is less than the first threshold, the calibration of the first camera module or the second camera module is completed.
[0052] Among them, the first threshold refers to the distance judgment condition used to determine whether the difference between the current first optical center distance and the optical center parameter meets the calibration condition. The first threshold can be customized according to the needs of the business scenario. For example, it can be set to 1 pixel distance. When the difference between the first optical center distance and the optical center parameter is less than 1 pixel distance, it means that the optical centers of the first camera and the second camera are approximately considered to be relatively stationary, that is, the first optical image stabilization module and the second optical image stabilization module are moving synchronously. This exemplary embodiment can control the difference between the first optical center distance and the optical center parameter within the first threshold as a calibration standard for the first camera module and the second camera module.
[0053] In an exemplary embodiment, the calibrating the first camera module or the second camera module based on the difference between the first optical center distance and the optical center parameter further includes:
[0054] If the difference between the first optical center distance and the optical center parameter is greater than the first threshold, the signal parameter of the first camera module is adjusted and the second optical center distance is re-collected.
[0055] If the difference between the first optical center distance and the optical center parameter is greater than the first threshold, the first camera module can be calibrated, and the calibration can be achieved by adjusting the signal parameters of the first camera module. Among them, the signal parameters can refer to PID parameters, and the signal parameters of the first camera module can be adjusted, and the PID parameters of the first camera module can be set according to a preset PID algorithm. Specifically, when setting the signal parameters, the transfer function can be inversely deduced through different input signals to obtain the corresponding PID parameters.
[0056] After the signal parameter adjustment of the first camera module is completed, the first control chip of the first camera module can be used to control the second control chip of the second camera module to complete the adaptation. For example, after determining the PID parameters of the first camera module, different input signals are given through specific PID adjustment logic to obtain different PID parameters so that the second camera module can adapt to the first camera module. In this exemplary embodiment, the first camera module and the second camera module can be set to a master-slave control structure, and the first control chip of the first camera module can control the second control chip of the second camera module to complete the adaptation process. Specifically, the motion trajectory of the first camera module can be adapted by adjusting the response and stabilization time of the PID parameters of the second control chip of the second camera module, thereby achieving compensation.
[0057] After completing the calibration of the first camera module and the second camera module, the second optical center distance can be re-collected, and the analysis process of the first optical center distance and the second optical center distance can be performed to determine whether the current calibration result is accurate.
[0058] In an exemplary embodiment, if the difference between the first optical center distance and the optical center parameter is less than the first threshold, the camera module calibration method may further include:
[0059] When the first optical image stabilization module drives the first camera to move to a random position, obtaining a third optical center distance between the optical center of the first camera and the optical center of the second camera;
[0060] Based on the difference between the first optical center distance and the third optical center distance, the first camera module or the second camera module is calibrated.
[0061] After determining that the difference between the first optical center distance and the optical center parameter is less than the first threshold, in order to further improve the accuracy and effectiveness of the calibration, the exemplary embodiment can also obtain the third optical center distance between the optical center of the first camera and the optical center of the second camera when the first optical image stabilization module drives the first camera to move to a random position. The random position refers to a random moving position when the first camera is in a working state. At this time, the optical center distance between the optical center of the first camera and the optical center of the second camera at the random position can be obtained. The random position can be any position except the initial position and the reference position, and the present disclosure does not specifically limit this.
[0062] Furthermore, the first camera module or the second camera module can be calibrated by comparing the difference between the first optical center distance and the third optical center distance.
[0063] In an exemplary embodiment, the calibrating the first camera module or the second camera module based on the difference between the first optical center distance and the third optical center distance may include:
[0064] If the difference between the first optical center distance and the third optical center distance is less than the second threshold, the calibration of the first camera module or the second camera module is completed.
[0065] Among them, the second threshold refers to a judgment condition for judging whether the difference between the current first optical center distance and the third optical center distance meets the calibration condition. The second threshold can be customized according to the needs of the business scenario. In this exemplary embodiment, the first threshold and the second threshold may have a certain correlation. For example, in order to ensure that the difference between the first optical center distance and the third optical center distance can be less than the second threshold, the first threshold can be set to have a higher accuracy. For example, when the first threshold is set to 1 pixel distance, the second threshold can be set to 2 pixel distance. This exemplary embodiment can control the difference between the first optical center distance and the third optical center distance within the second threshold to complete the calibration of the first camera module and the second camera module.
[0066] In an exemplary embodiment, the calibrating the first camera module or the second camera module based on the difference between the first optical center distance and the third optical center distance further includes:
[0067] If the difference between the first optical center distance and the third optical center distance is greater than the second threshold, the signal parameters of the first camera module are adjusted, and the second optical center distance and the third optical center distance are reacquired.
[0068] If the difference between the first optical center distance and the third optical center distance is greater than the second threshold, it indicates that the calibration of the first camera module or the second camera module needs to be performed. Therefore, the first camera module can be adjusted by adjusting the signal parameters of the first camera module, and the second camera module can be adapted. The adjustment of the signal parameters of the first camera module is similar to the above process. After setting the signal parameters of the first camera module, the adaptation process can also be completed for the second camera module. Then, the second optical center distance and the third optical center distance are reacquired to perform the calibration judgment process.
[0069] Figure 5 A flowchart of another camera module calibration method in this exemplary embodiment is shown, which may specifically include the following steps:
[0070] Step S510, when the first camera is at an initial position of the first optical image stabilization module and the second camera is at an initial position of the second optical image stabilization module, obtaining a first optical center distance between the optical center of the first camera and the optical center of the second camera;
[0071] Step S520, setting the PID parameters of the first camera module;
[0072] Step S530, when the first optical image stabilization module drives the first camera to move to the maximum travel position in the X-axis motion direction, obtaining a second optical center distance between the optical center of the first camera and the optical center of the second camera on the X-axis;
[0073] Step S540, when the first optical image stabilization module drives the first camera to move to the maximum travel position in the Y-axis motion direction, obtaining a second optical center distance between the optical center of the first camera and the optical center of the second camera on the Y-axis;
[0074] Step S550, taking the ratio of the second optical center distance on the Y axis to the second optical center distance on the X axis as the optical center parameter;
[0075] Step S560, determining whether the difference between the first optical center distance and the optical center parameter is less than a first threshold;
[0076] If the difference is greater than the first threshold, return to step S520 to adjust the PID parameters of the first camera module to calibrate the first camera module and make the second camera module adapt to the first camera module;
[0077] If the difference is less than the first threshold, executing step S570, when the first optical image stabilization module drives the first camera to move to a random position, obtaining a third optical center distance between the optical center of the first camera and the optical center of the second camera;
[0078] Step S580, determining whether the difference between the first optical center distance and the third optical center distance is less than a second threshold;
[0079] If the difference is less than the second threshold, executing step S590 to complete the calibration of the first camera module or the second camera module;
[0080] If the difference is less than the second threshold, step S520 is executed to adjust the PID parameters of the first camera module to calibrate the first camera module and adapt the second camera module to the first camera module.
[0081] This exemplary embodiment can calibrate the first camera module or the second camera module through the above process, so that the first optical image stabilization module and the second optical image stabilization module can move synchronously, thereby ensuring the synchronization of captured images.
[0082] In an exemplary embodiment, the terminal device may further include a sensor module, a processor, a first control chip and a second control chip, wherein the first control chip is used to control the first camera module, and the second control chip is used to control the second camera module; Figure 6 A flow chart of a method for controlling a terminal device is shown, which may specifically include the following steps:
[0083] Step S610, controlling the sensor module through the processor to send sensor data to the first camera module and / or the second camera module;
[0084] Step S620, the first camera module and / or the second camera module monitors the sensor data collected by the sensor module;
[0085] Step S630, controlling the first control chip of the first camera module through the processor;
[0086] Step S640, controlling the second control chip of the second camera module by the first control chip, so that the second camera module and the first camera module form a master-slave control structure;
[0087] Step S650, executing the above-mentioned camera module calibration method, and determining whether the calibration synchronization is completed;
[0088] If the calibration synchronization is completed, step S660 is executed to end the process, and the motion synchronization of the first optical image stabilization module and the second optical image stabilization module is achieved;
[0089] If the calibration synchronization is not completed, return to step S630, control the first control chip through the processor so that the first control chip controls the second chip, and execute the camera module calibration method again.
[0090] The exemplary embodiment of the present disclosure also provides a camera module calibration device, which is applied to a terminal device, wherein the terminal device includes a first camera module and a second camera module, wherein the first camera module includes a first camera and a first optical image stabilization module, and the second camera module includes a second camera and a second optical image stabilization module. Figure 7 As shown, the camera module calibration device 700 may include: a first distance acquisition module 710, used to obtain a first optical center distance between the optical center of the first camera and the optical center of the second camera when the first camera is in the initial position of the first optical image stabilization module and the second camera is in the initial position of the second optical image stabilization module; a second distance acquisition module 720, used to obtain a second optical center distance between the optical center of the first camera and the optical center of the second camera when the first optical image stabilization module drives the first camera to move to a reference position; a camera module calibration module 730, used to calibrate the first camera module or the second camera module according to the first optical center distance and the second optical center distance, so that the first optical image stabilization module and the second optical image stabilization module move synchronously.
[0091] In an exemplary embodiment, the second distance acquisition module includes: an X-axis optical center distance acquisition subunit, which is used to obtain the second optical center distance between the optical center of the first camera and the optical center of the second camera on the X-axis when the first optical image stabilization module drives the first camera to move to the maximum stroke in the X-axis movement direction; a Y-axis optical center distance acquisition subunit, which is used to obtain the second optical center distance between the optical center of the first camera and the optical center of the second camera on the Y-axis when the first optical image stabilization module drives the first camera to move to the maximum stroke in the Y-axis movement direction.
[0092] In an exemplary embodiment, the camera module calibration module includes: an optical center parameter determination unit, used to determine the optical center parameter based on the second optical center distance on the X-axis and the second optical center distance on the Y-axis; a module calibration unit, used to calibrate the first camera module or the second camera module based on the difference between the first optical center distance and the optical center parameter.
[0093] In an exemplary embodiment, the optical center parameter determination unit is used to take the ratio of the second optical center distance on the Y axis to the second optical center distance on the X axis as the optical center parameter.
[0094] In an exemplary embodiment, the module calibration unit includes: a first calibration subunit, used to complete the calibration of the first camera module or the second camera module if the difference between the first optical center distance and the optical center parameter is less than a first threshold.
[0095] In an exemplary embodiment, the module calibration unit includes: a second calibration subunit, which is used to adjust the signal parameters of the first camera module and re-collect the second optical center distance if the difference between the first optical center distance and the optical center parameter is greater than a first threshold.
[0096] In an exemplary embodiment, the camera module calibration device also includes: a third distance acquisition unit, used to obtain a third optical center distance between the optical center of the first camera and the optical center of the second camera if the difference between the first optical center distance and the optical center parameter is less than a first threshold value, when the first optical image stabilization module drives the first camera to move to a random position; a difference judgment unit, used to calibrate the first camera module or the second camera module based on the difference between the first optical center distance and the third optical center distance.
[0097] In an exemplary embodiment, the difference judgment unit includes: a third calibration subunit, used to complete the calibration of the first camera module or the second camera module if the difference between the first optical center distance and the third optical center distance is less than a second threshold.
[0098] In an exemplary embodiment, the difference judgment unit includes: a fourth calibration subunit, which is used to adjust the signal parameters of the first camera module and re-acquire the second optical center distance and the third optical center distance if the difference between the first optical center distance and the third optical center distance is greater than a second threshold.
[0099] The specific details of each part of the above device have been described in detail in the implementation method part, so they will not be repeated here.
[0100] The exemplary embodiments of the present disclosure further provide a computer-readable storage medium, which can be implemented in the form of a program product, including program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification, for example, to execute Figure 3 , Figure 4 , Figure 5 or Figure 6 The program product may be in the form of a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.
[0101] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory, a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0102] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0103] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0104] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0105] The exemplary embodiment of the present disclosure further provides an electronic device. The electronic device may include a processor and a memory, wherein the memory is used to store executable instructions of the processor, and the processor is configured to execute the above-mentioned camera module calibration method by executing the executable instructions.
[0106] Below Figure 8The mobile terminal 800 in FIG. 1 is taken as an example to exemplify the structure of the electronic device. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Figure 8 The construction in can also be applied to fixed type equipment.
[0107] like Figure 8 As shown, the mobile terminal 800 may specifically include: a processor 801, a memory 802, a bus 803, a mobile communication module 804, an antenna 1, a wireless communication module 805, an antenna 2, a display screen 806, a camera module 807, an audio module 808, a power module 809 and a sensor module 810.
[0108] The processor 801 may include one or more processing units, for example, the processor 801 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.
[0109] The encoder can encode (i.e. compress) an image or video to reduce the data size for easy storage or transmission. The decoder can decode (i.e. decompress) the encoded data of the image or video to restore the image or video data. The mobile terminal 800 can support one or more encoders and decoders, for example: image formats such as JPEG (Joint Photographic Experts Group), PNG (Portable Network Graphics), BMP (Bitmap), and video formats such as MPEG (Moving Picture Experts Group) 1, MPEG10, H.1063, H.1064, and HEVC (High Efficiency Video Coding).
[0110] The processor 801 may be connected to the memory 802 or other components via a bus 803 .
[0111] The memory 802 may be used to store computer executable program codes, which may include instructions. The processor 801 executes various functional applications and data processing of the mobile terminal 800 by running the instructions stored in the memory 802. The memory 802 may also store application data, such as images, videos, and other files.
[0112] The communication function of the mobile terminal 800 can be implemented by the mobile communication module 804, antenna 1, wireless communication module 805, antenna 2, modulation and demodulation processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 804 can provide 3G, 4G, 5G and other mobile communication solutions applied to the mobile terminal 800. The wireless communication module 805 can provide wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. applied to the mobile terminal 800.
[0113] The display screen 806 is used to implement display functions, such as displaying user interfaces, images, videos, etc. The camera module 807 is used to implement shooting functions, such as shooting images, videos, etc. The audio module 808 is used to implement audio functions, such as playing audio, collecting voice, etc. The power module 809 is used to implement power management functions, such as charging the battery, powering the device, monitoring the battery status, etc. The sensor module 810 may include one or more sensors for implementing corresponding sensing detection functions. For example, the sensor module 810 may include an inertial sensor, which is used to detect the motion posture of the mobile terminal 800 and output inertial sensing data.
[0114] It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or implementations combining hardware and software aspects, which may be collectively referred to herein as "circuit", "module" or "system". Those skilled in the art will readily think of other implementations of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and implementation are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0115] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A camera module calibration method, applied to a terminal device, characterized in that: The terminal device includes a first camera module and a second camera module, the first camera module includes a first camera and a first optical image stabilization module, and the second camera module includes a second camera and a second optical image stabilization module; the method includes: When the first camera is at an initial position of the first optical image stabilization module and the second camera is at an initial position of the second optical image stabilization module, obtaining a first optical center distance between an optical center of the first camera and an optical center of the second camera; When the first optical image stabilization module drives the first camera to move to a reference position, obtaining a second optical center distance between an optical center of the first camera and an optical center of the second camera; According to the first optical center distance and the second optical center distance, the first camera module or the second camera module is calibrated so that the first optical image stabilization module moves synchronously with the second optical image stabilization module.
2. The method according to claim 1, characterized in that: The step of acquiring a second optical center distance between an optical center of the first camera and an optical center of the second camera when the first optical image stabilization module drives the first camera to move to a reference position includes: When the first optical image stabilization module drives the first camera to move to a position of maximum travel in the X-axis motion direction, obtaining a second optical center distance between the optical center of the first camera and the optical center of the second camera on the X-axis; When the first optical image stabilization module drives the first camera to move to a position of maximum travel in the Y-axis motion direction, a second optical center distance between the optical center of the first camera and the optical center of the second camera on the Y-axis is obtained.
3. The method according to claim 2, characterized in that The step of calibrating the first camera module or the second camera module according to the first optical center distance and the second optical center distance includes: Determine an optical center parameter according to the second optical center distance on the X-axis and the second optical center distance on the Y-axis; Based on the difference between the first optical center distance and the optical center parameter, calibrate the first camera module or the second camera module.
4. The method according to claim 3, characterized in that Determining the optical center parameter according to the second optical center distance on the X-axis and the second optical center distance on the Y-axis includes: The ratio of the second optical center distance on the Y axis to the second optical center distance on the X axis is used as the optical center parameter.
5. The method according to claim 3, characterized in that: The calibrating the first camera module or the second camera module based on the difference between the first optical center distance and the optical center parameter includes: If the difference between the first optical center distance and the optical center parameter is less than a first threshold, the calibration of the first camera module or the second camera module is completed.
6. The method according to claim 5, characterized in that The calibrating the first camera module or the second camera module based on the difference between the first optical center distance and the optical center parameter further includes: If the difference between the first optical center distance and the optical center parameter is greater than the first threshold, the signal parameter of the first camera module is adjusted, and the second optical center distance is re-collected.
7. The method according to claim 5, characterized in that If the difference between the first optical center distance and the optical center parameter is less than a first threshold, the method further includes: When the first optical image stabilization module drives the first camera to move to a random position, obtaining a third optical center distance between an optical center of the first camera and an optical center of the second camera; Based on the difference between the first optical center distance and the third optical center distance, calibrate the first camera module or the second camera module.
8. The method according to claim 7, characterized in that The calibrating the first camera module or the second camera module based on the difference between the first optical center distance and the third optical center distance includes: If the difference between the first optical center distance and the third optical center distance is less than a second threshold, the calibration of the first camera module or the second camera module is completed.
9. The method according to claim 8, characterized in that The calibrating the first camera module or the second camera module based on the difference between the first optical center distance and the third optical center distance further includes: If the difference between the first optical center distance and the third optical center distance is greater than the second threshold, the signal parameters of the first camera module are adjusted, and the second optical center distance and the third optical center distance are reacquired.
10. A camera module calibration device, applied to a terminal device, characterized in that: The terminal device includes a first camera module and a second camera module, the first camera module includes a first camera and a first optical image stabilization module, and the second camera module includes a second camera and a second optical image stabilization module; the device includes: A first distance acquisition module, configured to acquire a first optical center distance between an optical center of the first camera and an optical center of the second camera when the first camera is at an initial position of the first optical image stabilization module and the second camera is at an initial position of the second optical image stabilization module; A second distance acquisition module, configured to acquire a second optical center distance between an optical center of the first camera and an optical center of the second camera when the first optical image stabilization module drives the first camera to move to a reference position; A camera module calibration module is used to calibrate the first camera module or the second camera module according to the first optical center distance and the second optical center distance, so that the first optical image stabilization module and the second optical image stabilization module move synchronously.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
12. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 9 by executing the executable instructions.
