Image smoothing method and device based on relative total variation and Laplace filtering

The image smoothing method using relative total variation and Laplace filtering effectively addresses texture interference by iteratively refining smoothing results, enhancing detection accuracy in industrial applications.

CN118735813BActive Publication Date: 2024-12-03泉州职业技术大学
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411204899.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-03
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

Classic image smoothing methods struggle to effectively distinguish between texture and structure, leading to low detection accuracy due to noise interference and texture interference in product images, which affects industrial detection processes.

Method used

An image smoothing method combining relative total variation and Laplace filtering, utilizing a first and second image smoothing model with data fidelity and regularization terms, where the second model incorporates Laplace filtering of residual images to iteratively enhance the smoothing process.

Benefits of technology

This approach achieves a balanced retention of edge structures while improving background smoothness, reducing interference, and enhancing image quality, thereby improving the accuracy and robustness of industrial product detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735813B_ABST
    Figure CN118735813B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of image processing, and provides an image smoothing method and device based on relative total variation and Laplace filtering. By applying a first image smoothing model and a second image smoothing model, the relative total variation model is combined with the Laplace filtering, and the advantage of the relative total variation model in distinguishing structures and textures is fully utilized. The edge structure loss caused by the relative total variation model is continuously compensated by the Laplace filtering, and an excellent balance can be achieved between retaining the edge of the detection target structure and improving the background smoothness, so as to achieve a more significant smoothing effect, improve image quality, reduce interference factors, thereby improving the accuracy and robustness of industrial assembly line product detection, and providing more reliable data and a higher level of automation for industrial production and manufacturing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an image smoothing method and device based on relative total variation and Laplace filtering. Background Art

[0002] With the vigorous development of science and technology in recent years, image processing and other technologies are applied in multiple steps in the industrial manufacturing process, that is, various pre-processing operations are performed on product images before the product in the product image is detected. Among them, the smoothing operation of the product image is involved.

[0003] Most classic smoothing methods use norm characteristics or Gaussian filtering to achieve the smoothing purpose, but it is still difficult to avoid various interferences, such as the noise generated during image acquisition or the texture of the product itself, which will interfere with the detection process of the product in the product image, and thus lead to the problem of low detection accuracy. Summary of the invention

[0004] The present invention provides an image smoothing method and device based on relative total variation and Laplace filtering, so as to solve the defects existing in the prior art.

[0005] The present invention provides an image smoothing method based on relative total variation and Laplace filtering, comprising:

[0006] Obtaining the image to be smoothed;

[0007] Inputting the image to be smoothed into a first image smoothing model, and solving the first image smoothing model to obtain an initial smoothing result corresponding to the image to be smoothed;

[0008] Inputting the initial smoothing result into a second image smoothing model, and iteratively solving the second image smoothing model to obtain a target smoothing result corresponding to the image to be smoothed;

[0009] Wherein, the first image smoothing model includes a first data fidelity term and a regularization term, the first data fidelity term is determined based on the image to be smoothed and the initial smoothing result, and the regularization term is determined based on a windowed total variation parameter and a windowed intrinsic variation parameter;

[0010] The second image smoothing model includes a second data fidelity term and the regularization term, wherein the second data fidelity term is determined based on a weighted sum of a previous smoothing result obtained in a previous iteration and a residual image of the previous smoothing result, and a current smoothing result obtained in a current iteration, wherein the residual image of the previous smoothing result is obtained based on Laplace filtering of the previous smoothing result.

[0011] According to an image smoothing method based on relative total variation and Laplace filtering provided by the present invention, the residual image of the previous smoothing result is determined based on the following steps:

[0012] Performing Laplace filtering on the previous smoothing result to obtain a filtering result;

[0013] Multiplying the filtering result by the target coefficient to obtain a residual image of the previous smoothing result;

[0014] The target coefficient takes a value of 1 when the center point pixel value of the convolution kernel used in Laplace filtering is greater than 0, and takes a value of -1 when the center point pixel value is less than or equal to 0.

[0015] According to an image smoothing method based on relative total variation and Laplace filtering provided by the present invention, the windowing total variation parameters include x-direction windowing total variation parameters and y-direction windowing total variation parameters, and the windowing intrinsic variation parameters include x-direction windowing intrinsic variation parameters and y-direction windowing intrinsic variation parameters;

[0016] The regularization term is determined based on a first ratio of the x-direction windowed total variation parameter to a first parameter and a second ratio of the y-direction windowed total variation parameter to a second parameter;

[0017] The first parameter is the sum of the x-direction windowed intrinsic variation parameter and the target value;

[0018] The second parameter is the sum of the y-direction windowed intrinsic variation parameter and the target value.

[0019] According to an image smoothing method based on relative total variation and Laplace filtering provided by the present invention, for any image smoothing model of the first image smoothing model and the second image smoothing model, any image smoothing model is solved based on the following steps:

[0020] For any ratio of the first ratio and the second ratio in any image smoothing model, decomposing the any ratio into a nonlinear term and a quadratic term;

[0021] Substituting the nonlinear term and the quadratic term into any one of the image smoothing models to obtain an alternative smoothing model;

[0022] The candidate smoothing model is converted into a matrix form, and the candidate smoothing model in the matrix form is solved to obtain a smoothing result corresponding to any one of the image smoothing models.

[0023] According to an image smoothing method based on relative total variation and Laplace filtering provided by the present invention, solving the candidate smoothing model in matrix form to obtain a smoothing result corresponding to any image smoothing model includes:

[0024] Let the value of the alternative smoothing model in matrix form be 0, and obtain the linear model;

[0025] The linear model is solved iteratively by minimization to obtain a smoothing result corresponding to any image smoothing model.

[0026] According to an image smoothing method based on relative total variation and Laplace filtering provided by the present invention, the second image smoothing model is expressed based on the following formula:

[0027] ;

[0028] in, is the current smoothing result, p is The pth pixel in is the weighted summation result, is the weight coefficient of the regularization term, A is the regularization term, is the second data fidelity item; is the previous smoothing result, for The weight coefficient of for The residual image of represents the i-th iteration.

[0029] The present invention also provides an image smoothing device based on relative total variation and Laplace filtering, comprising:

[0030] An image acquisition module, used for acquiring an image to be smoothed;

[0031] A first solving module, used for inputting the image to be smoothed into a first image smoothing model, and solving the first image smoothing model to obtain an initial smoothing result corresponding to the image to be smoothed;

[0032] A second solving module, used for inputting the initial smoothing result into a second image smoothing model, and iteratively solving the second image smoothing model to obtain a target smoothing result corresponding to the image to be smoothed;

[0033] Wherein, the first image smoothing model includes a first data fidelity term and a regularization term, the first data fidelity term is determined based on the image to be smoothed and the initial smoothing result, and the regularization term is determined based on a windowed total variation parameter and a windowed intrinsic variation parameter;

[0034] The second image smoothing model includes a second data fidelity term and the regularization term, wherein the second data fidelity term is determined based on a weighted sum of a previous smoothing result obtained in a previous iteration and a residual image of the previous smoothing result, and a current smoothing result obtained in a current iteration, wherein the residual image of the previous smoothing result is obtained based on Laplace filtering of the previous smoothing result.

[0035] According to the present invention, an image smoothing device based on relative total variation and Laplace filtering further includes a residual image determination module, which is used to:

[0036] Performing Laplace filtering on the previous smoothing result to obtain a filtering result;

[0037] Multiplying the filtering result by the target coefficient to obtain a residual image of the previous smoothing result;

[0038] The target coefficient takes a value of 1 when the center point pixel value of the convolution kernel used in Laplace filtering is greater than 0, and takes a value of -1 when the center point pixel value is less than or equal to 0.

[0039] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, an image smoothing method based on relative total variation and Laplace filtering as described above is implemented.

[0040] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described image smoothing methods based on relative total variation and Laplace filtering.

[0041] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the image smoothing method based on relative total variation and Laplace filtering as described above is implemented.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] The image smoothing method and device based on relative total variation and Laplace filtering provided by the present invention combine the relative total variation model with the Laplace filtering by applying the first image smoothing model and the second image smoothing model, fully utilizing the advantage of the relative total variation model in distinguishing between structure and texture, and continuously compensating for the edge structure loss caused by the relative total variation model through Laplace filtering, so as to achieve an excellent balance between retaining the edge of the detection target structure and improving the background smoothness, achieve a more significant smoothing effect, improve image quality, reduce interference factors, thereby improving the accuracy and robustness of industrial assembly line product detection, and providing more reliable data and a higher level of automation for industrial production and manufacturing. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on the drawings in the following description without paying any creative work.

[0045] Figure 1 It is a flow chart of an image smoothing method based on relative total variation and Laplace filtering provided by the present invention;

[0046] Figure 2 It is a structural schematic diagram of an image smoothing device based on relative total variation and Laplace filtering provided by the present invention;

[0047] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] Figure 1 FIG. 1 is a flow chart of an image smoothing method based on relative total variation and Laplace filtering provided in an embodiment of the present invention. Figure 1 As shown, the method includes:

[0050] S1, obtaining the image to be smoothed;

[0051] S2, inputting the image to be smoothed into a first image smoothing model, and solving the first image smoothing model to obtain an initial smoothing result corresponding to the image to be smoothed;

[0052] S3, inputting the initial smoothing result into a second image smoothing model, and iteratively solving the second image smoothing model to obtain a target smoothing result corresponding to the image to be smoothed;

[0053] Wherein, the first image smoothing model includes a first data fidelity term and a regularization term, the first data fidelity term is determined based on the image to be smoothed and the initial smoothing result, and the regularization term is determined based on a windowed total variation parameter and a windowed intrinsic variation parameter;

[0054] The second image smoothing model includes a second data fidelity term and the regularization term, wherein the second data fidelity term is determined based on a weighted sum of a previous smoothing result obtained in a previous iteration and a residual image of the previous smoothing result, and a current smoothing result obtained in a current iteration, wherein the residual image of the previous smoothing result is obtained based on Laplace filtering of the previous smoothing result.

[0055] Specifically, the image smoothing method based on relative total variation and Laplace filtering provided in an embodiment of the present invention is executed by an image smoothing device based on relative total variation and Laplace filtering. The device can be configured in a computer, which can be a local computer or a cloud computer. The local computer can be a computer, a tablet, etc., which is not specifically limited here.

[0056] First, step S1 is performed to obtain an image to be smoothed. The image to be smoothed may be an image under uniform light that needs to be smoothed, for example, an image under uniform illumination conditions obtained in various application scenarios. The image to be smoothed may be acquired by an industrial camera and transmitted to an image smoothing device based on relative total variation and Laplace filtering.

[0057] Then, step S2 is executed to input the image to be smoothed into the first image smoothing model, and the first image smoothing model is solved to obtain an initial smoothing result corresponding to the image to be smoothed.

[0058] The first image smoothing model may include a first data fidelity term and a regularization term, the first data fidelity term is determined by the image to be smoothed and the initial smoothing result, and the regularization term is determined by a windowed total variation parameter and a windowed intrinsic variation parameter.

[0059] The functional of the first image smoothing model can be expressed by the following formula:

[0060] ;

[0061] Wherein, S is the smoothing result output by the first image smoothing model, the final value obtained by solving the first image smoothing model is the initial smoothing result, p is the pth pixel in S, is the pixel value of the pth pixel in S, is the pixel value of the pth pixel in the image I to be smoothed, is the weight coefficient of the regularization term. is the first data fidelity term, which can ensure that the image to be smoothed does not seriously differ from the initial smoothing result obtained by solving. A is a regularization term, which is used to control the decomposition of the structure and texture of the initial smoothing result.

[0062] The regularization term A can be determined based on a windowed total variation (WTV) parameter and a windowed inherent variation (WIV) parameter. The windowed total variation parameter includes an x-direction windowed total variation parameter and a y-direction windowed total variation parameter. The windowed inherent variation parameter includes an x-direction windowed inherent variation parameter and a y-direction windowed inherent variation parameter.

[0063] The regularization term can be determined by a first ratio of the x-direction windowed total variation parameter to the first parameter and a second ratio of the y-direction windowed total variation parameter to the second parameter. For example, the sum of the first ratio and the second ratio can be used as the regularization term.

[0064] Here, the first parameter may be the sum of the x-direction windowing intrinsic variation parameter and the target value, and the target value may be a small positive number to prevent the x-direction windowing intrinsic variation parameter from being divided by 0. The second parameter may be the sum of the y-direction windowing intrinsic variation parameter and the target value.

[0065] The regularization term can be expressed as:

[0066] ;

[0067] in, is the x-direction windowed total variation parameter at pixel p, is the windowed total variation parameter in the y direction at pixel p; is the x-direction windowed intrinsic variational parameter at pixel p, is the windowed intrinsic variational parameter in the y direction at pixel p, is the target value; is the first ratio, is the second ratio.

[0068] , The calculation formula can be expressed as:

[0069] ;

[0070] ;

[0071] in, is the rectangular area centered on pixel p, and q is For each pixel in is the weight function defined according to spatial affinity, is the pixel value at pixel p, is the pixel value at pixel q, is the spatial scale of the window. Since both detail pixels and structure pixels produce larger windowed total variation parameters, this indicates that the windowed total variation parameters respond to visual saliency.

[0072] , The calculation formula can be expressed as:

[0073] ;

[0074] ;

[0075] Therefore, the windowed intrinsic variation parameters represent the overall spatial variation, and the windowed intrinsic variation parameters calculated for a window containing only texture are usually smaller than the windowed intrinsic variation parameters calculated for a window containing structure.

[0076] Based on this, the functional of the first image smoothing model can be expressed as:

[0077] .

[0078] The first image smoothing model is a relative total variation (RTV) model. Due to the characteristics of the windowed total variation parameter and the windowed intrinsic variation parameter, the first image smoothing model can simply and effectively remove the texture in the image to be smoothed and highlight the main structure.

[0079] By executing step S1, an initial smoothing result corresponding to the image to be smoothed is obtained, but textures and structures with similar scales in the image to be smoothed cannot be well distinguished, and most textures and a small part of small-scale structures may be lost.

[0080] In view of the situation where most of the texture and a small part of the small-scale structure are lost, inspired by the Laplace pyramid, in an embodiment of the present invention, the concept of residual is introduced into the global optimization iteration framework to obtain a second image smoothing model based on the combination of global optimization iteration and residual. The second image smoothing model fuses the initial smoothing result obtained by the first image smoothing model with its residual image as the input image for the next iteration.

[0081] The second image smoothing model may include a second data fidelity term and a regularization term, wherein the second data fidelity term is determined by a weighted sum of a previous smoothing result obtained in a previous iteration and a residual image of the previous smoothing result, and a current smoothing result obtained in a current iteration. The regularization term of the second image smoothing model may be the same as the regularization term of the first image smoothing model. The second image smoothing model may be represented by the following formula:

[0082] ;

[0083] in, is the current smoothing result, p is The pth pixel in is the weighted summation result, is the weight coefficient of the regularization term, A is the regularization term, is the second data fidelity item; is the previous smoothing result, for The weight coefficient is a predetermined value. for The residual image of represents the i-th iteration.

[0084] When i=2, we have: ;

[0085] in, is the initial smoothing result, is the residual image of the initial smoothing result, It is the weighted sum of the initial smoothing result and its residual image.

[0086] In the embodiment of the present invention, the residual image of the previous smoothing result The previous smoothing result can be Perform Laplace filtering to obtain .

[0087] The residual image obtained after Laplacian filtering represents the residual information in the original image, and contains high-frequency detail information similar to a certain level in the Laplacian pyramid. To simplify the calculation here, the residual image obtained by applying the Laplacian filter to the previous smoothing result is Substitute into the first image smoothing model.

[0088] Here, we can apply the Laplace filter operator to the previous smoothing result. , to achieve the previous smoothing result Laplace filtering.

[0089] The Laplace filter operator can usually be regarded as calculating the residual or edge information of the image, which is used to emphasize the high-frequency details and edge features in the image, which usually correspond to the changes or residuals in the image. The effect achieved after Laplace filtering is that the average brightness of the image (i.e., the low-frequency part) is suppressed, while the edges and high-frequency details (i.e., the high-frequency components) are emphasized.

[0090] The image smoothing method based on relative total variation and Laplace filtering provided in the embodiment of the present invention first obtains the image to be smoothed; then the image to be smoothed is input into the first image smoothing model, and the first image smoothing model is solved to obtain the initial smoothing result corresponding to the image to be smoothed; finally, the initial smoothing result is input into the second image smoothing model, and the second image smoothing model is iteratively solved to obtain the target smoothing result corresponding to the image to be smoothed. The first image smoothing model used in the method includes a first data fidelity term and a regularization term, the first data fidelity term is determined based on the image to be smoothed and the initial smoothing result, and the regularization term is determined based on the windowed total variation parameter and the windowed intrinsic variation parameter. The second image smoothing model includes a second data fidelity term and the regularization term, the second data fidelity term is determined based on the weighted sum of the previous smoothing result obtained in the previous iteration and the residual image of the previous smoothing result, and the current smoothing result obtained in the current iteration, and the residual image of the previous smoothing result is obtained based on Laplace filtering of the previous smoothing result. By applying the first image smoothing model and the second image smoothing model, the relative total variation model is combined with the Laplace filter, and the advantage of the relative total variation model in distinguishing structure and texture is fully utilized. The edge structure loss caused by the relative total variation model is continuously compensated by the Laplace filter. An excellent balance can be achieved between retaining the edge of the detection target structure and improving the background smoothness, achieving a more significant smoothing effect, improving image quality, and reducing interference factors, thereby improving the accuracy and robustness of industrial assembly line product detection, and providing more reliable data and a higher level of automation for industrial production and manufacturing.

[0091] Based on the above embodiment, the residual image of the previous smoothing result is determined based on the following steps:

[0092] Performing Laplace filtering on the previous smoothing result to obtain a filtering result;

[0093] Multiplying the filtering result by the target coefficient to obtain a residual image of the previous smoothing result;

[0094] The target coefficient takes a value of 1 when the center point pixel value of the convolution kernel used in Laplace filtering is greater than 0, and takes a value of -1 when the center point pixel value is less than or equal to 0.

[0095] Specifically, the residual image of the previous smoothing result It can be expressed as:

[0096] ;

[0097] in, is the filtering result, is the target coefficient.

[0098] Here, the previous smoothing result Laplace filtering can be understood as smoothing the previous result through the Laplace operator. A convolution operation is performed on the pixels to compute the difference, or residual, between each pixel and its surrounding pixels.

[0099] It can be expressed as:

[0100] ;

[0101] Among them, x and y represent the previous smoothing results. The position coordinates of a pixel in .

[0102] The Laplace operator can be regarded as a convolution kernel. The two common forms of convolution kernels are as follows:

[0103] ; .

[0104] Taking the convolution kernel in the first form as an example, the second-order derivative of the Laplace operator is approximately:

[0105] ;

[0106] ;

[0107] So we have:

[0108] ;

[0109] in, The previous smoothing result The coordinates of the position are The pixel value of The previous smoothing result The coordinates of the position are The pixel value of The previous smoothing result The coordinates of the position are The pixel value of The previous smoothing result The coordinates of the position are The pixel value of The previous smoothing result The coordinates of the position are The pixel value of .

[0110] The target coefficient c takes the value of 1 when the pixel value of the center point of the convolution kernel used in Laplace filtering is greater than 0, and takes the value of -1 when the pixel value of the center point is less than or equal to 0. That is:

[0111] ;

[0112] in, is the pixel value at the center of the convolution kernel.

[0113] On the basis of the above embodiment, for any image smoothing model of the first image smoothing model and the second image smoothing model, any image smoothing model is solved based on the following steps:

[0114] For any ratio of the first ratio and the second ratio in any image smoothing model, decomposing the any ratio into a nonlinear term and a quadratic term;

[0115] Substituting the nonlinear term and the quadratic term into any one of the image smoothing models to obtain an alternative smoothing model;

[0116] The candidate smoothing model is converted into a matrix form, and the candidate smoothing model in the matrix form is solved to obtain a smoothing result corresponding to any one of the image smoothing models.

[0117] Specifically, since the first image smoothing model and the second image smoothing model use the same regularization term, the same steps can be used to solve the first image smoothing model and the second image smoothing model, that is, any image smoothing model in the first image smoothing model and the second image smoothing model can be solved by the same steps.

[0118] Here, for any ratio of the first ratio and the second ratio in any image smoothing model, any ratio can be decomposed into a nonlinear term and a quadratic term.

[0119] Taking the first ratio in the first image smoothing model as an example, we have:

[0120] ;

[0121] in, is a quadratic term, and are all nonlinear terms, and there are:

[0122] ;

[0123] ;

[0124] in, is the Gaussian filter operator.

[0125] Thereafter, the nonlinear terms and quadratic terms obtained by decomposition are substituted into any image smoothing model to obtain an alternative smoothing model.

[0126] Then, the alternative smoothing model can be converted into a matrix form, and the alternative smoothing model in matrix form can be expressed as:

[0127] ;

[0128] in, and are the vector representations of S and I respectively, and is the Toeplitz matrix of the discrete gradient operator, , , and is a diagonal matrix, and , , and The diagonal values ​​of , , and correspond.

[0129] After that, the alternative smoothing model in matrix form is solved to obtain the smoothing result corresponding to any image smoothing model. At this time, the value of the alternative smoothing model in matrix form can be set to 0 to obtain a linear model.

[0130] The linear model can be:

[0131] ;

[0132] in, is the identity matrix, For vector-based The weight matrix for the tth iteration is calculated, is a symmetric positive definite Laplace matrix, is the smoothed result obtained at the tth iteration.

[0133] use , , and The value of can be used to minimize the linear model iteratively, and the smoothing result corresponding to any image smoothing model can be obtained.

[0134] like Figure 2As shown, based on the above embodiment, an image smoothing device based on relative total variation and Laplace filtering is provided in an embodiment of the present invention, including:

[0135] An image acquisition module 21, used to acquire an image to be smoothed;

[0136] A first solving module 22, used for inputting the image to be smoothed into a first image smoothing model, and solving the first image smoothing model to obtain an initial smoothing result corresponding to the image to be smoothed;

[0137] A second solving module 23, used for inputting the initial smoothing result into a second image smoothing model, and iteratively solving the second image smoothing model to obtain a target smoothing result corresponding to the image to be smoothed;

[0138] Wherein, the first image smoothing model includes a first data fidelity term and a regularization term, the first data fidelity term is determined based on the image to be smoothed and the initial smoothing result, and the regularization term is determined based on a windowed total variation parameter and a windowed intrinsic variation parameter;

[0139] The second image smoothing model includes a second data fidelity term and the regularization term, wherein the second data fidelity term is determined based on a weighted sum of a previous smoothing result obtained in a previous iteration and a residual image of the previous smoothing result, and a current smoothing result obtained in a current iteration, wherein the residual image of the previous smoothing result is obtained based on Laplace filtering of the previous smoothing result.

[0140] On the basis of the above-mentioned embodiment, the image smoothing device based on relative total variation and Laplace filtering provided in the embodiment of the present invention further includes a residual image determination module, which is used to:

[0141] Performing Laplace filtering on the previous smoothing result to obtain a filtering result;

[0142] Multiplying the filtering result by the target coefficient to obtain a residual image of the previous smoothing result;

[0143] The target coefficient takes a value of 1 when the center point pixel value of the convolution kernel used in Laplace filtering is greater than 0, and takes a value of -1 when the center point pixel value is less than or equal to 0.

[0144] On the basis of the above embodiments, in the image smoothing device based on relative total variation and Laplace filtering provided in the embodiments of the present invention, the windowing total variation parameters include x-direction windowing total variation parameters and y-direction windowing total variation parameters, and the windowing inherent variation parameters include x-direction windowing inherent variation parameters and y-direction windowing inherent variation parameters;

[0145] The regularization term is determined based on a first ratio of the x-direction windowed total variation parameter to a first parameter and a second ratio of the y-direction windowed total variation parameter to a second parameter;

[0146] The first parameter is the sum of the x-direction windowed intrinsic variation parameter and the target value;

[0147] The second parameter is the sum of the y-direction windowed intrinsic variation parameter and the target value.

[0148] On the basis of the above embodiments, the image smoothing device based on relative total variation and Laplace filtering provided in the embodiments of the present invention is used for any one of the first solution module and the second solution module:

[0149] For any ratio of the first ratio and the second ratio in any image smoothing model, decomposing the any ratio into a nonlinear term and a quadratic term;

[0150] Substituting the nonlinear term and the quadratic term into any one of the image smoothing models to obtain an alternative smoothing model;

[0151] The candidate smoothing model is converted into a matrix form, and the candidate smoothing model in the matrix form is solved to obtain a smoothing result corresponding to any one of the image smoothing models.

[0152] On the basis of the above embodiments, in the image smoothing device based on relative total variation and Laplace filtering provided in the embodiments of the present invention, any one of the solution modules is specifically used for:

[0153] Let the value of the alternative smoothing model in matrix form be 0, and obtain the linear model;

[0154] The linear model is solved iteratively by minimization to obtain a smoothing result corresponding to any image smoothing model.

[0155] On the basis of the above-mentioned embodiment, in the image smoothing device based on relative total variation and Laplace filtering provided in the embodiment of the present invention, the second image smoothing model is expressed based on the following formula:

[0156] ;

[0157] in, is the current smoothing result, p is The pth pixel in is the weighted summation result, is the weight coefficient of the regularization term, A is the regularization term, is the second data fidelity item; is the previous smoothing result, for The weight coefficient of for The residual image of represents the i-th iteration.

[0158] Specifically, the functions of each module in the image smoothing device based on relative total variation and Laplace filtering provided in the embodiment of the present invention correspond one-to-one to the operation flow of each step in the above-mentioned method embodiment, and the effects achieved are also consistent. Please refer to the above-mentioned embodiment for details, and no further details will be given in the embodiment of the present invention.

[0159] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor (Processor) 310, a communication interface (Communications Interface) 320, a memory (Memory) 330 and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the image smoothing method based on relative total variation and Laplace filtering provided in the above embodiments.

[0160] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0161] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the image smoothing method based on relative total variation and Laplace filtering provided in the above embodiments.

[0162] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the image smoothing method based on relative total variation and Laplace filtering provided in the above embodiments.

[0163] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0164] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An image smoothing method based on relative total variation and Laplace filtering, It is characterized in that include: Obtaining the image to be smoothed; Inputting the image to be smoothed into a first image smoothing model, and solving the first image smoothing model to obtain an initial smoothing result corresponding to the image to be smoothed; Inputting the initial smoothing result into a second image smoothing model, and iteratively solving the second image smoothing model to obtain a target smoothing result corresponding to the image to be smoothed; Wherein, the first image smoothing model includes a first data fidelity term and a regularization term, the first data fidelity term is determined based on the image to be smoothed and the initial smoothing result, and the regularization term is determined based on a windowed total variation parameter and a windowed intrinsic variation parameter; The second image smoothing model includes a second data fidelity term and the regularization term, the second data fidelity term is determined based on a weighted sum of a previous smoothing result obtained in a previous iteration and a residual image of the previous smoothing result, and a current smoothing result obtained in a current iteration, the residual image of the previous smoothing result is obtained based on Laplace filtering of the previous smoothing result; The residual image of the previous smoothing result is determined based on the following steps: Performing Laplace filtering on the previous smoothing result to obtain a filtering result; Multiplying the filtering result by the target coefficient to obtain a residual image of the previous smoothing result; The target coefficient takes a value of 1 when the center point pixel value of the convolution kernel used in Laplace filtering is greater than 0, and takes a value of -1 when the center point pixel value is less than or equal to 0.

2. The image smoothing method based on relative total variation and Laplace filtering according to claim 1, It is characterized in that The windowing total variation parameters include x-direction windowing total variation parameters and y-direction windowing total variation parameters, and the windowing intrinsic variation parameters include x-direction windowing intrinsic variation parameters and y-direction windowing intrinsic variation parameters; The regularization term is determined based on a first ratio of the x-direction windowed total variation parameter to a first parameter and a second ratio of the y-direction windowed total variation parameter to a second parameter; The first parameter is the sum of the x-direction windowed intrinsic variation parameter and the target value; The second parameter is the sum of the y-direction windowed intrinsic variation parameter and the target value.

3. The image smoothing method based on relative total variation and Laplace filtering according to claim 2, It is characterized in that For any image smoothing model of the first image smoothing model and the second image smoothing model, any image smoothing model is solved based on the following steps: For any ratio of the first ratio and the second ratio in any image smoothing model, decomposing the any ratio into a nonlinear term and a quadratic term; Substituting the nonlinear term and the quadratic term into any one of the image smoothing models to obtain an alternative smoothing model; The candidate smoothing model is converted into a matrix form, and the candidate smoothing model in the matrix form is solved to obtain a smoothing result corresponding to any one of the image smoothing models.

4. The image smoothing method based on relative total variation and Laplace filtering according to claim 3, It is characterized in that The step of solving the candidate smoothing model in matrix form to obtain a smoothing result corresponding to any one of the image smoothing models includes: Let the value of the alternative smoothing model in matrix form be 0, and obtain the linear model; The linear model is solved iteratively by minimization to obtain a smoothing result corresponding to any image smoothing model.

5. The image smoothing method based on relative total variation and Laplace filtering according to any one of claims 1 to 4, It is characterized in that The second image smoothing model is expressed based on the following formula: ; in, is the current smoothing result, p is The pth pixel in is the weighted summation result, is the weight coefficient of the regularization term, A is the regularization term, is the second data fidelity item; is the previous smoothing result, for The weight coefficient of for The residual image of represents the i-th iteration.

6. An image smoothing device based on relative total variation and Laplace filtering, It is characterized in that include: An image acquisition module, used for acquiring an image to be smoothed; A first solving module, used for inputting the image to be smoothed into a first image smoothing model, and solving the first image smoothing model to obtain an initial smoothing result corresponding to the image to be smoothed; A second solving module, used for inputting the initial smoothing result into a second image smoothing model, and iteratively solving the second image smoothing model to obtain a target smoothing result corresponding to the image to be smoothed; Wherein, the first image smoothing model includes a first data fidelity term and a regularization term, the first data fidelity term is determined based on the image to be smoothed and the initial smoothing result, and the regularization term is determined based on a windowed total variation parameter and a windowed intrinsic variation parameter; The second image smoothing model includes a second data fidelity term and the regularization term, the second data fidelity term is determined based on a weighted sum of a previous smoothing result obtained in a previous iteration and a residual image of the previous smoothing result, and a current smoothing result obtained in a current iteration, the residual image of the previous smoothing result is obtained based on Laplace filtering of the previous smoothing result; Also included is a residual image determination module for: Performing Laplace filtering on the previous smoothing result to obtain a filtering result; Multiplying the filtering result by the target coefficient to obtain a residual image of the previous smoothing result; The target coefficient takes a value of 1 when the center point pixel value of the convolution kernel used in Laplace filtering is greater than 0, and takes a value of -1 when the center point pixel value is less than or equal to 0.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the image smoothing method based on relative total variation and Laplace filtering as described in any one of claims 1 to 5 is implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the image smoothing method based on relative total variation and Laplace filtering as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Image smoothing method and target contour extraction method

    CN116739943A