Image adjustment method, device, electronic device and computer readable storage medium

By stretching and splitting the image to be adjusted, and calculating the fusion weight for fusion, the problem of difficulty in adjusting the image brightness and dynamic range of traditional technologies is solved, and a better image adjustment effect is achieved.

CN113920031BActive Publication Date: 2025-02-11GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111248981.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-26
Publication Date
2025-02-11
Estimated Expiration
2041-10-26

AI Technical Summary

Technical Problem

Traditional image adjustment methods are difficult to adjust the image brightness and dynamic range to the appropriate range, resulting in the inability to obtain better image adjustment effects in different scenarios.

Method used

By obtaining the image to be adjusted, the stretching process is performed to obtain a high-bit width image, and the high-bit width image is split according to the preset gain value to obtain a split image of different brightness. Then, the fusion weights are calculated based on the pixel values ​​of the split image, and the split image is fused with these weights to obtain the target image.

Benefits of technology

Ensure that the brightness and dynamic range of the image are adjusted to the appropriate range, effectively improving the brightness and dynamic effect of the adjusted image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113920031B_ABST
    Figure CN113920031B_ABST
Patent Text Reader

Abstract

The present application relates to an image adjustment method, device, computer equipment and storage medium. The method comprises: obtaining an image to be adjusted; stretching the image to be adjusted to obtain a high-bitwidth image; splitting the high-bitwidth image according to a preset gain value to obtain split images of different brightness; calculating the fusion weight of the split images according to the pixel values ​​of the split images, and using the fusion weight to fuse the split images to obtain a target image. The method can ensure that the brightness and dynamic range of the image are adjusted to a suitable range, thereby effectively improving the brightness and dynamic effect of the adjusted image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an image adjustment method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the development of technology in the field of computer technology, in some specific scenarios in the field of 3D vision, it is necessary to adjust the brightness and dynamic range of images so as to obtain images that meet the requirements of different scenarios.

[0003] However, in traditional image adjustment methods, a tone mapping module is usually used to directly adjust the brightness of the image. Since this method is difficult to adjust the image brightness and dynamic range to an appropriate range, it is difficult to obtain a good image adjustment effect in different scenes. Summary of the invention

[0004] The embodiments of the present application provide an image adjustment method, device, electronic device, and computer-readable storage medium, which can ensure that the brightness and dynamic range of an image are adjusted to an appropriate range, thereby effectively improving the brightness and dynamic effect of the adjusted image.

[0005] An image adjustment method, comprising:

[0006] Obtain the image to be adjusted;

[0007] Stretching the image to be adjusted to obtain a high bit width image;

[0008] Splitting the high bit width image according to a preset gain value to obtain split images with different brightness;

[0009] The fusion weights of the split images are calculated according to the pixel values ​​of the split images, and the split images are fused using the fusion weights to obtain a target image.

[0010] An image adjustment device, comprising:

[0011] An acquisition module, used for acquiring an image to be adjusted;

[0012] A processing module, used for stretching the image to be adjusted to obtain a high bit width image;

[0013] A splitting processing module, used for splitting the high bit width image according to a preset gain value to obtain split images with different brightness;

[0014] A calculation module, used for calculating the fusion weight of the split image according to the pixel values ​​of the split image;

[0015] The fusion module is used to fuse the split images using the fusion weights to obtain a target image.

[0016] An electronic device comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned image adjustment method.

[0017] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processor.

[0018] The above-mentioned image adjustment method, device, computer equipment and storage medium obtain the image to be adjusted, stretch the image to be adjusted to obtain a high-bitwidth image, and split the high-bitwidth image according to a preset gain value to obtain split images of different brightness. According to the pixel values ​​of the split images, the fusion weights of the split images of different brightness are calculated, and the split images are fused using the fusion weights to obtain the target image. Since the optimal fusion weight is selected for each pixel when calculating the fusion weight, the fusion weight is used as an adjustment parameter to adjust the contribution ratio of each split image in the target image, and the performance of the image brightness in different scenes can be flexibly controlled by selecting the optimal weight in each split image pixel. This optimal fusion weight can ensure that the brightness and dynamics of the target image finally obtained are adjusted to a suitable range, that is, by splitting the brightness of the image to be adjusted and fusing the split images, the image to be adjusted is adjusted to a suitable range of brightness and dynamics, which effectively improves the brightness and dynamic effects of the adjusted image. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A diagram showing an application environment of an image adjustment method in an embodiment;

[0021] Figure 2 is a flow chart of an image adjustment method in one embodiment;

[0022] Figure 3 is a graph of pixel values ​​or brightness values ​​in one embodiment;

[0023] Figure 4It is a flowchart of the steps of performing splitting processing on a high bit width image according to a preset gain value to obtain split images with different brightness in one embodiment;

[0024] Figure 5 A flowchart of a step of calculating a fusion weight of at least two frames of split images with different brightness in one embodiment;

[0025] Figure 6 This is a flowchart of processing of an HDR-fused image by a mobile terminal in one embodiment;

[0026] Figure 7 is a processing flow chart of an image stretching and brightening module in one embodiment;

[0027] Figure 8 The flowchart of processing Laplace fusion of 8BIT images with different brightness in one embodiment is as follows;

[0028] Fig. 9 is a structural block diagram of an image adjustment device in one embodiment;

[0029] Fig.10 FIG. 4 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0031] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first client may be referred to as a second client, and similarly, a second client may be referred to as a first client. Both the first client and the second client are clients, but they are not the same client.

[0032] Figure 1 FIG. 1 is a schematic diagram of an application environment of an image adjustment method in an embodiment. Figure 1As shown, the application environment includes a terminal 102, and the application environment can be an environment in which a user interacts with the terminal 102. A camera 104 is installed in the terminal 102, and the camera 104 can be a front-mounted, rear-mounted, rotating or pop-up camera, etc. The terminal 102 can obtain the image to be adjusted collected by the camera 104, and the terminal 102 stretches the image to be adjusted to obtain a high-bitwidth image; the terminal 102 splits the high-bitwidth image according to a preset gain value to obtain split images of different brightness; the terminal 102 calculates the fusion weights of the split images of different brightness according to the pixel values ​​of the split images, and fuses the split images using the fusion weights to obtain the target image. After the terminal 102 obtains the target image, the terminal 102 can classify and store each target image, or the terminal 102 sends the target image to the server corresponding to the identification information according to the identification information corresponding to the target image. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server can be implemented with an independent server or a server cluster composed of multiple servers. It can be understood that the image adjustment method provided in the embodiment of the present application can also be executed by a server.

[0033] Figure 2 FIG. 1 is a flow chart of an image adjustment method in one embodiment. The image adjustment method in this embodiment is executed at Figure 1 The following describes the terminal in the example. Figure 2 As shown, the image adjustment method includes steps 202 to 208 .

[0034] Step 202: Acquire the image to be adjusted.

[0035] Among them, the image to be adjusted refers to the image that needs to be adjusted. Due to the complex environment in which the subject is located, the image captured in certain specific scenes may be overexposed, dark, etc., which makes the visual effect of the captured image poor, so it is necessary to further adjust the captured image. The image to be adjusted may include an image captured by the terminal, a video stream image captured by a camera, or an image crawled from the network by the terminal. The image to be adjusted in the embodiment of the present application may be a high dynamic range image, which can provide more dynamic range and image details, and can better reflect the visual effects in the real environment.

[0036] Specifically, the terminal can obtain the image to be adjusted taken by the camera. In addition, the terminal can also download the image from the server or other cloud platform, and use the downloaded image as the image to be adjusted. The method of obtaining the image to be adjusted is not limited here. It can be understood that the image to be adjusted in this example can also be a high dynamic range fused image obtained by fusing the bright frame image and the dark frame image, that is, the terminal can obtain the HDR fused image, and use the obtained HDR fused image as the image to be adjusted.

[0037] For example, a user may start an application with an image recognition function in a terminal through a trigger operation, and the application calls a built-in camera in the terminal to acquire an image to be adjusted.

[0038] Step 204: stretch the image to be adjusted to obtain a high-bitwidth image.

[0039] Among them, stretching processing refers to linear stretching of the image to be adjusted. The linear stretching of the image is to transform all the pixels in the image to be adjusted according to the linear transformation function. Linear stretching can include direct linear stretching, cropped linear stretching and segmented stretching. In the captured image, for example, in a certain band, the grayscale value will be concentrated in a certain interval. If it is not stretched, the details will not be obvious, so linear stretching processing is required. The principle of linear stretching can be understood as the color value of a certain image is distributed in a certain small-scale area. Assuming it is an 8-bit image, the whole image is more distributed in a certain area, and the area needs to be expanded to the entire 8-bit color domain. For example: a frame of an image with a brightness value or chromaticity value range of 4-50 cannot show clearer details. If the brightness value or chromaticity value of the image is stretched, that is, the range of the brightness value or chromaticity value is stretched from 4-50 to 0-255, an image showing more details after stretching can be obtained.

[0040] A high-bitwidth image refers to an image whose bitwidth is greater than or equal to a preset threshold. For example, assuming the preset threshold is 8BIT, the terminal can use an image greater than or equal to 8BIT as a high-bitwidth image. Bitwidth refers to the amount of data that can be transmitted at one time by the memory or video memory. For example, if the output format of an image is 8BIT, the 8BIT in the image means that the brightness value or chromaticity value of this frame of the image is stored in a variable with a bitwidth of 8BIT, so the range of the brightness value or chromaticity value is 0-255. If it is a 10BIT image, the range of the brightness value or chromaticity value is 0-1023.

[0041] Specifically, after the terminal obtains the image to be adjusted, the terminal can perform linear stretching on the image to be adjusted to obtain a high-bitwidth image. For example, the terminal can automatically generate a corresponding gain value based on a preset gain function, and perform a linear operation on the image to be adjusted and the gain value to finally obtain a high-bitwidth image.

[0042] For example, assuming that the image to be adjusted obtained by the terminal is an 8BIT image, the terminal can obtain a gain value of 4 automatically generated based on a preset gain function, and the terminal multiplies the 8BIT image by the gain value 4, that is, multiplies the image to be adjusted by 4 pixel by pixel, to obtain a 10BIT image. In addition, the terminal can further use nonlinear tone mapping to adjust the brightness of the 10BIT image to obtain a brightened high-bitwidth image. It can be understood that the linear stretching and nonlinear tone mapping methods used in this embodiment can be integrated into an execution module in a computer program. For example, the linear stretching and nonlinear tone mapping methods can be integrated as the function of an image stretching and brightening module, and the terminal can call the image stretching and brightening module to achieve stretching and brightening and other performances.

[0043] Step 206 , splitting the high bit width image according to a preset gain value to obtain split images with different brightness.

[0044] The gain value refers to the amplification factor, for example, the gain value can be set to 2 to the power of 0, 2 to the power of 2 / 3, 2 to the power of 4 / 3, and 2 to the power of 2, etc. The gain value in the embodiment of the present application can be a pre-set fixed gain value, or it can be a pre-set gain value calculation method, and the system automatically generates a corresponding gain value according to the calculation method, and the calculation method and generation method of the gain value are not limited here.

[0045] The split image refers to images of different brightness obtained by splitting the high-bitwidth image according to different gain values. For example, if the terminal obtains 3 different gain values, there are 3 corresponding split images. In this embodiment, split images of different brightness are used to simulate multi-level exposure images.

[0046] Specifically, the terminal can obtain a gain value automatically generated based on a preset gain function or a preset gain value calculation formula, and split the high-bitwidth image according to the gain value to obtain split images of different brightness. For example, assuming that the terminal obtains the corresponding gain value of 2 based on the preset gain function 0 , 2 1 and 2 2, the terminal splits the high-bitwidth image according to the gain value obtained above, and splits it into three 8BIT images, so as to obtain three 8BIT images with different brightness, that is, to simulate multi-frame images with three different exposure levels. In addition, when the terminal splits the high-bitwidth image, the pixel value of the split output image needs to meet the preset brightness condition, which can also be pre-configured, for example, the range of the average brightness value of the image needs to be between 0 and 255.

[0047] Step 208: Calculate the fusion weights of the split images according to the pixel values ​​of the split images, and fuse the split images using the fusion weights to obtain the target image.

[0048] The fusion weight refers to the weight corresponding to different split images. For example, the weight corresponding to the first split image can be the first fusion weight, and the weights corresponding to different split images can be different. The fusion weight is used as an adjustment parameter to adjust the contribution ratio of each split image in the target image. The performance of image brightness in different scenes can be flexibly controlled by selecting the optimal weight in each split image pixel. The optimal weight can ensure that the brightness and dynamics of the image to be adjusted in different scenes are adjusted to the appropriate range.

[0049] The target image is the image obtained by fusing the split images according to the fusion weights, that is, the brightness and dynamics of the target image are adjusted to the appropriate range, effectively improving the brightness and dynamic effects of the image to be adjusted. For example, a frame of the image to be adjusted with a darker overall color can be adjusted to display more details in the output target image.

[0050] Specifically, the terminal can calculate the fusion weights of split images of different brightness based on a preset fusion weight function, and fuse the split images according to the fusion weights to obtain a target image; wherein the fusion weights are used to represent the contribution ratio of each split image in the target image.

[0051] For example, the terminal can calculate the fusion weights of the split images of different brightness based on a preset fusion weight function, and use the fusion weights to perform Laplacian pyramid (LP) fusion on the split images to obtain a target image after Laplacian pyramid fusion. It is understandable that the embodiments of the present application include but are not limited to the fusion method of Laplacian pyramid (LP), and can also be other fusion methods, which are not specifically limited here.

[0052] The image adjustment method in this embodiment obtains the image to be adjusted, stretches the image to be adjusted to obtain a high-bitwidth image, and performs brightness splitting processing on the high-bitwidth image according to a preset gain value to obtain split images of different brightness. According to the pixel values ​​of the split images, the fusion weights of the split images of different brightness are calculated, and the split images are fused using the fusion weights to obtain the target image. Since the optimal fusion weight is selected for each pixel when calculating the fusion weight, this optimal fusion weight can ensure that the brightness and dynamics of the target image finally obtained are adjusted to a suitable range, that is, by splitting the image to be adjusted and fusing the split images, the brightness and dynamics of the image to be adjusted are adjusted to a suitable range, which effectively improves the brightness and dynamic effects of the adjusted image.

[0053] In one embodiment, the step of obtaining the image to be adjusted includes:

[0054] Calculating the weights of the input first image and the second image respectively to obtain a first weight corresponding to the first image and a second weight corresponding to the second image; wherein the brightness of the first image is higher than the brightness of the second image;

[0055] Based on the first weight and the second weight, the first image and the second image are fused to obtain an image to be adjusted.

[0056] Among them, the high dynamic range fused image refers to an image obtained by fusing multiple HDR frames. For example, an image obtained by fusing the bright frame and the dark frame of HDR is a high dynamic range fused image. The image to be adjusted can be a high dynamic range fused image. The high dynamic range fused image is used to provide brightness information.

[0057] Specifically, the terminal can calculate the weights of the input first image and the second image respectively, and obtain the first weight corresponding to the first image and the second weight corresponding to the second image; wherein the brightness of the first image is higher than the brightness of the second image. For example, the first image can be a bright frame image, and the second image can be a dark frame image. Then the terminal can calculate the weights of the input bright frame image and the dark frame image respectively, and obtain the first weight corresponding to the bright frame image and the second weight corresponding to the dark frame image. The calculated weights are calculated based on the pixel values ​​of the bright frame image and the dark frame image. Furthermore, the terminal can fuse the bright frame image and the dark frame image based on the first weight and the second weight to obtain a high dynamic range fused image, and use the high dynamic range fused image as the image to be adjusted, so that the high dynamic range fused image can provide more detailed information for subsequent image adjustment, so that the adjusted image effect is better.

[0058] In one embodiment, the step of stretching the image to be adjusted to obtain a high bit width image includes:

[0059] Linearly stretch the image to be adjusted to obtain a high-bitwidth image;

[0060] The method further comprises:

[0061] Nonlinear tone mapping is performed on the pixel values ​​of the high-bitwidth image to obtain a high-bitwidth image with adjusted brightness.

[0062] After the terminal obtains the image to be adjusted, the terminal can perform linear stretching on the image to be adjusted to obtain a high-bitwidth image. Specifically, the terminal can transform all points in the image to be adjusted according to a linear transformation function. Assuming that the image after HDR fusion is an 8BIT image, the terminal uses the 8BIT image after HDR fusion as the image to be adjusted. When the terminal linearly stretches the image to be adjusted, the fused 8BIT image is multiplied by a gain value and linearly stretched to a high-bitwidth image. In the embodiment of the present application, the high-bitwidth image is a high-bitwidth image.

[0063] For example, assuming that the terminal calculates the corresponding gain value of 4 according to the calculation function of the preset gain value, the terminal multiplies the fused 8BIT image by the gain value 4, that is, multiplies the image to be adjusted by 4 pixel by pixel, to obtain a 10BIT image. It can be understood that the linear calculation method in this embodiment includes but is not limited to multiplying different gain values ​​to obtain images of different BIT positions, and can also be other calculation methods.

[0064] Furthermore, the terminal may perform nonlinear tone mapping on the pixel values ​​of the high-bitwidth image to obtain a high-bitwidth image with adjusted brightness. That is, the terminal may adjust the image brightness by nonlinear tone mapping. For example, the terminal may use a gamma correction method to perform tone mapping to adjust the brightness of the high-bitwidth image to obtain a high-bitwidth image with adjusted brightness. It is understandable that other nonlinear tone mapping methods may also be used in this implementation, which is not specifically limited here.

[0065] In this embodiment, the image to be adjusted is brightened to a high BIT image to avoid errors caused by quantization. Because calculations are generally performed within the range of integer values, in order to prevent computing resources from being calculated on floating-point types, numerical adjustments are performed after conversion to a high BIT image to ensure better accuracy, and to ensure that the brightness and dynamics of the image to be adjusted in different scenes are adjusted to an appropriate range.

[0066] In one embodiment, the step of performing nonlinear tone mapping on pixel values ​​of the high bit width image to obtain the high bit width image after adjusting brightness includes:

[0067] The pixel values ​​of the high-bit-width image are corrected using a correction function to obtain pixel values ​​of the high-bit-width image after tone mapping.

[0068] The terminal can perform nonlinear tone mapping on the pixel values ​​of the high-bitwidth image to obtain a high-bitwidth image with adjusted brightness. Specifically, the terminal can use the Gamma correction method to perform tone mapping, that is, use the Gamma correction formula on the pixel value Value of the image to obtain the mapped pixel value OutValue. If gamma is equal to 1, that is, no nonlinear tone mapping is performed, the gamma value in this embodiment can be pre-set. The specific calculation formula is as follows:

[0069] OutValue=Value gamma (1)

[0070] Among them, the gamma value is the value obtained through multi-scene experimental debugging; Value represents the pixel value of the input image; OutValue represents the pixel value after mapping. In this embodiment, gamma correction is used for tone mapping in order to brighten some darker areas to a certain extent. It is understandable that other correction functions can also be used in this implementation, which is not specifically limited here.

[0071] Therefore, after the image to be adjusted is transformed into a high BIT image, numerical adjustment can ensure better accuracy and ensure that the brightness and dynamics of the image to be adjusted in different scenes are adjusted to an appropriate range.

[0072] In one embodiment, the step of performing nonlinear tone mapping on pixel values ​​of the high bit width image to obtain the high bit width image after adjusting brightness includes:

[0073] According to a pre-configured mapping relationship between pixel values ​​before tone mapping and pixel values ​​after tone mapping, nonlinear tone mapping is performed on the high-bitwidth image to obtain a high-bitwidth image after tone mapping; the mapping relationship is obtained from a pre-set curve graph or mapping table.

[0074] The terminal may perform nonlinear tone mapping on the pixel values ​​of the high-bitwidth image to obtain a high-bitwidth image after adjusting the brightness. Specifically, the terminal may perform nonlinear tone mapping on the high-bitwidth image according to a pre-configured mapping relationship between the pixel values ​​before tone mapping and the pixel values ​​after tone mapping, or the terminal may perform nonlinear tone mapping on the high-bitwidth image according to a pre-configured mapping relationship between the brightness values ​​before tone mapping and the brightness values ​​after tone mapping to obtain a high-bitwidth image after tone mapping; the mapping relationship is obtained by a pre-set curve graph or mapping table. For example, Figure 3 As shown, it is a curve graph of pixel value or brightness value. Figure 3 The horizontal axis is the original pixel value or original brightness value of the image, and the vertical axis is the pixel value or brightness value after tone mapping of the image. Figure 3 The horizontal coordinate of the target point A in represents the original pixel value of the high-bitwidth image, and the vertical coordinate of the target point A represents the pixel value of the high-bitwidth image after tone mapping. Figure 3 It can be a curve graph obtained from multiple experiments. The horizontal axis can be the original pixel value or brightness value of the image, that is, the pixel value or brightness value before the image tone mapping, and the vertical axis is the pixel value or brightness value after the image tone mapping. The terminal can use this curve to perform nonlinear tone mapping processing, such as Figure 3 The horizontal coordinate of the target point A is 4.5, which means that the original pixel value or brightness value of the high-bit width image is 4. The terminal can Figure 3 The mapping relationship of the middle curve is found, when the horizontal coordinate of the target point A is 4, the vertical coordinate corresponding to the target point A is 6.5, that is, the terminal can perform nonlinear tone mapping on the high-bitwidth image according to the above mapping relationship, and obtain the pixel value or brightness value of the high-bitwidth image after tone mapping is 6.5. As a result, after the image to be adjusted is transformed into a high-BIT image, the numerical adjustment can ensure better accuracy, and can ensure that the brightness and dynamics of the image to be adjusted in different scenes are adjusted to the appropriate range.

[0075] In one embodiment, Figure 4 As shown, the step of splitting the high bit width image according to the preset gain value to obtain split images of different brightness includes:

[0076] Step 402, obtaining the target number of split images.

[0077] Step 404: Obtain a gain value generated based on the target quantity.

[0078] Step 406 , splitting the high bit width image according to the gain value to obtain a target number of split images after splitting.

[0079] The target number refers to the number of split images obtained after splitting the high-bitwidth image. For example, assuming that the high-bitwidth image is split into three brightness values, that is, the number of split images obtained after the splitting process is three, then the target number of split images is three.

[0080] Specifically, the terminal can obtain the target number of split images obtained after splitting the high-bitwidth image, and obtain a gain value generated based on the target number, wherein the gain value can be automatically generated according to a preset gain function, or can be a pre-set gain value directly obtained by the terminal. Further, the terminal can split the high-bitwidth image according to the gain value to obtain the target number of split images after the splitting process. For example, the terminal first obtains the target number of split images obtained after splitting the high-bitwidth image. Suppose it is split into 3 8BIT images, that is, the target number of split images obtained by the terminal is 3, and then the terminal calculates the corresponding gain value. Suppose the terminal calculates the gain value according to the preset function to be 2. 0 , 2 1and 2 2 . Further, the terminal can split the high BIT image according to the gain value calculated above to obtain three 8BIT images with different brightness values, that is, simulate multiple frames of images with three different exposure levels. It can be understood that this embodiment includes but is not limited to splitting into other numbers of 8BIT images, such as splitting into four 8BIT images, and the gain value can be set to 2 0 , 2 2 / 3 , 2 4 / 3 and 2 2 wait.

[0081] As a result, the terminal can perform splitting processing based on the high-bitwidth image and the corresponding gain value to obtain split images with different brightness values. The split images can be used to simulate multi-level exposure images to provide more detailed information and ensure that the output target image has better accuracy.

[0082] In one embodiment, the method further comprises the step of obtaining at least two gain values, specifically comprising:

[0083] Acquire at least two gain values; the gain values ​​are generated based on a preset gain function;

[0084] The high bit width image is split according to at least two gain values ​​to obtain at least two frames of split images with different brightness after the split.

[0085] Specifically, the terminal can obtain at least two gain values, which can be generated based on a preset gain function. The terminal splits the high bit width image according to the at least two gain values ​​to obtain at least two frames of split images with different brightness after the splitting process. For example, assuming that the preset gain function is y=2 N , where N represents the number of images, and y represents the gain value. For another example, assuming that the preset gain function is y=ax, where a represents the preset coefficient, x represents the brightness value of the image, and y represents the gain value.

[0086] For example, a system can be designed to automatically generate corresponding gain values ​​according to a calculation formula, such as calculating the average brightness mean (range between 0-255) of an image. When the brightness value is 50, the terminal automatically calculates a gain value of 50.0 / mean, 50.0 / mean is the ratio of 50.0 to mean; when the brightness value is 100, the terminal automatically calculates a gain value of 100.0 / mean, 100.0 / mean is the ratio of 100.0 to mean; when the brightness value is 150, the terminal automatically calculates a gain value of 150.0 / mean, 150.0 / mean is the ratio of 150.0 to mean; when the brightness value is 200, the terminal automatically calculates a gain value of 200.0 / mean, 200.0 / mean is the ratio of 200.0 to mean. It can be understood that the gain value calculation method in this embodiment includes but is not limited to the use of the above-mentioned gain value calculation method, and can also be other gain value calculation methods.

[0087] In this embodiment, the terminal can automatically calculate the corresponding gain value based on the image to be adjusted, and split the image to be adjusted according to the gain value, providing more brightness information for the subsequent fusion of the split images, so that the image to be adjusted can be adjusted to a suitable range for both brightness and dynamics, effectively improving the brightness and dynamic effects of the adjusted image.

[0088] In one embodiment, the method further comprises:

[0089] Performing brightness splitting processing on the high bit width image according to the gain value to obtain a first output pixel value corresponding to the split image after the brightness splitting processing;

[0090] Calculate the second output pixel value corresponding to the split image after brightness splitting according to the number of bits of the high bit width image;

[0091] The smaller value between the first output pixel value and the second output pixel value is used as the pixel value of the split image after the brightness splitting process.

[0092] The bit width of a high bit width image refers to the number of bits. For example, the number of bits of an image with a bit width of 8 BIT is 8 BIT, and the number of bits of an image with a bit width of 10 BIT is 10 BIT.

[0093] Specifically, after the terminal obtains the gain value generated based on the target quantity, or after the terminal obtains at least two gain values ​​generated based on the preset gain function, the terminal can perform brightness splitting processing on the high-bitwidth image according to the gain value to obtain the first output pixel value corresponding to the split image after the brightness splitting processing. Furthermore, the terminal can calculate the second output pixel value corresponding to the split image after the brightness splitting processing according to the number of bits of the high-bitwidth image; the terminal uses the smaller value of the first output pixel value and the second output pixel value as the pixel value of the split image after the brightness splitting processing, that is, the terminal selects the minimum value of the first output pixel value and the second output pixel value, and uses the minimum value as the pixel value of the split image after the brightness splitting processing.

[0094] For example, the following uses an 8BIT image as an example. The terminal first obtains the target number of split images obtained after splitting the high-bit width image. Assume that it is split into 3 8BIT images, and then the terminal calculates the corresponding gain value. Assume that the terminal calculates the gain value according to the preset function to be 2 0 , 2 1 and 2 2 Furthermore, the terminal can split the high BIT image according to the gain value calculated above to obtain three 8BIT images with different brightness, that is, simulate multiple frames of images with three different exposure levels. The specific calculation formula is as follows:

[0095] OutValue=min(255,Value / 2 N ) (2)

[0096] Among them, OutValue is the output pixel value, Value is the input pixel value, 2 N is the gain value, and min refers to the minimum value of the two values. It can be understood that the 255 in the above formula (2) varies according to the bit width of the image. The number of bits of an 8BIT image is 8BIT, so the range of the brightness or chromaticity value is 0-255. If it is a 10BIT image, the range is 0-1023, and formula (2) can be transformed into:

[0097] OutValue=min(1023,Value / 2 N ) (3)

[0098] Assume that the input pixel value of the high bit width image is 100 and the gain value is 2 0 , the terminal calculates according to the above formula (2), and finally obtains the output OutValue = min (255, 100 / 2 0 )=100. That is, the terminal uses the gain value 2 0 The high bit width image is subjected to brightness splitting processing, and the first output pixel value corresponding to the split image after brightness splitting processing is obtained as (100 / 20 ), the terminal calculates the second output pixel value of the split image after brightness splitting processing to be 255 according to the number of bits of the high-bit width image 8BIT, and the terminal selects the minimum value between the first output pixel value and the second output pixel value, and uses the minimum value as the pixel value of the split image after brightness splitting processing. As a result, after the image to be adjusted is transformed into a high-bit image, the numerical adjustment can ensure better accuracy, and can ensure that the brightness and dynamics of the image to be adjusted in different scenes are adjusted to the appropriate range.

[0099] In one embodiment, the steps of calculating the fusion weights of the split images according to the pixel values ​​of the split images, and fusing the split images using the fusion weights to obtain the target image include:

[0100] Calculate the fusion weights of at least two frames of split images with different brightness;

[0101] Normalize the fusion weights to obtain normalized weights;

[0102] The split images are Laplace fused according to the normalized weights to obtain the target image.

[0103] Specifically, the terminal calculates the fusion weights of at least two frames of split images with different brightness, and normalizes the calculated fusion weights to obtain normalized weights. The terminal uses the normalized weights to perform Laplacian pyramid fusion on the split images with different brightness to obtain a result image after Laplacian pyramid fusion. The weight of each pixel corresponding to the split images with different brightness is normalized, and the specific formula is as follows:

[0104]

[0105] Among them, weight[i] is the weight of the i-th frame, out_weight[i] is the normalized weight of the i-th frame, and i is an integer greater than 0.

[0106] The weight of each pixel corresponding to the split images with different brightness is normalized because the image calculated after normalization is a normal image. For example, if the calculated weights are 0.8, 0.6, and 0.7, and the corresponding pixel values ​​are 200, 150, and 175, then the final calculated pixel values ​​have exceeded 255. The number of bits of an 8BIT image is 8BIT, so the range of brightness or chromaticity values ​​is 0-255, so the resulting image is problematic.

[0107] In this embodiment, since the optimal fusion weight is selected for each pixel when calculating the fusion weight, the fusion weight is used as an adjustment parameter to adjust the contribution ratio of each split image in the target image. The performance of image brightness in different scenes can be flexibly controlled by selecting the optimal weight in each split image pixel. This optimal fusion weight can ensure that the brightness and dynamics of the final target image are adjusted to the appropriate range, thereby effectively improving the brightness and dynamic effects of the output target image.

[0108] In one embodiment, the step of calculating the fusion weight of at least two frames of split images with different brightness includes:

[0109] The pixel values ​​of at least two frames of split images with different brightness are input into a preset weight function, and the fusion weight corresponding to each frame of the split image is output.

[0110] The preset fusion weight function includes the mean, variance and fusion coefficient of the image, and the fusion coefficient of the image can be set in advance according to experimental data.

[0111] Specifically, the terminal can input the pixel values ​​of at least two frames of split images with different brightness into a preset weight function, and output the fusion weight corresponding to each frame of the split image; the preset fusion weight function includes the mean, variance and fusion coefficient of the image. That is, the terminal calculates the corresponding fusion weight for the split images with different brightness. The specific method of calculating the weight is as follows:

[0112]

[0113] Among them, x is the input pixel value, weight is the weight, mean and sigma are weight parameters.

[0114] The weight parameters mean and sigma can be specific parameters obtained from experiments. For example, mean=1.5*M, sigma=2.0*S can be obtained from experiments. The physical meanings of M and S are the mean and standard deviation of the image, respectively. S 2 The corresponding physical meaning is the variance of the image, where 1.5 in mean=1.5*M is a preset fusion coefficient, and 2.0 in sigma=2.0*S is also a preset fusion coefficient.

[0115] It can be understood that the calculation method of the fusion weight in the embodiment of the present application includes but is not limited to the above method, and can also be other methods of calculating the fusion weight.

[0116] In this embodiment, the performance of image brightness in different scenes can be flexibly controlled by selecting the optimal weight in each split image pixel. This optimal fusion weight can ensure that the brightness and dynamics of the final target image are adjusted to the appropriate range, thereby effectively improving the brightness and dynamic effects of the output target image.

[0117] In one embodiment, if Figure 5 As shown, the split image includes a third image and a fourth image, and the brightness of the third image is higher than that of the fourth image; the step of calculating the fusion weight of at least two frames of split images with different brightness includes:

[0118] Step 502, if the pixel value of the third image is less than the preset pixel critical value, a first fusion weight is calculated according to the number of bits of the high bit width image, the first fusion weight is used as the fusion weight of the third image, and zero is used as the fusion weight of the fourth image.

[0119] Step 504, if the pixel value of the third image is greater than or equal to the preset pixel critical value, the fusion weight of the fourth image is calculated based on the pixel value of the third image and the preset weight coefficient, and the fusion weight of the third image is calculated based on the first fusion weight and the fusion weight of the fourth image.

[0120] Specifically, the third image may be a bright frame image, and the fourth image may be a dark frame image, that is, when the split image includes a bright frame image and a dark frame image, when calculating the fusion weight of the two split images of different brightness, the terminal may determine whether the pixel value of the bright frame image is less than a preset pixel critical value; if the pixel value of the bright frame image is less than the preset pixel critical value, the terminal calculates the first fusion weight according to the number of bits of the high-bitwidth image, uses the first fusion weight as the fusion weight of the bright frame image, and uses zero as the fusion weight of the dark frame image; if the pixel value of the bright frame image is greater than or equal to the preset pixel critical value, the terminal calculates the fusion weight of the dark frame image according to the pixel value of the bright frame image and the preset weight coefficient, and calculates the fusion weight of the bright frame image according to the first fusion weight and the fusion weight of the dark frame image.

[0121] For example, let's take two 8BIT images with different brightness as an example. That is, when there are only two 8BIT images with different brightness, the specific calculation method is as follows:

[0122] When x<192 pixel value, weight1=0, weight2=255;

[0123] When x is greater than or equal to 192 pixel values, weight1=(x-192)*4, weight2=255-weight1.

[0124] Among them, x represents the pixel value of the bright frame image, weight1 represents the weight of the dark frame image, and weight2 represents the weight of the bright frame image.

[0125] The above calculation method is designed in that when the bright frame image starts from the preset pixel critical value of 192 pixels and gradually approaches overexposure, the weight of the dark frame image becomes larger and larger, and the overexposed area of ​​the bright frame image uses more dark frame information, so that the overexposed area retains dynamic information.

[0126] In this embodiment, by performing Laplace fusion on split images of different brightness, since the optimal weight is selected for each pixel when calculating the fusion weight, this optimal weight can ensure that the brightness and dynamics of the final output target image are adjusted to an appropriate range.

[0127] In one embodiment, the method provided in the embodiment of the present application can be applied to a scene based on taking photos with a mobile phone camera. The following takes the scene of taking photos with a mobile terminal as an example to illustrate the image adjustment method provided in the embodiment of the present application.

[0128] In the traditional way, the image after merging the bright and dark frames of HDR is directly processed by Tonemapping to adjust the brightness, including global Tonemapping or local Tonemapping, to obtain a target image with appropriate brightness and dynamic range. It is difficult for this single Tonemapping module to adjust the brightness and dynamic range to a suitable range, and it is difficult to cover good effects for different scenes. For example, the darker areas in a shooting scene are brightened to a suitable degree, but the same module may brighten the brighter areas in the same scene too much, or may not brighten the darker areas enough, so it is difficult to cover the adjustment effects of different scenes.

[0129] Therefore, in the embodiment of the present application, a method for simulating exposure and multi-frame Laplace fusion to compress dynamic images and adjust brightness is proposed. Figure 6As shown, it is a processing flow chart of the HDR fused image by the mobile terminal. First, the mobile terminal obtains the HDR fused image as the input image through the HDR (High Dynamic Range Image, High-Dynamic Range, HDR for short) bright and dark frame fusion module, and then brightens the fused image to a high BIT (bit width) image through the global brightening module, and divides the fully brightened high BIT image by different gain values ​​to obtain low BIT images of different brightness to simulate multi-level exposure images, and performs Laplace fusion on the low BIT images of different brightness to obtain an output image with brightness and dynamics adjusted to a suitable range. Among them, the mobile terminal obtains the HDR fused image through the HDR bright and dark frame fusion module, which can be a bright and dark frame image taken by the mobile terminal in certain specific scenes, and automatically calculates the weights of the input bright frame image and dark frame image, and then uses the weights to fuse the bright frame image and the dark frame image to obtain the HDR fused image.

[0130] The reason why the fused image is brightened to a high BIT (bit width) image through the global brightening module in the embodiment of the present application is to avoid the error caused by quantization. In order to prevent the computing resources from being calculated on floating point types, the high BIT image is used to ensure better numerical accuracy. In addition, in some scenes, low BIT images of different brightness can be directly obtained, which may cause some precision loss. If acceptable, this method can also be adopted.

[0131] Among them, the processing flow of the image stretching and brightening module is as follows: Figure 7 The figure shows the processing flow chart of the image stretching and brightening module. The specific processing steps are as follows:

[0132] 1. The HDR fused image is usually an 8BIT image. The mobile terminal can linearly scale the acquired fused image to a high BIT image by multiplying it by a gain value.

[0133] 2. The mobile terminal can multiply the 8BIT image by a gain value of 4, that is, multiply the image pixel by pixel by 4 to obtain a 10BIT image. The present application embodiment includes but is not limited to multiplying different gain values ​​to obtain images of different BIT positions for calculation.

[0134] 3. The mobile terminal uses nonlinear tone mapping to adjust the brightness of the high BIT image. The mobile terminal can use the Gamma correction method to perform tone mapping, that is, use the Gamma correction formula to the pixel value Value of the image to obtain the mapped pixel value OutValue. If gamma is equal to 1, no nonlinear tone mapping is performed, and its specific calculation formula is the aforementioned formula (1). In this embodiment, Gamma correction is used for tone mapping in order to brighten some darker areas to a certain extent. Gamma correction can also be used for tone mapping, or other alternative nonlinear tone mapping methods can be used, such as those obtained based on multiple experiments. Figure 3 A curve is shown, through which nonlinear tone mapping processing is performed.

[0135] Regarding the processing flow of splitting into 8BIT images of different brightness to simulate multi-level exposure, the specific processing steps are as follows:

[0136] The mobile terminal first calculates different gain values, which are split into three 8BIT images, and the gain values ​​are designed to be 2 to the power of 0, 2 to the power of 1, and 2 to the power of 2. The mobile terminal splits the high BIT image according to the gain values ​​calculated above to obtain 8BIT images of different brightness, and obtains three 8BIT images of different brightness, that is, simulating multiple frames of images with three different exposure levels, wherein the specific calculation formula is as shown in the above formula (2).

[0137] The processing flow of Laplace fusion of 8BIT images with different brightness is as follows: Figure 8 As shown in FIG. 1 , it is a processing flow chart of Laplace fusion of 8BIT images of different brightness. The specific processing steps are as follows:

[0138] 1. The mobile terminal calculates the fusion weight for 8BIT images of different brightness. The weight calculation method is as shown in the above formula (4). Other alternative weight calculation methods, such as when there are only two 8BIT images of different brightness, are designed as follows:

[0139] When x<192 pixel value, weight1=0, weight2=255;

[0140] When x is greater than or equal to 192 pixel values, weight1=(x-192)*4, weight2=255-weight1.

[0141] Among them, x(bright frame) represents the pixel value of the bright frame image, weight(dark frame) represents the weight of the dark frame image, and weight(bright frame) represents the weight of the bright frame image.

[0142] 2. The mobile terminal normalizes the weight of each pixel corresponding to images of different brightness. The specific method of calculating the weight is as shown in the above formula (5).

[0143] 3. The mobile terminal uses the normalized weights to perform Laplacian pyramid fusion on the images of different brightness to obtain a result image after Laplacian pyramid fusion.

[0144] In this embodiment, the low BIT images of different brightness are finally Laplace fused. Since the optimal weight is selected for each pixel when calculating the fusion weight, this optimal weight can ensure that the brightness and dynamics of the final target result image are adjusted to the appropriate range, that is, the image after multi-frame fusion of HDR is adjusted to an image with brightness and dynamics adjusted to the appropriate range, which effectively improves the brightness and dynamic effects of the image.

[0145] It should be understood that although Figure 1-8 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-8 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0146] Fig. 9 FIG. 1 is a structural block diagram of an image adjustment device according to an embodiment. Fig. 9 As shown, an image adjustment device is provided, including: an acquisition module 902, a processing module 904, a splitting processing module 906, a calculation module 908 and a fusion module 910, wherein:

[0147] The acquisition module 902 is used to acquire the image to be adjusted.

[0148] The processing module 904 is used to stretch the image to be adjusted to obtain a high-bitwidth image.

[0149] The splitting processing module 906 is used to split the high bit width image according to a preset gain value to obtain split images with different brightness.

[0150] The calculation module 908 is used to calculate the fusion weight of the split images according to the pixel values ​​of the split images.

[0151] The fusion module 910 is used to fuse the split images using the fusion weights to obtain a target image.

[0152] In one embodiment, the calculation module is further used to calculate the weights of the input first image and the second image respectively, to obtain a first weight corresponding to the first image and a second weight corresponding to the second image, wherein the brightness of the first image is higher than the brightness of the second image. The fusion module is further used to fuse the first image and the second image based on the first weight and the second weight to obtain the image to be adjusted. In one embodiment, the processing module is further used to linearly stretch the image to be adjusted to obtain a high-bitwidth image; and to perform nonlinear tone mapping on the pixel values ​​of the high-bitwidth image to obtain the high-bitwidth image after adjusting the brightness.

[0153] In one embodiment, the calculation module is further used to correct the pixel values ​​of the high bit width image using a correction function to obtain the pixel values ​​of the high bit width image after tone mapping.

[0154] In one embodiment, the processing module is also used to perform nonlinear tone mapping on the high-bitwidth image according to a pre-configured mapping relationship between pixel values ​​before tone mapping and pixel values ​​after tone mapping to obtain a high-bitwidth image after tone mapping; the mapping relationship is obtained by a pre-set curve graph or mapping table.

[0155] In one embodiment, the acquisition module is further used to acquire a target number of split images and to acquire a gain value generated based on the target number. The processing module is further used to split the high bit width image according to the gain value to obtain the target number of split images after the splitting process.

[0156] In one embodiment, the acquisition module is further used to acquire at least two gain values, which are generated based on a preset gain function. The processing module is further used to split the high bit width image according to the at least two gain values ​​to obtain at least two frames of split images with different brightness after the splitting process.

[0157] In one embodiment, the device further includes: a selection module.

[0158] The splitting processing module is also used to perform brightness splitting processing on the high bit width image according to the gain value to obtain a first output pixel value corresponding to the split image after the brightness splitting processing. The calculation module is also used to calculate the second output pixel value corresponding to the split image after the brightness splitting processing according to the number of bits of the high bit width image. The selection module is used to use the smaller value of the first output pixel value and the second output pixel value as the pixel value of the split image after the brightness splitting processing.

[0159] In one embodiment, the calculation module is further used to calculate the fusion weights of at least two frames of split images with different brightness. The processing module is further used to normalize the fusion weights to obtain the normalized weights. The fusion module is further used to perform Laplace fusion on the split images according to the normalized weights to obtain the target image.

[0160] In one embodiment, the device further includes: an input module.

[0161] The input module is used to input the pixel values ​​of at least two frames of split images with different brightness into a preset weight function, and output a fusion weight corresponding to each frame of the split image.

[0162] In one embodiment, the calculation module is also used to calculate a first fusion weight based on the number of bits of the high-bitwidth image if the pixel value of the third image is less than a preset pixel critical value, and use the first fusion weight as the fusion weight of the third image, and use zero as the fusion weight of the fourth image; if the pixel value of the third image is greater than or equal to the preset pixel critical value, calculate the fusion weight of the fourth image based on the pixel value of the third image and the preset weight coefficient, and calculate the fusion weight of the third image based on the first fusion weight and the fusion weight of the fourth image.

[0163] The division of the modules in the above-mentioned image adjustment device is only for illustration. In other embodiments, the image adjustment device may be divided into different modules as needed to complete all or part of the functions of the above-mentioned image adjustment device.

[0164] For the specific definition of the image adjustment device, please refer to the definition of the image adjustment method above, which will not be repeated here. Each module in the above-mentioned image adjustment device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0165] Fig.10Schematic diagram of the internal structure of an electronic device in an embodiment. The electronic device can be any terminal device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a car computer, a wearable device, etc. The electronic device includes a processor and a memory connected via a system bus. Among them, the processor may include one or more processing units. The processor may be a CPU (Central Processing Unit) or a DSP (Digital Signal Processing), etc. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement an image adjustment method provided in each of the following embodiments. The internal memory provides a cache operating environment for the operating system computer program in the non-volatile storage medium.

[0166] The implementation of each module in the image adjustment device provided in the embodiment of the present application can be in the form of a computer program. The computer program can be run on a terminal or a server. The program module constituted by the computer program can be stored in the memory of the electronic device. When the computer program is executed by the processor, the steps of the method described in the embodiment of the present application are implemented.

[0167] The embodiment of the present application further provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, when the computer-executable instructions are executed by one or more processors, the processors execute the steps of the image adjustment method.

[0168] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the image adjustment method.

[0169] Any reference to memory, storage, database or other medium used in this application may include non-volatile and / or volatile memory. Non-volatile memory may include ROM (Read-Only Memory), PROM (Programmable Read-only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-only Memory) or flash memory. Volatile memory may include RAM (Random Access Memory), which is used as an external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as SRAM (Static Random Access Memory), DRAM (Dynamic Random Access Memory), SDRAM (Synchronous Dynamic Random Access Memory), Double Data Rate DDRSDRAM (Double Data Rate Synchronous Dynamic Random Access memory), ESDRAM (Enhanced Synchronous Dynamic Random Access memory), SLDRAM (Sync Link Dynamic Random Access Memory), RDRAM (Rambus Dynamic Random Access Memory), and DRDRAM (Direct Rambus Dynamic Random Access Memory).

[0170] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An image adjustment method, characterized in that: include: Obtain the image to be adjusted; Stretching the image to be adjusted to obtain a high bit width image; Splitting the high bit width image according to a preset gain value to obtain split images with different brightness; Calculating the fusion weights of at least two frames of the split images with different brightness, including: inputting pixel values ​​of at least two frames of the split images with different brightness into a preset weight function, and outputting a fusion weight corresponding to each frame of the split image, wherein the preset weight function includes a mean value, a variance, and a fusion coefficient of the image; The split images are fused using the fusion weights to obtain a target image.

2. The method according to claim 1, characterized in that The step of obtaining the image to be adjusted includes: Calculating weights of a first image and a second image respectively to obtain a first weight corresponding to the first image and a second weight corresponding to the second image; wherein the brightness of the first image is higher than the brightness of the second image; Based on the first weight and the second weight, the first image and the second image are fused to obtain the image to be adjusted.

3. The method according to claim 1, characterized in that The step of stretching the image to be adjusted to obtain a high bit width image includes: Linearly stretching the image to be adjusted to obtain a high-bitwidth image; The method further comprises: Nonlinear tone mapping is performed on the pixel values ​​of the high-bitwidth image to obtain a high-bitwidth image with adjusted brightness.

4. The method according to claim 3, characterized in that The performing nonlinear tone mapping on the pixel values ​​of the high bit width image to obtain the high bit width image after adjusting the brightness includes: The pixel values ​​of the high bit width image are corrected by using a correction function to obtain pixel values ​​of the high bit width image after tone mapping.

5. The method according to claim 3, characterized in that: The performing nonlinear tone mapping on the pixel values ​​of the high bit width image to obtain the high bit width image after adjusting the brightness includes: According to a pre-configured mapping relationship between pixel values ​​before tone mapping and pixel values ​​after tone mapping, nonlinear tone mapping is performed on the high bit width image to obtain a high bit width image after tone mapping; the mapping relationship is obtained from a pre-set curve graph or mapping table.

6. The method according to claim 1, characterized in that The step of splitting the high bit width image according to a preset gain value to obtain split images with different brightness includes: Obtaining a target number of split images; Obtaining a gain value generated based on the target quantity; The high bit width image is split according to the gain value to obtain the target number of split images after the split.

7. The method according to claim 6, characterized in that The method further comprises: Acquire at least two gain values; the gain values ​​are generated based on a preset gain function; The high bit width image is split according to at least two gain values ​​to obtain at least two frames of split images with different brightness after the split.

8. The method according to claim 6 or 7, characterized in that: The method further comprises: Performing brightness splitting processing on the high bit width image according to the gain value to obtain a first output pixel value corresponding to the split image after the brightness splitting processing; Calculating, according to the number of bits of the high bit width image, a second output pixel value corresponding to the split image after the brightness splitting process; The smaller value between the first output pixel value and the second output pixel value is used as the pixel value of the split image after the brightness splitting process.

9. The method according to claim 1, characterized in that: The step of fusing the split images using the fusion weights to obtain a target image includes: Normalizing the fusion weight to obtain a normalized weight; The split images are subjected to Laplace fusion according to the normalized weights to obtain a target image.

10. The method according to claim 1, characterized in that The split image includes a third image and a fourth image, and the brightness of the third image is higher than the brightness of the fourth image; The calculating of the fusion weight of at least two frames of the split images with different brightness also includes: If the pixel value of the third image is less than the preset pixel critical value, a first fusion weight is calculated according to the number of bits of the high bit width image, the first fusion weight is used as the fusion weight of the third image, and zero is used as the fusion weight of the fourth image; If the pixel value of the third image is greater than or equal to the preset pixel critical value, the fusion weight of the fourth image is calculated based on the pixel value of the third image and the preset weight coefficient, and the fusion weight of the third image is calculated based on the first fusion weight and the fusion weight of the fourth image.

11. An image adjustment device, characterized in that: include: An acquisition module, used for acquiring an image to be adjusted; A processing module, used for stretching the image to be adjusted to obtain a high bit width image; A splitting processing module, used for splitting the high bit width image according to a preset gain value to obtain split images with different brightness; A calculation module, used for inputting pixel values ​​of at least two frames of the split images with different brightness into a preset weight function, and outputting a fusion weight corresponding to each frame of the split image, wherein the preset weight function includes a mean value, a variance and a fusion coefficient of the image; The fusion module is used to fuse the split images using the fusion weights to obtain a target image.

12. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the image adjustment method according to any one of claims 1 to 10.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

14. A computer program product comprising instructions, characterized in that When the image adjustment method is executed on a computer, the computer is enabled to execute the steps of the image adjustment method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Image processing method and apparatus for terminal, and terminal

    CN107534735A

  • Image processing method and device, terminal equipment and storage medium

    CN109727215A