CN111415313B - Image processing method, image processing device, electronic equipment and storage medium - Google Patents
Image processing method, image processing device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111415313B CN111415313B CN202010289258.3A CN202010289258A CN111415313B CN 111415313 B CN111415313 B CN 111415313B CN 202010289258 A CN202010289258 A CN 202010289258A CN 111415313 B CN111415313 B CN 111415313B
- Authority
- CN
- China
- Prior art keywords
- pixel
- value
- frequency domain
- image
- domain image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20024—Filtering details
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
The embodiment of the invention discloses an image processing method, an image processing device, electronic equipment and a medium, wherein the method comprises the following steps: generating a sub-noise value of each pixel in a first frequency domain image according to a power spectrum of the first frequency domain image; determining a power value of each pixel according to the power spectrum; generating a filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel; and generating a second frequency domain image according to the filtering intensity value of each pixel. By implementing the embodiment of the invention, refined filtering can be realized for the image, which is beneficial to reducing the noise of the image while ensuring the image details, thereby improving the overall quality of the image.
Description
Technical Field
The present invention relates to the field of signal processing technologies, and in particular, to the field of image processing, and in particular, to an image processing method and apparatus, an electronic device, and a storage medium.
Background
With the progress of electronic technology, the functions of electronic equipment are more and more abundant. More and more electronic devices are currently provided with cameras; the camera can be used for shooting videos or pictures; with the improvement of hardware equipment, the quality of pictures is better and better, but noise still possibly occurs in videos or pictures; therefore, in order to further improve the quality of video or pictures, image processing at a later stage becomes indispensable. The current noise reduction processing method for images includes: carrying out pyramid decomposition on an input image to obtain high-frequency and low-frequency image information on different scales, respectively carrying out guided filtering or convolution filtering on the images on the different scales, and reconstructing the filtered images of all scales to obtain a final filtered output image; however, the pyramid has a limited number of decomposition layers and limited different obtained scales, so that the filtering strength of different frequency components cannot be finely controlled.
Disclosure of Invention
The embodiment of the invention provides an image processing method and device, electronic equipment and a computer storage medium, and aims to realize refined filtering on an image, so that the image detail is ensured, the noise of the image is reduced, and the overall quality of the image is improved.
In a first aspect, an embodiment of the present invention provides an image processing method, which is applied to a first electronic device, and includes:
generating a sub-noise value of each pixel in a first frequency domain image according to a power spectrum of the first frequency domain image;
determining a power value of each pixel according to the power spectrum;
generating a filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel;
and generating a second frequency domain image according to the filtering intensity value of each pixel.
In a possible implementation manner, the generating a second frequency-domain image according to the filtered intensity value of each pixel includes:
generating an objective function value of each pixel according to the filtering intensity value of each pixel and the original function value of each pixel;
and generating the second frequency domain image according to the objective function value of each pixel.
In one possible implementation, the generating a sub-noise value for each pixel in the first frequency-domain image according to the power spectrum of the first frequency-domain image includes:
calculating the average value of the power spectrum to obtain an average energy estimation value;
determining that the total noise value is equal to the average energy estimate to the power of N, where 0 < N < 1.
Determining a first parameter according to the average energy estimation value and a first preset matching relationship, wherein the first parameter in the first preset matching relationship is reduced along with the increase of the average energy estimation value;
acquiring the frequency of each pixel;
determining a second parameter according to the frequency of each pixel and a second preset matching relationship, wherein the second parameter in the second preset matching relationship is increased along with the increase of the frequency of each pixel;
and generating a sub-noise value of each pixel according to the first parameter, the second parameter and the total noise value.
In one possible implementation, the generating the filtering strength value of each pixel according to the sub-noise value of each pixel and the power value of each pixel includes:
and substituting the sub-noise value of each pixel and the power value of each pixel into a preset formula to obtain a filtering intensity value of each pixel, wherein the filtering intensity value in the preset formula is reduced along with the increase of a first ratio, and the first ratio refers to the ratio of the sub-noise value of each pixel and the power value of each pixel.
In one possible implementation, before the generating the sub-noise value of each pixel in the first frequency-domain image according to the power spectrum of the first frequency-domain image, the method further includes:
acquiring an original image, wherein the original image is a non-frequency domain image;
performing Fourier transform on the original image to obtain an initial frequency domain image;
performing frequency spectrum conversion processing on the initial frequency domain image to obtain a first frequency domain image;
generating the power spectrum of the first frequency-domain image.
In a possible implementation manner, after the generating the second frequency-domain image according to the filtered intensity value of each pixel, the method further includes:
performing inverse spectrum conversion processing on the second frequency domain image to obtain a third frequency domain image;
and performing Fourier inverse transformation on the third frequency domain image to obtain a target image.
In a second aspect, an embodiment of the present invention provides an image processing apparatus, including:
a processing unit, configured to generate a sub-noise value for each pixel in a first frequency domain image according to a power spectrum of the first frequency domain image; and for determining a power value for said each pixel from said power spectrum; and for generating a filtered intensity value for said each pixel based on said sub-noise value for said each pixel and said power value for said each pixel; and generating a second frequency domain image according to the filtering intensity value of each pixel.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing steps in any of the methods of the first aspect of the embodiment of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program makes a computer perform part or all of the steps described in any one of the methods of the first aspect of the present application.
In a fifth aspect, the present application provides a computer program product, wherein the computer program product comprises a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps as described in any one of the methods of the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
It can be seen that, in the embodiment of the present invention, first, the electronic device generates a sub-noise value of each pixel in the first frequency domain image according to the power spectrum of the first frequency domain image; secondly, determining the power value of each pixel according to the power spectrum; secondly, generating a filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel; and finally, generating a second frequency domain image according to the filtering intensity value of each pixel. Therefore, in the embodiment of the invention, the electronic device can generate the filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel, and can execute filtering with different intensities according to the specific situation of each pixel, thereby realizing fine filtering aiming at the image; the method is beneficial to reducing the noise of the image while ensuring the details of the image, and further improving the overall quality of the image.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 2A is a schematic flowchart of an image processing method according to an embodiment of the present invention;
FIG. 2B is a schematic diagram of a possible matching relationship between a frequency and a second parameter according to an embodiment of the present invention;
FIG. 2C is a diagram of a first frequency domain image according to an embodiment of the present invention;
FIG. 2D is a diagram illustrating a spectrum conversion process according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating an image processing method according to another embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device includes a processor, a Memory, a signal processor, a communication interface, a touch display screen, a WiFi module, a speaker, a microphone, a Random Access Memory (RAM), a camera, and so on.
The storage, the signal processor, the WiFi module, the touch display screen, the loudspeaker, the microphone, the RAM and the camera are connected with the processor, and the communication interface is connected with the signal processor.
The electronic equipment can read the data of the original image and perform noise reduction processing on the data of the original image; and further generating a target image after noise reduction processing.
Among other things, the electronic devices may include various handheld devices, vehicle-mounted devices, wearable devices (e.g., smartwatches, smartbands, pedometers, etc.), computing devices or other processing devices connected to wireless modems, as well as various forms of User Equipment (UE), Mobile Stations (MS), terminal devices (terminal device), and so on, having wireless communication functions. For convenience of description, the above-mentioned devices are collectively referred to as electronic devices.
Based on the above description, an embodiment of the present invention provides an image processing method, which is applicable to an electronic device. Referring to fig. 2A, the image processing method may include the following steps S201 to S205:
s201, the electronic equipment generates a sub-noise value of each pixel in the first frequency domain image according to the power spectrum of the first frequency domain image.
It should be noted that the terms "first", "second", and the like in the description and claims of the embodiments of the present invention are used for distinguishing different objects, and are not used for describing a specific order.
S202, the electronic equipment determines the power value of each pixel according to the power spectrum.
S203, the electronic equipment generates a filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel.
When the filtering intensity value of each pixel is generated according to the sub-noise value of each pixel and the power value of each pixel, each pixel in the sub-noise value of each pixel, the power value of each pixel and the filtering intensity value of each pixel refers to the same pixel. For example, an image includes K pixels, and when the filtering intensity value of a first pixel of the K pixels is calculated, the filtering intensity value of the first pixel is calculated according to the sub-noise value of the first pixel and the power value of the first pixel, where K is an integer greater than 2; the first pixel may represent any one of K pixels.
S204, the electronic equipment generates a second frequency domain image according to the filtering intensity value of each pixel.
Specifically, the electronic device performs filtering on each pixel according to the filtering intensity value of the pixel; and filtering the first frequency domain image to obtain a second frequency domain image. For example, for a first pixel, the first pixel is filtered by using the filtering intensity value of the first pixel, and the above operation is performed for each pixel in the first frequency domain image, so as to obtain a second frequency domain image.
It can be seen that, in the embodiment of the present invention, first, the electronic device generates a sub-noise value of each pixel in the first frequency domain image according to the power spectrum of the first frequency domain image; secondly, determining the power value of each pixel according to the power spectrum; secondly, generating a filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel; and finally, generating a second frequency domain image according to the filtering intensity value of each pixel. Therefore, in the embodiment of the invention, the electronic device can generate the filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel, so that the electronic device can execute filtering with different intensities according to the specific situation of each pixel, and fine filtering for the image is realized; the method is beneficial to reducing the noise of the image while ensuring the details of the image, and further improving the overall quality of the image.
In one possible implementation, generating the second frequency-domain image according to the filtered intensity value of each pixel includes: generating an objective function value of each pixel according to the filtering intensity value of each pixel and the original function value of each pixel; and generating a second frequency domain image according to the objective function value of each pixel.
It should be noted that, in the process of actually generating the objective function value of each pixel, each pixel in the filtered intensity value of each pixel, the original function value of each pixel, and the objective function value of each pixel refers to the same pixel. For example, for a first pixel in the first frequency domain image, when generating an objective function value for the first pixel, the objective function value for the first pixel is generated from the filtered intensity value for the first pixel and the original function value for the first pixel.
Specifically; the objective function value for each pixel is equal to the product of the filtered intensity value for each pixel and the original function value for each pixel. Please refer to formula If 2 (i,j)=If 1 (i, j) × F (i, j); (i, j) represents the position of the first pixel in the image, in particular, see FIG. 2C; wherein F (i, j) represents the filtered intensity value of the first pixel, If 1 (i, j) represents the original function value, i.e. the value corresponding to the first pixel at (i, j) in the first frequency domain image; if 2 (i, j) represents the value of the objective function, i.e. the value corresponding to the first pixel at (i, j) in the second frequency domain image. Specifically, the first pixel refers to a pixel at the same position in the first frequency domain image and the second frequency domain image. The first frequency domain image is composed of original function values of all pixels; the second frequency domain image is composed of the objective function values of all pixels.
Therefore, in this example, the electronic device can calculate the objective function value of each pixel according to the filtering intensity value and the original function value of each pixel, so that the electronic device can perform filtering according to the specific condition of each pixel, fine filtering of the image is realized, and the quality of the filtered image is improved.
In one possible implementation, generating a sub-noise value for each pixel in the first frequency-domain image from the power spectrum of the first frequency-domain image includes: calculating the average value of the power spectrum to obtain an average energy estimation value; determining that the total noise value is equal to the N power of the average energy estimation value, wherein N is more than 0 and less than 1; determining a first parameter according to the average energy estimation value and a first preset matching relation, wherein the first parameter in the first preset matching relation is reduced along with the increase of the average energy estimation value; acquiring the frequency of each pixel; determining a second parameter according to the frequency of each pixel and a second preset matching relationship, wherein the second parameter in the second preset matching relationship is increased along with the increase of the frequency of each pixel; a sub-noise value for each pixel is generated based on the first parameter, the second parameter and the total noise value.
Specifically, N may be 1/2 in this embodiment of the present invention.
The first preset matching relationship and the second preset matching relationship may be preset matching relationships; the method can be stored in the electronic equipment so as to be convenient for the electronic equipment to call at any time;
wherein, the sub-noise value of each pixel is a first parameter and a second parameter and a total noise value;
referring to fig. 2B, fig. 2B is a schematic diagram illustrating a possible matching relationship between a frequency and a second parameter according to an embodiment of the present invention. It can be seen that the second parameter increases gradually with increasing frequency.
For example, a rectangular coordinate system is established by using the central point of the first frequency domain image, the maximum value of the abscissa in the first frequency domain image is W, the minimum value of the abscissa in the first frequency domain image is-W, the maximum value of the ordinate in the first frequency domain image is H, and the minimum value of the ordinate in the first frequency domain image is-H; please refer to the formula Tout (i, j) ═ K 1 (i,j)*K 2 (i,j)*Tavg;(﹣W<i<W,﹣H<j<H) (ii) a Wherein; i represents the abscissa of the first pixel; j denotes the ordinate of the first pixel, K 1 (i, j) represents a value of a first parameter; wherein in the determined first frequency domain image, K 1 (i, j) is a fixed value; k 2 (i, j) a value representing a second parameter, wherein the second parameter is determined according to the frequency corresponding to the first pixel; in the first frequency domain image, the values of the second parameters of the pixels with the same frequency are the same; second parameter of pixels with different frequenciesThe numerical values of (A) are different; tavg represents the total noise value. Specifically, please refer to fig. 2C, wherein fig. 2C is a schematic diagram of a first frequency domain image according to an embodiment of the present invention.
As can be seen, in this example, the electronic device may determine the sub-noise value corresponding to the pixel according to the average energy of the first frequency domain image, the frequency of the pixel, and the total noise value of the first frequency domain image.
In one possible implementation, generating a filtered intensity value for each pixel according to the sub-noise value of each pixel and the power value of each pixel includes: and substituting the sub-noise value of each pixel and the power value of each pixel into a preset formula to obtain a filtering intensity value of each pixel, wherein the filtering intensity value in the preset formula is reduced along with the increase of a first ratio, and the first ratio refers to the ratio of the sub-noise value of each pixel and the power value of each pixel.
Specifically, the formula for calculating the filtering strength may be: f (i, j) ═ 1/(1+ [ Tout (i, j)/P (i, j)] n ) Wherein, P (i, j) represents a power value corresponding to the first pixel (i, j) located in the rectangular coordinate system; f (i, j) represents the filtered intensity value corresponding to the first pixel.
Wherein the value range of n is n > 1. Specifically, n in the embodiment of the present invention may be 4.
It can be seen that, in this example, when the ratio of the sub-noise value of the pixel to the power value of the pixel is greater than 1, it indicates that the noise of the pixel is greater, that is, the pixel has a greater possibility of being noise, so that F (i, j) decreases with the increase of the ratio, so that finally, according to the smaller signal value after F (i, j) filtering, the noise reduction processing for the pixel is implemented; when the ratio of the sub-noise value of the pixel to the power value of the pixel is less than 1, it means that the pixel noise is low, that is, the probability that the signal corresponding to the pixel is the original image signal is high, so that F (i, j) increases with the decrease of the ratio, so that the signal value after being finally filtered according to F (i, j) is high, and the signal for the pixel is retained.
In one possible implementation, before generating the sub-noise value of each pixel in the first frequency-domain image according to the power spectrum of the first frequency-domain image, the method further includes: acquiring an original image, wherein the original image is a non-frequency domain image; carrying out Fourier transform on the original image to obtain an initial frequency domain image; carrying out frequency spectrum conversion processing on the initial frequency domain image to obtain a first frequency domain image; a power spectrum of the first frequency domain image is generated.
Wherein, the original image may be an image in RGB mode, or an original image file (RAW file); the image of the RGB mode can be subjected to Fourier transform according to R, G, B three channels respectively to obtain an initial frequency domain image; the original image file can be subjected to Fourier transform according to four channels of R, GR, B and GB respectively to obtain an initial frequency domain image.
When the Fourier transform is executed, the two-dimensional Fourier transform is converted into the one-dimensional Fourier transform in the row and column directions, the parallelism is increased, and the Fourier transform efficiency is improved. Specifically, the one-dimensional Fourier Transform may be Fast Fourier Transform (FFT) or Split-radix Fourier Transform (SRFFT).
The frequency spectrum conversion processing refers to frequency spectrum centralization processing, and in an initial frequency domain image, the closer to the central position, the higher the frequency corresponding to a pixel is; after the initial frequency domain image is subjected to the spectrum centering processing, in the first frequency domain image, the closer to the center position, the lower the frequency corresponding to the pixel is. Specifically, please refer to fig. 2D, wherein fig. 2D is a schematic diagram of a spectrum conversion process according to an embodiment of the present invention. And dividing the initial frequency domain image into four regions of 1,2,3 and 4, interchanging the positions of the regions 1 and 3, and interchanging the positions of the regions 2 and 4 to obtain a first frequency domain image.
As can be seen, in this example, the electronic device generates the first frequency domain image and a power spectrum of the first frequency domain image from the input original image.
In one possible implementation, after generating the second frequency-domain image according to the filtered intensity value of each pixel, the method further includes: performing inverse spectrum conversion processing on the second frequency domain image to obtain a third frequency domain image; and performing Fourier inverse transformation on the third frequency domain image to obtain a target image.
Wherein, the step of the inverse spectrum conversion processing is the inverse processing of the spectrum conversion processing.
After Fourier inverse transformation is carried out on the third frequency domain image, the real part of the transformed data is taken, and the filtered target image can be obtained.
Optionally, in the embodiment of the present invention, after the original image is obtained, the original image may be divided into M regions to obtain M sub-original images, where M is greater than or equal to 2 and is an integer; executing the steps in the above claims and the specification for each of the M regions, generating sub-target images corresponding to each region, obtaining M sub-target images, and forming a target image according to the M sub-target images; the position of the first sub-target image in the target image is the same as the position of the first sub-original image in the original image; the first sub-target image is generated from the first sub-original image, and the first sub-target image may represent any one of the M sub-target images.
Referring to fig. 3, fig. 3 is a flowchart illustrating another image processing method according to an embodiment of the present invention, where the image processing method is applicable to an electronic device, and the image processing method includes the following steps S301 to S302:
s301, the electronic equipment calculates the average value of the power spectrum to obtain an average energy estimation value;
s302, the electronic equipment determines that the total noise value is equal to the N power of the average energy estimation value, wherein N is more than 0 and less than 1;
s303, the electronic equipment determines a first parameter according to the average energy estimation value and a first preset matching relation, wherein the first parameter in the first preset matching relation is reduced along with the increase of the average energy estimation value;
s304, the electronic equipment acquires the frequency of each pixel;
s305, the electronic equipment determines a second parameter according to the frequency of each pixel and a second preset matching relationship, wherein the second parameter in the second preset matching relationship is increased along with the increase of the frequency of each pixel;
s306, the electronic equipment generates a sub-noise value of each pixel according to the first parameter, the second parameter and the total noise value;
s307, the electronic equipment determines the power value of each pixel according to the power spectrum;
s308, the electronic equipment brings the sub-noise value of each pixel and the power value of each pixel into a preset formula to obtain a filtering strength value of each pixel, wherein the filtering strength value in the preset formula is reduced along with the increase of a first ratio, and the first ratio refers to the ratio of the sub-noise value of each pixel and the power value of each pixel;
s309, the electronic equipment generates a target function value of each pixel according to the filtering intensity value of each pixel and the original function value of each pixel;
and S310, the electronic equipment generates a second frequency domain image according to the objective function value of each pixel.
It can be seen that, in the embodiment of the present invention, first, the electronic device generates a sub-noise value of each pixel in the first frequency domain image according to the power spectrum of the first frequency domain image; secondly, determining the power value of each pixel according to the power spectrum; secondly, generating a filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel; and finally, generating a second frequency domain image according to the filtering intensity value of each pixel. Therefore, in the embodiment of the invention, the electronic device can generate the filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel, so that the electronic device can execute filtering with different intensities according to the specific situation of each pixel, and fine filtering for the image is realized; the method is beneficial to reducing the noise of the image while ensuring the details of the image, and further improving the overall quality of the image.
Based on the description of the above embodiment of the image processing method, the embodiment of the present invention also discloses an image processing apparatus, which may be a computer program (including a program code) running in an electronic device. The image processing apparatus may perform the method shown in fig. 2A. Referring to fig. 4, the image processing apparatus may operate the following units:
a processing unit 401, configured to generate a sub-noise value of each pixel in a first frequency domain image according to a power spectrum of the first frequency domain image; and for determining a power value for said each pixel from said power spectrum; and for generating a filtered intensity value for said each pixel based on said sub-noise value for said each pixel and said power value for said each pixel; and generating a second frequency domain image according to the filtering intensity value of each pixel.
The image processing apparatus may further include a communication unit 402, where the communication unit 402 may be a touch display screen or a transceiver; the communication unit 402 can acquire or transmit image data in the embodiment of the present invention.
It can be seen that, in the embodiment of the present invention, first, the electronic device generates a sub-noise value of each pixel in the first frequency domain image according to the power spectrum of the first frequency domain image; secondly, determining the power value of each pixel according to the power spectrum; secondly, generating a filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel; and finally, generating a second frequency domain image according to the filtering intensity value of each pixel. Therefore, in the embodiment of the invention, the electronic device can generate the filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel, so that the electronic device can execute filtering with different intensities according to the specific situation of each pixel, and fine filtering for the image is realized; the method is beneficial to reducing the noise of the image while ensuring the details of the image, and further improving the overall quality of the image.
In a possible implementation manner, the processing unit 401, when configured to generate the second frequency-domain image according to the filter intensity value of each pixel, is specifically configured to: generating an objective function value of each pixel according to the filtering intensity value of each pixel and the original function value of each pixel; and generating the second frequency domain image according to the objective function value of each pixel.
In a possible implementation manner, the processing unit 401, when being configured to generate a sub-noise value of each pixel in the first frequency-domain image according to the power spectrum of the first frequency-domain image, is specifically configured to: calculating the average value of the power spectrum to obtain an average energy estimation value; determining that the total noise value is equal to the power N of the average energy estimated value, wherein N is more than 0 and less than 1; determining a first parameter according to the average energy estimation value and a first preset matching relationship, wherein the first parameter in the first preset matching relationship is reduced along with the increase of the average energy estimation value; acquiring the frequency of each pixel; determining a second parameter according to the frequency of each pixel and a second preset matching relationship, wherein the second parameter in the second preset matching relationship is increased along with the increase of the frequency of each pixel; generating a sub-noise value for each pixel based on the first parameter, the second parameter and the total noise value.
In a possible implementation manner, the processing unit 401, when configured to generate the filtered intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel, is specifically configured to: and bringing the sub-noise value of each pixel and the power value of each pixel into a preset formula to obtain a filtering strength value of each pixel, wherein the filtering strength value in the preset formula is reduced along with the increase of a first ratio, and the first ratio refers to the ratio of the sub-noise value of each pixel and the power value of each pixel.
In one possible implementation, the processing unit 401, before being configured to generate the sub-noise value of each pixel in the first frequency domain image according to the power spectrum of the first frequency domain image, is further configured to: acquiring an original image, wherein the original image is a non-frequency domain image; performing Fourier transform on the original image to obtain an initial frequency domain image; performing frequency spectrum conversion processing on the initial frequency domain image to obtain a first frequency domain image; generating the power spectrum of the first frequency domain image.
In a possible implementation, the processing unit 401, after being configured to generate the second frequency-domain image according to the filtered intensity value of each pixel, is further configured to: performing inverse spectrum conversion processing on the second frequency domain image to obtain a third frequency domain image; and performing Fourier inverse transformation on the third frequency domain image to obtain a target image.
According to another embodiment of the present invention, the units in the image processing apparatus shown in fig. 4 may be respectively or entirely combined into one or several other units to form another unit, or some unit(s) may be further split into multiple functionally smaller units to form another unit, which may achieve the same operation without affecting the achievement of the technical effect of the embodiment of the present invention. The units are divided based on logic functions, and in practical application, the functions of one unit can be realized by a plurality of units, or the functions of a plurality of units can be realized by one unit. In other embodiments of the present invention, the image processing apparatus may also include other units, and in practical applications, these functions may also be implemented by being assisted by other units, and may be implemented by cooperation of a plurality of units.
According to another embodiment of the present invention, the image processing apparatus device as shown in fig. 4 may be constructed by running a computer program (including program codes) capable of executing the steps involved in the corresponding method as shown in fig. 2A or fig. 3 on a general-purpose computing device such as a computer including a processing element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and a storage element, and the image processing method of the embodiment of the present invention may be implemented. The computer program may be recorded on a computer-readable recording medium, for example, and loaded and executed in the above-described computing apparatus via the computer-readable recording medium.
Based on the description of the method embodiment and the device embodiment, the embodiment of the invention also provides electronic equipment. Referring to fig. 5, the electronic device includes at least a processor 501, an input device 502, an output device 503, and a computer storage medium 504. The processor 501, the input device 502, the output device 503, and the computer storage medium 504 within the electronic device may be connected by a bus or other means.
A computer storage medium 504 may be stored in the memory of the electronic device, the computer storage medium 504 being used for storing a computer program comprising program instructions, the processor 501 being used for executing the program instructions stored by the computer storage medium 504. The processor 501 (or called CPU) is a computing core and a control core of the electronic device, and is adapted to implement one or more instructions, specifically, to load and execute the one or more instructions so as to implement a corresponding method flow or a corresponding function; in one embodiment, the processor 501 according to the embodiment of the present invention may be configured to perform a series of image processing processes, including: generating a sub-noise value of each pixel in a first frequency domain image according to a power spectrum of the first frequency domain image; determining a power value of each pixel according to the power spectrum; generating a filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel; and generating a second frequency domain image according to the filtering intensity value of each pixel.
An embodiment of the present invention further provides a computer storage medium (Memory), which is a Memory device in an electronic device and is used for storing programs and data. It is understood that the computer storage medium herein may include both a built-in storage medium in the electronic device and, of course, an extended storage medium supported by the electronic device. Computer storage media provide storage space that stores an operating system for an electronic device. Also stored in this memory space are one or more instructions, which may be one or more computer programs (including program code), suitable for loading and execution by processor 501. The computer storage medium may be a high-speed RAM memory, or may be a non-volatile memory (non-volatile memory), such as at least one disk memory; and optionally at least one computer storage medium located remotely from the processor.
In one embodiment, one or more instructions stored in a computer storage medium may be loaded and executed by processor 501 to perform the corresponding steps described above with respect to the method in the image processing embodiments; in particular implementations, one or more instructions in the computer storage medium are loaded by processor 501 and perform the following steps:
generating a sub-noise value of each pixel in a first frequency domain image according to a power spectrum of the first frequency domain image;
determining a power value of each pixel according to the power spectrum;
generating a filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel;
and generating a second frequency domain image according to the filtering intensity value of each pixel.
In one possible implementation, when used to generate the second frequency-domain image according to the filtered intensity value of each pixel, the one or more instructions may be further loaded and specifically executed by the processor 501: generating an objective function value of each pixel according to the filtering intensity value of each pixel and the original function value of each pixel; and generating the second frequency domain image according to the objective function value of each pixel.
In one possible implementation, when used to generate a sub-noise value for each pixel in a first frequency-domain image from a power spectrum of the first frequency-domain image, the one or more instructions may be further loaded and specifically executed by the processor 501 to: calculating the average value of the power spectrum to obtain an average energy estimation value; determining that the total noise value is equal to the power N of the average energy estimated value, wherein N is more than 0 and less than 1; determining a first parameter according to the average energy estimation value and a first preset matching relationship, wherein the first parameter in the first preset matching relationship is reduced along with the increase of the average energy estimation value; acquiring the frequency of each pixel; determining a second parameter according to the frequency of each pixel and a second preset matching relationship, wherein the second parameter in the second preset matching relationship is increased along with the increase of the frequency of each pixel; generating a sub-noise value for each pixel based on the first parameter, the second parameter and the total noise value.
In one possible implementation, when used to generate the filtered intensity value for each pixel based on the sub-noise value for each pixel and the power value for each pixel, the one or more instructions may be further loaded and specifically executed by the processor 501 to: and bringing the sub-noise value of each pixel and the power value of each pixel into a preset formula to obtain a filtering strength value of each pixel, wherein the filtering strength value in the preset formula is reduced along with the increase of a first ratio, and the first ratio refers to the ratio of the sub-noise value of each pixel and the power value of each pixel.
In one possible implementation, the one or more instructions may be further loaded and specifically executed by the processor 501, before being configured to generate a sub-noise value for each pixel in the first frequency-domain image from the power spectrum of the first frequency-domain image: acquiring an original image, wherein the original image is a non-frequency domain image; performing Fourier transform on the original image to obtain an initial frequency domain image; performing frequency spectrum conversion processing on the initial frequency domain image to obtain a first frequency domain image; generating the power spectrum of the first frequency domain image.
In one possible implementation, after the instructions for generating the second frequency-domain image according to the filtered intensity value of each pixel, the one or more instructions may be further loaded and specifically executed by the processor 501: performing inverse spectrum conversion processing on the second frequency domain image to obtain a third frequency domain image; and performing Fourier inverse transformation on the third frequency domain image to obtain a target image.
It can be seen that, in the embodiment of the present invention, first, the electronic device generates a sub-noise value of each pixel in the first frequency domain image according to the power spectrum of the first frequency domain image; secondly, determining the power value of each pixel according to the power spectrum; secondly, generating a filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel; and finally, generating a second frequency domain image according to the filtering intensity value of each pixel. Therefore, in the embodiment of the invention, the electronic device can generate the filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel, so that the electronic device can execute filtering with different intensities according to the specific situation of each pixel, and fine filtering for an image is realized; the method is beneficial to reducing the noise of the image while ensuring the details of the image, and further improving the overall quality of the image.
While the invention has been described in connection with what is presently considered to be the most practical and preferred embodiment, it is to be understood that the invention is not to be limited to the disclosed embodiment, but on the contrary, is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims (8)
1. An image processing method, comprising:
calculating the average value of the power spectrum of the first frequency domain image to obtain an average energy estimation value;
determining that the total noise value is equal to the power N of the average energy estimated value, wherein N is more than 0 and less than 1;
determining a first parameter according to the average energy estimation value and a first preset matching relationship, wherein the first parameter in the first preset matching relationship is reduced along with the increase of the average energy estimation value;
acquiring the frequency of each pixel in the first frequency domain image;
determining a second parameter according to the frequency of each pixel and a second preset matching relationship, wherein the second parameter in the second preset matching relationship is increased along with the increase of the frequency of each pixel;
generating a sub-noise value for each pixel based on the first parameter, the second parameter and the total noise value;
determining a power value of each pixel according to the power spectrum;
generating a filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel;
and generating a second frequency domain image according to the filtering intensity value of each pixel.
2. The method of claim 1, wherein generating a second frequency domain image from the filtered intensity values for each pixel comprises:
generating an objective function value of each pixel according to the filtering intensity value of each pixel and the original function value of each pixel;
and generating the second frequency domain image according to the objective function value of each pixel.
3. The method of claim 1, wherein generating the filtered intensity value for each pixel based on the per-pixel sub-noise value and the per-pixel power value comprises:
and substituting the sub-noise value of each pixel and the power value of each pixel into a preset formula to obtain a filtering intensity value of each pixel, wherein the filtering intensity value in the preset formula is reduced along with the increase of a first ratio, and the first ratio refers to the ratio of the sub-noise value of each pixel and the power value of each pixel.
4. The method of claim 1, wherein before calculating the average of the power spectrum of the first frequency-domain image and obtaining the average energy estimate, the method further comprises:
acquiring an original image, wherein the original image is a non-frequency domain image;
performing Fourier transform on the original image to obtain an initial frequency domain image;
performing frequency spectrum conversion processing on the initial frequency domain image to obtain a first frequency domain image;
generating the power spectrum of the first frequency domain image.
5. The method according to any of claims 1-4, wherein after generating the second frequency domain image from the filtered intensity values for each pixel, the method further comprises:
performing inverse spectrum conversion processing on the second frequency domain image to obtain a third frequency domain image;
and performing inverse Fourier transform on the third frequency domain image to obtain a target image.
6. An image processing apparatus, characterized by comprising a processing unit configured to:
calculating the average value of the power spectrum of the first frequency domain image to obtain an average energy estimation value;
determining that the total noise value is equal to the power N of the average energy estimated value, wherein N is more than 0 and less than 1;
determining a first parameter according to the average energy estimation value and a first preset matching relationship, wherein the first parameter in the first preset matching relationship is reduced along with the increase of the average energy estimation value;
acquiring the frequency of each pixel in the first frequency domain image;
determining a second parameter according to the frequency of each pixel and a second preset matching relationship, wherein the second parameter in the second preset matching relationship is increased along with the increase of the frequency of each pixel;
generating a sub-noise value for each pixel based on the first parameter, the second parameter and the total noise value;
determining a power value of each pixel according to the power spectrum;
generating a filtering intensity value of each pixel according to the sub-noise value of each pixel and the power value of each pixel;
and generating a second frequency domain image according to the filtering intensity value of each pixel.
7. An electronic device comprising an input device and an output device, further comprising:
a processor adapted to implement one or more instructions; and (c) a second step of,
a computer storage medium having stored thereon one or more instructions adapted to be loaded by the processor and to execute the image processing method according to any of claims 1-5.
8. A computer storage medium having stored thereon one or more instructions adapted to be loaded by a processor and to perform the image processing method according to any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010289258.3A CN111415313B (en) | 2020-04-13 | 2020-04-13 | Image processing method, image processing device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010289258.3A CN111415313B (en) | 2020-04-13 | 2020-04-13 | Image processing method, image processing device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111415313A CN111415313A (en) | 2020-07-14 |
CN111415313B true CN111415313B (en) | 2022-08-30 |
Family
ID=71493585
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010289258.3A Active CN111415313B (en) | 2020-04-13 | 2020-04-13 | Image processing method, image processing device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111415313B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102045514A (en) * | 2009-10-13 | 2011-05-04 | 原相科技股份有限公司 | Image noise filtering method |
CN107945125A (en) * | 2017-11-17 | 2018-04-20 | 福州大学 | It is a kind of to merge spectrum estimation method and the fuzzy image processing method of convolutional neural networks |
CN108090885A (en) * | 2017-12-20 | 2018-05-29 | 百度在线网络技术(北京)有限公司 | For handling the method and apparatus of image |
CN110556125A (en) * | 2019-10-15 | 2019-12-10 | 出门问问信息科技有限公司 | Feature extraction method and device based on voice signal and computer storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9326008B2 (en) * | 2012-04-10 | 2016-04-26 | Google Inc. | Noise reduction for image sequences |
-
2020
- 2020-04-13 CN CN202010289258.3A patent/CN111415313B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102045514A (en) * | 2009-10-13 | 2011-05-04 | 原相科技股份有限公司 | Image noise filtering method |
CN107945125A (en) * | 2017-11-17 | 2018-04-20 | 福州大学 | It is a kind of to merge spectrum estimation method and the fuzzy image processing method of convolutional neural networks |
CN108090885A (en) * | 2017-12-20 | 2018-05-29 | 百度在线网络技术(北京)有限公司 | For handling the method and apparatus of image |
CN110556125A (en) * | 2019-10-15 | 2019-12-10 | 出门问问信息科技有限公司 | Feature extraction method and device based on voice signal and computer storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111415313A (en) | 2020-07-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8805120B2 (en) | Image processing apparatus and method which generates reference data according to learning images | |
US9224365B2 (en) | Method and apparatus for reducing interference and mobile terminal | |
US8165420B2 (en) | Noise reduction circuit and image processing device | |
US10853921B2 (en) | Method and apparatus for image sharpening using edge-preserving filters | |
CN110060213A (en) | Image processing method, image processing device, storage medium and electronic equipment | |
US20100164685A1 (en) | Method and apparatus for establishing device connections | |
US11037273B2 (en) | Noise processing apparatus and noise processing method | |
US20190362477A1 (en) | Apparatus and method for successive multi-frame image denoising | |
US20190014275A1 (en) | Imaging method and terminal | |
CN111369450A (en) | Method and device for removing Moire pattern | |
US8478058B2 (en) | Apparatus and method for reducing noise from an image | |
US12159377B2 (en) | Image processing method and apparatus, video processing method and apparatus, electronic device, and storage medium | |
KR102781953B1 (en) | Image system including image signal processing unit and operation method of image signal processing unit | |
US20190164263A1 (en) | Systems and methods for image processing | |
CN113781318A (en) | Image color mapping method and device, terminal equipment and storage medium | |
CN114170082A (en) | Video playing method, image processing method, model training method, device and electronic equipment | |
CN110717864A (en) | Image enhancement method and device, terminal equipment and computer readable medium | |
US8433149B2 (en) | Image transmitter and image receiver, for transmitting/receiving image data to/from a device connected by a signal data line | |
CN111415313B (en) | Image processing method, image processing device, electronic equipment and storage medium | |
CN113949819A (en) | Noise removal circuit, image sensing device and method of operation thereof | |
CN113658070B (en) | Image processing method, image processing device, storage medium and electronic device | |
CN111462008B (en) | Low-illumination image enhancement method, low-illumination image enhancement device and electronic equipment | |
CN111783962B (en) | Data processing method, data processing device, storage medium and electronic device | |
CN110910439B (en) | Image resolution estimation method and device and terminal | |
CN119723221B (en) | Skin cancer image classification model training method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |