Method for improving image quality based on dynamic exposure proportion and camera
By analyzing the brightness characteristics and gradient values of historical short-exposure images, the exposure ratio and fusion parameters are dynamically adjusted, which solves the shortcomings of the fixed exposure ratio strategy, improves image quality and adaptability, and reduces halo artifacts and noise blur.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, fixed exposure ratio strategies cannot adapt to complex and ever-changing imaging environments, resulting in insufficient utilization of dynamic range or unnatural over-HDR effects. Furthermore, they lack fine-grained processing of saturated areas in short-exposure images, leading to issues such as halo artifacts and noise blurring.
By analyzing the brightness characteristics, saturation region ratio, and average gradient value of historical short-exposure images, the exposure ratio is dynamically adjusted, and long and short exposure images are fused together in combination with scene type to optimize the exposure ratio and fusion parameters.
It improves image quality in multi-modal imaging environments, adapts to different scene requirements, reduces halo artifacts and noise blur, and improves the dynamic range and detail fidelity of images.
Smart Images

Figure CN121815094A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of imaging technology, and in particular to a method and camera for improving HDR image quality based on dynamic exposure ratio. Background Technology
[0002] High Dynamic Range (HDR) imaging technology expands the dynamic range of an image by fusing images with different exposure times, thereby preserving shadow details in bright light and suppressing highlight overexposure in low light.
[0003] In related technologies, a fixed exposure ratio is typically used to capture long and short exposure images, and fusion is performed based on simple full-image brightness statistics. However, the fixed exposure ratio strategy lacks the ability to perceive scene content and cannot adapt to complex and varied imaging environments, such as low-light indoor environments to high-contrast outdoor environments. This can easily lead to insufficient utilization of dynamic range or produce unnatural effects of excessive HDR. Summary of the Invention
[0004] This application provides a method and camera for improving HDR image quality based on dynamic exposure ratio. This method dynamically adjusts the exposure ratio based on scene content, thereby adapting to various complex and changing imaging environments and ultimately improving image quality. The technical solution is as follows:
[0005] According to a first aspect of the embodiments of this application, a method for improving image quality based on dynamic exposure ratio is provided, comprising:
[0006] Acquire historical short-exposure images;
[0007] The historical short-exposure images are analyzed to obtain brightness features, saturation region proportions, and average gradient values.
[0008] The scene type corresponding to the historical short exposure image is identified based on the brightness features, the saturation region ratio, and the average gradient value.
[0009] The target exposure ratio is obtained by processing the scene type, the brightness feature, the saturation region ratio, and the average gradient value.
[0010] Based on the target exposure ratio, long exposure images and short exposure images are obtained;
[0011] The target image is obtained by fusing the long exposure image and the short exposure image based on the scene type.
[0012] In one possible implementation, analyzing the historical short-exposure image to obtain brightness features, saturation region proportions, and average gradient values includes:
[0013] The brightness characteristics are obtained by performing brightness analysis on the historical short-exposure images;
[0014] The saturation analysis is performed on the historical short-exposure image to obtain the proportion of the saturated region;
[0015] The average gradient value is obtained by performing gradient detection on the historical short-exposure images.
[0016] In one possible implementation, performing saturation analysis on the historical short-exposure image to obtain the saturation region ratio includes:
[0017] Saturation analysis is performed on each pixel in the historical short-exposure image to determine multiple saturated pixels;
[0018] Obtain the position of each of the saturated pixels;
[0019] Based on the positions of the multiple saturated pixels, at least one saturated region is determined;
[0020] The saturation region ratio is obtained by processing the at least one saturated region and the historical short-exposure image.
[0021] In one possible implementation, processing the scene type, the brightness feature, the saturation region ratio, and the average gradient value to obtain the target exposure ratio includes:
[0022] The initial exposure ratio is obtained by processing the scene type and the saturation region ratio;
[0023] The initial exposure ratio is adjusted based on the brightness characteristics and the average gradient value to obtain the target exposure ratio.
[0024] In one possible implementation, adjusting the initial exposure ratio based on the brightness feature and the average gradient value to obtain the target exposure ratio includes:
[0025] The initial exposure ratio is adjusted based on the brightness characteristics to obtain the intermediate exposure ratio;
[0026] The target exposure ratio is obtained by adjusting the intermediate exposure ratio based on the average gradient value.
[0027] In one possible implementation, the brightness feature includes brightness skewness;
[0028] The step of adjusting the initial exposure ratio based on the brightness characteristics to obtain the intermediate exposure ratio includes:
[0029] Obtain the preset positive skewness threshold and the preset negative skewness threshold;
[0030] If the brightness skewness is greater than the preset positive skewness threshold, a first brightness coefficient is generated; the first brightness coefficient and the initial exposure ratio are multiplied to obtain the intermediate exposure ratio;
[0031] Alternatively, if the brightness bias is less than the preset negative bias threshold, a second brightness coefficient is generated; the second brightness coefficient and the initial exposure ratio are multiplied to obtain the intermediate exposure ratio;
[0032] Alternatively, if the brightness deviation is not less than the preset negative deviation threshold and not greater than the preset positive deviation threshold, a third brightness coefficient is generated; the third brightness coefficient and the initial exposure ratio are multiplied to obtain the intermediate exposure ratio.
[0033] In one possible implementation, adjusting the intermediate exposure ratio based on the average gradient value to obtain the target exposure ratio includes:
[0034] Obtain the first preset gradient threshold, the second preset gradient threshold, and the third preset gradient threshold;
[0035] If the average gradient value is less than the first preset gradient threshold, a first gradient coefficient is generated; the first gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio.
[0036] If the average gradient value is not less than the second preset gradient threshold and not greater than the second preset gradient threshold, then a second gradient coefficient is generated; the second gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio.
[0037] If the average gradient value is greater than the second preset gradient threshold and not greater than the third preset gradient threshold, then a third gradient coefficient is generated; the third gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio.
[0038] Alternatively, if the average gradient value is greater than the third preset gradient threshold, a fourth gradient coefficient is generated; the fourth gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio;
[0039] The average gradient value characterizes the sharpness and texture complexity of the historical short-exposure image; the first gradient coefficient > the second gradient coefficient > the third gradient coefficient > the fourth gradient coefficient.
[0040] In one possible implementation, the method further includes:
[0041] When the scene type is an indoor low-light scene, the texture complexity value of each saturated region is obtained; when the proportion of the saturated region is less than a preset proportion threshold and the texture complexity value is less than a preset complexity threshold, the first preset proportion parameter, the target exposure ratio, and the preset texture parameter are multiplied to obtain the local exposure ratio of the saturated region; or when the proportion of the saturated region is not less than the preset proportion threshold and the texture complexity value is not less than the preset complexity threshold, the second preset proportion parameter and the target exposure ratio are multiplied to obtain the local exposure ratio of the saturated region.
[0042] Alternatively, when the scene type is an outdoor high-contrast scene, the edge intensity value and contrast value of each saturated region are obtained; if the edge intensity value of the saturated region is higher than a preset edge intensity threshold and the contrast value is greater than a preset contrast value, the first preset edge coefficient, the target exposure ratio, and the preset contrast coefficient are multiplied to obtain the local exposure ratio of the saturated region; or if the edge intensity value of the saturated region is not higher than the preset edge intensity threshold and the contrast value is not greater than the preset contrast value, the second preset edge coefficient and the target exposure ratio are multiplied to obtain the local exposure ratio of the saturated region.
[0043] Alternatively, when the scene type is a backlit portrait scene, the subject area and the background area are obtained; the subject area is provided with preset subject parameters, and the background area is provided with preset subject parameters; the preset subject parameters are multiplied by the target exposure ratio to obtain the local exposure ratio of the subject area; the preset background parameters are multiplied by the target exposure ratio to obtain the local exposure ratio of the background area.
[0044] In one possible implementation, the step of fusing the long-exposure image and the short-exposure image based on the scene type to obtain the target image includes:
[0045] Acquire a first noise level and motion level of the short-exposure image, and a second noise level and motion blur level of the long-exposure image;
[0046] The first noise level, the motion level, the second noise level, and the motion blur level are processed to obtain initial fusion parameters;
[0047] Select an adjustment strategy based on the scenario type;
[0048] Based on the adjustment strategy and the initial fusion parameters, the target fusion parameters are obtained;
[0049] The target image is obtained by fusing the long exposure image and the short exposure image based on the target fusion parameters.
[0050] According to a second aspect of the embodiments of this application, a camera for improving image quality based on dynamic exposure ratio is provided, comprising:
[0051] The acquisition module is used to acquire historical short-exposure images;
[0052] The analysis module is used to analyze the historical short-exposure images to obtain brightness features, saturation region ratios, and average gradient values.
[0053] The identification module is used to identify the scene type corresponding to the historical short exposure image based on the brightness features, the saturation region ratio, and the average gradient value.
[0054] The processing module is used to process the scene type, the brightness feature, the saturation region ratio, and the average gradient value to obtain the target exposure ratio;
[0055] The shooting module is used to take pictures based on the target exposure ratio to obtain long exposure images and short exposure images;
[0056] The fusion module is used to fuse the long exposure image and the short exposure image based on the scene type to obtain the target image.
[0057] According to a third aspect of the present application, a computer device is provided, the computer device including a processor and a memory, the memory being used to store at least one program, the at least one program being loaded by the processor and executed as described in the method for improving image quality based on dynamic exposure ratio.
[0058] According to a fourth aspect of the present application, a computer-readable storage medium is provided, wherein at least one program is stored in the computer-readable storage medium, the at least one program being loaded and executed by a processor to implement the method for improving image quality based on dynamic exposure ratio.
[0059] In embodiments of this application, the scene type corresponding to a historical short-exposure image is identified based on brightness features, saturation region ratio, and average gradient value; the scene type, brightness features, saturation region ratio, and average gradient value are processed to obtain a target exposure ratio; a long-exposure image and a short-exposure image are captured based on the target exposure ratio; and the long-exposure image and the short-exposure image are fused based on the scene type to obtain the target image. Compared to related technologies that use a fixed exposure ratio to capture long and short-exposure images, the technical solution of this application dynamically adjusts the exposure ratio through scene type, brightness features, saturation region ratio, and average gradient value. This not only adapts to complex and changing imaging environments but also fully utilizes the dynamic range, thereby improving the quality of the target image. Attached Figure Description
[0060] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0061] Figure 1 This is a schematic diagram of an implementation environment provided according to an embodiment of this application;
[0062] Figure 2 This is a flowchart illustrating a method for improving image quality based on dynamic exposure ratio performed by an HDR camera according to an embodiment of this application.
[0063] Figure 3 This is a flowchart illustrating step S202 performed by an HDR camera according to an embodiment of this application;
[0064] Figure 4 This is a flowchart illustrating step S2021 performed by an HDR camera according to an embodiment of this application;
[0065] Figure 5 This is a flowchart illustrating step S2022 performed by an HDR camera according to an embodiment of this application;
[0066] Figure 6 This is a flowchart illustrating step S204 performed by an HDR camera according to an embodiment of this application;
[0067] Figure 7 This is a flowchart illustrating step S2041 performed by an HDR camera according to an embodiment of this application;
[0068] Figure 8This is a flowchart illustrating step S2042 performed by an HDR camera according to an embodiment of this application;
[0069] Figure 9 This is a flowchart illustrating step S20421 performed by an HDR camera according to an embodiment of this application;
[0070] Figure 10 This is a flowchart illustrating step S20422 performed by an HDR camera according to an embodiment of this application;
[0071] Figure 11 This is a flowchart illustrating step S206 performed by an HDR camera according to an embodiment of this application;
[0072] Figure 12 This is a schematic diagram of the structure of a camera that improves image quality based on dynamic exposure ratio, according to an embodiment of this application.
[0073] Figure 13 This is a schematic diagram of the structure of a terminal according to an embodiment of this application;
[0074] Figure 14 This is a schematic diagram of the structure of a server according to an embodiment of this application. Detailed Implementation
[0075] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0076] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.
[0077] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items that have essentially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor does it limit the quantity or execution order. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various elements, these elements should not be limited by the terms.
[0078] These terms are simply used to distinguish one element from another. For example, without departing from the scope of various examples, the first action can be called the second action, and similarly, the second action can be called the first action. Both the first and second actions can be actions, and in some cases, they can be separate and distinct actions.
[0079] "At least one" refers to one or more actions. For example, at least one action can be one action, two actions, three actions, or any integer number of actions greater than or equal to one. "Multiple" refers to two or more actions. For example, multiple actions can be two actions, three actions, or any integer number of actions greater than or equal to two.
[0080] Figure 1 This is a schematic diagram of an implementation environment provided according to an embodiment of this application, which may include a terminal 101.
[0081] Each terminal 101 is equipped with an HDR camera 1011. For example, the terminal 101 can be a smartphone, wearable device, personal computer, laptop computer, tablet computer, and vehicle terminal, etc.
[0082] In related technologies, fixed exposure ratios (e.g., 1:4, 1:8) are typically used to capture long and short exposure images, and fusion is performed based on simple global image brightness statistics. However, this traditional method has significant drawbacks. First, the fixed exposure ratio strategy lacks the ability to perceive scene content and cannot adapt to complex and varied imaging environments, ranging from low-light indoors to high-contrast outdoors, easily leading to insufficient dynamic range utilization or unnatural over-HDR effects. Second, for saturated areas in short-exposure images, related technologies lack refined processing and fail to perform local optimization based on features such as edges and textures, easily producing halo artifacts at important detail edges. Furthermore, fusion methods based on global statistics have low computational efficiency and struggle to achieve a trade-off between noise suppression and motion blur avoidance. Therefore, these technologies largely limit further improvements in image quality and cannot simultaneously meet the application requirements of high dynamic range, high detail fidelity, and high visual naturalness.
[0083] To address the aforementioned technical problems, embodiments of this application provide a method for improving image quality based on dynamic exposure ratios. This method involves adjusting historical exposure ratios by combining scene type, brightness characteristics, saturation region ratio, and average gradient value to obtain a target exposure ratio; capturing images based on the target exposure ratio to obtain long-exposure and short-exposure images; determining target fusion parameters based on scene type, long-exposure and short-exposure images; and fusing the long-exposure and short-exposure images using the target fusion parameters to obtain the target image. This technical solution dynamically adjusts the exposure ratio and fusion weights by combining multiple factors, enabling it to adapt to more complex shooting scenarios and thereby improving the quality of images captured in various scenarios.
[0084] Figure 2 This is a flowchart illustrating a method for improving image quality based on dynamic exposure ratio using an HDR camera, according to an embodiment of this application. (Combined with...) Figure 2A method for improving image quality based on dynamic exposure ratio is described in detail. This method includes steps S201 to S206.
[0085] In step S201, the HDR camera acquires historical short-exposure images.
[0086] Among them, the historical short exposure images were obtained by HDR cameras based on historical exposure ratios.
[0087] In step S202, the HDR camera analyzes historical short-exposure images to obtain brightness features, saturation region proportions, and average gradient values.
[0088] Figure 3 This is a flowchart illustrating step S202 performed by an HDR camera according to an embodiment of this application. (In conjunction with...) Figure 3 Step S202 will be described in detail. Step S202 includes steps S2021 to S2023.
[0089] In step S2021, the HDR camera performs brightness analysis on historical short-exposure images to obtain brightness features.
[0090] Figure 4 This is a flowchart illustrating step S2021 performed by an HDR camera according to an embodiment of this application. (In conjunction with...) Figure 4 Step S2021 will be described in detail. Step S2021 includes steps S20211 to S20213.
[0091] In step S20211, the HDR camera processes the pixel value of each pixel in the historical short exposure image to obtain the brightness value of each pixel.
[0092] For example, the brightness value of each pixel is obtained by weighted averaging the pixel value of each pixel based on the coefficient.
[0093] In step S20212, the HDR camera processes the brightness values of multiple pixels to obtain a brightness histogram.
[0094] In step S20213, the HDR camera analyzes the brightness histogram to obtain brightness features.
[0095] The brightness features are used to quantify the brightness distribution of historical short-exposure images. Brightness features include, but are not limited to, brightness skewness, average brightness, and standard deviation. Brightness skewness, average brightness, and standard deviation are derived from the brightness histogram. Brightness skewness measures the asymmetry of the brightness histogram. Positive skewness indicates that there are more dark pixels in the historical exposure image, meaning the historical exposure image is generally dark. Negative skewness indicates that there are more bright pixels in the historical exposure image, meaning the historical exposure image is generally bright. The average brightness is the average of the brightness values of all pixels in the historical exposure image.
[0096] In step S2022, the HDR camera performs saturation analysis on historical short-exposure images to obtain the proportion of saturated regions.
[0097] Figure 5 This is a flowchart illustrating step S2022 performed by an HDR camera according to an embodiment of this application. (In conjunction with...) Figure 5 Step S2022 will be described in detail. Step S2022 includes steps S20221 to S20224.
[0098] In step S20221, the HDR camera performs saturation analysis on each pixel in the historical short-exposure image to determine multiple saturated pixels.
[0099] For example, a saturation threshold is set; the pixel value of a pixel is compared with the saturation threshold, and if the pixel value of a pixel is not less than the saturation threshold, then the pixel is a saturated pixel. The saturation threshold can be preset and adjusted according to actual needs.
[0100] In step S20222, the HDR camera acquires the position of each saturated pixel.
[0101] In step S20223, the HDR camera determines at least one saturation region based on the positions of multiple saturation pixels.
[0102] In some examples, by traversing historical short-exposure images and using a connected component analysis algorithm to connect discrete adjacent saturated pixels into a continuous region, a saturated region is obtained. However, some small saturated regions may be noise, which can affect the accuracy of the exposure ratio. To address this issue, this application sets an area threshold to remove saturated regions with an area smaller than the threshold.
[0103] In step S20224, the HDR camera processes at least one saturated region and historical short-exposure images to obtain the saturated region ratio.
[0104] The saturation region ratio represents the size of the overexposed area in a historical short-exposure image.
[0105] In some examples, a first area of multiple saturated regions and a second area of the historical short-exposure image are calculated. The first and second areas are then divided to obtain the saturated region ratio. A higher saturated region ratio indicates more severe loss of highlight details in the scene and a lower reliance on the historical long-exposure image, which is used to capture shadow details. Therefore, it is necessary to reduce the exposure ratio between the long-exposure and short-exposure images, i.e., to make the exposure time of the long-exposure image closer to that of the short-exposure image, to avoid further deterioration of highlight information after fusion.
[0106] In step S2023, the HDR camera performs gradient detection on historical short-exposure images to obtain the average gradient value.
[0107] In some examples, gradient detection methods are used to calculate the gradient value of each pixel in the image, and the average gradient value is obtained by averaging the gradient values of all pixels. For example, the Sobel operator is used to calculate the average gradient value. A higher average gradient value indicates sharper image edges, more complex textures, and thus a higher spatial frequency.
[0108] In step S203, the HDR camera identifies the scene type corresponding to the historical short exposure image based on brightness features, saturation region ratio, and average gradient value.
[0109] In some examples, brightness features, saturation region proportions, and average gradient values are input into a trained classification model, which outputs the scene type corresponding to the historical short-exposure image. Scene types include, but are not limited to, indoor low-light scenes, indoor high-contrast scenes, and backlit portrait scenes. Identifying scene types through a classification model not only shortens the recognition time but also improves recognition accuracy.
[0110] In step S204, the HDR camera processes scene type, brightness characteristics, saturation area ratio, and average gradient value to obtain the target exposure ratio.
[0111] Figure 6 This is a flowchart illustrating step S204 performed by an HDR camera according to an embodiment of this application. (In conjunction with...) Figure 6 Step S204 will be described in detail. Step S204 includes steps S2041 to S2042.
[0112] In step S2041, the HDR camera processes the scene type and the saturation area ratio to obtain the initial exposure ratio.
[0113] Figure 7 This is a flowchart illustrating step S2041 performed by an HDR camera according to an embodiment of this application. (In conjunction with...) Figure 7Step S2041 will be described in detail. Step S2041 includes steps S20411 to S20414.
[0114] In step S20411, the HDR camera acquires a preset table; the preset table includes multiple saturation region ratios and a reference exposure ratio.
[0115] The proportion of the saturated region corresponds one-to-one with the reference exposure proportion.
[0116] In step S20412, the HDR camera looks up a preset table based on the saturation region ratio to obtain the corresponding reference exposure ratio.
[0117] For example, a larger saturation region ratio results in a smaller reference exposure ratio to preserve highlight details; conversely, a smaller saturation region ratio results in a larger reference exposure ratio to fully utilize long-exposure images and enhance dynamic range. Therefore, in embodiments of this application, after determining the saturation region ratio of a historical short-exposure image, a corresponding reference exposure ratio is retrieved from a preset table based on that ratio. For example, the reference exposure ratio is determined according to a preset mapping relationship. When the saturation region ratio is greater than 20%, the reference exposure ratio is 1:2. When the saturation region ratio is less than 5%, the reference exposure ratio is 1:16. When the saturation region ratio is not less than 5% and not greater than 20%, the reference exposure ratio is 1:10.
[0118] In step S20413, the HDR camera acquires the preset scene parameters corresponding to the scene type.
[0119] It is understandable that different scene types have their corresponding brightness distribution and image quality characteristics. For example, in indoor low-light scenes, even if the saturation area ratio is very low, the overall environment is dark, so it is necessary to enhance the details in the shadows, that is, to increase the reference exposure ratio. In other words, in indoor low-light scenes, the preset scene parameter is greater than 1. As another example, in outdoor high-contrast scenes, the contrast between light and dark is large. If excessive pursuit of high dynamic range may lead to an unnatural image, therefore, it is necessary to lower the reference exposure ratio. In other words, in indoor high-contrast scenes, the preset scene coefficient is less than 1 to ensure a natural image. Yet another example is in backlit portrait scenes, it is necessary to ensure the exposure of the subject; therefore, the reference exposure ratio needs to be adjusted to a moderate level. In other words, in backlit portrait scenes, the preset scene coefficient is between that in indoor high-contrast scenes and that in indoor low-light scenes. Based on the above reasons, the embodiments of this application set preset scene coefficients for multiple scene types to adjust the corresponding reference exposure ratios.
[0120] In step S20414, the HDR camera adjusts the reference exposure ratio based on preset scene parameters to obtain the initial exposure ratio.
[0121] In some examples, the initial exposure ratio is obtained by multiplying the preset scene parameters and the reference exposure ratio. For example, the initial exposure ratio is the product of the preset scene parameters and the reference exposure ratio.
[0122] In step S2042, the HDR camera adjusts the initial exposure ratio based on brightness characteristics and average gradient value to obtain the target exposure ratio.
[0123] Figure 8 This is a flowchart illustrating step S2042 performed by an HDR camera according to an embodiment of this application. (In conjunction with...) Figure 8 Step S2042 will be described in detail. Step S20421 includes steps S20421 to S20422.
[0124] In step S20421, the HDR camera adjusts the initial exposure ratio based on brightness characteristics to obtain the intermediate exposure ratio.
[0125] Among them, brightness characteristics include brightness skewness.
[0126] Figure 9 This is a flowchart illustrating step S20421 performed by an HDR camera according to an embodiment of this application. (In conjunction with...) Figure 9 Step S20421 will be described in detail. Step S20421 includes steps S204211 to S204213.
[0127] In step S204211, the HDR camera acquires a preset positive bias threshold and a preset negative bias threshold.
[0128] Understandably, the brightness skewness index can effectively characterize the overall brightness of historical short-exposure images. Adjusting the initial exposure ratio based on the brightness skewness allows for effective adaptive adjustments to the initial exposure ratio.
[0129] In step S204212, if the luminance skewness is greater than the preset positive skewness threshold, the HDR camera generates the first luminance coefficient.
[0130] It is understandable that when the brightness deviation is greater than the preset positive deviation threshold, it indicates that the historical exposure image is generally too dark, so it is necessary to increase the initial exposure ratio, that is, the first brightness coefficient is greater than 1.
[0131] In step S204213, the HDR camera performs a multiplication calculation on the first brightness coefficient and the initial exposure ratio to obtain the intermediate exposure ratio.
[0132] For example, the intermediate exposure ratio is the product of the first brightness coefficient and the initial exposure ratio.
[0133] In other examples, if the luminance bias is less than a preset negative bias threshold, a second luminance coefficient is generated; the second luminance coefficient and the initial exposure ratio are multiplied to obtain the intermediate exposure ratio.
[0134] It is understandable that when the brightness deviation is less than the preset brightness deviation threshold, it indicates that the historical exposure image is generally too bright, so the initial exposure ratio needs to be reduced, that is, the second brightness coefficient is less than 1.
[0135] For example, the intermediate exposure ratio is the product of the second brightness coefficient and the initial exposure ratio.
[0136] In other examples, if the brightness deviation is not less than a preset negative deviation threshold and not greater than a preset positive deviation threshold, a third brightness coefficient is generated; the third brightness coefficient and the initial exposure ratio are multiplied to obtain the intermediate exposure ratio.
[0137] Understandably, when the brightness deviation is not less than the preset negative deviation threshold and not greater than the preset positive deviation threshold, there is no need to adjust the initial exposure ratio, that is, the third brightness coefficient is 1.
[0138] For example, the intermediate exposure ratio is the product of the third brightness factor and the initial exposure ratio.
[0139] In step S20422, the HDR camera adjusts the intermediate exposure ratio based on the average gradient value to obtain the target exposure ratio.
[0140] Figure 10 This is a flowchart illustrating step S20422 performed by an HDR camera according to an embodiment of this application. (In conjunction with...) Figure 10 Step S20422 will be described in detail. Step S20422 includes steps S204221 to S204223.
[0141] In step S204221, the HDR camera acquires a first preset gradient threshold, a second preset gradient threshold, and a third preset gradient threshold.
[0142] In step S204222, if the average gradient value is less than the first preset gradient threshold, the HDR camera generates the first gradient coefficient.
[0143] Understandably, if the average gradient value is less than the first preset gradient threshold, it indicates that the historical short-exposure image is very blurry or flat with little detail, requiring an increase in the intermediate exposure ratio to maximize dynamic range. In other words, in this case, the first gradient coefficient is greater than 1. For example, the first gradient coefficient could be 1.1 or 1.2.
[0144] In step S204223, the HDR camera performs a multiplication calculation on the first gradient coefficient and the intermediate exposure ratio to obtain the target exposure ratio.
[0145] For example, the target exposure ratio is the product of the first gradient coefficient and the intermediate exposure ratio.
[0146] In other examples, if the average gradient value is not less than the second preset gradient threshold and not greater than the second preset gradient threshold, then a second gradient coefficient is generated; the second gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio.
[0147] Understandably, when the average gradient value is neither less than nor greater than the second preset gradient threshold, it indicates that the detail level of the historical short-exposure image is generally low, and no fine-tuning is required. In other words, in this case, the second gradient coefficient is 1.
[0148] For example, the target exposure ratio is the product of the second gradient coefficient and the intermediate exposure ratio.
[0149] In other examples, if the average gradient value is greater than the second preset gradient threshold and not greater than the third preset gradient threshold, a third gradient coefficient is generated; the third gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio.
[0150] Understandably, when the average gradient value is greater than the second preset gradient threshold but not greater than the third preset gradient threshold, it indicates that the historical short-exposure image is clear and rich in detail, including textures of buildings and leaves. To prevent halos, artifacts, or texture blurring during the fusion process while maintaining detail clarity, the intermediate exposure ratio needs to be slightly reduced. In other words, in this case, the third gradient coefficient is less than 1. For example, the third gradient coefficient is 0.95.
[0151] For example, the target exposure ratio is the product of the second gradient coefficient and the intermediate exposure ratio.
[0152] In other examples, if the average gradient value is greater than the third preset gradient threshold, a fourth gradient coefficient is generated; the fourth gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio.
[0153] Understandably, when the average gradient value exceeds the third preset gradient threshold, it indicates that the historical short-exposure image contains numerous sharp edges and complex textures, such as dense tree branches. In this case, the intermediate exposure ratio needs to be reduced to ensure detail and avoid an unnatural image. That is, in this situation, the fourth gradient coefficient is less than 1. For example, the fourth gradient coefficient is 0.8.
[0154] For example, the target exposure ratio is the product of the second gradient coefficient and the intermediate exposure ratio.
[0155] Understandably, in saturated regions, strong edges indicate that the area represents the boundary of important elements, such as the outline of an object. Directly applying HDR processing to these areas without considering edge details can lead to unnatural effects such as halos and artifacts. To address these technical issues, embodiments of this application calculate not only the target exposure ratio but also the local exposure ratio for each saturated region, ensuring the clarity of edges and textures within the saturated areas and thus guaranteeing the overall image quality.
[0156] In some embodiments, when the scene type is an indoor low-light scene, the texture complexity value of each saturated region is obtained, and the target exposure ratio is adjusted according to the texture complexity and the proportion of the saturated region to obtain the local exposure ratio of each saturated region.
[0157] In some examples, when the saturated region ratio is less than a preset ratio threshold and the texture complexity value is less than a preset complexity threshold, the first preset ratio parameter, the target exposure ratio, and the preset texture parameter are multiplied to obtain the local exposure ratio of the saturated region.
[0158] In other examples, when the saturated region ratio is not less than a preset ratio threshold and the texture complexity value is not less than a preset complexity threshold, the second preset ratio parameter and the target exposure ratio are multiplied to obtain the local exposure ratio of the saturated region.
[0159] For example, a small neighborhood is extended from the center of each saturated region, for example, by 3-5 pixels. Within this neighborhood, the standard deviation of the pixel's brightness value is calculated. The larger the standard deviation, the more drastic the grayscale change and the more complex the texture, i.e., the higher the texture complexity value.
[0160] For example, in an indoor low-light scene, the brightness characteristics are that most pixels have low brightness values, a low proportion of saturated areas, rich texture, and many details; the target exposure ratio is 1:8; the first preset ratio parameter is 1.2, and the preset texture parameter is 0.8.
[0161] In some other embodiments, when the scene type is an outdoor high-contrast scene, the edge intensity value and contrast value of each saturated area are obtained; the target exposure ratio is adjusted based on the edge intensity value and contrast value to obtain the local exposure ratio of each saturated area.
[0162] In some examples, if the edge intensity value of the saturated region is higher than the preset edge intensity threshold and the contrast value is greater than the preset contrast value, then the first preset edge coefficient, the target exposure ratio, and the preset contrast coefficient are multiplied to obtain the local exposure ratio of the saturated region.
[0163] In other examples, if the edge intensity value of the saturated region is not higher than the preset edge intensity threshold and the contrast value is not greater than the preset contrast value, then the second preset edge coefficient and the target exposure ratio are multiplied to obtain the local exposure ratio of the saturated region.
[0164] Understandably, if a saturated area has high edge intensity and / or high contrast values—for example, text, tree branches, or building outlines—it indicates that these are details that need to be preserved. Therefore, the exposure ratio of this saturated area should be reduced, meaning that the contribution of the long-exposure image to this area will decrease, preserving more information from the short-exposure image.
[0165] For example, within the neighborhood, the edge intensity and contrast values of the saturated region are calculated. A higher edge intensity value indicates a sharper edge and greater importance of the saturated region; a higher contrast value indicates a more abrupt boundary, suggesting the edge is more likely to be an important scene boundary. For instance, the edge intensity value of the saturated region can be calculated using the Sobel operator or an edge detector within this neighborhood. The contrast value of the saturated region is obtained by calculating the average brightness of the saturated region and the average brightness of the adjacent background region.
[0166] For example, in outdoor high-contrast scenes, the brightness characteristics are bimodal distribution, strong contrast between light and dark, and a high proportion of saturated areas, mainly in the highlight areas, with a target exposure ratio of 1:4; the first preset edge coefficient is 0.7, and the preset contrast coefficient is 0.8.
[0167] Understandably, in backlit portrait scenes, you need to determine the subject area and the background area. In the subject area, lower the target exposure ratio, in the background area, increase the target exposure ratio, and in the remaining area, maintain the target exposure ratio.
[0168] In some embodiments, when the scene type is a backlit portrait scene, the subject area and the background area are acquired, and the target exposure ratio is adjusted based on the subject area and the background area.
[0169] In some examples, the main subject area has preset main subject parameters, and the background area has preset main subject parameters; the preset main subject parameters are multiplied by the target exposure ratio to obtain the local exposure ratio of the main subject area; the preset background parameters are multiplied by the target exposure ratio to obtain the local exposure ratio of the background area.
[0170] For example, the local exposure ratio of the main subject area is the product of the preset subject parameters and the target exposure ratio. The local exposure ratio of the background area is the product of the preset background parameters and the target exposure ratio.
[0171] In some embodiments, in a backlit portrait scene, the brightness characteristics are: a bright background, a darker subject, a saturated background area, and clear subject edges; the target exposure ratio is 1:4; the preset subject coefficient is 0.8, and the preset background coefficient is 1.2.
[0172] Based on the above analysis, it can be seen that the embodiments of this application optimize the target exposure ratio by combining scene type, saturation area ratio, edge, texture and contrast, thereby adapting to more complex scenes and lighting conditions, reducing HDR artifacts, improving image quality and maintaining a natural visual effect.
[0173] In step S205, the HDR camera takes pictures based on the target exposure ratio to obtain long exposure images and short exposure images.
[0174] In step S206, the HDR camera fuses long-exposure images and short-exposure images based on scene type to obtain the target image.
[0175] In related technologies, fusion methods based on global statistics for fusing long-exposure and short-exposure images suffer from low computational efficiency and difficulty in striking a balance between noise suppression and motion blur avoidance. To address these issues, embodiments of this application adjust the fusion weights based on scene type, quality differences between the long-exposure and short-exposure images, thereby improving the quality of the target image.
[0176] Figure 11 This is a flowchart illustrating step S206 performed by an HDR camera according to an embodiment of this application. (In conjunction with...) Figure 11 Step S206 will be described in detail. Step S206 includes steps S2061 to S2065.
[0177] In step S2061, the HDR camera acquires a first noise level and motion level of the short-exposure image and a second noise level and motion blur level of the long-exposure image.
[0178] It is understandable that long-exposure images may exhibit motion blur due to the long exposure time, while short-exposure images may exhibit greater noise due to the short exposure time. Therefore, a trade-off between noise and motion blur is necessary.
[0179] In some examples, a local noise level map and a global motion level map of a short-exposure image are obtained. A first noise level is calculated based on the local noise level map, and a motion level is calculated based on the global motion level map. A confidence map of the motion-blurred region and a global noise level map of a long-exposure image are obtained. A motion-blurred level is calculated based on the confidence map of the motion-blurred region, and a second noise level is calculated based on the global noise level map.
[0180] In step S2062, the HDR camera processes the first noise level, motion level, second noise level, and motion blur level to obtain initial fusion parameters.
[0181] The initial fusion parameters include the first initial fusion weight for each pixel in the short exposure image and the second initial fusion weight for each pixel in the long exposure image.
[0182] In some examples, the lower the first noise level and the higher the motion level, the larger the first initial fusion weight of the corresponding pixel. Conversely, the lower the motion blur level and the higher the second noise level, the larger the second initial fusion weight of the corresponding pixel.
[0183] In step S2063, the HDR camera selects an adjustment strategy based on the scene type.
[0184] In some examples, in low-light indoor scenes, the chosen adjustment strategy prioritizes noise suppression, generating a long-exposure fusion factor for the long-exposure image to increase the second initial fusion weight of each pixel in the long-exposure image. That is, the long-exposure fusion factor is greater than 1, while the short-exposure fusion factor is 1.
[0185] In step S2064, the HDR camera adjusts the initial fusion parameters based on the adjustment strategy to obtain the target fusion parameters.
[0186] For example, in an indoor low-light scene, the second target fusion weight for each pixel in a long-exposure image is the product of the second initial fusion weight and the long-exposure fusion factor. The first target fusion weight for each pixel in a short-exposure image is equal to the first initial fusion weight.
[0187] In other examples, in backlit portrait scenes, the chosen adjustment strategy prioritizes subject detail, combining face detection or subject recognition technology to identify the main subject area. A short-exposure fusion factor is then generated for each pixel within this main subject area. For example, the short-exposure fusion factor is greater than 1, while the long-exposure fusion factor is 1.
[0188] For example, the first target fusion weight for each pixel in the exposed image is the product of the first initial fusion weight and the short exposure fusion factor. The second target fusion weight for each pixel in the long exposure image is equal to the second initial fusion weight.
[0189] In other examples, in high-contrast outdoor scenes, the chosen adjustment strategy prioritizes dynamic range, eliminating the need to adjust the initial fusion parameters. That is, both the short-exposure and long-exposure fusion factors are set to 1. For instance, a Laplacian pyramid or gradient domain fusion method is used to fuse long-exposure and short-exposure images, extracting the best-quality edge and texture information from each image for fusion, thereby maximizing the preservation of detail and dynamic range.
[0190] In other examples, in typical scenarios, a balance-first approach is chosen, eliminating the need to adjust the initial fusion parameters. That is, both the short-exposure and long-exposure fusion factors are set to 1. For instance, a linear weighted fusion method is used to fuse long-exposure and short-exposure images.
[0191] In step S2065, the HDR camera fuses the long exposure image and the short exposure image based on the target fusion parameters to obtain the target image.
[0192] In some examples, the HDR camera, based on the selected adjustment strategy and target exposure parameters, uses a preset fusion algorithm to fuse long-exposure and short-exposure images to obtain the target image. It should be noted that the preset fusion algorithm can be directly obtained from related technologies, and will not be described in detail in the embodiments of this application.
[0193] In other examples, in high-contrast outdoor scenes, the chosen adjustment strategy prioritizes dynamic range, eliminating the need to adjust the initial fusion parameters. That is, both the short-exposure and long-exposure fusion factors are set to 1. For instance, a Laplacian pyramid or gradient domain fusion method is used to fuse long-exposure and short-exposure images, extracting the best-quality edge and texture information from each image for fusion, thereby maximizing the preservation of detail and dynamic range.
[0194] In other examples, in typical scenarios, a balance-first approach is chosen, eliminating the need to adjust the initial fusion parameters. That is, both the short-exposure and long-exposure fusion factors are set to 1. For instance, a linear weighted fusion method is used to fuse long-exposure and short-exposure images.
[0195] In some embodiments, the historical exposure ratios of multiple historical images are obtained; based on the historical exposure ratios of multiple historical images, a trained prediction model is used to predict the exposure ratio of the next image, avoiding ratio jumps caused by sudden scene changes.
[0196] In some examples, the predicted exposure ratio and the target exposure ratio are smoothed to obtain the actual exposure ratio, and the image is taken based on the actual exposure ratio to obtain short exposure images and long exposure images.
[0197] In some examples, the target image is detected to obtain the quality of the target image; based on the quality of the target image, some parameters of this application are optimized to further improve the quality of the target image.
[0198] In embodiments of this application, the scene type corresponding to a historical short-exposure image is identified based on brightness features, saturation region ratio, and average gradient value; the scene type, brightness features, saturation region ratio, and average gradient value are processed to obtain a target exposure ratio; a long-exposure image and a short-exposure image are captured based on the target exposure ratio; and the long-exposure image and the short-exposure image are fused based on the scene type to obtain the target image. Compared to related technologies that use a fixed exposure ratio to capture long and short-exposure images, the technical solution of this application dynamically adjusts the exposure ratio through scene type, brightness features, saturation region ratio, and average gradient value. This not only adapts to complex and changing imaging environments but also fully utilizes the dynamic range, thereby improving the quality of the target image.
[0199] Figure 12 This is a schematic diagram of a camera 1200 for improving image quality based on dynamic exposure ratio, according to an embodiment of this application. The camera includes:
[0200] The acquisition module 1201 is used to acquire historical short-exposure images;
[0201] Analysis module 1202 is used to analyze historical short-exposure images to obtain brightness features, saturation region ratio, and average gradient value.
[0202] The recognition module 1203 is used to identify the scene type corresponding to the historical short exposure image based on brightness features, saturation area ratio and average gradient value;
[0203] Processing module 1204 is used to process scene type, brightness characteristics, saturation area ratio and average gradient value to obtain target exposure ratio;
[0204] The shooting module 1205 is used to shoot based on the target exposure ratio to obtain long exposure images and short exposure images;
[0205] The fusion module 1206 is used to fuse long-exposure images and short-exposure images based on scene type to obtain the target image.
[0206] In some embodiments, historical short-exposure images are analyzed to obtain brightness features, saturation region proportions, and average gradient values, including:
[0207] Brightness characteristics are obtained by performing brightness analysis on historical short-exposure images.
[0208] Saturation analysis was performed on historical short-exposure images to obtain the proportion of saturated regions;
[0209] Gradient detection is performed on historical short-exposure images to obtain the average gradient value.
[0210] In some embodiments, saturation analysis is performed on historical short-exposure images to obtain the proportion of saturated regions, including:
[0211] Saturation analysis was performed on each pixel in historical short-exposure images to identify multiple saturated pixels.
[0212] Get the position of each saturated pixel;
[0213] Based on the positions of multiple saturated pixels, at least one saturated region is determined.
[0214] Process at least one saturated region and historical short-exposure images to obtain the saturated region ratio.
[0215] In some embodiments, processing scene type, brightness characteristics, saturation region ratio, and average gradient value to obtain the target exposure ratio includes:
[0216] The initial exposure ratio is obtained by processing the scene type and the proportion of the saturation area;
[0217] The initial exposure ratio is adjusted based on the brightness characteristics and the average gradient value to obtain the target exposure ratio.
[0218] In some embodiments, adjusting the initial exposure ratio based on brightness characteristics and average gradient values to obtain the target exposure ratio includes:
[0219] The initial exposure ratio is adjusted based on the brightness characteristics to obtain the intermediate exposure ratio;
[0220] The target exposure ratio is obtained by adjusting the intermediate exposure ratio based on the average gradient value.
[0221] In some embodiments, the brightness feature includes brightness skewness;
[0222] The initial exposure ratio is adjusted based on brightness characteristics to obtain the intermediate exposure ratio, including:
[0223] Obtain the preset positive skewness threshold and the preset negative skewness threshold;
[0224] If the brightness deviation is greater than the preset positive deviation threshold, a first brightness coefficient is generated; the first brightness coefficient and the initial exposure ratio are multiplied to obtain the intermediate exposure ratio;
[0225] If the brightness deviation is less than the preset negative deviation threshold, a second brightness coefficient is generated; the second brightness coefficient and the initial exposure ratio are multiplied to obtain the intermediate exposure ratio.
[0226] If the brightness deviation is not less than the preset negative deviation threshold and not greater than the preset positive deviation threshold, then a third brightness coefficient is generated; the third brightness coefficient and the initial exposure ratio are multiplied to obtain the intermediate exposure ratio.
[0227] In some embodiments, adjusting the intermediate exposure ratio based on the average gradient value to obtain the target exposure ratio includes:
[0228] Obtain the first preset gradient threshold, the second preset gradient threshold, and the third preset gradient threshold;
[0229] If the average gradient value is less than the first preset gradient threshold, a first gradient coefficient is generated; the first gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio.
[0230] If the average gradient value is not less than the second preset gradient threshold and not greater than the second preset gradient threshold, then a second gradient coefficient is generated; the second gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio.
[0231] If the average gradient value is greater than the second preset gradient threshold but not greater than the third preset gradient threshold, then a third gradient coefficient is generated; the third gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio.
[0232] If the average gradient value is greater than the third preset gradient threshold, a fourth gradient coefficient is generated; the fourth gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio.
[0233] The average gradient value characterizes the sharpness and texture complexity of historical short-exposure images; first gradient coefficient > second gradient coefficient > third gradient coefficient > fourth gradient coefficient.
[0234] In some embodiments, the method further includes:
[0235] When the scene type is an indoor low-light scene, obtain the texture complexity value of each saturated region; when the proportion of the saturated region is less than the preset proportion threshold and the texture complexity value is less than the preset complexity threshold, multiply the first preset proportion parameter, the target exposure ratio, and the preset texture parameter to obtain the local exposure ratio of the saturated region; or when the proportion of the saturated region is not less than the preset proportion threshold and the texture complexity value is not less than the preset complexity threshold, multiply the second preset proportion parameter and the target exposure ratio to obtain the local exposure ratio of the saturated region.
[0236] Alternatively, when the scene type is an outdoor high-contrast scene, the edge intensity value and contrast value of each saturated area are obtained; if the edge intensity value of the saturated area is higher than the preset edge intensity threshold and the contrast value is greater than the preset contrast value, the first preset edge coefficient, the target exposure ratio, and the preset contrast coefficient are multiplied to obtain the local exposure ratio of the saturated area; or if the edge intensity value of the saturated area is not higher than the preset edge intensity threshold and the contrast value is not greater than the preset contrast value, the second preset edge coefficient and the target exposure ratio are multiplied to obtain the local exposure ratio of the saturated area.
[0237] Alternatively, when the scene type is a backlit portrait scene, the subject area and the background area are obtained; the subject area has preset subject parameters, and the background area has preset subject parameters; the preset subject parameters and the target exposure ratio are multiplied to obtain the local exposure ratio of the subject area; the preset background parameters and the target exposure ratio are multiplied to obtain the local exposure ratio of the background area.
[0238] In some embodiments, a target image is obtained by fusing long-exposure images and short-exposure images based on scene type, including:
[0239] Acquire the first noise level and motion level of the short-exposure image, and the second noise level and motion blur level of the long-exposure image;
[0240] The initial fusion parameters are obtained by processing the first noise level, motion level, second noise level, and motion blur level.
[0241] Select and adjust strategies based on scenario type;
[0242] Based on the adjustment strategy and the initial fusion parameters, the target fusion parameters are obtained;
[0243] The target image is obtained by fusing long-exposure and short-exposure images based on the target fusion parameters.
[0244] It should be noted that the above embodiments of the camera for improving image quality based on dynamic exposure ratios are only illustrated by the division of the above functional modules when performing the corresponding steps. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the camera for improving image quality based on dynamic exposure ratios and the method embodiments for improving image quality based on dynamic exposure ratios provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0245] In embodiments of this application, the scene type corresponding to a historical short-exposure image is identified based on brightness features, saturation region ratio, and average gradient value; the scene type, brightness features, saturation region ratio, and average gradient value are processed to obtain a target exposure ratio; a long-exposure image and a short-exposure image are captured based on the target exposure ratio; and the long-exposure image and the short-exposure image are fused based on the scene type to obtain the target image. Compared to related technologies that use a fixed exposure ratio to capture long and short-exposure images, the technical solution of this application dynamically adjusts the exposure ratio through scene type, brightness features, saturation region ratio, and average gradient value. This not only adapts to complex and changing imaging environments but also fully utilizes the dynamic range, thereby improving the quality of the target image.
[0246] Embodiments of this application also provide a computer device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the method described above.
[0247] Taking computer devices as terminals as an example, Figure 13 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application. See also... Figure 13 Terminal 1300 can be: a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. Terminal 1300 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
[0248] Typically, terminal 1300 includes a processor 1301 and a memory 1302.
[0249] Processor 1301 may include one or more processing cores, such as a quad-core processor, a penta-core processor, etc. Processor 1301 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1301 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1301 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1301 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0250] The memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1302 are used to store at least one program code, which is executed by the processor 1301 to implement the process of terminal execution in the method embodiments of this application.
[0251] In some embodiments, the terminal 1300 may also optionally include a peripheral device interface 1303 and at least one peripheral device. The processor 1301, memory 1302, and peripheral device interface 1303 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1303 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of a display screen 1304, a camera assembly 1305, an audio circuit 1306, and a power supply 1307.
[0252] Peripheral device interface 1303 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1301 and memory 1302. In some embodiments, processor 1301, memory 1302 and peripheral device interface 1303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1301, memory 1302 and peripheral device interface 1303 can be implemented on separate chips or circuit boards, and this application embodiment does not limit this.
[0253] Display screen 1304 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1304 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1301 for processing. In this case, display screen 1304 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1304, disposed on the front panel of terminal 1300; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 1300 or in a folded design; in still other embodiments, display screen 1304 may be a flexible display screen, disposed on a curved or folded surface of terminal 1300. Furthermore, display screen 1304 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1304 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0254] The camera assembly 1305 is used to acquire images or videos. In some embodiments, the camera assembly 1305 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1305 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0255] The audio circuit 1306 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals which are then input to the processor 1301 for processing. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each positioned at a different location on the terminal 1300. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert the electrical signals from the processor 1301 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 1306 may also include a headphone jack.
[0256] Power supply 1307 is used to power the various components in terminal 1300. Power supply 1307 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1307 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0257] Those skilled in the art will understand that Figure 13 The structure shown does not constitute a limitation on terminal 1300 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0258] Taking computer equipment as a server as an example, Figure 14 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1400 can vary significantly due to different configurations or performance. It may include one or more processors 1401 (Central Processing Units, CPUs) and one or more memories 1402. The one or more memories 1402 store at least one computer program, which is loaded and executed by the one or more processors 1401 to implement the aforementioned method for improving image quality based on dynamic exposure ratios. Of course, the server 1400 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 1400 may also include other components for implementing device functions, which will not be elaborated upon here.
[0259] Embodiments of this application also provide a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to perform the method described above. Optionally, the computer-readable storage medium may be read-only memory (ROM), random access memory (RAM), compact-disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0260] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0261] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for improving image quality based on dynamic exposure ratio, characterized in that, include: Acquire historical short-exposure images; The historical short-exposure images are analyzed to obtain brightness features, saturation region proportions, and average gradient values. The scene type corresponding to the historical short exposure image is identified based on the brightness features, the saturation region ratio, and the average gradient value. The target exposure ratio is obtained by processing the scene type, the brightness feature, the saturation region ratio, and the average gradient value. Based on the target exposure ratio, long exposure images and short exposure images are obtained; The target image is obtained by fusing the long exposure image and the short exposure image based on the scene type.
2. The method according to claim 1, characterized in that, The analysis of the historical short-exposure images to obtain brightness features, saturation region proportions, and average gradient values includes: The brightness characteristics are obtained by performing brightness analysis on the historical short-exposure images; The saturation analysis is performed on the historical short-exposure image to obtain the proportion of the saturated region; The average gradient value is obtained by performing gradient detection on the historical short-exposure images.
3. The method according to claim 2, characterized in that, The step of performing saturation analysis on the historical short-exposure images to obtain the proportion of saturated regions includes: Saturation analysis is performed on each pixel in the historical short-exposure image to determine multiple saturated pixels; Obtain the position of each of the saturated pixels; Based on the positions of the multiple saturated pixels, at least one saturated region is determined; The saturation region ratio is obtained by processing the at least one saturated region and the historical short-exposure image.
4. The method according to claim 1, characterized in that, Processing the scene type, the brightness feature, the saturation region ratio, and the average gradient value to obtain the target exposure ratio includes: The initial exposure ratio is obtained by processing the scene type and the saturation region ratio; The initial exposure ratio is adjusted based on the brightness characteristics and the average gradient value to obtain the target exposure ratio.
5. The method according to claim 4, characterized in that, The step of adjusting the initial exposure ratio based on the brightness features and the average gradient value to obtain the target exposure ratio includes: The initial exposure ratio is adjusted based on the brightness characteristics to obtain the intermediate exposure ratio; The target exposure ratio is obtained by adjusting the intermediate exposure ratio based on the average gradient value.
6. The method according to claim 5, characterized in that, The brightness feature includes brightness skewness; The step of adjusting the initial exposure ratio based on the brightness characteristics to obtain the intermediate exposure ratio includes: Obtain the preset positive skewness threshold and the preset negative skewness threshold; If the brightness skewness is greater than the preset positive skewness threshold, a first brightness coefficient is generated; the first brightness coefficient and the initial exposure ratio are multiplied to obtain the intermediate exposure ratio; Alternatively, if the brightness bias is less than the preset negative bias threshold, a second brightness coefficient is generated; the second brightness coefficient and the initial exposure ratio are multiplied to obtain the intermediate exposure ratio; Alternatively, if the brightness deviation is not less than the preset negative deviation threshold and not greater than the preset positive deviation threshold, a third brightness coefficient is generated; the third brightness coefficient and the initial exposure ratio are multiplied to obtain the intermediate exposure ratio.
7. The method according to claim 5, characterized in that, The step of adjusting the intermediate exposure ratio based on the average gradient value to obtain the target exposure ratio includes: Obtain the first preset gradient threshold, the second preset gradient threshold, and the third preset gradient threshold; If the average gradient value is less than the first preset gradient threshold, a first gradient coefficient is generated; the first gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio. If the average gradient value is not less than the second preset gradient threshold and not greater than the second preset gradient threshold, then a second gradient coefficient is generated; the second gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio; If the average gradient value is greater than the second preset gradient threshold and not greater than the third preset gradient threshold, then a third gradient coefficient is generated; the third gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio. Alternatively, if the average gradient value is greater than the third preset gradient threshold, a fourth gradient coefficient is generated; the fourth gradient coefficient and the intermediate exposure ratio are multiplied to obtain the target exposure ratio; The average gradient value characterizes the sharpness and texture complexity of the historical short-exposure image; the first gradient coefficient > the second gradient coefficient > the third gradient coefficient > the fourth gradient coefficient.
8. The method according to claim 3, characterized in that, The method further includes: When the scene type is an indoor low-light scene, the texture complexity value of each saturated region is obtained; when the proportion of the saturated region is less than a preset proportion threshold and the texture complexity value is less than a preset complexity threshold, the first preset proportion parameter, the target exposure ratio, and the preset texture parameter are multiplied to obtain the local exposure ratio of the saturated region; or when the proportion of the saturated region is not less than the preset proportion threshold and the texture complexity value is not less than the preset complexity threshold, the second preset proportion parameter and the target exposure ratio are multiplied to obtain the local exposure ratio of the saturated region. Alternatively, when the scene type is an outdoor high-contrast scene, the edge intensity value and contrast value of each saturated region are obtained; if the edge intensity value of the saturated region is higher than a preset edge intensity threshold and the contrast value is greater than a preset contrast value, the first preset edge coefficient, the target exposure ratio, and the preset contrast coefficient are multiplied to obtain the local exposure ratio of the saturated region; or if the edge intensity value of the saturated region is not higher than the preset edge intensity threshold and the contrast value is not greater than the preset contrast value, the second preset edge coefficient and the target exposure ratio are multiplied to obtain the local exposure ratio of the saturated region. Alternatively, when the scene type is a backlit portrait scene, the subject area and the background area are obtained; the subject area is provided with preset subject parameters, and the background area is provided with preset subject parameters; the preset subject parameters are multiplied by the target exposure ratio to obtain the local exposure ratio of the subject area; the preset background parameters are multiplied by the target exposure ratio to obtain the local exposure ratio of the background area.
9. The method according to claim 1, characterized in that, The process of fusing the long-exposure image and the short-exposure image based on the scene type to obtain the target image includes: Acquire a first noise level and motion level of the short-exposure image, and a second noise level and motion blur level of the long-exposure image; The first noise level, the motion level, the second noise level, and the motion blur level are processed to obtain initial fusion parameters; Select an adjustment strategy based on the scenario type; Based on the adjustment strategy and the initial fusion parameters, the target fusion parameters are obtained; The target image is obtained by fusing the long exposure image and the short exposure image based on the target fusion parameters.
10. A camera that improves image quality based on dynamic exposure ratio, characterized in that, include: The acquisition module is used to acquire historical short-exposure images; The analysis module is used to analyze the historical short-exposure images to obtain brightness features, saturation region ratios, and average gradient values. The identification module is used to identify the scene type corresponding to the historical short exposure image based on the brightness features, the saturation region ratio, and the average gradient value. The processing module is used to process the scene type, the brightness feature, the saturation region ratio, and the average gradient value to obtain the target exposure ratio; The shooting module is used to take pictures based on the target exposure ratio to obtain long exposure images and short exposure images; The fusion module is used to fuse the long exposure image and the short exposure image based on the scene type to obtain the target image.