Image processing method, device, equipment and readable storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-20
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]本申请实施例提供一种图像处理方法、装置、设备及可读存储介质,解决图像的去噪效果有限的问题
[0012] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the image processing method as described in the first aspect.
Smart Images

Figure CN122066593B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image processing technology, and specifically relates to an image processing method, apparatus, device and readable storage medium. Background Technology
[0002] In scenarios such as medical image sharing, security video collaboration, and digital media distribution, high-quality images are required for circulation. The presence of noise in an image is a key indicator of its quality. However, in related technologies, electronic devices cannot accurately determine the noise characteristics of an image, resulting in limited noise reduction effects. Summary of the Invention
[0003] This application provides an image processing method, apparatus, device, and readable storage medium to solve the problem of limited image denoising effect.
[0004] Firstly, an image processing method is provided, including: Get the first image; Determine the frequency domain features corresponding to the first image; The first image and the frequency domain features are fused to obtain the second image; Based on the second image and the first image, noise features in the first image are determined; The noise in the second image is removed based on the noise features to obtain the third image.
[0005] Optionally, the method further includes: Divide the first image into at least two first sub-images; Determine the local signal-to-noise ratio corresponding to each of the at least two first sub-images; The wavelet basis function corresponding to each first sub-image is determined based on the local signal-to-noise ratio. Determining the frequency domain features corresponding to the first image includes: The frequency domain features corresponding to each first sub-image are obtained by decomposing each first sub-image using the wavelet basis function.
[0006] Optionally, the step of decomposing each of the first sub-images using the wavelet basis function to obtain the frequency domain features corresponding to the first image includes: Determine the wavelet basis decomposition layer number corresponding to each of the first sub-images; The frequency domain features corresponding to each first sub-image are obtained by decomposing each first sub-image using the wavelet basis function. Based on the frequency domain features corresponding to each of the first sub-images, the frequency band variance is determined; The frequency domain features corresponding to the first image are determined based on the frequency band variance and the preset variance threshold.
[0007] Optionally, the method further includes: If the local signal-to-noise ratio corresponding to the first target sub-image is greater than a preset threshold, the first target sub-image is a high-frequency noise image, and the wavelet basis function corresponding to the first target sub-image is determined to be the Haar wavelet basis function; the at least two first sub-images include the first target sub-image. If the local signal-to-noise ratio corresponding to the first sub-image of the target is less than or equal to the preset threshold, the first sub-image of the target is a low-frequency noise image, and the wavelet basis function corresponding to the first sub-image of the target is determined to be the Daubechies wavelet basis function.
[0008] Optionally, fusing the first image and the frequency domain features to obtain the second image includes: Acquire a fourth image, which is a noise-free first image; Initialize the first weight corresponding to the first image and the second weight corresponding to the frequency domain feature; The estimated second image is obtained by maximizing the posterior probability calculation on the initialized first weight, the initialized second weight, the first image, and the frequency domain features. Maximum likelihood estimation is performed on the estimated second and fourth images to obtain the iterative first and second weights. The second image is obtained by weighting the first image, the frequency domain features, and the iterated first and second weights.
[0009] Optionally, removing noise from the second image based on the noise features to obtain the third image includes: The noise features and the second image are input into a diffusion model, and at least two denoised images are obtained based on the diffusion model; wherein the at least two denoised images are ordered sequentially according to the timestamps of their generation, and the noise of the denoised image generated at the previous timestamp is greater than the noise of the denoised image generated at the next timestamp; If the noise in the newly generated denoised image is less than a preset noise threshold, the newly generated denoised image is used as the third image.
[0010] Secondly, embodiments of this application provide an image processing apparatus, including: The acquisition module is used to acquire the first image; The first determining module is used to determine the frequency domain features corresponding to the first image; The fusion module is used to fuse the first image and the frequency domain features to obtain a second image; The second determining module is used to determine noise features in the first image based on the second image and the first image; The noise removal module is used to remove noise from the second image based on the noise features to obtain a third image.
[0011] Thirdly, embodiments of this application provide an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, it implements the steps of the image processing method as described in the first aspect.
[0012] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the image processing method as described in the first aspect.
[0013] Fifthly, embodiments of this application provide a computer program product including computer instructions that, when executed by a processor, implement the steps of the image processing method as described in the first aspect.
[0014] In this embodiment, the electronic device acquires a first image and then determines the frequency domain features corresponding to the first image. The electronic device then fuses the first image and the frequency domain features to obtain a second image. Based on the second image and the first image, the electronic device determines the noise features in the first image. The electronic device then removes the noise from the second image based on the noise features to obtain a third image. In this process, the electronic device can first determine the frequency domain features corresponding to the first image and accurately obtain the corresponding second image based on the first image and the frequency domain features. This allows the first image to be denoised to have higher detail sharpness in the edge regions, reducing detail loss and better determining the noise features of the first image, thereby achieving accurate denoising of the first image and improving the denoising effect. Attached Figure Description
[0015] Figure 1 This is a flowchart of an image processing method provided in an embodiment of this application; Figure 2 This is a schematic diagram of wavelet basis decomposition provided in an embodiment of this application; Figure 3 This is a schematic diagram of a diffusion module provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an image processing device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0016] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0017] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and are not used to describe a specified order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, not limited in number; for example, a first object can be one or more. Furthermore, in the specification and claims, "and" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0018] It is worth noting that the technologies described in this application are not limited to Long Term Evolution (LTE) / LTE-Advanced (LTE-A) systems, but can also be used in other wireless communication systems, such as Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Frequency Division Multiple Access (FDMA), Orthogonal Frequency Division Multiple Access (OFDMA), Single-carrier Frequency-Division Multiple Access (SC-FDMA), and other systems. The terms "system" and "network" in this application are often used interchangeably, and the described technologies can be used with the systems and radio technologies mentioned above, as well as with other systems and radio technologies. However, the following description describes New Radio (NR) systems for illustrative purposes, and NR terminology is used in most of the following description. These technologies can also be applied to applications beyond NR systems, such as 6th generation (6G) radio systems. th Generation 6G communication system.
[0019] The following is through Figure 1The image processing method of this application is described in detail below, and the specific implementation process is as follows:
[0020] Step 101: Obtain the first image.
[0021] In some embodiments, the first image may be a grayscale image or a red-green-blue image.
[0022] After acquiring the first image, the electronic device can preprocess the first image to obtain the preprocessed first image I. pre For example, electronic devices can convert the first image into an image of a preset size, and can also adjust the brightness of the first image to a preset brightness to balance the image brightness and thus enhance the contrast.
[0023] For example, an electronic device can use bilinear interpolation to scale the matrix size of a noisy image to a normalized size W×H (let's say 256×256 pixels), as shown in the formula: .
[0024] in, It is the interpolation kernel function, s x and s y This is the scaling factor, a preset value; I is the first image. The image is after normalization, and x and y are the normalized values. pixel coordinates in Let be the pixel value of the first image I at coordinates (i, j), where i and j represent the coordinate positions.
[0025] For example, an electronic device can use a grayscale histogram to adjust the brightness of the first image, using the following formula: .
[0026] Where, n k Where k is the number of pixels at gray level k, and N is the total number of pixels. Let T[⋅] be the new gray value of the image at coordinates (x, y) after equalization, and let T[⋅] be the transformation function used to define how the old gray value is mapped to the new gray value. Let be the pixel value of the first image I at coordinates (i, j).
[0027] Step 102: Determine the frequency domain features corresponding to the first image.
[0028] In some embodiments, the method further includes: Divide the first image into at least two first sub-images; Determine the local signal-to-noise ratio corresponding to each of the at least two first sub-images; The wavelet basis function corresponding to each first sub-image is determined based on the local signal-to-noise ratio. Determining the frequency domain features corresponding to the first image includes: The frequency domain features corresponding to each first sub-image are obtained by decomposing each first sub-image using the wavelet basis function.
[0029] In this embodiment, to more accurately distinguish between signal and noise in the first image and obtain more accurate frequency domain features, a sliding window (e.g., an 8×8 pixel sliding window) is set in the first image. The electronic device divides the first image through the sliding window to obtain at least two first sub-images. The electronic device then calculates the local signal-to-noise ratio (LSNR) of each first sub-image.
[0030] The formula for calculating the local signal-to-noise ratio can be: .in, This represents the signal strength corresponding to the first sub-image (which can be calculated after low-pass filtering). It is the noise variance (calculated from the residual between the original image and the filtered image).
[0031] In order to dynamically extract the frequency domain features of the first image to adapt to the noise distribution of the first sub-images corresponding to different regions in the first image, the electronic device can adaptively select different wavelet basis functions for different first sub-images, decompose the first sub-images through the corresponding wavelet basis functions, generate a weighted feature map based on all the decomposed first sub-images, and determine the frequency domain features corresponding to the first image through the weighted feature map.
[0032] like Figure 2 As shown, electronic devices can transform functions in the time domain to the frequency domain. That is, the features of an image in the time domain are decomposed into features in the frequency domain using wavelet basis functions. Furthermore, with each level of wavelet basis function decomposition, a noisy first image that varies over time can be transformed into separable noise peaks and image peak components in the frequency domain. The formula for wavelet basis function decomposition is: .
[0033] in, Here, represents the wavelet basis functions, 'a' is the scaling parameter (controlling frequency), and 'b' is the translation parameter (controlling position). Both 'a' and 'b' are preset values. These are the wavelet transform coefficients, representing the degree of similarity between the original signal (or image row signal) and the wavelet basis at scale parameter a and translation parameter b. Let be the sequence of gray values corresponding to the image, or a function in the time domain.
[0034] Understandably, in this embodiment, the electronic device dynamically selects the most suitable wavelet basis function through local signal-to-noise ratio, enabling it to accurately preserve high-value details such as edges and textures while denoising. This also ensures the information fidelity of the first image during preprocessing, providing higher-quality information elements for subsequent circulation and application, directly enhancing the usability and value of information assets.
[0035] The selection process of wavelet basis functions will be explained in detail below.
[0036] In some embodiments, if the local signal-to-noise ratio corresponding to the target first sub-image is greater than a preset threshold, and the target first sub-image is an image with high-frequency noise, the wavelet basis function corresponding to the target first sub-image is determined to be the Haar wavelet basis function; the at least two first sub-images include the target first sub-image; If the local signal-to-noise ratio corresponding to the first sub-image of the target is less than or equal to the preset threshold, the first sub-image of the target is a low-frequency noise image, and the wavelet basis function corresponding to the first sub-image of the target is determined to be the Daubechies wavelet basis function.
[0037] In this embodiment, the electronic device can set a preset threshold. If the local signal-to-noise ratio corresponding to the first sub-image of the target is greater than the preset threshold, it indicates that the first sub-image of the target is an image region dominated by high-frequency noise (for example, the first sub-image of the target has salt-and-pepper noise). The electronic device can select the Haar wavelet basis function as the wavelet basis function corresponding to the first sub-image of the target. The wavelet basis function can make the decomposed image have the characteristics of short time-frequency bandwidth product and strong edge preservation.
[0038] If the local signal-to-noise ratio corresponding to the first sub-image of the target is less than or equal to a preset threshold, it indicates that the first sub-image of the target is an image region dominated by low-frequency noise (for example, the first sub-image of the target contains Gaussian white noise). The electronic device can select the Daubechies wavelet basis function as the wavelet basis function corresponding to the first sub-image of the target. This wavelet basis function can make the decomposed image have the characteristics of strong time-frequency energy focusing and good smoothness.
[0039] In some embodiments, electronic devices can be implemented using the following formula: Determine the preset threshold .in, Indicates the basic threshold. GSNR represents the local signal-to-noise ratio within the sliding window, while GSNR represents the global signal-to-noise ratio. This is the learning rate parameter, which is a preset value. For example, It can be 15dB.
[0040] The process of determining the frequency domain characteristics of electronic devices will be explained in detail below.
[0041] In some embodiments, the step of decomposing each of the first sub-images using the wavelet basis function to obtain the frequency domain features corresponding to the first image includes: Determine the wavelet basis decomposition layer number corresponding to each of the first sub-images; The frequency domain features corresponding to each first sub-image are obtained by decomposing each first sub-image using the wavelet basis function. Based on the frequency domain features corresponding to each of the first sub-images, the frequency band variance is determined; The frequency domain features corresponding to the first image are determined based on the frequency band variance and the preset variance threshold.
[0042] In this embodiment, the electronic device can be implemented using the formula: The optimal wavelet basis decomposition layer number corresponding to each first sub-image is determined. The signal-to-noise ratio (SNR) after wavelet decomposition at level l is represented. This represents the local signal-to-noise ratio before processing. The number of decomposition layers can range from 1 to 10. To determine the optimal number of wavelet basis decomposition layers, To iterate through all possible layers, select the layer with the greatest improvement in signal-to-noise ratio.
[0043] For example, assuming the decomposition layer is 4 layers, the electronic device can obtain the low-frequency approximation component LL and high-frequency detail component (e.g., horizontal high-frequency detail component LH, vertical high-frequency detail component HL, and diagonal high-frequency detail component HH) corresponding to the first sub-image through wavelet basis functions.
[0044] After determining the wavelet basis decomposition level corresponding to each first sub-image, the electronic device decomposes each first sub-image using the corresponding wavelet basis function to obtain the frequency domain features of each first sub-image. These frequency domain features can then generate a weighted feature map. The electronic device then determines the frequency band variance using the weighted feature map, and further refines the calculation based on the frequency band variance. and preset variance threshold Determine the frequency domain features corresponding to the first image.
[0045] Frequency domain features can be characterized as frequency domain weight parameters. Its calculation formula can be: ,in, Here, is the smoothing parameter, is a preset value, and k is the frequency band or sub-band index corresponding to the frequency domain. This refers to the frequency band variance, specifically the statistical variance of the wavelet coefficients within the k-th sub-band. This is the preset variance threshold.
[0046] In this embodiment, the electronic device can highlight noise-sensitive regions in the first image by determining the frequency domain features corresponding to the first image.
[0047] Step 103: Fuse the first image and the frequency domain features to obtain the second image.
[0048] In some embodiments, fusing the first image and the frequency domain features to obtain a second image includes: Acquire a fourth image, which is a noise-free first image; Initialize the first weight corresponding to the first image and the second weight corresponding to the frequency domain feature; The estimated second image is obtained by maximizing the posterior probability calculation on the initialized first weight, the initialized second weight, the first image, and the frequency domain features. Maximum likelihood estimation is performed on the estimated second and fourth images to obtain the iterative first and second weights. The second image is obtained by weighting the first image, the frequency domain features, and the iterated first and second weights.
[0049] In this embodiment, the fourth image is a preset, noise-free first image. After initializing the first and second weights, the electronic device can calculate the posterior probability using the formula: The estimated second image F1 is obtained, where F1 can be characterized by the first image, frequency domain features, and initialized first and second weights; W is the set corresponding to the frequency domain features; and F is the variable of the sharp image (i.e., the fourth image) to be estimated. Let F be the posterior probability, representing the probability that the clear image is F given the first image and frequency domain features. The first image; It is the likelihood function, modeled as a Gaussian distribution, which measures the probability of observing noise if the true image is F; Let F be the prior probability, and let F be the hypothetical probability of a clear image F.
[0050] The formula for a sharp image F is: .in, As the first weight, As the second weight, It is a frequency domain feature.
[0051] Where, the likelihood function Modeled as a Gaussian distribution, prior probability A sparse prior method (Laplace distribution) is used to preserve edge features by applying sparse priors to the fused features.
[0052] The electronic device determines the first and second weights after iteration through maximum likelihood estimation. The formula can be: .in, The fourth image, This is the regularization coefficient, a preset value, to prevent overfitting of the first and second weights. The first weight after iteration The second weight after iteration. The set corresponding to frequency domain features. The representation seeks the weight combination that minimizes the entire loss function (error term + penalty term). The square of the L2 norm is used to calculate the mean square error of the pixel difference between the predicted fused image and the clean image.
[0053] After determining the iteration directions of the first and second weights, the electronic device can update the first and second weights using gradient descent. The update formula is as follows: The loss function, Loss, is determined based on the sum of the mean squared error between the estimated second and fourth images and the weight regularization term. As a preset value, The first weight before the update. As the updated first weight, The second weight before the update. For the updated second weight, The partial derivative of the loss function with respect to the first weight. The partial derivative of the loss function with respect to the second weight is used to characterize the loss function.
[0054] Understandably, in the above embodiments, the electronic device introduces dynamic wavelet basis function selection and feature weighting, and accurately obtains the corresponding second image by maximizing the posterior probability and maximum likelihood estimation. By comparing the second image with the first image, the first image to be denoised has higher detail sharpness in the edge region, reducing detail loss and better determining the noise features of the first image.
[0055] Step 104: Based on the second image and the first image, determine the noise features in the first image.
[0056] Understandably, in the embodiments of this application, the electronic device can dynamically extract noise features based on the second image and the first image, reducing the number of subsequent diffusion model iterations (e.g., from 1000 steps to 200 steps) and improving real-time performance; at the same time, it achieves higher denoising accuracy in mixed noise scenarios.
[0057] Step 105: Remove noise from the second image based on the noise features to obtain the third image.
[0058] In some embodiments, removing noise from the second image based on the noise features to obtain a third image includes: The noise features and the second image are input into a diffusion model, and at least two denoised images are obtained based on the diffusion model; wherein the at least two denoised images are ordered sequentially according to the timestamps of their generation, and the noise of the denoised image generated at the previous timestamp is greater than the noise of the denoised image generated at the next timestamp; If the noise in the newly generated denoised image is less than a preset noise threshold, the newly generated denoised image is used as the third image.
[0059] In this embodiment, the electronic device can use a Markov chain-based Denoising Diffusion Probabilistic Models (DDPM) model (or diffusion model), which progressively diffuses the second image through noise features to obtain a clean, denoised image. In other embodiments, the diffusion module can also be obtained based on score-based generative models or using non-wavelet time-frequency methods (such as short-time Fourier transform), without limitation.
[0060] The theoretical denoising formula for the DDPM model can be: .in This represents a Gaussian diffusion process. Indicates noise characteristics, This represents the noise scheduling parameter, which is a preset value. q(*) represents the probability distribution of the noise forward diffusion process. This represents the image state at time step t. This represents the image state at time step t−1.
[0061] like Figure 3 As shown, the electronic device then obtains at least two denoised images through the stepwise diffusion of the DDPM model. In the DDPM model denoising process, the denoised images are ordered sequentially according to their generation timestamps. The noise of the denoised image generated at the previous timestamp is greater than that of the denoised image generated at the next timestamp. This process can be understood as the reverse process.
[0062] Its formula can be: .in, This represents the mean value corresponding to the DDPM model. The variance of the DDPM model is given by a preset value, where the variance and mean are the values of the preset values. For the third image, This is the fifth image in the denoising process; The sixth image is used in the denoising process. The noise in the fifth image is greater than that in the sixth image. If the noise in the sixth image is less than a preset noise threshold, the sixth image is used as the third image. Let be time, representing that as time increases, the noise in the denoised image generated at a later time stamp is less than the noise in the denoised image generated at an earlier time stamp. This represents the learnable parameters of the DDPM model. The noise features are those in the first image.
[0063] Understandably, in this embodiment, the electronic device achieves image denoising through a diffusion model, which can reduce the number of denoising iterations, directly reduce the amount of computation per processing, significantly compress data redundancy, and reduce the consumption of computing resources.
[0064] In some embodiments, electronic devices can also train the diffusion model using a loss function, making model training more efficient and targeted, achieving equal or even better results with less computational resources. The formula for the loss function, Loss, can be: .in, and These are the actual noise and the noise predicted by the diffusion model, respectively. For mathematical expectation, The noise features in the first image, The image is shown during the denoising process. The diffusion model can also use the U-Net architecture.
[0065] In some embodiments, adversarial examples, i.e., adversarial images, can be added during the training of the diffusion model to prevent the diffusion model from misidentifying high-noise images as low-noise images or vice versa. Without adversarial training, the diffusion model is easily attacked and outputs incorrect denoising results, leading to misjudgments in critical applications (such as medical diagnosis). The formula for the adversarial examples can be represented as: .in, Indicates the magnitude of the disturbance. Represents the loss function. For adversarial examples, For the first image, This is a sign function, and its output value is (+1, -1, 0). The loss function is given by the input image. The gradient. During training, if the model misidentifies a clean image as a noisy image or vice versa, it will receive a numerical penalty from the loss function, thereby enhancing generalization. Furthermore, introducing adversarial training can improve the model's robustness, enabling it to handle more complex noise types and reducing the need for repetitive processing due to data quality issues.
[0066] For example, electronic devices can add adversarial noise (such as simulated moiré patterns or high-frequency perturbations) to a clean image and generate adversarial examples to train a diffusion model to resist such perturbations.
[0067] In some embodiments, the diffusion model may only address local noise issues in an image. However, when there is noise in a large area of the image, the electronic device may not achieve satisfactory denoising results using the diffusion model. Therefore, the electronic device can employ nonlocal mean filtering to remove residual noise from the image.
[0068] The formula is: .in, This represents the pixel value at coordinates (x, y) in the final denoised image, where x and y are pixel coordinates. Given the pixel values of the input image at (i, j), Let (x, y) be the search window, centered at (x, y), where (i, j) are any pixel coordinates within the search window. This is a weighting function used to measure the similarity between pixel (i,j) and target pixel (x,y). The normalization factor is the sum of all weights.
[0069] in, , Here, h is the normalization factor, and h is the filter parameter, which is a preset value. It is a vector of pixel values for an image patch centered at (x,y). It is a vector of pixel values for an image patch centered at (i,j).
[0070] After obtaining the final denoised image, electronic devices can set a first flag on the denoised image to indicate that denoising is complete, in order to facilitate automated processing in subsequent business processes (such as image archiving or quality control). For example, the first flag can be in the form of metadata, represented as the string "denoised".
[0071] In some embodiments, electronic devices can also generate metadata based on denoising performance. For example, structured metadata such as "denoising level: A" or "residual noise level: 0.05" can be written into the image. This metadata allows the electronic device to quickly determine the denoising effect of the image, eliminating the need for re-denoising and thus improving processing efficiency. For instance, in a medical imaging system, metadata such as "detail retention: high" can be added to denoised X-ray images. Subsequent electronic devices can directly read this metadata, prioritizing the processing of this high-quality image and reducing the time doctors spend reviewing the images.
[0072] In some embodiments, after obtaining the denoised image, the electronic device can perform inverse gradient calculus based on the image output by the diffusion model to find the noise region that most affects the denoising effect in the original noisy image, and output a visual heatmap of that region. For example, the electronic device can use gradient-based activation mapping technology to calculate the gradient of the diffusion model and determine the noise distribution heatmap based on the output image. For example, for a low-light surveillance image, gradient inverse calculus can generate a heatmap based on image regions showing dark areas and high-frequency noise points in the image, highlight these regions on the original image based on the heatmap, and generate a noise analysis report for subsequent optimization reference.
[0073] As can be seen from the above embodiments, this application introduces an integrated data augmentation system architecture, which can accurately determine frequency domain features and perform end-to-end joint training, ensuring global optimization through a multi-task loss function. Furthermore, this application can be flexibly deployed to achieve stable and adaptive transformation from low-quality raw images to high-value usable images, providing a key technological foundation for standardized image preprocessing services.
[0074] The embodiments of this application significantly compress data redundancy and reduce computing resource consumption through efficient denoising technology. This adapts to real-time data processing scenarios on cloud platforms and edge devices such as smartphone cameras, reducing hardware investment and computing power consumption across the entire data acquisition-transmission-storage chain for enterprises. It provides low-cost technical support for the lightweight circulation of data elements. Furthermore, in core scenarios such as medical imaging (CT / MRI denoising), security monitoring (low-light enhancement), and the media industry (film restoration), this application can achieve accurate data denoising and quality improvement, allowing high-value data elements to be directly used for algorithm training, business decision-making, and product service upgrades. This significantly optimizes user experience and helps enterprises seize market opportunities in fields such as artificial intelligence healthcare and intelligent security by leveraging high-quality data assets, thereby strengthening their data-driven product competitiveness.
[0075] Please refer to Figure 4 , Figure 4 This is a schematic diagram of an image processing apparatus 400 according to an embodiment of this application. The image processing apparatus 400 includes: Acquisition module 401 is used to acquire the first image; The first determining module 402 is used to determine the frequency domain features corresponding to the first image; The fusion module 403 is used to fuse the first image and the frequency domain features to obtain a second image; The second determining module 404 is used to determine noise features in the first image based on the second image and the first image; The noise removal module 405 is used to remove noise from the second image based on the noise features to obtain a third image.
[0076] Optionally, the image processing device 400 may also include: A segmentation module is used to divide the first image into at least two first sub-images; The third determining module is used to determine the local signal-to-noise ratio corresponding to each of the at least two first sub-images; The fourth determining module is used to determine the wavelet basis function corresponding to each of the first sub-images based on the local signal-to-noise ratio; The first determining module 402 may also include: The decomposition unit is used to decompose each of the first sub-images using the wavelet basis function to obtain the frequency domain features corresponding to the first image.
[0077] Optionally, the decomposition unit may also include: The first determining subunit is used to determine the wavelet basis decomposition layer number corresponding to each of the first sub-images; The first decomposition subunit is used to decompose each of the first sub-images using the wavelet basis function to obtain the frequency domain features corresponding to each of the first sub-images; The second determining subunit is used to determine the frequency band variance based on the frequency domain features corresponding to each of the first sub-images; The third determining subunit is used to determine the frequency domain features corresponding to the first image based on the frequency band variance and the preset variance threshold.
[0078] Optionally, the image processing device 400 may also include: The fifth determining module is used to determine that the wavelet basis function corresponding to the first sub-image of the target is a Haar wavelet basis function when the local signal-to-noise ratio corresponding to the first sub-image of the target is greater than a preset threshold and the first sub-image of the target is a high-frequency noise image; the at least two first sub-images include the first sub-image of the target. The sixth determining module is used to determine that the wavelet basis function corresponding to the first sub-image of the target is a Daubechies wavelet basis function when the local signal-to-noise ratio corresponding to the first sub-image of the target is less than or equal to the preset threshold and the first sub-image of the target is a low-frequency noise image.
[0079] Optionally, the fusion module 403 may also include: An acquisition unit is used to acquire a fourth image, wherein the fourth image is a noise-free first image; An initialization unit is used to initialize the first weight corresponding to the first image and the second weight corresponding to the frequency domain feature; The first calculation unit is used to calculate the maximum posterior probability of the initialized first weight, the initialized second weight, the first image and the frequency domain features to obtain the estimated second image. The second calculation unit is used to perform maximum likelihood estimation calculation on the estimated second image and the fourth image to obtain the iterated first weight and second weight; The third calculation unit is used to perform weighted calculations on the first image, the frequency domain features, and the iterated first and second weights to obtain the second image.
[0080] Optionally, the removal module 405 may also include: An input unit is used to input the noise features and the second image into a diffusion model, and obtain at least two denoised images based on the diffusion model; wherein the at least two denoised images are ordered sequentially according to the timestamps of their generation, and the noise of the denoised image generated at the previous timestamp is greater than the noise of the denoised image generated at the next timestamp; The determining unit is configured to use the newly generated denoised image as the third image if the noise of the newly generated denoised image is less than a preset noise threshold.
[0081] The image processing apparatus 400 provided in this application embodiment can perform the above-described... Figure 1 The method embodiments shown are similar in principle and technical effect, and will not be described again here.
[0082] This application also provides an electronic device. Since the principle by which this electronic device solves the problem is similar to the image processing method in the embodiments of this application, the implementation of this electronic device can be found elsewhere. Figure 1 The implementation of the method shown will not be repeated here. Figure 5 As shown, the electronic device of this application embodiment includes: a processor 510, configured to read a program from a memory 520 and execute the following processes: Get the first image; Determine the frequency domain features corresponding to the first image; The first image and the frequency domain features are fused to obtain the second image; Based on the second image and the first image, noise features in the first image are determined; The noise in the second image is removed based on the noise features to obtain the third image.
[0083] Optionally, the processor 510 is also used to read the program from the memory 520 and perform the following steps: Divide the first image into at least two first sub-images; Determine the local signal-to-noise ratio corresponding to each of the at least two first sub-images; The wavelet basis function corresponding to each first sub-image is determined based on the local signal-to-noise ratio. Determining the frequency domain features corresponding to the first image includes: The frequency domain features corresponding to each first sub-image are obtained by decomposing each first sub-image using the wavelet basis function.
[0084] Optionally, the processor 510 is also used to read the program from the memory 520 and perform the following steps: The step of decomposing each of the first sub-images using the wavelet basis function to obtain the frequency domain features corresponding to the first image includes: Determine the wavelet basis decomposition layer number corresponding to each of the first sub-images; The frequency domain features corresponding to each first sub-image are obtained by decomposing each first sub-image using the wavelet basis function. Based on the frequency domain features corresponding to each of the first sub-images, the frequency band variance is determined; The frequency domain features corresponding to the first image are determined based on the frequency band variance and the preset variance threshold.
[0085] Optionally, the processor 510 is also used to read the program from the memory 520 and perform the following steps: If the local signal-to-noise ratio corresponding to the first target sub-image is greater than a preset threshold, the first target sub-image is a high-frequency noise image, and the wavelet basis function corresponding to the first target sub-image is determined to be the Haar wavelet basis function; the at least two first sub-images include the first target sub-image. If the local signal-to-noise ratio corresponding to the first sub-image of the target is less than or equal to the preset threshold, the first sub-image of the target is a low-frequency noise image, and the wavelet basis function corresponding to the first sub-image of the target is determined to be the Daubechies wavelet basis function.
[0086] Optionally, the processor 510 is also used to read the program from the memory 520 and perform the following steps: The step of fusing the first image and the frequency domain features to obtain the second image includes: Acquire a fourth image, which is a noise-free first image; Initialize the first weight corresponding to the first image and the second weight corresponding to the frequency domain feature; The estimated second image is obtained by maximizing the posterior probability calculation on the initialized first weight, the initialized second weight, the first image, and the frequency domain features. Maximum likelihood estimation is performed on the estimated second and fourth images to obtain the iterative first and second weights. The second image is obtained by weighting the first image, the frequency domain features, and the iterated first and second weights.
[0087] Optionally, the processor 510 is also used to read the program from the memory 520 and perform the following steps: The step of removing noise from the second image based on the noise features to obtain the third image includes: The noise features and the second image are input into a diffusion model, and at least two denoised images are obtained based on the diffusion model; wherein the at least two denoised images are ordered sequentially according to the timestamps of their generation, and the noise of the denoised image generated at the previous timestamp is greater than the noise of the denoised image generated at the next timestamp; If the noise in the newly generated denoised image is less than a preset noise threshold, the newly generated denoised image is used as the third image.
[0088] Among them, Figure 5 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 510 and memory represented by memory 520 together. The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides the interface.
[0089] The electronic device provided in this application embodiment can perform the above-described functions. Figure 1 The method embodiments shown are similar in principle and technical effect, and will not be described again here.
[0090] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the above-described image processing method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0091] This application also provides a computer program product, including computer instructions. When executed by a processor, these computer instructions implement the various processes of the above-described image processing method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.
[0092] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0093] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0094] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. An image processing method, characterized in that, include: Get the first image; Determine the frequency domain features corresponding to the first image; The first image and the frequency domain features are fused to obtain the second image; Based on the second image and the first image, noise features in the first image are determined; Based on the noise features, noise is removed from the second image to obtain the third image; The method further includes: Divide the first image into at least two first sub-images; Determine the local signal-to-noise ratio corresponding to each of the at least two first sub-images; The wavelet basis function corresponding to each first sub-image is determined based on the local signal-to-noise ratio. Determining the frequency domain features corresponding to the first image includes: The frequency domain features corresponding to the first image are obtained by decomposing each of the first sub-images using the wavelet basis functions. The step of decomposing each of the first sub-images using the wavelet basis function to obtain the frequency domain features corresponding to the first image includes: Determine the wavelet basis decomposition layer number corresponding to each of the first sub-images; The frequency domain features corresponding to each first sub-image are obtained by decomposing each first sub-image using the wavelet basis function. Based on the frequency domain features corresponding to each of the first sub-images, the frequency band variance is determined; The frequency domain features corresponding to the first image are determined based on the frequency band variance and the preset variance threshold.
2. The method according to claim 1, characterized in that, The method further includes: If the local signal-to-noise ratio corresponding to the first target sub-image is greater than a preset threshold, the first target sub-image is a high-frequency noise image, and the wavelet basis function corresponding to the first target sub-image is determined to be the Haar wavelet basis function; the at least two first sub-images include the first target sub-image. If the local signal-to-noise ratio corresponding to the first sub-image of the target is less than or equal to the preset threshold, the first sub-image of the target is a low-frequency noise image, and the wavelet basis function corresponding to the first sub-image of the target is determined to be the Daubechies wavelet basis function.
3. The method according to claim 1, characterized in that, The step of fusing the first image and the frequency domain features to obtain the second image includes: Acquire a fourth image, which is a noise-free first image; Initialize the first weight corresponding to the first image and the second weight corresponding to the frequency domain feature; The estimated second image is obtained by maximizing the posterior probability calculation on the initialized first weight, the initialized second weight, the first image, and the frequency domain features. The estimated second and fourth images are subjected to maximum likelihood estimation to obtain the iterative first and second weights. The second image is obtained by weighting the first image, the frequency domain features, and the iterated first and second weights.
4. The method according to claim 1, characterized in that, The step of removing noise from the second image based on the noise features to obtain the third image includes: The noise features and the second image are input into a diffusion model, and at least two denoised images are obtained based on the diffusion model; wherein the at least two denoised images are ordered sequentially according to the timestamps of their generation, and the noise of the denoised image generated at the previous timestamp is greater than the noise of the denoised image generated at the next timestamp; If the noise in the newly generated denoised image is less than a preset noise threshold, the newly generated denoised image is used as the third image.
5. An image processing apparatus, characterized in that, include: The acquisition module is used to acquire the first image; The first determining module is used to determine the frequency domain features corresponding to the first image; The fusion module is used to fuse the first image and the frequency domain features to obtain a second image; The second determining module is used to determine noise features in the first image based on the second image and the first image; The noise removal module is used to remove noise from the second image based on the noise features to obtain a third image; The image processing apparatus includes: A segmentation module is used to divide the first image into at least two first sub-images; The third determining module is used to determine the local signal-to-noise ratio corresponding to each of the at least two first sub-images; The fourth determining module is used to determine the wavelet basis function corresponding to each of the first sub-images based on the local signal-to-noise ratio; The first determination module includes: The decomposition unit is used to decompose each of the first sub-images using the wavelet basis function to obtain the frequency domain features corresponding to the first image; The decomposition unit includes: The first determining subunit is used to determine the wavelet basis decomposition layer number corresponding to each of the first sub-images; The first decomposition subunit is used to decompose each of the first sub-images using the wavelet basis function to obtain the frequency domain features corresponding to each of the first sub-images; The second determining subunit is used to determine the frequency band variance based on the frequency domain features corresponding to each of the first sub-images; The third determining subunit is used to determine the frequency domain features corresponding to the first image based on the frequency band variance and the preset variance threshold.
6. An electronic device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the image processing method as described in any one of claims 1 to 4.
7. A computer-readable storage medium for storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the image processing method as described in any one of claims 1 to 4.
8. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps in the image processing method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
A wavelet denoising method based on a self-adaptive non-local mean value
CN109685730A
Ferrographic abrasive particle image denoising method, device and equipment and readable storage medium
CN115358947A