An adaptive low-light image enhancement method and device and a storage medium
By using an adaptive low-light image enhancement method, adaptive parameters are generated using luminance channel features. Combined with joint filtering and nonlinear gamma correction, the problem of poor scene adaptability and noise amplification caused by parameter fixation in traditional methods is solved, and high-quality image enhancement effect is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-03-24
AI Technical Summary
Traditional low-light image enhancement techniques suffer from poor scene adaptability due to fixed parameters, making it impossible to effectively distinguish high-frequency details from noise. This results in color distortion and noise amplification, affecting image quality and subsequent analysis tasks.
An adaptive low-light image enhancement method is adopted. By extracting the luminance channel features to generate an adaptive key parameter set, the luminance channel is processed by a joint filtering strategy, adaptive weighted fusion and nonlinear gamma correction are performed to optimize the processing of illumination and reflection components, and finally noise reduction is performed to improve image quality.
It achieves high-quality image enhancement under different lighting and noise conditions, preserving detail information, reducing noise, optimizing brightness distribution, and improving the visual effect and usability of subsequent analysis of the image.
Smart Images

Figure CN121190371B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of image processing, in particular to an adaptive low-light image enhancement method and device and storage medium. BACKGROUND
[0002] In the field of digital image processing, low-light image enhancement technology has become a key support link for core scenes such as security monitoring, autonomous driving, and consumer photography. In these scenes, the low-light images collected by devices often lose details due to insufficient brightness, such as blurred facial contours in night monitoring images and unclear lane lines in images taken by vehicle-mounted cameras in tunnels, directly affecting the accuracy of subsequent target detection, image recognition, and other tasks. Therefore, high-quality image enhancement is crucial to ensure the stable operation of business processes.
[0003] In traditional low-light image enhancement technology solutions, the input low-light RGB image is first converted to a color space that separates brightness and color, such as HSV or YUV, and only the brightness channel is extracted for subsequent processing to avoid interference from color information during brightness adjustment. Then, the brightness channel is smoothed by a pre-set parameter Gaussian filter to estimate the illumination component of the image. Subsequently, the original brightness channel and the estimated illumination component are converted to the logarithmic domain, and the initial reflection component is obtained by logarithmic domain subtraction operation. Finally, the initial reflection component is linearly stretched with a fixed gain, and the illumination component is adjusted in brightness with a fixed threshold. The processed reflection component and the illumination component are converted back to the linear domain and multiplied to obtain the enhanced brightness channel. Finally, the original color channels are recombined into RGB format to complete the low-light image enhancement.
[0004] However, the fixed parameters of traditional methods result in poor scene adaptability. When faced with low-light images of different light intensities and scene types, fixed parameters cannot match the scene requirements, leading to over-enhancement and color distortion, or amplifying noise in dark areas. In addition, when extracting the reflection component, it is difficult to effectively distinguish between high-frequency details and high-frequency noise. When stretching the reflection component, the noise in the dark area will be amplified along with the details, resulting in a significant number of noise points in the enhanced image, especially in the dark areas of low-light images, which not only affects the visual effect but also interferes with subsequent image analysis tasks. SUMMARY
[0005] The present application discloses an adaptive low-light image enhancement method, device, and storage medium for stably outputting high-quality images under various complex conditions.
[0006] The first aspect of the present application discloses an adaptive low-light image enhancement method, comprising:
[0007] mapping an input low-light RGB image to an HSV color space, extracting a luminance channel from the HSV color space, and calculating luminance features of the luminance channel, the luminance features including a global mean, a normalized histogram, and a standard deviation of the luminance channel;
[0008] generating an adaptive key parameter set based on the luminance features via a preset mapping function;
[0009] processing the luminance channel via a joint filtering strategy and adaptively fusing the luminance channel to obtain an illumination component, the illumination component being used to represent ambient light distribution in the image;
[0010] converting the luminance channel and the illumination component to a logarithmic domain and performing operations thereon to obtain an initial reflectance component, the initial reflectance component being used to represent reflectance characteristics and detailed information of an object in the image;
[0011] performing linear stretching on the initial reflectance component according to a detail gain related parameter in the adaptive key parameter set to obtain an enhanced reflectance component;
[0012] performing non-linear gamma correction on the illumination component according to a gamma correction parameter in the adaptive key parameter set to obtain a corrected illumination component;
[0013] converting the enhanced reflectance component back to a linear domain and performing operations thereon with the corrected illumination component to obtain an enhanced luminance channel;
[0014] recombining the enhanced luminance channel with a hue channel and a saturation channel in the HSV color space, and converting the recombined channels back to an RGB format to obtain an enhanced image.
[0015] Optionally, the processing of the luminance channel via the joint filtering strategy and the adaptive fusing to obtain the illumination component used to represent ambient light distribution in the image includes:
[0016] performing guided filtering operations with the luminance channel as an input image and a guide image, calculating a linear relationship between the input image and the guide image in a local window, and outputting a guided filtering result;
[0017] performing noise suppression on flat regions with gradual grayscale changes in the luminance channel via a bilateral filtering algorithm, and limiting the smoothness of edge regions in the luminance channel, and outputting a bilateral filtering result;
[0018] performing weighted fusing on the guided filtering result and the bilateral filtering result to obtain the illumination component.
[0019] Optionally, the linear stretching processing of the initial reflection component according to the detail gain related parameter in the adaptive key parameter set to obtain an enhanced reflection component comprises:
[0020] The formula of the linear stretching processing is:
[0021]
[0022] wherein, is the enhanced reflection component, is the initial reflection component, is a gain coefficient in the adaptive key parameter set, is an offset parameter.
[0023] Optionally, the non-linear gamma correction processing of the illumination component according to the gamma correction parameter in the adaptive key parameter set to obtain a corrected illumination component comprises:
[0024] The formula of the non-linear gamma correction processing of the illumination component is:
[0025]
[0026] wherein, is the illumination component, is the corrected illumination component, is a gamma parameter.
[0027] Optionally, after the enhanced brightness channel and the original hue channel and saturation channel in the HSV color space are recombined and converted back to the RGB format to obtain an enhanced image, the method further comprises:
[0028] Based on the noise reduction intensity parameter in the adaptive key parameter set, a non-local mean filtering method is used to perform noise reduction processing on the enhanced image to output a final enhanced image.
[0029] Optionally, the noise reduction processing of the enhanced image based on the noise reduction intensity parameter in the adaptive key parameter set using the non-local mean filtering method to output a final enhanced image comprises:
[0030] Determining a filter kernel size and a similarity weight threshold of the non-local mean filtering;
[0031] Calculating the gray value difference between different pixel blocks in the enhanced image, and determining the similarity weight of each pixel block according to the gray value difference;
[0032] Performing non-local mean filtering processing on the enhanced image based on the filter kernel and the similarity weight threshold;
[0033] The pixel value of the preliminary enhanced image after the filtering processing is truncated to a preset effective range, and a final enhanced image is output.
[0034] Optionally, the method further comprises calculating a brightness feature of the brightness channel, the brightness feature comprising a global mean value, a normalized histogram and a standard deviation of the brightness channel, comprising:
[0035] counting a total number of pixels in the brightness channel;
[0036] calculating the global mean value of the brightness channel comprises:
[0037] traversing all pixel points in the brightness channel, and obtaining a gray value of each pixel one by one;
[0038] obtaining the global mean value based on the total number of pixels and the gray value of each pixel;
[0039] constructing the normalized histogram of the brightness channel comprises:
[0040] counting a number of pixels corresponding to each gray level in the brightness channel to form an original histogram;
[0041] obtaining a distribution probability of each gray level in the brightness channel based on the number of pixels corresponding to each gray level in the original histogram and the total number of pixels;
[0042] constructing the normalized histogram with the gray level as the horizontal axis and the distribution probability as the vertical axis;
[0043] calculating the standard deviation of the brightness channel comprises:
[0044] traversing all pixels and calculating a difference value between a gray value of each pixel and the global mean value, summing the square of the difference value to obtain a sum of squares;
[0045] obtaining an average square difference value based on the sum of squares and the total number of pixels, and taking the square root of the average square difference value to obtain the standard deviation.
[0046] Optionally, before recombining the enhanced brightness channel with the original hue channel and saturation channel in the HSV color space, the method further comprises adaptive adjustment of the saturation channel:
[0047] dynamically correcting the saturation channel based on an average brightness value in the statistical feature of the brightness channel;
[0048] when the average brightness value is lower than a preset brightness threshold, enhancing the saturation channel by a coefficient;
[0049] When the average brightness value is higher than or equal to a preset brightness threshold, the saturation channel is kept unchanged, and the preset brightness threshold is set according to 30% of the maximum pixel value of the brightness channel.
[0050] The second aspect of the present application provides an adaptive low-light image enhancement device, comprising:
[0051] A first conversion unit is configured to map an input low-light RGB image to an HSV color space, extract a brightness channel from the HSV color space, and calculate a brightness feature of the brightness channel, wherein the brightness feature comprises a global mean value, a normalized histogram, and a standard deviation of the brightness channel;
[0052] A generating unit is configured to generate an adaptive key parameter set by using a preset mapping function based on the brightness feature;
[0053] A first processing unit is configured to process the brightness channel by using a joint filtering strategy and to perform adaptive weighted fusion to obtain an illumination component, wherein the illumination component is used to represent ambient light distribution in an image;
[0054] A second conversion unit is configured to convert the brightness channel and the illumination component to a logarithmic domain and to perform operations to obtain an initial reflection component, wherein the initial reflection component is used to represent reflection characteristics and detail information of an object in the image;
[0055] A second processing unit is configured to perform linear stretching processing on the initial reflection component according to a detail gain related parameter in the adaptive key parameter set to obtain an enhanced reflection component;
[0056] A third processing unit is configured to perform nonlinear gamma correction processing on the illumination component according to a gamma correction parameter in the adaptive key parameter set to obtain a corrected illumination component;
[0057] A third conversion unit is configured to convert the enhanced reflection component back to a linear domain and to perform operations with the corrected illumination component to obtain an enhanced brightness channel;
[0058] A fourth conversion unit is configured to recombine the enhanced brightness channel with a hue channel and a saturation channel originally in the HSV color space, and to convert the recombined channels back to an RGB format to obtain an enhanced image.
[0059] The third aspect of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a program, and the program is executed on a computer to perform the method of the first aspect and any optional method of the first aspect.
[0060] As can be seen from the above technical solutions, the embodiments of the present application have the following advantages:
[0061] First, break the limitation of fixed parameters, realize the adaptive key parameter generation, this scheme extracts the statistical characteristics of the low light image brightness channel first, and then converts these scene characteristics into the key parameter set suitable for the current image through the preset mapping function, so that the parameters can be dynamically adjusted with the image illumination condition and noise level, avoiding the problem of insufficient or excessive enhancement caused by "one size fits all".
[0062] Second, optimize the illumination component estimation and reflection component enhancement logic, taking into account detail preservation and brightness uniformity, this scheme uses a joint filtering strategy to process the brightness channel, combining the smoothing characteristics of Gaussian filtering and the detail protection ability of edge preserving filtering, while preserving the trend of ambient light distribution, reducing the filtering of object edge details, making the estimated illumination component more accurate. At the same time, the traditional method only does fixed gain stretching on the reflection component, this scheme performs linear stretching based on adaptive detail gain parameters, which can specifically strengthen the hidden details in dark parts, and avoid distortion of bright part details due to excessive stretching.
[0063] Finally, supplement the illumination component correction and noise reduction link to solve the problem of "noise amplification and color imbalance". The traditional method does not make targeted adjustments to the illumination component, which can easily lead to uneven brightness of the enhanced image; this scheme uses adaptive gamma correction parameters to perform non-linear processing on the illumination component, and optimizes the brightness distribution according to the scene illumination difference, so that the bright area is not overexposed and the dark area has levels. In addition, this scheme specially adds noise reduction processing after obtaining the preliminary enhanced image, which can not only retain the details of the enhanced image, but also suppress noise points, further improving the image quality and subsequent analysis usability. BRIEF DESCRIPTION OF DRAWINGS
[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0065] Figure 1 An embodiment flowchart of an adaptive low-light image enhancement method provided by the present application;
[0066] Figure 2 An embodiment flowchart of calculating the illumination component provided by the present application;
[0067] Figure 3 An embodiment flowchart of using non-local mean filtering to perform noise reduction processing on the enhanced image provided by the present application;
[0068] Figure 4 An embodiment flowchart of adaptively adjusting the saturation channel provided by the present application;
[0069] Figure 5 A schematic flowchart illustrating an embodiment of calculating the brightness characteristics of the brightness channel provided in this application;
[0070] Figure 6 This is a structural diagram of an embodiment of an adaptive low-light image enhancement device provided in this application. Detailed Implementation
[0071] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0072] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0073] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0074] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0075] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0076] References to "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 an embodiment," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0077] Based on this, this application discloses an adaptive low-light image enhancement method, apparatus and storage medium for stably outputting high-quality images from various complex conditions.
[0078] The method of this application can be applied to servers, devices, terminals, or other devices with logical processing capabilities; therefore, this application does not limit its application. For ease of description, the following description uses a system as the executing entity.
[0079] Please see Figure 1 This application provides an embodiment of an adaptive low-light image enhancement method, comprising:
[0080] 101. Map the input low-light RGB image to the HSV color space, extract the luminance channel from the HSV color space, and calculate the luminance features of the luminance channel, including the global mean, normalized histogram, and standard deviation of the luminance channel.
[0081] 102. Based on brightness features, an adaptive key parameter set is generated through a preset mapping function;
[0082] In step 101, the low-light RGB image to be processed is first acquired, and then converted to the HSV color space using a color space mapping algorithm. Since the HSV space can separate luminance and color information, a luminance channel specifically reflecting the brightness of the image is extracted. The luminance characteristics of this channel are then calculated, including the global mean representing the overall luminance level. Normalized histogram reflecting pixel brightness distribution and the standard deviation that reflects the contrast of the image. .
[0083] Based on the brightness features obtained in step 101, step 102 calls a preset mapping function. This function automatically generates an adaptive key parameter set, including filter size, gain coefficient, etc., by logically associating the brightness features with parameters. The specific parameters are as follows:
[0084] Filter size parameter:
[0085] ;
[0086] Where A is the base filter radius, ensuring that the minimum window is used when the lighting is normal and there are no dark areas; B and C are the global brightness weight and dark pixel proportion weight, respectively, ensuring that the filter size is appropriately increased when the image is darker or has more dark areas, so as to obtain a smoother lighting estimate.
[0087] Detail gain parameters:
[0088] ;
[0089] D is the base gain coefficient, ensuring basic contrast enhancement even under normal lighting conditions; E is the gain adjustment coefficient, ensuring greater gain as the image darker, thereby enhancing shadow details.
[0090] Gamma correction parameters:
[0091] ;
[0092] Where: F is the lower limit of gamma, used to enhance the intensity of extremely dark images; G is the range coefficient, which controls the range of gamma value as brightness changes, ensuring that only slight enhancement is performed when the brightness is high to avoid overexposure.
[0093] Noise reduction strength parameters:
[0094] ;
[0095] Where H is the basic noise reduction intensity, and K is the adjustment coefficient. The integer should be a very small positive number to avoid the denominator being zero. When A smaller value indicates a flat image or a lot of noise. Adaptively increase to suppress noise; when When the value is large, it indicates rich details, so the noise reduction intensity is reduced to preserve structural information.
[0096] 103. The brightness channel is processed by a joint filtering strategy and adaptive weighted fusion is performed to obtain the illumination component, which is used to characterize the ambient light distribution in the image.
[0097] 104. Convert the luminance channel and illumination component to the logarithmic domain and perform calculations to obtain the initial reflection component. The initial reflection component is used to characterize the reflection characteristics and detail information of the object itself in the image.
[0098] Step 103 involves obtaining the illumination component that accurately represents the ambient light distribution of the image, specifically through a joint filtering strategy. This strategy employs two complementary filtering methods to collaboratively process the luminance channel. After completing both filtering processes, adaptive weighted fusion is performed based on the characteristics of different image regions. The gradient values of the luminance channel are calculated to distinguish between edge regions and flat regions. Edge regions with higher gradient values are assigned higher weights to the guided filtering results to ensure clear edges; flat regions with lower gradient values are assigned higher weights to the bilateral filtering results to enhance noise suppression, ultimately yielding the illumination component that truly reflects the ambient light distribution.
[0099] Step 104, based on Retinex theory, extracts core image details by separating the reflection components. First, the luminance channel and the illumination component obtained in step 103 are converted to the logarithmic domain. This conversion transforms the nonlinear multiplication relationship between them into a linear subtraction relationship, simplifying the calculation process. Then, the difference between the luminance channel and the illumination component in the logarithmic domain is calculated to obtain the initial reflection component. The initial reflection component is unaffected by ambient light intensity, retaining only the object's own reflective characteristics and encompassing key details such as texture and contour, laying the foundation for subsequent detail enhancement. The formula is as follows:
[0100] Based on Retinex theory ,in Represents the observed image, Indicates the irradiation component. This represents the reflected component. In the logarithmic field, this multiplication relationship can be transformed into an addition / subtraction form, which better reflects the human eye's perception of light intensity:
[0101] ;
[0102] This allows for the enhancement of detail by separating and strengthening the reflection components.
[0103] Logarithmic domain transformation: transform the input luminance channel With estimated irradiation component Mapped to the logarithmic field, the calculation formula is:
[0104] ;
[0105] in: It is a very small positive number, used to avoid logarithmic operations from tending towards negative infinity.
[0106] 105. Based on the detail gain-related parameters in the adaptive key parameter set, the initial reflection component is linearly stretched to obtain the enhanced reflection component.
[0107] Detail enhancement is performed on the initial reflection component to highlight the texture and contour information of objects in the image. Specifically, based on the detail gain parameters in the adaptive key parameter set, a linear stretching process is applied to the initial reflection component. The detail gain parameters dynamically adjust the stretching amplitude according to the brightness characteristics of the image in its early stages. If the image is generally dark and the details in the dark areas are deeply hidden, the stretching intensity is increased to expand the grayscale value range of the dark details; if there are local bright areas in the image, the stretching amplitude is appropriately reduced to avoid excessive detail enhancement leading to distortion. The final result is a more clearly enhanced reflection component with clearer details. The specific formula is as follows:
[0108] To enhance the details, Apply linear stretching:
[0109] ;
[0110] Among them, the gain coefficient With offset From adaptive parameters Control. Typically designed so that the lower the overall image brightness, the better. The larger the size, the more significant the contrast enhancement.
[0111] 106. Based on the gamma correction parameters in the adaptive key parameter set, perform nonlinear gamma correction processing on the irradiation component to obtain the corrected irradiation component.
[0112] Focusing on optimizing the brightness distribution of the illumination component, nonlinear gamma correction is performed on the illumination component using gamma correction parameters from an adaptive key parameter set. When the proportion of dark areas in the image is high, the correction parameter value is smaller to primarily enhance the brightness of dark areas; when there is a risk of overexposure in bright areas, the correction parameter value is larger to suppress excessive enhancement of bright areas. This results in a corrected illumination component with a more uniform brightness distribution that conforms to human visual perception. The specific formula is as follows:
[0113] To improve overall brightness, the amount of illumination is adjusted. Perform nonlinear gamma correction:
[0114] ;
[0115] Among them, gamma parameters Determined adaptively by step one. When At the same time, it can significantly improve the brightness of dark areas while avoiding overstretching of bright areas, thus maintaining visual naturalness.
[0116] 107. Convert the enhanced reflection component back to the linear domain and perform calculations with the corrected illumination component to obtain the enhanced brightness channel;
[0117] 108. Recombine the enhanced luminance channel with the original hue and saturation channels in the HSV color space, and then convert it back to RGB format to obtain the enhanced image.
[0118] Since the enhanced reflection component is in the logarithmic domain during the initial processing, the enhanced brightness channel, which combines detail and reasonable brightness, is reconstructed in step 107. Specifically, the enhanced reflection component is first converted back to the linear domain through an inverse exponential transform to restore the numerical dimension matching the enhanced reflection component and the corrected illumination component. Then, the two are multiplied to achieve the fusion of detail and brightness by utilizing the detail advantage of the enhanced reflection component and the brightness adjustment effect of the corrected illumination component. Finally, an enhanced brightness channel with clear details and balanced brightness is obtained.
[0119] Step 108 completes the image format restoration and output. The enhanced luminance channel is recombined with the original hue and saturation channels in the HSV color space to preserve the original color attributes of the image. Then, through the color space inverse conversion algorithm, the recombined HSV image is converted back to RGB format so that the image meets the requirements of conventional display and storage, and finally an enhanced image with optimized details, brightness and color in low-light scenes is obtained.
[0120] The specific algorithm formula is as follows:
[0121] Inverse exponential transform and luminance reconstruction: The enhanced reflection component is restored to the linear domain and multiplied with the corrected illumination component to obtain the enhanced luminance channel.
[0122] ;
[0123] The result is then truncated to the range [0,1] to ensure numerical stability.
[0124] Color restoration and adjustment: enhancing the color... With original hue With saturation The channels are recombined and converted back to RGB space. To mitigate potential color distortion, adaptive correction is introduced for the saturation channel:
[0125] ;
[0126] in, For control coefficients, global brightness The lower the saturation level, the greater the increase in saturation should be to maintain a natural perception.
[0127] In this embodiment, firstly, the limitations of fixed parameters are overcome to achieve adaptive key parameter generation. This solution first extracts the statistical features of the brightness channel of the low-light image, and then transforms these scene features into a key parameter set that adapts to the current image through a preset mapping function. This allows the parameters to be dynamically adjusted according to the image lighting conditions and noise level, avoiding the problem of insufficient or excessive enhancement caused by "one-size-fits-all".
[0128] Secondly, the logic for estimating the illumination component and enhancing the reflection component is optimized to balance detail preservation and brightness uniformity. This solution employs a joint filtering strategy to process the brightness channel, combining the smoothing properties of Gaussian filtering with the detail preservation capabilities of edge-preserving filtering. While retaining the ambient light distribution trend, it reduces the filtering of object edge details, making the estimated illumination component more accurate. Simultaneously, while traditional methods only apply fixed gain stretching to the reflection component, this solution performs linear stretching based on adaptive detail gain parameters. This effectively enhances hidden details in dark areas while avoiding distortion of bright details due to over-stretching.
[0129] Finally, the illumination component correction and noise reduction steps are added to address the issues of "noise amplification and color imbalance." Traditional methods do not specifically adjust the illumination component, which can easily lead to uneven brightness in the enhanced image. This solution uses adaptive gamma correction parameters to perform non-linear processing on the illumination component, optimizing the brightness distribution according to the differences in scene illumination, ensuring that bright areas are not overexposed and dark areas have detail. In addition, after obtaining the initial enhanced image, this solution specifically adds noise reduction processing to suppress noise while preserving enhanced details, further improving image quality and usability for subsequent analysis.
[0130] Please see Figure 2 This application provides an embodiment of a method for calculating radiation components, comprising:
[0131] 201. Using the luminance channel as the input image and the guide image, perform guided filtering operation, calculate the linear relationship between the input image and the guide image within the local window, and output the guided filtering result;
[0132] 202. Using the luminance channel as input, a bilateral filtering algorithm is used to suppress noise in the flat areas of the luminance channel where the grayscale changes are gradual, and to limit the smoothness of the edge areas in the luminance channel. The result of the bilateral filtering is then output.
[0133] 203. The guided filtering result and the bilateral filtering result are weighted and fused to obtain the illumination component.
[0134] Step 201 preserves the edge features of the luminance channel through guided filtering. The luminance channel is used as both the input image and the guide image. The linear relationship between the two is calculated within a preset local window. The constraint of the guide image on the input image is used to make the filtering result adjust synchronously with the changes in the edge of the luminance channel. This achieves both smoothing and precise preservation of edge details, and finally outputs the guided filtering result.
[0135] Step 202 uses bilateral filtering to suppress noise in flat areas. Taking the luminance channel as input, the algorithm considers both pixel spatial distance and grayscale similarity: for flat areas with gentle grayscale changes, the smoothing effect is enhanced to eliminate noise; for edge areas, the smoothing degree is limited to avoid edge blurring, and the bilateral filtering result is output.
[0136] Step 203 weights and fuses the two filtering results, assigning weights according to the characteristics of the image region. Edge regions are given priority to the guiding filtering result, while flat regions are given priority to the bilateral filtering result, ultimately obtaining an illumination component that balances edge preservation and noise suppression.
[0137] The guided filtering results and bilateral filtering results Weighted fusion is performed to obtain the final irradiation component. The algorithm is as follows:
[0138] ;
[0139] Among them, weight It can adaptively adjust based on local region characteristics: in edge regions, It places greater emphasis on guided filtering results with superior edge preservation performance; in flat areas, It relies more on the results of bilateral filtering with better noise suppression capabilities. The weight mapping function can be determined through empirical modeling or a preset strategy.
[0140] In this embodiment, guided filtering and bilateral filtering complement each other, improving the quality and applicability of the illumination component. Guided filtering, guided by the luminance channel, uses linear relationships within a local window to smooth luminance information while accurately preserving edge structure, and avoids gradient inversion artifacts that are prone to occur in bilateral filtering, ensuring natural and continuous edge contours. Bilateral filtering, relying on the dual weights of spatial proximity and gray-level similarity, specifically suppresses noise in flat areas, while limiting the smoothness of edges to avoid blurring details. The two work together to avoid the shortcomings of single filtering, which either blurs edges or fails to suppress noise sufficiently. The weighted fusion strategy combines the edge preservation advantage of guided filtering with the noise suppression advantage of bilateral filtering. By dynamically allocating weights, edge areas are prioritized for guided filtering results to preserve structure, while flat areas are prioritized for bilateral filtering results to reduce noise. The resulting illumination component conforms to the smooth characteristics of ambient light distribution while maintaining detail integrity, providing a high-quality illumination foundation for image enhancement based on Retinex theory.
[0141] Please see Figure 3 This application provides an embodiment of a method for denoising enhanced images using nonlocal mean filtering, comprising:
[0142] 301. Determine the filter kernel size and similarity weight threshold for nonlocal mean filtering;
[0143] 302. Calculate the gray value difference between different pixel blocks in the enhanced image, and determine the similarity weight of each pixel block based on the gray value difference;
[0144] 303. Perform nonlocal mean filtering on the enhanced image based on the filter kernel and similarity weight threshold;
[0145] 304. Truncate the pixel values of the initially enhanced image after filtering to a preset effective range and output the final enhanced image.
[0146] Step 301 sets the core parameters for nonlocal mean filtering. Specifically, it combines the noise reduction intensity parameters in the adaptive key parameter set generated in the previous embodiment to determine the filter kernel size and similarity weight threshold. The filter kernel size is dynamically adjusted according to the image noise density. The more severe the noise, the larger the kernel size is to cover more similar pixel blocks. The similarity weight threshold is set as the benchmark for judging whether pixel blocks are similar, so as to avoid misjudging noise blocks as similar texture blocks.
[0147] Step 302 calculates weights based on pixel block similarity. First, the enhanced image is divided into pixel blocks of fixed size (such as 3×3 or 5×5 blocks). The difference in grayscale values between different pixel blocks is quantized by calculating the Euclidean distance. If the distance is less than the similarity weight threshold, it is determined to be a high similarity block and assigned a higher weight. If the distance is greater than the threshold, it is determined to be a low similarity block and assigned a lower weight. This completes the weight allocation for each pixel block.
[0148] Steps 303 and 304 perform filtering and output optimization. Based on the filtering kernel and similarity weight set in step 301, the gray values of highly similar pixel blocks in the neighborhood of each pixel in the enhanced image are fused to achieve noise reduction. After filtering, the pixel values are further truncated to a preset effective range to avoid pixel value overflow caused by filtering operations. Finally, the enhanced image with sufficient noise suppression and complete texture details is output.
[0149] In this embodiment, by specifically determining the filter kernel size and similarity weight threshold, the parameters can be dynamically adapted according to the actual noise intensity of the enhanced image, solving the problem of "difficulty in balancing noise reduction and detail preservation" in traditional fixed-parameter filtering. By assigning similarity weights based on the differences in pixel block grayscale values, texture blocks and noise blocks can be accurately identified. High-similarity texture blocks are given high weights to fully preserve image details, while low-similarity noise blocks are given low weights to effectively suppress noise, further improving the accuracy of filtering. Combined with non-local mean filtering using the above parameters, and subsequent pixel value truncation processing, residual noise in low-light images is completely eliminated, and pixel value overflow caused by filtering operations is avoided. The final output is an enhanced image with clear details, balanced brightness, and normal display, fully meeting the practical needs of image visualization and subsequent processing in low-light scenarios.
[0150] Please see Figure 4 This application provides an embodiment of a method for adaptively adjusting the saturation channel, comprising:
[0151] 401. Based on the average brightness value in the statistical characteristics of the brightness channel, dynamically correct the saturation channel;
[0152] 402. When the average brightness value is lower than the preset brightness threshold, the saturation channel is enhanced by a coefficient.
[0153] 403. When the average brightness value is higher than or equal to the preset brightness threshold, the saturation channel remains unchanged. The preset brightness threshold is set according to 30% of the maximum pixel value of the brightness channel.
[0154] Step 401 focuses on the dynamic correction of the saturation channel to ensure that the image color performance is adapted to the lighting scene. The core basis is the average brightness value in the statistical characteristics of the brightness channel calculated in the previous embodiment. Because in low light environment, the saturation channel of the HSV color space is easily suppressed by brightness and appears dark. The average brightness value is used to judge the current light level, providing a quantitative basis for saturation adjustment and avoiding color imbalance caused by fixed saturation processing.
[0155] In step 402, when the average brightness value of the brightness channel is lower than a preset threshold, the saturation enhancement mechanism is activated. The enhancement coefficient here is dynamically adjusted based on the difference between the average brightness value and the preset threshold—if the average brightness is much lower than the threshold, the enhancement coefficient is appropriately increased to improve saturation and improve dull colors; if the average brightness is close to the threshold, the coefficient is appropriately decreased to avoid over-enhancement that leads to overly vibrant colors.
[0156] Step 403 clarifies the setting logic of the preset threshold to ensure that the threshold can accurately distinguish between low-light and normal-light scenes: the threshold is set to 30% of the maximum pixel value of the brightness channel. When the average brightness is lower than 30% of the maximum pixel value, it is determined to be low-light and the saturation needs to be enhanced; when the average brightness is higher than or equal to 30% of the maximum pixel value, it means that the light is sufficient and the original saturation channel can present normal colors. Keeping it unchanged can avoid color oversaturation and distortion caused by excessive adjustment, and finally achieve a balanced and natural color performance under different lighting conditions.
[0157] In this embodiment, the contradiction between the dim colors in low-light images and the oversaturation in normal-light images is resolved by dynamically correcting the saturation channel. When the average brightness is less than 30% of the maximum brightness, saturation is enhanced by a coefficient to restore color vividness and prevent color fading caused by insufficient light. At normal brightness, saturation remains constant to prevent color distortion caused by over-adjustment. A preset threshold is set based on the characteristics of the brightness channel to ensure accurate judgment of lighting scenes, ultimately ensuring that image colors remain natural and balanced under different lighting conditions, significantly improving visual comfort and color performance.
[0158] Please see Figure 5 This application provides an embodiment of a method for calculating the luminance characteristics of a luminance channel, comprising:
[0159] 501. Count the total number of pixels in the luminance channel;
[0160] 502. Traverse all pixels in the luminance channel and obtain the grayscale value of each pixel one by one;
[0161] 503. Based on the total number of pixels and the grayscale value of each pixel, obtain the global mean;
[0162] 504. Count the number of pixels corresponding to each gray level in the brightness channel to form the original histogram;
[0163] 505. Based on the number of pixels corresponding to each gray level and the total number of pixels in the original histogram, obtain the distribution probability of each gray level in the brightness channel;
[0164] 506. Construct a normalized histogram with gray level as the horizontal axis and probability distribution as the vertical axis;
[0165] 507. Iterate through all pixels and calculate the difference between the gray value of each pixel and the global mean. Squar the differences and sum them to get the sum of squares.
[0166] 508. Based on the sum of squares and the total number of pixels, obtain the mean square difference, and take the square root of the mean square difference to obtain the standard deviation.
[0167] Step 501 provides a basic quantitative basis for subsequent calculations of the global mean and normalized histogram. The total number of pixels obtained in this step will be used as the divisor when calculating the global mean and as the benchmark when calculating the distribution probability of the normalized histogram, ensuring the accuracy and consistency of subsequent statistical results.
[0168] Step 502 aims to collect the grayscale values of all pixels within the luminance channel, providing raw data for calculating the global mean and standard deviation. During this operation, a row-by-row, column-by-column traversal method is used to extract the grayscale value of each pixel one by one through the image data reading interface. Since the luminance channel is a single-channel image, each pixel's grayscale value only needs to be represented by a single numerical value, with a fixed range of 0-255. This ensures that the traversal process is complete and without omissions or repetitions, acquiring the grayscale values of all pixels to avoid affecting the accuracy of subsequent statistical results due to missing data.
[0169] Step 503 involves summing all the pixel grayscale values obtained in step 502 to obtain the total grayscale value, and then dividing the total grayscale value by the total number of pixels counted in step 501 to obtain the global mean.
[0170] Step 504 first defines the grayscale range as 0-255, then initializes a counting array of length 256 (array indices correspond to grayscale levels 0-255, and array elements are initially set to 0). Next, iterates through all the pixel grayscale values obtained in step 502, incrementing the value of the element at the corresponding index in the counting array by 1 for each grayscale value read. After the iteration is complete, the value of each element in the counting array represents the number of pixels at the corresponding grayscale level. The data is then processed to form the original histogram.
[0171] Step 505 transforms the "pixel count" of the original histogram into a "distribution probability," eliminating the influence of the total pixel count on the distribution result and enabling horizontal comparison of grayscale distribution features between brightness channel images of different resolutions. First, the original histogram obtained in step 504 and the total pixel count obtained in step 501 are retrieved; then, the distribution probability is calculated for each grayscale level. Since the pixel count for each grayscale level is a non-negative integer, and the total pixel count is a fixed positive number...
[0172] Step 506 presents the grayscale distribution pattern of the brightness channel through visualization, making the distribution characteristics more intuitive and easier to understand. First, the meanings of the horizontal and vertical axes of the coordinate system are determined: the horizontal axis represents grayscale levels, ranging from 0 to 255, with scales evenly arranged in ascending order; the vertical axis represents distribution probability, ranging from 0 to 1, with scale intervals set based on the maximum distribution probability of all grayscale levels. Then, for each grayscale level, its corresponding horizontal axis position is found in the coordinate system, and the vertical axis position is determined based on the distribution probability of that grayscale level, marking the corresponding coordinate points; finally, all coordinate points are connected sequentially according to grayscale level to form a continuous line graph, which is the normalized histogram.
[0173] Step 507 provides key intermediate data for calculating the standard deviation, the core of which is to quantify the degree of deviation of each pixel's grayscale value from the overall brightness level.
[0174] Step 508 further calculates the sum of squares into the standard deviation, which can directly characterize the dispersion of brightness distribution, providing a quantitative basis for subsequent judgment of image contrast.
[0175] In this embodiment, by counting the total pixels and extracting grayscale values, the global mean reflecting the overall brightness and the standard deviation reflecting the contrast are calculated, laying a reliable foundation for subsequent parameter generation and avoiding the impact of data deviation on the enhancement effect. By using the original histogram and the normalized histogram, the grayscale distribution is transformed into intuitive information, which can quickly identify the brightness defects of low-light images and provide direction for targeted processing. The obtained global mean, normalized histogram, and standard deviation can support saturation correction, filtering strategy optimization, and detail gain adjustment, respectively, making subsequent processing more in line with the actual situation of the image and effectively improving the adaptability and overall effect of low-light image enhancement.
[0176] Please see Figure 6 This application provides an embodiment of an adaptive low-light image enhancement device, comprising:
[0177] The first conversion unit 601 is used to map the input low-light RGB image to the HSV color space, extract the luminance channel from the HSV color space, and calculate the luminance features of the luminance channel, including the global mean, normalized histogram and standard deviation of the luminance channel.
[0178] Specifically, the first conversion unit 601 includes:
[0179] Count the total number of pixels in the brightness channel;
[0180] The calculation of the global mean of the luminance channel includes:
[0181] Iterate through all pixels in the luminance channel and obtain the grayscale value of each pixel one by one;
[0182] The global mean is obtained based on the total number of pixels and the grayscale value of each pixel;
[0183] Constructing the normalized histogram for the luminance channel includes:
[0184] The number of pixels corresponding to each gray level in the brightness channel is counted to form the original histogram;
[0185] Based on the number of pixels corresponding to each gray level and the total number of pixels in the original histogram, the distribution probability of each gray level in the brightness channel is obtained.
[0186] Construct a normalized histogram with gray level as the horizontal axis and probability distribution as the vertical axis;
[0187] The standard deviation of the luminance channel is calculated as follows:
[0188] Iterate through all pixels and calculate the difference between the grayscale value of each pixel and the global mean. Squar the differences and sum them to get the sum of squares.
[0189] The mean squared difference is obtained by taking the square root of the mean squared difference and the total number of pixels. The standard deviation is then obtained by taking the square root of the mean squared difference.
[0190] The generation unit 602 is used to generate an adaptive key parameter set based on brightness features through a preset mapping function;
[0191] The first processing unit 603 is used to process the brightness channel through a joint filtering strategy and perform adaptive weighted fusion to obtain the illumination component, which is used to characterize the ambient light distribution in the image.
[0192] Specifically, the first processing unit 603 includes:
[0193] Using the luminance channel as the input image and the guide image, a guided filtering operation is performed to calculate the linear relationship between the input image and the guide image within a local window, and the guided filtering result is output.
[0194] Using the luminance channel as input, a bilateral filtering algorithm is used to suppress noise in flat areas with gradual grayscale changes in the luminance channel, and to limit the smoothness of edge areas in the luminance channel, outputting the bilateral filtering result.
[0195] The guided filtering result and the bilateral filtering result are weighted and fused to obtain the illumination component.
[0196] The second conversion unit 604 is used to convert the brightness channel and illumination component to the logarithmic domain and perform calculations to obtain the initial reflection component. The initial reflection component is used to characterize the reflection characteristics and detail information of the object itself in the image.
[0197] The second processing unit 605 is used to perform linear stretching on the initial reflection component according to the detail gain related parameters in the adaptive key parameter set to obtain the enhanced reflection component.
[0198] Specifically, the second processing unit 605 includes:
[0199] The formula for linear stretching is:
[0200]
[0201] in, To enhance the reflection component, For the initial reflection component, For the gain coefficients in the adaptive key parameter set, This is the offset parameter.
[0202] The third processing unit 606 is used to perform nonlinear gamma correction processing on the irradiation component according to the gamma correction parameters in the adaptive key parameter set to obtain the corrected irradiation component.
[0203] Specifically, the third processing unit 606 includes:
[0204] The formula for nonlinear gamma correction of the irradiation component is:
[0205]
[0206] in, For the irradiation component, To correct the irradiation component, For gamma parameters.
[0207] The third conversion unit 607 is used to convert the enhanced reflection component back to the linear domain and perform calculations with the corrected illumination component to obtain the enhanced brightness channel.
[0208] Specifically, it also includes correction unit 608:
[0209] The saturation channel is dynamically corrected based on the average luminance value in the statistical characteristics of the luminance channel.
[0210] Specifically, it also includes enhancement unit 609:
[0211] When the average brightness value is lower than the preset brightness threshold, the saturation channel is enhanced by a coefficient.
[0212] Specifically, it also includes holding unit 610:
[0213] When the average brightness value is higher than or equal to the preset brightness threshold, the saturation channel remains unchanged. The preset brightness threshold is set according to 30% of the maximum pixel value of the brightness channel.
[0214] The fourth conversion unit 611 is used to recombine the enhanced brightness channel with the original hue and saturation channels in the HSV color space, and then convert it back to RGB format to obtain an enhanced image.
[0215] Specifically, it also includes the fourth processing unit 612:
[0216] Based on the noise reduction intensity parameters in the adaptive key parameter set, a nonlocal mean filtering method is used to denoise the enhanced image, and the final enhanced image is output.
[0217] Specifically, the fourth processing unit 612 includes:
[0218] Determine the filter kernel size and similarity weight threshold for nonlocal mean filtering;
[0219] Calculate the gray value difference between different pixel blocks in the enhanced image, and determine the similarity weight of each pixel block based on the gray value difference;
[0220] Nonlocal mean filtering is performed on the enhanced image based on the filter kernel and similarity weight threshold;
[0221] The pixel values of the initially enhanced image after filtering are truncated to a preset effective range, and the final enhanced image is output.
[0222] For detailed implementation methods, please refer to... Figures 1 to 5 Examples are not detailed here.
[0223] This application provides a computer-readable storage medium on which a program is stored, and when the program is executed on a computer, it performs the following... Figure 1 , Figure 2 , Figure 3 , Figure 4 as well as Figure 5 The method in the middle.
[0224] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0225] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0226] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0227] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0228] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. An adaptive low-light image enhancement method, characterized in that, include: The input low-light RGB image is mapped to the HSV color space, the luminance channel is extracted from the HSV color space, and the luminance features of the luminance channel are calculated. The luminance features include the global mean, normalized histogram and standard deviation of the luminance channel. Based on the brightness characteristics, an adaptive set of key parameters is generated through a preset mapping function; The brightness channel is processed by a joint filtering strategy and adaptive weighted fusion is performed to obtain the illumination component, which is used to characterize the ambient light distribution in the image. The brightness channel and the illumination component are converted to the logarithmic domain and operated on to obtain the initial reflection component, which is used to characterize the reflection characteristics and detail information of the object itself in the image. Based on the detail gain-related parameters in the adaptive key parameter set, the initial reflection component is linearly stretched to obtain the enhanced reflection component. Based on the gamma correction parameters in the adaptive key parameter set, the irradiation component is subjected to nonlinear gamma correction processing to obtain the corrected irradiation component. The enhanced reflection component is converted back to the linear domain and calculated with the corrected illumination component to obtain the enhanced brightness channel. The enhanced brightness channel is recombined with the original hue and saturation channels in the HSV color space, and then converted back to RGB format to obtain an enhanced image; The brightness channel is processed by a joint filtering strategy and then adaptively weighted and fused to obtain an illumination component. This illumination component is used to characterize the ambient light distribution in the image, including: Using the brightness channel as the input image and the guide image, a guided filtering operation is performed to calculate the linear relationship between the input image and the guide image within a local window, and the guided filtering result is output. Using the brightness channel as input, a bilateral filtering algorithm is used to suppress noise in the flat areas of the brightness channel where the grayscale changes are gradual, and to limit the smoothness of the edge areas in the brightness channel, and output the bilateral filtering result. The guided filtering result and the bilateral filtering result are weighted and fused. The gradient value of the brightness channel is calculated to distinguish the edge region from the flat region. The guided filtering result is given a higher weight to the edge region with a higher gradient value to ensure the edge is clear, while the bilateral filtering result is given a higher weight to the flat region with a lower gradient value to enhance the noise suppression effect, thus obtaining the illumination component.
2. The adaptive low-light image enhancement method according to claim 1, characterized in that, The step of linearly stretching the initial reflection component according to the detail gain correlation parameters in the adaptive key parameter set to obtain the enhanced reflection component includes: The formula for the linear stretching process is: in, To enhance the reflection component, For the initial reflection component, For the gain coefficients in the adaptive key parameter set, This is the offset parameter.
3. The adaptive low-light image enhancement method according to claim 1, characterized in that, The step of performing nonlinear gamma correction processing on the irradiation component based on the gamma correction parameters in the adaptive key parameter set to obtain the corrected irradiation component includes: The formula for nonlinear gamma correction of the irradiation component is: in, For the irradiation component, To correct the irradiation component, For gamma parameters.
4. The adaptive low-light image enhancement method according to claim 1, characterized in that, After recombining the enhanced brightness channel with the original hue and saturation channels in the HSV color space, and then converting it back to RGB format to obtain the enhanced image, the method further includes: Based on the noise reduction intensity parameters in the adaptive key parameter set, a nonlocal mean filtering method is used to denoise the enhanced image, and the final enhanced image is output.
5. The adaptive low-light image enhancement method according to claim 4, characterized in that, The method of using nonlocal mean filtering to denoise the enhanced image based on the denoising intensity parameters in the adaptive key parameter set, and outputting the final enhanced image, includes: Determine the filter kernel size and similarity weight threshold for nonlocal mean filtering; Calculate the grayscale value difference between different pixel blocks in the enhanced image, and determine the similarity weight of each pixel block based on the grayscale value difference; The enhanced image is subjected to nonlocal mean filtering based on the filter kernel and the similarity weight threshold; The pixel values of the initially enhanced image after filtering are truncated to a preset effective range, and the final enhanced image is output.
6. The adaptive low-light image enhancement method according to claim 1, characterized in that, The calculation of the luminance characteristics of the luminance channel, wherein the luminance characteristics include the global mean, normalized histogram, and standard deviation of the luminance channel, includes: Count the total number of pixels in the brightness channel; Calculating the global mean of the luminance channel includes: Iterate through all pixels in the brightness channel and obtain the grayscale value of each pixel one by one; The global mean is obtained based on the total number of pixels and the grayscale value of each pixel; Constructing the normalized histogram of the brightness channel includes: The number of pixels corresponding to each gray level in the brightness channel is counted to form the original histogram; Based on the number of pixels corresponding to each gray level in the original histogram and the total number of pixels, the distribution probability of each gray level in the brightness channel is obtained. The normalized histogram is constructed with the gray level as the horizontal axis and the probability distribution as the vertical axis. The standard deviation of the luminance channel is calculated as follows: Iterate through all pixels and calculate the difference between the grayscale value of each pixel and the global mean. Squar the differences and sum them to get the sum of squares. The mean squared difference is obtained based on the sum of squares and the total number of pixels, and the standard deviation is obtained by taking the square root of the mean squared difference.
7. The adaptive low-light image enhancement method according to any one of claims 1 to 6, characterized in that, Before recombining the enhanced brightness channel with the original hue and saturation channels in the HSV color space, the method further includes adaptive adjustment of the saturation channel: The saturation channel is dynamically corrected based on the average luminance value in the statistical characteristics of the luminance channel. When the average brightness value is lower than a preset brightness threshold, the saturation channel is enhanced by a coefficient. When the average brightness value is higher than or equal to a preset brightness threshold, the saturation channel remains unchanged. The preset brightness threshold is set according to 30% of the maximum pixel value of the brightness channel.
8. An adaptive low-light image enhancement device, characterized in that, The apparatus for performing the method as described in any one of claims 1 to 7 comprises: The first conversion unit is used to map the input low-light RGB image to the HSV color space, extract the luminance channel from the HSV color space, and calculate the luminance features of the luminance channel, wherein the luminance features include the global mean, normalized histogram and standard deviation of the luminance channel. The generation unit is used to generate an adaptive key parameter set based on the brightness features using a preset mapping function; The first processing unit is used to process the brightness channel through a joint filtering strategy and perform adaptive weighted fusion to obtain the illumination component, which is used to characterize the ambient light distribution in the image. The second conversion unit is used to convert the brightness channel and the illumination component to the logarithmic domain and perform calculations to obtain an initial reflection component, which is used to characterize the reflection characteristics and detail information of the object itself in the image. The second processing unit is used to perform linear stretching on the initial reflection component according to the detail gain-related parameters in the adaptive key parameter set to obtain the enhanced reflection component. The third processing unit is used to perform nonlinear gamma correction processing on the irradiation component according to the gamma correction parameters in the adaptive key parameter set to obtain the corrected irradiation component. The third conversion unit is used to convert the enhanced reflection component back to the linear domain and perform calculations with the corrected illumination component to obtain the enhanced brightness channel. The fourth conversion unit is used to recombine the enhanced brightness channel with the original hue and saturation channels in the HSV color space, and then convert it back to RGB format to obtain an enhanced image.
9. A computer-readable storage medium having a program stored thereon, the program performing the adaptive low-light image enhancement method as described in any one of claims 1 to 7 when executed on a computer.
Citation Information
Patent Citations
Color image enhancement method based on bright channel filtering
CN103578084A
Retinex-theory-based nonlinear image enhancement method and system
CN104346776A