Image contrast enhancement method, system, electronic device and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-03
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]然而,这些方法在降低模型复杂度的同时,往往不可避免地会牺牲图像的视觉增强效果,难以在计算效率与视觉质量之间取得良好平衡
[0040]本申请提供的图像对比度增强方法、系统、电子设备及存储介质,在进行图像对比度增强时,先从输入图像的YUV数据中分离出亮度分量和色度分量,通过增强网络模型仅对亮度分量进行对比度增强训练而同时获得针对亮度的增强系数网格和针对色度的补偿系数,进而在利用增强系数网格和补偿系数对亮度分量和色度分量进行分别增强后再合并获得增强图像,相较于现有方案,本申请通过将复杂的全通道图像增强问题解耦为“单通道(亮度分量)的增强训练+色度补偿”的模式,将增强网络模型的主要计算负荷集中于对单通道(亮度)的处理,从而在根本上显著降低了模型的计算复杂度和运算量,同时,基于补偿系数对色度分量的补偿增强,使得在降低计算量的同时,有效保证了输出的增强图像的颜色准确性,实现了图像增强时在对比度、亮度、饱和度和颜色上的兼顾,避免了仅增强亮度导致的颜色失真问题,使得最终输出的增强图像更接近原始目标效果。
Smart Images

Figure CN122550432A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to an image contrast enhancement method, system, electronic device, and storage medium. Background Technology
[0002] With the widespread application of deep learning technology in image processing, the quality requirements for images and videos are increasing, and the corresponding processing models are becoming more complex, significantly increasing the computational load. How to effectively reduce the computational complexity of algorithms while preserving complete image texture details has become a key challenge for realizing hardware portability and practical applications of these algorithms.
[0003] Currently, to reduce computational load, the industry often employs methods such as training only the luminance channel and performing simple linear compensation on the remaining channels, reducing the input image resolution, compressing network channels, network pruning, and knowledge distillation.
[0004] However, while these methods reduce model complexity, they often inevitably sacrifice the visual enhancement of the image, making it difficult to achieve a good balance between computational efficiency and visual quality. Summary of the Invention
[0005] In view of the above-mentioned technical problems, the purpose of this application is to provide an image contrast enhancement method, system, electronic device and storage medium, so as to reduce the amount of computation and computational complexity while ensuring the image enhancement effect, suppress the noise problem during image contrast enhancement processing and solve the video flickering phenomenon after contrast enhancement.
[0006] According to a first aspect of this application, an image contrast enhancement method is provided, comprising:
[0007] The luminance and chrominance components are separated from the YUV data of the input image, where Y represents luminance and U and V represent chrominance.
[0008] The luminance component is trained to enhance contrast using an augmentation network model, thereby obtaining an enhancement coefficient grid for the luminance component and a compensation coefficient for the chrominance component.
[0009] The luminance component is enhanced using the enhancement coefficient grid, and the chrominance component is enhanced using the compensation coefficient.
[0010] An enhanced image is obtained based on the enhanced luminance component and the enhanced chrominance component.
[0011] Optionally, the luminance component is contrast-enhanced using an enhancement network model to obtain an enhancement coefficient grid for the luminance component, comprising:
[0012] The luminance component is trained for contrast enhancement using the enhancement network model to obtain a low-resolution enhancement coefficient grid and a full-resolution guide map.
[0013] The low-resolution enhancement coefficient grid is trilinearly interpolated based on the guiding graph to obtain the full-resolution enhancement coefficient grid.
[0014] Optionally, performing trilinear interpolation on the low-resolution enhancement coefficient grid based on the guiding map includes:
[0015] Based on the guiding graph of the current frame input image, trilinear interpolation is performed on the low-resolution enhancement coefficient grid of the previous N frame input images, where N is an integer greater than or equal to 1 and less than or equal to 3.
[0016] Optionally, the enhancement network is pre-introduced with initial compensation coefficients for the chromaticity components;
[0017] The luminance component is trained using an augmented network model to enhance contrast, resulting in compensation coefficients for the chrominance component, including:
[0018] During the contrast enhancement training of the luminance component using the augmentation network algorithm, the initial compensation coefficients are constrained using the real data of the input image to obtain the low-resolution compensation coefficients.
[0019] The compensation coefficients at low resolution are upsampled to full resolution to obtain the compensation coefficients at full resolution.
[0020] Optionally, the enhanced network model employs an average pooling layer for global feature extraction.
[0021] Optionally, before separating the luminance and chrominance components from the YUV data of the input image, the method further includes: performing high-low frequency separation processing on the input image to obtain the low-frequency and high-frequency components of the input image;
[0022] Separating the luminance and chrominance components from the YUV data of the input image includes: separating the luminance and chrominance components from the YUV data corresponding to the low-frequency components of the input image.
[0023] Optionally, obtaining the enhanced image based on the enhanced luminance component and the enhanced chrominance component includes:
[0024] The enhanced luminance component and the enhanced chrominance component are merged to obtain the low-frequency component corresponding to the enhanced YUV data;
[0025] The enhanced image is obtained by superimposing the low-frequency components of the enhanced YUV data and the high-frequency components of the input image.
[0026] Optionally, when the input image is an RGB image, before separating the luminance and chrominance components from the YUV data of the input image, the method further includes:
[0027] The input image is converted from the RGB color gamut to the YUV color gamut to obtain the YUV data of the input image.
[0028] Optionally, the superposition process of the low-frequency components corresponding to the enhanced YUV data and the high-frequency components of the input image includes:
[0029] The low-frequency components corresponding to the enhanced YUV data are converted from the YUV color gamut to the RGB color gamut to obtain the low-frequency components of the enhanced input image.
[0030] The low-frequency components of the enhanced input image and the high-frequency components of the input image are superimposed.
[0031] Optionally, the process of performing trilinear interpolation on the low-resolution enhancement coefficient grid according to the guide map to obtain the full-resolution enhancement coefficient grid further includes: applying smoothing constraints on adjacent pixels to the enhancement coefficient grid.
[0032] According to a second aspect of this application, an image contrast enhancement system is provided, comprising:
[0033] The preprocessing unit is used to separate the luminance and chrominance components from the YUV data of the input image, where Y represents luminance and U and V represent chrominance.
[0034] An enhanced network model is used to train the luminance component for contrast enhancement, generating an enhancement coefficient grid for the luminance component and a compensation coefficient for the chrominance component.
[0035] The enhancement processing unit enhances the luminance component using the enhancement coefficient grid and enhances the chrominance component using the compensation coefficient.
[0036] The image synthesis unit obtains an enhanced image based on the enhanced luminance component and the enhanced chrominance component.
[0037] According to a third aspect of this application, an electronic device is provided, characterized in that it includes: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the method disclosed in any embodiment of this application.
[0038] According to a fourth aspect of this application, a storage medium is provided, characterized in that the storage medium stores a computer program or instructions, which, when executed by a processor, implement the steps of the method disclosed in any embodiment of this application.
[0039] The beneficial effects of this application include at least the following:
[0040] The image contrast enhancement method, system, electronic device, and storage medium provided in this application first separate the luminance and chrominance components from the YUV data of the input image when performing image contrast enhancement. An enhancement network model is then trained only on the luminance component for contrast enhancement, simultaneously obtaining an enhancement coefficient grid for luminance and a compensation coefficient for chrominance. The luminance and chrominance components are then enhanced separately using the enhancement coefficient grid and compensation coefficients before being merged to obtain the enhanced image. Compared to existing solutions, this application decouples the complex full-channel image enhancement problem into a "single-channel (luminance component) enhancement training + chrominance compensation" model. This concentrates the main computational load of the enhancement network model on processing a single channel (luminance), fundamentally and significantly reducing the computational complexity and workload of the model. Simultaneously, the compensation enhancement of the chrominance component based on the compensation coefficients effectively ensures the color accuracy of the output enhanced image while reducing computational load. This achieves a balance in contrast, luminance, saturation, and color during image enhancement, avoiding color distortion caused by only enhancing luminance, and making the final output enhanced image closer to the original target effect.
[0041] In a further preferred embodiment, by first generating a low-resolution enhancement coefficient grid and a full-resolution guide map, and then using the guide map to perform trilinear interpolation on the low-resolution enhancement coefficient grid to obtain a full-resolution enhancement coefficient grid, and by first generating low-resolution compensation coefficients and then upsampling to generate full-resolution compensation coefficients, the number of parameters that need to be directly generated and optimized by the enhancement network model is significantly reduced, further reducing the computational burden and model complexity.
[0042] In a further preferred embodiment, a full-resolution enhancement coefficient grid is generated by using the guide graph of the current frame and the low-resolution enhancement coefficient grid of the previous N frames. This effectively reduces algorithm latency, improves processing speed, and enhances the real-time performance of the scheme.
[0043] In a further preferred embodiment, the augmented network model uses an average pooling layer for global feature extraction. Compared with using multiple fully connected layers to extract global image features, this scheme greatly reduces the number of model parameters and computational complexity. While efficiently aggregating global information, it also makes the entire augmented network model more lightweight and robust, which is conducive to deployment and real-time operation on hardware platforms with limited computing power.
[0044] In a further preferred embodiment, the input image is first separated into high and low frequencies, and then the luminance and chrominance components are separated from the low-frequency components. This allows for subsequent contrast enhancement training only on the luminance components corresponding to the low-frequency components, effectively avoiding the amplification of high-frequency noise during the contrast enhancement training process. This results in a cleaner and higher-quality output enhanced image. At the same time, the retained high-frequency components preserve the finest texture and edge details of the original image. Consequently, in the enhanced image obtained by superimposing and fusing the original high-frequency components and the enhanced low-frequency components, the contrast is improved while perfectly maintaining the image's detail clarity.
[0045] In a further preferred embodiment, by introducing a smoothing constraint mechanism for adjacent pixels during the generation of the enhancement coefficient grid, the changes in enhancement coefficients between adjacent pixels or between adjacent frames in the image are made smooth, effectively eliminating the problem of block artifacts in the enhanced image in space or inter-frame flicker in time (in the video sequence) caused by abrupt changes in coefficients. This significantly improves the spatial coherence and temporal stability of the output image quality, providing a more comfortable and professional visual experience.
[0046] It should be noted that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit this application. Attached Figure Description
[0047] Figure 1 This diagram illustrates a method flow chart of an image contrast enhancement method provided according to an embodiment of this application.
[0048] Figure 2 This diagram illustrates the data flow of an image contrast enhancement method according to an embodiment of this application.
[0049] Figure 3 This diagram illustrates a structural block diagram of an image contrast enhancement system provided according to an embodiment of this application.
[0050] Figure 4 A structural block diagram of an electronic device provided according to an embodiment of this application is shown. Detailed Implementation
[0051] The preferred embodiments of this disclosure are described in detail below with reference to the accompanying drawings, but this disclosure is not limited to these embodiments. This disclosure covers any alternatives, modifications, equivalent methods, and solutions made within the spirit and scope of this disclosure.
[0052] In order to provide the public with a thorough understanding of this disclosure, specific details are described in detail in the following preferred embodiments of this disclosure, but those skilled in the art can fully understand this disclosure without these details.
[0053] The present disclosure is described in more detail below by way of example with reference to the accompanying drawings. It should be noted that the drawings are in a simplified form and use non-precise scales, and are only used to facilitate and clarify the illustration of the embodiments of the present disclosure.
[0054] To facilitate understanding of this application, a more complete description will be provided below with reference to the accompanying drawings. Preferred embodiments of this application are shown in the drawings. However, this application may be implemented in various forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of this application.
[0055] The terms "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0056] In the description of this application, the words "exemplary" or "for example" are used to indicate that they are examples, illustrations, or descriptions. Any embodiment described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments. In this document, the term "a plurality of" means two or more.
[0057] In addition, the same reference numerals in the figures indicate the same or similar structures, so repeated descriptions of them will be omitted. That is, the various parts in this specification are described in a combination of parallel and progressive manner. Each part focuses on the differences from other parts, and the same or similar parts between the various parts can be referred to each other.
[0058] Figure 1 A schematic flowchart of the image contrast enhancement method provided in the embodiments of this application is shown.
[0059] The execution entity of the image contrast enhancement method can be a terminal device, a server, or other processing device. The terminal device can be a user equipment (UE), computer, mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (PDA), handheld device, computing device, in-vehicle device, wearable device, etc. The execution entity of the image contrast enhancement method can also be an image contrast enhancement device (or system). In some possible implementations, the image contrast enhancement method can be implemented by a processor calling computer-readable instructions stored in memory.
[0060] like Figure 1 As shown, the image contrast enhancement method in this embodiment includes the following steps:
[0061] 110. Separate the luminance and chrominance components from the YUV data of the input image, where Y represents luminance and U and V represent chrominance.
[0062] As an example, the initial input image can be a YUV image, that is, an image represented using YUV data. In YUV data, Y represents the luminance component, characterizing the brightness of the YUV image, i.e., the grayscale value, while U and V represent the chrominance components, characterizing the color and saturation of the YUV image. As another example, the initial input image can also be an RGB image, that is, an image represented using RGB data. In this case, before separating the luminance and chrominance components from the YUV data of the input image, it is necessary to first convert the input image from the RGB color gamut to the YUV color gamut. This allows for the separation of the luminance and chrominance components after obtaining the YUV data of the input image.
[0063] As an example, an input image can be converted from the RGB color gamut to the YUV color gamut using the following conversion formula:
[0064] ;
[0065] ;
[0066] .
[0067] 120. The contrast enhancement of the luminance component is trained using an enhancement network model to obtain the enhancement coefficient grid for the luminance component and the compensation coefficient for the chrominance component.
[0068] In some preferred embodiments, before separating the luminance and chrominance components from the YUV data of the input image, the input image undergoes high-low frequency separation processing to obtain low-frequency and high-frequency components. Subsequently, only the luminance and chrominance components are separated from the YUV data corresponding to the low-frequency components. That is, the luminance component input to the strong network model is the luminance component of the corresponding low-frequency component of the input image obtained after high-low frequency separation processing. The low-frequency components of the image contain low-frequency texture and detail information, while the high-frequency components are prone to introducing high-frequency noise. In this embodiment, only the luminance component corresponding to the low-frequency component is fed into the enhancement network model for enhancement training, while the high-frequency component is temporarily cached and not input into the enhancement network model for enhancement. This ensures that during contrast enhancement training, both the key detail information of the input image is preserved, and the enhancement of high-frequency noise is suppressed. Simultaneously, the separated high-frequency component is subsequently directly superimposed on the enhanced low-frequency component, allowing the final enhanced image to retain high-frequency features, which is beneficial for improving the image quality and information integrity of the contrast-enhanced image.
[0069] Taking an initial input image that can be an RGB image as an example, one could first perform high-low frequency separation processing on the input image to obtain its low-frequency and high-frequency components. Then, the low-frequency components could be converted from the RGB color gamut to the YUV color gamut to obtain the corresponding YUV data. Finally, the luminance and chrominance components could be separated from the YUV data corresponding to the low-frequency components of the input image, thus reducing the processing load during color gamut conversion. Alternatively, the entire RGB image could be converted to YUV data first, then high-low frequency separation could be performed on the YUV data, and finally, the luminance and chrominance components could be separated from the low-frequency components of the YUV data.
[0070] In step 120, the method for obtaining the enhancement coefficient grid for the luminance component specifically includes: using the enhancement network model to perform contrast enhancement training on the luminance component to obtain a low-resolution (small-size) enhancement coefficient grid and a full-resolution guide map; and performing trilinear interpolation on the low-resolution enhancement coefficient grid based on the full-resolution guide map to obtain the full-resolution enhancement coefficient grid.
[0071] Contrast enhancement network models are neural network models with deep learning capabilities, such as those using the HDRNet architecture. During contrast enhancement training, the enhancement network model extracts global and local features from the luminance component of the input image. Based on the analysis and processing of these global and local features, it learns and optimizes parameters, generating a low-resolution enhancement coefficient grid and a full-resolution (i.e., the same resolution as the input luminance component) guide map. The low-resolution enhancement coefficient grid contains the enhancement coefficients for each luminance data point in the luminance component required for contrast enhancement, while the full-resolution guide map contains local details and structural information of the input image, guiding how to "map" and "apply" the coefficients from the low-resolution enhancement coefficient grid to each pixel of the original high-resolution image. Then, using the full-resolution guide map as spatial guidance during interpolation, trilinear interpolation is performed on the low-resolution enhancement coefficient grid to upsample the low-resolution enhancement coefficients to full resolution, generating the final enhancement coefficients for each pixel—the full-resolution enhancement coefficient grid. In this way, not only can the integrity of details be guaranteed, but the local enhancement capability can also be improved. At the same time, since the enhancement network model only needs to process the single-channel data of the brightness component of the input image, it only needs to generate the enhancement coefficient grid corresponding to a single brightness channel, which greatly reduces the amount of computation and computational complexity in the contrast enhancement training process.
[0072] In some preferred embodiments, the enhanced network model employs an average pooling layer for global feature extraction. For example, by averaging the spatial dimensions of the input feature map, global information of the image can be aggregated objectively and efficiently to generate a global feature vector. Compared to using multiple fully connected layers (FC layers) to extract high-order global features, this embodiment uses a single average pooling layer design, which significantly reduces the number of model parameters and the required computation while ensuring global information extraction capabilities. This greatly reduces the computational complexity of the network and effectively improves the robustness and real-time performance of the enhanced network model. Extensive experiments have demonstrated that the contrast enhancement scheme of this embodiment produces better visual effects in the enhanced image.
[0073] When performing trilinear interpolation, it is further preferable to use the guide map of the current frame input image to perform trilinear interpolation on the low-resolution enhancement coefficient grid of the previous N frames input images. Compared with using the guide map of the same frame and the low-resolution enhancement coefficient grid for trilinear interpolation, using the guide map of the current frame for cross-frame guidance optimizes the timing of the hardware logic design and can significantly reduce processing latency. Here, N is an integer greater than or equal to 1 and less than or equal to 3, preferably N equal to 1.
[0074] In video processing, due to variations in scene content, lighting, or network output, the enhancement coefficients calculated for adjacent frames or adjacent grid cells within the same frame can differ significantly. When these significantly different enhancement coefficients are applied to a full-resolution image through trilinear interpolation, it causes discontinuous and abrupt changes in brightness and contrast in adjacent regions (especially object edges and flat areas) between frames or spatially. In a video sequence, this discontinuity manifests as unpleasant flickering or blocky artifacts. Therefore, this embodiment generates a full-resolution enhancement coefficient grid by applying smoothing constraints to adjacent pixels during the trilinear interpolation of the low-resolution enhancement coefficient grid based on the guide map. For example, in the augmentation network model, an additional regularization term or filtering operation for smoothness is introduced to constrain the difference (gradient) between adjacent pixel values. This allows the augmentation network model to automatically learn and generate a smoother augmentation coefficient grid during the optimization process, making the changes in augmentation coefficient values at adjacent spatial locations more gradual. This avoids the blocky effect or inter-frame flickering phenomenon in the augmented image caused by excessive differences in augmentation coefficients between adjacent image blocks.
[0075] To avoid insufficient color saturation or color cast caused by only enhancing the luminance component, this embodiment also pre-introduces learnable initial compensation coefficients for the chrominance component into the enhancement network model. During the contrast enhancement training of the luminance component using the enhancement network algorithm, by constraining the initial compensation coefficients with real data from the input image, the enhancement network model will additionally learn two sets of compensation coefficients for the U and V channels of the chrominance component. In this embodiment, the compensation coefficients include weight coefficients (denoted as w) and bias coefficients (denoted as b). Optionally, the U and V channels of the chrominance component can share the same compensation coefficients (i.e., share the same set of weight coefficients w and bias coefficients b), or they can use their own independent compensation coefficients (i.e., use their own independent set of weight coefficients w and bias coefficients b). These compensation coefficients are learned in low-resolution form and then upsampled to full resolution. By adding a compensation coefficient for the chromaticity component to the enhancement network model, the chromaticity component of the image can be enhanced using this compensation coefficient. This makes the final enhanced image closer to the target effect, effectively avoiding severe color cast in the image, and also reducing repeated multiplication calculations, thus greatly reducing the amount of computation.
[0076] 130, the luminance component is enhanced using an enhancement coefficient grid, and the chrominance component is enhanced using a compensation coefficient.
[0077] In this step, the enhancement of the luminance component using the enhancement coefficient grid includes: performing pixel-by-pixel operations (such as affine transformation) on the original luminance component (i.e. the luminance component input to the enhancement coefficient grid) and the full-resolution enhancement coefficient grid to obtain the enhanced luminance component.
[0078] Enhancing chromaticity components using compensation coefficients involves correcting the original chromaticity components using compensation coefficients at full resolution to obtain the enhanced chromaticity components. For example, the original chromaticity components can be corrected using the following formula:
[0079] ;
[0080] .
[0081] Where U_out represents the enhanced U channel chroma component, V_out represents the enhanced V channel chroma component, U and V are the original chroma components, and w and b are the full-resolution compensation coefficients learned by the network.
[0082] 140. An enhanced image is obtained based on the enhanced luminance component and the enhanced chrominance component.
[0083] As an example, when the initial input image is a YUV image, an enhanced image can be obtained by merging the enhanced luminance component and the enhanced chrominance component. This enhanced image is a YUV image.
[0084] Furthermore, when the initial input image is a YUV image, and before separating the luminance component and chrominance component from the YUV data of the input image, high-low frequency separation processing is performed on the input image, then step 140 includes: merging the enhanced luminance component and the enhanced chrominance component to obtain the low-frequency component corresponding to the enhanced YUV data; and superimposing the low-frequency component corresponding to the enhanced YUV data and the high-frequency component of the input image to obtain an enhanced image, which is a YUV image.
[0085] As another example, when the initial input image is an RGB image, after obtaining the enhanced YUV image using any of the aforementioned methods, the process also includes converting the enhanced YUV image (i.e., the enhanced YUV data) from the YUV color gamut to the RGB color gamut to obtain the final enhanced image. In this case, the final output enhanced image is an RGB image.
[0086] As an example, an input image can be converted from the YUV color gamut to the RGB color gamut using the following conversion formula:
[0087] ;
[0088] ;
[0089] .
[0090] Figure 2 A schematic diagram of the data flow of the image contrast enhancement method provided in an embodiment of this application is shown.
[0091] like Figure 2 As shown, the data flow and main data processing procedures in the image contrast enhancement method provided in this embodiment include:
[0092] First, the input image is processed by high-low frequency separation (210) to separate the low-frequency component containing low-frequency texture and detail information of the image and the high-frequency component containing detail noise.
[0093] Next, if the input image is in RGB format or other non-YUV format, the separated low-frequency components are subjected to color gamut conversion (220) to obtain the YUV data corresponding to the low-frequency components.
[0094] Next, the YUV data corresponding to the low-frequency components are processed by data separation (230) to separate the luminance component (corresponding to the Y channel) and chrominance component (corresponding to the U and V channels) from the YUV data corresponding to the low-frequency components.
[0095] Next, the luminance component Y is input into the enhancement network model for contrast enhancement training (240) to obtain a full-resolution enhancement coefficient grid suitable for the luminance component and a full-resolution compensation coefficient suitable for the chrominance component. Specifically, the enhancement network model uses an average pooling layer for global feature extraction to reduce computational complexity. During training, the enhancement network model generates a low-resolution enhancement coefficient grid for the luminance component and low-resolution compensation coefficients for the chrominance component; simultaneously, the model also generates a full-resolution guide map corresponding to the current luminance component. During training, to reduce processing latency, in a preferred embodiment, the low-resolution enhancement coefficient grid of the previous frame can be trilinearly interpolated based on the guide map of the current frame to obtain a full-resolution enhancement coefficient grid suitable for the luminance component. During this interpolation process, a smoothing constraint on adjacent pixels is applied to the enhancement coefficient grid to avoid blockiness or flickering in the enhanced image. Simultaneously, the low-resolution compensation coefficients for the chrominance component are upsampled to full resolution.
[0096] Next, the luminance component is subjected to pixel-level luminance enhancement (250) using the full-resolution enhancement coefficient grid, and the chrominance component is subjected to chrominance enhancement (260) using the full-resolution compensation coefficient, also known as chrominance correction processing.
[0097] Next, the enhanced luminance component and the enhanced chrominance component are merged (270) to obtain the enhanced low-frequency YUV data.
[0098] Next, the enhanced low-frequency YUV data is subjected to color gamut conversion (280) to obtain enhanced low-frequency RGB data.
[0099] Finally, the enhanced low-frequency RGB data is superimposed with the high-frequency components of the initially separated input image (290) to produce an enhanced image with complete details and suppressed noise.
[0100] In this embodiment, the specific implementation of data processing procedures 210-290 can be referred to the following: Figure 1 The specific details of the embodiments will not be repeated here. Of course, if the input image is in YUV format, then... Figure 2 Data processing steps 220 and 280 can be omitted.
[0101] Furthermore, embodiments of this application also provide an image contrast enhancement system, which can be used to implement the image contrast enhancement method disclosed in any embodiment of this application. In specific implementation, such as... Figure 3 As shown, the image contrast enhancement system includes a preprocessing unit 310, an enhancement network model 320, an enhancement processing unit 330, and an image synthesis unit 340. The preprocessing unit 310 separates the luminance and chrominance components from the YUV data of the input image, where Y represents luminance and U and V represent chrominance. The enhancement network model 320 is used to train the luminance component for contrast enhancement, generating an enhancement coefficient grid for the luminance component and compensation coefficients for the chrominance component. The enhancement processing unit 330 enhances the luminance component using the enhancement coefficient grid and enhances the chrominance component using the compensation coefficients. The image synthesis unit 340 obtains an enhanced image based on the enhanced luminance and chrominance components.
[0102] In practical implementation, each module / unit in the image contrast enhancement system can be implemented as an independent entity, or it can be arbitrarily combined and implemented as the same or several entities. Furthermore, the specific implementation of each module / unit in the image contrast enhancement system described above can be found in the embodiments of the aforementioned image contrast enhancement method, and will not be repeated here.
[0103] This application also provides an electronic device 400, such as... Figure 4As shown, it includes a processor 410, a memory 420, and a program stored in the memory 420 and executable on the processor 410. When the program is executed by the processor 410, it can implement the various processes of the above-described image contrast enhancement methods and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0104] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. Therefore, this application also provides a storage medium storing a computer program or instructions. When executed by a processor, the computer program or instructions can implement the various processes in the embodiments of the above image contrast enhancement methods. The storage medium can be any medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0105] Since the instructions stored in the storage medium can execute the steps of the image contrast enhancement method provided in the embodiments of this application, the beneficial effects of the image contrast enhancement method provided in the embodiments of this invention can be achieved, as detailed in the preceding embodiments, and will not be repeated here. The specific implementation of each of the above operations can be found in the preceding embodiments, and will not be repeated here.
[0106] In summary, the image contrast enhancement scheme provided in this application achieves the following technical effects:
[0107] 1. Significantly reduced computational complexity: This application only performs single-channel contrast enhancement training on the luminance component of the input image. During the training process, an average pooling layer is also used for global feature extraction. Based on the training of the luminance component, enhancement coefficients suitable for the luminance component and compensation coefficients suitable for the chrominance component are generated simultaneously. Through the above optimizations, the overall computational load of the algorithm is significantly reduced, making it suitable for porting to various low-computing-power hardware platforms and facilitating the realization of real-time image enhancement under low power consumption.
[0108] 2. Better image contrast enhancement: While reducing computational complexity, the color compensation mechanism based on real image learning effectively maintains the color accuracy and saturation of the output image; at the same time, high and low frequency separation processing preserves texture details and suppresses high frequency noise, so that the final enhancement effect is close to the target effect of full-channel processing of the original input image in terms of brightness, contrast and color.
[0109] 3. Significantly improved output image quality: The high and low frequency processing mechanism for the input image effectively prevents the amplification of high-frequency noise during the enhancement training process, resulting in a cleaner and higher-quality output enhanced image. At the same time, the smoothing constraint mechanism of adjacent pixels used in the process of generating the full-resolution enhancement coefficient grid also fundamentally solves the flickering problem during image / video enhancement, providing a stable and comfortable visual experience.
[0110] 4. Enhanced real-time performance: Trilinear interpolation is performed using the low-resolution enhancement coefficient grid of the previous N frames (e.g., the previous frame) and the guiding map of the current frame to generate a full-resolution enhancement coefficient grid. This effectively reduces algorithm latency. In addition, the computational load and complexity are greatly reduced, significantly improving the algorithm's running speed and enhancing real-time performance. This is conducive to achieving efficient and high-quality image contrast enhancement.
[0111] Finally, it should be noted that the above embodiments are merely examples for clearly illustrating this application and are not intended to limit the implementation. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this application.
Claims
1. An image contrast enhancement method, comprising: The luminance and chrominance components are separated from the YUV data of the input image, where Y represents luminance and U and V represent chrominance. The luminance component is trained to enhance contrast using an augmentation network model, thereby obtaining an enhancement coefficient grid for the luminance component and a compensation coefficient for the chrominance component. The luminance component is enhanced using the enhancement coefficient grid, and the chrominance component is enhanced using the compensation coefficient. An enhanced image is obtained based on the enhanced luminance component and the enhanced chrominance component.
2. The image contrast enhancement method of claim 1, wherein, The luminance component is contrast-enhanced using an enhancement network model to obtain an enhancement coefficient grid for the luminance component, comprising: The luminance component is trained for contrast enhancement using the enhancement network model to obtain a low-resolution enhancement coefficient grid and a full-resolution guide map. The low-resolution enhancement coefficient grid is trilinearly interpolated based on the guiding graph to obtain the full-resolution enhancement coefficient grid.
3. The image contrast enhancement method of claim 2, wherein, Trilinear interpolation of the low-resolution enhancement coefficient grid based on the guiding diagram includes: Based on the guiding graph of the current frame input image, trilinear interpolation is performed on the low-resolution enhancement coefficient grid of the previous N frame input images, where N is an integer greater than or equal to 1 and less than or equal to 3.
4. The image contrast enhancement method of claim 1, wherein, The enhancement network is pre-introduced with initial compensation coefficients for the chromaticity components; The luminance component is trained using an augmented network model to enhance contrast, resulting in compensation coefficients for the chrominance component, including: During the contrast enhancement training of the luminance component using the augmentation network algorithm, the initial compensation coefficients are constrained using the real data of the input image to obtain the low-resolution compensation coefficients. The compensation coefficients at low resolution are upsampled to full resolution to obtain the compensation coefficients at full resolution.
5. The image contrast enhancement method of any one of claims 1-4, wherein, The enhanced network model uses average pooling layers for global feature extraction.
6. The image contrast enhancement method of claim 1, wherein, Before separating the luminance and chrominance components from the YUV data of the input image, the method further includes: performing high-low frequency separation processing on the input image to obtain the low-frequency and high-frequency components of the input image; Separating the luminance and chrominance components from the YUV data of the input image includes: separating the luminance and chrominance components from the YUV data corresponding to the low-frequency components of the input image.
7. The image contrast enhancement method of claim 6, wherein, Obtaining an enhanced image based on the enhanced luminance component and the enhanced chrominance component includes: The enhanced luminance component and the enhanced chrominance component are merged to obtain the low-frequency component corresponding to the enhanced YUV data; The enhanced image is obtained by superimposing the low-frequency components of the enhanced YUV data and the high-frequency components of the input image.
8. The image contrast enhancement method of claim 7, wherein, When the input image is an RGB image, before separating the luminance and chrominance components from the YUV data of the input image, the process further includes: The input image is converted from the RGB color gamut to the YUV color gamut to obtain the YUV data of the input image.
9. The image contrast enhancement method of claim 8, wherein, The superposition process of the low-frequency components corresponding to the enhanced YUV data and the high-frequency components of the input image includes: The low-frequency components corresponding to the enhanced YUV data are converted from the YUV color gamut to the RGB color gamut to obtain the low-frequency components of the enhanced input image. The low-frequency components of the enhanced input image and the high-frequency components of the input image are superimposed.
10. The image contrast enhancement method of claim 2, wherein, The process of performing trilinear interpolation on the low-resolution enhancement coefficient grid to obtain the full-resolution enhancement coefficient grid according to the guiding map also includes: applying smoothing constraints on adjacent pixels of the enhancement coefficient grid.
11. An image contrast enhancement system, comprising: The preprocessing unit is used to separate the luminance and chrominance components from the YUV data of the input image, where Y represents luminance and U and V represent chrominance. An enhanced network model is used to train the luminance component for contrast enhancement, generating an enhancement coefficient grid for the luminance component and a compensation coefficient for the chrominance component. The enhancement processing unit enhances the luminance component using the enhancement coefficient grid and enhances the chrominance component using the compensation coefficient. The image synthesis unit obtains an enhanced image based on the enhanced luminance component and the enhanced chrominance component.
12. An electronic device, comprising: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the method as claimed in any one of claims 1 to 10.
13. A storage medium, characterized by The storage medium stores a computer program or instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 10.