Image optimization method, device and computer equipment based on total variation minimization
By expanding the image to be optimized and using the split Bregman iteration method in the image optimization method, the problems of large computational complexity and discontinuous data are solved, the efficiency of image optimization is improved and the continuity of data is achieved.
Patent Information
- Application Number
- CN202111330586.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-11
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-11-11
AI Technical Summary
Existing image optimization methods based on total variation minimization have problems such as large computational complexity, many iteration variables, and discontinuous image data, which affects processing efficiency.
By expanding the image to be optimized outward from the edge, the split Bregman iteration method is used to perform alternate iterative calculations in the expanded area to obtain the grayscale optimization value in the center area, ensuring the continuity of image data and reducing iteration variables.
It improves the efficiency of image optimization, reduces the amount of calculations and iteration variables, ensures the continuity of image data, provides a foundation for subsequent data parallelization, and improves processing efficiency by about 40%-60%.
Smart Images

Figure CN114022387B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image optimization method, device and computer equipment based on total variation minimization. Background Art
[0002] Images are an important means for humans to obtain, express and transmit information. High-quality images can provide people with more comprehensive and accurate information. However, in practical applications, due to the existence of various factors, various types of noise often exist in images. For example, in the medical field, the autonomous movement of patients may introduce motion artifacts; beam hardening of high-density materials may cause streak artifacts; changes in radiation dose may introduce speckle noise, etc. Noise, as redundant interference information, affects image quality and people's understanding and judgment of image information, and should be removed as much as possible. Based on this, denoising images is the most effective way to improve image quality and ensure image resolution. In image denoising technology, Total Variation Minimization (TVM) is one of the most common denoising methods, which plays an irreplaceable role in the practical application of image denoising.
[0003] The TVM-based image optimization method in the related art divides the image to be optimized into multiple regions, and uses the formula corresponding to the region to gradually iterate and calculate to obtain the optimization result of the image in the region. Although this method can obtain effective results, due to the different calculation formulas for each region, and each calculation formula contains multiple different iteration variables, and multiple iterative calculations are required, the amount of calculation itself is very huge, which will greatly affect the overall processing efficiency. In addition, the image optimization method in the related art processes the image data in blocks, which destroys the continuity of the data during the iteration process.
[0004] Currently, no effective solution has been proposed for the problems of large total computational complexity, many iterative variables, and discontinuous image data in TVM-based image optimization methods in related technologies. Summary of the invention
[0005] In this embodiment, an image optimization method, apparatus, and computer device based on total variation minimization are provided to solve the problems of large total computational complexity, many iterative variables, and discontinuous image data in image optimization methods in related technologies.
[0006] In a first aspect, in this embodiment, a method for image optimization based on total variation minimization is provided, the method comprising:
[0007] The image to be optimized is expanded outward from the edge by at least two pixels, and the image obtained is, from the inside to the outside, the area to be optimized, the central area and the expanded area, wherein the expanded area includes the central area and the image area expanded outward from the edge of the central area by at least one pixel, the central area includes the area to be optimized and the image area expanded outward from the edge of the area to be optimized by at least one pixel, and the area to be optimized is the area where the image to be optimized is located; the split Bregman iteration method is used, based on the grayscale initial value of each pixel point in the expanded area, the initial value of the Lagrange multiplier, and the penalty parameter, the grayscale value, the shrinkage factor, and the Lagrange multiplier of each pixel point in the central area are alternately iteratively calculated until the iteration stop requirement is met, and the grayscale optimization value of each pixel point in the central area is obtained.
[0008] In some of the embodiments, the split Bregman iteration method is used to alternately iterate the grayscale value, shrinkage factor, and Lagrange multiplier of each pixel in the central area based on the initial grayscale value, initial Lagrange multiplier value, and penalty parameter of each pixel in the expanded area, including:
[0009] Initialize and calculate to obtain the first iteration value of the grayscale of each pixel in the central area, the initial value of the shrinkage factor, and the first iteration value of the Lagrange multiplier;
[0010] Iteratively calculate the k+2th iteration value of the grayscale of each pixel point in the central area based on the grayscale initial value, the k+1th iteration value, the kth iteration value and the k+1th iteration value of the Lagrange multiplier;
[0011] Iteratively calculate the k+1th iteration value of the contraction factor of the pixel point based on the gradient value of the k+2th iteration value of the grayscale of the pixel point and the k+1th iteration value of the Lagrange multiplier;
[0012] Based on the k+1th iteration value of the shrinkage factor of the pixel point, the gradient value of the k+2th iteration value of the grayscale, the k+1th iteration value of the Lagrange multiplier, and the penalty parameter, the k+2th iteration value of the Lagrange multiplier of the pixel point is iteratively calculated, where k=0, 1, 2…
[0013] In some embodiments, iteratively calculating the grayscale k+2 iteration value of the pixel point based on the grayscale initial value, the grayscale k+1 iteration value, the Lagrange multiplier k iteration value and the k+1 iteration value of each pixel point in the central area includes:
[0014] A fidelity term of the grayscale iteration value is obtained based on the initial grayscale value of the pixel point and the k+1th grayscale iteration value; a regularization term of the grayscale iteration value is obtained based on the kth and k+1th iteration values of the Lagrange multipliers of the pixel point and its left and upper adjacent pixels; and a k+2th grayscale iteration value of the pixel point is obtained based on the fidelity term and the regularization term.
[0015] In some embodiments, a fidelity term of a grayscale iteration value is obtained based on the grayscale initial value and the grayscale k+1th iteration value of the pixel; a regularization term of a grayscale iteration value is obtained based on the kth and k+1th iteration values of the Lagrange multipliers of the pixel and its left and upper adjacent pixels; and obtaining the grayscale k+2th iteration value of the pixel based on the fidelity term and the regularization term includes:
[0016]
[0017]
[0018] in, For the fidelity item; is the regularization term; U k+2 (i, j) is the grayscale k+2th iteration value of the pixel point in the central area; U 0 (i, j) is the initial grayscale value of the pixel; U k+1 (i, j) is the grayscale k+1th iteration value of the pixel; is the k-th iteration value in the x direction of the Lagrange multiplier of the left adjacent pixel of the pixel; is the kth iteration value in the y direction of the Lagrange multiplier of the upper adjacent pixel of the pixel; τ is the weight parameter.
[0019] In some of these embodiments, the value of τ is equal to 4.
[0020] In some embodiments, iteratively calculating the k+2th iteration value of the Lagrange multiplier of the pixel point based on the k+1th iteration value of the shrinkage factor of the pixel point, the gradient value of the k+2th iteration value of the grayscale, the k+1th iteration value of the Lagrange multiplier, and the penalty parameter includes:
[0021] When the k+1th iteration value of the shrinkage factor of the pixel point is greater than the inverse of the penalty parameter, the k+2th iteration value of the Lagrange multiplier of the pixel point is obtained according to the gradient value of the k+2th iteration value of the grayscale of the pixel point, the k+1th iteration value of the Lagrange multiplier, the k+1th iteration value of the shrinkage factor, and the penalty parameter;
[0022] When the k+1th iteration value of the shrinkage factor of the pixel point is less than or equal to the inverse of the penalty parameter, the k+2th iteration value of the Lagrange multiplier of the pixel point is obtained according to the gradient value of the k+2th iteration value of the grayscale of the pixel point and the k+1th iteration value of the Lagrange multiplier.
[0023] In some embodiments, when the k+1th iteration value of the shrinkage factor of the pixel is greater than the inverse of the penalty parameter, obtaining the k+2th iteration value of the Lagrange multiplier of the pixel according to the gradient value of the k+2th iteration value of the grayscale of the pixel, the k+1th iteration value of the Lagrange multiplier, the k+1th iteration value of the shrinkage factor, and the penalty parameter includes:
[0024] when hour,
[0025]
[0026]
[0027] k = 0, 1, 2, ...;
[0028] When the k+1th iteration value of the shrinkage factor of the pixel point is less than or equal to the inverse of the penalty parameter, obtaining the k+2th iteration value of the Lagrange multiplier of the pixel point according to the gradient value of the k+2th iteration value of the grayscale of the pixel point and the k+1th iteration value of the Lagrange multiplier includes:
[0029] when hour,
[0030]
[0031]
[0032] k = 0, 1, 2, ...;
[0033] in,
[0034]
[0035] λ(i, j) is the penalty parameter of the pixel.
[0036] In some of the embodiments, the initialization calculation to obtain the first iteration value of the grayscale of each pixel in the central area includes:
[0037] A weighted sum is performed based on the initial grayscale value of each pixel in the central area and the initial grayscale values of the pixels in the four areas of the pixel to obtain the first iteration value of the grayscale of the pixel.
[0038] In some embodiments, the initial grayscale value of the extended pixel point of the image to be optimized is the initial grayscale value of the pixel point of the image to be optimized that is closest to the extended pixel point; the grayscale iteration value of the extended pixel point outside the central area is equal to the initial grayscale value of the pixel point; and the initial value of the Lagrange multiplier of each pixel point in the central area is 0.
[0039] In a second aspect, in this embodiment, an image optimization device based on total variation minimization is provided, and the device includes:
[0040] An image expansion module, used to expand the image to be optimized from the edge to the outside by at least two pixels, and the obtained image is, from the inside to the outside, a region to be optimized, a central region, and an expansion region, wherein the expansion region includes the central region and an image region that expands outward from the edge of the central region by at least one pixel, the central region includes the region to be optimized and an image region that expands outward from the edge of the region to be optimized by at least one pixel, and the region to be optimized is the region where the image to be optimized is located;
[0041] The optimization iteration module is used to adopt the split Bregman iteration method to alternately iteratively calculate the grayscale value, shrinkage factor, and Lagrange multiplier of each pixel in the central area based on the grayscale initial value, Lagrange multiplier initial value, and penalty parameter of each pixel in the expanded area until the iteration stop requirement is met, thereby obtaining the grayscale optimization value of each pixel.
[0042] In a third aspect, a computer device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the image optimization method based on total variation minimization described in the first aspect is implemented.
[0043] Compared with the related art, the image optimization method based on total variation minimization provided in this embodiment expands the image to be optimized outward to obtain an image containing the central area, and based on the initial grayscale value of each pixel in the central area, the initial value of the Lagrange multiplier, and the penalty parameter, the grayscale value of the pixel, the shrinkage factor, and the Lagrange multiplier are alternately iterated through the split Bregman iteration method to obtain the optimized image. The problems of large total computational complexity, many iteration variables, and discontinuous image data in the image optimization method based on TVM in the related art are solved, the continuity of the image data during the optimization process is guaranteed, and the basis for subsequent data parallelization is provided; the iteration variables are reduced, and the image optimization efficiency is improved.
[0044] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0046] Figure 1 It is a flow chart of the image optimization method based on total variation minimization in the related art.
[0047] Figure 2 It is a schematic diagram of dividing the image region to be optimized in the image optimization method based on total variation minimization in the related technology.
[0048] Figure 3 4 is a flow chart of the image optimization method based on total variation minimization of this embodiment.
[0049] Figure 4 Schematic diagram of image expansion of the image optimization method based on total variation minimization in this embodiment.
[0050] Figure 5 This is a flow chart of alternately iterating calculations of the grayscale value, shrinkage factor, and Lagrange multiplier of each pixel in the central area in this embodiment.
[0051] Figure 6 Schematic diagram of the image optimization device based on total variation minimization of this embodiment. DETAILED DESCRIPTION
[0052] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0053] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0054] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, when running on a terminal, the terminal may include one or more processors and a memory for storing data, wherein the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above-mentioned terminal may also include a transmission device and an input and output device for communication functions.
[0055] The memory can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the image optimization method based on total variation minimization in this embodiment. The processor executes various functional applications and data processing by running the computer program stored in the memory, that is, realizing the above method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0056] The transmission device is used to receive or send data via a network. The above network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0057] A flowchart of a commonly used image optimization method based on total variation minimization is shown below: Figure 1 shown.
[0058] The image to be optimized is divided into 9 areas, and the position of each area in the image to be optimized is as follows Figure 2 shown.
[0059] The iteration formula corresponding to each area is as follows:
[0060] 1. Calculation formula for area 21:
[0061]
[0062] in:
[0063] (1)U k+1 Represents the result after the k+1th iteration;
[0064] (2)U 0 Represents the gray value data of the image to be processed;
[0065] (3)U k Represents the result after the kth iteration;
[0066] (4) and The iterative formula is described later.
[0067] 2. Calculation formula for area 22:
[0068]
[0069] 3. Calculation formula for area 23:
[0070]
[0071] 4. Calculation formula for area 24:
[0072]
[0073] 5. Calculation formula for area 25:
[0074]
[0075] 6. Calculation formula for area 26:
[0076]
[0077] 7. Calculation formula for area 27:
[0078]
[0079] 8. Calculation formula for area 28:
[0080]
[0081] 9. Calculation formula for area 29:
[0082]
[0083] Below and The iterative formula is explained in detail: 1. The calculation formula for areas 21, 22, 26, and 27 is:
[0084]
[0085]
[0086] in:
[0087]
[0088]
[0089]
[0090]
[0091]
[0092]
[0093] λ is equal to twice the grayscale value of the pixel in the image to be optimized.
[0094] 2. Calculation formula for areas 23 and 28:
[0095]
[0096] in:
[0097]
[0098]
[0099]
[0100] 3. Calculation formula for areas 24 and 29:
[0101]
[0102] in:
[0103]
[0104]
[0105]
[0106] The calculation of this commonly used image optimization method based on total variation minimization is mainly concentrated in the iterative calculation of each regional image. From the above formula, it can be found that this commonly used image optimization method based on total variation minimization needs to process the data in blocks, which destroys the continuity of the data in the memory, which will greatly affect the processing efficiency.
[0107] In this embodiment, an image optimization method based on total variation minimization is provided. Figure 3 is a flowchart of the image optimization method based on total variation minimization in this embodiment. Figure 3 As shown, the process includes the following steps:
[0108] Step S301, the image to be optimized is expanded from the edge to the outside by at least two pixels, and the image obtained is the area to be optimized 41, the central area 42 and the expanded area 43 from the inside to the outside. Figure 4 The expanded area 43 includes the central area 42 and the image area extending outward from the edge of the central area by at least one pixel, the central area 42 includes the area to be optimized 41 and the image area extending outward from the edge of the area to be optimized by at least one pixel, and the area to be optimized 41 is the area where the image to be optimized is located.
[0109] The image to be optimized in the embodiment of the present application is a rectangular grayscale image containing noise, and the image is composed of a pixel matrix, and the brightness of each pixel is represented by a grayscale value. The initial grayscale value of each pixel in the image to be optimized is known, and the grayscale value of each pixel after optimization is obtained by the image optimization method of this embodiment, thereby obtaining the entire optimized image.
[0110] The image to be optimized is expanded outward from the edge by at least one pixel to obtain the central area. The central area is also a rectangular grayscale image, and all pixels in the central area participate in the iterative calculation of grayscale values. The extended area can be obtained by expanding outward from the edge of the central area by at least one pixel. The grayscale values of pixels belonging to the extended area and not belonging to the central area are used as variables in the subsequent iterative calculation of the grayscale values of pixels in the central area. During the calculation, the grayscale iteration values of each pixel in the central area are obtained by assigning values to the variables. The position of each pixel in the pixel matrix of the expanded image is represented by i and j, where i is the serial number value numbered downward from the top pixel of the expanded image; j is the serial number value numbered rightward from the leftmost pixel of the expanded image. It can be seen that the origin of the coordinate system is the upper left corner of the expanded image, i corresponds to the ordinate Y, and j corresponds to the abscissa X.
[0111] Step S302, using the split Bregman iteration method, based on the grayscale initial value of each pixel in the expanded area, the initial value of the Lagrange multiplier, and the penalty parameter, the grayscale value, the shrinkage factor, and the Lagrange multiplier of each pixel in the central area are alternately iterated until the iteration stop requirement is met, thereby obtaining the grayscale optimization value of each pixel in the central area.
[0112] Based on the total variation minimization idea, the image in the central area is denoised, that is, the minimum value of the image noise in the central area is solved. Since the problem is nonlinear and non-differentiable in mathematical operations, the split Bregman iteration method can usually be used to transform the constrained optimization problem of the image denoising model into an unconstrained optimization problem, and the image denoising problem is decomposed into multiple sub-problems for solution. Auxiliary variables are introduced in the solution process: shrinkage factor and Lagrange multiplier, where the Lagrange multiplier includes two variables in the X direction and the Y direction. When solving the grayscale value of the pixel point in the central area, the shrinkage factor and the Lagrange multiplier are used as constants to participate in the iterative calculation; when solving the shrinkage factor or the Lagrange multiplier, the other two variables are used as constants to participate in the iterative calculation. Through the alternating iteration of the three variables of the shrinkage factor, the Lagrange multiplier, and the grayscale value of the pixel point in the central area, when the number of iterations meets the number of iterations preset according to the image quality and the amount of calculation, the iteration is stopped to obtain the grayscale optimization value of each pixel point. In addition, during the calculation process, it is also necessary to assign initial values to the grayscale values of the pixels extending outward from the image to be optimized, the Lagrange multiplier values of the pixels in the central area, and the penalty parameters to meet the initial iteration requirements.
[0113] Through the above steps S301 to S302, the image optimization method based on total variation minimization provided in this embodiment, by expanding the image to be optimized outward to obtain the central area and the extended area, based on the grayscale initial value of each pixel point in the extended area, the initial value of the Lagrange multiplier, and the penalty parameter, the grayscale value, the shrinkage factor, and the Lagrange multiplier of the pixel point in the central area are alternately iterated through the split Bregman iteration method to obtain the optimized image. The image optimization method of this embodiment unifies the iterative calculation formula of the grayscale value of all pixels in the central area, and solves the problem of discontinuous image data; in addition, the optimized iterative formula guarantees the independence between pixels to the greatest extent, lays a good foundation for subsequent data parallelization, and also makes the code framework of the entire optimization method more condensed and refined; the image optimization method of this embodiment introduces fewer variables and pixel grayscale values for alternate iterative calculation, reduces the number of iterative variables and the total amount of calculation, and can improve the image optimization efficiency by 40% to 60% on the basis of related technologies.
[0114] In some of the embodiments, a specific iterative process using the split Bregman iteration method is involved. Optionally, the above S302, based on the grayscale initial value of each pixel in the expansion area, the initial value of the Lagrange multiplier, and the penalty parameter, performs alternating iterative calculations on the grayscale value, the shrinkage factor, and the Lagrange multiplier of each pixel in the central area, including the following steps:
[0115] Step S501, initializing calculation to obtain the first iteration value of the grayscale of each pixel in the central area, the initial value of the shrinkage factor, and the first iteration value of the Lagrange multiplier.
[0116] The shrinkage factor and Lagrange multiplier are auxiliary variables introduced to solve the problem of pixel grayscale value calculation. The shrinkage factor plays an auxiliary convergence role in the iterative calculation of pixel grayscale value; the Lagrange multiplier is a component of the regularization term to prevent overfitting in the image denoising calculation process.
[0117] In order to ensure the denoising effect of the image while retaining the detailed features of the image, when iteratively calculating the grayscale value of a certain pixel in the central area, it is necessary to consider the grayscale values of other pixels adjacent to the pixel, as well as the gradient change of the grayscale values of the adjacent pixels and the pixel. For example, if the grayscale value of the pixel is 100, the grayscale value of the pixel on the right adjacent to the pixel is 110, and the grayscale value of the pixel below the pixel is 70, then the grayscale gradient of the pixel in the X direction (horizontal) is 10, and the grayscale gradient in the Y direction (vertical) is -30.
[0118] Before starting the iterative calculation, it is necessary to assign initial values to the grayscale values of the pixels that expand outward from the image to be optimized, the Lagrange multipliers of the pixels in the central area, and the penalty parameters to meet the initial iteration requirements. Among them, the initial grayscale values of the pixels of the image to be optimized are all known data. The initial grayscale values of the pixels obtained by expanding outward from the image to be optimized are assigned according to the initial grayscale values of the specific pixels of the image to be optimized; the initial Lagrange multiplier values of each pixel in the central area are specific values; the penalty parameter value of each pixel in the central area is twice the correction value of the corresponding pixel. The pixel correction value is determined by the final image quality and remains unchanged during the iteration process. .
[0119] According to the initial values of the above variables, the first iteration value of the grayscale of each pixel in the central area, the initial value of the shrinkage factor, and the first iteration value of the Lagrange multiplier can be calculated.
[0120] Step S502, iteratively calculate the grayscale k+2th iteration value of each pixel in the central area based on the grayscale initial value, grayscale k+1th iteration value, Lagrange multiplier kth iteration value and k+1th iteration value, where k=0, 1, 2...
[0121] According to the requirements of the iterative algorithm, to calculate the k+2 iteration value of the grayscale of the pixel in the central area, the required parameters include the initial grayscale value of the pixel, the k+1 iteration value of the grayscale, the k-th and k+1 iteration values of the Lagrange multipliers of the pixel and the left and upper pixels adjacent to the pixel, and the weight parameter. Among them, the weight parameter of the pixel is a positive constant. It can be seen that the two iteration values of the Lagrange multipliers of the pixel and the adjacent pixels are used in the calculation, which speeds up the iterative calculation speed.
[0122] Step S503, iteratively calculating the k+1th iteration value of the contraction factor of the pixel point based on the gradient value of the k+2th iteration value of the grayscale of the pixel point and the k+1th iteration value of the Lagrange multiplier, where k=0, 1, 2...
[0123] The shrinkage factor is an auxiliary variable of the Lagrange multiplier iterative calculation, which is used to control the convergence speed of the Lagrange multiplier iterative calculation.
[0124] Step S504, iteratively calculate the k+2th iteration value of the Lagrange multiplier of the pixel point based on the k+1th iteration value of the shrinkage factor of the pixel point, the gradient value of the k+2th iteration value of the grayscale, the k+1th iteration value of the Lagrange multiplier, and the penalty parameter, where k=0, 1, 2…
[0125] Lagrange multipliers are auxiliary variables in the iterative calculation of pixel grayscale values and are used to reduce image noise during image optimization.
[0126] Through the above steps S501 to S504, an alternating iteration sequence of the grayscale value, contraction factor, and Lagrange multiplier of each pixel in the central area is established. Compared with the related art, the iteration of the grayscale value of the pixel does not require the participation of the grayscale iteration values of other pixels adjacent to the pixel, and only the grayscale initial value and iteration value of the pixel need to be used. The auxiliary variables introduced in the iterative calculation are the contraction factor and Lagrange multiplier of the pixel. The iteration of the grayscale value of the pixel uses the two iteration values of the Lagrange multiplier of the pixel and the adjacent pixel, which accelerates the convergence of the iteration and reduces the number of calculations.
[0127] In some of the embodiments, the specific calculation process of calculating the grayscale k+2 iteration value of the pixel point is involved. Optionally, the calculation process of iteratively calculating the grayscale k+2 iteration value of the pixel point based on the grayscale initial value, the grayscale k+1 iteration value, the Lagrange multiplier k iteration value and the k+1 iteration value of each pixel point in the central area in S502 includes:
[0128] The fidelity term of the grayscale iteration value is obtained based on the initial grayscale value of the pixel and the k+1th grayscale iteration value; the regularization term of the grayscale iteration value is obtained based on the kth and k+1th iteration values of the Lagrange multipliers of the pixel and its left and upper adjacent pixels; the k+2th grayscale iteration value of the pixel is obtained based on the fidelity term and the regularization term.
[0129] Image denoising is an inverse problem, the purpose of which is to restore an image as close to the real image as possible from a degraded image. The denoising problem can be equivalent to finding an equality-constrained optimization problem of the total variation regularization function TV(u) of the unknown original image u, that is,
[0130]
[0131] Expression (1) is the classic ROF denoising model. The symbol ||·||2 represents the L2 norm. λ is a penalty parameter used to balance the fidelity term and the regularization term. f is a known image containing noise, and u is the real image to be restored. The first term in the above formula is the fidelity term, which controls the difference with the original image, reduces the image distortion, and has the effect of preserving the edge characteristics of the image; the second term is the regularization term, which smoothes the image and has the effect of denoising.
[0132] For the isotropic case, expression (1) can also be expressed as
[0133]
[0134] The process of iterating expression (1) can be described by the following formula:
[0135]
[0136] Among them, f k+1 =f+(f k -u k ) (4)
[0137] In the formula, k is the number of iterations.
[0138] By using the split Bregman iteration method, the above expressions (3) and (4) are transformed into a series of unconstrained optimization sub-problems, namely, iteratively calculating the gray value, shrinkage factor, and Lagrange multiplier value of each pixel in the central area. The expression form of the fidelity term and the regularization term has also changed, but their role remains unchanged.
[0139] When calculating the k+2th grayscale iteration value of a pixel, the parameters of the fidelity term are the initial grayscale value of the pixel and the k+1th grayscale iteration value. That is, the latest iteration value of the grayscale is used as the input of the next noisy image in each iteration, so that the next iteration value inherits part of the grayscale value of the real image and restores part of the real image from the noisy image. Therefore, when the iteration converges, the optimal solution that approximates the real image u can be obtained.
[0140] In the existing split Bregman iteration algorithm, the parameters of the fidelity term include the grayscale initial value and the grayscale k+1 iteration value of the pixel point mentioned above, as well as the grayscale k+1 iteration value of the four adjacent pixel points. This embodiment deletes these four parameters through derivation and optimization, reduces the amount of calculation, and improves the calculation efficiency.
[0141] The parameters of the regularization term are the kth and k+1th iteration values of the Lagrange multipliers of the pixel and its left and upper neighboring pixels. According to expression (2), the regularization term is a function of the grayscale gradient of the pixel. The smaller the grayscale gradient, the smaller the value of the regularization term, and the smoother the image of the pixel and its neighboring pixels.
[0142] In the existing split Bregman iterative algorithm, the parameters of the regularization term are the k+1th iteration value of the Lagrange multiplier of the pixel and its left and upper neighboring pixels, as well as another auxiliary variable The k+1th iteration value of . This embodiment deletes the auxiliary variable D and the four parameters through derivation and optimization, reduces the amount of calculation and improves the calculation efficiency.
[0143] In some of the embodiments, a specific calculation formula for calculating the grayscale k+2 iteration value of a pixel point is involved. Optionally, a fidelity term of the grayscale iteration value is obtained based on the grayscale initial value and the grayscale k+1 iteration value of the pixel point; a regularization term of the grayscale iteration value is obtained based on the kth and k+1th iteration values of the Lagrange multipliers of the pixel point and its left and upper adjacent pixels; a calculation formula for obtaining the grayscale k+2 iteration value of the pixel point based on the fidelity term and the regularization term is:
[0144]
[0145] in, For the fidelity item; is the regularization term; U k+2 (i, j) is the grayscale k+2th iteration value of the pixel in the central area; U 0 (i, j) is the initial gray value of the pixel; U k+1 (i, j) is the grayscale k+1th iteration value of the pixel; is the k-th iteration value in the x direction of the Lagrange multiplier of the left adjacent pixel of the pixel; is the kth iteration value in the y direction of the Lagrange multiplier of the upper adjacent pixel of the pixel; τ is the weight parameter.
[0146] Expressions (3) and (4) are transformed into a series of unconstrained optimization sub-problems through the split Bregman iteration method and solved iteratively. One of the sub-problems is the iterative solution of the grayscale value of the image pixel in the central area, which can be expressed by the following expression:
[0147]
[0148] in, for Iterative approximate solution, λ is the penalty parameter, μ is the weight parameter. For the same pixel, λ and μ are constants. and Auxiliary variables introduced for the split Bregman iteration method, where is the iterative approximate value of the grayscale gradient in the X direction of the pixel point (i, j); It is the iterative approximation of the grayscale gradient in the Y direction of the pixel point (i, j).
[0149] Due to D x , D y , B x , B y The following relationship exists:
[0150]
[0151] Therefore, we can know that:
[0152]
[0153] From this we can draw the following four inferences:
[0154]
[0155]
[0156]
[0157]
[0158] Combining the above four inferences, expression (6) can be simplified to:
[0159]
[0160] Let τ = μ / λ, and we can get the calculation expression of the k+2th iteration value of the grayscale of the image pixel in the central area:
[0161]
[0162]
[0163] The above formula of this embodiment is derived and optimized, and the grayscale k+1th iteration value of the four-domain pixel points adjacent to the pixel point (i, j) and D of another auxiliary variable D are deleted. x (i, j), D y (i, j), D x (i, j-1), D y The k+1th iteration value of (i-1, j) greatly reduces the amount of calculation and improves the efficiency of calculation. In addition, the above formula uses the two iteration values B of the Lagrange multiplier of the pixel point (i, j) and the adjacent pixel points k+1 and B k , which speeds up the iterative calculation.
[0164] In some of the embodiments, the specific value of the weight parameter τ is involved. Optionally, τ=4.
[0165] When τ=4, the calculation expression of the k+2th iteration value of the grayscale of the image pixel in the central area is:
[0166]
[0167] The value of the weight parameter τ adjusts the weight relationship between the initial grayscale value of the pixel and the iterative value.
[0168] In some of the embodiments, the specific calculation process of calculating the k+2th iteration value of the Lagrange multiplier of the pixel point is involved. Optionally, the calculation process of iteratively calculating the k+2th iteration value of the Lagrange multiplier of the pixel point based on the k+1th iteration value of the shrinkage factor of the pixel point, the gradient value of the k+2th iteration value of the grayscale, the k+1th iteration value of the Lagrange multiplier, and the penalty parameter in the above S304 includes:
[0169] When the k+1th iteration value of the shrinkage factor of the pixel point is greater than the inverse of the penalty parameter, the k+2th iteration value of the Lagrange multiplier of the pixel point is obtained according to the gradient value of the k+2th iteration value of the grayscale of the pixel point, the k+1th iteration value of the Lagrange multiplier, the k+1th iteration value of the shrinkage factor, and the penalty parameter.
[0170] When the k+1th iteration value of the shrinkage factor of the pixel point is less than or equal to the inverse of the penalty parameter, the k+2th iteration value of the Lagrange multiplier of the pixel point is obtained according to the gradient value of the k+2th iteration value of the grayscale of the pixel point and the k+1th iteration value of the Lagrange multiplier.
[0171] The shrinkage factor is an auxiliary variable in the iterative calculation process, and its function is to ensure the convergence of the iterative calculation of the Lagrange multiplier of the pixel point. The reciprocal of the product of the shrinkage factor and the penalty parameter is the convergence coefficient of the iterative calculation of the Lagrange multiplier, and the penalty parameter value of each pixel in the central area is twice the initial grayscale value of the corresponding pixel point, which is a fixed value. Therefore, the larger the shrinkage factor, the smaller the convergence coefficient, and the better the iterative convergence of the Lagrange multiplier; the smaller the shrinkage factor, the larger the convergence coefficient, and the worse the iterative convergence of the Lagrange multiplier. When the value of the shrinkage factor is less than or equal to the reciprocal of the penalty parameter, the convergence coefficient is greater than or equal to 1. At this time, the iterative calculation of the Lagrange multiplier cannot converge, so the convergence coefficient no longer participates in the iterative calculation of the Lagrange multiplier.
[0172] In some of the embodiments, a specific calculation formula for calculating the k+2th iteration value of the Lagrange multiplier of a pixel point is involved. Optionally, when the k+1th iteration value of the shrinkage factor of a pixel point is greater than the inverse of the penalty parameter, the calculation formula for obtaining the k+2th iteration value of the Lagrange multiplier of the pixel point is as follows based on the gradient value of the k+2th iteration value of the grayscale of the pixel point, the k+1th iteration value of the Lagrange multiplier, the k+1th iteration value of the shrinkage factor, and the penalty parameter:
[0173] when hour,
[0174]
[0175] When the k+1 iteration value of the shrinkage factor of a pixel is less than or equal to the inverse of the penalty parameter, the calculation formula for obtaining the k+2 iteration value of the Lagrange multiplier of the pixel is as follows based on the gradient value of the k+2 iteration value of the grayscale of the pixel and the k+1 iteration value of the Lagrange multiplier:
[0176] when hour,
[0177]
[0178] in,
[0179]
[0180] λ(i, j) is the penalty parameter of the pixel. (18)
[0181] The Lagrange multiplier iteration calculation of the pixel point is one of a series of unconstrained optimization sub-problems transformed by the split Bregman iteration method. is the convergence coefficient of the Lagrange multiplier iteration. hour, It has a convergence effect on iterative calculation. hour, Therefore, the convergence coefficient is no longer used as a parameter for iterative calculation.
[0182] Expression (18) represents s k+1 yes The L2 norm of , which is used as the iterative calculation parameter of the Lagrange multiplier to prevent iterative overfitting. k+1 The value of is a small positive number, but should not be less than 10 -4 f.
[0183] In some of the embodiments, the grayscale of each pixel in the central area is calculated for the first iteration. Optionally, the grayscale of each pixel in the central area is calculated and obtained by initializing the calculation to obtain the first iteration value, including:
[0184] According to the initial grayscale value of each pixel in the central area and the initial grayscale values of the pixels in the four areas of the pixel, a weighted sum is performed to obtain the first iteration value of the grayscale of the pixel.
[0185] The calculation of the first iteration value of the grayscale of the pixel point in the central area can be simplified according to expression (6). Expression (6) can be simplified to:
[0186]
[0187] When τ=4,
[0188]
[0189] The first iteration value of the grayscale of each pixel in the central area can be considered as the weight calculation of the initial grayscale value of the pixel and the four adjacent areas. For example, when τ=4, the weight of the initial grayscale value of the pixel is 4.5, the weight of the initial grayscale value of the four adjacent areas is 1, and the total weight is 8.5.
[0190] In some of the embodiments, the grayscale initial value setting of the extended pixel points of the image to be optimized and the Lagrange multiplier initial value setting of each pixel point in the central area are involved. Optionally, the grayscale initial value of the extended pixel points of the image to be optimized is the grayscale initial value of the pixel point of the image to be optimized that is closest to the extended pixel point; the grayscale iteration value of the extended pixel points outside the central area is equal to the grayscale initial value of the pixel point; and the Lagrange multiplier initial value of each pixel point in the central area is 0.
[0191] The initial grayscale value of the extended pixel point of the image to be optimized is used to calculate the first grayscale iteration value of each pixel point in the central area; the grayscale iteration value of the extended pixel point outside the central area is used to calculate the Lagrange multiplier iteration value of the pixel point, thereby calculating the grayscale iteration value of the pixel point in the central area; the initial Lagrange multiplier value of each pixel point in the central area is used to calculate the initial value of the contraction factor of the pixel point.
[0192] The present embodiment is described and illustrated below through preferred embodiments.
[0193] The image to be optimized is expanded outward from the edge by one pixel to obtain the central area. The central area is expanded outward by one pixel to obtain the extended area. The initial grayscale value of the pixel obtained by the expansion is equal to the initial grayscale value of the pixel of the image to be optimized that is closest to the extended pixel. Among them, the grayscale value of the extended pixel outside the central area in the extended area is a fixed value and no iteration is performed. The initial value of the Lagrange multiplier of each pixel in the central area is set to 0; the weight parameter τ = 4; the value of the penalty parameter λ is twice the correction value of the corresponding pixel; the number of iterations is 25 or 50 times.
[0194] The iterative calculation formula for the grayscale value of each pixel in the central area is as follows:
[0195]
[0196] and Auxiliary variables introduced for the split Bregman iteration method, where is the iterative approximate value of the grayscale gradient in the X direction of the pixel point (i, j); It is the iterative approximation of the grayscale gradient in the Y direction of the pixel point (i, j).
[0197] Due to Dx , D y , B x , B y The following relationship exists:
[0198]
[0199] Therefore, we can know that:
[0200]
[0201] From this we can draw the following four inferences:
[0202]
[0203]
[0204]
[0205]
[0206] Combining the above four inferences, expression (21) can be simplified to:
[0207]
[0208] because It is not difficult to conclude that:
[0209]
[0210] In addition, B x and B y The specific iteration formula is:
[0211] when Sometimes, there is
[0212]
[0213] when Sometimes, there is
[0214]
[0215] in,
[0216]
[0217] λ(i, j) is the penalty parameter of the pixel. (32)
[0218] When k reaches the set maximum number of iterations, 25 or 50, the iterative calculation ends and the optimized image is obtained.
[0219] This preferred embodiment expands the image to be optimized outward to obtain an image containing the central area, and based on the initial grayscale value of each pixel in the central area, the initial value of the Lagrange multiplier, and the penalty parameter, the grayscale value of the pixel, the shrinkage factor, and the Lagrange multiplier are alternately iterated through the split Bregman iteration method to obtain the optimized image. The image optimization method of this preferred embodiment unifies the iterative calculation formula of the grayscale value of all pixels in the central area, solving the problem of discontinuous image data; in addition, the optimized iterative formula guarantees the independence between pixels to the greatest extent, laying a good foundation for subsequent data parallelization, and also making the code framework of the entire optimization method more condensed and refined.
[0220] This preferred embodiment uses derivation and optimization to iteratively calculate the grayscale value of the pixel. The formula of Delete deletes the grayscale k+1th iteration value of the four-domain pixel points adjacent to the pixel point (i, j), as well as another auxiliary variable D x (i, j), D y (i, j), D x (i, j-1), D y The k+1th iteration value of (i-1, j) introduces fewer variables and performs alternating iterative calculations with the grayscale value of the pixel, thereby greatly reducing the amount of calculation and improving the efficiency of calculation. In addition, the above formula uses the two iteration values B of the Lagrange multiplier of the pixel (i, j) and the adjacent pixel k+1 and B k , which speeds up the iterative calculation.
[0221] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0222] In this embodiment, an image optimization device based on total variation minimization is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit" and the like used below can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0223] Figure 6 is a structural block diagram of the image optimization device based on total variation minimization in this embodiment, such as Figure 6 As shown, the device includes: an image expansion module 61 and an optimization iteration module 63.
[0224] The image expansion module 61 is used to expand the image to be optimized from the edge to the outside by at least two pixels, and the obtained image is, from the inside to the outside, the area to be optimized, the central area and the expansion area, wherein the expansion area includes the central area and the image area that expands outward from the edge of the central area by at least one pixel, the central area includes the area to be optimized and the image area that expands outward from the edge of the area to be optimized by at least one pixel, and the area to be optimized is the area where the image to be optimized is located.
[0225] The optimization iteration module 63 is used to adopt the split Bregman iteration method to alternately iterate the grayscale value, shrinkage factor, and Lagrange multiplier of each pixel in the central area based on the grayscale initial value, Lagrange multiplier initial value, and penalty parameter of each pixel in the expanded area until the iteration stop requirement is met to obtain the grayscale optimization value of each pixel.
[0226] In the image optimization device based on total variation minimization in this embodiment, after the image expansion module 61 determines the central area and the expansion area, the optimization iteration module 63 performs alternating iterative calculations of the grayscale value, the shrinkage factor, and the Lagrange multiplier on each pixel in the central area until the iteration stop requirement is met, and the grayscale optimization value of each pixel is obtained. The image optimization device of this embodiment unifies the iterative calculation formula of the grayscale value of all pixels in the central area, solves the problem of discontinuous image data, and provides a basis for subsequent data parallelization; the image optimization device of this embodiment reduces the number of iterative variables and the total amount of calculation by introducing fewer variables to perform alternating iterative calculations with the grayscale value of the pixel, thereby improving the efficiency of image optimization.
[0227] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0228] In this embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0229] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0230] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0231] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0232] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0233] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0234] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. An image optimization method based on total variation minimization, characterized in that include: The image to be optimized is expanded outward from the edge by at least two pixels, and the obtained image is, from the inside to the outside, a region to be optimized, a central region, and an expanded region, wherein the expanded region includes the central region and an image region that is expanded outward from the edge of the central region by at least one pixel, the central region includes the region to be optimized and an image region that is expanded outward from the edge of the region to be optimized by at least one pixel, and the region to be optimized is the region where the image to be optimized is located; Initialize and calculate to obtain the first iteration value of the grayscale of each pixel in the central area, the initial value of the shrinkage factor, and the first iteration value of the Lagrange multiplier; Iteratively calculate the k+2th iteration value of the grayscale of each pixel point in the central area based on the grayscale initial value, the k+1th iteration value, the kth iteration value and the k+1th iteration value of the Lagrange multiplier; Iteratively calculate the k+1th iteration value of the contraction factor of the pixel point based on the gradient value of the k+2th iteration value of the grayscale of the pixel point and the k+1th iteration value of the Lagrange multiplier; Based on the k+1th iteration value of the shrinkage factor of the pixel point, the gradient value of the k+2th iteration value of the grayscale, the k+1th iteration value of the Lagrange multiplier, and the penalty parameter, the k+2th iteration value of the Lagrange multiplier of the pixel point is iteratively calculated, where k=0, 1, 2...; until the iteration stop requirement is met, and the grayscale optimization value of each pixel point in the central area is obtained.
2. The image optimization method according to claim 1, characterized in that: Based on the grayscale initial value, the grayscale k+1th iteration value, the Lagrange multiplier kth iteration value and the k+1th iteration value of each pixel in the central area, iteratively calculating the grayscale k+2th iteration value of the pixel includes: A fidelity term of the grayscale iteration value is obtained based on the initial grayscale value of the pixel point and the k+1th grayscale iteration value; a regularization term of the grayscale iteration value is obtained based on the kth and k+1th iteration values of the Lagrange multipliers of the pixel point and its left and upper adjacent pixels; and a k+2th grayscale iteration value of the pixel point is obtained based on the fidelity term and the regularization term.
3. The image optimization method according to claim 2, characterized in that: Obtaining a fidelity item of the grayscale iteration value based on the grayscale initial value of the pixel point and the grayscale k+1th iteration value; Obtaining a regularization term of the grayscale iteration value based on the kth and k+1th iteration values of the Lagrange multipliers of the pixel and its left and upper adjacent pixels; Obtaining the grayscale k+2th iteration value of the pixel point based on the fidelity term and the regularization term includes: k=0,1,2,… in, For the fidelity item; is the regularization term; U k+2 (i, j) is the grayscale k+2th iteration value of the pixel point in the central area; U 0 (i, j) is the initial grayscale value of the pixel; U k+1 (i, j) is the grayscale k+1th iteration value of the pixel; is the k-th iteration value in the x direction of the Lagrange multiplier of the left adjacent pixel of the pixel; is the kth iteration value in the y direction of the Lagrange multiplier of the upper adjacent pixel of the pixel; τ is the weight parameter.
4. The image optimization method according to claim 3, characterized in that: The value of τ is equal to 4.
5. The image optimization method according to claim 1, characterized in that: Based on the k+1th iteration value of the shrinkage factor of the pixel point, the gradient value of the k+2th iteration value of the grayscale, the k+1th iteration value of the Lagrange multiplier, and the penalty parameter, iteratively calculating the k+2th iteration value of the Lagrange multiplier of the pixel point includes: When the k+1th iteration value of the shrinkage factor of the pixel point is greater than the inverse of the penalty parameter, the k+2th iteration value of the Lagrange multiplier of the pixel point is obtained according to the gradient value of the k+2th iteration value of the grayscale of the pixel point, the k+1th iteration value of the Lagrange multiplier, the k+1th iteration value of the shrinkage factor, and the penalty parameter; When the k+1th iteration value of the shrinkage factor of the pixel point is less than or equal to the inverse of the penalty parameter, the k+2th iteration value of the Lagrange multiplier of the pixel point is obtained according to the gradient value of the k+2th iteration value of the grayscale of the pixel point and the k+1th iteration value of the Lagrange multiplier.
6. The image optimization method according to claim 5, characterized in that: When the k+1th iteration value of the shrinkage factor of the pixel point is greater than the inverse of the penalty parameter, according to the gradient value of the k+2th iteration value of the grayscale of the pixel point, the k+1th iteration value of the Lagrange multiplier, the k+1th iteration value of the shrinkage factor, and the penalty parameter, obtaining the k+2th iteration value of the Lagrange multiplier of the pixel point includes: when hour, k=0,1,2…; When the k+1th iteration value of the shrinkage factor of the pixel point is less than or equal to the inverse of the penalty parameter, obtaining the k+2th iteration value of the Lagrange multiplier of the pixel point according to the gradient value of the k+2th iteration value of the grayscale of the pixel point and the k+1th iteration value of the Lagrange multiplier includes: when hour, k=0,1,2…; in, λ(i,j) is the penalty parameter of the pixel.
7. The image optimization method according to claim 1, characterized in that: Initialization calculation to obtain the first iteration value of the grayscale of each pixel in the central area includes: A weighted sum is performed based on the initial grayscale value of each pixel in the central area and the initial grayscale values of the four-area pixel points of the pixel point to obtain the first iteration grayscale value of the pixel point, and the four-area pixel points are adjacent pixel points of the pixel point.
8. The image optimization method according to claim 1, characterized in that: The initial grayscale value of the extended pixel point of the image to be optimized is the initial grayscale value of the pixel point of the image to be optimized that is closest to the extended pixel point; the grayscale iteration value of the extended pixel point outside the central area is equal to the initial grayscale value of the pixel point; the initial value of the Lagrange multiplier of each pixel point in the central area is 0.
9. An image optimization device based on total variation minimization, characterized in that include: An image expansion module, used to expand the image to be optimized from the edge to the outside by at least two pixels, and the obtained image is, from the inside to the outside, a region to be optimized, a central region, and an expansion region, wherein the expansion region includes the central region and an image region that expands outward from the edge of the central region by at least one pixel, the central region includes the region to be optimized and an image region that expands outward from the edge of the region to be optimized by at least one pixel, and the region to be optimized is the region where the image to be optimized is located; The optimization iteration module is used for initializing and calculating the grayscale 1st iteration value, the initial value of the contraction factor, and the 1st iteration value of the Lagrange multiplier of each pixel point in the central area; iteratively calculating the grayscale k+2th iteration value of the pixel point based on the grayscale initial value, the grayscale k+1th iteration value, the Lagrange multiplier kth iteration value, and the k+1th iteration value of each pixel point in the central area; iteratively calculating the contraction factor k+1th iteration value of the pixel point based on the gradient value of the grayscale k+2th iteration value of the pixel point and the Lagrange multiplier k+1th iteration value; iteratively calculating the Lagrange multiplier k+2th iteration value of the pixel point based on the contraction factor k+1th iteration value of the pixel point, the gradient value of the grayscale k+2th iteration value, the Lagrange multiplier k+1th iteration value, and the penalty parameter, wherein k=0, 1, 2…; until the iteration stop requirement is met, the grayscale optimization value of each pixel point is obtained.
10. A computer device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the image optimization method based on total variation minimization according to any one of claims 1 to 8.
