Backlight image processing method, device, equipment, storage medium and program product
By brightening dark tones, suppressing highlights, and enhancing edges in backlit images, and then fusing and performing tone correction and smoothing, the problems of lost facial details and fogging in backlit image processing are solved, achieving high-quality backlit image processing that is suitable for application on terminal devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU BAIGUOYUAN INFORMATION TECH CO LTD
- Filing Date
- 2023-09-05
- Publication Date
- 2026-06-16
Smart Images

Figure CN117094911B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, storage medium, and program product for processing backlight images. Background Technology
[0002] Backlit images refer to images where there is a strong light source behind the subject, resulting in overexposure of the light source and underexposure of the subject. This causes the background to appear too bright while the foreground subject appears too dark. When backlit images or videos occur, mapping and transforming the RGB channel component values can improve the image or video quality, providing users with a better subjective experience.
[0003] In related technologies, the enhancement of backlit images mainly falls into two categories: traditional methods and deep learning methods. Traditional methods use data analysis and statistics to adaptively transform and adjust the image, while deep learning methods generally rely on end-to-end training and fitting of existing data, directly using the trained model to enhance the image. Traditional backlit image enhancement methods primarily rely on statistical information about the image itself, such as image tone and histogram, to perform adaptive transformations and adjustments. Examples include histogram equalization, retinal cortex theory, and homomorphic filtering. However, these methods perform poorly when enhancing backlit images containing faces, resulting in issues such as loss of facial details, unnatural facial features, and image fogging. Deep learning methods, on the other hand, use data fitting. By constructing scene datasets and training end-to-end models, the trained model is directly used to fit the backlit enhancement result. However, deep learning methods require significant computation to achieve good enhancement results, making them unsuitable for on-device deployment. Summary of the Invention
[0004] This application provides a backlight image processing method, apparatus, device, storage medium, and program product, which can effectively improve image quality in backlight scenes and make the processed image more natural.
[0005] In a first aspect, embodiments of this application provide a backlight image processing method, the method comprising:
[0006] The acquired backlight images were processed by brightening the shadows, suppressing the highlights, and enhancing the edges to obtain brightened, suppressed, and edge-enhanced images, respectively.
[0007] The brightened image, the suppressed image, and the edge enhancement image are fused to obtain an enhanced image, and the enhanced image is then subjected to tone correction to obtain a corrected image;
[0008] A backlight-enhanced image is obtained by performing midtone smoothing processing on the corrected image and the backlight image.
[0009] Secondly, embodiments of this application also provide a backlight image processing apparatus, comprising:
[0010] The first processing module is configured to perform brightening of shadows, suppression of highlights, and edge enhancement on the acquired backlight image to obtain a brightened image, a suppressed image, and an edge enhanced image, respectively.
[0011] The fusion module is configured to fuse the brightened image, the suppressed image, and the edge-enhanced image to obtain an enhanced image;
[0012] The correction module is configured to perform tone correction on the enhanced image to obtain a corrected image;
[0013] The second processing module is configured to perform midtone smoothing processing on the corrected image and the backlight image to obtain a backlight enhanced image.
[0014] Thirdly, embodiments of this application also provide a backlight image processing device, the device comprising:
[0015] One or more processors;
[0016] Storage device for storing one or more programs.
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the backlight image processing method described in the embodiments of this application.
[0018] Fourthly, embodiments of this application also provide a non-volatile storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform the backlight image processing method described in embodiments of this application.
[0019] Fifthly, embodiments of this application also provide a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device reads from the computer-readable storage medium and executes the computer program, causing the device to perform the backlight image processing method described in embodiments of this application.
[0020] In this embodiment, a brightened image, a suppressed image, and an edge-enhanced image are obtained by separately brightening shadows, suppressing highlights, and enhancing edges on the acquired backlight image. These three images are then fused to obtain an enhanced image. Tone correction is applied to the enhanced image to obtain a corrected image. Midtone smoothing is then performed on the corrected image and the backlight image to obtain the enhanced backlight image. In this scheme, by separately brightening shadows, suppressing highlights, and enhancing edges on the backlight image, and then fusing them to obtain the enhanced image, the dark areas of the backlight image can be reasonably brightened and the highlight areas suppressed. Simultaneously, edge enhancement avoids the loss of edge details caused by the brightening and highlight suppression processes. Tone correction of the enhanced image solves the problem of inconsistency between the enhanced image and the original backlight image. Further smoothing resolves the hazy phenomenon that occurs during image enhancement, resulting in a final image that effectively improves image quality in backlight scenes and appears more natural. Attached Figure Description
[0021] Figure 1 A flowchart illustrating a backlight image processing method provided in this application embodiment;
[0022] Figure 2 A flowchart illustrating a method for brightening shadows, suppressing highlights, and enhancing edges in a captured backlit image, as provided in this application embodiment;
[0023] Figure 3 A flowchart of another backlight image processing method is provided for embodiments of this application;
[0024] Figure 4 A flowchart of another backlight image processing method is provided for embodiments of this application;
[0025] Figure 5 A flowchart illustrating a method for calculating a smoothing intensity matrix provided in this application embodiment;
[0026] Figure 6 A structural block diagram of a backlight image processing device provided in an embodiment of this application;
[0027] Figure 7 This is a schematic diagram of the structure of a backlight image processing device provided in an embodiment of this application. Detailed Implementation
[0028] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the scope of the embodiments. Furthermore, it should be noted that, for ease of description, only the parts relevant to the embodiments of this application are shown in the accompanying drawings, not the entire structure.
[0029] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0030] The backlight image processing method provided in this application embodiment can be executed by a computing device, such as a laptop, desktop computer, or smart terminal device. This backlight image processing method can be applied to images or videos taken in backlight scenes, such as videos generated by a user making a video call or live stream in a backlight scene using a mobile phone.
[0031] Figure 1 A flowchart of a backlight image processing method provided in an embodiment of this application is shown below. Figure 1 As shown, the specific steps include the following:
[0032] Step S101: The acquired backlight image is processed by brightening the shadows, suppressing the highlights, and enhancing the edges to obtain the brightened image, the suppressed image, and the edge enhanced image.
[0033] The backlit image refers to an image or video captured by a camera device in a backlit scene. For example, during a video call, videos captured in backlit environments may exhibit an overly bright background while the foreground subject (such as a human figure) is too dark. In one embodiment, the captured backlit image is first processed by brightening shadows, suppressing highlights, and enhancing edges. Brightening shadows brightens the dark areas in the backlit image by remapping the entire image, mapping low-pixel-value areas (dark areas) to the central pixel-value areas (midtone areas). Similarly, suppressing highlights reduces the brightness of highlight areas in the backlit image, mapping high-pixel-value areas (highlight areas) to the midtone areas. To achieve the mapping relationship during brightening shadows and suppressing highlights, operations such as log transformation and gamma transformation can be used. In the process of brightening shadows and suppressing highlights, the edges of the image may become blurred. Edge enhancement processing can be used to preserve the edges of backlit images, thereby improving the contrast and clarity of the final image.
[0034] Optional, Figure 2 A flowchart illustrating a method for brightening shadows, suppressing highlights, and enhancing edges in a captured backlit image, as provided in this application embodiment, is shown below. Figure 2 As shown, it includes:
[0035] Step S1011: Adjust the pixel values in the acquired backlight image based on the set first coefficient and the first mapping formula to obtain a brightened image.
[0036] In one embodiment, when brightening shadows, a gamma transformation is used to map shadow areas, as shown in the following formula example:
[0037]
[0038] Among them, I value ∈[0, 255] represents the pixel values of the input image, γ is the gamma transformation coefficient, and I′ value This represents the pixel value output after gamma transformation. By selecting different gamma transformation coefficients, the original pixel value can be mapped to different regions. The above formula can be used as an exemplary first mapping formula, and the coefficient used is denoted as the first coefficient. An exemplary value for this first coefficient could be 0.5.
[0039] Step S1012: Adjust the pixel values in the acquired backlight image based on the set second coefficient and the second mapping formula to obtain the suppressed image.
[0040] In one embodiment, highlight suppression can employ the same or different transformation method as shadow brightening. The transformation formula used in highlight suppression is denoted as the second mapping formula, and the coefficients used are denoted as the second coefficients. Taking the same gamma transformation as shadow brightening as an example, the formula is shown below:
[0041]
[0042] Among them, I value ∈[0, 255] represents the pixel values of the input image, γ is the gamma transformation coefficient, and I′ value This represents the pixel value output after gamma transformation. In this case, the second coefficient, i.e., the gamma transformation coefficient, can be 2, for example.
[0043] Specifically, when dealing with gamma transformation, if the gamma coefficient is less than 1, the low-pixel value area increases significantly, while the high-pixel value area increases slowly, effectively brightening the dark areas. If the gamma coefficient is greater than 1, the high-pixel value area decreases significantly, while the low-pixel value area decreases slowly, effectively suppressing the highlight areas.
[0044] Step S1013: Based on the set image sharpening algorithm, perform edge sharpening processing on the acquired backlight image to obtain an edge-enhanced image.
[0045] The image sharpening algorithm can be the Unsharp Mask (USM) image sharpening algorithm, and the exemplary process is as follows:
[0046] I u =αI+β(IG(I))
[0047] Where, I∈R H×W To output the image, I u ∈R H×W For the output image, H and W are the height and width of the image, G(·) is the Gaussian filter function, and α and β are the image sharpening coefficients. Intuitively, G(I) performs Gaussian smoothing on the output image to remove noise and details, resulting in a blurred version of the image. (IG(I)) subtracts the blurred version of the original image to obtain a mask image. Edges and details in the mask are highlighted, while other areas are suppressed. I+(IG(I)) overlays the mask onto the original image to enhance the edges and details, thus improving the contrast and sharpness of the image. α and β are used to control the intensity of the mask overlay on the original image; for example, values can be 1 and 1.5.
[0048] The image sharpening algorithm mentioned above can also be calculated using sharpening filters, Canny edge detection, Gaussian pyramids, and other methods.
[0049] It should be noted that the above-mentioned backlight image processing process can be triggered when the device detects that the currently captured image meets the backlight image conditions. The backlight condition can be that the backlight detection value of the acquired image is greater than a preset value. The backlight detection value can be obtained by performing backlight detection on the image through the built-in backlight detection algorithm, which is not the focus of the solution here and will not be elaborated on.
[0050] Step S102: Fuse the brightened image, the suppressed image, and the edge enhancement image to obtain an enhanced image, and perform tone correction on the enhanced image to obtain a corrected image.
[0051] In one embodiment, after obtaining the brightened image, the suppressed image, and the edge-enhanced image, they are fused to obtain the enhanced image. The fusion process can be achieved by multiplying the brightened image, the suppressed image, and the edge-enhanced image by different weight values, and then summing the products to obtain the enhanced image. Taking an RGB image format as an example, the fusion process calculates and fuses the values of the three RGB channels of the image separately.
[0052] In one embodiment, because the backlight image differs in tone from the original backlight image after brightening shadows, suppressing highlights, and enhancing edges, such as when the image enhancement and fusion process enhances the R, G, and B channels of the image separately, the enhancement magnitude of one channel may be much greater than that of the others, resulting in a tone inconsistency between the enhanced image I′ and the original input image I. Therefore, tone correction is performed to obtain a corrected image. The tone correction process can employ conventional methods in the art. Optionally, this solution uses projection of the enhanced image onto the color space of the backlight image to obtain the corrected image. An exemplary process is as follows:
[0053]
[0054] Among them, I c I represents the tonal-corrected image, I' represents the original backlit image, and I' represents the enhanced image.
[0055] Step S103: Perform midtone smoothing processing on the corrected image and the backlight image to obtain the backlight enhancement image.
[0056] In one embodiment, the brightening of dark areas and suppression of highlight areas can cause pixels in the midtones of the original image I to alternate with those in the enhanced image I′, resulting in a hazy appearance. This phenomenon is addressed here through midtone smoothing. Optionally, during the smoothing process, the pixel value regions in the image that are more clearly perceived by the human eye are defined as midtones, and the midtone regions are kept consistent with the original image I.
[0057] As described above, by performing highlight enhancement, highlight suppression, and edge enhancement on the acquired backlight image, respectively, brightening, suppressing, and edge-enhanced images are obtained. These images are then fused to obtain an enhanced image. Tone correction is applied to the enhanced image to obtain a corrected image. Finally, midtone smoothing is performed on the corrected image and the backlight image to obtain the enhanced backlight image. In this scheme, by performing highlight enhancement, highlight suppression, and edge enhancement on the backlight image separately, and then fusing them to obtain the enhanced image, the scheme effectively brightens the dark areas and suppresses the bright areas of the backlight image. Simultaneously, edge enhancement avoids the loss of edge details caused by highlight enhancement and highlight suppression. Tone correction on the enhanced image resolves the inconsistency between the enhanced image and the original backlight image. Further smoothing resolves the hazy phenomenon that occurs during image enhancement, resulting in a final image that effectively improves image quality in backlight scenes and appears more natural.
[0058] Figure 3 A flowchart of another backlight image processing method is provided for embodiments of this application, and an optional image fusion method is given, such as... Figure 3 As shown, it includes:
[0059] Step S201: The acquired backlight image is processed by brightening the shadows, suppressing the highlights, and enhancing the edges to obtain the brightened image, the suppressed image, and the edge enhanced image.
[0060] Step S202: Calculate the percentage weight map of pixel values in the brightened image, suppressed image and edge enhanced image respectively. The percentage weight map records the percentage weight of each pixel value. The closer the pixel value is to the center pixel value, the higher the percentage weight of the corresponding pixel value.
[0061] In one embodiment, a weighted map is first obtained by calculating the proportion of pixel values for each processed image. An exemplary calculation process is as follows:
[0062]
[0063] Where W∈R H×W×3 For the weight map of the RGB image, I k ∈R H×W×3 These refer to the brightened image, suppressed image, and edge-enhanced image, respectively. σ is the coefficient of the Gaussian function, which can be optionally set to 0.3.
[0064] Among these, the pixel value most noticeably perceived by the human eye is at the very center of the image, i.e., 127.5, where the pixel percentage is the highest, equal to 1. Pixel values further away from the center appear darker (or brighter), and their pixel percentages are lower. This embodiment uses a Gaussian curve to calculate the weight of pixels that are off-center. Specifically, This indicates that the pixel values are normalized to [0, 1], where 0.5 represents the center pixel value. This indicates the degree to which each pixel value deviates from the center.
[0065] Step S203: Based on the brightened image, the suppressed image, and the edge enhancement image, and their respective calculated proportion weight maps, perform fusion processing to obtain the enhanced image.
[0066] In one embodiment, the proportion weight maps corresponding to the brightened image, the suppressed image, and the edge-enhanced image are obtained, and the three are fused to obtain the enhanced image. Optional calculation formulas are as follows:
[0067]
[0068] Among them, k∈{brighten, darken, sharpen}, I′∈R H×W×3 This is the output image after weighted fusion. Here, `brighten` represents brightening shadows, `darken` represents suppressing highlights, and `sharpen` represents edge enhancement.
[0069] The specially configured image fusion method described above makes the resulting enhanced image more closely resemble human subjective perception and has a higher degree of naturalness. It should be noted that the normalized weighted fusion method described above can also be used to obtain the enhanced image through multi-scale fusion methods such as image pyramids.
[0070] Step S204: Perform tone correction on the enhanced image to obtain a corrected image, and perform midtone smoothing processing on the corrected image and the backlight image to obtain a backlight enhanced image.
[0071] As described above, by performing highlight enhancement, highlight suppression, and edge enhancement on the acquired backlight image, respectively, brightening, suppressing, and edge-enhanced images are obtained. These images are then fused to obtain an enhanced image. Tone correction is applied to the enhanced image to obtain a corrected image. Finally, midtone smoothing is performed on the corrected image and the backlight image to obtain the enhanced backlight image. In this scheme, by performing highlight enhancement, highlight suppression, and edge enhancement on the backlight image separately, and then fusing them to obtain the enhanced image, the scheme effectively brightens the dark areas and suppresses the bright areas of the backlight image. Simultaneously, edge enhancement avoids the loss of edge details caused by highlight enhancement and highlight suppression. Tone correction on the enhanced image resolves the inconsistency between the enhanced image and the original backlight image. Further smoothing resolves the hazy phenomenon that occurs during image enhancement, resulting in a final image that effectively improves image quality in backlight scenes and appears more natural.
[0072] Figure 4 A flowchart of another backlight image processing method is provided for embodiments of this application, illustrating an optional method for obtaining a backlight-enhanced image, such as... Figure 4 As shown, it includes:
[0073] Step S301: The acquired backlight image is processed by brightening the shadows, suppressing the highlights, and enhancing the edges to obtain the brightened image, the suppressed image, and the edge enhanced image.
[0074] Step S302: Fuse the brightened image, the suppressed image, and the edge enhancement image to obtain an enhanced image, and perform tone correction on the enhanced image to obtain a corrected image.
[0075] Step S303: Obtain the backlight intensity coefficient and the set midtone range of the pixels. Calculate the smoothing intensity matrix based on the pixel values of the backlight image, the midtone range, and the backlight intensity coefficient. Superimpose the corrected image and the backlight image based on the smoothing intensity matrix to obtain the backlight enhancement image.
[0076] The backlight intensity coefficient can be preset or obtained by detecting backlight in the backlight image using a backlight detection algorithm. The midtone range is a set pixel range, which is a pixel value area that is more clearly perceived by the human eye. For example, taking an RGB image with each channel value of [0, 255] as an example, the midtone range is exemplarily [61, 153].
[0077] When calculating the smoothing intensity matrix, one possible method is to determine the minimum pixel value in the RGB channels of the backlit image, and then calculate the smoothing intensity matrix based on the comparison between the minimum pixel value and the midtone intervals, as well as the backlight intensity coefficient. The midtone intervals include the minimum and maximum pixel values, denoted as low and high in the previous example, respectively. The process of calculating the smoothing intensity matrix based on the comparison between the minimum pixel value and the midtone intervals, as well as the backlight intensity coefficient, is as follows: Figure 5 As shown, Figure 5 A flowchart of a method for calculating a smoothing intensity matrix provided in this application embodiment includes:
[0078] Step S3031: When the minimum pixel value is less than the minimum value of the interval, the corresponding matrix value in the smoothing intensity matrix is calculated based on the minimum value of the interval, the pixel value of the backlight image, and the backlight intensity coefficient.
[0079] Step S3032: When the minimum pixel value is greater than the maximum value of the interval, the corresponding matrix value in the smoothing intensity matrix is calculated based on the maximum value of the interval, the pixel value of the backlight image, and the backlight intensity coefficient.
[0080] Step S3033: When the minimum pixel value is in the intermediate tone range, determine that the corresponding matrix value in the smoothing intensity matrix is 0.
[0081] In one embodiment, taking the smoothing intensity matrix as R as an example, the optional calculation process is as follows:
[0082]
[0083] Where ρ is the backlight enhancement intensity, I is the original backlight image, and I min =min(I R I G I B ) represents the minimum value in the R, G, and B channels of the original backlit image, I low I high ∈R H×W These are the minimum and maximum values of the intermediate adjustment interval.
[0084] In one embodiment, after obtaining the smooth intensity matrix R, the corrected image based on the smooth intensity matrix is superimposed with the backlight image to obtain the backlight enhanced image. Optionally, the calculation method can be:
[0085] I out =(I θ -R)·I+R·I c
[0086] Among them, Iout For the output backlight enhancement image, I θ ∈R H×W For an image consisting entirely of 1s, the matrix values in the smoothing intensity matrix described above are normalized values, ranging from 0 to 1. Through these calculations, the pixel portions in the output image that conform to human visual perception remain consistent with the original backlit image, ensuring the image processing effect.
[0087] As described above, by performing highlight enhancement, highlight suppression, and edge enhancement on the acquired backlight image, respectively, brightening, suppressing, and edge-enhanced images are obtained. These images are then fused to obtain an enhanced image. Tone correction is applied to the enhanced image to obtain a corrected image. Finally, midtone smoothing is performed on the corrected image and the backlight image to obtain the enhanced backlight image. In this scheme, by performing highlight enhancement, highlight suppression, and edge enhancement on the backlight image separately, and then fusing them to obtain the enhanced image, the scheme effectively brightens the dark areas and suppresses the bright areas of the backlight image. Simultaneously, edge enhancement avoids the loss of edge details caused by highlight enhancement and highlight suppression. Tone correction on the enhanced image resolves the inconsistency between the enhanced image and the original backlight image. Further smoothing resolves the hazy phenomenon that occurs during image enhancement, resulting in a final image that effectively improves image quality in backlight scenes and appears more natural.
[0088] In one embodiment, the processing of the backlit image described above is performed in the GPU of the terminal device without consuming CPU computing resources, which can significantly reduce the amount of data processing on the CPU.
[0089] Figure 6 A structural block diagram of a backlight image processing device provided in an embodiment of this application is shown below. Figure 6 As shown, this device is used to execute the backlight image processing method provided in the above embodiments, and has the corresponding functional modules and beneficial effects for executing the method. For example... Figure 6 As shown, the device specifically includes: a first processing module 101, a fusion module 102, a correction module 103, and a second processing module 104, wherein,
[0090] The first processing module 101 is configured to perform brightening of shadows, suppression of highlights and edge enhancement on the acquired backlight image to obtain a brightened image, a suppressed image and an edge enhanced image.
[0091] The fusion module 102 is configured to fuse the brightened image, the suppressed image, and the edge-enhanced image to obtain an enhanced image;
[0092] Correction module 103 is configured to perform tone correction on the enhanced image to obtain a corrected image;
[0093] The second processing module 104 is configured to perform midtone smoothing processing on the corrected image and the backlight image to obtain a backlight enhanced image.
[0094] As described above, by performing highlight enhancement, highlight suppression, and edge enhancement on the acquired backlight image, respectively, brightening, suppressing, and edge-enhanced images are obtained. These images are then fused to obtain an enhanced image. Tone correction is applied to the enhanced image to obtain a corrected image. Finally, midtone smoothing is performed on the corrected image and the backlight image to obtain the enhanced backlight image. In this scheme, by performing highlight enhancement, highlight suppression, and edge enhancement on the backlight image separately, and then fusing them to obtain the enhanced image, the scheme effectively brightens the dark areas and suppresses the bright areas of the backlight image. Simultaneously, edge enhancement avoids the loss of edge details caused by highlight enhancement and highlight suppression. Tone correction on the enhanced image resolves the inconsistency between the enhanced image and the original backlight image. Further smoothing resolves the hazy phenomenon that occurs during image enhancement, resulting in a final image that effectively improves image quality in backlight scenes and appears more natural.
[0095] In one possible embodiment, the first processing module 101 is configured as follows:
[0096] The pixel values in the acquired backlit image are adjusted based on the set first coefficient and the first mapping formula to obtain a brightened image;
[0097] The pixel values in the acquired backlight image are adjusted based on the set second coefficient and second mapping formula to obtain the suppressed image;
[0098] The image sharpening algorithm is used to sharpen the edges of the acquired backlit image to obtain an edge-enhanced image.
[0099] In one possible embodiment, the fusion module 102 is configured as follows:
[0100] Calculate the percentage weight map of pixel values in the brightened image, the suppressed image, and the edge enhanced image respectively. The percentage weight map records the percentage weight of each pixel value. The closer the pixel value is to the center pixel value, the higher the percentage weight of the corresponding pixel value.
[0101] An enhanced image is obtained by fusing the brightened image, the suppressed image, and the edge-enhanced image with their respective calculated proportion weight maps.
[0102] In one possible embodiment, the correction module 103 is configured as follows:
[0103] The enhanced image is projected onto the color space of the backlit image to obtain a corrected image.
[0104] In one possible embodiment, the second processing module 104 is configured as follows:
[0105] Obtain the backlight intensity coefficient and the set midtone range of the pixels;
[0106] A smoothing intensity matrix is calculated based on the pixel values of the backlight image, the midtone range, and the backlight intensity coefficient.
[0107] The backlight enhancement image is obtained by superimposing the corrected image and the backlight image based on the smooth intensity matrix.
[0108] In one possible embodiment, the backlight image includes an RGB format image, and the second processing module 104 is configured to:
[0109] Determine the minimum pixel value in the RGB three channels of the backlit image;
[0110] The smooth intensity matrix is calculated based on the comparison between the minimum pixel value and the intermediate tone range, as well as the backlight intensity coefficient.
[0111] In one possible embodiment, the intermediate tone interval includes the minimum and maximum values of the pixel interval, and the second processing module 104 is configured to:
[0112] When the minimum pixel value is less than the minimum value of the interval, the corresponding matrix value in the smoothing intensity matrix is calculated based on the minimum value of the interval, the pixel value of the backlight image, and the backlight intensity coefficient.
[0113] When the minimum pixel value is greater than the maximum value in the interval, the corresponding matrix value in the smoothing intensity matrix is calculated based on the maximum value in the interval, the pixel value of the backlight image, and the backlight intensity coefficient.
[0114] When the minimum pixel value is in the intermediate tone range, the corresponding matrix value in the smoothing intensity matrix is determined to be 0.
[0115] Figure 7 This is a schematic diagram of the structure of a backlight image processing device provided in an embodiment of this application, as shown below. Figure 7 As shown, the device includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of processors 201 in the device can be one or more. Figure 7Taking a processor 201 as an example; the processor 201, memory 202, input device 203, and output device 204 in the device can be connected via a bus or other means. Figure 7 Taking a bus connection as an example, the memory 202, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the backlight image processing method in this embodiment. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 202, thereby implementing the aforementioned backlight image processing method. The input device 703 can be used to receive input digital or character information and generate key signal inputs related to user settings and function control of the device. The output device 204 may include a display screen or other display device.
[0116] This application also provides a non-volatile storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a backlight image processing method described in the above embodiments, wherein the method includes:
[0117] The acquired backlight images were processed by brightening the shadows, suppressing the highlights, and enhancing the edges to obtain brightened, suppressed, and edge-enhanced images, respectively.
[0118] The brightened image, the suppressed image, and the edge enhancement image are fused to obtain an enhanced image, and the enhanced image is then subjected to tone correction to obtain a corrected image;
[0119] A backlight-enhanced image is obtained by performing midtone smoothing processing on the corrected image and the backlight image.
[0120] It is worth noting that in the embodiments of the backlight image processing device described above, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this application.
[0121] In some possible implementations, various aspects of the methods provided in this application can also be implemented as a program product comprising program code that, when run on a computer device, causes the computer device to perform the steps of the methods according to the various exemplary embodiments of this application described above. For example, the computer device can perform the backlight image processing method described in the embodiments of this application. The program product can be implemented using any combination of one or more readable media.
Claims
1. A backlight image processing method, characterized in that, include: The acquired backlight images were processed by brightening the shadows, suppressing the highlights, and enhancing the edges to obtain brightened, suppressed, and edge-enhanced images, respectively. The enhanced image is obtained by fusing the brightened image, the suppressed image, and the edge enhancement image. This includes: calculating the percentage weight maps of pixel values in the brightened image, the suppressed image, and the edge enhancement image, respectively. Each percentage weight map records the percentage weight of each pixel value; the closer a pixel value is to the center pixel value, the higher its percentage weight. The enhanced image is then obtained by fusing the brightened image, the suppressed image, and the edge enhancement image with their respective calculated percentage weight maps. The enhanced image is then subjected to tone correction to obtain the corrected image; A backlight-enhanced image is obtained by performing midtone smoothing processing on the corrected image and the backlight image.
2. The backlight image processing method according to claim 1, characterized in that, The process of brightening shadows, suppressing highlights, and enhancing edges in the acquired backlit images to obtain brightened, suppressed, and enhanced images, respectively, includes: The pixel values in the acquired backlit image are adjusted based on the set first coefficient and the first mapping formula to obtain a brightened image; The pixel values in the acquired backlight image are adjusted based on the set second coefficient and second mapping formula to obtain the suppressed image; The image sharpening algorithm is used to sharpen the edges of the acquired backlit image to obtain an edge-enhanced image.
3. The backlight image processing method according to claim 1, characterized in that, The step of performing tone correction on the enhanced image to obtain the corrected image includes: The enhanced image is projected onto the color space of the backlit image to obtain a corrected image.
4. The backlight image processing method according to any one of claims 1-3, characterized in that, The process of obtaining a backlight-enhanced image by performing midtone smoothing based on the corrected image and the backlight image includes: Obtain the backlight intensity coefficient and the set midtone range of the pixels; A smoothing intensity matrix is calculated based on the pixel values of the backlight image, the midtone range, and the backlight intensity coefficient. The backlight enhancement image is obtained by superimposing the corrected image and the backlight image based on the smooth intensity matrix.
5. The backlight image processing method according to claim 4, characterized in that, The backlight image includes an RGB format image. The step of calculating the smooth intensity matrix based on the pixel values of the backlight image, the midtone range, and the backlight intensity coefficient includes: Determine the minimum pixel value in the RGB three channels of the backlit image; The smooth intensity matrix is calculated based on the comparison between the minimum pixel value and the intermediate tone range, as well as the backlight intensity coefficient.
6. The backlight image processing method according to claim 5, characterized in that, The midtone range includes the minimum and maximum values of pixels within the range. The calculation of the smooth intensity matrix based on the comparison between the minimum pixel value and the midtone range, and the backlight intensity coefficient, includes: When the minimum pixel value is less than the minimum value of the interval, the corresponding matrix value in the smoothing intensity matrix is calculated based on the minimum value of the interval, the pixel value of the backlight image, and the backlight intensity coefficient. When the minimum pixel value is greater than the maximum value in the interval, the corresponding matrix value in the smoothing intensity matrix is calculated based on the maximum value in the interval, the pixel value of the backlight image, and the backlight intensity coefficient. When the minimum pixel value is in the intermediate tone range, the corresponding matrix value in the smoothing intensity matrix is determined to be 0.
7. A backlight image processing device, characterized in that, include: The first processing module is configured to perform brightening of shadows, suppression of highlights, and edge enhancement on the acquired backlight image to obtain a brightened image, a suppressed image, and an edge enhanced image, respectively. The fusion module is configured to fuse the brightened image, the suppressed image, and the edge enhancement image to obtain an enhanced image. This includes: calculating a weighted map of pixel values in the brightened image, the suppressed image, and the edge enhancement image, respectively. The weighted map records the weighted percentage of each pixel value; the closer a pixel value is to the center pixel value, the higher its weighted percentage. Based on the brightened image, the suppressed image, and the edge enhancement image and their respective calculated weighted maps, a fusion process is performed to obtain the enhanced image. The correction module is configured to perform tone correction on the enhanced image to obtain a corrected image; The second processing module is configured to perform midtone smoothing processing on the corrected image and the backlight image to obtain a backlight enhanced image.
8. A backlight image processing device, the device comprising: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the backlight image processing method according to any one of claims 1-6.
9. A non-volatile storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to perform the backlight image processing method according to any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the backlight image processing method according to any one of claims 1-6.