Adaptive image enhancement method and device in low-light scene
By using an adaptive image enhancement method to determine the scene and partition the RGB image, and a dynamic matching enhancement algorithm, the contradiction between brightness enhancement, noise suppression, and detail preservation in low-light environments is resolved, thus improving image quality.
Patent Information
- Application Number
- CN202511871017.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2045-12-12
AI Technical Summary
Existing technologies struggle to balance brightness enhancement with noise suppression and detail preservation in low-light environments, and lack differentiated processing for different low-light intensities, resulting in poor image quality.
An adaptive image enhancement method is adopted. By performing scene determination and adaptive partitioning processing on RGB images, illumination, noise and detail features are extracted, enhancement algorithms or combinations of algorithms are dynamically matched, and cross-partition fusion and naturalness optimization are performed to achieve accurate identification and end-to-end adaptation for different illumination intensities.
It effectively resolves the contradiction between noise suppression and detail preservation under extremely low light conditions, significantly improves the visual naturalness of images, and eliminates stitching marks and color distortion.
Smart Images

Figure CN121304516B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to an adaptive image enhancement method and apparatus for low-light scenes. Background Technology
[0002] With the widespread application of artificial intelligence technology in image processing, image enhancement in low-light environments has become crucial for improving visual perception. Especially in scenarios such as security monitoring and intelligent transportation, RGB images acquired at night, on cloudy days, or in low-light indoor environments often suffer from low overall brightness, significant noise, and severe loss of detail.
[0003] Existing technologies mostly employ globally uniform enhancement methods, such as gamma correction or histogram equalization with fixed parameters. These methods lack adaptability to local image features and struggle to balance brightness enhancement with noise suppression and detail preservation. Furthermore, traditional methods do not consider the differentiated needs of varying low-light intensities. For instance, the conflict between noise and detail is more pronounced in extreme low-light scenes, while in regular low-light scenes, it is necessary to avoid color distortion caused by over-enhancement.
[0004] Therefore, there is an urgent need in the existing technology for an adaptive image enhancement method and device for low-light scenes that can adaptively partition according to scene characteristics, dynamically match enhancement strategies, and take into account naturalness optimization, so as to comprehensively improve the visual quality and usability of images in low-light environments. Summary of the Invention
[0005] Therefore, it is necessary to provide an adaptive image enhancement method and apparatus for low-light scenes to address the aforementioned technical problems.
[0006] In a first aspect, the present invention provides an adaptive image enhancement method for low-light scenes, comprising:
[0007] Low-light scene determination is performed on RGB images to obtain the corresponding scene categories, which include normal low-light scenes and extreme low-light scenes;
[0008] Based on the scene category, the RGB image is adaptively partitioned to obtain multiple region images, which include the central region, the near-edge transition region, and the far-edge low-light region.
[0009] For each region image in multiple region images, illumination features, noise features, and detail features are extracted respectively, and a feature matrix corresponding to each region image is generated based on the extracted illumination features, noise features, and detail features.
[0010] Based on the scene category and feature matrix, and through a preset matching strategy, the corresponding image enhancement algorithm or algorithm combination is dynamically matched from a pre-set enhancement strategy library for each region image.
[0011] An image enhancement algorithm or a combination of algorithms is used to match each region image to perform image enhancement processing on the corresponding region image, resulting in enhanced images of each region.
[0012] The enhanced images of each region are sequentially subjected to cross-region fusion and color consistency calibration to obtain calibrated RGB images. The calibrated RGB images are then subjected to naturalness optimization processing to output the enhanced RGB images.
[0013] Secondly, the present invention provides an adaptive image enhancement device for low-light scenes, comprising:
[0014] The scene determination module is used to determine low-light scenes in RGB images and obtain the corresponding scene categories, which include normal low-light scenes and extreme low-light scenes.
[0015] The partitioning module, connected to the scene determination module, is used to adaptively partition the RGB image according to the scene category to obtain multiple region images, including the central region, the near-edge transition region, and the far-edge low-light region.
[0016] The feature extraction module, connected to the partitioning module, is used to extract illumination features, noise features, and detail features from each region image in multiple region images, and generate a feature matrix corresponding to each region image based on the extracted illumination features, noise features, and detail features.
[0017] The strategy matching module, connected to the feature extraction module, is used to dynamically match the corresponding image enhancement algorithm or algorithm combination for each region image from a pre-set enhancement strategy library based on the scene category and feature matrix and a preset matching strategy.
[0018] The enhancement processing module, connected to the strategy matching module, is used to perform image enhancement processing on the corresponding region image by using an image enhancement algorithm or a combination of algorithms matched for each region image, so as to obtain the enhanced region images;
[0019] The fusion optimization module, connected to the enhancement processing module, is used to sequentially perform cross-region fusion and color consistency calibration on the enhanced images of each region to obtain a calibrated RGB image. The calibrated RGB image is then subjected to naturalness optimization processing to output an enhanced RGB image.
[0020] The adaptive image enhancement method and apparatus for low-light scenes provided by this invention achieves accurate identification and end-to-end adaptation for different light intensities by constructing a hierarchical judgment mechanism for "normal-extreme" low-light scenes, effectively solving the core contradiction between noise suppression and detail preservation under extreme low light conditions. It employs an adaptive partitioning strategy based on "spatial location and illumination gradient," combined with deep learning-enabled three-dimensional feature analysis of "illumination-noise-detail," to dynamically match the optimal enhancement algorithm for each partition. Furthermore, it significantly eliminates stitching artifacts and color distortion through multi-scale cross-partition fusion and naturalness optimization techniques, improving the visual naturalness of the image. Attached Figure Description
[0021] Figure 1a A flowchart illustrating an adaptive image enhancement method for low-light scenes provided in an embodiment of the present invention;
[0022] Figure 1b Another flowchart illustrating the adaptive image enhancement method in low-light scenes provided in an embodiment of the present invention;
[0023] Figure 1c This is another flowchart illustrating the adaptive image enhancement method for low-light scenes provided in this embodiment of the invention.
[0024] Figure 2 A schematic diagram of the circuit module structure of the adaptive image enhancement device in low-light scenes provided in an embodiment of the present invention;
[0025] Figure 3 This is an internal structural diagram of a computer device according to one embodiment of the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0027] like Figure 1a As shown, the present invention provides an adaptive image enhancement method for low-light scenes, comprising:
[0028] Step S11: Determine the low-light scene of the RGB image to obtain the corresponding scene category, where the scene category includes normal low-light scene and extreme low-light scene;
[0029] Among them, such as Figure 1b As shown, step S11 may specifically include:
[0030] Step S111: Calculate the global average brightness, dynamic range, relative color temperature index based on RGB distribution, and local dark area proportion of the RGB image respectively;
[0031] In this invention, those skilled in the art can flexibly choose the calculation methods for the global average brightness value, dynamic range value, relative color temperature index based on RGB distribution, and the proportion of local dark areas in RGB images according to actual needs, and no limitation is made here.
[0032] Taking the OpenCV library as an example, the RGB image is first read using the cv2.imread() function. This function parses the RGB image into a three-dimensional NumPy array in BGR format, where each element represents the intensity value of a pixel at a specific location in the RGB image in the blue, green, and red channels, with a value range of 0-255.
[0033] After obtaining the three-dimensional NumPy array, the `cv2.cvtColor()` function, along with the `cv2.COLOR_BGR2YUV` parameter, converts the RGB image from the BGR color space to the YUV color space. This conversion process is based on the ITU-R BT.601 international standard, and its core is the luminance calculation formula Y = 0.299 × R + 0.587 × G + 0.114 × B. This formula takes into account the physiological characteristics of the human eye's sensitivity to different colors. After the conversion, the value of the Y channel is directly extracted, which is the luminance value of each pixel.
[0034] Finally, by averaging the brightness values of all pixels using the np.mean() function in the NumPy library, an accurate global average brightness value can be obtained, providing a crucial basis for determining low-light scenes.
[0035] Continuing the previous example, after obtaining the brightness value of each pixel in the RGB image, the maximum brightness value L in the brightness channel is calculated using the np.max() and np.min() functions of the NumPy library. max and minimum brightness L min Subtracting the two gives the dynamic range value D=L max -L min This dynamic range value reflects the difference in brightness between the brightest and darkest pixels in an image, and is an important indicator for evaluating image quality in low-light scenes.
[0036] Calculating the relative color temperature index based on the RGB distribution requires extracting color information from the RGB image and estimating the color temperature. Continuing with the OpenCV library as an example, first, the RGB image is read using the `cv2.imread()` function to obtain a three-dimensional NumPy array in BGR format. Then, the `np.mean()` function from the NumPy library is used to calculate the average intensity values of the red (R), green (G), and blue (B) channels, respectively, to obtain the average intensity value R of the red channel. avg The average intensity value G of the green channel avg and the average intensity value B of the blue channel avg Based on these average intensity values, calculate the sum of the RGB average intensity values. RGB =R avg +G avg +B avg And further, the normalized red ratio r=R is obtained. avg / sum RGB The ratio of blue to b = B avg / sum RGB Finally, an empirical formula based on the RGB ratio is used for color temperature estimation. When r > b, the formula T = 1000 × (r - 0.33) / (0.33 - b) is applied to calculate the relative color temperature index based on the RGB distribution, where 0.33 is the theoretical approximation (1 / 3) of the normalized RGB value under ideal white light. When this condition is not met, the default color temperature value (e.g., 5000K) is returned. This method, based on the statistical relationship between color temperature and the RGB channel ratio, is computationally efficient and can effectively distinguish between warm and cool light environments, providing important color feature references for low-light scene classification.
[0037] It's important to note that color temperature essentially describes the color characteristics of a light source, with variations primarily reflected in the relative proportions of red and blue components in the spectrum. Low color temperatures (warm light), such as incandescent bulbs and candlelight, have a much higher proportion of red than blue (r>b); high color temperatures (cool light), such as overcast skies and fluorescent lights, have a higher proportion of blue than red (b>r); while the green component is relatively stable in most natural and artificial light sources, affecting the perceived brightness rather than the perceived color temperature. Therefore, when estimating color temperature, the red ratio (r) and the blue ratio (b) are the primary considerations.
[0038] Continuing the previous example, after obtaining the luminance value of each pixel in the RGB image, a dark area luminance threshold is pre-set (e.g., 15). The `np.sum()` function from the NumPy library is used to count the number of pixels in the luminance channel whose luminance values are less than the dark area luminance threshold; this is the number of dark area pixels. Simultaneously, the total number of pixels in the RGB image is obtained through the `size` attribute of the luminance channel. Finally, the proportion of local dark areas in the RGB image is the ratio of the number of dark area pixels to the total number of pixels, i.e.: Proportion of local dark areas in an RGB image = Number of dark area pixels / Total number of pixels.
[0039] Step S112: If the global average brightness is less than the first brightness threshold, the scene category is determined to be an extreme low light scene;
[0040] The value of the first brightness threshold can be flexibly set by those skilled in the art according to actual needs. For example, the brightness range of an 8-bit RGB image is 0-255, and its first brightness threshold can be 10. Specifically, if the global brightness average L... avg Less than 10 (i.e., L) avg <10), the scene category is determined to be an extreme low light scene.
[0041] Step S113: If the global average brightness is greater than or equal to the first brightness threshold, perform the following judgment:
[0042] The scene category is determined to be a regular low-light scene if any of the following conditions are met: the global average brightness is less than the second brightness threshold and the dynamic range value is less than the dynamic range threshold; or, the global average brightness is less than the third brightness threshold and the relative color temperature index based on RGB distribution is less than the color temperature threshold; or, the proportion of local dark areas in the RGB image is greater than the dark area proportion threshold.
[0043] The values of the second brightness threshold, dynamic range threshold, third brightness threshold, color temperature threshold, and dark area percentage threshold can be flexibly set by those skilled in the art according to actual needs, and are not limited here. For example, the brightness range of an 8-bit RGB image is 0-255, so its second brightness threshold can be 30, dynamic range threshold can be 40, third brightness threshold can be 25, color temperature threshold can be 5000K, and dark area percentage threshold can be 40%. Specifically, if the global average brightness L... avg Less than 30 and the dynamic range value D is less than 40 (i.e., L) avg <30 and D<40); or, the global average brightness L avg The relative color temperature index T, based on the RGB distribution, is less than 25 and less than 5000K (i.e., L). avg<25 and T<5000K); or, if the proportion of local dark areas P1 in the RGB image is greater than 40% (i.e. P1>40%), the scene category is determined to be a normal low-light scene.
[0044] Step S114: If none of the above conditions are met, perform a slight contrast optimization on the RGB image.
[0045] The mild contrast stretching algorithm used is the existing mild contrast stretching algorithm, and its contrast gain is set to 1.1 to 1.2.
[0046] Step S12: Based on the scene category, perform adaptive partitioning processing on the RGB image to obtain multiple region images, which include the central region, the near-edge transition region, and the far-edge low-light region.
[0047] Optionally, such as Figure 1c As shown, step S12 specifically includes:
[0048] Step S121: Based on the spatial location segmentation method, divide the RGB image into a central region and an edge region;
[0049] The spatial location division method includes: obtaining the center point and diagonal length of the RGB image; dividing the RGB image into a circular central region with the center point as the center and one-third of the diagonal length as the radius, and using the remaining region after division as the edge region. Of course, those skilled in the art can choose other division methods, which are not limited here.
[0050] Step S122: Obtain the lens distortion parameters of the camera and use the lens distortion parameters to perform distortion pre-correction on the edge area;
[0051] Lens distortion is an inherent optical characteristic of camera lenses that causes straight lines in an image to appear curved at the edges. In panoramic cameras, this distortion is particularly noticeable at the image edges. The lens distortion parameters of a camera can be obtained through the SDK (Software Development Kit) provided by the camera manufacturer, including radial distortion coefficients such as first-order radial distortion coefficient K1 and second-order radial distortion coefficient K2.
[0052] Distortion pre-correction compensates for this deformation using a mathematical model, making the image closer to the real scene. In an optional embodiment of the present invention, if the Brown-Conrady distortion model is used for distortion pre-correction, its distortion formula is: x corrected =x×(1+k1×r²+k2×r 4 ), y corrected=y×(1+k1×r²+k2×r 4 ), where (x,y) are the normalized original coordinates of the pixels in the edge region, r is the distance from the pixel to the center point of the RGB image, and k1 and k2 are lens distortion parameters.
[0053] Assuming the center point of the RGB image is (0,0), the normalized original coordinates of a pixel in the edge region are (0.8,0), and the lens distortion parameters are... , The normalized distance from the pixel to the center point of the RGB image. .
[0054] The coordinates of this pixel after distortion pre-correction are: x corrected =x×(1+k1×r²+k2×r 4 = 0.8 × [1 + (-0.0003) × 0.8² + 0.00001 × 0.8] 4 ]=0.799849677, y corrected =y×(1+k1×r²+k2×r 4 = 0 × [1 + (-0.0003) × 0.8² + 0.00001 × 0.8] 4 The value is 0, meaning the normalized original coordinates of this pixel after distortion pre-correction are (0.799849677, 0). Other coordinates follow the same principle and will not be elaborated further here. Alternatively, if using the original coordinates from the RGB image, the normalized original coordinates after distortion pre-correction can be transformed using existing inverse normalization methods, which will not be elaborated further here.
[0055] Step S123: Calculate the brightness difference between the brightness value of each pixel in the corrected edge region and the average brightness value of the central region, and based on the brightness difference, subdivide the edge region into a near-edge transition region and a far-edge low-light region.
[0056] In an optional embodiment of the present invention, step S123 specifically includes: obtaining the brightness value of each pixel in the corrected edge region and calculating the average brightness value of the central region; calculating the brightness difference between the brightness value of each pixel in the corrected edge region and the average brightness value of the central region; comparing the brightness difference with a preset fourth brightness threshold; if the brightness difference is less than or equal to the fourth brightness threshold, dividing the corresponding pixel in the edge region into a near-edge transition region; if the brightness difference is greater than the fourth brightness threshold, dividing the corresponding pixel in the edge region into a far-edge low-light region.
[0057] The value of the fourth brightness threshold can be flexibly selected by those skilled in the art according to actual needs, and is not limited here. For example, the fourth brightness threshold is preferably 50.
[0058] Taking the OpenCV library as an example, firstly, the RGB image is read using the `cv2.imread()` function. This function returns a three-dimensional NumPy array (matrix) with dimensions represented as [height, width, number of channels], where the channel order is BGR. Next, the `cv2.cvtColor()` function, along with the `cv2.COLOR_BGR2YUV` parameter, converts the RGB image from the BGR color space to the YUV color space.
[0059] After conversion, extracting the first channel (Y channel) from the 3D YUV matrix yields a 2D luminance matrix, where each element represents the luminance value of the corresponding pixel. Based on this 2D luminance matrix, the average luminance value L of all pixels in the central region is calculated using the np.mean() function. center , such as L center =125.4.
[0060] Subsequently, the brightness value L of each pixel corresponding to the edge region in the two-dimensional brightness matrix is traversed. pixel Calculate the brightness value L for each pixel. pixel The average brightness L of the central region center The brightness difference (i.e., the absolute difference) between them is ΔL = |L pixel -125.4|. If the preset fourth brightness threshold is 50, compare the brightness difference ΔL of each pixel with the fourth brightness threshold and complete the division: for example, if a pixel L pixel1 =98.3, ΔL=|98.3-125.4|=27.1≤50, this pixel is classified as a near-edge transition region; another pixel L pixel2 =63.8, ΔL=|63.8-125.4|=61.6>50, therefore this pixel is classified as a low-light region at the far edge. This process allows for precise subdivision of edge regions.
[0061] Step S124: When the scene category is an extreme low light scene, perform noise pre-detection on the central area, the near edge transition area and the far edge low light area respectively, and mark the high noise area.
[0062] In an optional embodiment of the present invention, step S124 specifically includes: using a pixel window of a preset size (such as a 3×3 pixel window) to slide in the central region, the near-edge transition region, and the far-edge low-light region respectively; performing filtering processing on the pixels in the pixel window at each position, and calculating the variance of the pixel grayscale difference before and after filtering as the noise intensity. The calculation formula is: ,in, The number of pixels within the pixel window. Let be the grayscale value of the j-th pixel after filtering. Let be the grayscale value of the j-th pixel before filtering; let be the noise intensity. Compared with the preset first noise intensity threshold T noise1 Compare; if noise intensity Greater than the first noise intensity threshold T noise1 The region corresponding to this pixel window is marked as a high-noise region.
[0063] The size of the pixel window and the first noise intensity threshold can be flexibly set by those skilled in the art according to actual needs, and are not limited here. For example, the size of the pixel window is preferably a 3×3 pixel window, and the first noise intensity threshold is preferably 4.
[0064] Assuming noise pre-detection is performed on low-light areas at distant edges, a 3×3 pixel window and mean filtering method are used, with a preset first noise intensity threshold T. noise =4.
[0065] A 3×3 window is taken from the low-light region at the far edge, and its unfiltered pixel grayscale matrix is as follows: After 3×3 mean filtering, the pixel grayscale values of this window become: .
[0066] The variance of the pixel grayscale difference before and after filtering is calculated as the noise level. ≈7.35.
[0067] noise intensity ≈7.35 and the first noise intensity threshold T noise =4 for comparison: due to noise intensity Greater than the first noise intensity threshold T noise (i.e., 7.35 > 4), marking the area corresponding to the 3×3 pixel window as a high-noise area.
[0068] Step S13: For each region image in the multiple region images, extract the illumination features, noise features, and detail features respectively, and generate a feature matrix corresponding to each region image based on the extracted illumination features, noise features, and detail features;
[0069] Optionally, in step S13, for each of the multiple region images, the illumination features are extracted, including:
[0070] Step S1311: Based on the scene category, select the dark area brightness threshold and the brightness standard deviation threshold respectively;
[0071] Step S1312: Based on the selected dark area brightness threshold, filter out the dark area pixels in each of the multiple area images to obtain the number of dark area pixels in each of the multiple area images.
[0072] Step S1313: Calculate the ratio of the number of dark pixels in each region image to the total number of pixels in the corresponding region image to obtain the dark pixel ratio of the corresponding region image, and quantize the dark pixel ratio into a specific type according to the dark pixel ratio and the preset dark pixel ratio threshold.
[0073] Step S1314: Calculate the brightness standard deviation of each region image in the multiple region images, compare each brightness standard deviation with the selected brightness standard deviation threshold, and mark the illumination uniformity status of the corresponding region image according to the comparison results;
[0074] Step S1315: Use the specific type and illumination uniformity state corresponding to the dark pixel ratio of multiple region images as illumination features.
[0075] The values of the dark area brightness threshold and the brightness standard deviation threshold can be flexibly set by those skilled in the art according to actual needs, and are not limited here. The value of the dark area brightness threshold varies depending on the scene category. For typical low-light scenes, the dark area brightness threshold selected based on this scene category can be 15, and the brightness standard deviation threshold can be 8; for extreme low-light scenes, the dark area brightness threshold selected based on this scene category can be 8, and the brightness standard deviation threshold can be 5.
[0076] In this invention, the preset dark area proportion thresholds include a first dark area proportion threshold (e.g., 80%), a second dark area proportion threshold (e.g., 60%), and a third dark area proportion threshold (e.g., 30%), from which multiple ranges can be obtained. Based on the dark area pixel proportion and the multiple ranges, the dark area pixel proportion is quantized into a specific type. Specifically, the range corresponding to an extremely high dark area proportion is greater than the first dark area proportion threshold; the range corresponding to a high dark area proportion is less than or equal to the first dark area proportion threshold and greater than the second dark area proportion threshold; the range corresponding to a medium dark area proportion is less than or equal to the second dark area proportion threshold and greater than the third dark area proportion threshold; and the range corresponding to a low dark area proportion is less than the third dark area proportion threshold.
[0077] Assuming the current scene category is a typical low-light scene, the dark area brightness threshold selected based on this scene category is 15, and the brightness standard deviation threshold is 8. Taking the low-light area at the far edge as an example, the total number of pixels in this area is 10,000.
[0078] First, based on the selected dark area brightness threshold of 15, the dark pixels in this area are filtered out, and the number of dark pixels is counted to be 7500. The proportion of dark pixels is calculated as 7500 / 10000 = 0.75 (i.e., 75%). Since 60% (second dark area proportion threshold) < 75% (dark area pixel proportion) < 80% (first dark area proportion threshold), the specific type corresponding to this dark area pixel proportion is high dark area proportion.
[0079] Next, according to the formula Calculate the standard deviation of brightness in this region, where, The standard deviation of brightness in this region. This represents the total number of pixels in the region. Let be the brightness value of the i-th pixel within this region. This is the average brightness of all pixels within the region. Assume the standard deviation of brightness in this region is 12. Compare the calculated standard deviation of brightness with the selected standard deviation threshold. Since 12 > 8, the illumination uniformity of this region is marked as "uneven illumination".
[0080] Ultimately, the lighting characteristics of this far-edge low-light region are composed of "high dark area ratio" and "uneven lighting".
[0081] Similarly, the illumination characteristics of the central region and the near-edge transition region can also be obtained according to the above calculation process, which will not be repeated here.
[0082] Optionally, in step S13, for each of the multiple region images, noise features are extracted, including:
[0083] Step S1321: Select the corresponding second noise intensity threshold based on the scene category;
[0084] Step S1322: Filter through a preset window and calculate the variance of the pixel grayscale difference before and after filtering in each region image of multiple regions;
[0085] Step S1323: Compare the calculated variance with the selected second noise intensity threshold, and determine the initial noise intensity value based on the comparison result;
[0086] Step S1324: Input each region image from multiple region images into the lightweight noise classification model to obtain the corresponding noise type information, and quantize the noise type information into a specific noise type;
[0087] Step S1325: Use the initial noise intensity values and specific noise types of multiple region images as noise features.
[0088] The value of the second noise intensity threshold can be flexibly set by those skilled in the art according to actual needs, and is not limited here. The second noise intensity threshold will vary depending on the scene category. For example, if the scene category is a normal low-light scene, the second noise intensity threshold selected based on this scene category is 3; if the scene category is an extreme low-light scene, the second noise intensity threshold selected based on this scene category is 2.
[0089] The initial noise intensity value can be categorized as either high noise or low noise; specific noise types can be categorized as either Gaussian noise or mixed noise. Those skilled in the art can choose flexibly according to actual needs, and no limitation is made here.
[0090] Assuming the current scene category is a normal low-light scene, a second noise intensity threshold of 3 is selected based on this scene category.
[0091] Taking the low-light region at the far edge as an example, mean filtering is first performed through a preset 3×3 window, and the variance of the pixel grayscale difference before and after filtering in this region is calculated. Assume that the calculated variance is 4.5.
[0092] The calculated variance value is compared with the second noise intensity threshold. Since 4.5 > 3, the initial noise intensity of the area is judged to be "high noise".
[0093] The image patch of the low-light region at the far edge is input into a lightweight noise classification model based on the MobileNetV3 architecture. The model outputs the noise type information of the region as "mainly Gaussian noise" and quantizes the noise type information into the specific noise type of Gaussian noise.
[0094] Ultimately, the noise characteristics of this far-edge low-light region are composed of both "high noise" and "dominantly Gaussian noise".
[0095] Similarly, the noise characteristics of the central region and the near-edge transition region can also be obtained according to the above calculation process, which will not be repeated here.
[0096] Optionally, in step S13, for each of the multiple region images, detailed features are extracted, including:
[0097] Step S1331: Based on the scene category, select the gradient threshold, detail percentage threshold, and Laplacian variance threshold respectively;
[0098] Step S1332: Calculate the edge gradient value of each pixel in each region image in multiple region images using the edge detection operator;
[0099] Step S1333: Calculate the percentage of pixels whose edge gradient values are greater than the selected gradient threshold, compare each pixel percentage with the detail percentage threshold, and mark the detail state information according to the comparison result;
[0100] Step S1334: Calculate the Laplacian variance of each region image in the multiple region images, compare each Laplacian variance with the Laplacian variance threshold, and mark the sharpness status information according to the comparison result;
[0101] Step S1335: Use detail state information and sharpness state information as detail features.
[0102] The values of the gradient threshold, detail percentage threshold, and Laplacian variance threshold can be flexibly set by those skilled in the art according to actual needs, and are not limited here. The gradient threshold, detail percentage threshold, and Laplacian variance threshold will differ depending on the scene category. For example, if the scene category is a normal low-light scene, the gradient threshold selected based on this scene category can be 5, the detail percentage threshold can be 8%, and the Laplacian variance threshold can be 15; if the scene category is an extreme low-light scene, the gradient threshold selected based on this scene category can be 3, the detail percentage threshold can be 5%, and the Laplacian variance threshold can be 10.
[0103] Assuming the current scene category is a typical low-light scene, the gradient threshold selected for this scene category is 5, the detail percentage threshold is 8%, and the Laplacian variance threshold is 15. Taking a low-light region at the far edge as an example, assuming the total number of pixels in this region is 10,000, the edge gradient value of each pixel in this region is calculated using the Sobel operator. 600 pixels have a gradient value greater than 5, representing 6% of the total pixels. Comparing this pixel percentage with the detail percentage threshold, since 6% < 8%, the detail status is marked as "low detail." The Laplacian variance of this region is calculated to be 12. Comparing this Laplacian variance with the Laplacian variance threshold, since 12 < 15, the sharpness status is marked as "blurred detail." Ultimately, the detail features of this low-light region at the far edge are composed of both "low detail" and "blurred detail."
[0104] Similarly, the detailed features of the central region and the near-edge transition region can also be obtained according to the above calculation process, which will not be repeated here.
[0105] It should be noted that steps S1311 to S1316, S1321 to S1325, and S1331 to S1335 are not shown in the figure for ease of description only.
[0106] Step S14: Based on the scene category and feature matrix, and through a preset matching strategy, dynamically match the corresponding image enhancement algorithm or algorithm combination for each region image from the preset enhancement strategy library;
[0107] Optionally, step S14 specifically includes:
[0108] Step S141: If the scene category is an extreme low light scene, call the first decision tree model and match the extreme low light specific algorithm combination from the enhancement strategy library based on the feature matrix;
[0109] Step S142: If the scene category is a regular low-light scene, call the second decision tree model and select a preset number of candidate algorithms or combinations of algorithms from the enhancement strategy library based on the feature matrix;
[0110] The first decision tree model can be the existing CART (Classification and Regression Tree) decision tree model; the second decision tree model can be the existing C4.5 decision tree model, which is an extension and optimization of the ID3 algorithm. Of course, those skilled in the art can choose according to actual needs, and no limitation is made here.
[0111] Step S143: Calculate the comprehensive weight score of each candidate algorithm or algorithm combination based on the weighted voting mechanism;
[0112] Step S144: Select the candidate algorithm or algorithm combination with the highest comprehensive weight score as the image enhancement algorithm or algorithm combination for the corresponding region image.
[0113] Optionally, the preset matching strategy is based on a preset correspondence between the feature matrix and the enhancement algorithm combination, and the preset correspondence in the enhancement strategy library includes:
[0114] ① When the feature matrix indicates that the specific type of dark pixel ratio is high dark ratio, the initial noise intensity is high noise, the specific noise type is Gaussian noise, and the detail state information is low detail, a combination of nonlocal mean denoising algorithm and multi-scale Retinex image enhancement algorithm is used; among them, a nonlocal mean denoising algorithm with a denoising window of 5×5 and a multi-scale Retinex image enhancement algorithm with scale parameters of {5,15,30} are used.
[0115] ② When the feature matrix indicates that the specific type of dark pixel ratio is high dark ratio, the specific noise type is mixed noise, and the detail state information is low detail, the algorithm combination of adaptive median filtering algorithm and multi-scale Retinex image enhancement algorithm is used; among them, the adaptive median filtering algorithm with a filtering window of 3×3 to 7×7 and the multi-scale Retinex image enhancement algorithm with scale parameters of {5,15,30} are used.
[0116] ③ When the feature matrix indicates that the specific type corresponding to the proportion of dark pixels is high dark proportion, the initial noise intensity is high noise, and the sharpness status information is detail blur, the algorithm combination of the dark channel prior denoising algorithm, the non-local mean denoising algorithm and the multi-scale Retinex image enhancement algorithm is used.
[0117] ④ When the feature matrix indicates that the specific type of the dark pixel ratio is medium dark ratio, the initial noise intensity is low noise, and the illumination uniformity is uneven illumination, the matching partition gamma correction algorithm is used; where the gamma coefficient ranges from 0.6 to 1.4, and the specific value is dynamically assigned according to the brightness information of each block.
[0118] ⑤ When the feature matrix indicates that the specific type corresponding to the proportion of dark pixels is medium dark proportion, the initial noise intensity is high noise, and the detail status information is high detail, the algorithm combination of bilateral filtering noise reduction algorithm and adaptive gamma correction algorithm is matched; where, when using the algorithm combination of bilateral filtering noise reduction algorithm and adaptive gamma correction algorithm, the parameter configuration is as follows: the spatial domain standard deviation of bilateral filtering is set to 10, the value domain standard deviation is set to 20, and the gamma correction coefficient is dynamically adjusted in the range of 0.8 to 1.2 according to the image characteristics.
[0119] ⑥ When the feature matrix indicates that the specific type corresponding to the proportion of dark pixels is low dark proportion, the initial noise intensity is low noise, and the detail status information is high detail, a mild contrast stretching algorithm is matched; wherein, the contrast gain of the mild contrast stretching algorithm is set to 1.1 to 1.3.
[0120] ⑦ When the feature matrix indicates that the specific type corresponding to the proportion of dark pixels is low dark proportion, the initial noise intensity is high noise, and the detail state information is high detail, a combination algorithm of Gaussian filtering noise reduction algorithm and mild contrast stretching algorithm is used; wherein, the standard deviation of the Gaussian function in the Gaussian filtering noise reduction algorithm is 1.5, and the contrast gain of the mild contrast stretching algorithm is set to 1.1 to 1.3.
[0121] ⑧ When the feature matrix indicates that the specific type corresponding to the proportion of dark pixels is high dark proportion, the initial noise intensity is low noise, the illumination uniformity is uneven illumination and the detail status information is low detail, the algorithm combination of the matching layer brightness adjustment algorithm and the texture generation enhancement algorithm is used; wherein, the combined algorithm is configured with a three-level brightness layer (dark / medium / bright) mechanism, and is supplemented by texture generation enhancement, and its weight coefficient is applied in the range of 0.6-0.8.
[0122] ⑨ When the feature matrix indicates that the specific type of dark pixel ratio is mid-dark ratio, the specific noise type is mixed noise, and the sharpness status information is detail blur, the algorithm combination of guided filtering noise reduction algorithm and detail enhancement algorithm is matched; in the guided filtering noise reduction algorithm, the window radius of the guided filter is set to 3; in the detail enhancement algorithm, the weight coefficient of Unsharp Mask detail enhancement is set to 0.3.
[0123] ⑩ When the scene category is an extreme low-light scene and the feature matrix indicates that the specific type corresponding to the dark pixel ratio is extremely high dark ratio, the initial noise intensity is low noise or the specific noise type is mixed noise, and the detail state information is extremely low detail, the algorithm combination of multi-frame RGB alignment noise reduction algorithm, layered brightness enhancement algorithm and U-Net noise repair algorithm is matched.
[0124] It should be noted that the various algorithms involved in the preset matching strategy are all existing algorithms in the technology. Those skilled in the art can flexibly choose according to actual needs, and will not be elaborated here.
[0125] Step S15: Use an image enhancement algorithm or a combination of algorithms that is matched for each region image to perform image enhancement processing on the corresponding region image;
[0126] Step S16: Perform cross-region fusion and color consistency calibration on each region image after enhancement to obtain the calibrated RGB image, and perform naturalness optimization on the calibrated RGB image to output the RGB enhanced image.
[0127] Optionally, step S16 specifically includes:
[0128] Step S161: Perform pre-smoothing filtering on the edge pixel bands of adjacent regions to reduce edge brightness difference;
[0129] Optionally, step S161 specifically includes:
[0130] Step S1611: Identify the edges of adjacent image regions and select the regions of a preset width on both sides of each edge as edge pixel bands;
[0131] The preset width can be 15 to 20 pixels, and those skilled in the art can choose flexibly according to actual needs, without limitation here.
[0132] Step S1612: Based on the scene category, select the window size, number of iterations, and brightness difference control target for pre-smoothing filtering, wherein the window size for pre-smoothing filtering includes a first size and a second size, and the brightness difference control target includes a first target value and a second target value;
[0133] The first dimension is 5×5, the second dimension is 7×7, the first target value is 3, and the second target value is 2. Those skilled in the art can choose flexibly according to actual needs, and no limitation is made here.
[0134] Step S1613: If the scene category is a regular low-light scene, use a filter kernel of the first size to perform a filter process on each edge pixel band once, so that the brightness difference between the edges of adjacent image areas is less than the first target value.
[0135] Step S1614: If the scene category is an extreme low light scene, use a filter kernel of the second size to perform at least two iterative filtering processes on each edge pixel band so that the brightness difference of the image edges of adjacent regions is less than the second target value, wherein the second size is greater than the first size and the second target value is less than the first target value.
[0136] Step S162: Perform multi-scale fusion of images in each region at multiple different preset resolutions, wherein the number of resolution layers used in extreme low-light scenes is greater than the number of resolution layers used in regular low-light scenes.
[0137] Optionally, step S162 specifically includes:
[0138] Step S1621: Determine the number of resolution layers used for fusion, as well as the resolution and fusion weight of each layer, based on the scene category;
[0139] Step S1622: If the scene category is a regular low-light scene, the number of resolution levels is the first number, and the first resolution set and the first weight set are used for fusion;
[0140] Step S1623: If the scene category is an extreme low-light scene, the number of resolution levels is the second number, and the second resolution set and the second weight set are used for fusion; wherein, the second number is greater than the first number;
[0141] Step S1624: Based on the determined number of resolution levels and the resolution of each level, generate a corresponding multi-resolution image sequence for each region image after image enhancement.
[0142] Step S1625: Under each determined resolution level, fuse the images of each region corresponding to that resolution level to generate a primary fused RGB image for that level;
[0143] The images of each region can be fused using the Poisson fusion algorithm in the existing technology. Of course, those skilled in the art can also flexibly choose other fusion algorithms according to actual needs, which is not limited here.
[0144] Step S1626: The primary fused RGB images at each resolution level are weighted and superimposed according to their corresponding fusion weights to generate the final fused RGB image.
[0145] In normal low-light scenes, the first set of resolutions is 3, meaning there are 3 resolution levels. The resolutions of each level are, in order, the original resolution of the RGB image, the original resolution of the 1 / 2 RGB image, and the original resolution of the 1 / 4 RGB image (i.e., the first resolution set). The fusion weights of the above levels are 0.6, 0.3, and 0.1, respectively (i.e., the first weight set). In extreme low-light scenes, the second set of resolutions is 4, meaning the resolutions of each level are, in order, the original resolution of the RGB image, the original resolution of the 1 / 2 RGB image, the original resolution of the 1 / 4 RGB image, and the original resolution of the 1 / 8 RGB image (i.e., the second resolution set). The fusion weights of the above levels are 0.5, 0.3, 0.15, and 0.05, respectively (the second weight set).
[0146] Taking a typical low-light scene (3 resolution levels) as an example, the specific process is as follows:
[0147] First-level resolution fusion (1 / 4 resolution): The three regional images of the same scale—the 1 / 4 resolution regional image of the central region, the 1 / 4 resolution regional image of the near-edge transition region, and the 1 / 4 resolution regional image of the far-edge low-light region—are stitched together according to their geographical locations using the Poisson fusion algorithm to output a complete 1 / 4 resolution first-level fused RGB image, i.e., F1.
[0148] Second-level resolution fusion (1 / 2 resolution): The three regional images of the same scale—the 1 / 2 resolution regional image of the central region, the 1 / 2 resolution regional image of the near-edge transition region, and the 1 / 2 resolution regional image of the far-edge low-light region—are stitched together according to their geographical locations using the Poisson fusion algorithm to output a complete 1 / 2 resolution second primary fused RGB image, namely F2.
[0149] Third-level resolution fusion (original resolution): The original resolution images of the central region, the near-edge transition region, and the far-edge low-light region are combined using the Poisson fusion algorithm according to their geographical locations to output a complete, original-resolution third-level primary fused RGB image, i.e., F3.
[0150] Finally, according to the first weight set, F1, F2, and F3 are weighted and superimposed to generate the fused RGB image, that is, the fused RGB image = 0.1×F1 + 0.3×F2 + 0.6×F3. Other scenarios follow the same principle, which will not be elaborated here.
[0151] Step S163: Perform color consistency calibration on the fused RGB image so that the mean color of the near edge transition area and the far edge low light area is the same as the mean color of the center area, thus obtaining the calibrated RGB image;
[0152] Optionally, step S163 specifically includes:
[0153] Step S1631: Extract the set of pixels in the central region of the fused RGB image corresponding to the original RGB image, and calculate the mean value of its color as the calibration benchmark.
[0154] Step S1632: Calculate the deviation of the mean color of the pixel set corresponding to the near edge transition area and the far edge low light area of the RGB image before fusion in the fused RGB image and the calibration reference respectively.
[0155] Step S1633: Adjust the colors of the fused RGB image according to the deviation until each deviation is less than the preset color deviation threshold, and obtain the calibrated RGB image.
[0156] Step S164: Input the calibrated RGB image into the naturalness evaluation model to obtain the naturalness similarity score, and adjust and optimize the parameters of the calibrated RGB image according to the naturalness similarity score.
[0157] The naturalness assessment model employs the existing MobileNetV3 model. The training data for this model includes 30,000 sets of normal lighting panoramic RGB images, supplemented by 20,000 sets of "low light - normal light" paired samples for extreme low-light scenes. The model outputs the naturalness similarity S between the calibrated RGB image and the normal lighting image. In normal low-light scenes, when the naturalness similarity S < 0.8, the parameters of the calibrated RGB image are adjusted; in extreme low-light scenes, when the naturalness similarity S < 0.75, the parameters of the calibrated RGB image are adjusted again.
[0158] It should be noted that steps S141 to S144, S161 to S164, S1611 to S1614, S16121 to S1626, and S16131 to S1633 are not shown in the figure for ease of description only.
[0159] In this invention, three independently enhanced regional images are seamlessly merged into a complete RGB enhanced image. This not only eliminates stitching artifacts but also, through color calibration and naturalness optimization, ensures that the final enhancement effect improves image quality while maintaining a high degree of visual realism and naturalness.
[0160] The adaptive image enhancement method for low-light scenes provided by this invention achieves accurate identification and end-to-end adaptation for different light intensities by constructing a hierarchical judgment mechanism for "normal-extreme" low-light scenes, effectively solving the core contradiction between noise suppression and detail preservation under extreme low light conditions. It employs an adaptive partitioning strategy based on "spatial location and illumination gradient," combined with deep learning-enabled three-dimensional feature analysis of "illumination-noise-detail," to dynamically match the optimal enhancement algorithm for each partition. Furthermore, it significantly eliminates stitching artifacts and color distortion through multi-scale cross-partition fusion and naturalness optimization techniques, improving the visual naturalness of the image.
[0161] Based on the same inventive concept, embodiments of the present invention also provide an adaptive image enhancement apparatus for low-light scenes to implement the adaptive image enhancement method for low-light scenes described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations of one or more embodiments of the adaptive image enhancement apparatus for low-light scenes provided below can be found in the limitations of the adaptive image enhancement method for low-light scenes described above, and will not be repeated here.
[0162] like Figure 2 As shown, the present invention provides an adaptive image enhancement device for low-light scenes, comprising: a scene determination module 21, a partitioning processing module 22, a feature extraction module 23, a strategy matching module 24, an enhancement processing module 25, and a fusion optimization module 26; wherein,
[0163] The scene determination module 21 is used to determine the low light scene of the RGB image and obtain the corresponding scene category. The scene category includes normal low light scene and extreme low light scene.
[0164] The partitioning module 22 is connected to the scene determination module 21 and is used to perform adaptive partitioning processing on the RGB image according to the scene category to obtain multiple region images, including the central region, the near edge transition region and the far edge low light region.
[0165] The feature extraction module 23, connected to the partitioning processing module 22, is used to extract illumination features, noise features, and detail features from each region image in multiple region images, and generate a feature matrix corresponding to each region image based on the extracted illumination features, noise features, and detail features.
[0166] The strategy matching module 24, connected to the feature extraction module 23, is used to dynamically match the corresponding image enhancement algorithm or algorithm combination for each region image from a preset enhancement strategy library based on the scene category and feature matrix and a preset matching strategy.
[0167] The enhancement processing module 25, connected to the strategy matching module 24, is used to perform image enhancement processing on the corresponding region image by using an image enhancement algorithm or a combination of algorithms matched for each region image, so as to obtain the enhanced region images.
[0168] The fusion optimization module 26, connected to the enhancement processing module 25, is used to sequentially perform cross-region fusion and color consistency calibration on the enhanced images of each region to obtain a calibrated RGB image, and then perform naturalness optimization processing on the calibrated RGB image to output an enhanced RGB image.
[0169] Optionally, the scene determination module 21 is specifically used to: calculate the global average brightness, dynamic range value, relative color temperature index based on RGB distribution, and local dark area proportion in the RGB image respectively; if the global average brightness is less than the first brightness threshold, determine the scene category as an extreme low light scene; if the global average brightness is greater than or equal to the first brightness threshold, perform the following judgment: if any of the following conditions are met, determine the scene category as a normal low light scene: the global average brightness is less than the second brightness threshold and the dynamic range value is less than the dynamic range threshold; or, the global average brightness is less than the third brightness threshold and the relative color temperature index based on RGB distribution is less than the color temperature threshold; or, the local dark area proportion in the RGB image is greater than the dark area proportion threshold; if none of the above conditions are met, perform mild contrast optimization processing on the RGB image.
[0170] Optionally, the partitioning module 22 is specifically used for: dividing the RGB image into a central region and an edge region based on a spatial location partitioning method; obtaining the lens distortion parameters of the camera and using the lens distortion parameters to perform distortion pre-correction on the edge region; calculating the brightness difference between the brightness value of each pixel in the corrected edge region and the average brightness value of the central region, and based on the brightness difference, further subdividing the edge region into a near-edge transition region and a far-edge low-light region; when the scene category is an extreme low-light scene, performing noise pre-detection on the central region, the near-edge transition region, and the far-edge low-light region respectively, and marking high-noise regions.
[0171] Optionally, the feature extraction module 23 extracts illumination features for each of the multiple regional images, including: selecting a dark area brightness threshold and a brightness standard deviation threshold based on the scene category; filtering out dark pixels in each of the multiple regional images based on the selected dark area brightness threshold to obtain the number of dark pixels in each of the multiple regional images; calculating the ratio of the number of dark pixels in each of the multiple regional images to the total number of pixels in its corresponding regional image to obtain the proportion of dark pixels in the corresponding regional image, and quantizing the proportion of dark pixels into a specific type according to the proportion of dark pixels and a preset dark proportion threshold; calculating the brightness standard deviation of each of the multiple regional images, and comparing each brightness standard deviation with the selected brightness standard deviation threshold, and marking the illumination uniformity state of the corresponding regional image according to the comparison result; and using the specific type and illumination uniformity state corresponding to the proportion of dark pixels in the multiple regional images as illumination features.
[0172] Optionally, the feature extraction module 23 extracts noise features for each region image in the multiple region images, including: selecting a corresponding second noise intensity threshold based on the scene category; filtering through a preset window and calculating the variance of the pixel grayscale difference before and after filtering for each region image in the multiple region images; comparing the calculated variance with the selected second noise intensity threshold and determining the initial noise intensity value based on the comparison result; inputting each region image in the multiple region images into a lightweight noise classification model to obtain the corresponding noise type information and quantizing the noise type information into a specific noise type; and using the initial noise intensity value and the specific noise type of the multiple region images as noise features.
[0173] Optionally, the feature extraction module 23 extracts detail features for each of the multiple region images, including: selecting a gradient threshold, a detail proportion threshold, and a Laplacian variance threshold based on the scene category; calculating the edge gradient value of each pixel in each region image using an edge detection operator; calculating the proportion of pixels whose edge gradient values are greater than the selected gradient threshold, comparing each pixel proportion with the detail proportion threshold, and marking detail state information based on the comparison result; calculating the Laplacian variance of each region image, comparing each Laplacian variance with the Laplacian variance threshold, and marking sharpness state information based on the comparison result; and using the detail state information and sharpness state information as detail features.
[0174] Optionally, the strategy matching module 24 is specifically used for: if the scene category is an extreme low-light scene, calling the first decision tree model to match an extreme low-light-specific algorithm combination from the enhancement strategy library based on the feature matrix; if the scene category is a regular low-light scene, calling the second decision tree model to filter a preset number of candidate algorithms or algorithm combinations from the enhancement strategy library based on the feature matrix; calculating the comprehensive weight score of each candidate algorithm or algorithm combination based on the weight voting mechanism; and selecting the candidate algorithm or algorithm combination with the highest comprehensive weight score as the image enhancement algorithm or algorithm combination for the corresponding region image.
[0175] Optionally, the fusion optimization module 26 is specifically used for: performing pre-smoothing filtering on the edge pixel bands of adjacent region images to reduce edge brightness differences; performing multi-scale fusion on each region image at multiple different preset resolutions, wherein the number of resolution levels used in extreme low-light scenes is greater than the number of resolution levels used in conventional low-light scenes; performing color consistency calibration on the fused RGB image so that the mean color of the near-edge transition region and the far-edge low-light region is the same as the mean color of the central region, thus obtaining a calibrated RGB image; inputting the calibrated RGB image into the naturalness evaluation model to obtain a naturalness similarity score, and adjusting and optimizing the parameters of the calibrated RGB image based on the score result.
[0176] Optionally, pre-smoothing filtering is performed on the edge pixel bands of adjacent image regions to reduce edge brightness difference. This includes: identifying the edges of adjacent image regions and selecting regions of a preset width on both sides of each edge as edge pixel bands; selecting the window size, iteration number, and brightness difference control target of the pre-smoothing filter according to the scene category, wherein the window size of the pre-smoothing filter includes a first size and a second size, and the brightness difference control target includes a first target value and a second target value; if the scene category is a normal low-light scene, a filter kernel of the first size is used to perform one filtering process on each edge pixel band so that the brightness difference of the edges of adjacent image regions is less than the first target value; if the scene category is an extreme low-light scene, a filter kernel of the second size is used to perform at least two iterative filtering processes on each edge pixel band so that the brightness difference of the edges of adjacent image regions is less than the second target value, wherein the second size is larger than the first size, and the second target value is smaller than the first target value.
[0177] Optionally, multi-scale fusion is performed on images of various regions at multiple different preset resolutions. The number of resolution levels used in extreme low-light scenes is greater than that used in regular low-light scenes. This includes: determining the number of resolution levels for fusion, as well as the resolution and fusion weights of each level, based on the scene category; if the scene category is a regular low-light scene, the number of resolution levels is a first number, and fusion is performed using a first resolution set and a first weight set; if the scene category is an extreme low-light scene, the number of resolution levels is a second number, and fusion is performed using a second resolution set and a second weight set; wherein the second number is greater than the first number; based on the determined number of resolution levels and the resolution of each level, a corresponding multi-resolution image sequence is generated for each image-enhanced region image; at each determined resolution level, the region images corresponding to that resolution level are fused to generate a primary fused RGB image for that level; the primary fused RGB images of each resolution level are weighted and superimposed according to their corresponding fusion weights to generate a final fused RGB image.
[0178] Optionally, color consistency calibration is performed on the fused RGB image to ensure that the mean color values of the near-edge transition area and the far-edge low-light area are the same as the mean color value of the central area, thus obtaining a calibrated RGB image. This includes: extracting the set of pixels in the fused RGB image corresponding to the central area of the original RGB image, and calculating its mean color value as a calibration benchmark; calculating the deviation between the mean color value of the set of pixels in the fused RGB image corresponding to the near-edge transition area and the far-edge low-light area of the original RGB image and the calibration benchmark; and adjusting the color of the fused RGB image according to the deviation until each deviation is less than a preset color deviation threshold, thus obtaining a calibrated RGB image.
[0179] The adaptive image enhancement device for low-light scenes provided by this invention achieves accurate identification and end-to-end adaptation for different light intensities by constructing a hierarchical judgment mechanism for "normal-extreme" low-light scenes, effectively solving the core contradiction between noise suppression and detail preservation under extreme low light conditions. It employs an adaptive partitioning strategy based on "spatial location and illumination gradient," combined with deep learning-enabled three-dimensional feature analysis of "illumination-noise-detail," to dynamically match the optimal enhancement algorithm for each partition. Furthermore, through multi-scale cross-partition fusion and naturalness optimization techniques, it significantly eliminates stitching artifacts and color distortion, improving the visual naturalness of the image.
[0180] It should be noted that "multiple" in this invention includes two or more.
[0181] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0182] Each module in the devices of this invention can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0183] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data required for or generated by the adaptive image enhancement method for low-light scenes described above. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements an adaptive image enhancement method for low-light scenes.
[0184] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 3As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements an adaptive image enhancement method for low-light scenarios. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0185] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the computer device to which the present invention is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0186] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0187] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0188] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0189] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this invention are all information and data authorized by the user or fully authorized by all parties.
[0190] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided by this invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided by this invention may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided by this invention may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0191] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0192] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.
Claims
1. An adaptive image enhancement method for low-light scenes, characterized in that, include: Low-light scene determination is performed on RGB images to obtain the corresponding scene categories, which include normal low-light scenes and extreme low-light scenes; Based on the scene category, the RGB image is adaptively partitioned to obtain multiple region images, which include the central region, the near-edge transition region, and the far-edge low-light region. For each region image in multiple region images, illumination features, noise features, and detail features are extracted respectively, and a feature matrix corresponding to each region image is generated based on the extracted illumination features, noise features, and detail features. Based on the scene category and feature matrix, and through a preset matching strategy, the corresponding image enhancement algorithm or algorithm combination is dynamically matched from a pre-set enhancement strategy library for each region image. An image enhancement algorithm or a combination of algorithms is used to match each region image to perform image enhancement processing on the corresponding region image, resulting in enhanced images of each region. The enhanced images of each region are sequentially subjected to cross-region fusion and color consistency calibration to obtain calibrated RGB images. The calibrated RGB images are then subjected to naturalness optimization processing to output the enhanced RGB images. The step of dynamically matching a corresponding image enhancement algorithm or combination of algorithms for each region image based on scene category and feature matrix, using a preset matching strategy, from a pre-set enhancement strategy library, includes: If the scene category is an extreme low light scene, the first decision tree model is invoked, and an extreme low light-specific algorithm combination is matched from the enhancement strategy library based on the feature matrix; If the scene category is a regular low-light scene, the second decision tree model is invoked to select a preset number of candidate algorithms or combinations of algorithms from the enhancement strategy library based on the feature matrix; Based on the weighted voting mechanism, calculate the comprehensive weight score of each candidate algorithm or combination of algorithms; The candidate algorithm or algorithm combination with the highest comprehensive weight score is selected as the image enhancement algorithm or algorithm combination for the corresponding region image.
2. The method according to claim 1, characterized in that, The process of determining low-light scenes from RGB images to obtain corresponding scene categories includes: Calculate the global mean brightness, dynamic range, relative color temperature index based on RGB distribution, and local dark area proportion of the RGB image respectively; If the global average brightness is less than the first brightness threshold, the scene category is determined to be an extreme low light scene. If the global average brightness is greater than or equal to the first brightness threshold, perform the following judgment: The scene category is determined to be a regular low-light scene if any of the following conditions are met: the global average brightness is less than the second brightness threshold and the dynamic range value is less than the dynamic range threshold; or, the global average brightness is less than the third brightness threshold and the relative color temperature index based on RGB distribution is less than the color temperature threshold; or, the proportion of local dark areas in the RGB image is greater than the dark area proportion threshold. If none of the above conditions are met, perform a slight contrast optimization on the RGB image.
3. The method according to claim 1, characterized in that, The RGB image is adaptively partitioned according to the scene category to obtain multiple region images, which include a central region, a near-edge transition region, and a far-edge low-light region, including: Based on the spatial location partitioning method, the RGB image is divided into a central region and an edge region; Obtain the lens distortion parameters of the camera and use the lens distortion parameters to perform distortion pre-correction on the edge area; Calculate the brightness difference between the brightness value of each pixel in the corrected edge region and the average brightness value of the central region, and based on the brightness difference, subdivide the edge region into a near-edge transition region and a far-edge low-light region; When the scene category is an extreme low-light scene, noise pre-detection is performed on the central area, the near-edge transition area, and the far-edge low-light area, and high-noise areas are marked.
4. The method according to claim 1, characterized in that, For each region image in the multiple region images, extract illumination features, including: Based on the scene category, select the dark area brightness threshold and the brightness standard deviation threshold respectively; Based on the selected dark area brightness threshold, dark area pixels in each region image of multiple region images are filtered out to obtain the number of dark area pixels in each region image of multiple region images. The ratio of the number of dark pixels in each region image to the total number of pixels in the corresponding region image is calculated to obtain the dark pixel ratio of the corresponding region image. Based on the dark pixel ratio and a preset dark pixel ratio threshold, the dark pixel ratio is quantized into a specific type. Calculate the brightness standard deviation for each region image in multiple region images, compare each brightness standard deviation with the selected brightness standard deviation threshold, and mark the illumination uniformity status of the corresponding region image based on the comparison results; The specific type and illumination uniformity state corresponding to the proportion of dark pixels in multiple regions of the image are used as illumination features.
5. The method according to claim 1, characterized in that, For each region image in the multiple region images, noise features are extracted, including: Based on the scene category, select the corresponding second noise intensity threshold; Filtering is performed through a preset window, and the variance of the pixel grayscale difference before and after filtering is calculated for each region image in multiple region images. The calculated variance is compared with the selected second noise intensity threshold, and the initial noise intensity value is determined based on the comparison result. Each region image from multiple region images is input into a lightweight noise classification model to obtain the corresponding noise type information, and the noise type information is quantized into a specific noise type. The initial noise intensity values and specific noise types of multiple region images are used as noise features.
6. The method according to claim 1, characterized in that, For each region image in the multiple region images, extract detailed features, including: Based on the scene category, select the gradient threshold, detail percentage threshold, and Laplacian variance threshold respectively; The edge gradient value of each pixel in each region image is calculated using an edge detection operator; Calculate the percentage of pixels whose edge gradient values are greater than the selected gradient threshold, compare each pixel percentage with the detail percentage threshold, and mark the detail state information based on the comparison results; Calculate the Laplacian variance of each region image in multiple region images, compare each Laplacian variance with a Laplacian variance threshold, and mark the sharpness status information based on the comparison results; Detail status information and sharpness status information are used as detail features.
7. The method according to claim 1, characterized in that, The process involves sequentially performing cross-region fusion and color consistency calibration on each region of the enhanced image to obtain a calibrated RGB image. The calibrated RGB image is then subjected to naturalness optimization processing to output an enhanced RGB image, including: Pre-smoothing filtering is applied to the edge pixel bands of adjacent regions to reduce edge brightness differences; Multi-scale fusion of images in various regions is performed at multiple preset resolutions. The number of resolution layers used in extreme low-light scenes is greater than that used in regular low-light scenes. Color consistency calibration is performed on the fused RGB image to ensure that the mean color value of the near-edge transition area and the far-edge low-light area is the same as the mean color value of the central area, thus obtaining the calibrated RGB image. The calibrated RGB image is input into the naturalness assessment model to obtain a naturalness similarity score, and the parameters of the calibrated RGB image are adjusted and optimized based on the score results.
8. The method according to claim 7, characterized in that, The step of performing pre-smoothing filtering on the edge pixel bands of adjacent regions of the image to reduce edge brightness difference includes: Identify the edges of adjacent image regions and select the regions of a preset width on both sides of each edge as the edge pixel band; Based on the scene category, select the window size, number of iterations, and brightness difference control target for pre-smoothing filtering. The window size for pre-smoothing filtering includes a first size and a second size, and the brightness difference control target includes a first target value and a second target value. If the scene category is a regular low-light scene, use a filter kernel of the first size to perform a filter process on each edge pixel band once, so that the brightness difference between the edges of adjacent image areas is less than the first target value; If the scene category is an extreme low-light scene, a filter kernel of the second size is used to perform at least two iterative filtering processes on each edge pixel band so that the brightness difference of the image edges of adjacent regions is less than the second target value, wherein the second size is larger than the first size and the second target value is smaller than the first target value.
9. An adaptive image enhancement device for low-light scenes, characterized in that, include: The scene determination module is used to determine low-light scenes in RGB images and obtain the corresponding scene categories, which include normal low-light scenes and extreme low-light scenes. The partitioning module, connected to the scene determination module, is used to adaptively partition the RGB image according to the scene category to obtain multiple region images, including the central region, the near-edge transition region, and the far-edge low-light region. The feature extraction module, connected to the partitioning module, is used to extract illumination features, noise features, and detail features from each region image in multiple region images, and generate a feature matrix corresponding to each region image based on the extracted illumination features, noise features, and detail features. The strategy matching module, connected to the feature extraction module, dynamically matches corresponding image enhancement algorithms or combinations of algorithms from a pre-set enhancement strategy library for each region image based on the scene category and feature matrix, using a preset matching strategy. Specifically, if the scene category is an extreme low-light scene, the first decision tree model is invoked to match an extreme low-light-specific algorithm combination from the enhancement strategy library based on the feature matrix; if the scene category is a regular low-light scene, the second decision tree model is invoked to filter a preset number of candidate algorithms or combinations of algorithms from the enhancement strategy library based on the feature matrix; based on a weighted voting mechanism, the comprehensive weight score of each candidate algorithm or combination of algorithms is calculated; and the candidate algorithm or combination of algorithms with the highest comprehensive weight score is selected as the image enhancement algorithm or combination of algorithms for the corresponding region image. The enhancement processing module, connected to the strategy matching module, is used to perform image enhancement processing on the corresponding region image by using an image enhancement algorithm or a combination of algorithms matched for each region image, so as to obtain the enhanced region images; The fusion optimization module, connected to the enhancement processing module, is used to sequentially perform cross-region fusion and color consistency calibration on the enhanced images of each region to obtain a calibrated RGB image. The calibrated RGB image is then subjected to naturalness optimization processing to output an enhanced RGB image.
Citation Information
Patent Citations
Retinex low-illumination image enhancement method based on image fusion
CN118333922A
Image enhancement method and system in complex coal mine environment
CN120495604A