Guiding filtering method based on scale adaptive weight and elastic network regression

By combining elastic network regression and scale adaptive weights, the problems of detail halo and rounding of guide filtering in high-intensity tasks are solved, and clearer image smoothing effect is achieved and PSNR index is improved.

CN120298239APending Publication Date: 2025-07-11JIANGSU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510358533.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

Existing guided filtering methods are prone to details halos and rounding problems when dealing with high-intensity tasks, and the traditional linear ridge regression model lacks flexibility and cannot effectively smooth high-frequency details while retaining edge information.

Method used

The guided filtering method based on elastic network regression is adopted, combined with the scale adaptive weight strategy, the detail transfer factor and intensity bias factor are calculated by optimizing the objective function, and the scale adaptive weighted average operation is introduced, which improves the sparsity and edge retention effect of image processing.

Benefits of technology

The detail halo and rounded artifacts are significantly reduced, and the image smoothing effect is improved. The PSNR index is increased by 0.14dB, 0.62dB and 1.52dB respectively, maintaining efficient calculation speed and image clarity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120298239A_ABST
    Figure CN120298239A_ABST
Patent Text Reader

Abstract

The invention discloses a guide filtering method based on scale adaptive weight and elastic network regression. The guide filtering method comprises the following steps: S1, calculating a detail transfer factor and an intensity bias factor by optimizing an objective function according to an image input by a user and parameter information; s2, calculating a scale image and a scale adaptive weight according to the guide image; s3, respectively performing weighted average operation on the detail transfer factor and the intensity bias factor calculated in the S1 by using scale adaptive weight; s4, selecting an iteration strategy according to the task scene to obtain a final output result; the invention provides a novel scale-aware guided image filter. The filter can effectively smooth details / textures while keeping edges / structures.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image filtering in digital image processing, and particularly relates to a guided filtering method based on scale-adaptive weights and elastic net regression. Background Art

[0002] Image processing and computer vision tasks often rely on the structural information in images and videos. However, due to the characteristics of data distribution in images, important structural information in images is often easily destroyed during the processing of traditional filtering methods. This is because details in images, such as edges and textures, usually exist in the form of high-frequency information, which is similar to noise in the image. Therefore, using traditional linear time-invariant filters to reduce noise often leads to the loss of details, specifically manifested as image blurring, etc. To solve the limitations of traditional filters, many researchers have proposed edge-preserving filtering techniques. This technique uses spatial information to avoid filtering in edge regions while effectively smoothing other parts of the image. Due to its sensitivity to edges, edge-preserving filtering is widely used in multiple fields such as image smoothing, high-dynamic-range image tone remapping, detail enhancement, image upsampling, and image denoising.

[0003] Guided filtering is one of the classic representative methods in edge-preserving image filtering proposed by He Kaiming. He proposed a new filtering model and achieved a linear computational complexity on the premise that the processing result is approximately the same as that of bilateral filtering, while avoiding the gradient reversal artifacts that may occur during the processing of bilateral filtering. This method has been widely used in various image processing applications, and subsequently, many scholars have made improvements based on guided filtering and proposed various variant methods of guided filtering. Summary of the Invention

[0004] In the present invention, we consider that most existing studies ignore the problem that the ridge regression model used for guided filtering cannot produce sparse image results. An insufficiently sparse solution will cause halos to form at the edges, and at the same time, due to the reason of its model, guided filtering will produce detail halo artifacts when dealing with high-intensity tasks. And the research focusing on eliminating detail halos often cannot solve the detail halo problem in thin structures and the rounding problem at the corners. To solve the above problems, we propose a guided image filtering model based on elastic net regression regularization, which improves the sparsity of the result, and we propose a new scale-adaptive weighting strategy, which can avoid the rounding problem while eliminating detail halos.

[0005] To achieve the above object, the technical solution provided by the present invention is as follows:

[0006] A guided filtering method based on scale-adaptive weights and elastic net regression, comprising the following steps:

[0007] S1: Calculate the detail transfer factor and intensity bias factor by optimizing the objective function according to the input image and parameter information of the user;

[0008] S2: Calculate the scale image and scale adaptive weight according to the guidance image;

[0009] S3: Use the scale adaptive weight to perform weighted average operations on the detail transfer factor and intensity bias factor calculated in S1 respectively;

[0010] S4: Select the iterative strategy according to the task scenario to obtain the final output result;

[0011] Furthermore, the above step S1 is specifically as follows:

[0012] S11: For the input image as shown in Figure 1 (a), we optimize the objective function shown in formula (1) through each window Ω k to obtain the detail transfer factor a corresponding to the current processing window k and intensity bias factor b k . This objective function is an improvement of the basic model of the guided filter. It controls the retention degree of edges and detail areas in the picture through the detail transfer factor. During the optimization process of the local window, in order to minimize the objective function, there will be a higher a value at the edge, so as to achieve the purpose of retaining the edge information of the picture. And in the detail part of the image, due to the existence of the regularization term, the strategy of high a value is not adopted at this time, but the b value is adjusted to minimize the objective function, so as to achieve the effect of edge-preserving smoothing of the image. We modify the regularization term in the original objective function of the guided filter to a more flexible elastic net regression regularization to adjust the sparsity of image processing.

[0013]

[0014] Among them, Ω k is the processing window corresponding to the current pixel point k, and its window radius is r. G i , P i are the intensity values of the i-th pixel point in the window Ω k of the guidance image G and the input image P respectively. ∈1, ∈2 are user input parameters, which are used as regularization term coefficients in formula (1) to control the weights of the L1 and L2 regularization terms respectively, so as to affect the detail smoothing degree and result sparsity of the output image. λ is the edge-aware weight, which is used to further optimize the performance of the regularization term, and its definition is shown in the following formula:

[0015]

[0016] Among them, n is the number of pixels in the window, To guide the variance value of the 3×3 neighborhood of the image G at the current pixel k, is the variance value of the 3×3 neighborhood of the input image P at the current pixel j. τ is a very small constant used to avoid the error of the denominator being zero, and its value is (0.001*L) 2 , where L is the dynamic range of the input image;

[0017] S12. By taking the derivatives of a and b respectively and using the soft-threshold operator to solve equation (1), a closed-form solution of the objective function can be obtained as shown in the following equation:

[0018]

[0019] where is the variance value of the neighborhood with radius r in the window Ω of the guidance image G k , and δ k is the covariance between the guidance image G and the input image P in the window Ω k . and are the average values in the k-th window of the guidance image and the input image respectively. Its calculation speed is similar to that of the original guided filter, and the time complexity remains at O(n). While retaining the advantages of fast calculation speed and low calculation cost, the elastic net regression model is used to enhance the sparsity of the solution, thus significantly reducing the brightness halo artifacts and making the smoothing result look clearer. The processing effect of the elastic net regression regularized guided filter is as shown in Figure 2 (a), and the processing effect of the original guided filter is shown in Figure 2(b). Their gradient images are given by Figure 2 (c), Figure 2 (d) respectively.

[0020] Furthermore, the above step S2 specifically includes the following contents:

[0021] From S1, the linear coefficient a of each window can be derived k . However, since each pixel is included in multiple windows, the linear coefficient of each pixel can be obtained by simply averaging the windows, which is also the strategy of the original guided filter. However, this will spread the high-value a k information at the image edge to the nearby areas, which will make the detail transfer factor around the edge have a larger value. Therefore, the smoothing effect of the detail part around the edge will be affected, resulting in the artifact of detail halo, as shown in Figure 2 (c) and Figure 2 (d) at the image edge.

[0022] Therefore, we change the mean strategy of the original guided filter to a weighted average strategy. Since this operation is similar to the erosion operation in morphology due to its characteristics, we call it a soft erosion operation. For the design of the weights in the soft erosion operation, we introduce a spatial scale factor to avoid the rounding artifacts that occur in many other filtering methods.

[0023] S21. First, we need to calculate the scale image η of our image. The value of each pixel in this image determines the radius of the processing window used by our filter at the corresponding pixel in the input image during the filtering process. We need to perform an erosion operation on the guided image that has undergone mean filtering. The process is shown in the following equation:

[0024]

[0025] is the erosion gradient map The pixel value at pixel k, where π k is the processing window centered at pixel k with a radius of r - 1, is the gradient operator, and ‖·‖ is used to calculate the magnitude of the gradient. is the pixel value at pixel j in the processing window π k of the guided image G after mean filtering. This operation blurs the detailed parts in the guided image using mean filtering to reduce the interference of detailed information, and uses erosion to refine the edges to accurately locate the edge information of the guided image.

[0026] S22. Further, we map the value range of to between 1 and r through the following equation:

[0027]

[0028] where μ is the change rate parameter, which determines the change rate of the scale data from 1 to r. After obtaining the scale image, the scale-adaptive weights can be calculated.

[0029] S23. The weight design is shown in the following equation. The scale-adaptive weight W can be calculated from equation (7). W k is the weight value of the adaptive weight at pixel k, m is the number of pixels in the processing window, and θ is the weight sensitivity control parameter used to adjust the weight distribution:

[0030]

[0031] where

[0032]

[0033] In the equation is the operator that rounds to the nearest integer. specifies the processing window Λ at each pixel point k k with a radius size of s k is the scale adaptive variance we proposed. This term is an important part of our scale adaptive weight. i and j are pixel indices, representing pixel i and pixel j in the processing window Λ respectively k This weight uses a smaller processing window at the image edge and a larger processing window at the smooth area to avoid the rounding artifacts caused by the weight information at the corners being diluted by the weight information at the smooth area.

[0034] Furthermore, the above step S3 specifically includes the following content:

[0035] S31. After obtaining the scale adaptive variance we need, we can replace the original mean strategy through weighted average operation.

[0036] The weighted average of coefficients a and b is shown as follows:

[0037]

[0038] where and are the new detail transfer factor and intensity deflection factor obtained after weighted average of pixel i in the window Λ i according to the scale adaptive weight W respectively.

[0039] S32. Through the above operations, we can obtain the processed detail transfer factor and intensity bias factor Thus, the processed output image O can be obtained through the following formula:

[0040]

[0041] That is, the pixel O of the output image i value is obtained by multiplying the weighted average detail transfer factor by the pixel value G of the guidance image at pixel i i plus the intensity deflection factor obtained.

[0042] The distribution of the value of a before soft erosion is as shown in Figure 3 (b), and the distribution of the value of a after soft erosion operation is as shown in Figure 3 (a).

[0043] Furthermore, the above step S4 specifically includes the following content:

[0044] Our method also supports iterative processing, and can stably improve the overall processing effect through iterative processing. Users can use different iterative strategies to specifically improve the processing effect in different application scenarios. Our method can be used in tasks such as image smoothing, high-dynamic-range (HDR) image tone remapping, JPEG compression artifact removal, and texture removal.

[0045] S41. For relatively simple tasks such as image smoothing and JPEG compression artifact removal, we only need to perform simple iterative processing, that is, using the output image of the previous round of processing as the input image for the next round of processing. The processing effects are respectively as Figure 8 (b) and Figure 6 (b) shown.

[0046] S42. However, in the case of strong image noise intensity or more complex processing tasks, the basic iterative strategy will cause the inability to remove the detail halo artifacts in the thin structures of the image. At this time, we will add a post-processing filter during the iterative processing. The filter still uses our method, but the difference is that it will use a smaller window parameter and a larger blur parameter. The processing results of the high-dynamic-range image tone remapping experiment are as Figure 7 (b) shown, and the processing results of the texture removal experiment are as Figure 9 (a) shown.

[0047] This iterative strategy can help our method obtain a better edge-preserving smoothing effect while removing the detail halo artifacts in the thin structures of the image. As Figure 4 (a) shown

[0048] The beneficial effects of the present invention are as follows:

[0049] Guided image filtering is a widely used image smoothing technique and is applied to various low-level vision tasks. However, it has problems such as detail halo and rounding. In addition, due to the L2 regularization in the linear ridge regression model, the original guided image filter often ignores important thin structures. Existing variants of the guided image filter cannot fully solve these problems. In the present invention, we propose a new scale-aware guided image filter that can effectively smooth details / textures while preserving edges / structures. To overcome the halo artifacts, we use an elastic net regression model for image smoothing, which inherits the advantages of ridge regression and lasso regression. In addition, we propose a scale-adaptive weighting scheme to correct the output of the regression, which greatly reduces the detail halo and rounding artifacts. Despite various improvements, we show that the model can still be efficiently solved. Our filter still retains the high processing efficiency of the guided filter and can smoothly process 720P three-channel color images in real time.

[0050] The problems, solutions, and effects solved by each inventive point are as follows:

[0051] 1. Image smoothing optimization based on elastic net regression

[0052] Technical problem: Due to the use of the L2-regularized ridge regression model, the traditional guided filter lacks flexibility and cannot preserve edge information while smoothing high-intensity details.

[0053] Solution: In step S11 of claim 1, elastic net regression is introduced to dynamically balance sparsity by adjusting the L1 and L2 regularization coefficients ∈1 and ∈2.

[0054] Effect: The flexibility of the filtering method is improved, and a wider range of visual effects can be obtained. In the image smoothing experiment, the PSNR index is improved by 0.14 dB compared with the original weighted guided filter.

[0055] 2. Scale-adaptive weighting scheme to eliminate rounding and detail halo artifacts

[0056] Technical problem: Existing guided filtering methods handle the detail transfer factor and intensity bias factor unreasonably, resulting in rounding and detail halo artifacts in high-intensity processing tasks.

[0057] Solution: In step S23 of claim 2, a scale-adaptive weighting scheme is introduced, and the detail transfer factor and intensity bias factor are weighted and averaged by the weights calculated by introducing scale information.

[0058] Effect: The rounding artifacts and most of the detail halo artifacts are solved. In the image smoothing experiment, the PSNR index is improved by 0.62 dB compared with the original weighted guided filter.

[0059] 3. Multi-scale iterative processing framework to completely remove detail halo artifacts and improve the filtering effect

[0060] Technical problem: Detail halo artifacts at thin structures are not removed, and it is limited by the fact that the guided filter is a local filter and the underlying model is a linear relationship, resulting in poor single-pass processing effects.

[0061] Solution: In claim 4, the propagation range of pixel information within the window is increased through iterative processing to improve the overall smoothing and edge-preserving effect of the filtering; a small-scale post-filter is added to focus on solving the detail halo problem at thin structures.

[0062] Effect: The filtering quality is greatly improved and the detail halo problem is completely solved. In the image smoothing experiment, the PSNR index is improved by 1.52 dB compared with the original weighted guided filter. Description of the Drawings

[0063] Figure 1 Experimental input image; Figure 1(a) Input image for edge-preserving smoothing experiment; Figure 1 (b) Input image for texture removal experiment;

[0064] Figure 2 Output images of edge-preserving smoothing experiment under different models; Figure 2 (a) Processing effect of elastic net regression regularized guided filter; Figure 2 (b) Processing effect of original guided filter; Figure 2 (c) Gradient image corresponding to the processing result of elastic net regression regularized guided filter; Figure 2 (d) Gradient image corresponding to the processing result of original guided filter;

[0065] Figure 3 a-value distribution images before and after soft erosion operation; Figure 3 (a) a-value distribution after soft erosion operation; Figure 3 (b) a-value distribution before soft erosion operation;

[0066] Figure 4 Processing effects of thin structure detail halo under different iteration strategies; Figure 4 (a) Processing effect of thin structure detail halo after iterative processing; Figure 4 (b) Processing effect of thin structure detail halo after single filtering;

[0067] Figure 5 Comparison images of circularization artifact processing effects; Figure 5 (a) Results of texture removal experiment without filtering iteration; Figure 5 (b) Results of texture removal experiment after iteration but without scale adaptive weighting; Figure 5 (c) Results of texture removal experiment after iteration with scale adaptive weighting mechanism introduced;

[0068] Figure 6 Input and output images of JPEG compression artifact removal experiment; Figure 6 (a) Input image of JPEG compression artifact removal experiment; Figure 6 (b) Output image after filtering and smoothing the input image;

[0069] Figure 7 Input and output images of high dynamic range image tone remapping experiment; Figure 7 (a) Input image of high dynamic range image tone remapping experiment; Figure 7 (b) Output image after tone remapping the input image;

[0070] Figure 8 Input and output images of Smoothing experiment;Figure 8 (a) is the input image of the Smoothing experiment; Figure 8 (b) is the output image after filtering and smoothing the input image;

[0071] Figure 9 Input and output images of the texture removal experiment; Figure 9 (a) is the output image after texture removal processing of the input image; Figure 9 (b) is the input image of the texture removal experiment;

[0072] Figure 10 It is a schematic diagram of the processing flow of the filtering method; Specific implementation manners

[0073] The present invention will be described in detail below in conjunction with the various implementation manners shown in the accompanying drawings. However, these implementation manners do not limit the present invention, and any structural, method, or functional transformation made by those of ordinary skill in the art based on these implementation manners is included within the protection scope of the present invention.

[0074] The guided filtering method based on scale adaptive weight and elastic net regression includes the following steps:

[0075] S1: Calculate the detail transfer factor and the intensity bias factor by optimizing the objective function according to the image and parameter information input by the user;

[0076] S2: Calculate the scale image and the scale adaptive weight according to the guidance image;

[0077] S3: Use the scale adaptive weight to perform weighted average operations on the detail transfer factor and the intensity bias factor calculated in S1 respectively;

[0078] S4: Select an iterative strategy according to the task scenario to obtain the final output result;

[0079] The specific content of step S1 of the present invention includes:

[0080] S11. For the input image as shown in Figure 1 (a), we optimize the objective function shown in formula (1) through each window Ω k to obtain the detail transfer factor a corresponding to the current processing window k and the intensity bias factor b k。The objective function is an improvement of the basic model of the guided filter. It controls the retention degree of edges and detail regions in the picture through a detail transfer factor. During the optimization process of the local window, in order to minimize the objective function, a higher value of a is used at the edges, so as to achieve the purpose of retaining the edge information of the picture. In the detail part of the image, due to the existence of the regularization term, the strategy of a high value of a is not adopted. Instead, the value of b is adjusted to minimize the objective function, so as to achieve the effect of edge-preserving smoothing of the image. We modify the regularization term in the objective function of the original guided filter to a more flexible elastic net regression regularization to adjust the sparsity of image processing.

[0081]

[0082] Among them, Ω k is the processing window corresponding to the current pixel point k, and its window radius is r. G i , P i are the intensity values of the i-th pixel point in the window Ω k of the guidance image G and the input image P respectively. ∈1, ∈2 are user input parameters, which are used as regularization term coefficients in formula (1) to control the weights of the L1 and L2 regularization terms respectively, so as to affect the detail smoothing degree and result sparsity of the output image. λ is the edge-aware weight, which is used to further optimize the performance of the regularization term, and its definition is shown in the following formula:

[0083]

[0084] Among them, n is the number of pixels in the window, is the variance value of the 3*3 neighborhood of the guidance image G at the current pixel k, is the variance value of the 3*3 neighborhood of the input image P at the current pixel j, and τ is a very small constant used to avoid the error of the denominator being 0, and its value is (0.001*L) 2 , where L is the dynamic range of the input image;

[0085] S12. By taking the derivatives of a and b respectively and using the soft threshold operator to solve formula (1), the closed solution of the objective function can be obtained, as shown in the following formula:

[0086]

[0087] Among them, is the variance value of the neighborhood with r as the radius in the window Ω k of the guidance image G, and δ k is the covariance between the guidance image G and the input image P in the window Ω k . and They are the average values in the k-th window of the guiding image and the input image respectively. Its calculation speed is similar to that of the original guided filter, and the time complexity remains at O(n). While retaining the advantages of fast calculation speed and low calculation cost, the elastic net regression model is used to enhance the sparsity of the solution, thus significantly reducing the brightness halo artifacts and making the smoothing result look clearer. The processing effect of the elastic net regression regularized guided filter is as shown in Figure 2 (a), and the processing effect of the original guided filter is as shown in Figure 2 (b). Their gradient images are given by Figure 2 (c) and Figure 2 (d) respectively.

[0088] The above step S2 specifically includes the following content:

[0089] From S1, the linear coefficient a of each window can be deduced k . However, since each pixel is included in multiple windows, the linear coefficient of each pixel can be obtained by simply averaging the windows, which is also the strategy of the original guided filter. However, this will spread the a k information with a relatively high value at the image edge to the nearby areas, which will make the detail transfer factor around the edge have a larger value. Therefore, the smoothing effect of the detail part around the edge will be affected, resulting in the artifact of detail halo, as shown in Figure 2 (c) and Figure 2 the image edges of (d).

[0090] Therefore, we change the mean strategy of the original guided filter to a weighted average strategy. Since this operation is similar to the erosion operation in morphology due to its characteristics, we call it a soft erosion operation. For the design of the weights in the soft erosion operation, we introduce a spatial scale factor to avoid the rounding artifacts that appear in many other filtering methods.

[0091] S21. First, we need to calculate the scale image η of our image. The value of each pixel in this image determines the radius of the processing window used by our filter at the corresponding pixel of the input image during the filtering process. We need to perform an erosion operation on the guided image that has undergone mean filtering. The process is as shown in the following formula:

[0092]

[0093] is the erosion gradient map The pixel value at pixel k, where π k is a processing window centered at pixel k with a radius of r - 1, is the gradient operator, and ‖·‖ is used to calculate the magnitude of the gradient. For guiding the pixel value at pixel j in the processing window π after the guidance image G undergoes mean filtering. This operation blurs the detailed parts in the guidance image using mean filtering to reduce the interference of detailed information, and uses erosion to refine the edges to accurately locate the edge information of the guidance image. k

[0094] S22. Further, map the value range of to obtain the normalized erosion gradient map η between 1 and r through the following formula. η k is the value of the erosion gradient map η at pixel k, and r is the radius of the processing window set by the user:

[0095]

[0096] where μ is the change rate parameter, which determines the change rate of the scale data from 1 to r; after obtaining the scale image, the calculation of the scale adaptive weight can be performed.

[0097] S23. The weight is designed as shown in the following formula. The scale adaptive weight W can be calculated from formula (7). W k is the weight value of the adaptive weight at pixel k, m is the number of pixels in the processing window, and θ is the weight sensitivity control parameter used to adjust the weight distribution:

[0098]

[0099] where

[0100]

[0101] In the formula is the operator that rounds to the nearest integer. specifies the radius size of the processing window Λ k at each pixel point k. s k is the scale adaptive variance we proposed. This term is an important part of our scale adaptive weight. i and j are pixel indices, representing pixel i and pixel j in the processing window Λ k respectively. This weight avoids the circularization artifacts caused by the dilution of the weight information at the corners by the weight information in the smooth area by using a smaller processing window at the image edges and a larger processing window in the smooth area.

[0102] The specific content of step S3 of the present invention includes:

[0103] S31. After obtaining the scale adaptive variance we need, we can replace the original mean strategy through weighted average operation.

[0104] The weighted average of coefficients a and b is shown as follows:

[0105]

[0106] Wherein, and are respectively the new detail transfer factor and the intensity deflection factor obtained after weighted averaging of pixel i in window Λ i according to the scale-adaptive weight W.

[0107] S32. Through the above operations, we can obtain the processed detail transfer factor and the intensity bias factor so that the processed output image O can be obtained through the following formula:

[0108]

[0109] That is, the pixel O i of the output image is obtained by multiplying the weighted-averaged detail transfer factor by the pixel value G i of the guidance image at pixel i and adding the intensity deflection factor obtained.

[0110] The distribution of the value of a before soft erosion is as shown in Figure 3 (b), and the distribution of the value of a after the soft erosion operation is as shown in Figure 3 (a).

[0111] Step S4 specifically includes the following content:

[0112] Our method also supports iterative processing, and the overall processing effect can be stably improved through iterative processing. Users can use different iterative strategies to specifically improve the processing effect in different application scenarios. Our method can be used in tasks such as image smoothing, high-dynamic-range image tone remapping, JPEG compression artifact removal, and texture removal.

[0113] S41. For relatively simple tasks such as image smoothing and JPEG compression artifact removal, we only need to simply perform iterative processing, that is, use the output image of the previous round of processing as the input image of the next round of processing. The processing effects are respectively as shown in Figure 8 (b) and Figure 6 (b).

[0114] S42. However, in image processing tasks with strong image noise intensity or relatively complex situations, the basic iterative strategy will result in the inability to remove the detail halo artifacts in the thin structures of the image. At this time, we will add a post-processing filter during the iterative process. The filter still uses our method, but the difference is that it will use a smaller window parameter and a larger blur parameter. The processing results of the high-dynamic-range image tone remapping experiment are shown in Figure 7 (b), and the processing results of the texture removal experiment are shown in Figure 9 (a).

[0115] This iterative strategy can help our method achieve a better edge-preserving smoothing effect while removing the detail halo artifacts in the thin structures of the image. As shown in Figure 4 (a).

[0116] The series of detailed descriptions listed above are only specific descriptions of the feasible implementation manners of the present invention, and they are not intended to limit the protection scope of the present invention. Any equivalent manners or changes that do not depart from the technology created by the present invention should be included in the protection scope of the present invention.

Claims

1. A guided filtering method based on scale adaptive weights and elastic net regression, characterized in that It includes the following steps: S1: Calculate the detail transfer factor and intensity bias factor by optimizing the objective function according to the input image and parameter information of the user; S2: Calculate the scale image and scale adaptive weight according to the guidance image; S3: Use the scale adaptive weight to perform weighted average operations on the detail transfer factor and intensity bias factor calculated in S1 respectively; S4: Select an iterative strategy according to the task scenario to obtain the final output result.

2. The method according to claim 1, wherein The specific method of the optimization objective function in S1: S11. For the input image, we perform optimization on a window-by-window basis Ω k to obtain the detail transfer factor a corresponding to the current processing window by optimizing the objective function shown in Equation (1). k and the intensity bias factor b k ; this objective function is an improvement on the basic model of the guided filter, which controls the retention degree of edges and detail regions in the picture through the detail transfer factor; during the optimization process of the local window, in order to minimize the objective function, a higher a value will be obtained at the edges, so as to achieve the purpose of retaining the edge information of the picture; while in the detail part of the image, due to the existence of the regularization term, the strategy of a high a value is not adopted at this time, but the b value is adjusted to minimize the objective function, so as to achieve the effect of edge-preserving smoothing of the image; we modify the regularization term in the original objective function of the guided filter to a more flexible elastic net regression regularization to adjust the sparsity of image processing. where Ω k is the processing window corresponding to the current pixel point k, with a window radius of r, G i , P i are the intensity values of the i-th pixel point in the guidance image G and the input image P in the window Ω k respectively; ∈1, ∈2 are user input parameters, which serve as regularization term coefficients in equation (1) to control the weights of the L1 and L2 regularization terms respectively, thereby affecting the detail smoothness and result sparsity of the output image; λ is the edge-aware weight, which is used to further optimize the performance of the regularization term, and its definition is shown as follows: where n is the number of pixels within the window, is the variance value of the 3×3 neighborhood of the guidance image G at the current pixel k, is the variance value of the 3×3 neighborhood of the input image P at the current pixel j, and τ is a very small constant used to avoid the error of the denominator being zero, and its value is (0.001*L) 2 , where L is the dynamic range of the input image; S12: By taking the derivatives of a and b respectively and using the soft threshold operator to solve equation (1), the closed solution of this objective function can be obtained, as shown in the following formula: where is the variance value of the neighborhood of r in the window Ω of the guidance image G k , and δ k is the covariance between the guidance image G and the input image P in the window Ω k ; and are the average values in the k-th window of the guidance image and the input image respectively; its calculation speed is similar to that of the original guided filter, and the time complexity remains at O(n). While retaining the advantages of fast calculation speed and low calculation cost, the elastic net regression model is used to enhance the sparsity of the solution, thus significantly reducing the brightness halo artifacts and making the smoothing result look clearer.

3. The method according to claim 1, wherein The specific method for calculating the scale image and scale adaptive weight in S2 is as follows: The linear coefficient a of each window can be derived from S1 k ; however, since each pixel is included in multiple windows, the linear coefficient of each pixel can be obtained by simply averaging the windows, which is exactly the strategy of the original guided filter; However, this will spread the value of a that is relatively high at the image edge k to the nearby areas, which will make the detail transfer factor around the edge have a larger value. Therefore, the smoothing effect of the detail part around the edge will be affected, resulting in the artifact of detail halo; For this reason, the mean strategy of the original guided filter is changed to a weighted average strategy, and since this operation is similar to the erosion operation in morphology due to its characteristics, it is called a soft erosion operation; for the design of the weight in the soft erosion operation, a spatial scale factor is introduced, aiming to avoid the rounding artifacts that occur in many other filtering methods; S21. First, calculate the scale image η of the image. The value of each pixel in this image determines the radius of the processing window used by the filter at the corresponding pixel in the input image during the filtering process. Perform an erosion operation on the guided image that has undergone mean filtering to obtain an erosion gradient map The process is shown in the following formula: is the corrosion gradient map The pixel value at pixel k, where π k is the processing window centered at pixel k with a radius of r - 1, is the gradient operator, and ‖·‖ is used to calculate the magnitude of the gradient, is the pixel value at pixel j in the processing window π after the guidance image G is subjected to mean filtering k This operation blurs the detailed parts in the guidance image by using mean filtering to reduce the interference of detailed information, and uses erosion to refine the edges to accurately locate the edge information of the guidance image; S22. Further, map the value range to between 1 and r through the following formula to obtain the normalized erosion gradient map η, where η k is the value of the erosion gradient map η at pixel k, and r is the processing window radius set by the user: where μ is the change rate parameter, which determines the change rate of the scale data from 1 to r; After obtaining the scale image, the scale adaptive weight can be calculated; S23. The weight design is shown in the following formula. The scale adaptive weight W can be calculated from formula (7). W k is the weight value of the adaptive weight at pixel k, m is the number of pixels in the processing window, and θ is the weight sensitivity control parameter used to adjust the weight distribution: where where is the operator for rounding to the nearest integer; specifies the radius size of the processing window Λ k at each pixel point k, and s k is the proposed scale-adaptive variance, which is an important part of the scale-adaptive weight. i and j are pixel indices, representing pixel i and pixel j in the processing window Λ k respectively. This weight uses a smaller processing window at the image edge and a larger processing window at the smooth area to avoid the rounding artifacts caused by the dilution of the weight information at the corners by the weight information at the smooth area.

4. The method according to claim 1, wherein The specific method for performing weighted average operations on the detail transfer factor and intensity bias factor in S3 is as follows: S31: After obtaining the required scale adaptive variance, the original mean strategy can be replaced by a weighted average operation; The weighted average of the coefficients a and b is as shown in the following formula: Among them, and are respectively the new detail transfer factor and intensity deflection factor obtained after weighted averaging of pixel i in window Λ i according to the scale adaptive weight W; S32. Through the above operations, the processed detail transfer factor can be obtained. and the intensity bias factor Thus, the processed output image O can be obtained through the following formula: That is, the pixel O of the output image i The value is determined by the detail transfer factor after weighted averaging multiplied by the pixel value G of the guidance image at pixel i i plus the intensity deflection factor to obtain the result.

5. The method according to claim 1, characterized in that, The specific method for selecting an iterative strategy according to the task scenario in S4 is as follows: S41: For relatively simple tasks such as image smoothing and JPEG compression artifact removal, only simple iterative processing is required, that is, using the output image of the previous round of processing as the input image of the next round of processing; S42: However, in tasks with strong image noise intensity or more complex processing, the basic iterative strategy will result in the inability to remove the detail halo artifacts in the thin structure of the image. At this time, a post-processing filter is added during the iterative processing. This filter still uses this method, but the difference is that it will use smaller window parameters and larger blur parameters.