Image noise reduction method and system and medium
By constructing correction functions based on the anisotropic diffusion filtering algorithm during image denoising process and generating a lookup table, the problems of large hardware resource consumption and high power consumption are solved, and the optimization of hardware resources and the efficiency of data storage and reading in image denoising process are achieved.
Patent Information
- Application Number
- CN202411658534.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-07
AI Technical Summary
The prior art consumes a large amount of hardware resources and high power consumption during image noise reduction, and fails to effectively optimize data storage and reading.
By constructing correction functions based on anisotropic diffusion filtering algorithm, a lookup table is generated to store data, and different storage and reading methods are adopted in the rising and falling edges according to the characteristics of the correction functions to reduce the consumption of hardware resources.
The optimization of hardware resources during image noise reduction is achieved, the hardware resource consumption of storing and reading data is reduced, and the overall hardware storage and reading efficiency is improved.
Smart Images

Figure CN119579452A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to an image noise reduction method, system and medium. Background Art
[0002] Image smoothing and enhancement are very important parts of image processing. Generally, Gaussian noise can be used to simulate most sensor noise. Traditional isotropic algorithms (such as linear smoothing filters) do not consider the boundaries of the image and smooth the noise and boundaries to the same extent, resulting in reduced clarity of the image edge. Anisotropic diffusion filters overcome the defects of Gaussian filters and can better retain image edge details while reducing noise.
[0003] Anisotropy refers to the property that the mechanical and physical properties of a material show differences in all directions. Based on this, the image is regarded as a heat field, the pixel is regarded as a heat flow, and the degree of diffusion to the surrounding is determined according to the relationship between the current pixel and the surrounding pixels. If a certain neighboring pixel is very different from the current pixel, then this neighboring pixel is likely to be a boundary pixel, and the diffusion coefficient of the current pixel in this neighborhood direction will be relatively small, so the boundary information is preserved.
[0004] The Chinese patent discloses a method and device for real-time processing of multi-resolution anisotropic diffusion filtering of ultrasonic images (application number CN200910009167.3). Aiming at the characteristics of large computational complexity and slow processing speed of multi-resolution anisotropic diffusion filtering image processing algorithm, the method relies on Intel hardware and development technology, adopts blocking and masking methods to ensure that image information is not distorted, suppress speckle noise in the image, and improve the speed of image processing, which is used to optimize the processing speed of ultrasonic scanning image display data in ultrasonic imaging systems. However, the solution does not propose different storage methods for the storage data of the correction function, thereby saving hardware resources for data storage and reading, and the technical problems solved are different from those of this solution.
[0005] Therefore, in order to solve the above problems, the present invention provides an image noise reduction method, system and medium, which can solve the problem of large resource consumption and high power consumption in hardware resources for noise reduction. Summary of the invention
[0006] The purpose of the present invention is to overcome the above problems existing in the prior art and to provide an image noise reduction method, system and medium.
[0007] In order to achieve the above technical objectives and the above technical effects, the present invention is implemented through the following technical solutions: An image noise reduction method, comprising: Constructing a correction function based on anisotropic diffusion filtering algorithm, and correcting the pixel value of the pixel to be corrected by using the pixel values of the neighboring pixels of the pixel to be corrected; The integer value of the strain variable corresponding to the independent variable value in the rising edge of the correction function image and a boundary value among several independent variable values corresponding to different integer values of the strain variable in the falling edge are stored to generate a lookup table; Obtaining the value of the independent variable and determining whether it is at the rising edge or the falling edge of the correction function image, so as to determine the method of reading the data stored in the lookup table according to the determination result; Calculate the pixel correction value of the pixel to be corrected relative to the neighboring pixel based on the stored data to reduce image noise; Among them, the values of the independent variable and the dependent variable are all natural numbers.
[0008] Furthermore, the neighboring pixel points of the pixel point to be corrected include four-directional neighbors of up, down, left, and right pixel points and eight-directional neighbors of up, down, left, right, and oblique pixel points.
[0009] Furthermore, the correction function image has the characteristics of steep rise on the rising edge and slow fall on the falling edge.
[0010] Furthermore, one of the boundary values of the independent variable value interval is a maximum value or a minimum value.
[0011] Further, the method of determining the method of reading the data stored in the lookup table according to the judgment result includes: When the independent variable value is at the rising edge, read the integer value of the dependent variable corresponding to the independent variable value in the lookup table; When the independent variable value is at the falling edge, it is determined between which two boundary values the independent variable value is located to obtain the dependent variable value corresponding to the corresponding boundary value.
[0012] Further, the determining between which two boundary values the independent variable value is located comprises: By comparing the value of the independent variable with the stored boundary values, you can get which two boundary values the independent variable value lies between.
[0013] Furthermore, the method of comparing the independent variable value with the storage boundary value includes one or more of a binary method, an operation method or a comparison method.
[0014] Further, the step of obtaining the strain value corresponding to the corresponding boundary value includes: If one of the boundary values of the interval storing the independent variable value is the maximum value, then the dependent variable value corresponding to the larger value of the two boundary values is obtained; If one of the boundary values of the interval storing the independent variable value is the minimum value, then the dependent variable value corresponding to the smaller value of the two boundary values is obtained.
[0015] An image noise reduction system, comprising: An acquisition module constructs a correction function based on an anisotropic diffusion filter algorithm to correct the pixel value of the pixel to be corrected by using the pixel values of the neighboring pixels of the pixel to be corrected; A storage module stores an integer value of a strain variable corresponding to an independent variable value in a rising edge of a correction function image and a boundary value among a plurality of independent variable values corresponding to different integer values of the strain variable in a falling edge, so as to generate a lookup table; An acquisition module, which acquires the value of the independent variable and determines whether it is at the rising edge or the falling edge of the correction function image, so as to determine the method of reading the data stored in the lookup table according to the determination result; A calculation module, which calculates the pixel correction value of the pixel to be corrected relative to the neighboring pixel points based on the stored data to reduce image noise; Among them, the values of the independent variable and the dependent variable are all natural numbers.
[0016] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image noise reduction method as described above is implemented.
[0017] The beneficial effects of the present invention are: 1. The present invention utilizes the characteristics of the correction function curve that the rising edge is steep and the falling edge is slow. The method of recording the independent variable on the falling edge replaces the method of recording the dependent variable in the prior art to reduce the hardware resources required for storing data. At the same time, the method of recording the dependent variable on the rising edge is retained to reduce the hardware resources required for obtaining data, thereby achieving overall storage optimization of hardware resources.
[0018] 2. In the present invention, a correction function is constructed by an anisotropic diffusion filtering algorithm to intuitively display the pixel value relationship between the pixel to be corrected and its neighboring pixels, and the function characteristics of the correction function are used to record the strain variable Y value in the rising edge of the correction function image, and a boundary value among several independent variable values corresponding to different strain variable integer values in the falling edge of the image, instead of repeatedly recording the same Y value corresponding to several independent variables, to ensure that less hardware storage resources are used to record and store data, so as to generate a lookup table, reduce hardware computing resources, and facilitate recording and reading data.
[0019] 3. In the present invention, by determining whether the independent variable value is located at the rising edge or the falling edge of the correction function image, the reading method of the data stored in the lookup table is determined. If the independent variable value is located at the rising edge, the corresponding dependent variable value is directly output. If the independent variable value is located at the falling edge, it is determined again between which two boundary values the independent variable value is located to determine in which independent variable interval the independent variable is located, thereby obtaining the dependent variable value corresponding to the independent variable interval, so as to perform subsequent calculation of the correction value of the pixel to be corrected. Due to the existence of the judgment logic, it is obvious that the reading speed of the independent variable at the rising edge of the correction function image is higher than the reading speed of the independent variable at the falling edge, that is, the storage method of the dependent variable at the rising edge has a fast reading speed but consumes a lot of storage resources, while the storage method of the dependent variable at the falling edge has a slow reading speed but less storage resources. Therefore, the present invention utilizes the fact that the dependent variable in the correction function has a trend of changing first fast and then slow as the independent variable increases, that is, the correction function image has the characteristics of steep rise on the rising edge and slow fall on the falling edge, and adopts different storage methods for the dependent variables corresponding to the independent variables in the rising edge and the falling edge of the image, thereby realizing the overall hardware storage and reading optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 It is a flowchart of the image noise reduction method in the present invention; Figure 2 It is the correction function image of different K values in the four-way filtering 8-bit mode of the present invention; Figure 3 In the present invention, 1 With G 2 Gradient change effect comparison curve chart; Figure 4 It is a system block diagram of the image noise reduction system in the present invention. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] like Figure 1-3 As shown, the present invention first provides an image noise reduction method, comprising: Constructing a correction function based on anisotropic diffusion filtering algorithm, and correcting the pixel value of the pixel to be corrected by using the pixel values of the neighboring pixels of the pixel to be corrected; The integer value of the strain variable corresponding to the independent variable value in the rising edge of the correction function image and a boundary value among several independent variable values corresponding to different integer values of the strain variable in the falling edge are stored to generate a lookup table; Obtaining the value of the independent variable and determining whether it is at the rising edge or the falling edge of the correction function image, so as to determine the method of reading the data stored in the lookup table according to the determination result; Calculate the pixel correction value of the pixel to be corrected relative to the neighboring pixel based on the stored data to reduce image noise; Among them, the values of the independent variable and the dependent variable are all natural numbers.
[0023] In the present invention, the anisotropic diffusion filtering algorithm is specifically: The idea of the anisotropic diffusion filtering algorithm is to perform smoothing within the scale region and reduce unnecessary smoothing or even non-smoothing at the boundaries between scale regions. The anisotropic diffusion model (PM model) is improved based on the heat diffusion partial differential equation: (1) Among them, div represents the divergence operator, represents the gradient operator, △ represents the Laplace operator, I t represents the t-th iteration image, I 0 represents the original image, and c(•) is the diffusion coefficient function.
[0024] If c(•) is a constant, then it simplifies to the isotropic heat diffusion equation I t =c△t. Assuming we know the location of the region boundaries, we set the diffusion coefficient inside each region to 1 and the diffusion coefficient on the boundary to 0. In this way, filtering will be performed separately in each region, the boundaries can be kept clear, and there is no interaction between different regions.
[0025] Therefore, in order to achieve the edge-preserving effect, c(•) needs to consider two factors—the boundary estimate E(•) and the diffusion coefficient variation with the boundary g(•).
[0026] The boundary estimate E(x, y, t) is required to be able to calculate whether the current position is the best estimate of the boundary. An ideal estimate needs to meet two characteristics: 1. Inside each region, E(x,y,t)=0; 2. For each boundary point E(x,y,t)=Ke(x,y,t), where e is the normal vector unit on the edge and K is the local contrast of the edge.
[0027] If there exists an E(x, y, t) that satisfies the above requirements well, then the diffusion coefficient function can be defined as c=g(||E||), where g(•) is used to adjust the diffusion coefficient according to the boundary estimate; as required, g(•) should be a non-negative monotonically decreasing function, and g(0)=1, and g(•) drops to 0 when encountering the boundary; in this way, the diffusion process only takes place within the region, and when the value of E is large, the diffusion process will not affect or cross the boundary.
[0028] In the PM model, boundary estimation is achieved through grayscale gradient , g(•) has two choices: (2) or (3) Figure 3 For the gradient The value range is [0,255], when K=20, and It can be seen that when the threshold K is reached, The decline rate is faster than , approaches 0 faster, so the scale spaces generated by these two functions are different: Give more weight to high-contrast edges than to low-contrast edges. Give more weight to larger areas than to smaller ones.
[0029] For a two-dimensional image, the anisotropic diffusion equation of the 4-neighborhood discrete form of formula (1) is: (4) Among them, N, S, W, and E are the mnemonic subscripts for up, down, left, and right, respectively. , Represents the grayscale difference of the nearest neighbor: (5) The diffusion coefficients in each direction are: (6) Select g 2 (•) as the diffusion coefficient function, let , , formula (4) can be simplified to: (7) Where X and X' represent the original pixel and the corrected pixel respectively, and N, S, W, and E are the upper, lower, left, and right pixel values respectively.
[0030] For the four-way anisotropic diffusion filtering algorithm, when the threshold T is greater than the grayscale difference between the adjacent noise point and the corrected pixel, the presence of the noise point will have a greater impact on the correction value of the surrounding pixels above, below, left and right, and this impact cannot spread to the oblique pixels, resulting in a certain difference between the surrounding pixels and the oblique pixels, thus resulting in a checkerboard noise phenomenon.
[0031] If the formula can be optimized to 8 items, the correction value caused by the noise can be diffused to the eight directions of the neighborhood. At the same time, the additional introduction of correction values in 4 oblique directions for averaging can also reduce the grayscale difference between the noise and the neighboring pixels. In the case of eight-way correction, the grayscale value transition of different pixels is smoother after correction.
[0032] On the basis of formula (4), the one-way correction values of four additional oblique pixels are added, and the eight one-way correction values are summed and averaged.
[0033] NW, NE, SW, and SE are the upper left, upper right, lower left, and lower right pixel values, respectively. , the simplified algorithm formula is as follows: (8) Compared with four-way filtering, eight-way filtering considers more directions, can better adapt to the complex structures and textures in the image, and retain more details. However, precisely because more directions are considered, the amount of calculation is greater and the processing speed is slower than four-way filtering. Therefore, four-way filtering is suitable for processing images with simple structures and few noise directions, while eight-way filtering is suitable for processing images with complex structures and textures. Which filter to choose depends on the specific application scenario and performance requirements.
[0034] In the present invention, based on the pixel value correction formula (7) and formula (8) in the anisotropic diffusion filter algorithm, a correction function Y is constructed: Among them, Y represents the correction coefficient of one of the neighboring pixels above, below, left, and right of the pixel to be corrected for the pixel to be corrected, X represents the pixel value difference between one of the neighboring pixels above, below, left, and right of the pixel to be corrected and the pixel to be corrected, a is a constant, and its value is determined by the correction scenario of four-way filtering or eight-way filtering. According to experience, the value range of K is related to the bit mode. For 8-bit mode, the value range of K is 0-255, for 10-bit mode, the value range of K is 0-1023, and for 12-bit mode, the value range of K is 0-4095. Among them, different bit modes will affect the maximum value of the correction function, and then affect the bit width required for the integer part of Y. For different bit modes, the larger the K value, the higher the corresponding accuracy.
[0035] In the present invention, a correction function constructed by an anisotropic diffusion filtering algorithm is used to calculate the pixel value correction coefficient of the neighboring pixels around the pixel to be corrected to reflect the influence of the neighboring pixels on the pixel to be corrected.
[0036] In the present invention, the correction values under different K values are calculated, and the calculated data are stored to obtain storage resources to generate a lookup table, which is convenient for data storage and reading, so as to save hardware computing resources.
[0037] The specific stored procedure is: The integer value of the strain variable Y corresponding to the independent variable X value is taken for the rising edge of the correction function image, and one boundary value among several independent variable X values corresponding to the same strain variable Y value on its falling edge is recorded to generate a lookup table.
[0038] The advantage of such storage is that, since the characteristic of the correction image is that it rises quickly first and then falls slowly, and the stored values of the independent variable X and the strain variable Y are both natural numbers, therefore, for the falling edge of the correction function image, different independent variable X values correspond to the same integer value of the strain variable Y. If the method of recording the strain variable Y value is continued, different independent variable X values will repeatedly record the same strain variable Y value, wasting storage resources. Since different strain variable Y values correspond to different X value intervals, by storing one of the boundary values of the interval, the hardware storage resources for repeatedly recording the Y value can be reduced, thereby improving storage efficiency.
[0039] In the present invention, the rounding method for the Y value includes but is not limited to rounding or retaining integer digits. Other rounding methods still fall within the protection scope of the present invention.
[0040] In the present invention, when reading, the independent variable value is used as the index value to read the independent variable Y value. Since the data storage methods of the rising edge and the falling edge of the correction function image are different, the data reading methods of the rising edge and the falling edge are also different when reading. By adding a selection logic to determine whether the X value as the index value is located at the rising edge or the falling edge, different storage data reading methods are performed according to the different positions of the index values to obtain the Y values corresponding to different index values.
[0041] In the present invention, the Y value obtained by indexing the independent variable X value as the index value is substituted into the pixel value correction formula (7) or (8) to calculate the corrected pixel value of the pixel to be corrected, and the pixel value correction operation of the pixel to be corrected is performed with the pixel values of the pixel points in the neighborhood of the pixel to be corrected to achieve image noise reduction.
[0042] As described above, in the present invention, a correction function is constructed through an anisotropic diffusion filtering algorithm to intuitively display the pixel value relationship between the pixel to be corrected and its neighboring pixels, and the function characteristics of the correction function are used to record the strain variable Y value in the rising edge of the correction function image, and a boundary value among several independent variable values corresponding to different strain variable integer values in the falling edge of the image, instead of repeatedly recording the same Y value corresponding to several independent variables, to ensure that less hardware storage resources are used to record and store data, so as to generate a lookup table, reduce hardware computing resources, and facilitate recording and reading data.
[0043] In the embodiment of the present invention, the neighboring pixel points of the pixel point to be corrected include four-directional neighbors of up, down, left, and right pixel points and eight-directional neighbors of up, down, left, right, and oblique pixel points.
[0044] In the present invention, there are currently two types of neighboring pixels of the pixel to be corrected, one of which is a four-way neighborhood including four neighboring pixels above, below, left and right of the pixel to be corrected. For this neighborhood pixel, a takes a value of 4, and the correction function is: For a four-way neighborhood, the maximum value of the correction function is when The value of Y at this time is , that is, the inflection points of the rising and falling edges of the correction function image are .
[0045] The other is an eight-way neighborhood including eight pixel points above, below, left, right, and four oblique angles of the pixel to be corrected. For the pixel points in this neighborhood, a is 8, and the correction function is: For the eight-way neighborhood, the maximum value of the correction function is when The value of Y at this time is , that is, the inflection points of the rising and falling edges of the correction function image are .
[0046] In the embodiment of the present invention, the correction function image has the characteristics of steep rise on the rising edge and gradual fall on the falling edge.
[0047] In the present invention, the rising edge of the correction function image has a rapid rising trend, that is, it has a steep rising property, and the falling edge has a slow falling trend, that is, it has a slow falling property, which reflects that the change trend of the correction function response variable shows the characteristic of first rising rapidly and then falling slowly as the independent variable increases. It is precisely because of this characteristic that for the falling edge of the correction function image, several different independent variables correspond to the same response variable, so that hardware storage resources can be saved by storing the boundary values of the independent variables instead of storing repeated response variables.
[0048] In the embodiment of the present invention, one of the boundary values of the independent variable value interval is a maximum value or a minimum value.
[0049] In the present invention, since the values of the independent variable and the strain variable are both integers, there are situations in the falling edge of the corrected image where different independent variables correspond to the same strain variable integer. Therefore, several independent variables corresponding to the same strain variable constitute an independent variable interval, and the independent variables in the interval all correspond to the same strain variable integer value. In order to avoid repeated storage of the same strain variable value, the boundary value of the independent variable interval is stored to reduce the waste of hardware storage resources and improve storage efficiency. The boundary value includes the maximum value and minimum value of the independent variable value interval. The reason is that by selecting the maximum value or minimum value of the independent variable interval, not only can the boundary value be used to replace the storage of the same strain variable, but also the independent variable interval can be distinguished, which is convenient for judging the interval range of the index value during subsequent reading, thereby improving reading efficiency.
[0050] In the embodiment of the present invention, the method of determining the method of reading the data stored in the lookup table according to the judgment result includes: When the independent variable value is at the rising edge, read the integer value of the dependent variable corresponding to the independent variable value in the lookup table; When the independent variable value is at the falling edge, it is determined between which two boundary values the independent variable value is located to obtain the dependent variable value corresponding to the corresponding boundary value.
[0051] In the present invention, when reading the stored data in the lookup table, the given independent variable value is used as the index value to read the corresponding dependent variable value. Since the data storage methods of the rising edge and the falling edge in the correction function image are different, the data reading also needs to distinguish the position of the independent variable value in the image, and judge whether the independent variable value is at the rising edge or the falling edge through the judgment logic.
[0052] Since the integer value of the strain variable corresponding to the independent variable value in the rising edge of the correction function image is stored, when the independent variable value is located at the rising edge of the correction function image, the strain variable value corresponding to the independent variable value can be directly output.
[0053] Since one of the boundary values among the independent variable values corresponding to different integer values of the dependent variable in the falling edge is stored, when the independent variable value is at the falling edge of the correction function graph, the independent variable is located between two stored boundary values by judging which one of the two stored boundary values the independent variable is located between, that is, judging which independent variable interval the independent variable is located in, thereby obtaining the corresponding dependent variable value of the independent variable interval.
[0054] In the present invention, by judging whether the independent variable value is located at the rising edge or the falling edge of the correction function image, the reading method of the data stored in the lookup table is determined. If the independent variable value is located at the rising edge, the corresponding dependent variable value is directly outputted. If the independent variable value is located at the falling edge, it is judged again between which two boundary values the independent variable value is located to judge in which independent variable interval the independent variable is located, thereby obtaining the dependent variable value corresponding to the independent variable interval, so as to perform subsequent calculation of the correction value of the pixel to be corrected. Due to the existence of the judgment logic, it is obvious that the reading speed of the independent variable at the rising edge of the correction function image is higher than the reading speed of the independent variable at the falling edge, that is, the storage method of the dependent variable at the rising edge has a fast reading speed but consumes a lot of storage resources, while the storage method of the dependent variable at the falling edge has a slow reading speed but less storage resources. Therefore, the present invention utilizes the fact that the dependent variable in the correction function has a trend of changing first fast and then slowing down as the independent variable increases, that is, the correction function image has the characteristics of steep rise on the rising edge and slow fall on the falling edge, and adopts different storage methods for the dependent variables corresponding to the independent variables in the rising edge and the falling edge of the image, thereby realizing the overall hardware storage and reading optimization.
[0055] In the embodiment of the present invention, the step of determining between which two boundary values the independent variable value is located includes: By comparing the value of the independent variable with the stored boundary values, you can get which two boundary values the independent variable value lies between.
[0056] In the present invention, after determining that the independent variable is located at the falling edge, since in the falling edge, a number of independent variable intervals and a number of dependent variable values have a one-to-one correspondence, it is necessary to determine between which two stored boundary values the independent variable is located, so as to determine in which independent variable interval the independent variable is located, thereby obtaining the dependent variable value corresponding to the independent variable interval, and the way to determine that the independent variable is located in the interval is: By comparing the stored boundary value with the size of the independent variable value as the index value, the position of the independent variable value is gradually determined, thereby obtaining the dependent variable value to be output.
[0057] In the embodiment of the present invention, the method for comparing the independent variable value with the storage boundary value includes one or more of a binary method, an operation method or a comparison method.
[0058] Preferably, the present invention adopts a binary search method to gradually determine between which two boundary values the independent variable value is located, thereby determining the independent variable interval in which the independent variable value is located.
[0059] In the embodiment of the present invention, the step of obtaining the strain value corresponding to the corresponding boundary value includes: If one of the boundary values of the interval storing the independent variable value is the maximum value, then the dependent variable value corresponding to the larger value of the two boundary values is obtained; If one of the boundary values of the interval storing the independent variable value is the minimum value, then the dependent variable value corresponding to the smaller value of the two boundary values is obtained.
[0060] In the present invention, after determining between which two boundary values the independent variable value is located, how to determine which boundary value the independent variable value is located in corresponding to the independent variable interval, that is, which boundary value corresponding to the dependent variable value is used as the output object, needs to be determined based on the stored boundary values.
[0061] In order to further save storage resources, in formula (7), one item is repeatedly calculated for both the upper and lower adjacent pixels and the left and right adjacent pixels. Taking the left and right adjacent pixels as an example, when calculating the correction value of point p(i,j), WX in the left correction value formula is calculated by p(i-1,j)-p(i,j), while EX in the right correction value formula of point p(i-1,j) is calculated by p(i,j)-p(i-1,j). Therefore, for the left and right adjacent pixels, the left pixel And the right pixel There is only one symbol difference, and by caching some results, the amount of calculation can be reduced.
[0062] Furthermore, in the present invention, for the correction function including but not limited to the filter function in the anisotropic diffusion filter algorithm, for the filter function with asymmetric characteristics of the rising edge and the falling edge, the data storage and reading method of the present invention can be adopted to save hardware resources for storing and reading data and realize the overall storage optimization of hardware resources.
[0063] Specifically, for the filtering function that rises quickly first and then falls slowly, the storage and reading method can adopt the correction function method of the present invention; For a filtering function that rises slowly first and then falls quickly, one of the boundary values of several independent variable X values corresponding to the same strain variable Y value in the storage rising edge can be used to record. When reading data, for the independent variable on the rising edge, it is determined between which two boundary values the independent variable value is located to obtain the strain variable value corresponding to the corresponding boundary value. Similarly, for a filtering function that first decreases and then increases, hardware resources can also be saved according to the corresponding storage and reading methods. It is only necessary to ensure that the area where the dependent variable changes slowly with the increase of the independent variable is recorded. This can avoid the waste of hardware storage resources to a large extent.
[0064] What's more, the storage and reading ideas in the present invention are not only applicable to the data storage and reading of filtering functions, but also include data storage and reading methods for independent variables or dependent variables in images with asymmetric curves or broken line functions. In other words, the present invention protects a method for optimizing data storage and reading, which is convenient for saving the use of hardware resources.
[0065] The technical solution of the present invention is now specifically described with the following embodiments: Example
[0066] In this embodiment, the four-way filtering 8-bit mode is taken as an example: Since integer-level operations need to be guaranteed in hardware algorithms, for the pixel value correction formula (7) of the four-way filtering, the sum of the data of the four correction functions must reach an accuracy of 1, so the accuracy requirement of each correction function is 1 / 4, so the bit width of the decimal part of the correction function is 3 bits. Because for 8 bits, when X=32, the maximum value of the correction function Y does not exceed 4, the bit width of the integer part of the correction function is 2 bits, that is, the bit width of the correction function Y is 5 bits. Example
[0067] In this embodiment, the eight-way filtering 8-bit mode is taken as an example: Since integer-level operations need to be guaranteed in hardware algorithms, for the pixel value correction formula (8) of the four-way filtering, the sum of the data of the eight correction functions must reach an accuracy of 1, so the accuracy requirement of each correction function is 1 / 8, so the bit width of the decimal part of the correction function is 4 bits. Because for 8 bits, the maximum value of the correction function Y does not exceed 2, the bit width of the integer part of the correction function is 1 bit, that is, the bit width of the correction function Y is 5 bits.
[0068] The bit width of Y can be divided into an integer part and a fractional part. The integer part is affected by the image bit mode, and the fractional part is affected by the selection of four-way filtering and eight-way filtering.
[0069] In summary, the present invention utilizes the characteristics of the correction function curve that the rising edge is steep and the falling edge is slow, and adopts the method of recording the independent variable for the falling edge instead of the method of recording the dependent variable in the prior art to reduce the hardware resources required for storing data. At the same time, the method of recording the dependent variable for the rising edge is retained to reduce the hardware resources required for obtaining data, thereby achieving overall storage optimization of hardware resources.
[0070] like Figure 4 As shown, based on the same inventive concept, the present application also proposes an image noise reduction system, comprising: An acquisition module constructs a correction function based on an anisotropic diffusion filter algorithm to correct the pixel value of the pixel to be corrected by using the pixel values of the neighboring pixels of the pixel to be corrected; A storage module stores an integer value of a strain variable corresponding to an independent variable value in a rising edge of a correction function image and a boundary value among a plurality of independent variable values corresponding to different integer values of the strain variable in a falling edge, so as to generate a lookup table; An acquisition module, which acquires the value of the independent variable and determines whether it is at the rising edge or the falling edge of the correction function image, so as to determine the method of reading the data stored in the lookup table according to the determination result; A calculation module, which calculates the pixel correction value of the pixel to be corrected relative to the neighboring pixel points based on the stored data to reduce image noise; Among them, the values of the independent variable and the dependent variable are all natural numbers.
[0071] Based on the same inventive concept, the present application also proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the image denoising method as described above is implemented.
[0072] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0073] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.
Claims
1. An image denoising method, characterized in that: include: Constructing a correction function based on anisotropic diffusion filtering algorithm, and correcting the pixel value of the pixel to be corrected by using the pixel values of the neighboring pixels of the pixel to be corrected; The integer value of the strain variable corresponding to the independent variable value in the rising edge of the correction function image and a boundary value among several independent variable values corresponding to different integer values of the strain variable in the falling edge are stored to generate a lookup table; Obtaining the value of the independent variable and determining whether it is at the rising edge or the falling edge of the correction function image, so as to determine the method of reading the data stored in the lookup table according to the determination result; Calculate the pixel correction value of the pixel to be corrected relative to the neighboring pixel based on the stored data to reduce image noise; Among them, the values of the independent variable and the dependent variable are all natural numbers.
2. The image denoising method according to claim 1, characterized in that: The neighboring pixel points of the pixel point to be corrected include four-directional neighbors of up, down, left, and right pixel points and eight-directional neighbors of up, down, left, right, and oblique pixel points.
3. The image denoising method according to claim 1, characterized in that: The correction function image has the characteristics of steep rise on the rising edge and slow fall on the falling edge.
4. The image denoising method according to claim 1, characterized in that: One of the boundary values of the independent variable value interval is a maximum value or a minimum value.
5. The image denoising method according to claim 1, characterized in that: The method of determining the method of reading the data stored in the lookup table according to the judgment result includes: When the independent variable value is at the rising edge, read the integer value of the dependent variable corresponding to the independent variable value in the lookup table; When the independent variable value is at the falling edge, it is determined between which two boundary values the independent variable value is located to obtain the dependent variable value corresponding to the corresponding boundary value.
6. The image denoising method according to claim 5, characterized in that: The step of determining between which two boundary values the independent variable value is located comprises: By comparing the value of the independent variable with the stored boundary values, you can get which two boundary values the independent variable value lies between.
7. The image denoising method according to claim 6, characterized in that: The method for comparing the independent variable value with the storage boundary value includes one or more of a binary method, an operation method or a comparison method.
8. The image denoising method according to claim 7, characterized in that: The step of obtaining the strain variable value corresponding to the corresponding boundary value includes: If one of the boundary values of the interval storing the independent variable value is the maximum value, then the dependent variable value corresponding to the larger value of the two boundary values is obtained; If one of the boundary values of the interval storing the independent variable value is the minimum value, then the dependent variable value corresponding to the smaller value of the two boundary values is obtained.
9. An image noise reduction system, characterized in that: include: An acquisition module constructs a correction function based on an anisotropic diffusion filter algorithm to correct the pixel value of the pixel to be corrected by using the pixel values of the neighboring pixels of the pixel to be corrected; A storage module stores an integer value of a strain variable corresponding to an independent variable value in a rising edge of a correction function image and a boundary value among a plurality of independent variable values corresponding to different integer values of the strain variable in a falling edge, so as to generate a lookup table; An acquisition module, which acquires the value of the independent variable and determines whether it is at the rising edge or the falling edge of the correction function image, so as to determine the method of reading the data stored in the lookup table according to the determination result; A calculation module, which calculates the pixel correction value of the pixel to be corrected relative to the neighboring pixel points based on the stored data to reduce image noise; Among them, the values of the independent variable and the dependent variable are all natural numbers.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, an image denoising method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Multi-resolution anisotropic diffusing filter real-time processing method and device for ultrasound pattern
CN101504763B