METHOD FOR DENOISING IMAGE, APPARATUS, AND COMPUTER-READABLE STORAGE MEDIUM

Information

  • Patent Application
  • 20220253985
  • Publication Number
    20220253985
  • Date Filed
    April 29, 2022
    2 years ago
  • Date Published
    August 11, 2022
    2 years ago
Abstract
A method for denoising an image, an apparatus, and a computer-readable storage medium. The method includes: dividing a to-be-processed image into a plurality of image areas; for each image area, expanding an edge of the image area to obtain an expanded area; wherein the expanded area comprises the image area and an edge area, and the edge area comprises pixels in another image area adjacent to the image area; for each expanded area, performing denoising processing on the expanded area through a preset algorithm to obtain a denoised expanded area; wherein the denoised expanded area comprises a denoised image area and a denoised edge area; and abandoning the denoised edge area in each denoised expanded area, and retaining and combining all the denoised image areas to form a denoised image.
Description
TECHNICAL FIELD

The present disclosure relates to the field of image processing technologies, and in particular to a method for denoising an image, an apparatus, and a computer-readable storage medium.


BACKGROUND

In daily life, image processing technology has been applied to all aspects of human life, such as mobile phone terminal shooting, image display on the display, image denoising analysis in medical aviation and other fields. Among them, image denoising techniques are also applied in many important fields, and how to achieve denoising with fidelity is called the focus of research.


Current image denoising techniques require complex iterative algorithms for implementation, with complicated computational processes, more computational resources required, and longer computational times.


SUMMARY OF THE DISCLOSURE

The present disclosure provides a method for denoising an image, an apparatus, and a computer-readable storage medium.


To solve the above technical problem, the present disclosure provides a method for denoising an image, comprising: dividing a to-be-processed image into a plurality of image areas; for each image area, expanding an edge of the image area to obtain an expanded area; wherein the expanded area comprises the image area and an edge area, and the edge area comprises pixels in another image area adjacent to the image area; for each expanded area, performing denoising processing on the expanded area through a preset algorithm to obtain a denoised expanded area; wherein the denoised expanded area comprises a denoised image area and a denoised edge area; and abandoning the denoised edge area in each denoised expanded area, and retaining and combining all the denoised image areas to form a denoised image.


In some embodiments, for each image area, the expanding an edge of the image area to obtain an expanded area comprises: expanding the image area along an edge shape of the image area to obtain the expanded area with the same shape as the image area.


In some embodiments, the expanding the image area along an edge shape of the image area comprises: expanding the edge of the image area with a preset number of pixels along the edge shape of the image area; wherein the preset number is greater than or equal to 1.


In some embodiments, the dividing a to-be-processed image into a plurality of image areas comprises: equally dividing the to-be-processed image into the plurality of image areas each in a rectangular shape.


In some embodiments, in condition of the to-be-processed image being a three-dimensional image, the dividing a to-be-processed image into a plurality of image areas comprises: dividing the to-be-processed image into the plurality of image areas according to three-dimensional coordinates of the to-be-processed image; wherein each image area is three-dimensional.


In some embodiments, for each expanded area, the performing denoising processing on the expanded area through a preset algorithm comprises: establishing an image denoising Rudin-Osher-Fatemi (ROF) model for the expanded area, and solving a Euler-Lagrange equation for the image denoising ROF model to denoise the expanded area; wherein the Euler-Lagrange equation of the image denoising ROF model is as followed:






{








u
k

-

z
k

-

α




·

(




u
k










u
k




2

+
β



)





=
0

,





in






Ω
δ
k


,











u
k




n


=
0

,





on








Ω
δ
k



,




;





where uk is a pixel value of a k-th denoised image area, zk is a pixel value of a k-th image area, Ωδk is a k-th expanded area, and n is an outer normal vector of a corresponding image area; k is greater than or equal to 1 and less than or equal to n; α and β are preset parameters.


In some embodiments, values of α and β depend on a desired denoising degree; the greater the desired denoising degree, the less the values of α and β.


In some embodiments, for each expanded area, the performing denoising processing on the expanded area through a preset algorithm comprises: applying a Newton-Krylov-Schwarz (NKS) algorithm to denoise the expanded area.


To solve the above technical problem, the present disclosure further provides an apparatus for denoising an image, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor; wherein the processor is capable of executing the computer program to implement operations of the method as described above.


To solve the above technical problem, the present disclosure further provides a computer-readable storage medium, storing a computer program; wherein the computer program is executable by a processor to implement operations of the method as described above.





BRIEF DESCRIPTION OF THE DRAWINGS


FIG. 1 is a flowchart of a method for denoising an image according to an embodiment of the present disclosure.



FIG. 2 is an expanded schematic view of an image area in the embodiment shown in FIG. 1.



FIG. 3 is a schematic view of an image area division of a three-dimensional image in the embodiment shown in FIG. 1.



FIG. 4 is an effect view after denoising processing on an image through the method embodiment shown in FIG. 1.



FIG. 5 is a structural schematic view of a denoising apparatus according to an embodiment of the present disclosure.



FIG. 6 is a structural schematic view of a computer-readable storage medium according to an embodiment of the present disclosure.





DETAILED DESCRIPTION

In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, an image denoising method, an image denoising apparatus, and a computer-readable storage medium provided by the present disclosure are described in further detail below in conjunction with the accompanying drawings and specific embodiments.


The image denoising method of the present disclosure is particularly suitable for large-scale images. In the method of the present disclosure, a to-be-processed image is first divided into a plurality of image areas to perform denoising processing on each image area, thereby reducing the calculation scale. In addition, it is found in the present disclosure that when directly denoising a divided image area, since there are no associated pixels around pixels at an edge of the image to refer to for denoising, the denoising effect is not good. In the present disclosure, the image is expanded and then denoised. In this case, the pixels at the edges are expanded pixels, and the pixels at the original edges are now located inside the expanded area, such that the denoising effect of the pixels at the original edges may be ensured. After completing the calculation, the denoising result at the expanded edges is discarded, i.e., the part with better denoising effect is retained and the image is reconstructed based thereon. The present disclosure ensures the denoising effect of the whole image by the above method.


Referring to FIG. 1, FIG. 1 is a flowchart of a method for denoising an image according to an embodiment of the present disclosure. The method includes operations at blocks illustrated therein.


At block S101: dividing a to-be-processed image into a plurality of image areas.


In the present disclosure, the to-be-processed image is first divided into multiple image areas, and different processors may be applied to implement parallel calculation of the multiple image areas.


When the to-be-processed image is a two-dimensional image, the to-be-processed image may be equally divided into multiple rectangular image areas, which may facilitate calculation and equalize the calculation burden, improving the overall calculation efficiency. As shown in FIG. 2, FIG. 2 is an expanded schematic view of an image area in the embodiment shown in FIG. 1. The to-be-processed image in FIG. 2 is divided into multiple image areas Ω0k.


When the to-be-processed image is a three-dimensional image, during the dividing process of the three-dimensional image, the to-be-processed image is divided into multiple three-dimensional image areas according to three-dimensional coordinates of the to-be-processed image. As shown in FIG. 3, FIG. 3 is a schematic view of an image area division of a three-dimensional image in the embodiment shown in FIG. 1. The three-dimensional to-be-processed image is divided along three mutually perpendicular axes, so as to obtain divided three-dimensional image areas. Different from a calculation method in which a three-dimensional image is changed to a two-dimensional image through slices, the calculation is performed directly with three-dimensional data in the embodiment, which is faster and has better effect.


At block S102: expanding an edge of each image area to obtain a corresponding expanded area.


During the calculation of each image area, the edge of the image area is required to be expanded to ensure the denoising effect of the edge of the image area. The obtained expanded area includes the image area and an edge area, and the edge area includes pixels in other image areas adjacent to the image area.


Further referring to FIG. 2, in FIG. 2, the to-be-processed image is divided into multiple image areas Ω0k, and an edge of each image area Ω0k is expanded to obtain an expanded area Ωδk. The expanded area Ωδk, includes the image area Ω0k and an edge area δ. To facilitate understanding, in FIG. 2, the edge area δ only shows the expanded part of the lower edge of the image area. Of course, the expanded parts at the upper, left, and right edges are also an edge area. The edge area δ includes pixels in other adjacent image areas. That is, adjacent expanded areas overlap each other at least partially.


Specifically, in order to ensure that each pixel at the edge of the image area has a better denoising effect, each pixel at the edge is expanded. Therefore, the expansion in the embodiment is an expansion of the image area along the edge shape of the image area, to obtain the expanded area having the same shape as the image area. Specifically, the edge of the image area is expanded by a preset number of pixels, the preset number is greater than or equal to 1, and is further set to be less than or equal to 5. For example, in FIG. 2, the edge of the image area is expanded by 2 pixels.


The reason why the pixel at the edges has poor denoising effect is because the surrounding pixels are not considered in the calculation, while the contents of adjacent pixels in the image are generally related to each other. Therefore, in the embodiment, the image area is expanded and then calculated, and the number of associated pixels is not too large. In the embodiment, the number of expanded pixels may be set to 1-5. Of course, the more the number, the greater the computational burden. After an experimental verification, expansion with 2 pixels may be enough to achieve better calculation results and faster calculation speed.


At block S103: performing denoising processing on each expanded area through a preset algorithm to obtain a corresponding denoised expanded area.


After the image area is expanded, a preset algorithm is used to denoise the expanded area, that is, mathematical calculations are performed.


In a case where the image denoising is described in mathematical language, the details are as follows:






z(x)=u(x)+ε(x), xÅΩ⊂custom-characterd (d=2,3)


where u(x) represents an ideal denoised image to be restored, z(x) represents the original observed to-be-processed image, ε(x) represents an image noise to be removed, and x∈Ω⊂custom-characterd (d=2,3) represents whether the image is a two-dimensional image or a three-dimensional image. The performing denoising processing on the to-be-processed image is to find the ideal denoised image u(x).


In the embodiment, an image denoising Rudin-Osher-Fatemi (ROF) model is established to solve the above-mentioned image denoising problem, and the model is specifically as follows:







Find






u
k




B


V


(

Ω
δ
k

)









Such





that







min


u
k



BV


(

Ω
δ
k

)






{


α





Ω
δ
k









u
k





d






Ω
δ
k




+


1
2







u
k

-

z
k






L
2



(

Ω
δ
k

)


2



}






where zk=z|Ωδk is sub-image data with noise on the expanded area


The above ROF model may be converted into Euler-Lagrange equation form to facilitate solving.








{







u
k

-

z
k

-

α




·

(




u
k










u
k




2

+
β



)





=
0

,





in






Ω
δ
k


,











u
k




n


=
0

,





on








Ω
δ
k



,









where α is a positive parameter, and β is also a positive parameter to avoid singularities when ↑∇uk| is 0. k represents a k-th area, and n represents an outer normal vector of the divided image area. In the embodiment, during specific calculations, uk is a pixel value of the k-th denoised image area, and zk is a pixel value of the k-th image area, that is, the original pixel value. The values of α and β depend on the degree of desired denoising. When the degree of desired denoising is greater, the values of α and β will be less, In the embodiment, the degree of denoising is expected to be greater, as shown in FIG. 4, where α=0.18, β=1.0×10−4.


For the above image denoising, a Newton-Krylov-Schwarz (NKS) algorithm may be used for calculation in the embodiment, and the specific process of the algorithm is as follows:


1. taking the image areas divided by the to-be-processed image as an initial image u0.


2.1 building a Jacobian matrix Jk.


2.2 using a Krylov subspace method to fuzzy calculate the following right preconditions for the Jacobian system.






J
k
M
k
−1
M
k
s
k
=−F(uk)


2.3 performing three times of line searching to determine a step size Tk.


2.4 uk+1=uk+Tksk.


iteratively performing the above 2.1-2.4, k=0,1, . . . until convergence.


Among them, F(u0)=0 represents a nonlinear system generated by the finite difference discretization of the following formula in the Euler-Lagrange equation above on a rectangular or hexahedral grid.









u
k

-

z
k

-

α




·

(




u
k










u
k




2

+
β



)





=
0

,

in






Ω
δ
k






where Jk represents the full Jacobian matrix of F(uk), and Mk−1 represents an additional Schwarz preprocessing operator.


Fuzzy calculation means that the accuracy of Jacobian calculation depends on a parameter η, based on:





F(uk)+J(uk)sk∥≤η∥F(uk)∥


In the calculation of the NKS algorithm, the number of divided image areas is equal to the number of solvers. The solvers are for incomplete LU decomposition. The relative remaining stopping conditions for a linear solver and a nonlinear solver are 10−4 and 10−6, respectively, and the overlap in the Schwarz preprocessing operator is set to 1.


In this operation, each expanded area is calculated to obtain a corresponding denoised expanded area, and the denoised expanded area includes a denoised image area and a denoised edge area.


At block S104: abandoning a denoised edge area in each denoised expanded area, and retaining and combining the denoised image areas to form a denoised image.


After calculating the above expanded area Ωδk, the edge area part is removed, the image area part Ω0k is retained, and all the denoised image areas are combined to obtain the denoised image u. The mathematical calculation process is as follows:





u=Σk=1NE0kR0kuk


where R0k is a restriction operator from the expanded area Ωδk to the image area Ω0k. That is, the vector uk is defined in the expanded area Ωδk, and R0kuk belongs to only the image area Ω0k.


E0k is an expansion operator from the image area Ω0k to the entire image Ω. That is, m is defined as the number of pixels in the image Ω, mk is the number of pixels in the expanded area Ωδk, and E0k is a m×mk matrix. When the element (E0k)l1, l2 in the matrix can correspond to a pixel in the image area, its value is 1; when the element (E0k)l1,l2 in the matrix cannot correspond to a pixel in the image area, its value is 0.


In the image denoising method in the embodiments, a to-be-processed image is first divided into multiple image areas, reducing the calculation scale. The edge is expanded, and after the denoising calculation, the expanded edge area with poor denoising result is removed, effectively improving the denoising effect. Specifically, ROF model or NKS algorithm may be used for calculation. For large-scale images, efficient and fast calculation may be achieved.


When the above image denoising method is implemented in detail, a computer program is usually used to express its logical process, that is, each operation of the denoising method. In addition, a corresponding software system is constructed to implement the above denoising method based on hardware equipment.


For hardware equipment, reference may be made to FIG. 5, which is a structural schematic view of a denoising apparatus according to an embodiment of the present disclosure. A denoising apparatus 100 includes a processor 11 and a memory 12, and a computer program is stored in the memory 12. The processor 11 can implement the above denoising method when the computer program is executed.


The computer program may be stored in a computer-readable storage medium. When the above image denoising method is implemented in the form of software and sold or used as an independent product, it can be stored in a readable storage medium of an electronic device. That is, the present disclosure further provides a computer-readable storage medium. Referring to FIG. 6. FIG. 6 is a structural schematic view of a computer-readable storage medium according to an embodiment of the present disclosure. A computer-readable storage medium 200 stores a computer program, and the computer program can be executed by a processor to implement operations of the above method. The computer-readable storage medium may be a U disk, an optical disk, a server, etc.


The above is only an embodiment of the present disclosure, and does not therefore limit the scope of the present disclosure. The equivalent structure or equivalent process transformation made by using the contents of specification and drawings in the present disclosure, or directly or indirectly applied to other related technical fields, is the same as included in the scope of the present disclosure.

Claims
  • 1. A method for denoising an image, comprising: dividing a to-be-processed image into a plurality of image areas;for each image area, expanding an edge of the image area to obtain an expanded area; wherein the expanded area comprises the image area and an edge area, and the edge area comprises pixels in another image area adjacent to the image area;for each expanded area, performing denoising processing on the expanded area through a preset algorithm to obtain a denoised expanded area; wherein the denoised expanded area comprises a denoised image area and a denoised edge area; andabandoning the denoised edge area in each denoised expanded area, and retaining and combining all the denoised image areas to form a denoised image.
  • 2. The method according to claim 1, wherein for each image area, the expanding an edge of the image area to obtain an expanded area comprises: expanding the image area along an edge shape of the image area to obtain the expanded area with the same shape as the image area.
  • 3. The method according to claim 2, wherein the expanding the image area along an edge shape of the image area comprises: expanding the edge of the image area with a preset number of pixels along the edge shape of the image area; wherein the preset number is greater than or equal to 1.
  • 4. The method according to claim 1, wherein the dividing a to-be-processed image into a plurality of image areas comprises: equally dividing the to-be-processed image into the plurality of image areas each in a rectangular shape.
  • 5. The method according to claim 1, wherein in condition of the to-be-processed image being a three-dimensional image, the dividing a to-be-processed image into a plurality of image areas comprises: dividing the to-be-processed image into the plurality of image areas according to three-dimensional coordinates of the to-be-processed image; wherein each image area is three-dimensional.
  • 6. The method according to claim 1, wherein for each expanded area, the performing denoising processing on the expanded area through a preset algorithm comprises: establishing an image denoising Rudin-Osher-Fatemi (ROF) model for the expanded area, and solving a Euler-Lagrange equation for the image denoising ROF model to denoise the expanded area;wherein the Euler-Lagrange equation of the image denoising ROF model is as followed:
  • 7. The method according to claim 6, wherein values of α and β depend on a desired denoising degree; the greater the desired denoising degree, the less the values of α and β.
  • 8. The method according to claim 1, wherein for each expanded area, the performing denoising processing on the expanded area through a preset algorithm comprises: applying a Newton-Krylov-Schwarz (NKS) algorithm to denoise the expanded area.
  • 9. An apparatus for denoising an image, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor; wherein the processor is capable of executing the computer program to implement: dividing a to-be-processed image into a plurality of image areas;for each image area, expanding an edge of the image area to obtain an expanded area; wherein the expanded area comprises the image area and an edge area, and the edge area comprises pixels in another image area adjacent to the image area;for each expanded area, performing denoising processing on the expanded area through a preset algorithm to obtain a denoised expanded area; wherein the denoised expanded area comprises a denoised image area and a denoised edge area; andabandoning the denoised edge area in each denoised expanded area, and retaining and combining all the denoised image areas to form a denoised image.
  • 10. The apparatus according to claim 9, wherein for each image area, the expanding an edge of the image area to obtain an expanded area comprises: expanding the image area along an edge shape of the image area to obtain the expanded area with the same shape as the image area.
  • 11. The apparatus according to claim 10, wherein the expanding the image area along an edge shape of the image area comprises: expanding the edge of the image area with a preset number of pixels along the edge shape of the image area; wherein the preset number is greater than or equal to 1.
  • 12. The apparatus according to claim 9, wherein the dividing a to-be-processed image into a plurality of image areas comprises: equally dividing the to-be-processed image into the plurality of image areas each in a rectangular shape.
  • 13. The apparatus according to claim 9, wherein in condition of the to-be-processed image being a three-dimensional image, the dividing a to-be-processed image into a plurality of image areas comprises: dividing the to-be-processed image into the plurality of image areas according to three-dimensional coordinates of the to-be-processed image; wherein each image area is three-dimensional.
  • 14. The apparatus according to claim 9, wherein for each expanded area, the performing denoising processing on the expanded area through a preset algorithm comprises: establishing an image denoising Rudin-Osher-Fatemi (ROF) model for the expanded area, and solving a Euler-Lagrange equation for the image denoising ROF model to denoise the expanded area;wherein the Euler-Lagrange equation of the image denoising ROF model is as followed:
  • 15. The apparatus according to claim 14, wherein values of α and β depend on a desired denoising degree; the greater the desired denoising degree, the less the values of α and β.
  • 16. The apparatus according to claim 9, wherein for each expanded area, the performing denoising processing on the expanded area through a preset algorithm comprises: applying a Newton-Krylov-Schwarz (NKS) algorithm to denoise the expanded area.
  • 17. A non-transitory computer-readable storage medium, storing a computer program; wherein the computer program is executable by a processor to implement: dividing a to-be-processed image into a plurality of image areas;for each image area, expanding an edge of the image area to obtain an expanded area; wherein the expanded area comprises the image area and an edge area, and the edge area comprises pixels in another image area adjacent to the image area;for each expanded area, performing denoising processing on the expanded area through a preset algorithm to obtain a denoised expanded area; wherein the denoised expanded area comprises a denoised image area and a denoised edge area; andabandoning the denoised edge area in each denoised expanded area, and retaining and combining all the denoised image areas to form a denoised image.
  • 18. The non-transitory computer-readable storage medium according to claim 17, wherein for each image area, the expanding an edge of the image area to obtain an expanded area comprises: expanding the image area along an edge shape of the image area to obtain the expanded area with the same shape as the image area.
  • 19. The non-transitory computer-readable storage medium according to claim 17, wherein for each expanded area, the performing denoising processing on the expanded area through a preset algorithm comprises: establishing an image denoising Rudin-Osher-Fatemi (ROF) model for the expanded area, and solving a Euler-Lagrange equation for the image denoising ROF model to denoise the expanded area;wherein the Euler-Lagrange equation of the image denoising ROF model is as followed:
  • 20. The non-transitory computer-readable storage medium according to claim 19, wherein values of α and β depend on a desired denoising degree; the greater the desired denoising degree, the less the values of α and β.
CROSS REFERENCE

The present application is a continuation-application of International (PCT) Patent Application No. PCT/CN2019/114761, filed on Oct. 31, 2019, the entire contents of which are hereby incorporated by reference in its entirety.

Continuations (1)
Number Date Country
Parent PCT/CN2019/114761 Oct 2019 US
Child 17732577 US