An adaptive processing method for image enhancement and a storage medium
By constructing an adaptive control mechanism for edge space coverage and guided filtering, and optimizing image enhancement parameters, the problem of unstable component separation caused by improper adjustment of edge space coverage in Retinex theory is solved, and a more stable image enhancement effect is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-30
- Publication Date
- 2026-06-19
AI Technical Summary
Existing image enhancement methods based on Retinex theory lack effective adjustment and adaptive control of edge space coverage, resulting in unstable separation of illumination and reflection components, which affects the quality of image enhancement.
By constructing an adaptive control mechanism for edge spatial coverage, combining guided filtering to estimate illumination components, and utilizing edge gradient statistics and Markov state transition methods to optimize image enhancement parameters, adaptive processing of guided images is achieved.
It improves the separation stability of illumination and reflection components, enhances the continuity of brightness recovery and structure preservation during image enhancement, and reduces instability caused by fixed parameters or manual experience selection.
Smart Images

Figure CN121937298B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically, to an adaptive processing method and storage medium for image enhancement. Background Technology
[0002] Retinex theory (retinal-cortical theory) is a common image enhancement theory. Its basic idea is to decompose an image into illumination and reflection components. The illumination component reflects the overall lighting changes of the scene, while the reflection component reflects the texture details and structural information of object surfaces. Image enhancement methods based on Retinex theory typically extract the brightness channel of the input image, estimate the illumination component using edge-preserving filtering or guided filtering, and then extract the reflection component by analyzing the relationship between the illumination component and the original image, thereby achieving image brightness equalization and detail enhancement. Because these methods can simultaneously improve the visibility of dark areas while preserving image structural details, they are widely used in low-light surveillance image enhancement, image preprocessing, and visual perception enhancement.
[0003] In Retinex-based image enhancement methods, guided filtering is often used to smooth the image edges, estimating the illumination component and separating it from the reflection component. In this process, the guide image describes the structural distribution features of the image, and its edge structure information directly affects how edge and smooth regions are processed during guided filtering. Therefore, the edge structure distribution density in the guide image, i.e., the edge spatial coverage, has a significant impact on the estimation of the illumination component. When the edge spatial coverage changes, the number and distribution range of edges participating in structural constraints in the guide image also change, thereby altering the separation effect of illumination changes and detail textures during filtering, ultimately affecting the separation quality of the illumination and reflection components and the overall image enhancement result.
[0004] In practical applications, the edge space coverage ratio typically has a two-way impact on image enhancement. When the edge space coverage ratio is low, the structural constraints in the guide image are weaker, resulting in a smoother and more stable illumination component estimation process, but with weaker preservation of detailed structures. Conversely, when the edge space coverage ratio is high, the number of structural edges in the guide image increases, better preserving object contours and texture details; however, excessive edge structures may also interfere with illumination component estimation. Therefore, both the level of edge space coverage and the relative edge space coverage ratio have different effects on the separation process of illumination and reflection components, thus affecting the final image enhancement quality.
[0005] When the edge space coverage is low, there is less edge structure information in the guided image, reducing the image's structural constraint capability. Guided filtering relies primarily on large-scale brightness changes for smoothing when estimating the illumination component. In this case, while the illumination component can maintain good continuity, some real edge structures in the image may be over-smoothed, leading to a reduction in recoverable details in the reflection component, resulting in blurred contours, weakened textures, and other problems that affect the image enhancement's ability to represent the target structure.
[0006] When the edge spatial coverage is high, the edge structures in the guided image are densely distributed. When estimating the illumination component, the guided filter performs structure-preserving processing on a large number of edge regions, making the filtering process more strictly protect the boundary structure. Although this method can enhance the image contour and texture details, too many edge structures will cause the illumination component to be frequently segmented in space, which will lead to the illumination estimation process being interfered with by texture information, easily producing local illumination abrupt changes or blocky illumination distributions, reducing the overall smoothness of the illumination component, and affecting the stable extraction of the reflection component.
[0007] Existing image enhancement methods based on Retinex theory often lack effective adjustment and adaptive control of edge space coverage when constructing guide images, making it difficult to achieve a stable balance between preserving edge structure and smoothing illumination components. When the edge space coverage is set improperly, it can easily lead to insufficient separation of illumination and reflection components, resulting in problems such as loss of detail, texture interference, or discontinuous illumination distribution, thus affecting the overall image enhancement effect. Therefore, how to reasonably control the edge space coverage in guide images to improve the stability of illumination and reflection component separation and image enhancement quality has become an urgent problem to be solved in the current technical field.
[0008] To address the above problems, this invention proposes a solution. Summary of the Invention
[0009] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide an adaptive processing method and storage medium for image enhancement. By constructing an adaptive control mechanism for edge spatial coverage and combining it with guided filtering to achieve illumination component estimation, the method solves the problem that the degree of edge emphasis is difficult to control reasonably in Retinex image enhancement, which leads to unstable separation of illumination and reflection components.
[0010] To achieve the above objectives, the present invention provides the following technical solution:
[0011] An adaptive processing method for image enhancement includes the following steps:
[0012] Under standard low-light monitoring sample conditions, the spatial distribution of structural edges in historical enhanced images is statistically analyzed using a grid. Based on the continuity of the target contour, the effective structural edge grid ratio is selected, and a stable center value is extracted as the first edge space coverage rate. A coverage expansion interval is constructed centered on the first edge space coverage rate and divided into equidistant segments to generate several second edge space coverage rates. Edge detection is performed on the image to be enhanced, and the edge gradient magnitude is calculated. The gradients are sorted, and the cumulative statistical coverage ratios in the image grid space form a gradient cumulative coverage sequence. Based on this sequence, each second edge space coverage rate is converted into a corresponding edge gradient boundary value and structure preservation window scale. The control quantity corresponding to each second edge space coverage rate is applied to guide image construction, and the illumination component is estimated based on guided filtering. The reflection component is separated according to Retinex theory to complete image enhancement. Feature extraction is performed on the image enhancement results corresponding to each second edge space coverage rate, and a guide image score is calculated based on the Markov state transition method. The second edge space coverage rate corresponding to the maximum score is determined based on the distribution of the guide image score along the second edge space coverage rate, and the control quantity corresponding to this coverage rate is applied to guide image construction to complete the image enhancement process.
[0013] An adaptive processing system for image enhancement includes an edge coverage extraction module, a coverage interval generation module, a gradient coverage mapping module, a guided filtering enhancement module, an enhancement feature evaluation module, and an optimal coverage decision module. The edge coverage extraction module performs grid statistics on the spatial distribution of structural edges in historical enhanced images under standard low-light monitoring sample conditions, and filters the proportion of effective structural edge grids based on the continuity of the target contour, extracting a stable center value as the first edge space coverage. The coverage interval generation module constructs a coverage expansion interval centered on the first edge space coverage and performs equidistant segmentation to generate several second edge space coverages. The gradient coverage mapping module performs edge detection on the image to be enhanced and calculates the edge gradient magnitude, sorts them by gradient, and accumulates them statistically in the image grid space. The coverage ratio forms a gradient cumulative coverage sequence. Based on this sequence, the coverage ratio of each second edge space is converted into the corresponding edge gradient boundary value and structure-preserving window scale. The guided filtering enhancement module applies the control quantity corresponding to each second edge space coverage ratio to the guided image construction, estimates the illumination component based on the guided filter, and separates the reflection component according to Retinex theory to complete image enhancement. The enhancement feature evaluation module extracts features from the image enhancement results corresponding to each second edge space coverage ratio and calculates the guided image score based on the Markov state transition method. The optimal coverage decision module determines the second edge space coverage ratio corresponding to the maximum score based on the distribution of the guided image score along the second edge space coverage ratio, and applies the control quantity corresponding to this coverage ratio to the guided image construction to complete the image enhancement processing.
[0014] An electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform an adaptive processing method for image enhancement.
[0015] A computer-readable storage medium storing a computer program that, when executed by a processor, implements an adaptive processing method for image enhancement.
[0016] The technical effects and advantages of the adaptive processing method for image enhancement proposed in this invention are as follows:
[0017] 1. This invention statistically analyzes the spatial distribution of structural edges in historical enhanced images to extract a stable first edge spatial coverage rate. Based on this, it constructs coverage expansion intervals to generate multiple sets of second edge spatial coverage rates. Then, combining this with a gradient accumulation coverage sequence, each coverage rate is adaptively mapped to its corresponding edge gradient boundary value and structure preservation window scale, thereby achieving controllable adjustment of edge emphasis during the construction of the guide image. This method enables the guide image to maintain the main structural edges while avoiding excessive texture edges participating in structural constraints, thus improving the stability of illumination component estimation, making the separation of illumination and reflection components in Retinex theory more accurate, and effectively enhancing the continuity of brightness recovery and structure preservation ability during image enhancement.
[0018] 2. This invention extracts features from image enhancement results obtained under different second edge space coverage rates, constructs an enhancement feature state sequence based on the Markov state transition method, calculates the state stability probability to obtain a guided image score, and automatically determines the optimal edge space coverage rate based on the score distribution, thereby achieving adaptive optimization of image enhancement parameters. This technical solution can automatically balance the relationship between structural edge preservation, illumination continuity, and texture interference under different scene conditions, making the final separation results of illumination and reflection components more reasonable, reducing instability caused by fixed parameters or manual experience selection, and thus improving the stability and adaptability of image enhancement effects. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating an adaptive processing method for image enhancement according to the present invention. Detailed Implementation
[0020] 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 of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0021] Example 1, Figure 1 An adaptive processing method for image enhancement according to the present invention is provided, comprising the following steps:
[0022] S1. Under standard low-light monitoring sample conditions, perform grid statistics on the spatial distribution of structural edges in historical enhanced images, and filter the effective structural edge grid ratio based on the continuity of the target contour, extracting the stable center value as the first edge spatial coverage.
[0023] In this embodiment, under standard low-light monitoring sample conditions, the spatial distribution of structural edges in historical enhanced images is statistically analyzed using grids, and the proportion of effective structural edge grids is selected based on the continuity of the target contour. The stable center value is then extracted as the first edge spatial coverage rate. Specifically:
[0024] Standard low-light surveillance video sequences are acquired, and image frames are extracted from the video sequences at fixed time intervals to form an original sample image set. Image enhancement processing based on Retinex theory is performed on each image in the original sample image set to obtain a historical enhanced image set.
[0025] The brightness channel is extracted from each enhanced image in the historical enhanced image set, and the gradient magnitude map and gradient direction map are obtained by calculating the two-dimensional gradient vector field of the brightness channel. The non-maximum suppression method is used in the gradient magnitude map to preserve the location of the local maximum gradient response, thus obtaining the set of structural edge pixels.
[0026] Each enhanced image is divided into a fixed-size two-dimensional grid region, and the number and distribution of structural edge pixels in each grid region are counted. A structural edge grid distribution map is constructed based on the spatial coordinates of the edge pixels in the grid.
[0027] In the structural edge grid distribution map, grid adjacency relationships are established with grids as nodes, and the structural orientation consistency between adjacent grids is calculated based on the cosine similarity of the gradient direction of edge pixels at the grid center. Adjacent grids with orientation consistency higher than the average similarity are connected to form an edge grid connectivity graph.
[0028] In the edge mesh connected graph, all connected subgraphs are traversed, and the path length and directional stability of the grid nodes in each connected subgraph are calculated. The directional stability is obtained by statistically analyzing the variance of the gradient direction distribution within the subgraph. Connected subgraphs with a path length greater than the average path length of all subgraphs and a directional stability less than the overall variance mean are selected as the edge mesh set corresponding to the continuous target contour path.
[0029] The proportion of the edge grid set in each enhanced image to the total grid is calculated to obtain the corresponding structural edge grid proportion sequence;
[0030] Sort the sequence of grid proportions at the structural edge and calculate the median. Use the median as the first edge space coverage.
[0031] In this embodiment, the standard low-light monitoring sample condition refers to a video sequence acquired in a low-light environment, where the lighting is insufficient but the scene structure information can still be identified. This typically includes scenarios such as nighttime monitoring and indoor low-brightness monitoring, and is used to ensure that subsequent image enhancement methods can stably extract edge and texture information under low-light conditions.
[0032] In this embodiment, the historical enhanced image set is an image set obtained by applying a preliminary image enhancement method based on Retinex theory to the original low-light image set. These images have undergone brightness equalization and local contrast enhancement processing, making structural edges and details more prominent and facilitating the statistical analysis of edge spatial distribution.
[0033] In this embodiment, the luminance channel is a single-channel image extracted from a color image. It typically uses the image's brightness information (such as grayscale or luminance components) to eliminate the interference of color on edge detection and gradient calculation, making edge calculation more accurate and consistent with human visual brightness perception.
[0034] In this embodiment, the set of structural edge pixels is the set of pixels that retain the local maximum gradient value after non-maximum suppression, obtained by two-dimensional gradient operation at the edge response position in the brightness channel image. This set represents significant structural boundaries and target contour features in the image and is used for subsequent grid statistics and coverage calculation.
[0035] In this embodiment, the two-dimensional grid region is a regular sub-region in which the image is divided according to a fixed size. Each grid cell contains a certain number of pixels, which is used to statistically analyze the distribution of pixels at the structural edges in space and to provide a spatial reference frame for calculating the proportion and continuity of the edge grid.
[0036] In this embodiment, the edge mesh connectivity graph is a graph structure built with meshes as nodes and adjacency relationships and directional consistency as edges, used to represent the structural continuity between meshes. By calculating gradient direction similarity to connect adjacent meshes to form a connectivity graph, continuous target contour paths can be identified in the graph.
[0037] In this embodiment, directional stability is a quantitative indicator that describes the consistency of gradient directions within the edge grid set. It is obtained by statistically analyzing the variance of the gradient directions of all grids in the subgraph. The smaller the variance, the more consistent the directions are, indicating that the edge distribution of the connected subgraph is closer to the true target contour.
[0038] In this embodiment, the first edge spatial coverage is a stable value obtained by statistically analyzing the sequence of edge grid proportions corresponding to continuous target contour paths in all historical enhanced images and taking the median. This value reflects the average coverage of the target structure in the spatial grid and is used as the reference center for generating the second edge spatial coverage.
[0039] It should be noted that in this embodiment, the steps of extracting the brightness channel, calculating the gradient, suppressing non-maximum values, dividing the grid, performing edge statistics, constructing the connected graph, and calculating the orientation stability of the historical enhanced image are sequential. Each step provides the necessary data and spatial structure information for the next step, so that the spatial coverage of the first edge extracted at the end can accurately reflect the spatial features of the target contour.
[0040] It should be noted that this method can also be extended to multi-scale grid statistics, that is, to repeatedly perform structural edge statistics and connectivity analysis under different grid sizes to obtain multi-scale edge coverage information. This can enhance the adaptability of the method to different target sizes and scene complexity, and improve the robustness and detail preservation of low-light image enhancement.
[0041] S2, construct a coverage expansion interval centered on the first edge space coverage rate and perform equidistant segmentation to generate several second edge space coverage rates.
[0042] In this embodiment, the step of constructing a coverage expansion interval centered on the first edge space coverage rate and performing equidistant segmentation to generate several second edge space coverage rates specifically involves:
[0043] Establish a coverage reference coordinate system with the first edge space coverage rate as the center value;
[0044] Discrete frequency domain analysis is performed on the structural edge grid proportion sequence in the historical enhanced image set. The discrete Fourier transform is performed on the proportion sequence to obtain the frequency domain amplitude sequence. The main frequency band of coverage change is determined based on the energy concentration segment in the frequency domain amplitude sequence.
[0045] Based on the frequency amplitude corresponding to the main frequency band, the stable fluctuation amplitude of the coverage change is obtained, and the stable fluctuation amplitude is used as the coverage expansion range to establish a symmetrical coverage expansion interval on both sides of the first edge space coverage.
[0046] Within the coverage expansion interval, the coverage is linearly sampled at fixed intervals to form several discrete coverage sampling points;
[0047] The discrete coverage sampling points are sorted according to their numerical values to form a second edge space coverage sequence, which is then used as the edge space coverage set to be screened in the subsequent image enhancement process.
[0048] In this embodiment, the coverage reference coordinate is a numerical reference axis established with the first edge space coverage as the center. It is used to define the start and end points of coverage changes, so that subsequent sampling and equidistant segmentation can be carried out around a stable center value, ensuring that the selection of the second edge space coverage has continuity and a reasonable range.
[0049] In this embodiment, discrete frequency domain analysis is a method for extracting the frequency characteristics of the structural edge grid proportion sequence in a historical enhanced image set. By converting time or sequence data to the frequency domain, it analyzes the periodic changes and main fluctuation components in the sequence to identify the main frequency band of edge coverage changes, thereby determining the stable fluctuation amplitude of coverage.
[0050] In this embodiment, the frequency domain amplitude sequence is the amplitude sequence corresponding to each frequency obtained after discrete Fourier transform, reflecting the intensity and energy distribution of different frequency components in the proportion sequence. The energy concentration segment represents the main fluctuation area of the coverage change, which is used to determine the reasonable size of the coverage expansion range.
[0051] In this embodiment, the stable fluctuation amplitude is the size of the main fluctuation interval identified based on the frequency domain amplitude sequence, obtained by analyzing the concentration of energy in the main frequency band. It represents the typical variation range of edge coverage in historical enhanced images and is used as the radius of the coverage expansion interval, so that the generated second edge space coverage can cover the possible effective variation range.
[0052] In this embodiment, discrete coverage sampling points are a number of values obtained by linearly sampling the coverage at fixed intervals within the coverage expansion interval. Each sampling point represents a potential second edge space coverage, which is used to test the effect of different coverage on the separation effect of illumination and reflection components in subsequent image enhancement processes.
[0053] In this embodiment, the second edge space coverage sequence is a sequence formed by sorting each discrete sampling point according to its numerical value. It is used as the coverage set to be screened in the subsequent image enhancement process. This sequence can systematically cover the fluctuation range around the first edge space coverage, ensuring that the enhancement results are evaluated under different coverage levels.
[0054] It should be noted that in this embodiment, the steps of performing frequency domain analysis and main frequency band identification on the structural edge grid proportion sequence of the historical enhanced image can obtain the coverage fluctuation pattern by analyzing the periodicity and stability of the sequence, avoiding blindly selecting the coverage range, and ensuring that the generated second edge space coverage sequence can reflect the real edge structure characteristics.
[0055] It should be noted that this method can also be extended to multi-scale frequency domain analysis, that is, frequency domain analysis is performed on the edge grid proportion sequence at different scales or at different time intervals to obtain multi-scale stable fluctuation amplitude, thereby generating a richer second edge space coverage sequence, improving the adaptability and robustness of the method under complex scenarios and dynamic monitoring conditions.
[0056] S3: Perform edge detection on the image to be enhanced and calculate the edge gradient magnitude. Sort by gradient and accumulate statistical coverage ratio in the image grid space to form a gradient cumulative coverage sequence. Based on this sequence, convert the coverage rate of each second edge space into the corresponding edge gradient boundary value and structure preservation window scale.
[0057] In this embodiment, the process of performing edge detection on the image to be enhanced and calculating the edge gradient magnitude, sorting by gradient, and accumulating statistical coverage ratios in the image grid space to form a gradient cumulative coverage sequence, and converting each second edge space coverage rate into a corresponding edge gradient boundary value and structure-preserving window scale based on this sequence, specifically involves:
[0058] Obtain the brightness channel of the image to be enhanced, perform two-dimensional gradient operation on the brightness channel to obtain the gradient magnitude map and gradient direction map, and use non-maximum suppression to retain the local maximum gradient response position in the gradient magnitude map to obtain the edge pixel set;
[0059] The gradient magnitude of each pixel in the edge pixel set is read and sorted in descending order of gradient magnitude to form an edge gradient sorting sequence.
[0060] The image to be enhanced is divided into two-dimensional grid regions of fixed size, and the edge pixels in the sorted sequence are mapped to the corresponding grid cells according to their spatial coordinates. The number of grids covered by the edge pixels that have appeared is accumulated and counted step by step in the sorted sequence, and the proportion of the number of grids to the total number of grids is calculated to form a gradient accumulation coverage sequence.
[0061] The gradient cumulative coverage sequence is matched with the second edge space coverage sequence. For each second edge space coverage, the closest coverage ratio position is searched in the gradient cumulative coverage sequence, and the gradient magnitude corresponding to that position is read as the edge gradient boundary value.
[0062] After obtaining the edge gradient boundary value corresponding to each second edge spatial coverage, the spatial distribution of edge pixels above the edge gradient boundary value is statistically analyzed, and the average edge spacing is calculated. The corresponding structure preservation window scale is determined based on the average edge spacing, thereby obtaining the structure preservation window scale corresponding to each second edge spatial coverage.
[0063] In this embodiment, the edge pixel set is a set of pixels obtained by performing two-dimensional gradient operations on the brightness channel of the image to be enhanced to obtain a gradient magnitude map and a gradient direction map, and by using non-maximum suppression to retain the location of the local maximum gradient response. This set reflects the significant structural edge locations in the image and can be used to construct the structural constraints of the guiding image.
[0064] In this embodiment, the edge gradient sorting sequence is a sequence formed by arranging the gradient magnitudes of each pixel in the edge pixel set in descending order. This sequence is used to determine the importance and influence of edge pixels. The larger the gradient magnitude, the more significant the edge is, and the higher its weight is given to subsequent coverage matching and structure preservation window determination.
[0065] In this embodiment, the two-dimensional grid region is used to divide the image to be enhanced into small blocks of fixed size. Each grid cell is used to statistically analyze the edge pixel distribution and cumulative coverage ratio, so that the image spatial information is discretized, which makes it easier to map the gradient sorting information to the actual space and calculate the coverage ratio.
[0066] In this embodiment, the gradient cumulative coverage sequence is a sequence formed by mapping pixels to two-dimensional grid regions sequentially according to the edge gradient sorting sequence and counting the proportion of the number of covered grids to the total number of grids. This sequence is used to quantify the cumulative coverage of edge pixels in the spatial grid, thereby providing a basis for matching the second edge spatial coverage rate with the gradient boundary value.
[0067] In this embodiment, the edge gradient boundary value is the gradient magnitude read from the position of the coverage ratio closest to each second edge spatial coverage in the gradient accumulation coverage sequence. This boundary value is used to filter pixels with significant structural edges and control the edge emphasis in the guide image and subsequent filtering window constraints.
[0068] In this embodiment, the structure maintains the window scale, which is the radius of the filtering window determined by performing spatial distribution statistics on pixels with edge amplitudes higher than the boundary value and calculating the average edge spacing after obtaining the edge gradient boundary value. This scale is used to guide the filtering process to ensure that the structure edges are not weakened by smoothing, while ensuring that the unstructured areas are sufficiently smoothed.
[0069] It should be noted that in this embodiment, the construction of the gradient accumulation coverage sequence not only considers the pixel gradient magnitude, but also combines grid space mapping, so that the coverage ratio statistics can reflect the distribution of edges in the actual image space, avoiding reliance on single pixel intensity and ignoring spatial clustering characteristics, thereby improving the stability and accuracy of edge screening.
[0070] It should be noted that this method can be further extended to a multi-layer grid accumulation strategy, that is, by accumulating statistics through grids of different sizes, a multi-layer gradient accumulation coverage sequence is obtained. This can simultaneously consider local detail edges and global structural edges, making the matching between the second edge spatial coverage and gradient boundary value more precise and adaptable to complex scenes, thereby enhancing the robustness of image enhancement effects.
[0071] S4. The control quantities corresponding to the coverage of each second edge space are applied to guide image construction, and the illumination components are estimated based on the guided filter. The reflection components are separated according to the Retinex theory to complete image enhancement.
[0072] In this embodiment, the control quantity corresponding to each second edge space coverage is applied to guide image construction, and the illumination component is estimated based on the guided filter. The reflection component is separated according to Retinex theory to complete image enhancement. Specifically, the process is as follows:
[0073] Obtain the brightness channel of the image to be enhanced, as well as the edge gradient boundary value and structure preservation window scale corresponding to each second edge spatial coverage;
[0074] For each set of edge gradient boundary values corresponding to the second edge space coverage, pixels with gradient magnitudes greater than the edge gradient boundary value are selected as structural edge pixels in the gradient magnitude map, and a structural edge mask map is generated based on the pixel space coordinates.
[0075] Using the structural edge mask as a constraint, edge-preserving smoothing processing is performed on the brightness channel of the image to be enhanced to construct a guide image. The original gradient structure is preserved at the corresponding position of the structural edge mask, and a smooth region is generated in the non-structural region through local mean filtering, thereby obtaining a guide image that reflects the distribution of scene structure.
[0076] Using the guiding image as a guiding constraint and the corresponding structure-preserving window scale as the filtering window radius, a guided filtering operation is performed on the brightness channel of the image to be enhanced to obtain a smooth brightness map. This smooth brightness map is then determined as the illumination component estimation result of the image.
[0077] The relationship between the luminance channel, illumination component and reflection component is established based on Retinex theory. The reflection component is extracted by performing a pixel-by-pixel logarithmic difference operation on the luminance channel and illumination component.
[0078] A brightness dynamic range adjustment operation is performed on the illumination component to obtain an enhanced illumination component, and an exponential reconstruction operation is performed on the enhanced illumination component and the reflection component to obtain the image enhancement result under the corresponding second edge space coverage.
[0079] In this embodiment, the control quantity corresponding to the second edge space coverage rate is a set of parameters formed by the edge gradient boundary value determined according to the aforementioned gradient cumulative coverage sequence and the structure preservation window scale. This control quantity is used to guide the edge emphasis and the range of the filtering window during the image construction process, so as to adjust the separation effect of the illumination component and the reflection component.
[0080] In this embodiment, the structural edge mask map is a binary mask generated on the image based on the pixel spatial coordinates after filtering out pixels with values greater than the corresponding edge gradient boundary value in the gradient magnitude map. This mask marks the location of the structural edge and is used to protect the edge from being smoothed out when constructing the guide image and performing the guide filtering.
[0081] In this embodiment, the guiding image is an image after edge-preserving smoothing is performed on the brightness channel with the structural edge mask as a constraint. The image retains the original gradient structure at the edge position, while the non-structural area is smoothed by local mean filtering, which is used as the structural constraint for subsequent guiding filtering.
[0082] In this embodiment, the smoothed brightness map is a brightness image obtained by performing guided filtering operation with the guided image as the guiding constraint and maintaining the window scale with the corresponding structure. This image mainly reflects the overall illumination distribution in the scene and can be used as the illumination component estimation result in Retinex theory.
[0083] In this embodiment, the reflection component is image detail information obtained by separating the luminance channel from the smooth luminance map (illumination component) through pixel-by-pixel logarithmic difference operation according to Retinex theory. It includes object texture, edge contours and surface details, and is used to maintain the clarity of image structure during the enhancement process.
[0084] In this embodiment, the enhanced illumination component is the image obtained after performing brightness dynamic range adjustment on the estimated illumination component. It is used to increase the brightness of dark areas and suppress overly bright areas. It is also used to perform exponential reconstruction operation with the reflection component to finally obtain the image enhancement result under the corresponding second edge space coverage.
[0085] It should be noted that in this embodiment, the combination of edge gradient boundary value and structure-preserving window scale during the guided image construction process can achieve a balance between edge protection and smooth area, so that the illumination component estimation maintains continuity, reduces interference from texture, and ensures the clarity of the reflection component details.
[0086] It should be noted that this embodiment can be extended to multi-scale guided image construction, that is, by maintaining the window scale with different structures, the same image is filtered and estimated multiple times to generate multi-scale illumination components, which are then fused to obtain a more robust illumination estimation result, thereby further improving the adaptability and detail performance of image enhancement in complex low-light scenes.
[0087] S5, feature extraction is performed on the image enhancement results corresponding to each second edge space coverage, and the guide image score is calculated based on the Markov state transition method.
[0088] In this embodiment, the step of extracting features from the image enhancement results corresponding to each second edge space coverage and calculating the guiding image score based on the Markov state transition method specifically involves:
[0089] Extract the brightness channel of the image enhancement result corresponding to each second edge spatial coverage;
[0090] Two-dimensional gradient operations are performed on the brightness channels of each image enhancement result to obtain a gradient magnitude map. The number of pixels with gradient magnitudes greater than the corresponding edge gradient boundary values is counted, and the proportion of this number of pixels to the total number of pixels is calculated to obtain the structure edge preservation ratio sequence.
[0091] Two-dimensional discrete Laplacian operator operation is performed on the brightness channel of each image enhancement result to obtain a brightness change map, and the local variance distribution of the brightness change map is calculated. The illumination continuity sequence is obtained by averaging the local variance of each grid region.
[0092] Low-pass filtering is performed on the brightness channels of each image enhancement result to obtain a smooth brightness map, and the difference map between the original brightness channel and the smooth brightness map is calculated. The texture interference intensity sequence is obtained by statistically analyzing the mean square energy of the difference map.
[0093] The structural edge proportions, illumination continuity, and texture interference intensity are normalized and then constructed in sequence to enhance the feature vector sequence.
[0094] The enhanced feature vector sequence is constructed into a state sequence according to the order of the coverage of each second edge space, and the Euclidean distance between the feature vectors of adjacent states is calculated. A state transition probability matrix is established according to the magnitude of the Euclidean distance.
[0095] The steady-state probability solution operation is performed on the state transition probability matrix, and the stable probability value of each state is calculated. The stable probability value of each state is weighted and combined with the corresponding structural edge preservation ratio and illumination continuity to obtain the guide image scoring sequence corresponding to each second edge spatial coverage.
[0096] In this embodiment, the brightness channel is the grayscale information channel extracted from the image enhancement results corresponding to each second edge space coverage. This channel reflects the image brightness distribution and is the basis for subsequent gradient, variance and filtering operations, used to characterize the image structure and illumination characteristics.
[0097] In this embodiment, the structural edge preservation ratio sequence is a sequence formed by statistically analyzing the proportion of pixels with gradient magnitudes greater than the corresponding edge gradient boundary values to the total number of pixels after obtaining the gradient magnitude map by performing two-dimensional gradient operations on the brightness channel. This sequence is used to quantify the structural edge preservation of the image under different edge coverage rates.
[0098] In this embodiment, the illumination continuity sequence is a sequence formed by performing a two-dimensional discrete Laplacian operator operation on the brightness channel to obtain a brightness variation map, and then averaging the local variance of each grid region. This sequence reflects the spatial smoothness and continuity of the image's illumination and is used to evaluate the illumination component estimation effect.
[0099] In this embodiment, the texture interference intensity sequence is a sequence formed by obtaining a smoothed brightness map by low-pass filtering the brightness channel and calculating the mean square energy of the difference map between the original brightness channel and the smoothed brightness map. This sequence is used to measure the degree of interference of image texture or noise on illumination estimation.
[0100] In this embodiment, the enhanced feature vector sequence is a vector sequence formed by combining the normalized sequences of structural edge preservation ratio, illumination continuity, and texture interference intensity in sequence. This sequence is used to construct the Markov state sequence to quantify the overall quality features of image enhancement under different second edge space coverage.
[0101] In this embodiment, the guided image scoring sequence is obtained by constructing the enhanced feature vector sequence into a state sequence, calculating the Euclidean distance between adjacent states to establish a state transition probability matrix, solving for the steady-state probability, and weighting the steady-state probability value with the corresponding structural edge preservation ratio and illumination continuity. This scoring sequence is used to evaluate the image enhancement effect corresponding to each second edge spatial coverage and guide the selection of the optimal edge spatial coverage.
[0102] It should be noted that by combining three features—structure edge preservation ratio, illumination continuity, and texture interference intensity—this embodiment can comprehensively evaluate the image enhancement effect, quantify the quality of illumination component estimation and the degree of detail preservation, and provide a reliable basis for selecting the optimal edge space coverage.
[0103] It should be noted that this embodiment can be further extended to a multi-feature weighted or adaptive feature selection strategy, that is, to assign different weights to structural, lighting and texture features according to different scenes or image content, thereby improving the robustness and accuracy of guided image scoring under complex low-light conditions.
[0104] S6. Determine the second edge space coverage corresponding to the maximum score based on the distribution of the guide image score along the second edge space coverage, and apply the control quantity corresponding to the coverage to the guide image construction to complete the image enhancement process.
[0105] In this embodiment, the step of determining the second edge space coverage corresponding to the maximum score based on the distribution of the guide image score along the second edge space coverage variation, and applying the control quantity corresponding to this coverage to the guide image construction to complete the image enhancement processing, specifically involves:
[0106] Obtain the guide image scoring sequence corresponding to the second edge space coverage sequence, and establish a one-to-one scoring distribution sequence according to the numerical value of the second edge space coverage;
[0107] Perform a one-dimensional Gaussian smoothing operation on the rating distribution sequence, and then perform a weighted average of adjacent rating values to obtain a smoothed rating sequence;
[0108] The smoothed scoring sequence is subjected to a first-order difference operation to obtain a scoring change gradient sequence, and a sign change detection is performed on the scoring change gradient sequence to determine a candidate set of local maxima at the position where the gradient changes from a positive value to a negative value.
[0109] Read the corresponding score value from the candidate set of local maxima, compare the score values, and select the local maximum with the largest score value as the optimal score position.
[0110] Read the second edge space coverage corresponding to the optimal scoring position, and determine the second edge space coverage as the optimal edge space coverage;
[0111] Retrieve the edge gradient boundary value corresponding to the optimal edge space coverage and the structure preservation window scale, and regenerate the structure edge mask map based on the edge gradient boundary value;
[0112] Using the structural edge mask as a structural constraint and the corresponding structural window size as the radius of the guided filtering window, the guided filtering operation is re-executed on the brightness channel of the image to be enhanced to obtain the illumination component.
[0113] Based on Retinex theory, logarithmic difference operations are performed on the luminance channel and the illumination component to extract the reflection component, and luminance dynamic range adjustment operations are performed on the illumination component.
[0114] The adjusted illumination component and the reflection component are subjected to an exponential reconstruction operation to obtain the final image enhancement result.
[0115] In this embodiment, the score distribution sequence is a sequence formed by arranging the guide image scores corresponding to each second edge space coverage rate in order of coverage rate value. This sequence is used to reflect the changing trend of image enhancement effect under different coverage rates and to provide basic data for subsequent selection of the optimal coverage rate.
[0116] In this embodiment, the smoothed score sequence is the sequence obtained by performing a one-dimensional Gaussian smoothing operation on the score distribution sequence. By weighting adjacent score values, noise fluctuations are reduced and the overall trend is highlighted, which is used to accurately locate local maxima in the score.
[0117] In this embodiment, the score change gradient sequence is a sequence obtained by performing a first-order difference operation on the smoothed score sequence. It is used to characterize the rate of increase or decrease of the score as the coverage of the second edge space changes, and to determine the candidate set of local maxima by detecting changes in the gradient sign.
[0118] In this embodiment, the optimal scoring position is the point with the largest score value selected from the candidate set of local maxima. The corresponding second edge space coverage is the optimal edge space coverage, which is used to guide the final guided image construction and ensure the best image enhancement effect.
[0119] In this embodiment, the structural edge mask is a mask regenerated based on the edge gradient boundary value corresponding to the optimal edge space coverage. It is used to maintain the image structure information during the guided filtering process and to perform smoothing processing in non-structured areas, thereby constructing a guided image that reflects the distribution of scene structure.
[0120] In this embodiment, the final image enhancement result is the enhanced image obtained by constructing a guide image based on the optimal edge space coverage and completing guide filtering, illumination component adjustment and reflection component extraction. This image has uniform brightness, clear structure and sufficient detail retention under low illumination conditions.
[0121] It should be noted that by selecting the second edge space coverage corresponding to the maximum score, this embodiment achieves balanced control of structure and illumination during image enhancement, enabling the image to achieve optimal results between detail preservation and illumination smoothing.
[0122] It should be noted that this embodiment can also be extended to dynamic scene adaptation, that is, the scoring sequence is updated in real time according to different time frames or environmental changes, and the corresponding optimal edge space coverage is selected, so as to maintain the stability and consistency of the enhanced image in continuous monitoring scenarios.
[0123] Example 2: The present invention also includes an adaptive processing system for image enhancement, comprising an edge coverage extraction module, a coverage interval generation module, a gradient coverage mapping module, a guided filtering enhancement module, an enhancement feature evaluation module, and an optimal coverage decision module.
[0124] The edge coverage extraction module is used to perform grid statistics on the spatial distribution of structural edges in historical enhanced images under standard low-light monitoring sample conditions, and to filter the effective structural edge grid ratio based on the continuity of the target contour, and extract the stable center value as the first edge spatial coverage.
[0125] The coverage interval generation module is used to construct a coverage expansion interval centered on the first edge space coverage rate and perform equidistant segmentation to generate several second edge space coverage rates.
[0126] The gradient coverage mapping module is used to perform edge detection on the image to be enhanced and calculate the edge gradient magnitude. It sorts the gradients and accumulates the statistical coverage ratios in the image grid space to form a gradient cumulative coverage sequence. Based on this sequence, the coverage rate of each second edge space is converted into the corresponding edge gradient boundary value and the structure preservation window scale.
[0127] The guided filtering enhancement module is used to apply the control quantities corresponding to the coverage of each second edge space to guide image construction, estimate the illumination component based on the guided filter, and separate the reflection component according to the Retinex theory to complete image enhancement;
[0128] The enhanced feature evaluation module is used to extract features from the image enhancement results corresponding to each second edge space coverage and calculate the guide image score based on the Markov state transition method.
[0129] The optimal coverage decision module is used to determine the coverage of the second edge space corresponding to the maximum score based on the distribution of the coverage variation along the second edge space of the guide image score, and apply the control quantity corresponding to the coverage to the guide image construction to complete the image enhancement process.
[0130] The present invention also includes an electronic device, the electronic device comprising:
[0131] At least one processor;
[0132] And, a memory communicatively connected to the at least one processor;
[0133] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform an adaptive processing method for image enhancement.
[0134] The present invention also includes a computer-readable storage medium storing a computer program that, when executed by a processor, implements an adaptive processing method for image enhancement.
[0135] In the embodiments provided by this invention, it should be understood that the disclosed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.
[0136] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0137] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.
[0138] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0139] Those skilled in the art will understand that all or part of the processes in the methods of 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. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0140] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.
[0141] In the embodiments provided in this disclosure, it should be understood that the disclosed systems and methods can also be implemented in other ways. The system embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0142] It should be noted that, in this disclosure, 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 a process, method, article, or apparatus. Without further limitation, an element limited by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0143] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for adaptive processing of image enhancement, characterized in that, Includes the following steps: Under standard low-light monitoring sample conditions, grid statistics were performed on the spatial distribution of structural edges in historical enhanced images, and the proportion of effective structural edge grids was screened based on the continuity of the target contour. The stable center value was extracted as the first edge spatial coverage. Construct a coverage expansion interval centered on the first edge space coverage rate and perform equidistant segmentation to generate several second edge space coverage rates; Edge detection is performed on the image to be enhanced, and the edge gradient magnitude is calculated. The gradient is sorted and the cumulative statistical coverage ratio is accumulated in the image grid space to form a gradient cumulative coverage sequence. The coverage rate of each second edge space is converted into a corresponding control quantity according to the gradient cumulative coverage sequence. The control quantity includes the edge gradient boundary value and the structure preservation window scale. The control values corresponding to the coverage of each second edge space are applied to guide image construction, and the illumination components are estimated based on the guided filter. The reflection components are separated according to the Retinex theory to complete image enhancement. Feature extraction is performed on the image enhancement results corresponding to each second edge space coverage, and a guide image score is calculated based on the Markov state transition method. The second edge space coverage corresponding to the maximum score is determined based on the distribution of the score change along the second edge space coverage of the guide image, and the control value corresponding to the second edge space coverage of the maximum score is applied to the guide image construction to complete the image enhancement process.
2. The adaptive processing method for image enhancement according to claim 1, characterized in that, Under standard low-light monitoring sample conditions, the spatial distribution of structural edges in historical enhanced images is statistically analyzed using a grid. Based on the continuity of the target contour, the proportion of effective structural edge grids is selected, and the stable center value is extracted as the first edge spatial coverage rate. Specifically: Standard low-light surveillance video sequences are acquired, and image frames are extracted from the video sequences at fixed time intervals to form an original sample image set. Image enhancement processing based on Retinex theory is performed on each image in the original sample image set to obtain a historical enhanced image set. The brightness channel is extracted from each enhanced image in the historical enhanced image set, and the gradient magnitude map and gradient direction map are obtained by calculating the two-dimensional gradient vector field of the brightness channel. The non-maximum suppression method is used in the gradient magnitude map to preserve the location of the local maximum gradient response, thus obtaining the set of structural edge pixels. Each enhanced image is divided into a fixed-size two-dimensional grid region, and the number and distribution of structural edge pixels in each grid region are counted. A structural edge grid distribution map is constructed based on the spatial coordinates of the edge pixels in the grid. In the structural edge grid distribution map, grid adjacency relationships are established with grids as nodes, and the structural orientation consistency between adjacent grids is calculated based on the cosine similarity of the gradient direction of edge pixels at the grid center. Adjacent grids with orientation consistency higher than the average similarity are connected to form an edge grid connectivity graph. In the edge mesh connected graph, all connected subgraphs are traversed, and the path length and directional stability of the grid nodes in each connected subgraph are calculated. The directional stability is obtained by statistically analyzing the variance of the gradient direction distribution within the subgraph. Connected subgraphs with a path length greater than the average path length of all subgraphs and a directional stability less than the overall variance mean are selected as the edge mesh set corresponding to the continuous target contour path. The proportion of the edge grid set in each enhanced image to all grids is statistically analyzed to obtain the corresponding structural edge grid proportion sequence; Sort the sequence of grid proportions at the structural edge and calculate the median. Use the median as the first edge space coverage.
3. The adaptive processing method for image enhancement according to claim 2, characterized in that, The process of constructing a coverage expansion interval centered on the first edge space coverage rate and dividing it into equidistant segments to generate several second edge space coverage rates is as follows: Establish a coverage reference coordinate system with the first edge space coverage rate as the center value; Discrete frequency domain analysis is performed on the structural edge grid proportion sequence corresponding to the historical enhanced image set. Discrete Fourier transform is performed on the structural edge grid proportion sequence to obtain the frequency domain amplitude sequence. The main frequency band of coverage change is determined based on the energy concentration segment in the frequency domain amplitude sequence. Based on the frequency amplitude corresponding to the main frequency band, the stable fluctuation amplitude of the coverage change is obtained, and the stable fluctuation amplitude is used as the coverage expansion range to establish a symmetrical coverage expansion interval on both sides of the first edge space coverage. Within the coverage expansion interval, the coverage is linearly sampled at fixed intervals to form several discrete coverage sampling points; The discrete coverage sampling points are sorted according to their numerical values to form a second edge space coverage sequence, which is then used as the edge space coverage set to be screened in the subsequent image enhancement process.
4. The adaptive processing method for image enhancement according to claim 3, characterized in that, The process involves edge detection of the image to be enhanced, calculation of edge gradient magnitudes, sorting by gradient, and accumulating statistical coverage ratios in the image grid space to form a gradient cumulative coverage sequence. Based on this gradient cumulative coverage sequence, the coverage rate of each second edge space is converted into a corresponding control variable. This control variable includes an edge gradient boundary value and a structure-preserving window scale. Specifically: Obtain the brightness channel of the image to be enhanced, perform two-dimensional gradient operation on the brightness channel to obtain the gradient magnitude map and gradient direction map, and use non-maximum suppression to retain the local maximum gradient response position in the gradient magnitude map to obtain the edge pixel set; The gradient magnitude of each pixel in the edge pixel set is read and sorted in descending order of gradient magnitude to form an edge gradient sorting sequence. The image to be enhanced is divided into a fixed-size two-dimensional grid region, and the edge pixels in the edge gradient sorting sequence are mapped to the corresponding grid cells according to their spatial coordinates. The number of grids covered by the edge pixels that have appeared is accumulated and counted in the edge gradient sorting sequence in order, and the proportion of the number of grids to the total number of grids is calculated to form a gradient accumulation coverage sequence. The gradient cumulative coverage sequence is matched with the second edge space coverage sequence. For each second edge space coverage, the closest coverage ratio position is searched in the gradient cumulative coverage sequence, and the gradient magnitude corresponding to the closest coverage ratio position is read as the edge gradient boundary value. After obtaining the edge gradient boundary value corresponding to each second edge spatial coverage, the spatial distribution of edge pixels above the edge gradient boundary value is statistically analyzed, and the average edge spacing is calculated. The corresponding structure preservation window scale is determined based on the average edge spacing, thereby obtaining the structure preservation window scale corresponding to each second edge spatial coverage.
5. The adaptive processing method for image enhancement according to claim 4, characterized in that, The process involves applying the control values corresponding to the spatial coverage of each second edge to the guided image construction, estimating the illumination component based on the guided filter, and separating the reflection component according to Retinex theory to complete image enhancement. Specifically: Obtain the brightness channel of the image to be enhanced, as well as the edge gradient boundary value and structure preservation window scale corresponding to each second edge spatial coverage; For each set of edge gradient boundary values corresponding to the second edge space coverage, pixels with gradient magnitudes greater than the edge gradient boundary value are selected as structural edge pixels in the gradient magnitude map, and a structural edge mask map is generated based on the pixel space coordinates. Using the structural edge mask as a constraint, edge-preserving smoothing processing is performed on the brightness channel of the image to be enhanced to construct a guide image. The original gradient structure is preserved at the corresponding position of the structural edge mask, and a smooth region is generated in the non-structural region through local mean filtering, thereby obtaining a guide image that reflects the distribution of scene structure. Using the guiding image as a guiding constraint and the corresponding structure-preserving window scale as the filtering window radius, a guided filtering operation is performed on the brightness channel of the image to be enhanced to obtain a smooth brightness map. This smooth brightness map is then determined as the illumination component estimation result of the image. The relationship between the luminance channel, illumination component and reflection component is established based on Retinex theory. The reflection component is extracted by performing a pixel-by-pixel logarithmic difference operation on the luminance channel and illumination component. A brightness dynamic range adjustment operation is performed on the illumination component to obtain an enhanced illumination component, and an exponential reconstruction operation is performed on the enhanced illumination component and the reflection component to obtain the image enhancement result under the corresponding second edge space coverage.
6. The adaptive processing method for image enhancement according to claim 5, characterized in that, The process of extracting features from the image enhancement results corresponding to each second edge space coverage rate and calculating the guided image score based on the Markov state transition method is as follows: Extract the brightness channel of the image enhancement result corresponding to each second edge spatial coverage; Two-dimensional gradient operations are performed on the brightness channels of each image enhancement result to obtain a gradient magnitude map. The number of pixels with gradient magnitudes greater than the corresponding edge gradient boundary values is counted, and the proportion of this number of pixels to the total number of pixels is calculated to obtain the structure edge preservation ratio sequence. Two-dimensional discrete Laplacian operator operation is performed on the brightness channel of each image enhancement result to obtain a brightness change map, and the local variance distribution of the brightness change map is calculated. The illumination continuity sequence is obtained by averaging the local variance of each grid region. Low-pass filtering is performed on the brightness channels of each image enhancement result to obtain a smooth brightness map, and the difference map between the original brightness channel and the smooth brightness map is calculated. The texture interference intensity sequence is obtained by statistically analyzing the mean square energy of the difference map. The structural edge proportions, illumination continuity, and texture interference intensity are normalized and then constructed in sequence to enhance the feature vector sequence. The enhanced feature vector sequence is constructed into a state sequence according to the order of the coverage of each second edge space, and the Euclidean distance between the feature vectors of adjacent states is calculated. A state transition probability matrix is established according to the magnitude of the Euclidean distance. The steady-state probability solution operation is performed on the state transition probability matrix, and the stable probability value of each state is calculated. The stable probability value of each state is weighted and combined with the corresponding structural edge preservation ratio and illumination continuity to obtain the guide image scoring sequence corresponding to each second edge spatial coverage.
7. The adaptive processing method for image enhancement according to claim 6, characterized in that, The process involves determining the second edge space coverage corresponding to the maximum score based on the distribution of the guide image score along the second edge space coverage, and then applying the control variable corresponding to the second edge space coverage corresponding to the maximum score to the guide image construction to complete the image enhancement processing. Specifically: Obtain the guide image scoring sequence corresponding to the second edge space coverage sequence, and establish a one-to-one scoring distribution sequence according to the numerical value of the second edge space coverage; Perform a one-dimensional Gaussian smoothing operation on the rating distribution sequence, and then perform a weighted average of adjacent rating values to obtain a smoothed rating sequence; The smoothed scoring sequence is subjected to a first-order difference operation to obtain a scoring change gradient sequence, and a sign change detection is performed on the scoring change gradient sequence to determine a candidate set of local maxima at the position where the gradient changes from a positive value to a negative value. Read the corresponding score value from the candidate set of local maxima, compare the score values, and select the local maximum with the largest score value as the optimal score position. Read the second edge space coverage corresponding to the optimal scoring position, and determine the second edge space coverage as the optimal edge space coverage; Retrieve the edge gradient boundary value corresponding to the optimal edge space coverage and the structure preservation window scale, and regenerate the structure edge mask map based on the edge gradient boundary value; Using the structural edge mask as a structural constraint and the corresponding structural window size as the radius of the guided filtering window, the guided filtering operation is re-executed on the brightness channel of the image to be enhanced to obtain the illumination component. Based on Retinex theory, logarithmic difference operations are performed on the luminance channel and the illumination component to extract the reflection component, and luminance dynamic range adjustment operations are performed on the illumination component. The adjusted illumination component and the reflection component are subjected to an exponential reconstruction operation to obtain the final image enhancement result.
8. A system for image enhancement using the adaptive processing method according to any one of claims 1 to 7, characterized in that, It includes an edge coverage extraction module, a coverage interval generation module, a gradient coverage mapping module, a guided filtering enhancement module, an enhanced feature evaluation module, and an optimal coverage decision module. The edge coverage extraction module is used to perform grid statistics on the spatial distribution of structural edges in historical enhanced images under standard low-light monitoring sample conditions, and to filter the effective structural edge grid ratio based on the continuity of the target contour, and extract the stable center value as the first edge spatial coverage. The coverage interval generation module is used to construct a coverage expansion interval centered on the first edge space coverage rate and perform equidistant segmentation to generate several second edge space coverage rates. The gradient coverage mapping module is used to perform edge detection on the image to be enhanced and calculate the edge gradient magnitude. It sorts the gradients and accumulates the statistical coverage ratios in the image grid space to form a gradient cumulative coverage sequence. Based on the gradient cumulative coverage sequence, it converts the coverage rate of each second edge space into a corresponding control quantity. The control quantity includes the edge gradient boundary value and the structure preservation window scale. The guided filtering enhancement module is used to apply the control quantities corresponding to the coverage of each second edge space to guide image construction, estimate the illumination component based on the guided filter, and separate the reflection component according to the Retinex theory to complete image enhancement; The enhanced feature evaluation module is used to extract features from the image enhancement results corresponding to each second edge space coverage and calculate the guide image score based on the Markov state transition method. The optimal coverage decision module is used to determine the coverage of the second edge space corresponding to the maximum score based on the distribution of the coverage change along the second edge space of the guide image score, and apply the control quantity corresponding to the coverage of the second edge space corresponding to the maximum score to the guide image construction to complete the image enhancement processing.
9. An electronic device, comprising: The electronic device includes: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the adaptive processing method for image enhancement as described in any one of claims 1 to 7.
10. A computer readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the adaptive processing method for image enhancement as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Image super-resolution edge reconstruction method and system based on morphology and coverage rate perception
CN121563771A
Image enhancement method for brightness gain self-adaptive regulation and control under low illumination
CN121582126A