Sparse gradient enhanced edge preserving image smoothing method
By introducing structural fidelity terms and sparse gradient enhancement terms into the global optimization model, combining mapping functions and bilateral filtering, and using L2 and L1 norm constraints, the semantic information destruction and threshold division limitations in the image smoothing process in the existing technology are solved. problem, achieving sparse smoothing and robustness improvement for complex images.
Patent Information
- Application Number
- CN202410958794.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-07-17
AI Technical Summary
Existing global optimization algorithms are difficult to effectively retain semantic information during the image smoothing process, especially when processing complex images, which easily destroy structural information, and rely on thresholds to distinguish textures and structures. There are limitations, resulting in under-smoothing or over-smoothing.
A global optimization model consisting of data fidelity terms, structure fidelity terms and sparse gradient enhancement terms is proposed. It is preprocessed by combining mapping functions with bilateral filtering to compress fine texture information, and uses L2 and L1 norms to constrain the output image. Gradient, iterative solution is performed by combining the subgradient method and fast Fourier transform, and the Lp norm is converted to the L1 norm to achieve sparse smoothing.
While maintaining the semantic information of the image, it achieves sparse smoothing effects on simple and complex images, improves the robustness and computational efficiency of the filter, avoids the limitations of threshold division, and can effectively process texture and non-texture images.
Smart Images

Figure BDA0004949688610000031 
Figure BDA0004949688610000051 
Figure BDA0004949688610000052
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing, and in particular to an edge-preserving image smoothing method for sparse gradient enhancement. Background Art
[0002] Edge-preserving smoothing algorithm is a crucial image preprocessing technology. Its main goal is to smooth noise and unnecessary details during image processing while maintaining important contours and significant structural features in the image. The essence of image smoothing is to decompose an image into a base layer and a detail layer. The base layer reflects the structural information of the image, while the detail layer contains the texture information of the image. Further operations and recombination of the base layer and the detail layer can be widely used in image edge extraction, image detail enhancement, image denoising, HDR (High Dynamic Range) tone mapping, guided depth map upsampling, grayscale image colorization and other fields.
[0003] Existing edge-preserving smoothing algorithms can be divided into three categories: weighted average-based smoothing algorithms, global optimization-based smoothing algorithms, and deep learning-based smoothing algorithms. Weighted average-based smoothing algorithms use well-defined filter kernels for edge-preserving smoothing. This type of algorithm achieves smoothing by weighted averaging pixel values in a local window. Global optimization-based smoothing algorithms achieve edge-preserving smoothing by designing fidelity terms and penalty terms. In this type of algorithm, the data term (fidelity term) usually remains unchanged, and the relationship between the output image and the input image is constrained by the L2 norm to avoid image distortion. The penalty term introduces various norms to penalize the gradient of the image to achieve image smoothing. Deep learning-based image smoothing algorithms learn traditional filters by adopting different network architectures.
[0004] Smoothing algorithms based on global optimization usually first establish a global optimization model, then solve the model to obtain the optimal solution, and finally generate an output image. Existing global optimization models usually include two important components: data term (fidelity term) and penalty term (regularization term). Among them, weighted least squares filtering (WLS) is a classic method based on global optimization algorithm. However, since this method involves solving a large linear system, it consumes a lot of time. In order to improve the computational efficiency of WLS, Min et al. proposed a fast global filter (FGS) based on weighted least squares. This method approximates the solution of dense linear systems by solving a series of one-dimensional subproblems, thereby accelerating the original weighted least squares filtering algorithm. However, since only one-dimensional information is considered, this may cause blocky phenomena in the filtering results. Therefore, the semi-global weighted least squares filtering algorithm (SG-WLS) proposed by Liu et al. incorporates certain two-dimensional neighbor information while retaining the neighbor information in the one-dimensional direction. In order to obtain sparse smoothing results, Bi et al. proposed an edge-preserving smoothing algorithm based on L1 norm image transformation, which penalizes the image gradient using L1 norm. Yang et al. proposed the L1 gradient reconstruction model (L1-R), which uses a mapping function to suppress texture information, and then outputs the relationship between the image gradient and the image gradient after mapping function preprocessing through the L1 norm constraint, thereby achieving image smoothing. Xu et al. proposed a filter based on L0 norm gradient minimization, which controls the number of non-zero gradients to achieve sharpening of the main edges and smoothing of detail information. Xu et al. proposed a relative total variation filter (RTV) for texture images, which is also a classic algorithm in global optimization algorithms and aims to extract structural information from textures. Based on the idea of RTV, in recent years, He et al. proposed a scale-aware bilateral total variation structure-preserving texture filter (BTV), which effectively quantifies texture and structural features by forming a bilateral total variation regularization term. Li et al. proposed an enhanced relative total variation edge-preserving smoothing algorithm (ERTVBF) embedded in bilateral filtering, which can simultaneously retain significant edge information and weak structural information of interest. The edge-preserving smoothing algorithm based on global optimization needs to find the optimal solution in the global range, so it takes a lot of time compared to the weighted average smoothing algorithm. In addition, such algorithms are usually designed with only texture images or natural non-texture images in mind, which results in a lack of robustness.
[0005] In daily life, the images we see can be divided into texture images and non-texture images. Furthermore, images can be divided into simple images and complex images according to the strength of the detail information and structural information they contain. Simple images contain only weak texture information while containing significant structural information, and the two are clearly distinguishable in visual effects. In complex images, weak structures and strong structures coexist, and are difficult to distinguish visually. Existing global optimization algorithms usually only achieve data fidelity of images through data items (fidelity items), which may destroy the semantic information in the image. Summary of the invention
[0006] Existing global optimization models usually consist of data fidelity terms and regularization terms. The data fidelity term aims to ensure that the smoothed image u is similar to the input image g and usually remains unchanged during the design of many models. The regularization term achieves a smoothing effect by applying various norm constraints to the gradient of the output image. The general optimization framework is as follows:
[0007]
[0008] Among them, Φ(·) represents different penalties for the output image u, and λ is used to adjust the relationship between the data fidelity term and the regularization term. Experiments and analysis show that the existing global optimization methods cannot well preserve the semantic information of the image by only designing the data fidelity term. This is because different input images contain texture information and structural information of different complexity, which may cause the structural information of the image to be destroyed.
[0009] In the existing methods, the least squares filtering algorithm embedded with bilateral filtering and the L1 gradient reconstruction model process the input image gradient through different preprocessing operations to achieve structure preservation. They respectively constrain the relationship between the output image gradient and the preprocessed image gradient through the L2 norm and L1 norm to achieve image smoothing. However, since they directly use the preprocessed image gradient for the regularization term and penalize the output image gradient, it is necessary to trade off between the smoothing quality and edge preservation performance. The least squares filtering algorithm embedded with bilateral filtering performs well in structure preservation and improves the efficiency of the original weighted least squares filtering algorithm. However, this algorithm directly preprocesses the input image gradient with bilateral filtering and uses the L2 norm to constrain the similarity between the output image gradient and the preprocessed image gradient. This method is prone to under-smoothing when processing complex non-texture images, and cannot effectively remove the texture information of the image when processing texture images.
[0010] In comparison, the L1 gradient reconstruction model also preprocesses the input image gradient first. However, the difference is that the L1 gradient reconstruction model distinguishes between structural information and texture information through a mapping function, that is, it determines whether the gradient of the input image belongs to texture or structure by artificially setting a threshold. If the input image gradient is judged to be texture, the texture is suppressed to make its gradient smaller; if the input image gradient is judged to be structure, the structural information is kept unchanged. Subsequently, the L1 norm is used to constrain the relationship between the output image and the image gradient after preprocessing by the mapping function, so as to achieve a smoothing effect. However, today's images are rich and diverse, and there are certain limitations in using thresholds to distinguish between texture information and structural information. This is because this method is highly dependent on the selection of thresholds. If the selection is inappropriate, it is easy to mistakenly divide structural information into texture information, resulting in the destruction of structural information; or mistakenly divide texture information into structural information, retaining unnecessary details, resulting in undersmoothing. In addition, the model uses the L1 norm for constraints. Due to the sparsity of the L1 norm, whether the threshold selection is appropriate further affects the image smoothing effect. Figure 2 The comparison of the effects of different gradient preprocessing methods on simple and complex non-texture images is shown in the figure. It can be seen from the figure that compared with L1-R (edge-preserving filter model of L1 gradient reconstruction), the structure fidelity term and BLF-LS (least squares edge-preserving image smoothing embedded in bilateral filter) proposed in the present invention can both retain the complete structure of the image, but the present invention performs better in removing tiny textures.
[0011] The inventors of the present application have discovered through research that the above-mentioned method, when combining structure preservation with gradient penalty, will lead to destruction of the image structure or the appearance of under-smoothing. To address the above-mentioned technical problems, the present invention proposes a global optimization model consisting of a data fidelity term, a structure fidelity term and a sparse gradient enhancement term, which can not only retain complete semantic information, but also exhibit a sparse smoothing effect when processing both simple and complex non-texture images.
[0012] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:
[0013] A sparse gradient enhanced edge-preserving image smoothing method comprises the following steps:
[0014] S1. A structural fidelity term is introduced based on the existing global optimization model including a data fidelity term. In the structural fidelity term, the gradient of the input image is preprocessed by combining a mapping function with a bilateral filter. First, the pixel value of the input image is normalized from 0 to 255 to 0 to 1, and a threshold is set to compress the subtle texture information in the image. There is no need to distinguish whether the gradient of the input image belongs to texture or structure, so as to complete the mapping function processing. The formula of the mapping function is as follows:
[0015]
[0016] Where sign(·) is the sign function, h is the input image gradient, σ is the threshold, and α is the degree of compression;
[0017] Then, the image gradient processed by the mapping function is processed by bilateral filtering, so that the output image gradient only retains significant structural information. Finally, the relationship between the output image gradient and the image gradient preprocessed by the mapping function and bilateral filtering is constrained by the L2 norm, so as to achieve the structural fidelity of the image and better retain the complete semantic information of the image.
[0018] S2. Based on the structural fidelity term, a sparse gradient enhancement term is introduced. In the sparse gradient enhancement term, the L2 norm and L1 norm are used to constrain the output image gradient to enhance sparsity. The L1 norm is iteratively solved by combining the subgradient method, fast Fourier transform and alternating direction multiplier method, thereby effectively achieving edge-preserving image smoothing; or,
[0019] Using L p The norm constrains the output image gradient, where 0<p≤1 or p=2. When p=1 or p=2, L p norm is a convex optimization problem, and when 0<p<1, L p The norm is a non-convex optimization problem. In order to effectively solve L when 0<p<1 p norm problem, through the iterative reweighting method, L p The norm is converted to the L1 norm for solution, that is, the non-convex optimization problem is converted into a convex optimization problem for solution, and the preconditioned conjugate gradient method is used in the solution process to improve the computational efficiency.
[0020] Furthermore, in step S1, the threshold σ for compressing the fine texture information in the image is set to 0.05-0.3, and the compression degree α is set to 2-3.
[0021] Furthermore, in step S2, when 0<p<1, L p The process of solving the norm is as follows:
[0022] Given an input image g, the output image u is obtained by the following optimization formula:
[0023]
[0024] Among them, λ and γ are balance weights used to adjust the trade-off between data fidelity, structural fidelity, and sparse gradient enhancement; Represents L pnorm; c(·) is the gradient compression function; f BLF (·) is for bilateral filtering; Indicates differential; x, y indicates the x direction and y direction of the image;
[0025] In the above optimization formula Rewrite it as follows:
[0026]
[0027] Rewrite the above formula into matrix form as follows:
[0028]
[0029] Among them, Diag(w * ) is a diagonal matrix, D x and D y are the difference matrices in the x-direction and y-direction respectively, then the above optimization formula can be rewritten as follows:
[0030]
[0031] When solving the minimization subproblem of the filtered output image u, the preconditioned conjugate gradient method is used to solve the following equation:
[0032]
[0033] Where ρ is the Lagrange penalty coefficient, and ρ>0; k is the kth iteration;
[0034] make η x and η y is a dual variable;
[0035] Z x and Z y The minimization subproblem is solved and expressed as follows using the shrink operator:
[0036]
[0037] Right x and d y The solution to the dual problem is as follows:
[0038]
[0039] Compared with the prior art, the sparse gradient enhanced edge-preserving image smoothing method provided by the present invention has the following advantages:
[0040] 1. The present invention provides a new global optimization model framework, which can effectively smooth texture images and non-texture images, as well as simple images and complex images while preserving edges, making the filter more robust.
[0041] 2. The present invention not only considers the data fidelity of the image, but also considers the structural fidelity of the image, and retains the strong structure and weak structure information of the image.
[0042] 3. By introducing the structural fidelity term, the fine texture information is suppressed to a certain extent, and the problem of relying on thresholds to divide textures and structures can be avoided.
[0043] 4. By introducing sparse gradient enhancement items, it is easier to process low-frequency signals during image smoothing and achieve a sparse smoothing effect.
[0044] 5. The present invention adopts L p The norm constraint outputs the gradient, and L p The norm is converted to L1 norm for solving to obtain a sparser smoothing effect. When p = 1, the fast Fourier transform (FFT) is used to convert the spatial domain to the frequency domain for calculation; when 0 < p < 1, the preconditioned conjugate gradient (PCG) method is used to accelerate matrix operations, thereby improving computational efficiency. Figure 3 In the paper, the smoothing effect of different filters on simple and complex non-texture image gradients after preprocessing is shown. Figure 3 The smoothing result is Figure 2 The parameters of the gradient preprocessing remain consistent. By observing the smoothed results, it can be seen that BLF-LS shows a good smoothing effect when processing simple non-texture images, but when dealing with complex non-texture images, the lawn appears to be less smooth. In contrast, L1-R can produce a sparse smoothing effect, but because L1-R destroys certain structural information when preprocessing the input image gradient, the smoothed image becomes somewhat blurred. Compared with the above two filters, the algorithm proposed in the present invention can not only retain complete semantic information, but also show a sparse smoothing effect when processing simple and complex non-texture images and texture images. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 This is a qualitative analysis comparison diagram of the present invention and other classical filters on noisy images.
[0046] Figure 2 This is a comparison chart of the effects of the present invention and other filter different gradient preprocessing methods on simple images and complex non-texture images.
[0047] Figure 3This is a comparison chart of the smoothing effects of the present invention and other filters after gradient preprocessing of simple and complex non-texture images.
[0048] Figure 4 It is a comparison diagram of the influence of different λ and γ values on the smoothing effect of a two-dimensional image when the sparse gradient enhancement term of the present invention adopts the L1 norm constraint.
[0049] Figure 5 It is a comparison diagram of the smoothing effect of the sparse gradient enhancement term of the present invention using different regular constraints.
[0050] Figure 6 This is a comparison diagram of the smoothing results of the present invention and other filters on non-texture images.
[0051] Figure 7 This is a comparison chart of the visual effects of the present invention and various filters on the NKS data set.
[0052] Figure 8 This is a comparison diagram of the smoothing results of the present invention and the texture filter on a simple texture image.
[0053] Fig. 9 This is a comparison diagram of the smoothing results of the present invention and the texture filter on a complex texture image.
[0054] Fig.10 This is a comparison diagram of the visual effects of the present invention and various filters in image detail enhancement.
[0055] Fig.11 This is a comparison diagram of the visual effects of the present invention and various filters in edge extraction.
[0056] Fig.12 This is a comparison chart of the visual effects of the present invention and various filters in HDR tone mapping.
[0057] Fig.13 This is a comparison chart of the visual effects of the present invention and various filters in removing clip art compression artifacts.
[0058] Fig.14 This is a comparison diagram of the abstract visual effects of the present invention and various filters on images. DETAILED DESCRIPTION
[0059] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further described below with reference to specific diagrams.
[0060] Compared with the existing global optimization model, the global optimization model constructed by the present invention consists of three parts, namely, data fidelity term, structural fidelity term and sparse gradient enhancement term. The present invention can not only retain complete semantic information, but also show sparse smoothing effect when processing simple and complex non-texture images. To achieve the above purpose, the present invention provides the following technical solutions:
[0061] A sparse gradient enhanced edge-preserving image smoothing method comprises the following steps:
[0062] S1. A structural fidelity term is introduced based on the existing global optimization model including a data fidelity term. In the structural fidelity term, the gradient of the input image is preprocessed by combining a mapping function with a bilateral filter. First, the pixel value of the input image is normalized from 0 to 255 to 0 to 1, and a smaller threshold is set to compress the subtle texture information in the image. There is no need to distinguish whether the gradient of the input image belongs to texture or structure, so as to complete the mapping function processing. The formula of the mapping function is as follows:
[0063]
[0064] Where sign(·) is the sign function, h is the input image gradient, σ is the threshold, and α is the degree of compression;
[0065] Then, the image gradient processed by the mapping function is processed by bilateral filtering, so that the output image gradient only retains significant structural information. Finally, the relationship between the output image gradient and the image gradient preprocessed by the mapping function and bilateral filtering is constrained by the L2 norm, so as to achieve the structural fidelity of the image and better retain the complete semantic information of the image.
[0066] S2. A sparse gradient enhancement term is introduced on the basis of the structural fidelity term. A sparse regularization constraint is used to retain complete semantic information while achieving a sparser smoothing effect. In the sparse gradient enhancement term, in order to obtain a sparse smoothing effect, the L2 norm and the L1 norm are used to constrain the output image gradient to enhance sparsity. Since the L2 norm and the L1 norm have different properties, the L2 norm can make some low-frequency signals close to 0 but not completely 0, while the L1 norm can make some low-frequency signals completely 0. Therefore, compared with the L2 norm, the L1 norm can achieve a sparser smoothing effect. Although the L1 norm is not differentiable, the present invention iteratively solves the L1 norm by combining the subgradient method, the fast Fourier transform and the alternating direction multiplier method (ADMM), thereby effectively achieving image smoothing while maintaining the edge; or,
[0067] In order to obtain a sparser smoothing effect, L p The norm constrains the output image gradient, where 0<p≤1 or p=2. When p=1 or p=2, L p norm is a convex optimization problem, and when 0<p<1, L p The norm is a non-convex optimization problem. In order to effectively solve L when 0<p<1 p norm, the present invention uses an iterative reweighting method to convert Lp The norm is converted to the L1 norm for solving, that is, the non-convex optimization problem is converted into a convex optimization problem for solving, and the preconditioned conjugate gradient (PCG) method is used in the solution process to improve the computational efficiency.
[0068] As a specific embodiment, in step S1, the threshold σ for compressing the subtle texture information in the image is set to 0.05-0.3, and the compression degree α is set to 2-3, thereby avoiding the judgment of whether the gradient of the input image belongs to texture or structure by artificially setting the threshold. Today's images are rich and colorful, and the use of thresholds to directly distinguish between structure and texture has certain limitations. This is because this method is highly dependent on the selection of thresholds. If the selection is inappropriate, it is easy to mistakenly classify structural information as texture information, resulting in the destruction of structural information; or mistakenly classify texture information as structural information, retaining unnecessary details, resulting in a lack of smoothness.
[0069] In order to better understand the present invention, the technical solution provided by the present invention will be described in detail below.
[0070] Different from the existing global optimization smoothing algorithm consisting of two terms, data term and penalty term, the model proposed in this invention consists of three parts, namely data fidelity term, structural fidelity term and sparse gradient enhancement term. Given an input image g, the output image u can be obtained by the following optimization formula (2):
[0071]
[0072] Among them, λ and γ are balance weights used to adjust the trade-off between data fidelity, structural fidelity, and sparse gradient enhancement; Represents L p norm; c(·) is the gradient compression function; f BLF (·) is for bilateral filtering; Here we first introduce the solution process when p = 2, then introduce the solution process when p = 1, and finally extend it to L when 0 < p < 1 p Norm. When p = 2, formula (2) becomes the following form:
[0073]
[0074] make Taking its derivative with respect to u and setting it to 0 can be expressed as:
[0075]
[0076] Among them, D x and D yis a discrete differential operator, and equation (4) can be solved as follows:
[0077]
[0078] Where I is the identity matrix, Assuming that the size of the input image g is H×W, the process of solving equation (5) requires solving a HW×HW matrix, which is very time-consuming. Therefore, the present invention advocates solving it in the Fourier domain, and the calculation method is as follows:
[0079]
[0080] When p=1, equation (2) becomes the following form:
[0081]
[0082] In order to effectively solve the edge-preserving smoothing filter algorithm for sparse gradient enhancement proposed in the present invention, the present invention will adopt an iterative method combining alternating direction multipliers and fast Fourier transforms to solve. By introducing the Lagrange multiplier and constructing the augmented Lagrangian function, equation (7) can be expressed as follows:
[0083]
[0084] Among them, η x and η y is the dual variable, ρ is the Lagrangian penalty coefficient, and ρ>0. By introducing the augmented Lagrangian method, the global optimization function is relaxed to a strictly convex function, thereby improving the robustness of the algorithm. The Lagrangian penalty term and the dual term are combined and expressed as follows:
[0085]
[0086] Then, equation (7) is reformulated as follows:
[0087]
[0088] Equation (11) can be solved by iterative minimization. The k+1th iteration includes the following steps, where the minimization subproblem of solving problem u (filtered output image u) is as follows:
[0089]
[0090] Solve the problem Z x and Z y The minimization subproblem of is as follows:
[0091]
[0092]
[0093] About d x and d y The solution to the dual problem is as follows:
[0094]
[0095] When equation (12) is solved as a linear system, it takes a lot of time. Therefore, the present invention uses the fast Fourier transform method to convert the problem from the spatial domain to the frequency domain for calculation, so that the matrix inversion process becomes a point-to-point division operation in the frequency domain to improve the calculation efficiency. The closed-form solution of formula (12) is expressed as follows:
[0096]
[0097] Among them, F(·) and F -1 (·) represent fast Fourier transform (FFT) and inverse fast Fourier transform (IFFT), respectively. represents the complex conjugate of FFT, and F(1) is the FFT of the impulse function. is the Hadamard product. All additions, multiplications, and divisions in the above formula are point-to-point operations.
[0098] For equation (13) and equation (14), the present invention uses a subgradient method to obtain their closed-form solutions, and uses a shrink operator to express them in the following form:
[0099]
[0100] in, t x and t y Respectively and sign(·) and max(·) are the sign function and the maximum value function respectively. According to the above formula derivation, the filter proposed in the present invention can be described in detail as the following algorithm:
[0101] Input: input image g, balance parameters λ and γ, ε to determine whether convergence
[0102] Output: Filtered image u
[0103] 1: Initialization: u {0} =g;
[0104] 2: Gradient preprocessing of the input image g;
[0105] 3: while|u {k} -u {k-1} |>εdo
[0106] 4: Calculate formula (17) to obtain u {k+1}
[0107] 5: Calculate formula (18) to obtain
[0108] 6: Calculate formula (19) to obtain
[0109] 7: Calculate formula (15) to obtain
[0110] 8: Calculate formula (16) to obtain
[0111] 9: end while
[0112] 10: return u{ k}
[0113] In order to improve the robustness of the algorithm and obtain a sparser smoothing result, the present invention adopts L p norm (0<p<1) constrains the sparse gradient enhancement term. When 0<p<1, equation (2) is a non-convex optimization problem. In order to solve L p norm, the present invention adopts an iterative reweighting method to p The problem is converted to L1 norm for solution. Rewrite it as follows:
[0114]
[0115] Rewrite equation (20) into matrix form as follows:
[0116]
[0117] Among them, Diag(w * ) is a diagonal matrix, D x and D y are the difference matrices in the x-direction and y-direction respectively, then equation (2) can be rewritten as follows:
[0118]
[0119] When solving the minimization subproblem of problem u (filtered output image u), the present invention uses the preconditioned conjugate gradient (PCG) method to solve the following equation:
[0120]
[0121] Z x and Z y The minimization subproblem of is solved as follows:
[0122]
[0123] Right x and d y The solution to the dual problem is as follows:
[0124]
[0125] The structural information in the image contains important semantic information. However, the existing smoothing algorithms based on global optimization usually only consider data fidelity in terms of image fidelity, and ignore the fidelity of structural information. Even if a structural fidelity item is designed, it is often used as a smoothing item at the same time, which may cause the semantic information of the image to be destroyed or a large amount of unnecessary detail information to be retained. In terms of image smoothing, most of the existing filtering algorithms can only perform a single smoothing task and cannot process texture images and non-texture images well at the same time. The present invention proposes a new edge-preserving smoothing algorithm framework based on global optimization. This algorithm can not only retain the complete semantic information of the image, but also has excellent edge preservation capabilities compared to existing methods. It is also suitable for natural images and texture images. The filter has excellent edge-preserving smoothing capabilities. Figure 1 .
[0126] In order to verify the necessity and rationality of using sparse regularization constraints, the present invention uses L1 regularization, L2 regularization and L p Regularization is used to constrain. At the same time, the same structural fidelity term will be used to preprocess the gradient, but different parameters will be adjusted in the experiment for comparison. L1 regularization and L2 regularization have different properties. L2 regularization tends to make the gradient of the output image as small as possible and close to zero, while the most significant feature of L1 regularization is sparsity, which can set certain gradient values to zero. Therefore, from the perspective of image smoothing, the sparse gradient enhancement term using L1 regularization will make the image flatter. By observing Figure 4 It can be clearly seen that even if the parameters of the model using L2 regularization are adjusted, the excellent smoothing effect shown by L1 regularization cannot be achieved. p Regularization is converted to L1. By adjusting the value of ρ, a sparser smoothing result can be obtained even with a smaller γ.
[0127] To briefly explain the role of parameters λ and γ in controlling the edge-preserving smoothing algorithm of sparse gradient enhancement proposed in the present invention, Figure 5The different visual effects of different λ and γ values on the image are shown. When λ is fixed, increasing the size of γ will achieve smoother results. As we can observe, γ plays a crucial role in controlling the smoothness in the sparse gradient enhancement term.
[0128] The edge-preserving image smoothing task needs to retain significant edges while smoothing low-amplitude detail information, which seems to be a contradictory goal. A global optimization model is established to find a balance between the two. Existing images can be divided into texture images and non-texture images. Non-texture images usually contain complex scenes and structural information of different intensities, while texture images contain periodic texture information, but have a certain similarity with the structure. Existing methods are usually designed only for non-texture images or texture images, resulting in good filtering effects in non-texture images, but regular texture information cannot be filtered out in texture images. The sparse gradient enhanced edge-preserving smoothing algorithm proposed in the present invention performs well in both non-texture images and texture images.
[0129] In order to evaluate the performance of the algorithm proposed in the present invention, experimental comparisons were carried out on the BSDS500 dataset, the NKS dataset and the texture dataset provided by Xu et al. The comparison method includes four local methods (BLF, GF, BTF and RGF), two deep learning methods (DEAF and ResNet), and twelve global optimization methods (WLS, L0, RTV, FGS, RoG, BLF-LS, SWF, ILS, G-smooth, L1-R, SGSTF, SSF). Since the BSDS500 dataset and the texture dataset provided by Xu et al. lack Ground Truth images, they are used as qualitative analysis, and the smoothing quality is evaluated in a subjective way by human eyes by magnifying the local area in the image. The NKS dataset is used for quantitative analysis, which contains the input image and the GT image. The parameters of the algorithm of the present invention on the computer hardware platform are Intel i7-8750H CPU, 16GB memory, and MATLAB2018b software platform.
[0130] Figure 6The smoothing results of each algorithm for non-texture images and their magnification effects in local areas are shown. In general, each algorithm applies different degrees of smoothing to the input image. By magnifying the local area of the image, it can be observed that when faced with more complex structures, many algorithms show a certain degree of under-smoothing, such as L0, DEAF, ILS, BLF-LS, ResNet and Semi-Sparsity filters. Among them, the BLF-LS algorithm also causes the color of the connection between the house and the sky to change. The WLS and G-smooth algorithms show excellent smoothing effects, but they destroy the original structural information of the image, making it difficult to distinguish the information of the house on the mountain. Although the FGS and L1-R algorithms retain good structural information and remove unnecessary details, there are some slight artifacts. The sparse gradient enhanced edge-preserving smoothing algorithm proposed in the present invention can not only effectively smooth the detail information of complex scenes, but also retain the structural information of the houses on the mountain and the fences on the boat. Figure 7 The visual effects of the filters on the NKS dataset are compared. In these examples, the whiskers of the kitten represent the weak structural information in the image. After most algorithms smooth the image, the whiskers are destroyed, while the invention can well preserve the weak structural information of the image. Table 1 shows the quantitative results comparison of each algorithm on the NKS dataset. It can be seen that the invention obtains the highest values in the PSNR, SSIM and SSEQ indicators, which is better than other algorithms.
[0131] Table 1 Quantitative results comparison of various methods on the NKS dataset in terms of PSNR, SSIM and SSEQ indicators
[0132]
[0133]
[0134] Figure 8 The qualitative experimental comparison of filtering texture images through different filters is shown. In general, all filters can remove the texture of the input image and retain its overall structural information. However, RTV and RoG show damage to the edge structure in the magnified part of the blue rectangular box. BTF and RGF make the structure of the green magnified area not maintain its original shape. SWF still retains fine texture details at the edge. The structure of SGSTF appears too smooth. G-smooth and L1-R can retain better structure, but there is still a little jagged structure at the edge. In contrast, the present invention not only retains the complete structural information while smoothing the texture, but also retains the original fine structure of the cartoon character. In order to better evaluate the robustness of the algorithm of the present invention in removing texture, Fig. 9The visual comparison of the smoothing effects of various algorithms on complex texture images is shown. From the local magnified image, it can be seen that RTV causes the eyebrows and facial contours to be damaged, BTF, RGF and SGSTF make the smoothed image appear blurred to varying degrees, while SWF and L1-R still retain a part of the texture at the edge of the smoothed image. In contrast, RoG, G-smooth and the present invention can better smooth texture details while achieving edge preservation.
[0135] In order to comprehensively evaluate the present invention, a series of experiments were conducted, covering multiple tasks in the field of image photography, including detail enhancement, edge extraction, HDR tone mapping, clipart compression artifact removal, and image abstraction. These experiments are intended to verify the performance and effect of the present invention in different scene applications. In order to better evaluate the performance of each algorithm in various applications, the reference-free image indicators ILNIQE and TMQI were introduced for analysis.
[0136] Image smoothing decomposes an image into a base layer and a detail layer. By operating and recombining the base layer and the detail layer, different application effects can be obtained. By subtracting the filtered image from the original image, the detail layer, i.e. the detail information in the original image, is obtained. The detail layer is then enlarged and added back to the original image, thereby enhancing the detail information of the image and achieving the effect of image enhancement. In this experiment, the detail layer enhancement factor is uniformly set to 3.
[0137] Fig.10 The visual effect comparison of image detail enhancement of each algorithm is shown. From the enlarged image, it can be seen that the L0, RTV, FGS, DEAF, ResNet and SSF algorithms have halo phenomenon after image detail enhancement, while the present invention avoids the occurrence of halo phenomenon. In order to better evaluate the quality of detail enhancement, ILNIQE is used for evaluation. The quantitative analysis results of image enhancement of each algorithm are shown in Table 2. It can be found that the present invention has certain competitiveness in detail enhancement applications.
[0138] Table 2 Quantitative analysis results of each method in image detail enhancement
[0139]
[0140] Accurately identifying the edge structure of an image is a challenging task because an image contains not only significant structural information but also complex texture information. Through image smoothing, low-amplitude detail information in the image can be removed and significant edge structures can be retained. Next, the canny operator is used for edge extraction to improve the accuracy of the obtained edge.
[0141] Fig.11The visual effect comparison of each algorithm in edge extraction is shown. The input contains both houses with obvious structures and unnecessary details in the grass area. Visually, compared with other methods, RTV and G-smooth can better remove details on the grass while retaining the structure of the house. However, compared with RTV and G-smooth, the present invention can better retain the structural information of the house and avoid damage to the roof structure of the house, thereby extracting complete edge information more completely.
[0142] High dynamic range (HDR) images have a wider brightness range than standard images, but ordinary display devices cannot display this range. In order to display HDR images on ordinary devices, they need to be converted into low dynamic range (LDR) images using HDR tone mapping. First, the input HDR image is mapped using a logarithmic function to distribute the brightness level evenly over a larger range. Next, the image is decomposed into a base layer and a detail layer through an edge-preserving filter, the base layer is compressed, then recombined with the detail layer, and finally inversely mapped to generate a tone-mapped image. In this experiment, the present invention sets compression to 0.25.
[0143] Table 3 Quantitative analysis results of each method on the dataset provided by Yeganeh
[0144]
[0145] Fig.12 The visual effect comparison of each algorithm in HDR tone mapping is demonstrated. WLS, FGS and DEAF have different degrees of halo phenomenon, while L0 and RTV have different degrees of artifact phenomenon, and SSF mapping lacks sufficient details. Compared with these algorithms, the present invention does not produce artifact phenomenon and can truly reflect the HDR tone mapping results. In order to better evaluate the tone mapping quality of HDR images generated by each algorithm, TMQI is used as an evaluation index, and the 15 images provided by it are used in the quantitative analysis. The specific evaluation results are shown in Table 3, which shows that the present invention has certain advantages among many algorithms.
[0146] Clip art images usually have piecewise constant features and show clear sharp edges. However, when compressed using low-quality JPEG format, artifacts will be generated at the edges, resulting in blurred edges. Fig.13 The results of removing clipart compression artifacts by various filters are shown. Among them, BLF-LS and G-smooth still have artifacts at the edge, while L1-R and the present invention will result in unclear edge preservation when p=1. In contrast, the L1-R filter used in the present invention p When p = 0.7, the norm method can not only sharpen the edges but also effectively remove artifacts.
[0147] Image abstraction is one of the important applications of image filtering. The goal of image abstraction is to remove unimportant details in the image and retain the significant structural information of the image, thereby accurately expressing the essential characteristics of the image content. The method proposed in this invention is suitable for non-realistic image abstraction. It realizes edge enhancement on the basis of detail flattening. The image abstraction result is as follows: Fig.14 shown.
[0148] Finally, experimental verification shows that the present invention exhibits excellent edge preservation capabilities when processing both texture images and non-texture images, and outperforms existing image smoothing methods in a variety of applications.
[0149] Compared with the prior art, the sparse gradient enhanced edge-preserving image smoothing method provided by the present invention has the following advantages:
[0150] 1. The present invention provides a new global optimization model framework, which can effectively smooth texture images and non-texture images, as well as simple images and complex images while preserving edges, making the filter more robust.
[0151] 2. The present invention not only considers the data fidelity of the image, but also considers the structural fidelity of the image, and retains the strong structure and weak structure information of the image.
[0152] 3. By introducing the structural fidelity term, the fine texture information is suppressed to a certain extent, and the problem of relying on thresholds to divide textures and structures can be avoided.
[0153] 4. By introducing sparse gradient enhancement items, it is easier to process low-frequency signals during image smoothing and achieve a sparse smoothing effect.
[0154] 5. The present invention adopts L p The norm constraint outputs the gradient, and L p The norm is converted to L1 norm for solving to obtain a sparser smoothing effect. When p = 1, the fast Fourier transform (FFT) is used to convert the spatial domain to the frequency domain for calculation; when 0 < p < 1, the preconditioned conjugate gradient (PCG) method is used to accelerate matrix operations, thereby improving computational efficiency. Figure 3 In the paper, the smoothing effect of different filters on simple and complex non-texture image gradients after preprocessing is shown. Figure 3 The smoothing result is Figure 2The parameters of the gradient preprocessing remain consistent. By observing the smoothed results, it can be seen that BLF-LS shows a good smoothing effect when processing simple non-texture images, but when dealing with complex non-texture images, the lawn appears to be less smooth. In contrast, L1-R can produce a sparse smoothing effect, but because L1-R destroys certain structural information when preprocessing the input image gradient, the smoothed image becomes somewhat blurred. Compared with the above two filters, the algorithm proposed in the present invention can not only retain complete semantic information, but also show a sparse smoothing effect when processing simple and complex non-texture images and texture images.
[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A sparse gradient enhanced edge-preserving image smoothing method, characterized in that: The following steps are involved: S1. A structural fidelity term is introduced based on the existing global optimization model including a data fidelity term. In the structural fidelity term, the gradient of the input image is preprocessed by combining a mapping function with a bilateral filter. First, the pixel value of the input image is normalized from 0 to 255 to 0 to 1, and a threshold is set to compress the subtle texture information in the image. There is no need to distinguish whether the gradient of the input image belongs to texture or structure, so as to complete the mapping function processing. The formula of the mapping function is as follows: Where sign(·) is the sign function, h is the input image gradient, σ is the threshold, and α is the degree of compression; Then, the image gradient processed by the mapping function is processed by bilateral filtering, so that the output image gradient only retains significant structural information. Finally, the relationship between the output image gradient and the image gradient preprocessed by the mapping function and bilateral filtering is constrained by the L2 norm, so as to achieve the structural fidelity of the image and better retain the complete semantic information of the image. S2. Based on the structural fidelity term, a sparse gradient enhancement term is introduced. In the sparse gradient enhancement term, the L2 norm and L1 norm are used to constrain the output image gradient to enhance sparsity. The L1 norm is iteratively solved by combining the subgradient method, fast Fourier transform and alternating direction multiplier method, thereby effectively achieving edge-preserving image smoothing; or, Using L p The norm constrains the output image gradient, where 0<p≤1 or p=2. When p=1 or p=2, L p norm is a convex optimization problem, and when 0<p<1, L p The norm is a non-convex optimization problem. In order to effectively solve L when 0<p<1 p norm problem, through the iterative reweighting method, L p The norm is converted to the L1 norm for solution, that is, the non-convex optimization problem is converted into a convex optimization problem for solution, and the preconditioned conjugate gradient method is used in the solution process to improve the computational efficiency.
2. The edge-preserving image smoothing method of sparse gradient enhancement according to claim 1, characterized in that: In the step S1 , the threshold σ for compressing the fine texture information in the image is set to 0.05-0.3, and the compression degree α is set to 2-3.
3. The edge-preserving image smoothing method of sparse gradient enhancement according to claim 1, characterized in that: In step S2, when 0<p<1, L p The process of solving the norm is as follows: Given an input image g, the output image u is obtained by the following optimization formula: Among them, λ and γ are balance weights used to adjust the trade-off between data fidelity, structural fidelity, and sparse gradient enhancement; Represents L p norm; c(·) is the gradient compression function; f BLF (·) is for bilateral filtering; Indicates differential; x, y indicates the x direction and y direction of the image; In the above optimization formula Rewrite it as follows: Rewrite the above formula into matrix form as follows: Among them, Diag(w * ) is a diagonal matrix, D x and D y are the difference matrices in the x-direction and y-direction respectively, then the above optimization formula can be rewritten as follows: When solving the minimization subproblem of the filtered output image u, the preconditioned conjugate gradient method is used to solve the following equation: Where ρ is the Lagrange penalty coefficient, and ρ>0; k is the kth iteration; make η x and η y is a dual variable; Z x and Z y The minimization subproblem is solved and expressed as follows using the shrink operator: Right x and d y The solution to the dual problem is as follows:
Citation Information
Patent Citations
A gradient projection image reconstruction method based on a compressed sensing approximation L0 norm
CN109584330A
Structure preserving image smoothing algorithm of reweighted data item
CN115829862A
Sparsity-based super-resolution correlation microscopy
US20200003693A1
Signal processing device, signal processing method, and signal processing program
WO2022190249A1
Cited By
Video image contrast enhancement method for storage monitoring scene
CN122134604A
