Image denoising methods, devices, terminals and storage media
Through the multi-scale image boundary extraction algorithm based on structure tensor and adaptive exponential variational method, the problem of boundary information blurring and loss caused by image denoising methods in the existing technology is solved, the noise in smooth areas is reduced and the boundary information is retained, and efficient image denoising is achieved.
Patent Information
- Application Number
- CN202411351118.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-09-26
AI Technical Summary
Existing image denoising methods tend to reduce noise in smooth areas while blurring and losing information in boundary areas.
We employ a multi-scale image boundary extraction algorithm based on structure tensor and an adaptive exponential variational method. By acquiring the boundary information pointed to by image variables, we construct an adaptive exponential variational method to optimize the image, thereby reducing noise in smooth regions and preserving boundary information.
It effectively reduces noise in smooth areas of an image, avoids blurring and loss of information in boundary areas, and achieves efficient image denoising.
Smart Images

Figure CN119399054B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image denoising technology. More specifically, this application relates to an image denoising method, apparatus, terminal, and storage medium. Background Technology
[0002] In practical applications, images often contain noise, which is often intertwined with important structural information, making noise differentiation and removal challenging. Existing technologies typically employ the Total Variational Method (TVM) to remove noise from images. The TVM leverages the structural information characteristics of both ideal and noisy images to design an effective image denoising method. This method assumes that ideal images contain less structural information (such as boundaries) than noisy images, primarily because noise adds pseudo-structural information, a phenomenon particularly pronounced in smooth regions. Therefore, this method uses the minimization of the regularization term in the TVM to remove noise in these smooth regions. However, this noise removal process can lead to information blurring and loss in image boundary regions. Consequently, existing image denoising methods still cannot fully achieve the desired image denoising results. Summary of the Invention
[0003] The purpose of this application is to provide an image denoising method, apparatus, terminal, and storage medium that can reduce noise in smooth areas and avoid information blurring and loss in boundary areas, thereby efficiently achieving the image denoising task. This application is mainly achieved through the following technical solutions:
[0004] A first aspect of this application provides an image denoising method, comprising:
[0005] Acquire the image to be processed, and set the image variable to point to the image to be processed;
[0006] Set a predetermined value and number of loops, and initialize the number of loops to 1;
[0007] If the number of iterations is less than or equal to the predetermined value, the following steps are performed:
[0008] A multi-scale image boundary extraction algorithm based on structure tensor is used to extract the boundary information corresponding to the target point, wherein the target point is any pixel in the image pointed to by the image variable;
[0009] An adaptive exponential variational method is constructed based on the boundary information;
[0010] The image pointed to by the image variable is calculated using the adaptive exponential variational method to obtain an optimized image, and the image pointed to by the image variable is modified to the optimized image.
[0011] If the number of iterations equals the predetermined value, the optimized image is determined as the target denoised image, and the target denoised image is output.
[0012] If the predetermined value is not 1, the number of iterations is incremented by 1.
[0013] According to one embodiment of this application, the step of extracting boundary information corresponding to the target point using a multi-scale image boundary extraction algorithm based on structure tensor includes:
[0014] Calculate the structure tensor corresponding to the target point;
[0015] The structural tensor is subjected to eigenvalue decomposition to obtain the first eigenvalue and the second eigenvalue;
[0016] Set the first, second, and third parameters;
[0017] The boundary information is obtained based on the first feature value, the second feature value, the first parameter, the second parameter, and the third parameter.
[0018] According to one embodiment of this application, the step of calculating the structure tensor corresponding to the target point includes:
[0019] Calculate the first-order partial derivative of the target point in the x-direction;
[0020] Calculate the first-order partial derivative of the target point in the y-direction;
[0021] Calculate the Gaussian kernel corresponding to the target point;
[0022] The structure tensor corresponding to the target point is calculated based on the first-order partial derivative of the target point in the x-direction, the first-order partial derivative of the target point in the y-direction, and the Gaussian kernel.
[0023] According to one embodiment of this application, the formula for calculating the structure tensor is:
[0024]
[0025] Among them, K σ The Gaussian kernel is defined as I; I is a single-channel image, i.e., the image pointed to by the image variable; ω is the target point. The image variable refers to the spatial range of the image it points to, that is, the pixel space of the image it points to or the set of pixels of the image it points to; J x (ω) is the first-order partial derivative of the target point in the x-direction; I y (ω) is the first-order partial derivative of the target point in the y-direction; For the target point at x The square of the first partial derivative in the direction; The square of the first-order partial derivative of the target point in the y-direction; The gradient of the target point in the image pointed to by the image variable; for The transpose of ; * represents the convolution operation.
[0026] According to one embodiment of this application, the step of constructing an adaptive exponential variational method based on the boundary information includes:
[0027] The adaptive index of the target point is calculated using the boundary information;
[0028] The adaptive exponential variational method is constructed based on the adaptive exponent and the total variational method.
[0029] According to one embodiment of this application, the calculation formula of the adaptive exponential variational method is as follows:
[0030]
[0031] Among them, u * Represents the target denoised image; arg min represents the minimum value search function; E p (u) represents the energy function; u represents a possible denoised image, i.e., the optimized image; U represents the set of all possible denoised images, i.e., the set of optimized images; The gradient of u; represents the regularization term; p(S(ω)) represents the adaptive exponent; Y represents the image to be processed, i.e., the noisy image; Represents the data fidelity factor; γ represents the regularization parameter; It represents the spatial range of the image pointed to by the image variable, that is, the pixel space of the image pointed to by the image variable or the set of pixels of the image pointed to by the image variable.
[0032] According to one embodiment of this application, the energy function satisfies the following Euler-Lagrange equation:
[0033]
[0034] Where u represents the possible denoised image, i.e., the optimized image; E p (u) represents the energy function; E p (u) Partial derivative with respect to u; u x This represents the first-order partial derivative of u in the x-direction; E p (u) about ux The partial derivatives; represent Partial derivative in the x-direction; u y This represents the first-order partial derivative of u in the y-direction; E p (u) about u y The partial derivatives; represent Partial derivative in the y-direction.
[0035] A second aspect of this application provides an image denoising apparatus, comprising:
[0036] The image acquisition module is used to acquire the image to be processed and set an image variable to point to the image to be processed;
[0037] The setting module is used to set a predetermined value and the number of loops, and initialize the number of loops to 1;
[0038] The loop module is configured to perform the following steps when the number of loop iterations is less than or equal to a predetermined value: extracting boundary information corresponding to the target point using a multi-scale image boundary extraction algorithm based on structure tensors, wherein the target point is any pixel in the image pointed to by the image variable; constructing an adaptive exponential variational method based on the boundary information; calculating the image pointed to by the image variable using the adaptive exponential variational method to obtain an optimized image, and modifying the image pointed to by the image variable to the optimized image; determining the optimized image as the target denoised image when the number of loop iterations is equal to the predetermined value, and outputting the target denoised image; and incrementing the number of loop iterations by 1 when the predetermined value is not 1.
[0039] A third aspect of this application provides a terminal device, including a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to perform the steps of the image denoising method described in the first aspect of this application.
[0040] A fourth aspect of this application provides a computer-readable storage medium for storing a computer program that causes a computer to perform the steps of the image denoising method described in the first aspect of this application.
[0041] The beneficial effects of the embodiments of this application include at least the following:
[0042] This application embodiment improves the regularization term of the total variational method by using image boundary information, so that the improved method can adaptively process smooth and boundary regions in the image. Specifically, this application embodiment obtains the image to be processed and sets an image variable to point to the image to be processed; sets a predetermined value and a number of iterations, and initializes the number of iterations to 1; when the number of iterations is less than or equal to the predetermined value, the following steps are performed: extracting the boundary information corresponding to the target point using a multi-scale image boundary extraction algorithm based on structure tensor, wherein the target point is any pixel in the image pointed to by the image variable; constructing an adaptive exponential variational method based on the boundary information; calculating the image pointed to by the image variable using the adaptive exponential variational method to obtain an optimized image, and modifying the image pointed to by the image variable to the optimized image; when the number of iterations is equal to the predetermined value, determining the optimized image as the target denoised image, and outputting the target denoised image; when the predetermined value is not 1, incrementing the number of iterations by 1. Therefore, the embodiments of this application can simultaneously take into account both smooth regions and boundary regions in the image. Compared with the prior art, the embodiments of this application can not only reduce noise in smooth regions of the image, but also avoid information blurring and loss in boundary regions, thereby efficiently achieving the image denoising task. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the conventional technology, the drawings used in the description of the embodiments or the conventional technology will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 Here are flowcharts of some embodiments of the image denoising method of this application;
[0045] Figure 2 Here are flowcharts of the image denoising method of this application in other embodiments;
[0046] Figure 3 This is a reference image of the image to be processed in this application;
[0047] Figure 4 This is a reference image for the ideal image in this application;
[0048] Figure 5 This is a reference image for the target denoised image in this application;
[0049] Figure 6 This is a reference image for the target denoised image in this application;
[0050] Figure 7 Here are some schematic block diagrams of the image denoising apparatus of this application in some embodiments;
[0051] Figure 8 This is a schematic block diagram of the terminal device of this application in some embodiments. Detailed Implementation
[0052] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application are described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.
[0053] It should be noted that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0054] The terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0055] The terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are expressly listed, but may include other steps or units that are not expressly listed or that are inherent to such process, method, product, or apparatus.
[0056] Unless otherwise defined, all technical and scientific terms used in the specification of this application have the same meaning as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used in the specification of this application includes any and all combinations of one or more of the relevant listed items.
[0057] Because images are affected by various factors during the imaging process, noise is usually present in the acquired images. The formation process of a noisy image can be described as follows: Where X is the ideal image without noise, Y is the acquired noisy image, and ε is the noise in the image. Let Y be all the pixels in image Y, and ω be one of those pixels. From a formulaic perspective, the existence of noise is relatively simple. However, in actual images, noise is often intertwined with important structural information, making noise differentiation and removal challenging. Currently, image denoising techniques mainly include smoothing-based filtering, frequency domain methods based on spatial transformation, and optimization-iterative denoising algorithms. Specifically:
[0058] Smoothing-based filtering techniques remove noise by weighted averaging of similar structures. This type of method is most common in image denoising tasks. Initially, Gaussian filters defined correlation weights using the spatial distance between pixels and calculated the estimated value by weighted averaging of neighborhood values, thus smoothing and removing noise. Subsequently, to avoid the image boundary blurring problem caused by this weighting method, some researchers defined weights using the similarity between values. To avoid the influence of noise on the calculation of numerical similarity, weights were designed based on the differences in patch regions, thus avoiding boundary blurring to some extent. Although many researchers have improved the weights of such algorithms, the impact of noise on the accuracy of weight calculation remains a significant challenge.
[0059] Frequency domain methods based on spatial transforms analyze and remove noise by performing relevant transformations. Typically, images in the spatial domain are obtained through various methods. These images can be converted to transform domain data using other transformations (such as Fourier transform and discrete cosine transform). Frequency domain images are a common type of transform domain data. The saliency of noise characteristics differs between the spatial and transform domains. Therefore, by utilizing the properties of noise in the transform domain, appropriate transform domain filters can be designed to effectively remove noise. To further improve the denoising effect of transform domain filtering algorithms, frequency domain filtering algorithms are often used in conjunction with spatial domain filtering algorithms.
[0060] Denoising algorithms based on optimization iterations utilize the denoising results of the previous step to further improve the performance of the next step. Due to the influence of noise, directly calculating numerical similarity using noisy images cannot guarantee accuracy. Therefore, to accurately describe numerical similarity in ideal images, using preprocessing and iterative results for relevant calculations is a common denoising method. Total variational methods use the structural information in the image as an optimization function to progressively remove noise. This method is not constrained by the type of noise, and the algorithm does not change significantly with variations in noise type. Therefore, this type of algorithm has good universality.
[0061] However, the total variational method in optimization-based iterative denoising algorithms can lead to information blurring and loss in image boundary regions during the noise removal process. To address this issue, the inventors improved the regularization term of the total variational method using image boundary information, enabling the improved method to adaptively handle smooth and boundary regions in the image.
[0062] The specific embodiments of this application will be further described below with reference to the accompanying drawings.
[0063] <Image Denoising Methods>
[0064] like Figure 1 and Figure 2 The diagram shown is a flowchart of an image denoising method provided in the first aspect of an embodiment of this application. Figure 1 The image denoising method includes:
[0065] S1. Obtain the image to be processed and set the image variable to point to the image to be processed.
[0066] It should be noted that the image to be processed is a single-channel image. A single-channel image typically refers to a grayscale image or a binary image, where the color of each pixel is represented by a single numerical value, reflecting the brightness information of that pixel. In a grayscale image, the color of each pixel is represented by an 8-bit or 32-bit numerical value, ranging from 0 to 255, where 0 represents black, 255 represents white, and intermediate values represent different grayscale levels. This image mode is suitable for scenarios that do not require color information, such as black and white photographs, scanned documents, etc. Furthermore, a binary image is also a type of single-channel image; it has only two color levels: white and black, and is typically used to represent text or simple graphics in an image.
[0067] In the embodiments of this application, the image to be processed is still a noisy image, which can be referred to Figure 3 As shown.
[0068] S2. Set a predetermined value and number of loops, and initialize the number of loops to 1.
[0069] The predetermined value is a positive integer; for example, the predetermined value is 7 or 12. In other embodiments, the specific value of the predetermined value can be set by those skilled in the art according to actual needs, and this application embodiment does not further limit this. The predetermined value is in Figure 2 The terminator is represented by N, which is the termination condition.
[0070] The number of iterations is the number of times steps S4, S5, S6, S7, and S8 are executed.
[0071] S3. If the number of cycles is less than or equal to the predetermined value, perform the following steps S4, S5, S6, S7 and S8.
[0072] S4. A multi-scale image boundary extraction algorithm based on structure tensor is used to extract the boundary information corresponding to the target point, wherein the target point is any pixel in the image pointed to by the image variable.
[0073] Furthermore, the step of extracting the boundary information corresponding to the target point using a multi-scale image boundary extraction algorithm based on structure tensors includes:
[0074] S41. Calculate the structure tensor corresponding to the target point.
[0075] Further, step S41 includes:
[0076] S411. Calculate the first-order partial derivative of the target point in the x-direction.
[0077] S412. Calculate the first-order partial derivative of the target point in the y-direction.
[0078] S413. Calculate the Gaussian kernel corresponding to the target point.
[0079] S414. Calculate the structure tensor corresponding to the target point based on the first-order partial derivative of the target point in the x-direction, the first-order partial derivative of the target point in the y-direction, and the Gaussian kernel.
[0080] Steps S411 and S412 can be understood as follows: Figure 2 The step of "calculating the first-order partial derivatives of the image to be processed in each direction" in the S413 process. Step S413 can be understood as... Figure 2 The step of "calculating the Gaussian kernel of the structure tensor" is described in section S414. Step S414 can be understood as... Figure 2 The step in "Calculate all structure tensors in the image" is described.
[0081] Furthermore, the formula for calculating the structure tensor is:
[0082]
[0083] Where Kσ is the Gaussian kernel; I is a single-channel image, i.e., the image pointed to by the image variable; ω is the target point. The image variable refers to the spatial range of the image it points to, that is, the pixel space of the image it points to or the set of pixels of the image it points to; I x (ω) is the first-order partial derivative of the target point in the x-direction; I y (ω) is the first-order partial derivative of the target point in the y-direction; The square of the first-order partial derivative of the target point in the x-direction; The square of the first-order partial derivative of the target point in the y-direction; The gradient of the target point in the image pointed to by the image variable; for The transpose of ; * represents the convolution operation.
[0084] More specifically, the K σ It is a Gaussian kernel with a standard deviation of σ.
[0085] Further, Among them, K σ For the Gaussian kernel, Let W be the effective range of the Gaussian kernel, and x∈W be a point within the effective range of the Gaussian kernel. Let be the square of the first-order partial derivative of the target point in the x-direction.
[0086] It should be understood that the size of W is related to the noise level, and the impact of noise on the image can be reduced by adjusting the size of W.
[0087] As can be seen from the above formula for calculating the structure tensor, the structure tensor uses both gradient information and neighborhood information. The use of neighborhood information and its smoothing operation can reduce the impact of noise to a certain extent.
[0088] It should also be understood that, in the embodiments of this application, directly using the structure tensor to define the image boundary is quite complex. This is because the structure tensor provides image information in matrix form, while common image processing methods primarily use pixel values to complete tasks. Therefore, the calculation formula of the structure tensor cannot be directly applied to common image processing methods. However, the scalar information in the structure tensor can be extracted through dimensionality compression. As can be seen from the above definition (i.e., the calculation formula of the structure tensor), the structure tensor is a symmetric matrix. Therefore, the structure tensor is decomposable.
[0089] The multi-scale image boundary extraction algorithm based on structure tensor proposed in this application can reduce the impact of noise on the boundary by utilizing the multi-scale information in the structure tensor.
[0090] S42. Perform eigenvalue decomposition on the structure tensor to obtain the first eigenvalue and the second eigenvalue. Step S42 can be understood as follows: Figure 2 The step of “performing eigenvalue decomposition on the structure tensor” in the text.
[0091] The formula for calculating the eigenvalue decomposition of the structure tensor is as follows:
[0092]
[0093] Among them, VUV T Let e1 represent the eigenvalue decomposition of the structure tensor S(ω), e2 represent the first eigenvalue, e2 represent the second eigenvalue, v1 represent the eigenvector of e1, and v2 represent the eigenvector of e2. This represents the transpose of v1. This represents the transpose of v2. v1 and v2 constitute the characteristic matrix.
[0094] In the smooth region of the image pointed to by the image variable and the boundary region of the image pointed to by the image variable, the feature values also have different values. For example, the feature value of the structure tensor in the smooth region is close to 0, that is, the first feature value and the second feature value corresponding to the smooth region are close to 0.
[0095] In other embodiments, the step of extracting boundary information corresponding to the target point using a multi-scale image boundary extraction algorithm based on structure tensors further includes: saving the first feature value and the second feature value. (See reference) Figure 2 The "Save Results" step in the process.
[0096] S43. Set the first parameter, the second parameter, and the third parameter.
[0097] The first parameter is denoted by α1, the second parameter by α2, and the third parameter by α3. In other embodiments, the representation of the first, second, and third parameters can be set by those skilled in the art according to actual needs.
[0098] S44. Obtain the boundary information based on the first feature value, the second feature value, the first parameter, the second parameter, and the third parameter. This step can be referred to... Figure 2 The step in the text is "Calculate the multi-scale image boundary based on the structure tensor according to the formula".
[0099] It should be understood that, from a geometric perspective, there is a correspondence between the structure tensor and an ellipse. This is because the first and second eigenvalues can correspond to the two radius lengths of the ellipse, while the other eigenvector corresponds to the two radial directions of the ellipse.
[0100] To extract scalar information from the structural tensor while avoiding the loss of matrix information, this application designs the calculation formula for the boundary information as follows:
[0101]
[0102] Among them, c iThe multi-scale information corresponding to the structure tensor; α1 is the first parameter; e1 represents the first feature value; e2 represents the second feature value; e1+e2 as a whole describes the average size information of the structure tensor (ellipse), and the larger value corresponds to the boundary of the image pointed to by the image variable; The boundary properties in the structure tensor are described from the perspective of anisotropy; The average eigenvalues of the structure tensor; The relationship between the two eigenvalues of the structure tensor is described in terms of proportion. The minimum eigenvalue of the structure tensor. The largest eigenvalue of the structure tensor; ∈>0, ∈ is used to avoid the meaningless case where the denominator is equal to 0.
[0103] The formula for calculating the boundary information takes into account multiple perspectives and extracts multi-scale information from the structural tensor from multiple perspectives.
[0104] The multi-scale image boundary extraction algorithm based on structure tensors proposed in this application can, to some extent, compensate for the information error caused by dimensionality compression when using scalar information to describe matrix information, thereby improving the accuracy of information extraction and ultimately ensuring that the boundary information of the image can be well recovered during the denoising process.
[0105] S5. Construct an adaptive exponential variational method based on the boundary information.
[0106] Further, step S5 includes:
[0107] S51. Calculate the adaptive index of the target point using the boundary information. (Refer to...) Figure 2 The step in the text is "Calculate all adaptive exponents using image boundaries".
[0108] Specifically, the formula for calculating the adaptive index is as follows:
[0109] p(S(ω)0=1+e -C(ω) ;
[0110] Where p(S(ω)) is the adaptive exponent, which can also be understood as the exponential term of spatial adaptation; C(ω) is the boundary information, that is, the boundary defined based on the multi-scale information of the structure tensor; e is the natural constant with a value of 2.718.
[0111] The adaptive index can be adaptively adjusted based on the boundary information.
[0112] Furthermore, the adaptive exponent satisfies the following condition: 1 ≤ p(S(ω)) ≤ 2. Also, the boundary region (i.e., the edge region) satisfies the condition p(S(ω)) → 1, while the smooth region satisfies the condition p(S(ω)) → 2. The symbol "→" indicates a tendency towards.
[0113] S52. Construct the adaptive exponential variational method based on the adaptive exponent and the total variational method.
[0114] Specifically, the total variation method is a method used to describe the variation of a function or signal within its domain. In image processing, the total variation method is typically defined as the sum of the differences in grayscale values between adjacent pixels in an image; these differences can be in the horizontal, vertical, or diagonal direction. The total variation method achieves image denoising, deblurring, and other purposes by minimizing the total variation values of the image.
[0115] The calculation formula for the total variation method is as follows:
[0116]
[0117] Among them, u * Y represents the final denoised image; u represents a possible denoised image; U represents the set of all possible denoised images; E(u) represents the energy function. This represents a regularization term that is related to structural information in the image (i.e., a noisy image or a potentially denoised image); Let u represent the gradient of u. x Let u be the partial derivative of u in the x-direction. y γ represents the partial derivative of u in the y direction; γ is a parameter used to balance the regularization and fidelity terms. This represents the fidelity term, used to guide the minimization process using the noisy image Y; Represents the spatial extent of a noisy image.
[0118] It should be understood that the regularization term is related to the structural information in the image. Because noise adds pseudo-structural information to the image, the denoised image can be obtained by minimizing the energy function E(u). Furthermore, the process of minimizing structural information is guided by the intrinsic information of the image to be restored, rather than being a blind minimization.
[0119] The regularization term of the total variation method L was used 1 Regularized flow. The goal of image denoising is to remove noise from smooth regions as much as possible while accurately restoring the image's boundary information. However, formally speaking, the total variational method minimizes... During the process, it is difficult to distinguish between smooth regions and boundary regions, which can easily lead to the loss of image boundary information when noise in smooth regions is smoothed out. To address this deficiency, this application proposes an adaptive exponent based on the total variational method.
[0120] Variational method.
[0121] The calculation formula for the adaptive exponential variational method is as follows:
[0122]
[0123] Among them, u * Represents the target denoised image; arg min represents the minimum value search function; E p (u) represents the energy function; u represents a possible denoised image, i.e., the optimized image; U represents the set of all possible denoised images, i.e., the set of optimized images; The gradient of u; represents the regularization term; p(S(ω)) represents the adaptive exponent; Y represents the image to be processed, i.e., the noisy image; Represents the fidelity term; γ represents the regularization parameter; It represents the spatial range of the image pointed to by the image variable, that is, the pixel space of the image pointed to by the image variable or the set of pixels of the image pointed to by the image variable.
[0124] The target denoised image is the final denoised image.
[0125] The adaptive index is a spatially adaptive index term. The adaptive index can be calculated reasonably based on whether the region is a boundary region or a smooth region.
[0126] This is an exponential regularization term that automatically adjusts the degree of structure restoration and noise smoothing based on the local structure of the image, and can adaptively handle edges and flat regions to improve filtering performance. To obtain an acceptable restored image, the filtering method is designed to smooth flat regions while preserving edge information as much as possible.
[0127] The fidelity term is used to ensure that the optimized u is as close as possible to the original observation data Y.
[0128] The regularization parameter is the weight that balances the regularization term and the fidelity term.
[0129] The design of the adaptive exponential variational method can effectively distinguish between smooth regions and boundary regions in an image, and process these two regions reasonably according to the boundary information, thereby achieving effective smoothing of noise in smooth regions and reasonable preservation of boundary information, so as to improve the denoising effect of the image.
[0130] S6. Calculate the image pointed to by the image variable using the adaptive exponential variational method to obtain the optimized image, and modify the image pointed to by the image variable to the optimized image.
[0131] In this embodiment of the application, gradient descent is used to minimize the energy in the adaptive exponential variational method, and E p (u) takes an extreme value only if it satisfies the Euler-Lagrange equation.
[0132] Specifically, the energy function satisfies the following Euler-Lagrange equation:
[0133]
[0134] Where u represents the possible denoised image, i.e., the optimized image; E p (u) represents the energy function; E p (u) Partial derivative with respect to u; u x This represents the first-order partial derivative of u in the x-direction; E p (u) about u x The partial derivatives; represent Partial derivative in the x-direction; u y This represents the first-order partial derivative of u in the y-direction; E p (u) about u y The partial derivatives; represent Partial derivative in the y-direction.
[0135] In the embodiments of this application, the Euler-Lagrange equation is equivalent to Where γ represents the regularization parameter; u represents the possible denoised image, i.e. the optimized image; Y represents the image to be processed, i.e. the noisy image; and div represents the divergence applied to the vector. This represents the gradient of u.
[0136] Next, the time variable t is introduced to solve for E. p The gradient descent flow of (u) is calculated using the formula for the time variable t:
[0137]
[0138] Among them, u xx Let u be the second partial derivative of u in the x-direction; u yy Let be the second partial derivative of u in the y direction; Let be the square of the first-order partial derivative of u in the x-direction; Let u be the square of the first-order partial derivative of u in the y-direction; x Let u be the first-order partial derivative of u in the x-direction; u y Let be the first-order partial derivative of u in the y direction; γ is the regularization parameter; y(x,y,t) is the pixel with coordinates (x,u) on image u at time t; Y(x,y,t) is the pixel with coordinates (x,y) on image Y at time t. Let p be the gradient of the image u; p is the regularization term. The exponent of t. The calculation formula that introduces the time variable t can be understood as... Figure 2 The steps are "calculate the second-order partial derivative of the image" and "update according to the energy iteration formula to obtain the next iteration image".
[0139] It should be understood that during the iterative process of the calculation formula that introduces the time variable t, the image boundary region satisfies u(x,y,t)=0, and the image at the initial time satisfies u(x,y,00=Y(x,y).
[0140] S7. When the number of iterations is equal to the predetermined value, the optimized image is determined as the target denoised image, and the target denoised image is output.
[0141] S8. If the predetermined value is not 1, the number of iterations is incremented by 1.
[0142] In the above technical solution, the embodiments of this application can simultaneously take into account smooth areas and boundary areas in the image. Compared with the prior art, the embodiments of this application can not only reduce noise in smooth areas of the image, but also avoid information blurring and information loss in boundary areas, thereby efficiently achieving the image denoising task.
[0143] In other embodiments, the numerical difference between the maximum and minimum eigenvalues in the embodiments of this application... It can also be used as another way to describe boundary information in a structure tensor.
[0144] In practical applications, the effectiveness of the image denoising method can be seen in the following example:
[0145] refer to Figure 4 This is the ideal image; Figure 3The image is a noisy image (i.e., the image to be processed); if the predetermined value is set to 7, after 7 iterations, the target denoised image reference is obtained. Figure 5 As shown. After 7 iterations, the removed elements are... Figure 5 The image is displayed in the lower right corner. After 7 iterations, this application can effectively remove noise from the image, mainly showing that noise in smooth areas is effectively removed while boundary information is well preserved.
[0146] If the predetermined value is set to 12, and 12 iterations are performed, the target denoised image reference is obtained. Figure 6 As shown. After 12 iterations, the removed elements are... Figure 6 The image is shown in the lower right corner. After 12 iterations, noise in smooth areas was removed more effectively. Although some boundaries were blurred, the final denoising result was acceptable. Furthermore, the difference image shows that this application removed a significant amount of noise from the image, and structural information (such as boundaries) in the image was not mistakenly removed.
[0147] In summary, the embodiments of this application can indeed achieve the image denoising task, and the denoising effect is obvious.
[0148] Image Denoising Device
[0149] like Figure 7 The diagram shown is a schematic block diagram of an image denoising apparatus provided in the second aspect of an embodiment of this application. Figure 7 The image denoising device 800 includes:
[0150] The image acquisition module 801 is used to acquire the image to be processed and set an image variable to point to the image to be processed;
[0151] Setting module 802 is used to set a predetermined value and the number of cycles, and initialize the number of cycles to 1;
[0152] The loop module 803 is configured to perform the following steps when the number of loop iterations is less than or equal to a predetermined value: extracting boundary information corresponding to the target point using a multi-scale image boundary extraction algorithm based on structure tensors, wherein the target point is any pixel in the image pointed to by the image variable; constructing an adaptive exponential variational method based on the boundary information; calculating the image pointed to by the image variable using the adaptive exponential variational method to obtain an optimized image, and modifying the image pointed to by the image variable to the optimized image; determining the optimized image as the target denoised image when the number of loop iterations is equal to the predetermined value, and outputting the target denoised image; and incrementing the number of loop iterations by 1 when the predetermined value is not 1.
[0153] Terminal Equipment
[0154] A third aspect of this application provides a terminal device, the schematic diagram of which is as follows: Figure 8 As shown. The terminal device includes a processor, memory, network interface, display screen, and temperature sensor connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the terminal device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements an image denoising method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The temperature sensor is pre-installed inside the terminal device to detect the operating temperature of the internal components.
[0155] Those skilled in the art will understand that Figure 8 The block diagram shown is only a partial structural diagram related to the solution of this application and does not constitute a limitation on the terminal device on which the solution of this application is applied. The specific terminal device may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements.
[0156] In some embodiments, the terminal device includes a processor and a memory for storing computer programs. The processor is used to call and run the computer programs stored in the memory to perform the steps of the image denoising method provided in the first aspect of the embodiments of this application.
[0157] Computer-readable storage media
[0158] A fourth aspect of this application provides a computer-readable storage medium for storing a computer program that causes a computer to perform the steps of the image denoising method described in the first aspect of this application.
[0159] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0160] The technical features of the above embodiments can be combined without changing the basic principles of this application. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0161] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the patent protection scope of this application should be determined by the appended claims.
Claims
1. An image denoising method, characterized in that, include: Acquire the image to be processed, and set the image variable to point to the image to be processed; Set a predetermined value and number of loops, and initialize the number of loops to 1; If the number of iterations is less than or equal to the predetermined value, the following steps are performed: A multi-scale image boundary extraction algorithm based on structure tensor is used to extract the boundary information corresponding to the target point, wherein the target point is any pixel in the image pointed to by the image variable; An adaptive exponential variational method is constructed based on the boundary information; The image pointed to by the image variable is calculated using the adaptive exponential variational method to obtain an optimized image, and the image pointed to by the image variable is modified to the optimized image. If the number of iterations equals the predetermined value, the optimized image is determined as the target denoised image, and the target denoised image is output. If the predetermined value is not 1, the number of iterations is incremented by 1. The step of constructing an adaptive exponential variational method based on the boundary information includes: calculating the adaptive exponent of the target point using the boundary information; and constructing the adaptive exponential variational method based on the adaptive exponent and the total variational method. The calculation formula for the adaptive exponential variational method is as follows: ; in, This represents the denoised image of the target; This represents a function for finding the minimum value. Represents the energy function; This represents a possible denoised image, also known as the optimized image; This represents the set of all possible denoised images, which is also the set of optimized images; represent The gradient; Represents the regularization term; Represents the adaptive index; This represents the image to be processed, i.e., the noisy image; Represents data fidelity; Represents the regularization parameter; It represents the spatial range of the image pointed to by the image variable, that is, the pixel space of the image pointed to by the image variable or the set of pixels of the image pointed to by the image variable.
2. The image denoising method according to claim 1, characterized in that, The steps for extracting boundary information corresponding to target points using a multi-scale image boundary extraction algorithm based on structure tensors include: Calculate the structure tensor corresponding to the target point; The structural tensor is subjected to eigenvalue decomposition to obtain the first eigenvalue and the second eigenvalue; Set the first, second, and third parameters; The boundary information is obtained based on the first feature value, the second feature value, the first parameter, the second parameter, and the third parameter.
3. The image denoising method according to claim 2, characterized in that, The step of calculating the structure tensor corresponding to the target point includes: Calculate the target point at First-order partial derivative in the direction; Calculate the target point at First-order partial derivative in the direction; Calculate the Gaussian kernel corresponding to the target point; Based on the target point The first-order partial derivative in the direction, the target point in The first-order partial derivative in the direction and the Gaussian kernel are used to calculate the structure tensor corresponding to the target point.
4. The image denoising method according to claim 3, characterized in that, The formula for calculating the structure tensor is: ; in, The Gaussian kernel; It is a single-channel image, that is, the image pointed to by the image variable; For the target point, , The image variable refers to the spatial range of the image, that is, the pixel space of the image or the set of pixels of the image. For the target point in First-order partial derivative in the direction; For the target point in First-order partial derivative in the direction; For the target point in The square of the first partial derivative in the direction; For the target point in The square of the first partial derivative in the direction; The gradient of the target point in the image pointed to by the image variable; for Transpose of; This is a convolution operation.
5. The image denoising method according to claim 1, characterized in that, The energy function satisfies the following Euler-Lagrange equation: ; in, This represents a possible denoised image, also known as the optimized image; Represents the energy function; represent about The partial derivatives; represent exist First-order partial derivative in the direction; represent about The partial derivatives; represent exist Partial derivatives in the direction; represent exist First-order partial derivative in the direction; represent about The partial derivatives; represent exist Partial derivatives in the direction.
6. An image denoising device, characterized in that, include: The image acquisition module is used to acquire the image to be processed and set an image variable to point to the image to be processed; The setting module is used to set a predetermined value and the number of loops, and initialize the number of loops to 1; The loop module is configured to perform the following steps when the number of loop iterations is less than or equal to a predetermined value: extracting boundary information corresponding to the target point using a multi-scale image boundary extraction algorithm based on structure tensors, wherein the target point is any pixel in the image pointed to by the image variable; constructing an adaptive exponential variational method based on the boundary information; calculating the image pointed to by the image variable using the adaptive exponential variational method to obtain an optimized image, and modifying the image pointed to by the image variable to the optimized image; determining the optimized image as the target denoised image when the number of loop iterations is equal to the predetermined value, and outputting the target denoised image; incrementing the number of loop iterations by 1 when the predetermined value is not 1. The loop module is also used to calculate the adaptive exponent of the target point using the boundary information; and to construct the adaptive exponential variational method based on the adaptive exponent and the total variational method. The calculation formula for the adaptive exponential variational method is as follows: ; in, This represents the denoised image of the target; This represents a function for finding the minimum value. Represents the energy function; This represents a possible denoised image, also known as the optimized image; This represents the set of all possible denoised images, which is also the set of optimized images; represent The gradient; Represents the regularization term; Represents the adaptive index; This represents the image to be processed, i.e., the noisy image; Represents data fidelity; Represents the regularization parameter; It represents the spatial range of the image pointed to by the image variable, that is, the pixel space of the image pointed to by the image variable or the set of pixels of the image pointed to by the image variable.
7. A terminal device, characterized in that, include: A processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory to perform the steps of the image denoising method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, Used to store a computer program that causes a computer to perform the steps of the image denoising method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Total variation image denoising method based on adaptive weighted edge detection
CN113362257A
Image processing method based on transform domain denoising autoencoder as a priori
WO2022226886A1