A temperature drift compensation method and device
By acquiring the current temperature and temperature drift information of the camera module, and using the temperature drift information of the assembled camera module for temperature drift compensation, the problem of low lens temperature drift compensation accuracy is solved, improving focusing accuracy and image quality, especially improving focusing speed in phase-detection focusing scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-12-02
- Publication Date
- 2026-06-02
AI Technical Summary
Existing lens temperature drift compensation schemes have low compensation accuracy and poor temperature drift compensation effect, which affects image quality and focusing accuracy, especially in scenarios where high focusing accuracy is required.
By acquiring the current temperature and temperature drift information of the camera module, the target phase compensation value and/or target focal length are determined. Temperature drift compensation is performed using the temperature drift information of the assembled camera module, which is suitable for phase focusing schemes such as PDAF, improving focusing accuracy and efficiency.
It improves the effect of lens temperature drift compensation, enhances the focusing accuracy and image quality of electronic devices, and increases focusing speed.
Smart Images

Figure CN122138032A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of photography, and more particularly to a method and device for temperature drift compensation. Background Technology
[0002] Lens temperature drift refers to the shift in the focal position of a lens due to changes in ambient temperature caused by the thermal expansion or contraction of lens materials. Lens temperature drift has a significant impact on image quality, potentially leading to reduced focusing accuracy and decreased image sharpness. This negative impact is particularly pronounced in scenarios requiring high focusing precision, such as professional photography, continuous shooting, and industrial inspection.
[0003] Currently, the most widely used method to address lens temperature drift is to compensate for it during lens focusing. This method primarily involves measuring the lens's temperature drift parameters, fitting a temperature drift curve based on these parameters, and then using this curve to compensate for and correct the problems caused by lens temperature drift.
[0004] However, the above-mentioned temperature drift compensation scheme has low compensation accuracy and poor temperature drift compensation effect. Summary of the Invention
[0005] This application provides a temperature drift compensation method and device, which performs temperature drift compensation based on the temperature drift information of the lens module, thereby improving the compensation effect of temperature drift compensation and improving the focusing accuracy of the device.
[0006] In a first aspect, embodiments of this application provide a temperature drift compensation method, the method comprising: determining the phase difference of image frames acquired by a camera module; acquiring the current temperature of the camera module and temperature drift information of the camera module, wherein the temperature drift information indicates the correspondence between multiple test temperatures and multiple phase compensation values, and / or indicates the correspondence between multiple test temperatures and multiple focal lengths of the camera module; determining a target phase compensation value and / or a target focal length based on the current temperature of the camera module and the temperature drift information; and adjusting the focus based on the target phase compensation value and / or the target focal length and the phase difference.
[0007] Based on the above technical solution, since the stress and baking during the assembly of the lens into a camera module may cause changes in the lens's temperature drift information, the temperature drift information of the lens before assembly may be inconsistent with the temperature drift information of the camera module during actual shooting. In this embodiment, by using the temperature drift information of the assembled camera module for temperature drift compensation, the temperature drift information can be made closer to the temperature drift information of the camera module during actual shooting. Compared to the solution of using the temperature drift information of the lens before assembly for temperature drift compensation, the temperature drift compensation solution provided in this embodiment can achieve better temperature drift compensation effect, improve the focusing accuracy of the electronic device, and improve the image quality captured by the electronic device.
[0008] Furthermore, in this embodiment, a target phase compensation value can be determined, and then temperature drift compensation can be performed based on the target phase compensation value. This is more suitable for phase focusing schemes, such as phase detection autofocus (PDAF) focusing schemes, which improves the efficiency of temperature drift compensation in electronic devices and increases the focusing speed of electronic devices.
[0009] In one possible implementation, determining the target phase compensation value and / or target focal length based on the current temperature and temperature drift information of the camera module includes: determining a target test temperature based on the current temperature of the camera module and multiple test temperatures, wherein the target test temperature is the test temperature with the smallest absolute value of the difference between the multiple test temperatures and the temperature of the camera module; determining the phase compensation value corresponding to the target test temperature as the target phase compensation value, or determining the focal length corresponding to the target test temperature as the target focal length.
[0010] In one possible implementation, temperature drift information indicates the correspondence between multiple test temperatures and multiple phase compensation values. Focusing is performed based on the target phase compensation value and the phase difference, including: determining the product of the sum of the target phase compensation value and the phase difference and the defocus conversion coefficient as the lens position parameter; and focusing is performed based on the lens position parameter.
[0011] In one possible implementation, obtaining the temperature drift information of the camera module includes: determining temperature drift calibration parameters, which include multiple test temperatures; performing temperature drift tests on the lens module at multiple test temperatures to obtain corresponding multiple phase difference values; and determining temperature drift information based on the multiple test temperatures and multiple phase difference values.
[0012] In one possible implementation, the temperature drift information also includes multiple defocus conversion coefficients, and the temperature drift information also indicates the correspondence between multiple test temperatures and multiple defocus conversion coefficients.
[0013] In one possible implementation, the camera module includes a lens module and an image sensor, and the temperature of the camera module is the same as the temperature of the lens module.
[0014] Secondly, embodiments of this application provide an electronic device, including a processor and a memory. The processor is coupled to the memory; the memory stores computer instructions, which are loaded and executed by the processor to enable the electronic device to implement any of the methods provided in the first aspect.
[0015] Thirdly, embodiments of this application provide a chip, which includes: a processor and an interface circuit; the interface circuit is used to receive code instructions and transmit them to the processor; the processor is used to run the code instructions to execute any of the methods provided in the first aspect.
[0016] Fourthly, embodiments of this application provide a computer-readable storage medium storing at least one computer program instruction, which is loaded and executed by a processor to implement any of the methods provided in the first aspect above.
[0017] Fifthly, embodiments of this application provide a computer program product, including computer execution instructions, which, when executed on a computer, cause the computer to perform any of the methods provided in the first aspect.
[0018] The possible implementations of aspects two through five have similar effects to those of aspect one and the possible designs of aspect one, and will not be elaborated upon here. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of a temperature drift scenario;
[0020] Figure 2 This is a schematic diagram of temperature drift information;
[0021] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0022] Figure 4 A schematic diagram of the software architecture of an electronic device provided in an embodiment of this application;
[0023] Figure 5 A schematic diagram illustrating a temperature drift compensation method provided in an embodiment of this application;
[0024] Figure 6 A schematic flowchart illustrating a temperature drift compensation method provided in an embodiment of this application;
[0025] Figure 7 A schematic diagram illustrating a temperature drift compensation method provided in an embodiment of this application;
[0026] Figure 8 A schematic diagram illustrating another temperature drift compensation method provided in this application embodiment;
[0027] Figure 9 A schematic diagram illustrating another temperature drift compensation method provided in this application embodiment;
[0028] Figure 10 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application;
[0029] Figure 11 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application. Detailed Implementation
[0030] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0031] In the description of this application, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between the related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. A and B can be singular or plural.
[0032] In the description of this application, unless otherwise stated, "multiple" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0033] Furthermore, to facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.
[0034] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner to facilitate understanding.
[0035] It is understood that the term "embodiment" used throughout the specification means that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, various embodiments throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It is understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0036] It is understood that some optional features in the embodiments of this application can be implemented independently in certain scenarios without relying on other features, such as the current solution on which they are based, to solve the corresponding technical problems and achieve the corresponding effects. Alternatively, they can be combined with other features as needed in certain scenarios. Correspondingly, the apparatus given in the embodiments of this application can also implement these features or functions, which will not be elaborated here.
[0037] In this application, unless otherwise specified, the same or similar parts between the various embodiments can be referred to each other. Unless otherwise specified or logically conflicting, the terminology and / or descriptions between different embodiments are consistent and can be mutually referenced. Different embodiments can be combined to form new embodiments based on their inherent logical relationships. The following embodiments of this application do not constitute a limitation on the scope of protection of this application.
[0038] The following describes the relevant technologies of the embodiments of this application:
[0039] I. Phase detection autofocus technology.
[0040] Phase detection autofocus (PDAF) works by determining the focus point based on the difference in image formation at different locations after light passes through a lens. On the image sensor or dedicated focus sensor of an electronic device, multiple pixels receive light. When the lens is not in focus, the phase difference between these pixels is detected. For example, light from the same point on the subject will form images at different locations on the sensor of the electronic device after passing through different parts of the lens. If the phase difference between these images is inconsistent, the electronic device can calculate the direction and distance the lens needs to adjust based on this phase difference, thus quickly and accurately focusing on the subject.
[0041] II. Image Sensor.
[0042] In PDAF technology, phase detection can be performed using the image sensor of the camera module to obtain phase information. This can be achieved using sensors such as phase detection pixel sensors, dual-pixel sensors, and quad-phase detection sensors.
[0043] For example, a phase-detection pixel sensor has pixels specifically designed for phase detection. These pixels are physically blocked, allowing light to enter only from specific directions, thus generating image information from two different perspectives: left-right or top-bottom. By comparing the phase difference between these two images, the distance to the object can be determined, and the direction and distance the lens needs to move can be calculated, enabling fast focusing.
[0044] For example, in a dual-pixel sensor, each pixel is divided into two sub-pixels, a left sub-pixel and a right sub-pixel, which share the same microlens to detect phase information. This means that all pixels can be used simultaneously for phase detection and imaging, achieving fast focusing without affecting image quality.
[0045] For example, a quad-phase detection sensor can perform 2x2 phase detection autofocus on the entire sensor's image array. This means dividing the pixels into 2x2 groups, where pixels in each group can provide phase information in different directions, thereby more accurately calculating the distance to the object and the focus information.
[0046] In summary, in the embodiments of this application, electronic devices can acquire phase information through various image sensors of the camera module, and the specifics are not limited here.
[0047] like Figure 1 As shown in a, b, and c, lens temperature drift occurs when the lens's focus shifts due to the thermal expansion or contraction of its materials. This shift affects the sharpness and focusing accuracy of the captured image. The impact is particularly pronounced in scenarios requiring high focusing precision and long shooting periods. Figure 1 As shown in a, when the ambient temperature drops to -5 degrees Celsius, lens temperature drift causes focusing errors and reduces image sharpness; as... Figure 1 As shown in c, when the ambient temperature rises to 55 degrees Celsius, lens temperature drift causes focusing errors and reduces image sharpness. Figure 2 As shown, to compensate for the decrease in image sharpness caused by temperature drift, it is necessary to calibrate the temperature drift parameters of the lens, fit the temperature drift curve of the lens, and then compensate by focusing according to the temperature drift curve of the lens during shooting.
[0048] Understandably, in actual production, the differences between each lens are quite significant, and the temperature drift curve of a single lens cannot cover all lenses. Calibrating the temperature drift of each individual lens would be time-consuming, labor-intensive, and extremely costly, failing to meet the needs of large-scale production. On the other hand, lenses are affected by assembly stress and baking during subsequent production, causing deviations between the calibrated temperature drift curve and the actual temperature drift curve of the assembled lens module, resulting in poor temperature drift compensation.
[0049] Based on this, embodiments of this application provide a temperature drift compensation method, which includes: determining the phase difference of image frames acquired by a camera module; acquiring the current temperature of the camera module and temperature drift information of the camera module, wherein the temperature drift information indicates the correspondence between multiple test temperatures and multiple phase compensation values, and / or indicates the correspondence between multiple test temperatures and multiple focal lengths of the camera module; determining a target phase compensation value and / or a target focal length based on the current temperature of the camera module and the temperature drift information; and adjusting the focus based on the target phase compensation value and / or the target focal length and the phase difference.
[0050] Based on the above technical solution, since the stress and baking during the assembly of the lens into a camera module may cause changes in the lens's temperature drift information, the temperature drift information of the lens before assembly may be inconsistent with the temperature drift information of the camera module during actual shooting. In this embodiment, by using the temperature drift information of the assembled camera module for temperature drift compensation, the temperature drift information can be made closer to the temperature drift information of the camera module during actual shooting. Compared to the solution of using the temperature drift information of the lens before assembly for temperature drift compensation, the temperature drift compensation solution provided in this embodiment can achieve better temperature drift compensation effect, improve the focusing accuracy of the electronic device, and improve the image quality captured by the electronic device.
[0051] Furthermore, in this embodiment, a target phase compensation value can be determined, and then temperature drift compensation can be performed based on the target phase compensation value. This is more suitable for phase focusing schemes, such as PDAF focusing schemes, which improves the efficiency of temperature drift compensation in electronic devices and increases the focusing speed of electronic devices.
[0052] To better understand the embodiments of this application, the structure of the electronic device of the embodiments of this application is described below.
[0053] Figure 3 A schematic diagram of the structure of electronic device 100 is shown. Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a multispectral sensor 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0054] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0055] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0056] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0057] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0058] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0059] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0060] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0061] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 150 can provide solutions for wireless communication applications, including 2G / 3G / 4G / 5G, on the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
[0062] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0063] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with networks and other devices through wireless communication technology.
[0064] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0065] The display screen 194 is used to display images, display videos, and receive swipe operations, etc. The display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or more display screens 194.
[0066] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0067] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's image sensor. The light signal is converted into an electrical signal, and the camera's image sensor transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0068] Camera 193 is used to capture still images or videos. An object is projected onto an image sensor through a lens, generating an optical image. The image sensor can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The image sensor converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or more cameras 193.
[0069] In this embodiment, the electronic device can acquire a target image through the camera 193. The focal length of the camera is adjustable. The electronic device can adjust the focal length of the camera by calculating the lens position, thereby achieving a clearer image.
[0070] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0071] Internal memory 121 can be used to store executable program code, including instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located within the processor.
[0072] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0073] In some embodiments, the multispectral sensor 180 can be used to acquire first reflection spectral data and first light source spectral data corresponding to multiple light sources.
[0074] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0075] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, or to indicate messages, missed calls, notifications, etc.
[0076] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with or separate from the electronic device 100.
[0077] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture, etc. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.
[0078] Figure 4 This is a software structure block diagram of an electronic device 100 according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, the hardware abstraction layer, and the kernel layer.
[0079] The application layer can include a series of application packages. For example... Figure 3 As shown, the application package can include applications such as camera, settings, and calendar.
[0080] Camera apps are applications that enable shooting and recording. Electronic devices can respond to a user's action of opening the camera app to take photos or record videos. It's understandable that the photo and video recording functions of a camera app can also be invoked by other applications. For example, video calling applications can also use photo and video recording functions.
[0081] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes a set of predefined functions.
[0082] Among them, such as Figure 4 As shown, the application framework layer can also include a camera service, which can be called by camera applications to enable functions such as taking photos or recording videos.
[0083] In addition, such as Figure 4 As shown, the application framework layer may also include a window manager, content provider, resource manager, and view system, etc.
[0084] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0085] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, etc.
[0086] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0087] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0088] The Android runtime consists of core libraries and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.
[0089] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0090] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0091] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0092] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0093] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG2, H.262, MP3, AAC, AMR, JPG, and PNG.
[0094] 3D graphics processing libraries are used to implement 3D graphics drawing, image rendering, compositing, and layer processing. 2D graphics engines are drawing engines for 2D graphics.
[0095] The Hardware Abstraction Layer (HAL) is a layer of abstraction that sits between the kernel layer and the Android runtime. The HAL can be a wrapper around hardware drivers in the kernel layer, providing a calling interface for the application framework layer.
[0096] In this embodiment of the application, the hardware abstraction layer may include a camera hardware abstraction layer (camera HAL).
[0097] The kernel layer is the layer between hardware and software. The kernel layer includes at least camera drivers, sensor drivers, and display drivers. In some embodiments, the camera driver controls the operation of the camera module, the sensor driver controls the operation of sensors such as RGB sensors and TOF sensors, and the display driver controls the display screen to show images.
[0098] The hardware can include a camera module, an RGB sensor, a TOF sensor, and a display screen, etc. The camera module can include a camera, a lens, an image sensor, and a digital signal processor, etc. In the embodiments of this application, the camera can be a front-facing camera module or a rear-facing camera module.
[0099] In this embodiment, the electronic device can invoke its shooting function through an application. For example, after the camera application is launched, the electronic device can activate its shooting function. Then, the electronic device can invoke the camera hardware abstraction module through the camera service, obtain the image frame acquired by the camera hardware abstraction module through the camera driver, and display the image frame on the display interface of the electronic device. Simultaneously, the electronic device can also obtain phase difference information, temperature information, and other information from the image through the sensor hardware abstraction module. The electronic device can then determine the phase difference of the acquired image frame and, based on the target phase compensation value or target focal length corresponding to the phase difference and temperature information, determine the lens position parameters that need to be adjusted. The motor then adjusts the lens position of the camera module to the specified position. After adjusting the lens position parameters of the camera module, the electronic device can reacquire the image frame and display the reacquired image frame on the display interface of the electronic device, thus implementing the temperature drift compensation method provided in this embodiment.
[0100] Of course, the process corresponding to the temperature drift compensation method provided in this application embodiment can also be set in software such as the kernel layer or application framework layer, or in independent dedicated hardware. This application embodiment does not limit this.
[0101] It should be noted that although the embodiments of this application are described using the Android system, the principle of the temperature drift compensation method is also applicable to electronic devices with operating systems such as iOS or Windows.
[0102] For ease of understanding, this application uses a mobile phone as an electronic device. First, it explains the application scenarios of the temperature drift compensation method by referring to some user interfaces shown in this application embodiment. After the shooting function is activated, the electronic device can display the following after the camera application is launched: Figure 5 Interface 501. This interface 501 can be a preview interface provided by the camera application to implement shooting functions, which includes a preview frame 5011, shooting controls 5012, and function controls corresponding to various shooting modes.
[0103] The preview box 5011 is used to display the image output by the camera in real time. The shooting control 5012 is used to trigger the shooting operation of the electronic device. The functional controls corresponding to various shooting modes may include night scene mode controls, portrait mode controls, photo mode controls, video mode controls, professional mode controls, and more controls for enabling more functions in the camera application.
[0104] like Figure 5As shown in (a), immediately after the camera application is launched, the electronic device acquires an image and displays it in the preview frame 5011. Assuming the focal length parameter for image capture by the electronic device is 1, the phase difference of the image acquired by the electronic device is relatively large. After focusing based on temperature drift compensation according to this embodiment, as... Figure 5 As shown in (b), the electronic device adjusts the focal length parameter of the image capture to 1.2, re-obtains the image and displays it on interface 601. At this time, the phase difference of the image acquired by the electronic device is small.
[0105] It is understandable that before temperature drift compensation, the phase difference of the image is large, resulting in low image clarity and poor image quality. After focusing based on temperature drift compensation in this embodiment, the focal length parameter of the image is adjusted from 1 to 1.2, reducing the phase difference of the image and improving the image quality and clarity.
[0106] Understandable Figure 5 (a) and Figure 5 The interface shown in (b) is merely an example of a focusing method for electronic devices based on temperature drift compensation and does not constitute a limitation on the embodiments of this application. In actual focusing, the focal length parameter of the electronic device is not limited to being adjusted from 1 to 1.2, but can be adjusted arbitrarily within the focal length adjustment range of the electronic device, and is not specifically limited here.
[0107] Furthermore, in this embodiment of the application, in order to illustrate the change in image sharpness before and after focus adjustment from the perspective of display effect, the sharpness of the portrait displayed in (a) of 5 is specifically discussed. Figure 5 The sharpness of the portrait shown in (b) is based on the following assumptions:
[0108] Assumption Figure 5 The portrait shown in (a) represents a low-resolution image, and it is assumed that... Figure 5 The portrait shown in (b) represents a high-resolution image. The resolution of the portraits shown in these two images does not represent the actual display effect in the shooting.
[0109] The following details the specific implementation of the electronic device controlling the temperature drift compensation method of the camera in the embodiments of this application.
[0110] It is understood that in the embodiments of this application, the executing entity may perform some or all of the steps in the embodiments of this application. These steps or operations are merely examples, and the embodiments of this application may also perform other operations or variations thereof. Furthermore, the various steps may be executed in different orders as presented in the embodiments of this application, and it is not necessarily necessary to execute all the operations in the embodiments of this application.
[0111] It should be noted that the message names between devices or the names of parameters in the messages in the embodiments of this application are just examples. In specific implementations, other names may also be used. This application does not specifically limit this.
[0112] The following is combined with Figures 6 to 10 The technical solutions of this application will be described in detail with specific method embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0113] In the embodiments of this application, such as Figure 5 As shown, after the camera application is launched, the electronic device can adjust the focal length for shooting through temperature drift compensation. The specific steps are as follows:
[0114] For example, Figure 6 This is a schematic flowchart illustrating a temperature drift compensation method provided in an embodiment of this application. (Refer to...) Figure 10 As shown, the temperature drift compensation method may specifically include the following steps:
[0115] 601. Determine the phase difference of the image frames acquired by the camera module.
[0116] Electronic devices can acquire image frames through a camera module and then determine the phase difference of the image frame.
[0117] In this embodiment, the camera module includes an image sensor. The electronic device can acquire image frames through the camera module and determine the phase difference of the acquired image frames based on the image sensor. For example, a phase detection pixel sensor has pixels specifically designed for phase detection. These pixels are physically blocked, allowing light to enter only from specific directions, thus generating image information from two different perspectives: left-right or top-bottom. By comparing the phase difference between these two perspectives, the distance to the object can be determined, and the direction and distance the lens needs to move can be calculated, achieving fast focusing.
[0118] 602. Obtain the current temperature of the camera module and the temperature drift information of the camera module.
[0119] The electronic device can acquire the current temperature of the camera module and the temperature drift information of the camera module. The temperature drift information indicates the correspondence between multiple test temperatures and multiple phase compensation values, and / or indicates the correspondence between multiple test temperatures and multiple focal lengths of the camera module.
[0120] In this embodiment of the application, the electronic device can obtain the temperature drift information of the camera module through the following method:
[0121] S1. Determine the temperature drift calibration parameters.
[0122] The electronic device first determines the temperature drift calibration parameters, which are used to perform temperature drift tests according to the set temperature drift calibration parameters, thereby obtaining temperature drift information. The temperature drift calibration parameters may include at least one of multiple test lens temperatures, multiple test lens positions, multiple image distances, and multiple focal lengths, etc. The test lens position is the location of the lens module of the camera module where the temperature drift test is performed.
[0123] In this embodiment, the test lens position d, the lens focal length f, and the test lens position l maintain the following relationship:
[0124]
[0125] The test lens position d is located between the close-focus lens position d1 and the telephoto lens position d2. The close-focus lens position d1 is the closest distance that the lens module can move to for close-focus, and the telephoto lens position d2 is the farthest distance that the lens module can move to for telephoto. The electronic device can determine multiple positions between the close-focus lens position d1 and the telephoto lens position d2 as the test lens positions, and the specific position is not limited here.
[0126] Preferably, during testing, the midpoint between the telephoto lens position d1 and the close-focus lens position d2 can be used as one of the test lens positions, i.e., d = (d1 + d2) / 2. Using the midpoint as one of the test lens positions divides the position data into two parts, making it easier to process the temperature drift data.
[0127] For example, the displacement from the lens's telephoto position to its near-focal position can be divided into N equal parts, and then the lens can be pushed to test at N+1 positions. For example, when N is 9, 10 test positions can be determined.
[0128] Among them, for the test lens temperature, the electronic device can set multiple test lens temperatures according to the accuracy requirements, such as -5 degrees Celsius, 10 degrees Celsius, 25 degrees Celsius, 40 degrees Celsius, and 55 degrees Celsius, and then perform temperature drift tests at each of these five lens temperatures.
[0129] In one possible implementation, the electronic device can be set to display an image for temperature drift testing. This image can be a test chart with alternating black and white vertical stripes, and the electronic device can set the stripe width, for example... Figure 7 As shown, the stripe width w can be set to test lens position l / (9 * focal length f).
[0130] S2. Conduct a temperature drift test.
[0131] Under the temperature drift calibration parameters set in step S1 above, the camera module is subjected to a temperature drift test to obtain the temperature drift test results.
[0132] Specifically, under multiple set test lens temperatures, the camera module captures images for temperature drift testing, and then determines relevant information of the acquired images (such as phase difference information and sharpness information) to perform temperature drift testing on the camera module and obtain the corresponding temperature drift test results.
[0133] For example Figure 8 As shown, with the test temperature set at 25 degrees Celsius, images for temperature drift testing were captured at ten positions from 460 to 660 degrees of the test lens. The phase difference and sharpness information of the acquired images were then determined.
[0134] In this embodiment of the application, the temperature drift test result can be a relevant parameter of the corresponding phase difference. For example... Figure 8 As shown, under a set test temperature of 25 degrees Celsius, the corresponding phase difference and sharpness data were determined at ten positions from 460° to 660° of the test lens. For example, at position 450°, the corresponding phase difference is -1 pixel, and the corresponding contrast ratio is 1,100,000; at position 500°, the corresponding phase difference is -0.6 pixels, and the corresponding contrast ratio is 1,400,000. Other positions are as follows... Figure 5 As shown.
[0135] In this embodiment, the electronic device can obtain temperature drift test results through sensors such as phase detection pixel sensors, full-pixel dual-core sensors, and quad-phase detection sensors. Other types of sensors can also be used, but this is not limited here.
[0136] S3. Determine temperature drift information.
[0137] After conducting a temperature drift test, the electronic device determines the temperature drift information corresponding to the camera module based on the set temperature drift calibration parameters and the temperature drift test results. This temperature drift information indicates the correspondence between multiple test temperatures and multiple phase compensation values, and / or indicates the correspondence between multiple test temperatures and the focal lengths of multiple camera modules. When the temperature drift information can indicate the correspondence between multiple test temperatures and multiple phase compensation values, this information can include multiple test temperatures and multiple phase compensation values, where any one of the multiple test temperatures in the temperature drift information has a corresponding phase compensation value among the multiple phase compensation values. Similarly, when the temperature drift information can indicate the correspondence between multiple test temperatures and the focal lengths of multiple camera modules, this information can include multiple test temperatures and the focal lengths of multiple camera modules, where any one of the multiple test temperatures in the temperature drift information has a corresponding focal length among the multiple camera module focal lengths.
[0138] In this embodiment, when the temperature drift information can indicate the correspondence between multiple test temperatures and multiple phase compensation values, the electronic device can determine the corresponding phase compensation value based on the phase difference information in the temperature drift test results when determining the phase compensation value in the temperature drift information. For example, at 25 degrees Celsius, if the lens test position is at 45°, the corresponding phase difference is -1. It can be understood that to achieve a compensated phase difference of 0, the electronic device can determine the corresponding phase compensation value as 1. Similarly, at 25 degrees Celsius, if the lens test position is at 67°, the corresponding phase difference is 0.2. It can be understood that to achieve a compensated phase difference of 0, the electronic device can determine the corresponding phase compensation value as -0.2. Besides these methods, other methods can be used to determine the phase compensation value, such as when the compensation objective is to achieve a non-zero phase difference, for example, a compensated phase difference of 1. Specific methods are not limited here.
[0139] In one possible implementation, the temperature drift information can also indicate the correspondence between multiple test temperatures and multiple defocus conversion coefficients. Since the defocus conversion coefficient of the camera module can be different at different temperatures, the electronic device can determine the corresponding defocus conversion coefficient at different temperatures. Therefore, the temperature drift information can also include multiple defocus conversion coefficients. It is understood that the defocus conversion coefficient corresponds to the temperature information; that is, any one of the multiple test temperatures includes a corresponding defocus conversion coefficient in the multiple defocus conversion coefficients. In other words, the temperature drift information can also indicate the correspondence between multiple test temperatures and multiple defocus conversion coefficients.
[0140] In one possible implementation, since the phase difference data of PD pixels differs at different locations on the image sensor, the corresponding temperature drift information can be determined separately for each location on the image sensor. For example... Figure 9 As shown, the image acquired by the image sensor can be divided into multiple regions. At the same lens position under the same test temperature, the phase compensation value of each region is different. Correspondingly, the electronic device can determine different phase compensation values for each region based on the corresponding temperature drift information. Therefore, the electronic device determines the corresponding temperature drift information for each region, making it more accurate and convenient to use.
[0141] In one possible implementation, the temperature drift information can also indicate the correspondence between multiple test temperature ranges and multiple phase compensation values. That is, the temperature information in the temperature drift information can be a temperature value or a test temperature range, and the temperature within that range is applicable to the corresponding phase compensation value. The temperature drift information can include multiple test temperature ranges, each with a corresponding phase compensation value. For example, the temperature drift information can include five test temperature ranges: (-15,-5], (-5,5], (5,15], (15,25], and (25,35], each with a corresponding phase compensation value and / or focal length value.
[0142] In this embodiment, multiple test temperatures are set during temperature drift testing. When determining multiple test temperature ranges in the temperature drift information, the electronic device can determine the temperature based on these multiple test temperatures. Simultaneously, the phase compensation value and / or focal length value corresponding to these multiple test temperature ranges can also be the same as the phase compensation value and / or focal length value corresponding to the multiple test temperatures. For example, when performing a temperature drift test at a set test temperature of -10 degrees Celsius, the corresponding phase compensation value is -1. When determining the temperature drift information, the electronic device can determine the corresponding temperature range (-15, -5], and the phase compensation value corresponding to this temperature range (-15, -5] is also -1. In addition, other temperature ranges can be included. For example, the corresponding temperature range (-5, 5] can be determined based on a test temperature of 0 degrees Celsius, and the corresponding temperature range (5, 15] can be determined based on a test temperature of 10 degrees Celsius. Specific limitations are not specified here.
[0143] In another possible implementation, in this embodiment of the application, the multiple test temperatures in the temperature drift information are multiple temperature values, such as -10 degrees Celsius, 0 degrees Celsius, 10 degrees Celsius, 20 degrees Celsius, and 30 degrees Celsius. Each temperature value has a corresponding phase compensation value and / or focal length value.
[0144] In this embodiment of the application, the camera module of the electronic device includes a lens module and an image sensor. Since this embodiment of the application focuses on temperature drift caused by lens module deformation due to temperature, in one possible implementation, when the electronic device obtains temperature information, it can obtain the current temperature of the lens module in the camera module as the current temperature of the camera module, thereby obtaining more accurate temperature information that causes temperature drift of the lens and achieving more precise focusing.
[0145] 603. Determine the target phase compensation value and / or target focal length based on the current temperature and temperature drift information of the camera module.
[0146] After obtaining the current temperature and temperature drift information of the camera module, the electronic device can determine the target phase compensation value and / or target focal length based on the current temperature and temperature drift information of the camera module.
[0147] In this embodiment of the application, the temperature drift information may include multiple test temperatures and multiple phase compensation values. After the electronic device obtains the temperature information, it determines the closest test temperature in the temperature drift information based on the temperature, and then determines the corresponding target phase compensation value.
[0148] In one possible implementation, the multiple test temperatures in the temperature drift information can be multiple temperature ranges. The electronic device can first determine which temperature range the current temperature of the camera module belongs to, and then determine the phase compensation value corresponding to that temperature range as the target phase compensation value, or determine the corresponding focal length as the target focal length. For example, if the current temperature of the camera module is 11 degrees Celsius, the electronic device can determine that the current temperature of the camera module belongs to the temperature range (5, 15], and the phase compensation value corresponding to the temperature range (5, 15] is 10. Then, the electronic device can determine that the target phase compensation value corresponding to the current temperature of the camera module is 10.
[0149] In another possible implementation, the multiple test temperatures in the temperature drift information are multiple temperature values, such as -10 degrees Celsius, 0 degrees Celsius, 10 degrees Celsius, 20 degrees Celsius, and 30 degrees Celsius. Each temperature value has a corresponding phase compensation value and / or focal length value. After obtaining the current temperature of the camera module, the electronic device can, based on the temperature drift information, determine the target test temperature as the test temperature with the smallest absolute value of the difference between the multiple test temperatures and the camera module temperature. Then, the electronic device can determine the phase compensation value corresponding to this target test temperature as the target phase compensation value. For example, if the current temperature of the camera module is 11 degrees Celsius, and the test temperature with the smallest absolute value of the difference between the five temperature values (-10 degrees Celsius, 0 degrees Celsius, 10 degrees Celsius, 20 degrees Celsius, and 30 degrees Celsius) and the camera module temperature is 10 degrees Celsius, then the electronic device can determine the phase compensation value 10 corresponding to 10 degrees Celsius as the target phase compensation value.
[0150] In one possible implementation, since the phase difference data of PD pixels differs at different locations on the image sensor, the corresponding temperature drift information can be determined separately for each location on the image sensor. For example... Figure 9As shown, the image acquired by the image sensor can be divided into multiple regions. At the same lens position under the same test temperature, the phase compensation value of each region is different. Correspondingly, the electronic device can determine different phase compensation values for each region based on the corresponding temperature drift information determined for each region. Therefore, the electronic device determines the corresponding temperature drift information for each region, making it more accurate and convenient to use. In this case, the electronic device can have different phase compensation values for different regions. The electronic device can determine the corresponding target phase compensation value based on the corresponding position of the phase difference obtained in the above steps.
[0151] Based on the above technical solution, since the stress and baking during the assembly of the lens into a camera module may cause changes in the lens's temperature drift information, the temperature drift information of the lens before assembly is inconsistent with the temperature drift information of the camera module during actual shooting. In this embodiment, the temperature drift information of the assembled camera module is used for temperature drift compensation, instead of the temperature drift information of the lens before assembly. This avoids the problem of decreased accuracy of temperature drift data caused by lens assembly. Therefore, using the temperature drift information of the camera module for temperature drift compensation can achieve better temperature drift compensation results, improve the focusing accuracy of the electronic device, and improve the image quality captured by the electronic device.
[0152] Furthermore, in this embodiment, a target phase compensation value can be determined, and then temperature drift compensation can be performed based on the target phase compensation value. This is more suitable for phase focusing schemes, such as phase detection autofocus (PDAF) focusing schemes, which improves the efficiency of temperature drift compensation in electronic devices and increases the focusing speed of electronic devices.
[0153] 604. Determine the lens position parameters based on the target phase compensation value and / or target focal length and phase difference.
[0154] The electronic device determines the lens position parameters based on the target phase compensation value, phase difference information, and defocus conversion coefficient.
[0155] Specifically, after determining the target phase compensation value and phase difference information, the electronic device can determine the amount of position the lens needs to move. The electronic device can determine that the product of the sum of the target phase compensation value a and the phase difference b and the defocus conversion coefficient M is the lens position D, that is, the lens position parameter D = (target phase compensation value a + phase difference b) * defocus conversion coefficient M.
[0156] For example, at 25 degrees Celsius, the target phase compensation value is -3, the phase difference is 5, and the defocus conversion factor is 20. We can get the lens position D = (-3+5)*20 = 40. In this case, the lens position parameter is 40 units, which means that the electronic device needs to move the lens in the current state by 40 units.
[0157] In one possible implementation, the defocus conversion coefficient in this embodiment can be different or the same at different temperatures. That is, each test temperature can have a corresponding defocus conversion coefficient, and the defocus conversion coefficient corresponding to each test temperature can be different or the same; no specific limitation is made here.
[0158] In this application, the lens position parameter can be the amount of position the lens needs to be adjusted, such as adjusting the lens to a certain unit position towards the near focal length or to the far focal length. It can also be a specific position to be adjusted to, for example, setting a specific position parameter between the closest and farthest focal lengths. The lens position parameter determined by the electronic device can be the position parameter corresponding to a specific position. For example, if the position parameter corresponding to the closest focal length is -10 and the position parameter corresponding to the farthest focal length is 10, and the current position parameter of the lens module is 0, and the electronic device calculates a lens position parameter of 2, then the electronic device is instructed to adjust the lens to the position corresponding to lens position parameter 2.
[0159] 605. Adjust the focus according to the lens position parameters.
[0160] The electronic device focuses based on the determined lens position parameters to obtain a focused image.
[0161] In this application, the electronic device adjusts the focal length of the camera module by driving a motor to adjust the position of the lens in the camera module. Therefore, when adjusting the focal length of the camera module, the electronic device can first calculate the corresponding target lens position based on the required focal length, and then adjust the lens in the camera module to reach the target lens position by driving the motor.
[0162] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 10 As shown, the electronic device 1000 includes:
[0163] Processing module 1001 is used to determine the phase difference of image frames acquired by the camera module;
[0164] The acquisition module 1002 is used to acquire the current temperature of the camera module and the temperature drift information of the camera module. The temperature drift information indicates the correspondence between multiple test temperatures and multiple phase compensation values, and / or indicates the correspondence between multiple test temperatures and multiple focal lengths of the camera modules.
[0165] The processing module 1001 is also used to determine the target phase compensation value and / or target focal length based on the current temperature and temperature drift information of the camera module;
[0166] The processing module 1001 is also used to focus based on the target phase compensation value and / or the target focal length and phase difference.
[0167] In one possible implementation, the processing module 1001 is specifically used to determine a target test temperature based on the current temperature of the camera module and multiple test temperatures, wherein the target test temperature is the test temperature with the smallest absolute value of the difference between the multiple test temperatures and the temperature of the camera module; determine the phase compensation value corresponding to the target test temperature as the target phase compensation value, or determine the focal length corresponding to the target test temperature as the target focal length.
[0168] In one possible implementation, the processing module 1001 is specifically used to determine the product of the sum of the target phase compensation value and the phase difference and the defocus conversion coefficient as the lens position parameter; and to perform focusing based on the lens position parameter.
[0169] In one possible implementation, the acquisition module 1002 is specifically used to determine temperature drift calibration parameters, which include multiple test temperatures; perform temperature drift tests on the lens module at multiple test temperatures to obtain corresponding multiple phase difference values; and determine temperature drift information based on the multiple test temperatures and multiple phase difference values.
[0170] In one possible implementation, the temperature drift information also includes multiple defocus conversion coefficients, and the temperature drift information also indicates the correspondence between multiple test temperatures and multiple defocus conversion coefficients.
[0171] In one possible implementation, the temperature of the camera module is the same as the temperature of the lens module.
[0172] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 11 As shown, the electronic device 1100 includes one or more processors 1101, communication lines 1102 and communication interfaces 1103. Optionally, the electronic device 1100 also includes a memory 1104.
[0173] In some implementations, memory 1104 stores elements such as executable modules or data structures, or subsets thereof, or extended sets thereof.
[0174] The methods described in the embodiments of this application can be applied to or implemented by processor 1101. Processor 1101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuit in the hardware of processor 1101 or by instructions in software form. The processor 1101 may be a general-purpose processor (e.g., a microprocessor or conventional processor), a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates, transistor logic devices, or discrete hardware components. Processor 1101 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0175] The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can be located in mature storage media in the art, such as random access memory, read-only memory, programmable read-only memory, or electrically erasable programmable read-only memory (EEPROM). This storage medium is located in memory 1104, and processor 1101 reads information from memory 1104 and, in conjunction with its hardware, completes the steps of the above method.
[0176] The processor 1101, memory 1104 and communication interface 1103 can communicate with each other via communication line 1102.
[0177] In the above embodiments, the instructions stored in the memory for execution by the processor can be implemented in the form of a computer program product. This computer program product can be pre-written into the memory, or it can be downloaded and installed into the memory as software.
[0178] This application also provides a computer program product comprising one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the process or function performed by the electronic device or electronic device according to the embodiments of this application is generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website satellite constellation, computer, server, or data center to another website satellite constellation, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. For example, available media may include magnetic media (e.g., floppy disk, hard disk, or magnetic tape), optical media (e.g., digital versatile disc (DVD)), or semiconductor media (e.g., solid-state disk (SSD)).
[0179] This application provides an electronic device, which includes a processor and a memory. The memory stores a computer program, and the processor executes the computer program to perform the temperature drift compensation method described above.
[0180] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program or instructions. When executed by a processor, the computer program or instructions implement the methods performed by the aforementioned base station or electronic device. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.
[0181] As one possible design, computer-readable media may include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM, or other optical disc storage; computer-readable media may include disk storage or other disk storage devices. Furthermore, any connecting cable may also be appropriately referred to as computer-readable media. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of media. As used herein, disks and optical discs include optical discs (CD), laser discs, optical discs, DVDs, floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0182] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0183] The above specific embodiments further illustrate the purpose, technical solution and beneficial effects of this application. It should be understood that the above are only specific embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of this application should be included within the scope of protection of this application.
Claims
1. A temperature drift compensation method, applied to an electronic device, the electronic device including a camera module, characterized in that, The method includes: Determine the phase difference of the image frames acquired by the camera module; The current temperature of the camera module and the temperature drift information of the camera module are obtained. The temperature drift information indicates the correspondence between multiple test temperatures and multiple phase compensation values, and / or indicates the correspondence between multiple test temperatures and multiple focal lengths of the camera modules. The target phase compensation value and / or target focal length are determined based on the current temperature of the camera module and the temperature drift information. Focusing is performed based on the target phase compensation value and / or the target focal length and the phase difference.
2. The method according to claim 1, characterized in that, Determining the target phase compensation value and / or target focal length based on the current temperature of the camera module and the temperature drift information includes: A target test temperature is determined based on the current temperature of the camera module and the plurality of test temperatures. The target test temperature is the test temperature with the smallest absolute value of the difference between the test temperatures and the temperature of the camera module. The phase compensation value corresponding to the target test temperature is determined as the target phase compensation value, or the focal length corresponding to the target test temperature is determined as the target focal length.
3. The method according to claim 2, characterized in that, The temperature drift information indicates the correspondence between multiple test temperatures and multiple phase compensation values. The focusing based on the target phase compensation value and the phase difference includes: The product of the sum of the target phase compensation value and the phase difference and the defocus conversion coefficient is determined as the lens position parameter; Focusing is performed based on the lens position parameters.
4. The method according to claim 3, characterized in that, The step of obtaining the temperature drift information of the camera module includes: Determine the temperature drift calibration parameters, which include multiple test temperatures; Multiple phase difference values were obtained by performing temperature drift tests on the lens module at the multiple test temperatures. The temperature drift information is determined based on the multiple test temperatures and the multiple phase differences.
5. The method according to claim 4, characterized in that, The temperature drift information also includes multiple defocus conversion coefficients, and the temperature drift information further indicates the correspondence between the multiple test temperatures and the multiple defocus conversion coefficients.
6. The method according to claim 5, characterized in that, The camera module includes a lens module and an image sensor, and the temperature of the camera module is the same as the temperature of the lens module.
7. An electronic device, characterized in that, The electronic device includes an acquisition module and a processing module, wherein: The processing module is used to determine the phase difference of the image frames acquired by the camera module; The acquisition module is used to acquire the current temperature of the camera module and the temperature drift information of the camera module. The temperature drift information indicates the correspondence between multiple test temperatures and multiple phase compensation values, and / or indicates the correspondence between multiple test temperatures and multiple focal lengths of the camera modules. The processing module is used to determine the target phase compensation value and / or the target focal length based on the current temperature of the camera module and the temperature drift information. The processing module is used to adjust the focus based on the target phase compensation value and / or the target focal length and the phase difference.
8. An electronic device, characterized in that, It includes a memory and a processor, the memory being used to store a computer program, and the processor being used to invoke the computer program to execute the temperature drift compensation method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program or instructions that, when executed, implement the temperature drift compensation method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, Includes a computer program, which, when run, causes the computer to perform the temperature drift compensation method as described in any one of claims 1 to 6.