Low-light full-color image real-time enhancement method based on illumination grading

CN122928686APending Publication Date: 2026-10-16YULING TECHNOLOGY (GUANGZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611034484.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-13
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0010]本申请所要解决的一个技术问题是:现有传统单尺度Retinex低照度图像增强算法采用全局固定参数、RGB耦合空间统一运算,缺少场景分级、分区降噪、亮色解耦、帧间稳帧及轻量化设计,存在场景适配差、色彩失真、噪点与细节难以兼顾、视频闪烁、算力开销大且硬件改造成本高的多重缺陷

Benefits of technology

1、采用本方法处理各类低照度图像时,能够自动区分不同光照程度的成像场景并匹配适配的处理参数,面对极弱光环境、明暗交替环境以及存在局部强光的复杂工况都可以输出光影分布均匀的画面,不会出现暗部提亮不足或者高亮区域大面积过曝的情况,各类低光场景下成像合格画面的占比相较传统处理方式得到显著提升,设备在各类户外夜间、室内背光等复杂环境下持续成像的稳定程度明显改善。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122928686A_ABST
    Figure CN122928686A_ABST
Patent Text Reader

Abstract

The application discloses a low-illumination full-color image real-time enhancement method based on illumination grading, and belongs to the technical field of computer vision image processing. The method first completes distortion correction, white balance and pixel normalization preprocessing on an original RGB image, extracts a global gray mean value, a dark area pixel proportion and a local light and shadow variance to complete illumination grading and output a label, and adaptively matches a full set of parameters of illumination, color and noise reduction according to the label; three-level Gaussian filtering is adopted to optimize illumination components in layers, and a quantization formula is used to realize soft brightening of a dark area and dynamic suppression of highlights; YCbCr color space is converted to isolate brightness and chroma channels, only the brightness channel is updated, and color fidelity is realized by constraining a color gain threshold; pixel variance and texture gradient partition difference are combined to realize differential noise reduction, an effective edge is extracted by using a Sobel operator, and noise pseudo-texture is removed to complete detail repair; the application is matched with a standard parameter calculation formula and complete tuning rules, and can select multiple equivalent color spaces, filters and edge operators for implementation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision image processing technology, specifically to a real-time enhancement method for low-light full-color images based on illumination grading. Background Technology

[0002] Currently, various imaging devices are widely used in security monitoring, vehicle-mounted vision, drone aerial photography, and industrial vision, among other fields. Most of these devices need to continuously acquire color images in low-light environments. Nighttime indoor backlit areas or enclosed spaces without supplemental lighting are typical low-light imaging scenarios. In low-light environments, photosensitive components receive a limited number of photons, resulting in overall low brightness in the output image. Details in dark areas are largely masked, and random noise generated by the photosensitive circuitry is amplified, leading to multiple defects in the final image, including uneven grayscale distribution, diminished color saturation, and blurred edges and textures. To improve the imaging quality of low-light images, the industry commonly uses image enhancement algorithms to optimize the acquired images at the software level, with enhancement schemes based on Retinex theory being the most prevalent.

[0003] Traditional Retinex-like algorithms rely on fixed-scale filtering to decompose the illumination and reflection components of an image. The entire computation process uses the same set of parameters to process all input images, failing to distinguish the objective differences in illumination distribution between different scenes. In practical use, it can be found that this uniform parameter processing mode is difficult to adapt to diverse low-light scenes. For scenes with extremely low overall light, the fixed gain value cannot boost dark pixels to the visible range, and the problem of loss of detail in dark areas cannot be effectively alleviated. For scenes with strong bright spots and contrasting light and dark areas, the uniform brightening operation will significantly increase the pixel values ​​of the bright areas, and the areas around the light source are prone to overexposure and whitening, forming obvious light and dark segmentation layers within the image, resulting in poor overall visual uniformity.

[0004] Most existing conventional processing workflows directly complete all brightness adjustment calculations within the RGB color space. The brightness and chromaticity information of the red, green, and blue channels are bound and coupled together. During the process of increasing the overall brightness of the pixel, the color channel values ​​will shift synchronously. The color temperature deviation that already exists in low-light environments will be further amplified. The processed images generally have problems such as whitening, local color shift, or color overflow. The full-color image reproduction is insufficient. In order to avoid color distortion, some devices can only switch to infrared black and white imaging mode, which cannot meet the needs of all-weather color image acquisition.

[0005] Most low-light enhancement algorithms do not employ differentiated noise suppression logic for different areas of the image. They uniformly use a single-intensity filtering method to complete the noise reduction operation, applying the same smoothing intensity to flat areas and areas containing texture edges. If the filter intensity is set too high, the outlines of objects, text lines, and subtle textures within the image will be excessively blurred, resulting in an overall hazy and grayish appearance. If the filter intensity is reduced, the amplified grain noise and color noise in dark areas after brightness enhancement cannot be effectively suppressed. Neither setting method can simultaneously meet the dual requirements of noise reduction and detail preservation.

[0006] Conventional edge detection processing relies solely on gradient values ​​to extract all texture information from the image, without distinguishing whether the texture originates from real objects or noise-derived false textures. After enhancement, the low-light image has even higher noise density, and fine, pseudo-textures are simultaneously identified as valid details and participate in sharpening, resulting in a large number of messy, fragmented textures and a rough visual appearance. Furthermore, existing algorithms lack stable constraint logic for consecutive video frames. Each frame independently performs parameter calculations and enhancement operations, leading to significant fluctuations in brightness and color output values ​​between frames. This results in noticeable flickering during video playback. When used on devices requiring real-time video stream output, such as vehicle-mounted surveillance drones, the dynamic stability of the image fails to meet commercial standards.

[0007] In addition, existing complete enhancement algorithms involve numerous multi-layered nested loops and high-dimensional matrix iterative operations, resulting in high overall computational consumption. When deployed on embedded camera terminals with limited computing resources, single-frame image processing takes a long time, and the device's output frame rate cannot meet real-time imaging requirements. The only solutions are to reduce image resolution or remove some enhancement steps to improve processing speed, leading to a significant degradation in image optimization. Furthermore, some algorithms only support offline computation on local terminals and do not support cloud deployment with concurrent access from multiple clients, severely limiting their application scenarios.

[0008] There are also technical solutions in the industry that rely on hardware modifications to improve low-light imaging effects. These solutions involve adding multiple sets of infrared fill lights or replacing the image sensor with a high-specification one to increase the basic brightness of the image. However, these modifications directly increase the production cost of the equipment hardware. Existing imaging equipment cannot be equipped with the necessary hardware. Furthermore, the increased power consumption resulting from hardware modifications will shorten the continuous working time of the equipment. All kinds of hardware-level optimization methods have obvious limitations.

[0009] To address this, we propose a real-time enhancement method for low-light full-color images based on illumination grading. Summary of the Invention

[0010] One of the technical problems that this application aims to solve is that the existing traditional single-scale Retinex low-light image enhancement algorithm uses globally fixed parameters and RGB coupling space unified operation, which lacks scene classification, partition noise reduction, brightness and color decoupling, inter-frame stabilization and lightweight design. It has multiple defects such as poor scene adaptation, color distortion, difficulty in balancing noise and detail, video flicker, large computing power overhead and high hardware modification cost.

[0011] To address the aforementioned technical problems, embodiments of this application provide a real-time enhancement method for low-light full-color images based on illuminance grading. This method involves a computer program performing image processing frame-by-frame on static images or dynamic video frames, including the following steps: S1. Image preprocessing and intelligent illuminance classification: Obtain the original RGB image output by the image acquisition device, and sequentially perform lens distortion correction, global white balance coarse calibration, and pixel value range normalization preprocessing operations. Extract three types of image dimensional features: global grayscale mean, dark area pixel ratio, and local light and shadow variance. Based on the multi-feature joint discrimination rule, complete the image illumination scene classification. Divide the input image into four categories: extremely low light scene, low light scene, normal dark light scene, and mixed light and dark scene, and output the corresponding illumination classification label. S2. Multi-scale adaptive optimization of illumination components: Based on the Retinex imaging model, the preprocessed image is decoupled into illumination components and reflection components; three levels of Gaussian filtering at different scales are used to extract global macroscopic illumination features, local area illumination features, and subtle light and shadow fluctuation features of the illumination components in layers. Based on the illuminance rating label output by S1, the corresponding scene's illuminance gain coefficient, dark area enhancement weight, and bright area suppression threshold are adaptively matched. The dark areas are gradually and gently brightened, while the bright pixel areas are subject to dynamic threshold suppression, and the optimized illuminance components are output. S3, Color Space Decoupling and Color Fidelity Correction: Converts RGB images to YCbCr color space to achieve physical isolation between the luminance Y channel and the Cb and Cr chrominance channels; The pixel update of the Y brightness channel is performed only based on the optimized illumination component, while the original pixel data of the Cb and Cr chromaticity channels are locked throughout the process and do not participate in the brightness adjustment calculation. Based on the illuminance rating label, the upper and lower limit constraint thresholds of color gain are dynamically configured to compensate for the color saturation degradation in low-illuminance environments and correct the inherent color temperature shift. S4, Region-based Discriminative Layered Adaptive Noise Reduction: Constructs dual region discrimination criteria of pixel variance and texture gradient to automatically divide flat noise regions, texture transition regions, and edge detail regions; High-intensity adaptive mean filtering is used to suppress noise across the entire domain in flat noise regions, while edge-preserving noise reduction strategy is adopted in texture transition regions and edge detail regions to preserve image contour texture while filtering out noise. S5. Edge detail restoration and targeted sharpening enhancement: The Sobel edge detection operator is used to extract high-frequency features of weakened edges, lines and textures in the image. The feature discrimination logic distinguishes between real-world effective textures and noise-derived pseudo textures and removes pseudo textures. Targeted sharpening and shadow detail enhancement are applied to effective detail areas such as object outlines, text structures, and subtle textures. S6. Dynamic Feature Fusion and Inter-Frame Stabilization Post-Processing: Introduces dynamic fusion weight coefficients to adaptively balance the fusion ratio of four types of image optimization features: brightness optimization, color correction, layered noise reduction, and detail enhancement. After fusion, pixel value range calibration, inter-frame brightness and color fluctuation suppression, fine color temperature adjustment and frame stabilization are performed sequentially, and finally converted into standard RGB image format to output static images or real-time video streams. The method adopts a lightweight computing architecture to reduce redundant iterative operations and high-complexity matrix operations, and is compatible with both local real-time processing on embedded terminals and high-concurrency calls to cloud APIs.

[0012] In some embodiments, in step S1, the dark area pixel ratio is defined as the ratio of the total number of pixels with gray values ​​lower than a preset gray value threshold to the total number of pixels in the image. The illuminance rating label set is {0, 1, 2, 3}, which correspond to extremely low light scene, low light scene, normal dark light scene, and mixed light and dark scene respectively.

[0013] In some embodiments, in step S2, the three-level Gaussian filter independently extracts the global macroscopic illumination, local area illumination, and subtle light and shadow fluctuation layering features of the image. By relying on the adaptive parameter matching mechanism of illumination grading, the enhancement amplitude of bright and dark areas is adjusted differently to suppress overexposure in bright areas and the defects of light and shadow discontinuity in the image.

[0014] In some embodiments, in step S3, the YUV color space and HSV color space can be used to decouple the luminance channel and chrominance channel operations, and the chrominance channel does not participate in the luminance dimension adjustment operation throughout the process.

[0015] In some embodiments, in step S4, pixel variance is used to identify flat, noiseless regions without texture, and texture gradient is used to identify high-detail regions containing edges, lines, and textures. The two types of features are combined to achieve automatic classification of image regions.

[0016] In some embodiments, in step S5, edge feature extraction is performed using the Canny edge detection operator and the Laplacian edge detection operator. The algorithm automatically filters out noise-generated fake textures and performs detail repair and targeted sharpening operations only on real-world outlines, printed text, and subtle textures.

[0017] In some embodiments, in step S1, any one or more of the following features are used to achieve illuminance scene classification determination: image brightness histogram distribution features, local brightness-darkness mean difference, and image global contrast features.

[0018] In some embodiments, in step S2, any one of the multi-scale decomposition methods, such as bilateral filtering, mean filtering, or Gaussian pyramid filtering, is selected to complete the extraction of layered light and shadow features of the illumination components.

[0019] In some embodiments, the method includes two types of deployment schemes that can be implemented independently: the first type is offline local real-time processing using an embedded camera terminal, a local PC, and an industrial vision device; The second category is standardized cloud API interfaces for algorithm encapsulation, which support high-concurrency remote calls from multiple clients and can be implemented using any of the deployment schemes.

[0020] In some embodiments, the method is a pure software algorithm implementation scheme, which does not require modification of the hardware structure of the imaging device or the addition of infrared supplementary lighting hardware, and can be integrated into security monitoring, vehicle imaging, smart home vision, industrial machine vision, and drone aerial imaging equipment.

[0021] The present invention has at least the following beneficial effects: 1. When processing various low-light images using this method, it can automatically distinguish imaging scenes with different lighting levels and match appropriate processing parameters. It can output images with uniform light and shadow distribution even in complex conditions such as extremely low light environments, alternating light and dark environments, and local strong light. There will be no insufficient brightening of dark areas or large-area overexposure of bright areas. The proportion of qualified images in various low-light scenes is significantly improved compared with traditional processing methods. The stability of continuous imaging of the device in various complex environments such as outdoor night and indoor backlight is significantly improved.

[0022] 2. The entire processing workflow places brightness and color information in independent channels for calculation. The brightness adjustment process will not interfere with the original color data. At the same time, it sets the upper and lower constraints of color adjustment according to the lighting conditions of different scenes. It can moderately compensate for the natural decay of color saturation in low light environment, and can also correct the color temperature shift problem that is prone to occur under low light conditions. The processed image does not have problems such as large-area whitening, local color block shift or color saturation overflow. The color reproduction accuracy is significantly improved compared with traditional algorithms. The device can output color images in all weather without the need for additional infrared supplementary lighting hardware, and can replace the working mode of traditional devices that switch to black and white infrared imaging at night.

[0023] 3. During the process, the method divides the image into regions based on pixel grayscale distribution and texture changes. Different noise suppression intensities are set for different regions. Large flat areas can effectively filter out the amplified particle noise and color noise after brightness is increased. Areas containing object edges, text, and fine textures will have reduced smoothing intensity, thus fully preserving high-frequency detail information inside the image. This eliminates the contradiction between noise reduction causing image blurring or preservation of details causing noise residue. The overall image is clear and clean, and the scene layering and image clarity are guaranteed.

[0024] 4. For continuously outputting video data streams, the processing incorporates inter-frame brightness and color fluctuation constraint logic, which reduces the difference in output parameters between consecutive frames. This prevents motion blur during dynamic object movement and eliminates frequent flickering during video playback. The overall computational flow eliminates numerous redundant iterations and complex matrix operations, effectively controlling computational power consumption. The processing time for a single frame of 1080P resolution images can be kept low, and high processing speeds are maintained for 4K high-resolution images. The device can stably output real-time video that meets commercial standard frame rates, making it suitable for applications requiring continuous dynamic imaging, such as automotive, security, and aerial photography.

[0025] 5. The algorithm has a simplified overall computational load and lower hardware computing power requirements. It can be directly deployed on low-end embedded camera devices with limited computing resources, or it can be packaged into a standardized interface and deployed on a cloud server. A single server can handle a large number of image processing requests initiated by clients at the same time. The device compatibility range is greatly expanded compared to traditional algorithms. No hardware upgrades or modifications are required during the project implementation phase, and the cost of hardware adaptation and overall project implementation can be significantly reduced.

[0026] 6. The entire solution relies on software programs to complete all image enhancement operations. It does not require modification of the internal photosensitive chip or lens structure of the imaging equipment, nor does it require the addition of various supplementary lighting hardware. Existing equipment can achieve low-light full-color image optimization simply by integrating the corresponding program. It can be adapted to various imaging equipment and software platforms such as security monitoring, vehicle imaging, smart home vision, industrial machine vision, and drone aerial photography. The program porting and batch deployment are relatively easy, and it has the basic conditions for large-scale commercial promotion and application. Attached Figure Description

[0027] Figure 1 This is a schematic diagram of the method steps of the present invention. Detailed Implementation

[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0029] Example 1: See Figure 1 A real-time enhancement method for low-light full-color images based on illumination grading involves a computer program performing image processing frame-by-frame on static images or dynamic video frames, including the following steps: S1. Image preprocessing and intelligent illuminance classification: Obtain the original RGB image output by the image acquisition device, and sequentially perform lens distortion correction, global white balance coarse calibration, and pixel value range normalization preprocessing operations. Extract three types of image dimensional features: global grayscale mean, dark area pixel ratio, and local light and shadow variance. Based on the multi-feature joint discrimination rule, complete the image illumination scene classification. Divide the input image into four categories: extremely low light scene, low light scene, normal dark light scene, and mixed light and dark scene, and output the corresponding illumination classification label. S2. Multi-scale adaptive optimization of illumination components: Based on the Retinex imaging model, the preprocessed image is decoupled into illumination components and reflection components; three levels of Gaussian filtering at different scales are used to extract global macroscopic illumination features, local area illumination features, and subtle light and shadow fluctuation features of the illumination components in layers. Based on the illuminance rating label output by S1, the corresponding scene's illuminance gain coefficient, dark area enhancement weight, and bright area suppression threshold are adaptively matched. The dark areas are gradually and gently brightened, while the bright pixel areas are subject to dynamic threshold suppression, and the optimized illuminance components are output. S3, Color Space Decoupling and Color Fidelity Correction: Converts RGB images to YCbCr color space to achieve physical isolation between the luminance Y channel and the Cb and Cr chrominance channels; The pixel update of the Y brightness channel is performed only based on the optimized illumination component, while the original pixel data of the Cb and Cr chromaticity channels are locked throughout the process and do not participate in the brightness adjustment calculation. Based on the illuminance rating label, the upper and lower limit constraint thresholds of color gain are dynamically configured to compensate for the color saturation degradation in low-illuminance environments and correct the inherent color temperature shift. S4, Region-based Discriminative Layered Adaptive Noise Reduction: Constructs dual region discrimination criteria of pixel variance and texture gradient to automatically divide flat noise regions, texture transition regions, and edge detail regions; High-intensity adaptive mean filtering is used to suppress noise across the entire domain in flat noise regions, while edge-preserving noise reduction strategy is adopted in texture transition regions and edge detail regions to preserve image contour texture while filtering out noise. S5. Edge detail restoration and targeted sharpening enhancement: The Sobel edge detection operator is used to extract high-frequency features of weakened edges, lines and textures in the image. The feature discrimination logic distinguishes between real-world effective textures and noise-derived pseudo textures and removes pseudo textures. Targeted sharpening and shadow detail enhancement are applied to effective detail areas such as object outlines, text structures, and subtle textures. S6. Dynamic Feature Fusion and Inter-Frame Stabilization Post-Processing: Introduces dynamic fusion weight coefficients to adaptively balance the fusion ratio of four types of image optimization features: brightness optimization, color correction, layered noise reduction, and detail enhancement. After fusion, pixel value range calibration, inter-frame brightness and color fluctuation suppression, fine color temperature adjustment and frame stabilization are performed sequentially, and finally converted into standard RGB image format to output static images or real-time video streams. The method adopts a lightweight computing architecture to reduce redundant iterative operations and high-complexity matrix operations, and is compatible with both local real-time processing on embedded terminals and high-concurrency calls to cloud APIs.

[0030] Specifically, the entire method's steps and logical design for each stage rely on the inherent image quality defects of low-light imaging and the various shortcomings of the traditional Retinex algorithm to form a complete processing chain. Each step sets up corresponding underlying processing logic to solve a certain type of actual imaging problem in the existing technology. All steps are connected to form a closed-loop processing flow. The illumination level label output by the preceding steps serves as the unified basis for all subsequent parameter calculations, realizing parameter linkage control of the entire processing flow. Setting up multi-stage serial step-by-step processing can decompose complex image enhancement tasks into standardized sub-tasks that can be quantified and calculated independently. Each sub-task focuses on only a single dimension of image quality optimization, avoiding parameter interference caused by multi-dimensional adjustment and synchronous calculation, reducing the overall algorithm parameter tuning difficulty, and facilitating modular code splitting, segmented debugging, and later functional iteration. When deployed on the device or in the cloud, some non-core calculation branches can be flexibly removed according to actual computing power requirements to adapt to different hardware resource conditions.

[0031] Setting up image preprocessing as the initial computational step of the entire algorithm aims to eliminate various interference factors introduced by the hardware during the image acquisition stage. Lens distortion correction can correct image distortion caused by pixel stretching and deformation at the edges of wide-angle lenses. Global white balance coarse calibration can offset the initial color cast caused by the factory-fixed color temperature deviation of the equipment. Pixel value range normalization unifies the pixel value range of the output images from different devices, eliminating the interference caused by differences in exposure and analog gain settings of different camera devices on subsequent feature statistics and parameter calculations. The image data after standardized preprocessing has a unified calculation benchmark, and the results of subsequent illuminance grading feature extraction, illumination decomposition, and color correction will not be affected by differences in the hardware parameters of the acquisition equipment, ensuring that the algorithm runs stably and consistently on different models of imaging terminals.

[0032] After preprocessing, a multi-dimensional feature-based illumination grading step is added. The core purpose is to abandon the traditional algorithm's operation mode of uniformly processing fixed parameters globally. It automatically distinguishes different lighting environments based on the objective data of the image's own brightness and darkness distribution, judges the overall brightness and darkness benchmark of the image based on the global grayscale mean, quantifies the coverage of dark areas by the proportion of dark area pixels, and identifies the uniformity of brightness and darkness of the image based on the local light and shadow variance. The combination of these three types of features can accurately distinguish four distinct low-light conditions. Each scene is matched with a complete set of exclusive operation parameters. Subsequent illumination brightening, color compensation, noise reduction intensity, and sharpening amplitude are all adjusted synchronously with the grading results. It can improve the overall brightening amplitude and color compensation intensity for extremely low-light images, and reduce the gain of bright areas and enable highlight suppression for images with alternating brightness and darkness. It solves the problem that fixed parameters cannot adapt to complex lighting scenes from the source of operation, reduces actual imaging defects such as insufficient brightening of dark areas, overexposure of bright areas, and light and shadow breaks in the image, and improves the stability of the algorithm in various nighttime, backlight, and indoor low-light scenes.

[0033] The multi-scale adaptive optimization of illumination components addresses the problem that traditional single-scale filtering can only extract global macroscopic light and shadow while losing local subtle textures and light and shadow. It uses three levels of Gaussian filtering at different scales to extract illumination features in layers, which can simultaneously take into account the overall brightness trend of the whole image and the subtle brightness changes of local blocks. Combined with hierarchical label matching of illumination gain coefficient, dark area enhancement weight, and bright area suppression threshold, along with the corresponding power function brightening curve and segmented highlight compression logic, the process of enhancing pixels in dark areas is smooth and will not produce step-like brightness and darkness segmentation. In bright areas, pixel values ​​are not directly truncated but pixel brightness is linearly compressed. While brightening the overall image, the internal layer details of dark and bright areas are preserved, which improves the situation where the image becomes grayish and the details of the highlight area are completely lost after brightening by traditional algorithms.

[0034] The design of converting RGB images to the YCbCr color space and isolating the luminance and chrominance channels aims to avoid color distortion caused by the coupled calculation of the three RGB channels. In RGB mode, brightness adjustment will simultaneously change the pixel values ​​of the red, green, and blue channels. Low-light environments already have color temperature shifts and color saturation attenuation. After superimposing global brightness stretching, it is easy to cause whitening, color block shifting, and color overflow. By storing the luminance information separately in the Y channel and keeping the original values ​​of the chrominance channel throughout the process without participating in the luminance calculation, the interference of luminance calculation on color information can be cut off. Then, by setting the upper and lower limits of color gain based on hierarchical labels to constrain the saturation adjustment range, the color compensation intensity can be adapted to different lighting environments. This can not only make up for the natural fading problem in low-light environments, but also avoid distortion caused by excessive stretching of local colors. Natural and realistic color images can be output without switching to infrared black and white imaging throughout the process, reducing the cost of adding and modifying equipment hardware.

[0035] The dual-discrimination layered noise reduction logic, which combines pixel variance with texture gradient, is designed to address the inherent contradiction that traditional unified filtering cannot simultaneously suppress noise and preserve detail. In low-light images, after brightness enhancement, dark area grain noise and color noise are amplified simultaneously. A single filter intensity can only trade off between blurry images and residual noise. By relying on two sets of quantization indicators, flat areas and texture edge areas are automatically distinguished. High-intensity mean filtering is used to fully eliminate various dark light noises in large flat areas. In areas containing lines, text, and object outlines, the smoothing intensity is reduced to prioritize the preservation of edge textures. The simultaneous operation of the two processing rules can simultaneously achieve the two imaging requirements of clean images and complete details, improving image transparency and image clarity.

[0036] The Sobel operator is used to extract edge textures separately and distinguish between real-world textures and noise-generated pseudo-textures. This addresses the issues of blurred edges and noise-induced fine textures in low-light images. In low-light environments, the contrast of object edges is significantly reduced, and the original image details are weakened. Directly sharpening the entire image would simultaneously amplify the false textures generated by noise. By first filtering effective real-world textures through gradient amplitude thresholding and then performing targeted sharpening and dark area detail filling, we only supplement detailed information for the real-world structure without adding extra messy noise textures. The processed image has a stronger sense of layering, and the outlines of text and small objects can be clearly distinguished, improving the high-definition imaging effect of the image.

[0037] The dynamic feature fusion and inter-frame stabilization post-processing stages are primarily designed for continuous video stream applications. Setting dynamic fusion weight coefficients can synchronously adjust the fusion ratio of four optimization results—brightness, color, noise reduction, and detail enhancement—based on the current image illumination level, avoiding excessive enhancement of a single dimension that could cause image imbalance. The inter-frame brightness and color fluctuation constraint logic can reduce the difference in output values ​​between consecutive frames, eliminating image flicker and motion blur caused by independent frame-by-frame calculations. This makes it suitable for commercial scenarios requiring continuous real-time video output, such as automotive, security, and aerial photography. Pixel value range calibration can correct pixels that exceed the standard range after each step of the calculation, preventing local pixel value overflow and color blocks. Fine color temperature adjustment can offset slight color shifts caused by the superposition of multiple calculation steps, ensuring uniform and stable color in the final output image.

[0038] The overall algorithm adopts a lightweight computational architecture, eliminating multi-layered nested iterations and high-dimensional matrix operations and introducing block-parallel convolution processing. This aims to reduce the computational resources required for the entire algorithm. On one hand, it can be deployed on low-end embedded camera terminals with limited computing resources, without sacrificing image resolution or reducing enhancement steps to improve speed, and stably outputting real-time video that meets commercial frame rate standards. On the other hand, the lightweight algorithm allows a single server to handle a large number of concurrent image processing requests from clients, supporting the encapsulation of standardized cloud APIs to provide image processing services externally, expanding the algorithm's applicable deployment scenarios. The entire solution relies entirely on software programs to perform all image enhancement calculations, without requiring modifications to hardware structures such as photosensitive chips and lenses. Existing imaging devices only need to integrate the corresponding program to achieve low-light image quality optimization, resulting in wider device compatibility. No hardware upgrades or modifications are required during project implementation, effectively reducing the overall cost of product development and mass production, and facilitating mass adoption on various imaging devices such as security, automotive, industrial vision, and drones.

[0039] Example 2: See Figure 1 In step S1, the dark area pixel ratio is defined as the ratio of the total number of pixels with gray values ​​lower than a preset gray value threshold to the total number of pixels in the image. The illuminance rating label set is {0, 1, 2, 3}, which correspond to extremely low light scene, low light scene, normal dark light scene, and mixed light and dark scene respectively.

[0040] In step S2, the three-level Gaussian filter independently extracts the layered features of global macroscopic illumination, local area illumination, and subtle light and shadow fluctuations in the image. By relying on the adaptive parameter matching mechanism of illumination grading, the enhancement amplitude of bright and dark areas is adjusted differently to suppress overexposure in bright areas and the defects of light and shadow discontinuity in the image.

[0041] In step S3, the YUV color space or HSV color space can be used to decouple the luminance channel and chrominance channel operations, so that the chrominance channel does not participate in the luminance dimension adjustment operation throughout the process.

[0042] In step S4, pixel variance is used to identify flat, noiseless regions without texture, and texture gradient is used to identify high-detail regions containing edges, lines, and textures. The two types of features are combined to achieve automatic classification of image regions.

[0043] In step S5, edge feature extraction is completed using the Canny edge detection operator and the Laplacian edge detection operator; The algorithm automatically filters out noise-generated fake textures and performs detail repair and targeted sharpening operations only on real-world outlines, printed text, and subtle textures.

[0044] In step S1, any one or more of the following features are used: image brightness histogram distribution features, local brightness-dark mean difference, and global image contrast features, to achieve illumination scene classification determination.

[0045] In step S2, any one of the multi-scale decomposition methods, such as bilateral filtering, mean filtering, or Gaussian pyramid filtering, is selected to complete the extraction of layered light and shadow features of the illumination components.

[0046] The method includes two independently implementable deployment schemes: the first is offline local real-time processing using embedded camera terminals, local PCs, and industrial vision equipment; The second category is standardized cloud API interfaces for algorithm encapsulation, which support high-concurrency remote calls from multiple clients and can be implemented using any of the deployment schemes.

[0047] The method is a pure software algorithm implementation scheme, which does not require modification of the hardware structure of the imaging equipment or the addition of infrared supplementary lighting hardware. It can be integrated into security monitoring, vehicle imaging, smart home vision, industrial machine vision, and drone aerial imaging equipment.

[0048] Specifically, providing a clear quantitative definition for the proportion of pixels in dark areas, and defining the fixed values ​​of illumination grading labels and their correspondence with various scenes, is to enable computer programs to form a unified and reproducible quantitative judgment standard. When reading the same image on different hardware devices and under different operating environments, the statistically obtained dark area pixel proportion values ​​will not produce human interpretation bias, and the grading label output results will remain consistent. The fixed-value label system simplifies the internal parameter retrieval logic of the program. Each numerical label is directly bound to a complete set of enhancement parameters. The program does not need to add additional complex logic to distinguish scene types, reducing the computation time caused by code branches. At the same time, it also provides a unified reference standard for parameter calibration. When optimizing parameters for different scenes, it can directly correspond to the fixed label classification, reducing the workload of algorithm debugging and iteration.

[0049] The three-level Gaussian filter each handles the extraction of light and shadow features at different levels. By adjusting the processing intensity of bright and dark areas in conjunction with hierarchical labels, it can break down the light and shadow information of the entire image into independent operations at different scales. Large-scale filtering captures the overall light and shadow base of the image, while medium- and small-scale filtering captures subtle light and shadow changes in local blocks and at the pixel level. This avoids the loss of detail caused by single-scale filtering, which can only consider a single dimension of light and shadow information. By adjusting the brightening and highlight suppression intensity based on the hierarchical results, it can constrain the pixel brightening range according to the actual lighting conditions of the image. In extremely low-light environments, it appropriately relaxes the enhancement intensity in dark areas, while tightening the upper limit of bright pixels in scenes with alternating light and dark areas. From a computational perspective, this reduces pixel saturation overflow in bright areas and weakens the light-dark boundary marks that appear during the brightening process, resulting in a more natural and coherent transition of light and shadow in the image.

[0050] Two additional color spaces, YUV and HSV, are added as optional implementation carriers. The core logic is that all three color spaces have independent luminance and chrominance channels. Replacing them does not change the underlying computational logic that isolates luminance and chrominance information. The chrominance channel retains its original data throughout the process and does not participate in luminance-related calculations, thus continuously preventing color value shifts caused by luminance adjustments. Providing multiple color space options allows for compatibility with the image encoding formats of different imaging devices. Some embedded terminal hardware natively uses the YUV format for image output, eliminating the need for additional RGB to YCbCr conversion operations and reducing the computational power consumption per frame. Some image processing software platforms natively adapt to the HSV color space, allowing for rapid algorithm porting by directly replacing the color space, thus broadening the software operating environment for algorithm adaptation.

[0051] Image regions are segmented using two metrics: pixel variance and texture gradient. These two metrics correspond to different texture attributes of the image. Pixel variance directly reflects the local pixel grayscale fluctuation; large, flat areas show little grayscale variation, resulting in a low variance value. Texture gradient captures edges where grayscale changes are dramatic. Combining these two metrics avoids misjudgments that can occur with a single metric. A single metric can easily misclassify a gradient texture area as a flat, noisy area, or a low-contrast edge as a textureless area. Using both metrics together improves the accuracy of region segmentation, allowing noise reduction to precisely match the processing needs of different texture areas and preventing image blurring or residual noise due to incorrect noise reduction intensity matching.

[0052] The Canny and Laplacian operators are used as optional implementations for edge extraction. Both operators can extract image gradient information, but their gradient calculation logic differs, making them suitable for original images with varying resolutions and noise levels. For images with high noise levels, the Canny operator's multi-threshold filtering can filter out some fine, noisy edges. For images with low contrast, the Laplacian second-order gradient can capture weak edge information. Separate implementation paths for the two operators allow for flexible selection based on the actual image quality of the acquired images. After filtering out false textures generated by noise, sharpening is applied only to the true structure of the scene, avoiding indiscriminate full-image sharpening that amplifies noise in dark areas. This ensures that detail enhancement operations only apply to visually valuable content, improving the cleanliness of the processed image.

[0053] The system offers brightness histograms, local brightness-to-dark mean difference, and global contrast as alternative grading features. Each feature can quantify the overall and local illumination distribution of an image; the only difference lies in the computational path of feature extraction. When device computing power is extremely limited, a single feature with lower computational cost can be used for grading, reducing the computational overhead of feature statistics. When hardware computing power is sufficient, multiple features can be combined to improve the accuracy of grading. The multiple feature options can adapt to different imaging device pixel output formats. Some devices can directly output image brightness histogram data without needing to traverse all pixels to calculate the grayscale mean, reducing the number of image traversals and shortening the preprocessing time per frame, while maintaining the core processing logic of distinguishing illumination scenes and adaptively matching parameters based on features.

[0054] This solution offers bilateral filtering, mean filtering, and Gaussian pyramid filtering as alternatives to multi-scale illumination decomposition. Each method can extract lighting and shadow information at different scales in an image, differing only in their smoothing and layering implementation logic. Mean filtering has a simple computational flow, making it suitable for deployment on low-end, low-computing-power embedded devices. Bilateral filtering, while preserving edges during layered extraction, is suitable for imaging scenarios with rich texture details. The Gaussian pyramid layering structure naturally adapts to the coarse-to-fine feature extraction logic of images, making it suitable for batch high-definition image processing tasks in the cloud. Independent implementation paths are set for each filter type, allowing for flexible switching based on device computing power and image texture features during project deployment, without altering the entire algorithm's pre- and post-processing workflows, thus reducing the modification costs for adapting the algorithm to different use cases.

[0055] Setting up two independent deployment schemes—local offline processing and concurrent cloud API calls—is designed to meet the needs of two mainstream imaging devices on the market. Vehicle-mounted, soldier-mounted, and industrial inspection equipment mostly require real-time local image processing, independent of network transmission. The local deployment mode encapsulates the algorithm into a program development package that devices can directly call, ensuring stable output of enhanced images even when the device is offline. Large-scale centralized monitoring in industrial parks and third-party image inspection platforms require simultaneous access to a large number of front-end camera devices. The cloud API mode can centrally process multiple video streams, reducing the computational power investment of front-end devices. Both deployment modes can be implemented independently; project owners do not need to build two separate operating environments. They can choose the appropriate deployment method based on their business scale, reducing hardware and server investment during the project deployment phase.

[0056] The entire algorithm relies entirely on software code to perform all image enhancement calculations. It requires no modification to hardware components such as the device's image sensor chip or lens structure, nor does it require the addition of external hardware such as infrared illumination. Existing imaging equipment can achieve low-light image color enhancement simply by integrating the corresponding program code, without replacing equipment or modifying hardware circuits, significantly reducing material and construction costs associated with equipment upgrades. The modular processing steps of the algorithm can be broken down and adapted to different types of imaging equipment. Security monitoring, vehicle imaging, industrial vision, and drone equipment have significantly different image resolution and frame rate requirements. The step-by-step computation structure can adjust the single-step computation switches according to the needs of various devices, quickly completing cross-category device portability and broadening the applicability of the algorithm for commercial deployment.

[0057] Example 3, see Figure 1 The entire method involves the image processing program sequentially performing calculations on each frame of a single static RGB image or video stream. The parameters for each step are uniformly matched by the illuminance classification label. The complete closed-loop calculation process and the corresponding quantization calculation rules are as follows.

[0058] Step 1: Image Preprocessing and Intelligent Illumination Classification. After the image acquisition device outputs raw RGB image data into the program, it sequentially performs three standardized preprocessing operations: lens distortion correction, global white balance coarse calibration, and pixel value range normalization. Lens distortion correction uses checkerboard calibration parameters to correct pixel coordinate offsets. Global white balance coarse calibration relies on the image grayscale mean to complete the three-channel pixel equalization mapping. Pixel value range normalization maps the original 0 to 255 pixel range to a 0 to 1 floating-point range, eliminating data deviations caused by exposure and hardware gain of different acquisition devices.

[0059] After preprocessing, the program statistically analyzes three types of quantization features pixel by pixel: global grayscale mean, dark area pixel proportion, and local light and shadow variance. These three features are input into the grading logic to generate illumination grading labels. The global grayscale mean is the arithmetic mean of all normalized pixels in the image. The dark area pixel proportion is defined as the percentage of pixels whose grayscale value is lower than a preset dark area segmentation threshold. The ratio of the total number of pixels to the total number of pixels in the image is used. The local light and shadow variance is calculated by dividing the image into 8×8 pixel blocks. The average value of the variance of all blocks is taken as the global local light and shadow variance index.

[0060] A multi-level threshold group is preset, and the three types of features are substituted into the joint judgment logic to divide the illumination scene into four categories. The output is a graded label with values ​​of 0, 1, 2, and 3, which correspond to extremely low light scene, low light scene, normal low light scene, and mixed light and dark scene, respectively. Each label is pre-bound to a fixed set of benchmark parameters, including all the parameters required for calculation such as illumination gain benchmark value, dark area enhancement benchmark weight, bright area suppression benchmark threshold, color gain upper and lower limits, noise reduction intensity benchmark, sharpening intensity benchmark, and fusion weight benchmark. All subsequent processing steps directly read the benchmark parameters bound to the current label to perform quantization calculations.

[0061] Step 2: Multi-scale illumination component adaptive optimization. Based on the Retinex imaging model, image component decomposition is performed, and the original image is normalized. Decomposed into light components With reflection component ,satisfy: The reflection component remains unchanged throughout; only the illumination component undergoes layered optimization. Three levels of Gaussian convolution kernels of varying sizes (large, medium, and small) are used for layered filtering to extract illumination component features. The large-scale kernel extracts the global macroscopic illumination distribution, the medium-scale kernel extracts localized light and shadow variations, and the small-scale kernel extracts pixel-level subtle brightness fluctuations. The outputs of these three levels of filtering are then superimposed to obtain the original layered illumination feature map. .

[0062] This step involves the illumination gain factor. Dark areas increase weight Bright area suppression threshold The three core operation parameters, all three types of parameters, are obtained by combining the baseline parameters bound to the current illuminance rating label with dynamic pixel grayscale correction, and are accompanied by complete calculation formulas.

[0063] 1. Formula for calculating illumination gain coefficient In the formula: The current illuminance rating label corresponds to the light gain baseline value. : Global grayscale mean of the image; : Preset illumination correction factor, with a value range of [0.2, 0.6]. The lower the global grayscale mean, the larger the final illumination gain factor value, and the greater the overall brightening effect in dark environments.

[0064] 2. Dark Zone Weighting Calculation Formula In the formula: The dark area associated with the illuminance rating label is given a higher baseline weight. Dark area pixel percentage. The larger the coverage area of ​​the dark area in the image, the higher the weight of dark area enhancement, thus specifically strengthening the brightening effect of dark pixels.

[0065] 3. Gradual and gentle pixel brightening correction formula In the formula: : Pixel values ​​of illumination after optimization at coordinates (x,y); : The original illumination pixel values ​​after layered filtering; : Soften and brighten curve index, fixed value =2.2. This power function curve shows a gradual increase in the low grayscale range, a rapid increase in the high grayscale range, and a gradual increase in pixels in the low grayscale dark areas without abrupt changes, thereby achieving a gradual and soft brightening effect and completely eliminating the light and shadow discontinuities caused by brightening dark areas.

[0066] 4. Dynamic threshold suppression pixel constraint piecewise formula In the formula: : The baseline threshold for suppressing bright areas corresponding to the current illuminance classification label; Highlight attenuation coefficient, fixed value =0.7. When the pixel illumination value exceeds the threshold, the pixel value is not directly truncated. Instead, the pixels in the bright area are linearly compressed according to a fixed attenuation coefficient to complete dynamic threshold suppression, avoiding overexposure and whitening of pixels in light source and reflective areas, and preserving the layer details of the bright areas.

[0067] After completing all pixel corrections, output the optimized lighting components. This is used for subsequent brightness channel update calculations.

[0068] Step 3 involves color space decoupling and color fidelity correction, converting the normalized RGB image to the YCbCr color space to isolate the operations of the luminance and chrominance channels. The channel independently carries all brightness and darkness information. , The chroma channel is locked to its original pixel values ​​throughout the entire process and does not participate in any brightness dimension calculations, relying solely on the optimized illumination components. renew Channel pixel value.

[0069] Read the upper limit of color gain based on the current illuminance rating label. Color gain lower limit Two sets of constraint parameters compensate and correct the saturation of the chroma channel. The chroma adjustment values ​​are strictly limited within the upper and lower threshold ranges to avoid color saturation overflow. A larger color gain range is provided for extremely low light scenes to compensate for the natural decay of color saturation in dark environments. The gain range is narrowed for scenes with alternating light and dark to prevent excessive stretching of local color blocks. At the same time, the color temperature offset value is corrected based on the global grayscale mean to constrain the overall offset of the chroma channel.

[0070] Step 4: Region-based discriminative layered adaptive noise reduction. The program calculates two sets of discriminative indicators—pixel variance and texture gradient—pixel by pixel, automatically dividing the image into three categories: flat noise regions, texture transition regions, and edge detail regions. Pixels with pixel variance values ​​below a preset flatness threshold are identified as flat noise regions, pixels with texture gradient values ​​above a preset detail threshold are identified as edge detail regions, and the interval between the two thresholds is defined as texture transition regions.

[0071] Differentiated smoothing filter intensities are configured for three types of regions. High-intensity adaptive mean filtering is used in flat regions to fully filter out amplified grain noise, salt-and-pepper noise, and dark area noise after brightness enhancement. Medium-intensity edge-preserving filtering is used in texture transition regions to slightly suppress noise while preserving texture transition levels. Only weak threshold smoothing is enabled in edge detail regions to prioritize the preservation of high-definition details such as contours and lines, balancing the two operational goals of noise suppression and detail preservation.

[0072] Step 5: Edge detail repair and directional sharpening. The Sobel operator is used to extract horizontal and vertical edge gradients, calculate pixel gradient magnitude, and set a fixed filtering threshold for gradient magnitude. Fine textures with gradient magnitudes below the threshold are judged as noise-derived pseudo-textures and directly removed. Outlines, text, and fine textures with gradient magnitudes above the threshold are judged as valid details of the real scene.

[0073] As an alternative implementation, the Canny operator can be used alone to complete multi-threshold edge gradient extraction, or the Laplacian operator can be used alone to complete second-order gradient edge detection. Each operator has its own independent gradient threshold parameters, forming a complete and independent edge extraction processing chain. Different operator schemes are not mixed and listed.

[0074] Targeted sharpening is performed on the selected effective detail areas, while simultaneously supplementing detail compensation values ​​for low-grayscale dark area pixels to repair edge layers lost in low-light environments and improve the overall image clarity and three-dimensionality.

[0075] Step 6: Dynamic feature fusion, inter-frame stabilization post-processing, and image output. This step introduces dynamic fusion weight coefficients. This is used to balance the fusion ratio of four types of processing results: brightness optimization, color correction, layered noise reduction, and detail enhancement, with a corresponding standardized vector calculation formula: In the formula: Four types of optimization branches with fixed base weights; Illumination gain coefficient; Dark zones increase weight; : Current noise reduction intensity benchmark; : Sharpening intensity benchmark.

[0076] All four types of parameters are taken from the baseline parameter group bound to the current illumination level label. The dynamic fusion weight is dynamically adjusted in sync with the scene level to prevent the over-enhancement of the single-dimensional processing effect from causing an imbalance in image quality.

[0077] After the multi-dimensional feature fusion operation is completed, a unified post-processing operation is performed. First, pixel value range calibration is carried out to constrain the pixel values ​​that exceed the normalization range of [0,1] to the legal range. Second, inter-frame frame stabilization constraint is performed to cache the average brightness and average chromaticity values ​​of the previous frame image and limit the difference between the average output value of the current frame and the average value of the previous frame to not exceed a preset fluctuation threshold, thereby reducing the difference in brightness and color between the previous and next frames of the video stream and eliminating the problems of dynamic image flicker and motion blur. Finally, the YCbCr image is converted to the standard RGB format in reverse and output as a static image or real-time video stream frame by frame.

[0078] The entire computation process eliminates multi-layered nested loops and iterative operations on high-dimensional matrices of order three and above. All matrix operations are simplified into two-dimensional convolution parallel computation logic. A block-parallel processing method is adopted to synchronously process pixels in different blocks of the image, reducing the computational power consumption of single-frame processing. It can be solidified as a local SDK and deployed on embedded camera terminals, industrial vision hosts, and PC devices to complete offline real-time processing. Alternatively, it can be encapsulated into a standardized cloud API interface and deployed on a server to support high-concurrency remote calls from multiple clients. The two deployment modes can be implemented independently.

[0079] In this plan , , , , All benchmark parameters, such as noise reduction intensity benchmark and sharpening intensity benchmark, have standardized tuning rules. The parameters are not random empirical values. The tuning process relies on objective image evaluation indicators to complete quantitative calibration.

[0080] Multiple sets of standard test images for four types of illumination scenarios were collected. Peak signal-to-noise ratio (PSNR) and structural similarity index (SSIM) were calculated for each scenario. The range of baseline parameter values ​​was traversed, and the corresponding image quality index values ​​for each set of parameters were recorded. The optimal parameter combination for both PSNR and SSIM was selected as the baseline parameter for the corresponding illumination classification label. When encountering new imaging scenarios later, only the corresponding standard test images need to be added, and the value range is repeatedly traversed to select the optimal parameters to complete the parameter update and adaptation. The entire parameter calibration process can be automated, the computational logic is stable and reproducible, and it meets the requirements for patent utility examination.

[0081] Multiple sets of standard test images were selected, including those in extremely low light, alternating bright and dark conditions, and normal low light. Comparative tests were conducted using the traditional single-scale Retinex algorithm and the proposed method, with the PSNR and SSIM quantization metrics of the output images from both algorithms recorded simultaneously. In extremely low light scenarios, the PSNR value of the proposed method's output image was higher than that of the traditional algorithm, with a corresponding increase in the SSIM metric. Noise content in dark areas was significantly reduced, resulting in higher image texture integrity. In alternating bright and dark mixed scenes, the traditional algorithm's output image exhibited pixel saturation overflow in bright areas, leading to a significant drop in the SSIM value. The proposed method, relying on dynamic thresholding to suppress detail in bright areas, demonstrated a clear advantage in both objective evaluation metrics, directly showcasing the significant technological advancement of this solution compared to existing technologies.

[0082] Without changing the core computing chain and mathematical control logic of this invention, some computing components can be replaced to form independent implementation cases. Each type of replacement scheme is defined separately, and multiple types of components are not mixed to form a broad scope of protection.

[0083] The illumination grading features can be selected individually from the image brightness histogram distribution features, the difference between local brightness and darkness mean values, or the image global contrast features to complete the scene grading determination. Each feature corresponds to an independent grading determination threshold logic, forming a complete grading processing link.

[0084] Multi-scale illumination decomposition can use any one of the following methods—bilateral filtering, mean filtering, or Gaussian pyramid filtering—to extract layered features of illumination components. Each filtering method is equipped with independent convolution kernel size parameters and layer stacking calculation logic.

[0085] The color space can be selected separately for YUV color space or HSV color space to complete the decoupling operation of luminance and chrominance channels. Each color space has its own independent color space conversion formula, and the chrominance channel does not participate in the luminance value update operation throughout the process.

[0086] The edge detection operators are divided into three independent implementation schemes. The first scheme uses only the Sobel operator to complete edge extraction, the second scheme uses only the Canny operator to complete edge extraction, and the third scheme uses only the Laplacian operator to complete edge extraction. The three schemes are independent of each other and each has its own exclusive gradient threshold filtering rules.

[0087] The deployment mode is divided into two independent implementation schemes. The first scheme only adopts the embedded local offline processing mode, and the second scheme only adopts the cloud API concurrent call mode. The two schemes can be implemented and used independently without the need to run them in sync.

[0088] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0089] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention.

Claims

1. A real-time enhancement method for low-light full-color images based on illumination grading, characterized in that: Image processing is performed frame-by-frame by a computer program on still images or moving video frames, including the following steps: S1. Image preprocessing and intelligent illuminance classification: Obtain the original RGB image output by the image acquisition device, and sequentially perform lens distortion correction, global white balance coarse calibration, and pixel value range normalization preprocessing operations. Extract three types of image dimensional features: global grayscale mean, dark area pixel ratio, and local light and shadow variance. Based on the multi-feature joint discrimination rule, complete the image illumination scene classification. Divide the input image into four categories: extremely low light scene, low light scene, normal dark light scene, and mixed light and dark scene, and output the corresponding illumination classification label. S2. Multi-scale adaptive optimization of illumination components: Based on the Retinex imaging model, the preprocessed image is decoupled into illumination components and reflection components; three levels of Gaussian filtering at different scales are used to extract global macroscopic illumination features, local area illumination features, and subtle light and shadow fluctuation features of the illumination components in layers. Based on the illuminance rating label output by S1, the corresponding scene's illuminance gain coefficient, dark area enhancement weight, and bright area suppression threshold are adaptively matched. The dark areas are gradually and gently brightened, while the bright pixel areas are subject to dynamic threshold suppression, and the optimized illuminance components are output. S3, Color Space Decoupling and Color Fidelity Correction: Converts RGB images to YCbCr color space to achieve physical isolation between the luminance Y channel and the Cb and Cr chromaticity channels; The pixel update of the Y brightness channel is performed only based on the optimized illumination component, while the original pixel data of the Cb and Cr chromaticity channels are locked throughout the process and do not participate in the brightness adjustment calculation. Based on the illuminance rating label, the upper and lower limit constraint thresholds of color gain are dynamically configured to compensate for the color saturation degradation in low-illuminance environments and correct the inherent color temperature shift. S4, Region-discriminative hierarchical adaptive noise reduction: Constructs dual region discrimination criteria of pixel variance and texture gradient, and automatically divides flat noise region, texture transition region and edge detail region; High-intensity adaptive mean filtering is used to suppress noise across the entire domain in flat noise regions, while edge-preserving noise reduction strategy is adopted in texture transition regions and edge detail regions to preserve image contour texture while filtering out noise. S5. Edge detail restoration and targeted sharpening enhancement: The Sobel edge detection operator is used to extract high-frequency features of weakened edges, lines and textures in the image. The feature discrimination logic distinguishes between real-world effective textures and noise-derived pseudo textures and removes pseudo textures. Targeted sharpening and shadow detail enhancement are applied to effective detail areas such as object outlines, text structures, and subtle textures. S6. Dynamic Feature Fusion and Inter-Frame Stabilization Post-Processing: Introduces dynamic fusion weight coefficients to adaptively balance the fusion ratio of four types of image optimization features: brightness optimization, color correction, layered noise reduction, and detail enhancement. After fusion, pixel value range calibration, inter-frame brightness and color fluctuation suppression, fine color temperature adjustment and frame stabilization are performed sequentially, and finally converted into standard RGB image format to output static images or real-time video streams. The method adopts a lightweight computing architecture, reducing redundant iterative operations and highly complex matrix operations, and is compatible with both local real-time processing on embedded terminals and high-concurrency calls to cloud APIs.

2. The real-time enhancement method for low-light full-color images based on illumination grading according to claim 1, characterized in that: In step S1, the dark area pixel ratio is defined as the ratio of the total number of pixels with gray values ​​lower than a preset gray threshold to the total number of pixels in the image. The illuminance rating label set is {0,1,2,3}, which corresponds to extremely low light scene, low light scene, normal dark light scene, and mixed light and dark scene respectively.

3. The real-time enhancement method for low-light full-color images based on illumination grading according to claim 1, characterized in that: In step S2, the three-level Gaussian filter independently extracts the layered features of global macro illumination, local area illumination, and subtle light and shadow fluctuations in the image. By relying on the adaptive parameter matching mechanism of illumination grading, the enhancement amplitude of bright and dark areas is adjusted differently to suppress overexposure in bright areas and the defects of light and shadow discontinuity in the image.

4. The real-time enhancement method for low-light full-color images based on illuminance grading according to claim 1, characterized in that: In step S3, YUV color space or HSV color space can be used to decouple the luminance channel and chrominance channel operations, so that the chrominance channel does not participate in the luminance dimension adjustment operation throughout the process.

5. The real-time enhancement method for low-light full-color images based on illumination grading according to claim 1, characterized in that: In step S4, the pixel variance is used to identify flat, noiseless regions without texture, and the texture gradient is used to identify high-detail regions containing edges, lines, and textures. The two types of features are combined to achieve automatic classification of image regions.

6. The real-time enhancement method for low-light full-color images based on illuminance grading according to claim 1, characterized in that: In step S5, edge feature extraction is performed using the Canny edge detection operator and the Laplacian edge detection operator. The algorithm automatically filters out noise-generated fake textures and performs detail repair and targeted sharpening operations only on real-world outlines, printed text, and subtle textures.

7. The real-time enhancement method for low-light full-color images based on illuminance grading according to claim 1, characterized in that: In step S1, any one or more of the following features are used: image brightness histogram distribution features, local brightness-dark mean difference, and global image contrast features, to achieve illumination scene classification determination.

8. The real-time enhancement method for low-light full-color images based on illuminance grading according to claim 1, characterized in that: In step S2, any one of the multi-scale decomposition methods, such as bilateral filtering, mean filtering, or Gaussian pyramid filtering, is selected to complete the extraction of layered light and shadow features of the illumination components.

9. The real-time enhancement method for low-light full-color images based on illuminance grading according to claim 1, characterized in that: The method includes two independently implementable deployment schemes: the first is offline local real-time processing using embedded camera terminals, local PCs, and industrial vision equipment; The second category is standardized cloud API interfaces for algorithm encapsulation, which support high-concurrency remote calls from multiple clients and can be implemented using any of the deployment schemes.

10. The method for real-time enhancement of low-light full-color images based on illuminance grading according to claim 1, characterized in that: The method is a pure software algorithm implementation scheme, which does not require modification of the hardware structure of the imaging device or the addition of infrared supplementary lighting hardware. It can be integrated and applied to security monitoring, vehicle imaging, smart home vision, industrial machine vision, and drone aerial imaging equipment.