Method for switching between high dynamic range modes and electronic device storage medium

By switching to DAG HDR mode when light intensity decreases, the exposure gain and exposure ratio are controlled, which solves the problem of signal-to-noise ratio drop in LOFIC HDR mode and improves the shooting experience and image consistency.

WO2025107283A9PCT designated stage expired Publication Date: 2025-10-30HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/133944
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2025-10-30

AI Technical Summary

Technical Problem

When electronic devices use LOFIC HDR mode, the signal-to-noise ratio drops in the transition area between bright and dark areas, affecting the user's shooting experience.

Method used

By gradually switching from LOFIC HDR mode to DAG HDR mode when the light intensity decreases, the changes in exposure gain and exposure ratio are controlled. The same conversion gain characteristic of long and short frames in DAG HDR mode is utilized to alleviate the signal-to-noise ratio drop and maintain the consistency of exposure ratio and image brightness before and after the switch.

Benefits of technology

It effectively alleviates the signal-to-noise ratio drop in the transition area between bright and dark areas, improves the user's shooting experience, and ensures the naturalness and consistency of image transitions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023133944_30102025_PF_FP_ABST
    Figure CN2023133944_30102025_PF_FP_ABST
Patent Text Reader

Abstract

A method for switching between high dynamic range (HDR) modes and an electronic device storage medium, relating to the technical field of terminals. The method is applied to an electronic device supporting an overflow integration capacitor (LOFIC) HDR mode and a dual analog gain (DAG) HDR mode, and comprises: starting a camera operating program; acquiring the illuminance of the environment in which the electronic device is located; and starting the LOFIC HDR mode. According to the scheme, when the illuminance is reduced, the electronic device does not remain in the LOFIC HDR mode, but switches the HDR mode to the DAG HDR mode, so as to utilize a characteristic of the DAG HDR mode wherein same uses the same conversion gain for both long frames and short frames, such that a signal-to-noise ratio drop in a transition area between a bright portion and a dark portion can be mitigated, thereby improving the photographing experience of a user.
Need to check novelty before this filing date? Find Prior Art

Description

A method for switching high dynamic range modes, and a storage medium for electronic devices. Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a method for switching high dynamic range modes and a storage medium for electronic devices. Background Technology

[0002] With the development of the terminal industry, many electronic devices support high dynamic range (HDR) photography technology. HDR photography technology can capture and display the vast dynamic range of the real world, even when the dynamic range available in typical imaging sensors and display devices is limited.

[0003] Lateral overflow integration capacitor (LOFIC) HDR mode is an HDR mode that extends the dynamic range of complementary metal-oxide-semiconductor (CMOS) by increasing lateral overflow capacitance. However, when electronic devices use LOFIC HDR mode, during previewing or video recording, a drop in signal-to-noise ratio (SNR) occurs from high to low in the transition areas between bright and dark areas of the image, resulting in SNR stratification and degrading the user's shooting experience.

[0004] Summary of the Invention

[0005] In view of this, this application provides a method for switching high dynamic range modes and an electronic device storage medium, which can alleviate the signal-to-noise ratio drop in the transition area between bright and dark areas and improve the user's shooting experience.

[0006] In a first aspect, this application provides a method for switching high dynamic range modes, applied to an electronic device that supports LOFIC HDR mode and dual analog gain (DAG) HDR mode. The method includes: starting a camera running program, acquiring the ambient light intensity of the electronic device, enabling LOFIC HDR mode, and switching the HDR mode to DAG HDR mode when the ambient light intensity drops below a first ambient light intensity.

[0007] When the camera sensor is operating in LOFIC HDR mode, existing solutions continue to use LOFIC HDR mode as light intensity decreases. In this case, to ensure image quality in low light, LOFIC HDR gradually increases the exposure gain of longer frames, causing a noticeable drop in signal-to-noise ratio (SNR) in the transition areas between bright and dark areas. The solution in this application does not continuously maintain LOFIC HDR mode but switches to DAG HDR mode. This solution utilizes the characteristic of DAG HDR mode, where both long and short frames use the same conversion gain. When the light intensity drops below the initial light intensity, indicating low light intensity, the SNR drop in LOFIC HDR mode is more pronounced. However, with DAG HDR mode, there is no significant SNR drop between long and short frames. This effectively mitigates the SNR drop in the transition areas between bright and dark areas in the merged image, improving the user's shooting experience.

[0008] In one possible implementation, when the light intensity is greater than or equal to a first light intensity, the method further includes: when the light intensity decreases, controlling the exposure gain of the LOFIC HDR mode to increase as the light intensity decreases, and controlling the exposure ratio of the LOFIC HDR mode to decrease as the light intensity decreases.

[0009] In existing solutions, when light intensity decreases, to ensure image quality in low brightness, the exposure gain of the long frames in LOFIC HDR mode is gradually increased, thus increasing the exposure ratio of LOFIC HDR mode. The solution in this application increases the exposure gain of LOFIC HDR mode to ensure image quality while controlling the exposure ratio of LOFIC HDR mode to decrease as light intensity decreases, ensuring that the exposure ratio of LOFIC HDR mode is not too high before switching to DAG HDR mode. The advantages of this are twofold: firstly, it avoids a significant drop in signal-to-noise ratio in the image before switching to DAG HDR mode due to excessive exposure ratio; secondly, since the pixel circuitry of DAG HDR mode generally does not include lateral overflow capacitors, the maximum exposure ratio of DAG HDR mode may be lower than that of LOFIC HDR mode. By reducing the exposure ratio of LOFIC HDR mode, the abrupt change in exposure ratio during HDR mode switching can be reduced or eliminated, making the HDR mode switching more natural.

[0010] In one possible implementation, the exposure gain includes both analog and digital gain, controlling the exposure gain of the LOFIC HDR mode to increase as the light intensity decreases, and controlling the exposure ratio of the LOFIC HDR mode to decrease as the light intensity decreases, specifically including:

[0011] The digital gain of the LOFIC HDR mode remains constant; the rate of increase of the analog gain of the short frames in the LOFIC HDR mode as the light intensity decreases is greater than the rate of increase of the analog gain of the long frames in the LOFIC HDR mode as the light intensity decreases.

[0012] The exposure ratio is the ratio of the exposure gain of the long frame to the exposure gain of the short frame. With a constant digital gain, the exposure ratio gradually decreases when the rate of increase of the analog gain of the short frame exceeds the rate of increase of the analog gain of the long frame. This implementation increases the analog gain of the LOFIC HDR mode to ensure image quality without exacerbating the signal-to-noise ratio drop. In one possible implementation, when the light intensity is less than a first light intensity, the HDR mode is switched to DAG HDR mode, specifically including:

[0013] The analog gain of the short frame in LOFIC HDR mode is determined based on the light intensity. When the analog gain of the long frame is greater than the first preset gain, the HDR mode is switched to DAG HDR mode. The first preset gain is the analog gain of the short frame in LOFIC HDR mode when the light intensity is the first light intensity. The exposure ratio is kept unchanged before and after the HDR mode switch.

[0014] This implementation keeps the exposure ratio constant before and after switching HDR modes, making the HDR mode switching more natural and the image more consistent.

[0015] In one possible implementation, the exposure gain includes both analog and digital gain, controlling the exposure gain of the LOFIC HDR mode to increase as the light intensity decreases, and controlling the exposure ratio of the LOFIC HDR mode to decrease as the light intensity decreases, specifically including:

[0016] The analog gain of long frames in LOFIC HDR mode remains unchanged;

[0017] The analog gain controlling the short frames in LOFIC HDR mode increases as the light intensity decreases;

[0018] The digital gain controlling the LOFIC HDR mode increases as the light intensity decreases.

[0019] In this implementation, digital gain is increased to ensure image quality in low-light environments. Furthermore, since the analog gain remains unchanged for long frames, the signal-to-noise ratio drop in the transition areas between bright and dark parts of the image is significantly mitigated in LOFIC HDR mode.

[0020] In one possible implementation, when the light intensity is less than the first light intensity, the HDR mode is switched to the DAG HDR mode, specifically including:

[0021] The analog gain of the short frame in LOFIC HDR mode and the digital gain of LOFIC HDR mode are determined based on the light intensity. When the digital gain of LOFIC HDR mode is greater than the second preset gain, the HDR mode is switched to DAG HDR mode. The second preset gain is the digital gain of LOFIC HDR mode when the light intensity is the first light intensity. The exposure ratio is kept unchanged before and after the HDR mode switch.

[0022] In this implementation, as the illuminance decreases, the digital gain increases. When the digital gain is too high, it causes a decrease in the overall signal-to-noise ratio (SNR). When the digital gain exceeds the second preset gain corresponding to the first illuminance, the HDR mode is switched to ensure a high SNR across the entire image. Furthermore, by keeping the exposure ratio constant before and after the HDR mode switch, the HDR mode switch is made more natural, resulting in higher image consistency.

[0023] In one possible implementation, the exposure gain includes both analog and digital gain, controlling the exposure gain of the LOFIC HDR mode to increase as the light intensity decreases, and controlling the exposure ratio of the LOFIC HDR mode to decrease as the light intensity decreases, specifically including:

[0024] The rate of increase of the analog gain of the LOFIC HDR mode when the digital gain of the LOFIC HDR mode remains constant and when the analog gain of the short frame of the LOFIC HDR mode increases as the light intensity decreases is greater than the rate of increase of the analog gain of the long frame of the LOFIC HDR mode when the light intensity decreases.

[0025] When the analog gain of the long frame in LOFIC HDR mode is greater than the third preset gain, the analog gain of the long frame in LOFIC HDR mode remains unchanged, the analog gain of the short frame in LOFIC HDR mode increases as the light intensity decreases, and the digital gain of LOFIC HDR mode increases as the light intensity decreases.

[0026] This scheme performs two exposure gain adjustment processes sequentially as the light intensity gradually decreases. In the first exposure gain adjustment process, the digital gain of the LOFIC HDR mode remains constant, and the analog gain growth rate of the longer frames is made less than that of the shorter frames. In the second exposure gain adjustment process, the digital gain of the LOFIC HDR mode and the analog gain of the shorter frames are increased, while the analog gain of the longer frames remains constant.

[0027] Through the above two adjustment processes, before switching to HDR mode, the SNR dip in the transition area of ​​the image can be alleviated, and a significant drop in the signal-to-noise ratio in the dark areas of the image can be avoided. After switching to HDR mode, the SNR dip problem is alleviated, and abrupt changes in exposure ratio are avoided, making the HDR mode switch natural. In one possible implementation, when the light intensity is less than the first light intensity, the HDR mode is switched to DAG HDR mode, specifically including:

[0028] The analog gain and digital gain of the LOFIC HDR mode for short frames are determined based on the light intensity. When the digital gain of the LOFIC HDR mode is greater than the fourth preset gain, the HDR mode is switched to DAG HDR mode. The fourth preset gain is the digital gain of the LOFIC HDR mode when the light intensity is the first light intensity. The exposure ratio is kept unchanged before and after the HDR mode switch.

[0029] In this implementation, a large digital gain can cause a decrease in the overall signal-to-noise ratio (SNR). Therefore, when the digital gain exceeds the fourth preset gain corresponding to the first illumination intensity, the HDR mode is switched to ensure a high SNR across the entire image. Furthermore, by keeping the exposure ratio constant before and after the HDR mode switch, the HDR mode switch is made more natural, resulting in higher image consistency.

[0030] In one possible implementation, the exposure ratio remains unchanged before and after the HDR mode switch, specifically including:

[0031] When the maximum exposure ratio corresponding to the current exposure time is less than the exposure ratio before switching to HDR mode, the exposure time is reduced and the analog gain of the long frame of DAG HDR mode is increased to keep the exposure ratio unchanged before and after switching to HDR mode. The exposure time is negatively correlated with the maximum exposure ratio corresponding to the exposure time.

[0032] When the maximum exposure ratio at the current exposure time is less than the exposure ratio before switching to HDR mode, the exposure ratio can be adjusted by reducing the exposure time and increasing the analog gain of long frames. This can reduce the difference in image brightness before and after the mode switch while adjusting the exposure ratio of DAG HDR mode.

[0033] In one possible implementation, the method also includes:

[0034] Maintain consistent screen brightness before and after switching to HDR mode.

[0035] By controlling the brightness of the image before and after switching to HDR mode, the switching of HDR mode becomes more natural, further improving image consistency.

[0036] In one possible implementation, maintaining consistent screen brightness before and after HDR mode switching specifically includes:

[0037] The product of the exposure time before switching to HDR mode and the exposure gain of the long frame in LOFIC HDR mode is equal to the product of the exposure time after switching to HDR mode and the exposure gain of the long frame in DAG HDR mode.

[0038] The product of the exposure gain and exposure time of a long frame is the exposure amount corresponding to the long frame. By keeping the exposure amount of the long frame constant before and after mode switching, the brightness consistency of the image before and after mode switching is improved.

[0039] Secondly, this application also provides an electronic device that supports both LOFIC HDR mode and DAG HDR mode. The electronic device includes a processor and a memory, the memory storing a program that, when executed by the processor, performs the high dynamic range mode switching method provided in the first aspect and any implementation thereof. The electronic device can be a mobile phone, laptop computer, wearable electronic device (e.g., smartwatch, smart glasses), tablet computer, augmented reality (AR) device, virtual reality (VR) device, etc.

[0040] Thirdly, this application also provides a storage medium storing a computer program, which, when executed by an electronic device, implements the high dynamic range mode switching method provided by the first aspect and any implementation thereof.

[0041] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description

[0042] Figure 1 is a schematic diagram of the pixel circuit provided in an embodiment of this application;

[0043] Figure 2 is a schematic diagram of the image signal-to-noise ratio curves obtained by capacitors with different conversion gains as a function of illumination provided in the embodiments of this application;

[0044] Figure 3 is a schematic diagram of a scenario provided in an embodiment of this application;

[0045] Figure 4 is a flowchart of a high dynamic range mode switching method provided in an embodiment of this application;

[0046] Figure 5 is a flowchart of another high dynamic range mode switching method provided in an embodiment of this application;

[0047] Figure 6 is a flowchart of another high dynamic range mode switching method provided in an embodiment of this application;

[0048] Figure 7 is a schematic diagram of an electronic device provided in an embodiment of this application;

[0049] Figure 8 is an architecture diagram of the software system of the electronic device provided in the embodiments of this application. Detailed Implementation

[0050] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "a plurality of" means two or more.

[0051] To enable those skilled in the art to more clearly understand the solution of this application, the inventive concept of the technical solution of this application will first be described below. The electronic device in the embodiments of this application can be a mobile phone, tablet computer, personal digital assistant (PDA), or other electronic device. The embodiments of this application do not impose any special limitations on the specific form of this electronic device.

[0052] Dynamic range (DR), also known as exposure range, refers to the range of light intensity a camera can capture. For an image signal, it is the ratio of the maximum to the minimum value of a variable light signal. Currently, many electronic devices support HDR photography. HDR photography can capture and display the vast dynamic range of the real world, even with the limited dynamic range available in typical imaging sensors and display devices.

[0053] Currently, the HDR modes of electronic devices can be stagger HDR (SHDR) mode, LOFIC HDR mode, dual conversion gain (DCG) mode, and dual analog gain (DAG) mode, etc.

[0054] The following describes how electronic devices implement LOFIC HDR mode.

[0055] See Figure 1, which is a schematic diagram of the pixel circuit provided in this application.

[0056] The pixel circuitry used in LOFIC HDR mode incorporates a large-capacity well capacitor C. s C s Its capacity is greater than that of a typical well, C. FD In practical applications, the capacity of C s The capacity is generally C FD Its capacity is dozens of times that of other things.

[0057] Before exposure begins, switches TG, R, and S are turned on to reset C. s and C FD .

[0058] At this time, the reset noise N2 remains at C s and C FD .

[0059] In an integrating periodic device, the signal charge integrates at the photodiode (PD) until saturation is reached, and then the overflow charge is transferred to C through the switch TG. s and C FD That is, the overflow charge in C s and CFD Integrating at the point allows the overflow charge from the PD to be used for the signal.

[0060] After integration, switch S is turned off to turn C. s and C FD Isolate and allocate each C FD The charge makes the voltage of the FD circuit read out as signal N1. Then, by opening the switch TG, the signal charge is transferred from PD to FD, and the signal charge transferred from PD to FD is read out as signal S1+N1.

[0061] By turning on switch S, in PD, C s and C FD All signal charges at the point of integration in C s and C FD The mixture is then read out as a signal S2+N2.

[0062] C s and C FD A reset is performed by opening switches TG and R. Then, after closing switches R and T, the reset noise N2' for the next reset is read.

[0063] In summary, each pixel circuit reads out N1, S1+N1, S2+N2, and N2', thereby acquiring the high-sensitivity signal S1 and the high-well-capacity signal S2. Both S1 and S2 signals exhibit linear responses to incident light. From the working principle of the pixel circuit described above, it can be seen that C... FD The response has a higher signal-to-noise ratio in low-light scenes, but it is more prone to saturation, corresponding to high conversion gain (HCG). C s Its characteristic is that it has a low signal-to-noise ratio in low-light scenes, but it is not easy to reach saturation in strong-light scenes, and it can record more highlight information, corresponding to low conversion gain (LCG). For easy distinction, this voltage conversion gain is represented by LOFIC in the following description.

[0064] The pixel circuitry in LOFIC HDR mode increases C s This allows the CMOS to have two capacitors with different conversion gains. The two capacitors can achieve voltage conversion with different amplification factors. Combining the different voltage conversion gains, two signal outputs with different brightness are obtained. By fusing the two images, the dynamic range of the final image can be expanded, increasing the dynamic range of the current CMOS from 60dB to nearly 90dB.

[0065] Information about LOFIC HDR mode can be found in Table 1 below.

[0066] Table 1: Information Table for LOFIC HDR Mode

[0067] The different analog gains AG1 and AG2 are provided by a programmable gain amplifier (PGA).

[0068] Referring to Figure 2, this figure is a schematic diagram of the image signal-to-noise ratio as a function of illumination obtained by capacitors with different conversion gains according to the embodiments of this application.

[0069] Curve 1 and Curve 2 show the relationship between signal-to-noise ratio and illumination intensity when reading long frames.

[0070] Curve 3 shows the relationship between signal-to-noise ratio and light intensity when reading short frames.

[0071] The high-voltage conversion gains corresponding to curves 1 and 2 in the figure are different; the high-voltage conversion gain corresponding to curve 2 is 16 times that of curve 1.

[0072] When the light intensity is high, the required high voltage conversion gain is low, and the gain factor of curve 1 is used in this case.

[0073] Curve 1 and curve 3 intersect at point A. After activating LOFIC HDR mode, the signal-to-noise ratio (SNR) value to the left of intersection point A is determined by curve 1, and the SNR value to the right of intersection point A is determined by curve 3.

[0074] The intersection point A represents the transition region between the dark and bright areas. In one possible implementation, point A is represented by a short frame. Since the signal-to-noise ratio (SNR) of a short frame is significantly lower than that of a long frame, a layering problem in the SNR occurs in the transition region. That is, as shown in Figure 2, a drop in SNR from high to low can be observed near the transition region (also known as the fusion point). This phenomenon is called SNR dip. The extent of the SNR drop depends on the location of the intersection point of the two curves. When the SNR dip exceeds a certain value, the fused image exhibits significant noise inconsistencies.

[0075] When the ambient light intensity decreases, a higher voltage conversion gain is required, and the gain factor of curve 2 is used in this case. At this point, curves 2 and 3 intersect at point B. After activating LOFIC HDR mode, the signal-to-noise ratio (SNR) value to the left of point B is determined by curve 2, and to the right of point B, it is determined by curve 3. As shown in Figure 2, increasing the voltage conversion gain lowers the saturation point of the HCG curve, causing the intersection point B of curves 2 and 3 to shift to the left relative to intersection point A. This results in a significant increase in SNR drop, and the noise inconsistency problem is more pronounced in the transition region. In electronic device previews and video recording, this mode exhibits a significant SNR dip in low-light scenes, which will be explained in detail below with specific scenarios.

[0076] See Figure 3, which is a schematic diagram of the scenario provided in this application.

[0077] When a user shoots at night, the preview or captured image contains a bright area (10) and a dark area (20). Bright area 10 could be, for example, an illuminated streetlamp, while dark area 20 could be a non-illuminated object, such as a tree. As explained above, using the current LOFIC HDR mode, a noticeable SNR dip occurs in the transition area between bright area 10 and dark area 20, visually manifesting as increased noise in the transition area. Furthermore, the noise is more pronounced in low ambient light. For example, noise at night is more noticeable than at dusk, thus degrading the user's shooting experience.

[0078] Based on the above analysis, it is currently necessary to alleviate the SNR dip problem caused by LOFIC HDR mode in low-light conditions. This application provides a high dynamic range mode switching method and an electronic device storage medium that can gradually reduce the exposure ratio of LOFIC HDR mode as the light intensity decreases until LOFIC HDR mode switches to DAG HDR mode. This solution utilizes the characteristics of dual analog gain (DAG) HDR mode, significantly alleviating the SNR dip problem in low-light conditions. Furthermore, because the exposure ratio of LOFIC HDR mode is gradually reduced before switching, the sudden change in exposure ratio during the switching process is mitigated, resulting in higher image consistency before and after HDR mode switching and improving the user's shooting experience.

[0079] The DAG HDR mode will be introduced first below. Information about the DAG HDR mode can be found in Table 2 below.

[0080] Table 2: Information Table for LOFIC HDR Mode

[0081] The DAG HDR mode performs a single exposure and readout in two steps. Both the long and short frames are obtained using the same high conversion gain (HCG), but the two frames use different analog gains. One frame uses high analog gain (HAG), and the other uses low analog gain (LAG). The camera sensor simultaneously inputs both HAG-processed and LAG-processed frames into the chip platform's image processing module, where they are processed by an algorithm to generate a single frame. Because the long and short frames generated by DAG HDR mode use the same conversion gain, there is no significant SNR dip problem. This application's solution mitigates the SNR dip problem by switching the sensor's operating state from LOFIC HDR mode to DAG mode through mode switching.

[0082] In this embodiment of the application, in order to alleviate the SNR dip problem as much as possible, the following aspects need to be met:

[0083] 1. In LOFIC HDR mode, as light intensity decreases, the analog gain of long frames cannot be too high, otherwise it will cause a noticeable SNR dip in the transition area. Therefore, the exposure ratio needs to be properly controlled.

[0084] 2. Because the pixel circuitry in DAG HDR mode generally does not include C... s This means that the maximum exposure ratio in DAG HDR mode may be lower than that in LOFIC HDR mode. When switching from LOFIC HDR mode to DAG HDR mode, the analog gain of the longer frames in DAG HDR mode needs to be high enough to avoid a sudden change in the exposure ratio of DAG HDR mode compared to LOFIC HDR mode. The minimum analog gain of the shorter frames in DAG HDR mode is 1, so the maximum exposure ratio depends on the analog gain of the longer frames in DAG HDR mode.

[0085] 3. The image brightness does not change abruptly before and after mode switching.

[0086] The technical solutions provided in the embodiments of this application are described in detail below.

[0087] Referring to Figure 4, this figure is a flowchart of a high dynamic range mode switching method provided in an embodiment of this application.

[0088] The method includes the following steps:

[0089] S40: The automatic exposure control module adjusts the exposure ratio of the LOFIC HDR mode according to the light intensity to make the exposure ratio positively correlated with the light intensity.

[0090] The Automatic Exposure Control (AEC) module determines the dynamic range of the current scene. The AEC module performs light intensity measurement, scene analysis, and exposure compensation, which are explained below.

[0091] Dynamic range, also known as exposure range, refers to the range of light intensity captured by a camera.

[0092] The process of light intensity measurement is to obtain the current ambient light information by using the exposure information of an image.

[0093] Scene analysis refers to the processing performed to obtain information about the specific lighting conditions, such as whether there is backlighting or strong frontal lighting. Analyzing this information can improve the ease of use of the sensor and significantly enhance image quality, making it a crucial technology in automatic exposure.

[0094] After completing light intensity measurement and scene analysis, the AEC module can adjust the corresponding parameters to make the exposure adjustment effective, mainly by setting the exposure time and exposure gain.

[0095] At the same exposure time, the exposure ratio is the ratio of the exposure gain of the longer frame to the exposure gain of the shorter frame. Exposure gain includes analog gain and the digital gain of the digital image signal after the image signal processor (ISP) converts the electrical signal into a digital image signal. When the digital gain remains constant, the ratio of the analog gain of the longer frame to the analog gain of the shorter frame equals the exposure ratio. When an electronic device activates HDR mode, it increases the exposure gain to enhance the sensitivity of the image sensor to light when the ambient light intensity decreases.

[0096] In this embodiment, when the AEC module adjusts the exposure ratio of the LOFIC HDR mode according to the light intensity, the exposure ratio is positively correlated with the light intensity. That is, when the light intensity shows a decreasing trend, the exposure ratio also shows a decreasing trend.

[0097] In one possible implementation, light intensity is characterized by illuminance, with the unit of illuminance being lux.

[0098] In the technical solution of this application embodiment, in an HDR environment, when the light intensity decreases, in order to ensure image quality, the AEC module simultaneously increases the analog gain of both long frames and short frames, while ensuring that the growth rate of the analog gain of short frames is greater than the growth rate of the analog gain of long frames, thereby gradually reducing the exposure ratio. Specific examples can be found in Table 3 below.

[0099] Table 3: Changes in Gain and Exposure Ratio (Table 1)

[0100] The data in each row of Table 3, from top to bottom, are exposure time, simulated exposure gain for short frames, simulated exposure gain for long frames, and exposure ratio.

[0101] The data in Table 3, from left to right, show how the data changes as the light intensity gradually decreases in an HDR environment.

[0102] Taking LOFIC HDR mode as an example, the well capacity of the circuit when reading short frames is 24 times that when reading long frames. According to Table 3, it can be determined that the analog gain of short frames increases at a faster rate, causing the exposure ratio to decrease as the light intensity decreases.

[0103] S41: When the analog gain of a long frame is greater than the first preset gain and / or the light intensity is less than the first preset light intensity, switch the HDR mode from LOFIC HDR mode to DAG HDR mode.

[0104] In this embodiment, when the SNR dip in the transition area between the bright and dark parts of the image is severe, it is necessary to switch to HDR mode. Whether to switch to HDR mode can be determined based on the analog gain of the long frame and / or the light intensity, as explained in detail below.

[0105] In one possible implementation, the switch from LOFIC HDR mode to DAG HDR mode is determined based on the analog gain of the long frame. The analog gain of the long frame is gradually increased as the light intensity decreases. When the analog gain of the long frame increases to a level greater than a first preset gain, the HDR mode is switched from LOFIC HDR mode to DAG HDR mode. This embodiment does not specifically limit the first preset gain; in practical applications, the first preset gain can be pre-calibrated based on the specific shooting capabilities of the electronic device's camera. Taking a first preset gain of 8 as an example in Table 3, HDR mode switching occurs when the analog gain of the long frame is greater than 8. The gradual increase in the analog gain of the long frame corresponds to the gradual transition from curve 1 to curve 2 in Figure 2, with the SNR dip phenomenon becoming increasingly severe.

[0106] In another possible implementation, the switch from LOFIC HDR mode to DAG HDR mode is determined based on the light intensity. The analog gain of long frames is gradually increased as the light intensity decreases. When the light intensity is determined to be less than a first preset light intensity, the HDR mode is switched from LOFIC HDR mode to DAG HDR mode. This embodiment does not specifically limit the first preset light intensity; in practical applications, the first preset light intensity can be pre-calibrated based on the specific shooting capabilities of the electronic device's camera.

[0107] In another possible implementation, mode switching can be determined using either the analog gain or light intensity of the long frame. When a mode switch is deemed necessary based on either factor, it is initiated. For example, if the analog gain of the long frame is greater than a first preset gain, but the light intensity determination result has not yet been obtained, a mode switch can be initiated. Similarly, if the light intensity is determined to be less than a first preset light intensity, but the analog gain determination result has not yet been obtained, a mode switch can be initiated. This implementation uses the earliest obtained condition as the criterion, resulting in a faster response speed and higher sensitivity to mode switching.

[0108] In another possible implementation, the mode switching can be determined by the analog gain of the long frame and the light intensity. When the analog gain is greater than the first preset gain and the light intensity is less than the first preset light intensity, the HDR mode is switched from LOFIC HDR mode to DAG HDR mode. This implementation is more accurate.

[0109] The electronic device stores a first preset gain and a corresponding first preset light intensity, which are then recalled when needed.

[0110] S42: The AEC module adjusts the exposure ratio and exposure time of the DAG HDR mode.

[0111] To ensure a smooth transition between HDR modes, the brightness and exposure ratio of the image must remain constant before and after the HDR mode switch.

[0112] Specifically, when the exposure ratio of the DAG HDR mode differs from that of the LOFIC HDR mode, the AEC module will switch HDR modes. The exposure ratio of the LOFIC HDR mode will then be used as the exposure ratio of the DAG HDR mode after the HDR mode switch, and the analog gain for the long and short frames in the DAG HDR mode will be determined based on this exposure ratio. Furthermore, if the maximum exposure ratio at the current exposure time is less than the exposure ratio before the HDR mode switch, the exposure ratio can be adjusted by decreasing the exposure time and increasing the analog gain of the long frames.

[0113] Before mode switching, the analog gain of the short frame is 12 and the analog gain of the long frame is 8. When reading the short frame, the well capacity of the circuit is 24 times that when reading the long frame, so the exposure ratio R1 is 16.

[0114] When switching modes, to maximize the range of exposure ratio variations in DAG HDR mode and fully utilize its performance, the analog gain of short frames can be selected to a relatively small value. In this embodiment, the analog gain of short frames is set to the minimum value of 1. In this case, to maintain a constant exposure ratio, the analog gain of long frames in DAG HDR mode will be configured to 16.

[0115] To maintain consistent image brightness before and after mode switching, the exposure time can be shortened, that is, the image brightness can be reduced by shortening the exposure time from 20ms to 10ms.

[0116] The longer the exposure time, the more photons are captured in the charge-coupled device (CCD) or complementary metal-oxide-semiconductor (CMOS) phototransistor, resulting in a brighter image.

[0117] In this embodiment of the application, with the digital gain unchanged, the value of the product of the exposure time and the analog gain of the long frame remains unchanged before and after the mode switch. According to the data in Table 3, the value of the product of the exposure time and the analog gain of the long frame before the mode switch is 20*8=160, and the value of the product of the exposure time and the analog gain of the long frame after the mode switch is 10*16=160, thereby ensuring that the brightness of the image does not change before and after the mode switch.

[0118] Understandably, in practical applications, the AEC module can also ensure that the difference in exposure ratio before and after mode switching is within a first preset range, and the difference in image brightness is within a second preset range. This means that a small difference in exposure ratio and image brightness is allowed before and after HDR mode switching, reducing adjustment difficulty and increasing adjustment speed.

[0119] In summary, the technical solution provided in this application increases the analog gain of both long and short frames in the LOFIC HDR mode as light intensity gradually decreases, and makes the increase rate of the analog gain of short frames faster, thereby reducing the exposure ratio. When the analog gain of the long frame is greater than a first preset gain and / or the light intensity is less than a first preset light intensity, the HDR mode is switched from LOFIC HDR mode to DAG HDR mode. By switching the HDR mode, the SNR dip problem is alleviated. At this time, since the exposure ratio has been reduced in advance, the exposure ratio of LOFIC HDR mode will not be greater than the maximum exposure ratio of DAG HDR mode when switching modes. Therefore, DAG HDR mode can use the exposure ratio before the mode switch, thus avoiding a sudden change in the exposure ratio and making the HDR mode switch natural. In addition, by adjusting the exposure time, the brightness of the image before and after switching the HDR mode does not change suddenly, making the HDR mode switch more natural. Therefore, this solution can improve the user's photography experience.

[0120] The above embodiments illustrate how to adjust the analog gain of two frames before fusing them in HDR mode. The following describes how to first fuse the two frames in HDR mode, and then adjust the digital gain of the ISP to achieve a natural switching between HDR modes.

[0121] Referring to Figure 5, this figure is a flowchart of another high dynamic range mode switching method provided in an embodiment of this application.

[0122] The method includes the following steps:

[0123] S50: When the light intensity decreases, the AEC module increases the analog gain of the short frames in LOFIC HDR mode, maintains the analog gain of the short frames in LOFIC HDR mode unchanged, and increases the digital gain of LOFIC HDR mode.

[0124] The digital gain in LOFIC HDR mode refers to the gain of the digital image signal after the Image Signal Processor (ISP) converts the electrical signal into a digital image signal by merging two frames into one in LOFIC HDR mode.

[0125] The automatic exposure control module determines the dynamic range of the current scene. The AEC module can perform light intensity measurement, scene analysis, and exposure compensation.

[0126] The automatic exposure control module adjusts the exposure ratio in LOFIC HDR mode based on light intensity to ensure a positive correlation between the exposure ratio and light intensity. That is, the exposure ratio decreases as light intensity decreases. In one possible implementation, light intensity is characterized by illuminance, measured in lux.

[0127] In the technical solution of this application embodiment, in an HDR environment, as the light intensity gradually decreases, in order to ensure image quality, the AEC module simultaneously increases the analog gain of the short frames in the LOFIC HDR mode gradually while maintaining the analog gain of the short frames in the LOFIC HDR mode unchanged, thereby causing the exposure ratio to gradually decrease. Specific examples can be found in Table 4 below.

[0128] Table 4: Changes in Gain and Exposure Ratio (Table 2)

[0129] The data in each row of Table 4, from top to bottom, are: exposure time, the product of the analog exposure gain and the digital exposure gain of the short frame, the product of the analog exposure gain and the digital exposure gain of the long frame, and the exposure ratio.

[0130] The data in Table 4, from left to right, show how the data changes as the light intensity gradually decreases in an HDR environment.

[0131] Taking LOFIC HDR mode as an example, the circuit's well capacity is 24 times that of the circuit's well capacity when reading short frames is 24 times that when reading long frames. According to Table 4, it can be determined that the analog gain (i.e., sensor gain) of short frames increases at a faster rate, causing the exposure ratio to decrease as the light intensity decreases.

[0132] Once the two frames are fused, their analog gain can no longer be adjusted individually. Therefore, the digital gain of the long and short frames in Table 4 is the same. The digital gain also increases as the light intensity decreases.

[0133] S51: When the digital gain increases to a level greater than the second preset gain and / or the light intensity is less than the second preset light intensity, switch the HDR mode from LOFIC HDR mode to DAG HDR mode.

[0134] Because the technical solution of this application first fuses two frames of images and then increases the digital gain, and since the digital gain acts on the digital signal, increasing the digital gain will cause a decrease in the overall image signal-to-noise ratio. Therefore, when the overall image signal-to-noise ratio drops to a certain level, it is necessary to switch to HDR mode. Whether to switch to HDR mode can be determined based on the magnitude of the digital gain and the light intensity. This will be explained in detail below.

[0135] In one possible implementation, the decision to switch from LOFIC HDR mode to DAG HDR mode is determined based on the magnitude of the digital gain. As light intensity decreases, the digital gain gradually increases to ensure image quality, leading to a decrease in the overall signal-to-noise ratio (SNR). When the digital gain increases to a level greater than a second preset gain, it is considered that the decrease in the overall SNR caused by the digital gain is significant, necessitating a switch to HDR mode. This application does not specifically limit the second preset gain. In practical applications, the second preset gain can be pre-calibrated based on the specific shooting capabilities of the camera on the electronic device. Table 4 above uses a second preset gain of 8 as an example.

[0136] In another possible implementation, the switch from LOFIC HDR mode to DAG HDR mode is determined based on the light intensity. In this case, because the digital gain increases accordingly as the light intensity decreases, when the light intensity drops below a second preset light intensity, it is considered that the decrease in the overall signal-to-noise ratio caused by the digital gain is significant, necessitating a switch to HDR mode. This application does not specifically limit the second preset light intensity. In practical applications, the second preset light intensity can be pre-calibrated based on the specific shooting capabilities of the camera on the electronic device.

[0137] In another possible implementation, when it is determined that the gain is greater than the second preset gain or the light intensity is less than the second preset light intensity, the mode is switched. The switching condition obtained first is used as the criterion, which has a faster response speed and higher sensitivity to mode switching.

[0138] In another possible implementation, when the digital gain is increased to be greater than the second preset gain and the light intensity is less than the second preset light intensity, the HDR mode is switched from LOFIC HDR mode to DAG HDR mode. This implementation is more accurate in its judgment.

[0139] S52: The AEC module adjusts the exposure time and exposure ratio in DAG HDR mode.

[0140] To ensure a smooth transition between HDR modes, the brightness and exposure ratio of the image must remain constant before and after the HDR mode switch.

[0141] Specifically, when the exposure ratio of the DAG HDR mode differs from that of the LOFIC HDR mode, the AEC module will switch HDR modes. The exposure ratio of the LOFIC HDR mode will then be used as the exposure ratio of the DAG HDR mode after the HDR mode switch, and the analog gain corresponding to the long and short frames of the DAG HDR mode will be determined based on this exposure ratio. Furthermore, if the maximum exposure ratio at the current exposure time is less than the exposure ratio before the HDR mode switch, the exposure ratio can be adjusted by decreasing the exposure time and increasing the analog gain of the long frame. For example, if the maximum analog gain of the long frame corresponding to 20ms is 8, which corresponds to a maximum exposure ratio of 8, less than 16, adjusting the exposure time to 10ms will allow for a larger exposure ratio.

[0142] Before the mode switch, the analog gain of the long frames remains unchanged, and the analog gain of the long frames in Table 4 remains at 1. The analog gain of the short frames gradually increases, causing the exposure ratio to decrease before the mode switch.

[0143] When switching modes, to maximize the range of exposure ratio changes in DAG HDR mode and fully utilize its performance, the analog gain of short frames can be selected to a smaller value. In this embodiment, the analog gain of short frames is set to the minimum value of 1. To maintain a constant exposure ratio, the analog gain of long frames in DAG HDR mode is configured to 16. To maintain consistent image brightness before and after mode switching, the exposure time needs to be shortened, i.e., by reducing the exposure time from 20ms to 10ms to reduce image brightness.

[0144] In this embodiment, the analog gain of the long frame remains unchanged, and the product of the exposure time and the exposure gain of the LOFIC HDR mode is equal to the product of the exposure time of the DAG HDR mode and the exposure gain of the long frame after the mode switch, so that the brightness of the image does not change before and after the mode switch.

[0145] Referring to the data in Table 4, the product of exposure time and exposure gain before mode switching is 20 * 1 * 8 = 160.

[0146] After switching modes, the digital gain of DAG HDR mode is set to 1 by default. At this time, the product of the exposure time and the exposure gain of the long frame is 10*16*1=160.

[0147] Understandably, in practical applications, the AEC module can also ensure that the difference in exposure ratio before and after mode switching is within a first preset range, and the difference in image brightness is within a second preset range. This means that a small difference in exposure ratio and image brightness is allowed before and after HDR mode switching, reducing adjustment difficulty and increasing adjustment speed.

[0148] In summary, the technical solution provided in this application maintains the analog gain of the long frames in LOFIC HDR mode unchanged while increasing the exposure gain of the short frames in LOFIC HDR mode as the light intensity gradually decreases, thereby reducing the exposure ratio and increasing the digital gain of LOFIC HDR mode. When the digital gain increases to a level greater than the second preset gain and / or the light intensity is less than the second preset light intensity, the HDR mode is switched from LOFIC HDR mode to DAG HDR mode. By switching the HDR mode, the SNR dip problem is alleviated. Since the exposure ratio has been reduced in advance, abrupt changes in the exposure ratio are avoided, making the HDR mode switch natural. In addition, by adjusting the exposure time, the brightness of the image before and after switching the HDR mode does not change abruptly, making the HDR mode switch more natural. Therefore, this solution can improve the user's photography experience.

[0149] The above embodiments illustrate how to first fuse two frames of HDR images and then adjust the digital gain of the ISP to achieve a natural switching of HDR modes. The following describes how to adjust the analog gain of each frame before fusing them, and how to adjust the digital gain of the ISP after fusing them to achieve a natural switching of HDR modes.

[0150] Referring to Figure 6, this figure is a flowchart of another high dynamic range mode switching method provided in an embodiment of this application.

[0151] The method includes the following steps:

[0152] S60: When the light intensity decreases, the AEC module maintains the digital gain of the LOFIC HDR mode, increases the analog gain of the long and short frames of the LOFIC HDR mode, and reduces the exposure ratio of the LOFIC HDR mode.

[0153] In LOFIC HDR mode, there are two exposure gain adjustment processes. In the first exposure gain adjustment process, the digital gain of LOFIC HDR mode remains unchanged, while the analog gain of both long and short frames in LOFIC HDR mode is increased, and the exposure ratio of LOFIC HDR mode is decreased.

[0154] When the AEC module adjusts the exposure ratio of LOFIC HDR mode according to the light intensity, the exposure ratio is positively correlated with the light intensity. That is, when the light intensity decreases, the exposure ratio also decreases.

[0155] In one possible implementation, the analog gain of the shorter frames increases at a greater rate than that of the longer frames, thus gradually reducing the exposure ratio. See Table 5 below for specific examples.

[0156] Table 5: Changes in Gain and Exposure Ratio (Table 3)

[0157] The data in each row of Table 5, from top to bottom, are: exposure time, the product of the analog exposure gain and the digital exposure gain of the short frame, the product of the analog exposure gain and the digital exposure gain of the long frame, and the exposure ratio.

[0158] The data in Table 5, from left to right, show how the data changes as the light intensity gradually decreases in an HDR environment.

[0159] Taking LOFIC HDR mode as an example, where the circuit's well capacity is 24 times that of the circuit's well capacity when reading short frames is 24 times that when reading long frames, Table 5 shows that during the first exposure gain adjustment process, the digital gain remains constant at 1, and the analog gain growth rate of short frames is greater than that of long frames, thus gradually reducing the exposure ratio.

[0160] S61: When the analog gain of the long frame is greater than the third preset gain and / or the light intensity is less than the third preset light intensity, the AEC module increases the digital gain of the LOFIC HDR mode and the analog gain of the short frame, while keeping the analog gain of the long frame unchanged.

[0161] In this embodiment, when the SNR dip in the transition area between bright and dark areas of the image is large, the first exposure gain adjustment process ends and the second exposure gain adjustment process begins. Whether to end the first exposure gain adjustment process can be determined based on the analog gain magnitude and / or light intensity of the long frame.

[0162] In one possible implementation, the decision to end the first exposure gain adjustment process is determined based on the magnitude of the analog gain of the long frame. This application does not specifically limit the third preset gain; in practical applications, the third preset gain can be pre-calibrated according to the specific shooting capabilities of the electronic device's camera. Taking a third preset gain of 4 as an example in Table 5, when the analog gain of the long frame is greater than 4, the first exposure gain adjustment process ends, and the analog gain of the long frame remains unchanged thereafter. The gradual increase in the analog gain of the long frame corresponds to the gradual transition from curve 1 to curve 2 in Figure 2, where the SNR dip phenomenon gradually becomes more severe.

[0163] In another possible implementation, the switch from LOFIC HDR mode to DAG HDR mode is determined based on the light intensity. This application embodiment does not specifically limit the third preset light intensity; in practical applications, the third preset light intensity can be pre-calibrated according to the specific shooting capabilities of the electronic device's camera. In this application embodiment, the third preset light intensity is the light intensity when the AEC module adjusts the analog gain of the long frame to 4.

[0164] In another possible implementation, the magnitude of the analog gain or the intensity of light within a long frame can be used to determine whether to end the first exposure gain adjustment process. This implementation uses the earliest acquired conditions as the criterion, resulting in a faster response speed and higher sensitivity.

[0165] In another possible implementation, the analog gain of a long frame and the light intensity can be used to make a judgment. When the analog gain is greater than the first preset gain and the light intensity is less than the first preset light intensity, the first exposure gain adjustment process ends. This implementation is more accurate in its judgment.

[0166] After the first exposure gain adjustment process is completed, the second exposure gain adjustment process begins. During the second exposure gain adjustment process, the AEC module increases the digital gain of the LOFIC HDR mode and the analog gain of short frames, while keeping the analog gain of long frames unchanged.

[0167] S62: When the digital gain increases to a level greater than the fourth preset gain and / or the light intensity is less than the fourth preset light intensity, switch the HDR mode from LOFIC HDR mode to DAG HDR mode.

[0168] Digital gain acts on digital signals. Increasing the digital gain will cause a decrease in the overall signal-to-noise ratio (SNR). Therefore, when the overall SNR drops to a certain level, it is necessary to switch to HDR mode. Whether to switch to HDR mode can be determined based on the magnitude of the digital gain and the light intensity. This will be explained in detail below.

[0169] In one possible implementation, the decision to switch from LOFIC HDR mode to DAG HDR mode is determined based on the magnitude of the digital gain. As light intensity decreases, the digital gain gradually increases to ensure image quality, leading to a decrease in the overall signal-to-noise ratio (SNR). When the digital gain increases to a level greater than a fourth preset gain, it is considered that the decrease in the overall SNR caused by the digital gain is significant, necessitating a switch to HDR mode. This application does not specifically limit the fourth preset gain. In practical applications, the fourth preset gain can be pre-calibrated based on the specific shooting capabilities of the camera on the electronic device. Table 5 above uses a fourth preset gain of 2 as an example.

[0170] In another possible implementation, the decision to switch from LOFIC HDR mode to DAG HDR mode is determined based on the light intensity. In this case, because the digital gain increases as the light intensity decreases, when the light intensity drops below a fourth preset light intensity, the decrease in the overall signal-to-noise ratio caused by the digital gain is considered significant, necessitating a switch to HDR mode. This embodiment does not specifically limit the fourth preset light intensity. In practical applications, the fourth preset light intensity can be pre-calibrated based on the specific shooting capabilities of the camera on the electronic device.

[0171] In another possible implementation, when the gain is determined to be greater than the fourth preset gain or the light intensity is less than the fourth preset light intensity, the mode is switched. The switching condition obtained first is used as the criterion, which has a faster response speed and higher sensitivity to mode switching.

[0172] In another possible implementation, when the digital gain is increased to be greater than the fourth preset gain and the light intensity is less than the fourth preset light intensity, the HDR mode is switched from LOFIC HDR mode to DAG HDR mode. This implementation is more accurate in its judgment.

[0173] S63: The AEC module adjusts the exposure time and exposure ratio in DAG HDR mode.

[0174] To ensure a smooth transition between HDR modes, the brightness and exposure ratio of the image must remain constant before and after the HDR mode switch.

[0175] Specifically, when the exposure ratio of the DAG HDR mode differs from that of the LOFIC HDR mode, the AEC module will switch HDR modes. During this switch, the exposure ratio of the LOFIC HDR mode will be used as the exposure ratio of the DAG HDR mode after the HDR mode switch, and the analog gain corresponding to the long and short frames of the DAG HDR mode will be determined based on this exposure ratio. Furthermore, if the maximum exposure ratio at the current exposure time is less than the exposure ratio before the HDR mode switch, the exposure ratio can be adjusted by decreasing the exposure time and increasing the analog gain of the long frames.

[0176] To maximize the exposure ratio variation range of the DAG HDR mode and fully utilize its performance, the analog gain of short frames can be selected to a relatively small value. In this embodiment, the analog gain of the short frames is set to the minimum value of 1. In this case, to maintain a constant exposure ratio, the analog gain of the long frames in the DAG HDR mode is configured to 16. To maintain consistent image brightness before and after mode switching, the exposure time needs to be shortened, i.e., by reducing the exposure time from 20ms to 10ms to reduce image brightness.

[0177] In this embodiment, the product of the exposure time and the exposure gain of the LOFIC HDR mode is equal to the product of the exposure time of the DAG HDR mode and the exposure gain of the long frame after the mode switch, so that the brightness of the image does not change before and after the mode switch.

[0178] Referring to the data in Table 5, the product of exposure time and exposure gain before mode switching is 20*4*2=160.

[0179] After switching modes, the digital gain of DAG HDR mode is set to 1 by default. At this time, the product of the exposure time and the exposure gain of the long frame is 10*16*1=160.

[0180] Understandably, in practical applications, the AEC module can also ensure that the difference in exposure ratio before and after mode switching is within a first preset range, and the difference in image brightness is within a second preset range. This means that a small difference in exposure ratio and image brightness is allowed before and after HDR mode switching, reducing adjustment difficulty and increasing adjustment speed.

[0181] In summary, the technical solution provided in this application performs two exposure gain adjustment processes sequentially as the light intensity gradually decreases. In the first exposure gain adjustment process, the digital gain of the LOFIC HDR mode remains constant, and the analog gain growth rate of the long frame is less than that of the short frame. In the second exposure gain adjustment process, the digital gain of the LOFIC HDR mode and the analog gain of the short frame are increased, while the analog gain of the long frame remains constant. Through these two adjustment processes, before switching to HDR mode, the SNR dip in the transition area of ​​the image is alleviated, and a significant decrease in the signal-to-noise ratio in the dark areas of the image is avoided. After switching to HDR mode, the SNR dip problem is alleviated. Since the exposure ratio has already been lowered in advance, the exposure ratio of the LOFIC HDR mode will not exceed the maximum exposure ratio of the DAG HDR mode during mode switching. Therefore, the DAG HDR mode can use the exposure ratio before mode switching, avoiding abrupt changes in exposure ratio and making the HDR mode switch natural. Furthermore, by adjusting the exposure time, the image brightness before and after switching to HDR mode does not change abruptly, making the HDR mode switch more natural. Therefore, this solution can improve the user's photography experience.

[0182] Based on the high dynamic range mode switching method provided in the above embodiments, this application also provides an electronic device, which will be described in detail below with reference to the accompanying drawings.

[0183] The electronic devices provided in this application embodiment can be mobile phones, laptops, wearable electronic devices (such as smartwatches and smart glasses), tablets, AR devices, or VR devices, etc. The following description uses a mobile phone as an example.

[0184] Referring to Figure 7, this figure is a schematic diagram of an electronic device provided in an embodiment of this application.

[0185] The electronic device 100 includes a processor 110, a camera 120, a display screen 130, a sensor module 140, and an internal storage area 150. The sensor module 140 may include a color temperature sensor 141, and may also include other types of sensors.

[0186] The processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and a neural network processing unit (NPU).

[0187] Electronic device 100 can perform shooting functions through an image signal processor (ISP), camera 120, video codec, GPU, display screen 130, and application processor.

[0188] The ISP (Image Signal Processor) is used to process data fed back from the camera 120. For example, during shooting, when the shutter is opened, light is transmitted through the lens to the camera's image sensor. The light signal is converted into an electrical signal, and the image sensor transmits the electrical signal to the ISP for processing, converting it into an image visible to the eyes. 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 integrated into the camera 120.

[0189] Camera 120 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element 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 multiple cameras.

[0190] The color temperature sensor 141 is used to sense the ambient color temperature and illuminance, thereby enabling electronic devices to perform automatic exposure control based on the detection results.

[0191] Internal memory 150 can be used to store computer executable program code, which includes instructions. Internal memory 150 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. Furthermore, internal memory 150 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 implements the high dynamic range mode switching method in the above embodiments by executing instructions stored in internal memory 150 and / or instructions stored in memory disposed in the processor.

[0192] It is understood that the structures illustrated in the embodiments of the present invention 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.

[0193] The software system of the electronic device is described below with reference to the accompanying drawings.

[0194] Referring to Figure 8, this figure is an architecture diagram of the software system of the electronic device provided in the embodiments of this application.

[0195] This application uses the layered architecture of the Android system as an example to illustrate the software structure of an electronic device.

[0196] A layered architecture divides software into several layers, which communicate with each other through software interfaces. In some embodiments, the Android system, from top to bottom, consists of the application layer, the application framework layer, the system runtime library layer, the hardware abstraction layer (HAL), and the kernel layer (Linux Kernel). For ease of understanding, the hardware layer is also illustrated in the diagram.

[0197] The application layer can include a series of application packages. Both built-in system applications and non-system applications belong to the application layer and are responsible for direct interaction with the user. For example, it can include a camera app.

[0198] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0199] The system runtime library layer mainly includes the Android runtime library and program libraries (Native C / C++ Libraries), which can provide camera services.

[0200] The Hardware Abstraction Layer (HAL) is a routine package in the software layer. It is an interface layer located between the operating system kernel and the hardware circuitry. Its purpose is to abstract the hardware and simulate the details of a specific system platform so that programs can directly access hardware resources.

[0201] The hardware abstraction layer includes the CAMX-CHI architecture, which provides the HAL3 interface for the Camera Provider to call, receives requests from the Camera Provider, implements the HAL3 interface internally, and controls the camera driver layer through the V4L2 standard framework, sends requests to the driver part, waits for the results to be returned, and then reports to the Camera Provider.

[0202] The CAMX-CHI architecture consists of two parts: CAMX and the camera hardware interface (CHI) - camera development kit (CDK).

[0203] CAMX is responsible for implementing the basic service code. CAMX mainly includes the csl module, which implements the interaction with the driver; swl, which implements the software node and enables automatic exposure control (AEC); and sensorNode, which generates sensor configuration instructions. csl is the communication module responsible for implementing communication between CAMX and the driver layer.

[0204] CHI-CDK is responsible for fulfilling scalability and customization needs, making it easy for original equipment manufacturers (OEMs) and original design manufacturers (ODMs) to add their own extended functions.

[0205] The module in the OEM module stores configuration files for different sensors, which are needed when initializing the sensors.

[0206] The EEPROM module in the OEM module stores the configuration information of the electrically erasable programmable read-only memory (EEPROM).

[0207] The sensor module in the OEM module stores the register configuration parameters for each sensor mode. For example, it can store configuration parameters related to LOFIC HDR mode and DAG HDR mode.

[0208] The Linux kernel is the layer between hardware and software. It contains at least basic Linux drivers, such as V2L2, and also device drivers, such as sensor drivers. The camera request management (CRM) shown in the diagram is used to manage camera configuration requests.

[0209] When a user opens the camera app for previewing or recording video, the electronic device can determine whether to enable HDR mode based on the dynamic range of the current environment. The electronic device can support LOFIC HDR mode and DAG HDR mode. Furthermore, the electronic device may also support other HDR modes, but this embodiment does not specifically limit the specific HDR modes supported.

[0210] Because the LOFIC HDR mode has a wider dynamic range than the DAG HDR mode, electronic devices first adopt the LOFIC HDR mode.

[0211] As ambient light intensity gradually decreases, the solution described in the above method embodiments switches the LOFIC HDR mode to DAG HDR mode, alleviating the SNR dip problem. Furthermore, by adjusting the exposure time, the image brightness before and after switching HDR modes does not change abruptly, making the HDR mode switch more natural. Therefore, this electronic device enhances the user's shooting experience.

[0212] This application also provides a storage medium storing a program that, when executed by a processor, implements the high dynamic range mode selection method described in the above embodiments.

[0213] Readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically-erasable programmable read-only memory (EEPROM), flash memory, or other memory technologies.

[0214] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for switching high dynamic range modes, characterized in that, The method, applied to an electronic device that supports overflow-capacitor (LOFIC) high dynamic range (HDR) mode and dual analog gain (DAG) HDR mode, comprises: Launch the camera's operating program; Obtain the light intensity of the environment in which the electronic device is located; Enable the LOFIC HDR mode; When the light intensity drops below the first light intensity, the HDR mode is switched to the DAG HDR mode.

2. The method according to claim 1, characterized in that, When the light intensity is greater than or equal to the first light intensity, the method further includes: When the light intensity decreases, the exposure gain of the LOFIC HDR mode increases as the light intensity decreases, and the exposure ratio of the LOFIC HDR mode decreases as the light intensity decreases.

3. The method according to claim 2, characterized in that, The exposure gain includes analog gain and digital gain. The control of the exposure gain in the LOFIC HDR mode increases as the light intensity decreases, and the control of the exposure ratio in the LOFIC HDR mode decreases as the light intensity decreases, specifically including: The digital gain of the LOFIC HDR mode remains unchanged; The rate of increase of the analog gain of the short frame in the LOFIC HDR mode as the light intensity decreases is greater than the rate of increase of the analog gain of the long frame in the LOFIC HDR mode as the light intensity decreases.

4. The method according to claim 3, characterized in that, The step of switching the HDR mode to the DAG HDR mode when the light intensity is less than the first light intensity specifically includes: The analog gain of the short frame in the LOFIC HDR mode and the analog gain of the short frame in the LOFIC HDR mode are determined based on the light intensity. When the analog gain of the long frame is greater than the first preset gain, the HDR mode is switched to the DAG HDR mode. The first preset gain is the analog gain of the short frame in the LOFIC HDR mode when the light intensity is the first light intensity. The exposure ratio remains unchanged before and after switching to HDR mode.

5. The method according to claim 2, characterized in that, The exposure gain includes analog gain and digital gain. The control of the exposure gain in the LOFIC HDR mode increases as the light intensity decreases, and the control of the exposure ratio in the LOFIC HDR mode decreases as the light intensity decreases, specifically including: The analog gain of long frames in the LOFIC HDR mode remains unchanged; The analog gain of the short frames in the LOFIC HDR mode increases as the light intensity decreases; The digital gain of the LOFIC HDR mode increases as the light intensity decreases.

6. The method according to claim 5, characterized in that, The step of switching the HDR mode to the DAG HDR mode when the light intensity is less than the first light intensity specifically includes: The analog gain of the short frame in LOFIC HDR mode and the digital gain of the LOFIC HDR mode are determined based on the light intensity. When the digital gain of the LOFIC HDR mode is greater than the second preset gain, the HDR mode is switched to the DAG HDR mode. The second preset gain is the digital gain of the LOFIC HDR mode when the light intensity is the first light intensity. The exposure ratio remains unchanged before and after switching to HDR mode.

7. The method according to claim 2, characterized in that, The exposure gain includes analog gain and digital gain. The control of the exposure gain in the LOFIC HDR mode increases as the light intensity decreases, and the control of the exposure ratio in the LOFIC HDR mode decreases as the light intensity decreases, specifically including: The digital gain of the LOFIC HDR mode is kept constant, and the rate of increase of the analog gain of the short frame of the LOFIC HDR mode as the light intensity decreases is greater than the rate of increase of the analog gain of the long frame of the LOFIC HDR mode as the light intensity decreases. When the analog gain of the long frame in the LOFIC HDR mode is greater than the third preset gain, the analog gain of the long frame in the LOFIC HDR mode remains unchanged, the analog gain of the short frame in the LOFIC HDR mode increases as the light intensity decreases, and the digital gain of the LOFIC HDR mode increases as the light intensity decreases.

8. The method according to claim 7, characterized in that, The step of switching the HDR mode to the DAG HDR mode when the light intensity is less than the first light intensity specifically includes: The analog gain of the short frame in LOFIC HDR mode and the digital gain of the LOFIC HDR mode are determined based on the light intensity. When the digital gain of the LOFIC HDR mode is greater than the fourth preset gain, the HDR mode is switched to the DAG HDR mode. The fourth preset gain is the digital gain of the LOFIC HDR mode when the light intensity is the first light intensity. The exposure ratio remains unchanged before and after switching to HDR mode.

9. The method according to claim 4, 6, or 8, characterized in that, The control of keeping the exposure ratio unchanged before and after switching HDR modes specifically includes: When the maximum exposure ratio corresponding to the current exposure time is less than the exposure ratio before the HDR mode switch, the exposure time is reduced and the analog gain of the long frame of the DAG HDR mode is increased to keep the exposure ratio unchanged before and after the HDR mode switch. The exposure time is negatively correlated with the maximum exposure ratio corresponding to the exposure time.

10. The method according to any one of claims 1-9, characterized in that, The method further includes: Maintain consistent screen brightness before and after switching to HDR mode.

11. The method according to claim 10, characterized in that, The control of maintaining consistent screen brightness before and after HDR mode switching specifically includes: The product of the exposure time before switching to HDR mode and the exposure gain of the long frame in LOFIC HDR mode is equal to the product of the exposure time after switching to HDR mode and the exposure gain of the long frame in DAG HDR mode.

12. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory being used to store a program that, when executed by the processor, performs the high dynamic range mode switching method according to any one of claims 1-11.

13. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by an electronic device, implements the high dynamic range mode switching method according to any one of claims 1-11.