L0 image edge-preserving filtering method based on iterative L1 paradigm
By iterating the L0 image edge-preserving filtering method of the L1 paradigm, the shortcomings of existing filters in halo and intensity drift artifacts are solved, and efficient image edge preservation and artifact suppression are achieved, which is suitable for applications such as portrait beautification and high dynamic range imaging.
Patent Information
- Application Number
- CN202210047387.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-17
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-01-17
AI Technical Summary
Existing edge-preserving filters have the problems of long computation time or poor effect in suppressing halo artifacts and intensity drift artifacts. In particular, local edge-preserving filters are prone to produce halo artifacts, while global edge-preserving filters may cause intensity drift artifacts in the resulting image.
An L0 image edge-preserving filtering method based on the iterative L1 paradigm is adopted. By setting the spatial growth factor k and weight λ, the image gradient is calculated and truncated. The ADMM algorithm is used for fast solution in the Fourier domain, and the parameter β is iteratively updated to obtain the final filtering result.
It effectively suppresses halo and intensity drift artifacts, improves computational efficiency, and maintains significant edge preservation in image processing. It is suitable for applications such as portrait beautification, high dynamic range imaging, and image enhancement, reducing image color cast and artifacts.
Smart Images

Figure CN114511457B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computational photography, and in particular is an L0 image edge-preserving filtering method based on an iterative L1 paradigm. Background Art
[0002] Edges in images contain rich visual information. However, traditional filters such as mean and Gaussian filters can destroy image structure when the filtering blur is too high. To address this problem, researchers have proposed edge-preserving filters, which effectively preserve edge information while removing image details. Edge-preserving filters have significant theoretical and practical significance and are widely used in applications such as image enhancement, HDR (High Dynamic Range) imaging, and portrait skin retouching.
[0003] Existing edge-preserving filters can be divided into local edge-preserving filters and global edge-preserving filters. Local edge-preserving filters replace each pixel in the image with a weighted average of adjacent pixels, such as bilateral filters and guided filters. Most local edge-preserving filters have a fast calculation speed, but are prone to produce halo artifacts near the edges of the resulting image; while global edge-preserving filters model the entire filtering process as an optimization problem to solve, such as gradient L0 norm smoothing (L0Smoothing) and weighted least squares filters (WLS). The advantage of global edge-preserving filters is that they can effectively suppress halo artifacts, but solving the optimization problem is usually too time-consuming and may cause intensity drift artifacts in the resulting image.
[0004] The present invention proposes a new global edge-preserving filtering method for solving the gradient L0 norm, namely, an L0 image edge-preserving filtering method based on the iterative L1 norm. This method can effectively suppress the halo artifacts of local edge-preserving filters and the intensity drift artifacts of existing global edge-preserving filters, and has high computational efficiency. Summary of the Invention
[0005] In response to the problems existing in the prior art, the present invention proposes an L0 image edge-preserving filtering method based on the iterative L1 paradigm, which can well preserve the significant edges in the image while filtering out details, and can effectively suppress two artifacts: halo and intensity drift.
[0006] An L0 image edge-preserving filtering method based on an iterative L1 paradigm comprises the following steps:
[0007] Step 1: Set the spatial growth factor k and weight λ, the initial value β, and select the input image;
[0008] Step 2, calculate the gradient of the input image;
[0009] Step 3: truncate the obtained gradient by using parameters λ and β;
[0010] Step 4: Filter the input image using the truncated gradient and output the image;
[0011] Step 5: Update the parameter β to k*β, and obtain the final filtering result after multiple iterations of steps 3 and 4.
[0012] Furthermore, the objective function of the above L0 image edge-preserving filtering method based on iterative L1 paradigm is
[0013]
[0014] Where O represents the output image, I represents the input image, and i represents pixel i. C(O) is the L0 form of the gradient, representing the number of pixels in the output image O where the gradient in the x and y directions is non-zero. λ is a parameter that balances these two values. The image gradient is the difference between adjacent pixels and can be calculated using the following formula.
[0015]
[0016] Image gradients are calculated in both the x and y directions. To calculate the x-direction gradient for pixel i, subtract the value of the current pixel from the value of the next pixel. The same applies to the y-direction gradient. For the gradients at the right and bottom edges of the image, we use the left and top edges as their next pixels, thus constraining the gradient of the entire image.
[0017] Furthermore, we introduce auxiliary variables h and v as The penalty term is rewritten as
[0018]
[0019] where h i ,v i That is, the value of the i-th item in h,v. When the weight parameter β is large enough, h,v can achieve the penalty effect.
[0020] By optimizing O, h, and v separately, we can transform it into two sub-problems:
[0021]
[0022] Furthermore, an iterative method is used to solve the above two sub-problems. Each iteration consists of two steps, namely, calculating the truncated gradient h,v and calculating the output image.
[0023] Furthermore, the method for calculating the truncated gradient h,v is:
[0024] First calculate the gradient of image O. When the sum of the absolute values of the x and y gradients of image O is less than or equal to When , take (0, 0), otherwise, directly take the gradient value of O. The solution formula is as follows:
[0025]
[0026] Furthermore, the method for calculating the output image O is:
[0027] In the first iteration, assign O to the input image I and calculate the image gradient and According to λ and β, the gradient is truncated to obtain h, v; then the ADMM algorithm is used to quickly solve in the Fourier domain to obtain the output image of the first iteration;
[0028] In the second and subsequent iterations, the parameter β is updated to k*β, and the output image O obtained last time is used to iterate again according to the method of the first iteration.
[0029] Furthermore, the specific process of solving the output image O is:
[0030] The method to solve the output image O is to solve an L1 paradigm constraint problem, using the ADMM algorithm to solve it, introducing z x ,z y ,d x ,d y , where z x ,z y is the optimization variable, d x ,d y is the Lagrange multiplier, Rewrite it as
[0031]
[0032] Where ρ is the penalty parameter and ρ>0, let the scaling dual variable μ x =(1 / ρ)d x , μ y =(1 / ρ)d y ,but
[0033]
[0034] By optimizing O, we can get:
[0035]
[0036] z x , z y Optimize and get:
[0037]
[0038] Then solve O by the fast Fourier transform operator
[0039]
[0040] Where F(·) is the fast Fourier transform operator, represents the conjugate complex number. F(1) is the Fourier transform of the delta function.
[0041] For z x , z y , solved by soft operators:
[0042]
[0043] Then z x , z y have to:
[0044]
[0045] For μ x 、μ y , can be solved iteratively by the following formula:
[0046]
[0047] Furthermore, when the iterative method is used to solve the L0 problem, the number of iterations is set to 6, after which the filtered image has hardly changed.
[0048] The beneficial effects of the present invention are:
[0049] In various practical applications such as portrait beautification, high dynamic range imaging HDR, and image enhancement, the effects and problems of edge-preserving filtering on images will directly affect the final results of the application. Compared with the traditional L0 solution method, this invention has better performance in image processing, has a more natural effect on filtering shadow areas, and is less likely to produce color casts in images. Figure 2 、 Figure 3 And it can overcome the halo and effectively suppress the intensity drift and gradient reversal artifacts, such as Figure 4 、 Figure 5 As shown in the figure, the processing results are also very good for the artifacts introduced by JPEG image compression, such as Figure 6 As shown, good results were achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a flow chart of the method of the present invention.
[0051] Figure 2The figure compares the filtering effects of the present invention and the traditional L0 solution method. 2(a) is the original image, 2(b) is the result after filtering by the present invention, and 2(c) is the result after traditional L0 filtering.
[0052] Figure 3 The data is drawn by selecting the pixels in the 10th row of the image, where the black color is the pixel value of the original image, 3(b) is the pixel value of the filtering result of the present invention, and 3(c) is the pixel value of the traditional L0 filtering result. It can be seen that there is an obvious intensity drift artifact.
[0053] Figure 4 Figure 5 is the result of applying the edge-preserving filter to image enhancement, where 4(a) is the original image; 4(b) is the result after filtering by the present invention with parameters k=2 and λ=0.01; 5(c) is the result after traditional L0 filtering with parameters k=2 and λ=0.01, where obvious gradient reversal artifacts can be seen.
[0054] Figure 5 Figure 5(a) shows the results of applying the edge-preserving filter to the HDR image display. Figure 5(b) shows the HDR image. Figure 5(c) shows the result of the filtering method of the present invention. The parameters are k = 2 and λ = 0.02. Figure 5(c) shows the result of the traditional L0 filtering. It can be seen that obvious artifacts are generated near the window frame. The parameters are k = 2 and λ = 0.01.
[0055] Figure 6 The results of applying the edge-preserving filter to remove JPEG compression artifacts are shown in Figure 6(a), where 6(b) is the original image and the results of the present invention are shown with parameters k = 2 and λ = 0.01. 6(c) is the result of traditional L0 filtering with parameters k = 2 and λ = 0.01; and 6(d) is the result of fast adaptive bilateral filtering. DETAILED DESCRIPTION
[0056] This paper proposes an L0 image edge-preserving filtering method based on the iterative L1 paradigm. Given a user-input image and parameters, this method first calculates the input image gradient, then truncates the gradient based on the input parameters, and finally applies the truncated gradient to the filtering output image. To achieve L0 image filtering, this paper proposes a method based on the iterative L1 paradigm that iteratively updates the gradient and output image, continuously refining the results. Experimental results demonstrate that this method can overcome artifacts such as haloing and intensity drift, achieving excellent edge-preserving filtering results.
[0057] The present invention will be further described below with reference to the accompanying drawings.
[0058] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0059] like Figure 1 As shown, the L0 image edge-preserving filtering method based on the iterative L1 paradigm proposed in the present invention has the following specific process:
[0060] Step 1: Set the spatial growth factor k and weight λ. The initial value β defaults to 2λ. Select the input image I.
[0061] Step 2: Calculate the gradient of the input image
[0062] Step 3: truncate the obtained gradient using the parameters λ and β. The specific gradient truncation method is:
[0063]
[0064] Step 4: Use the truncated gradient to filter the input image and output the image. The solution is:
[0065]
[0066] Where F(·) is the fast Fourier transform operator, represents the conjugate complex number. F(1) is the Fourier transform of the delta function.
[0067] For z x , z y , solved by soft operators:
[0068]
[0069] Then z x , z y have to:
[0070]
[0071] For μ x 、μ y , solved iteratively by the following formula:
[0072]
[0073] Step 5: Update the parameter β to k*β, and obtain the final filtering result after multiple iterations of steps 3 and 4.
[0074] When the iterative method is used to solve the L0 problem, the number of iterations is set to 6, after which the filtered image has hardly changed.
[0075] The series of detailed descriptions listed above are only specific descriptions of feasible implementation methods of the present invention. They are not intended to limit the scope of protection of the present invention. Any equivalent methods or changes that do not deviate from the technology of the present invention should be included in the scope of protection of the present invention.
Claims
1. L0 image edge-preserving filtering method based on iterative L1 paradigm, characterized by: include: S1, set the spatial growth factor k and weight λ, initial value β, and establish the objective function of the image; S2, calculates the gradient of the input image; S3, truncates the obtained gradient by parameters λ and β; S4, using the truncated gradient, filters the input image and outputs the image; S5, update the parameter β to k*β, and obtain the final filtering result after multiple iterations of steps S3 and S4; In S1, the objective function is Where O represents the output image, I represents the input image, i represents pixel i, C(O) is the L0 form of the gradient, which represents the number of pixels in the output image O whose gradient in the x and y directions is not zero, and λ is the parameter that balances the two terms. The image gradient is the difference between adjacent pixels and is calculated as follows: The calculation of image gradients includes both x and y directions. When calculating the x-direction gradient of pixel i, the value of the current pixel i is subtracted from the value of the next pixel. The same is true for the y-direction gradient. For the gradients of the right and lower boundaries of the image, the left and upper boundaries are used as their next pixels to constrain the gradient of the entire image. Introduce auxiliary variables h, v as The penalty term is redesigned as where h i ,v i That is, the value of the i-th item in h,v. When the weight parameter β is large enough, h,v can achieve the penalty effect; By optimizing O, h, and v separately, we can transform it into two sub-problems: The above two sub-problems are solved by an iterative method. Each iteration requires calculating the truncated gradient h, v and the output image. Method for calculating truncated gradient h,v: Calculate the gradient of image O. When the sum of the absolute values of the x and y gradients of image O is less than or equal to When , take (0, 0), otherwise, directly take the gradient value of O. The solution formula is as follows: The method to calculate the output image is: In the first iteration, assign O to the input image I and calculate the image gradient and According to λ and β, the gradient is truncated to obtain h, v; then the ADMM algorithm is used to quickly solve in the Fourier domain to obtain the output image of the first iteration; In the second and subsequent iterations, the parameter β is updated to k*β, and the output image O obtained last time is used to iterate again according to the method of the first iteration; The specific process of solving the output image O is: The method of solving the output image O is transformed into solving an L1 paradigm constraint problem, and the ADMM algorithm is used to solve it. x ,z y ,d x ,d y , where z x ,z y is the optimization variable, d x ,d y is the Lagrange multiplier, Rewrite it as Where ρ is the penalty parameter and ρ>0, let the scaling dual variable μ x =(1 / ρ)d x , μ y =(1 / ρ)d y ,but Optimizing O, we get: z x , z y Optimize and get: Then the output image O is solved by the fast Fourier transform operator Where F(·) is the fast Fourier transform operator, represents the conjugate complex number, F(1) is the Fourier transform of the delta function; For z x , z y , solved by soft operators: Then z x , z y have to: For μ x 、μ y , can be solved iteratively by the following formula:
2. The L0 image edge-preserving filtering method based on iterative L1 paradigm according to claim 1, characterized in that: The number of iterations is set to 6.
Citation Information
Patent Citations
Image super-resolution method based on adaptive filtering and regularization constraint
CN104200439A
Image edge-preserving filtering method based on soft clustering
CN111932472A