Image denoising method, device and storage medium based on block matching

By constructing images clustering and Gaussian mixed models, calculating the probability value and distribution position of the tile, dividing similar tile sets and performing fusion processing, the problems of low block matching accuracy and high computing power consumption in the prior art are solved, and a more efficient image noise reduction effect is achieved.

CN119313587BActive Publication Date: 2025-03-28ZHEJIANG DAHUA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411866625.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-03-28
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

The existing image noise reduction method has low accuracy in block matching in a noisy environment, and in order to reduce computing power consumption, block matching is usually performed in the local image field, resulting in insufficient utilization of redundant information in the whole image and limited noise reduction capability.

Method used

By clustering the sample tiles, a Gaussian mixed model is constructed, the probability value of the tiles to be reduced belongs to each sample cluster cluster, the matching cluster cluster that meets the preset conditions is selected, the distribution position of the tiles to be reduced in the vector space, the adjacent tiles to be reduced are divided into the same similar tiles set, and the fusion process is performed to obtain the noise-reduced image.

Benefits of technology

The accuracy of block matching is improved, and the redundant information of the entire image can be fully utilized without increasing the demand for computing resources, and the ability to reduce image noise is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119313587B_ABST
    Figure CN119313587B_ABST
Patent Text Reader

Abstract

The present application discloses a block matching-based image denoising method, device and storage medium, which includes: based on the block vector corresponding to each block to be denoised and the Gaussian mixture model corresponding to each sample clustering cluster, the probability value of each block to be denoised belonging to each sample clustering cluster is calculated, and the matching clustering cluster corresponding to the block to be denoised is selected according to the probability value, and the distribution position of each block to be denoised in the vector space of the corresponding matching clustering cluster is determined respectively, and the blocks to be denoised with adjacent distribution positions are divided into the same similar block set, and all the blocks to be denoised contained in the similar block set are fused to obtain the denoised image. The Gaussian mixture model can be used to match similar blocks to be denoised, so as to replace the direct comparison between blocks, and the accuracy of block matching can be improved without increasing the demand for computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image denoising method, device and storage medium based on block matching. Background Art

[0002] Images are widely used in a wide range of fields, and the quality of images directly affects the effectiveness of their application in various fields. However, images are inevitably interfered by noise during the process of acquisition, processing, and transmission. Therefore, filtering out noise in images is extremely important.

[0003] In the existing image denoising methods, block matching can be used to achieve image denoising. It mainly finds similar blocks through the block matching method, and performs weighted fusion of blocks through the weights of these similar blocks, thereby achieving image denoising. However, when there is noise in the image, the accuracy of block matching is not high. In addition, in order to reduce the computing power consumption of image denoising, block matching is generally performed in a local image area, resulting in the inability to make good use of the redundant information of the entire image and limited denoising capabilities. If block matching is performed on the entire image, it will result in excessive computing power resources required. Summary of the invention

[0004] In order to solve the above technical problems, the present application at least provides an image denoising method, device and storage medium based on block matching.

[0005] In a first aspect, the present application provides an image denoising method based on block matching, the method comprising: clustering sample blocks, and constructing a Gaussian mixture model for each sample clustering cluster obtained by clustering; wherein the sample blocks are obtained by performing block extraction on a low-noise sample image, and the noise content of the low-noise sample image is lower than a threshold; extracting a plurality of blocks to be denoised from the image to be denoised, and calculating the probability value of each block to be denoised belonging to each sample clustering cluster based on a block vector corresponding to each block to be denoised and a Gaussian mixture model corresponding to each sample clustering cluster; selecting a sample clustering cluster whose probability value meets a preset condition, obtaining a matching clustering cluster corresponding to the block to be denoised, and determining the distribution position of each block to be denoised in the vector space of the corresponding matching clustering cluster; dividing the blocks to be denoised that are adjacent to each other in distribution positions into the same similar block set, and fusing all the blocks to be denoised contained in the similar block set to obtain a denoised block corresponding to each block to be denoised in the similar block set; and fusing all the denoised blocks to obtain a denoised image corresponding to the image to be denoised.

[0006] In one embodiment, the sample tiles are clustered, and a Gaussian mixture model is constructed for each sample cluster cluster obtained by clustering, including: taking a preset number of sample cluster clusters as clustering targets, and using an expectation-maximization algorithm to iteratively solve the model parameters of the Gaussian mixture models of all sample tiles to obtain the Gaussian mixture model corresponding to each sample cluster cluster; or, using a clustering algorithm to cluster all sample tiles to obtain a preset number of sample cluster clusters, and based on the sample tiles contained in each sample cluster cluster, respectively calculating the model parameters of the Gaussian mixture model corresponding to each sample cluster cluster, to obtain the Gaussian mixture model corresponding to each sample cluster cluster; or, using a clustering algorithm to cluster all sample tiles to obtain a preset number of sample cluster clusters, and based on the sample tiles contained in each sample cluster cluster, respectively calculating the model parameters of the Gaussian mixture model corresponding to each sample cluster cluster, to obtain initial model parameters; and using an expectation-maximization algorithm to iteratively optimize the initial model parameters to obtain the Gaussian mixture model corresponding to each sample cluster cluster.

[0007] In one embodiment, the distribution position of each image block to be denoised in the vector space of the corresponding matching cluster cluster is determined respectively, including: calculating the vector distance between the cluster center of the matching cluster cluster or the sample image contained therein and the vectors corresponding to the image block to be denoised; based on the vector distance, obtaining the distribution position of the image block to be denoised in the vector space of the corresponding matching cluster cluster.

[0008] In one embodiment, the vector distance between the cluster center of the matching cluster cluster and the vectors corresponding to the image block to be denoised is calculated; based on the vector distance, the distribution position of the image block to be denoised in the vector space of the corresponding matching cluster cluster is obtained, including: dividing a plurality of grids in the vector space of the matching cluster cluster with the cluster center as the center point; determining the grid to which the image block to be denoised belongs based on the vector distance between the image block to be denoised and the cluster center; taking the grid to which the image block to be denoised belongs as the distribution position of the image block to be denoised in the vector space of the matching cluster cluster; and dividing the image blocks to be denoised that are adjacent to each other in distribution positions into the same set of similar image blocks, including: taking all the image blocks to be denoised in the same grid as adjacent image blocks to be denoised, and dividing them into the same set of similar image blocks.

[0009] In one embodiment, all the to-be-denoised image blocks contained in the similar image block set are fused to obtain the denoised image blocks corresponding to each to-be-denoised image block in the similar image block set, including: using any of the following denoising calculation strategies to calculate the denoised image blocks corresponding to each to-be-denoised image block: Strategy 1: combining the image block vectors corresponding to all the to-be-denoised image blocks contained in the similar image block set to obtain the image block vector matrix, and obtaining the eigenvector matrix of the covariance matrix corresponding to the matching clustering clusters associated with the similar image block set; based on the image block vector matrix and the eigenvector matrix, solving to obtain the denoised image blocks corresponding to each to-be-denoised image block ; Strategy 2: Combine the tile vectors corresponding to all the denoised tiles contained in the similar tile set to obtain a tile vector matrix, and perform singular value decomposition on the tile vector matrix; subtract the decomposed singular values ​​from the preset threshold, and reintegrate the subtracted singular values ​​to obtain the denoised tiles corresponding to each denoised tile; Strategy 3: Use the tile denoising result calculated by strategy 1 as the first denoised tile, and use the tile denoising result calculated by strategy 2 as the second denoised tile, and perform weighted fusion on the first denoised tile and the second denoised tile to obtain the denoised tiles corresponding to each denoised tile.

[0010] In one embodiment, all the to-be-denoised blocks contained in the similar block set are fused to obtain a denoised block corresponding to each to-be-denoised block in the similar block set, including: counting the number of blocks to be denoised contained in the similar block set; if the number of blocks is within a first threshold range, using strategy one to calculate the denoised block corresponding to each to-be-denoised block in the similar block set; if the number of blocks is within a second threshold range, using strategy three to calculate the denoised block corresponding to each to-be-denoised block in the similar block set; if the number of blocks is within a third threshold range, using strategy two to calculate the denoised block corresponding to each to-be-denoised block in the similar block set; wherein the value in the first threshold range is less than the value in the second threshold range, and the value in the second threshold range is less than the value in the third threshold range.

[0011] In one embodiment, there are multiple matching clustering clusters corresponding to the denoised image block, each matching clustering cluster corresponds to a similar image block set, and each similar image block set calculates a denoised image block; after fusing all the denoised image blocks contained in the similar image block set to obtain the denoised image block corresponding to each denoised image block in the similar image block set, the method also includes: obtaining the denoised image block calculated by each similar image block set of the denoised image block; and calculating the vector distance between the vectors corresponding to the denoised image block and the cluster center of each matching clustering cluster; based on the vector distance corresponding to each matching clustering cluster, respectively setting the weight of the denoised image block corresponding to each associated similar image block set, the weight being inversely correlated with the vector distance; performing weighted fusion on each denoised image block according to the weight of each denoised image block, and using the weighted fusion result as the final denoised image block.

[0012] In one embodiment, there is regional overlap between multiple denoised image blocks extracted from the image to be denoised; the denoised image corresponding to the image to be denoised is obtained by combining all the denoised image blocks, including: for any pixel to be denoised in the image to be denoised, obtaining the denoised image blocks corresponding to all the denoised image blocks containing the pixel to be denoised; performing weighted fusion on the denoised pixels corresponding to the pixel to be denoised in all the denoised image blocks obtained to obtain the target denoised pixels corresponding to the pixel to be denoised; and obtaining the denoised image corresponding to the image to be denoised by combining the target denoised pixels corresponding to all the pixels to be denoised.

[0013] The second aspect of the present application provides an image denoising device based on block matching, the device comprising: a model building module, used to cluster sample blocks, and build a Gaussian mixture model for each sample cluster cluster obtained by clustering; wherein the sample block is obtained by performing block extraction on a low-noise sample image, and the noise content of the low-noise sample image is lower than a threshold; a clustering probability calculation module, used to extract a plurality of blocks to be denoised from the image to be denoised, and based on the block vector corresponding to each block to be denoised and the Gaussian mixture model corresponding to each sample cluster cluster, calculate the probability that each block to be denoised belongs to each sample cluster cluster respectively Probability value; a position mapping module, used to select the sample clustering cluster whose probability value meets the preset conditions, obtain the matching clustering cluster corresponding to the image block to be denoised, and determine the distribution position of each image block to be denoised in the vector space of the corresponding matching clustering cluster; a block denoising module, used to divide the image blocks to be denoised that are adjacent to each other in distribution position into the same similar image block set, and fuse all the image blocks to be denoised contained in the similar image block set to obtain the denoised image block corresponding to each image block to be denoised in the similar image block set; a block fusion module, used to fuse all denoised image blocks to obtain the denoised image corresponding to the image to be denoised.

[0014] A third aspect of the present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned image denoising method based on block matching.

[0015] A fourth aspect of the present application provides a computer-readable storage medium on which program instructions are stored. When the program instructions are executed by a processor, the above-mentioned image denoising method based on block matching is implemented.

[0016] The above scheme clusters the sample blocks and constructs a Gaussian mixture model for each sample cluster cluster obtained by clustering; extracts multiple blocks to be denoised from the image to be denoised, and calculates the probability value of each block to be denoised belonging to each sample cluster cluster based on the block vector corresponding to each block to be denoised and the Gaussian mixture model corresponding to each sample cluster cluster; selects the sample cluster cluster whose probability value meets the preset conditions to obtain the matching cluster cluster corresponding to the block to be denoised, and determines the vector space of each block to be denoised in the corresponding matching cluster cluster. The method comprises the following steps: dividing the denoised blocks with adjacent distribution positions into the same similar block set, fusing all the denoised blocks in the similar block set to obtain the denoised blocks corresponding to each denoised block in the similar block set; fusing all the denoised blocks to obtain the denoised image corresponding to the denoised image, and matching similar denoised blocks by using a Gaussian mixture model to replace the direct comparison between blocks, thereby improving the accuracy of block matching without increasing the demand for computing resources.

[0017] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0019] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;

[0020] Figure 2 is a flowchart of an image denoising method based on block matching shown in an exemplary embodiment of the present application;

[0021] Figure 3 is a schematic diagram of block extraction shown in an exemplary embodiment of the present application;

[0022] Figure 4 is a schematic diagram of vector space grid division shown in an exemplary embodiment of the present application;

[0023] Figure 5 is a schematic diagram showing a change in a grid position according to an exemplary embodiment of the present application;

[0024] Figure 6 is a block diagram of an image denoising device based on block matching shown in an exemplary embodiment of the present application;

[0025] Figure 7 is a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present application;

[0026] Figure 8 It is a schematic diagram of the structure of a computer-readable storage medium shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0027] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0028] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0029] The term "and / or" in this article is only an association information describing the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previous and next associated objects are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.

[0030] The following is a description of the image denoising method based on block matching provided in an embodiment of the present application.

[0031] Please refer to Figure 1 , which shows a schematic diagram of a solution implementation environment provided by an embodiment of the present application. The solution implementation environment may include a terminal 110 and a server 120, and the terminal 110 and the server 120 are connected to each other in communication.

[0032] The number of the terminal 110 may be one or more. The terminal 110 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto.

[0033] Server 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.

[0034] In one example, the server 120 may perform image denoising processing on the image to be denoised obtained from the terminal 110 to obtain a denoised image. Of course, the server 120 may store the denoised image locally, transmit it back to the terminal 110, or transmit it to other terminals.

[0035] In one example, a client running a target application is installed in the terminal 110, and the target application may be an application that provides an image noise reduction function. The terminal 110 uses the target application to perform image noise reduction processing on the image to be noise reduced to obtain a noise reduced image. The server 120 may be a background server of the target application, and is used to provide background services for the client of the target application.

[0036] In the block matching-based image denoising method provided in the embodiment of the present application, the execution subject of each step can be the terminal 110, such as the client of the target application installed and running in the terminal 110, or the server 120, or the terminal 110 and the server 120 can interact and cooperate to execute, that is, part of the steps of the method are executed by the terminal 110 and the other steps are executed by the server 120.

[0037] See also Figure 2 , Figure 2 is a flowchart of an image denoising method based on block matching shown in an exemplary embodiment of the present application. The image denoising method based on block matching can be applied to Figure 1 It should be understood that the method can also be applied to other exemplary implementation environments and be specifically executed by devices in other implementation environments, and this embodiment does not limit the implementation environment to which the method is applicable.

[0038] like Figure 2 As shown, the image denoising method based on block matching includes at least steps S210 to S250, which are described in detail as follows:

[0039] Step S210: clustering the sample blocks, and constructing a Gaussian mixture model for each sample cluster obtained by clustering; wherein the sample blocks are obtained by performing block extraction on low-noise sample images, and the noise content of the low-noise sample images is lower than a threshold.

[0040] A low-noise sample image is obtained, where the noise content of the low-noise sample image is lower than a threshold, and blocks are extracted from each low-noise sample image to obtain a plurality of sample blocks.

[0041] For example, 50,000 low-noise sample images are collected, and blocks of the low-noise sample images are extracted according to the size of w×h to obtain multiple sample blocks. Among them, w and h represent the number of pixels, which can be preset based on experience or set according to the accuracy of the image denoising task. For example, the larger w and h are, the larger the number of clusters corresponding to the clustering needs to be set, and the more time and samples are required to build the Gaussian mixture model, but the better the denoising effect; the smaller w and h are, the smaller the number of clusters corresponding to the clustering can be set, and the less time and sample are required to build the Gaussian mixture model, but the denoising effect becomes worse.

[0042] The Gaussian Mixture Model (GMM) is constructed with sample patches as units. The Gaussian Mixture Model is a statistical model that assumes that all data points (i.e., sample patches) come from the weighted sum of multiple Gaussian distributions, each of which (also called normal distribution) is defined by its Gaussian mean (i.e., cluster center) and covariance matrix. The core of GMM is that it can capture the complex structure in the data, allowing data points to belong to multiple clusters with different probabilities.

[0043] The formula of the Gaussian mixture model can be expressed as the following formula 1 and formula 2:

[0044] (Formula 1)

[0045] (Formula 2)

[0046] Wherein, x is the tile vector corresponding to the sample tile. For example, if the sample tile is a 9-pixel×9-pixel tile, it is expanded to obtain a 1×81 tile vector. ,satisfy ; K is the number of clusters, which is used to limit the number of sample clusters. If K is set to 512, 512 sample clusters will be obtained in the end; represents the Gaussian mean u and covariance matrix ; d is the Gaussian dimension; Represents the weight of the kth distribution (sample cluster), which represents the proportion of the kth distribution in the overall data.

[0047] Step S220: extract multiple denoised blocks from the denoised image, and calculate the probability value of each denoised block belonging to each sample cluster based on the block vector corresponding to each denoised block and the Gaussian mixture model corresponding to each sample cluster.

[0048] The image to be denoised is subjected to block extraction to obtain a plurality of blocks to be denoised.

[0049] For example, see Figure 3 , Figure 3 A schematic diagram of block extraction is shown as an exemplary embodiment of the present application. Figure 3 As shown, Figure 3 Each small square in represents 1 pixel. Taking a 9-pixel × 9-pixel sliding window, where the sliding window moves 2 pixels in the column or row direction each time, M denoised blocks are extracted in sequence from the image to be denoised by sliding the window. The image vector corresponding to each denoised block is expressed as ,

[0050] Of course, in practical applications, sliding windows of other sizes and window moving distances of other sizes may also be selected, and this application does not limit this.

[0051] It can be understood that when the window moving distance is smaller than the size of the sliding window moving direction, there are overlapping parts between each block to be denoised, and multiple denoising can be performed on one pixel, thereby improving the denoising effect.

[0052] For another example, the image to be denoised may be directly segmented into blocks according to a preset block size, and the segmented blocks may be used as the blocks to be denoised.

[0053] For example, different block extraction strategies can be used for different types of image areas in the denoised blocks, such as identifying key image areas and non-key image areas in the denoised blocks, where the key image areas are foreground areas and the non-key image areas are background areas, and using a sliding window method to extract the denoised blocks contained in the key image areas, and setting the existence of overlapping areas between the blocks to be denoised during the extraction process to improve the denoising effect of the key image areas; and extracting the denoised blocks contained in the non-key image areas by directly dividing the blocks according to a preset block size, where there is no overlapping area between the blocks to be denoised, or the overlapping area between the blocks to be denoised in the non-key image areas is smaller than the overlapping area between the blocks to be denoised in the key image areas, thereby reducing the computing power resources required for denoising the entire image.

[0054] The image block vector corresponding to each image block to be denoised is substituted into the Gaussian mixture model corresponding to each sample cluster to obtain the probability value of each image block to be denoised belonging to each sample cluster.

[0055] Specifically, after solving the above formula 1 and formula 2, the probability value of the image block to be denoised belonging to each sample cluster can be calculated according to the image block vector corresponding to the image block to be denoised and the above formula 1 and formula 2.

[0056] Exemplarily, according to the above formula 1 and formula 2, the probability calculation formula constructed is expressed as the following formula 3:

[0057] (Formula 3)

[0058] Among them, the tile vector corresponding to each tile to be denoised is expressed as , is the mth image block to be denoised; Represents the probability that the mth image block to be denoised belongs to the kth sample cluster. For the symbolic interpretation of other formula parameters, please refer to the above formula 1 and formula 2.

[0059] By using Formula 3, the probability value of each image block to be denoised belonging to each sample cluster is calculated.

[0060] For example, the first block to be denoised is calculated The probability value of belonging to each sample cluster is K, that is, value.

[0061] Of course, in addition to using the above formula 3 to calculate the probability value of the image block to be denoised belonging to each sample cluster cluster, other methods can also be used to calculate the probability value of the image block to be denoised belonging to each sample cluster cluster, such as using a clustering algorithm to use the image block to be denoised as the data to be clustered to calculate the probability value of it belonging to each sample cluster cluster. This application does not limit this.

[0062] Step S230: Selecting a sample cluster whose probability value meets a preset condition, obtaining a matching cluster corresponding to the image block to be denoised, and determining the distribution position of each image block to be denoised in the vector space of the corresponding matching cluster.

[0063] After obtaining the probability value that each image block to be denoised belongs to each sample cluster, for each image block to be denoised, a sample cluster whose probability value meets a preset condition is selected to obtain a matching cluster corresponding to the image block to be denoised.

[0064] For example, if the probability value of the image block to be denoised belongs to the sample clustering cluster meets one or more of the following conditions, the sample clustering cluster will be used as the matching clustering cluster corresponding to the image block to be denoised: Condition 1: Sort the sample clustering clusters in descending order according to the probability value, select the top Q sample clustering clusters in the sorting result, and use these sample clustering clusters as the matching clustering clusters corresponding to the image block to be denoised; Condition 2: Determine whether the probability value is greater than the preset probability threshold. If the probability value is greater than the preset probability threshold, use the sample clustering cluster as the matching clustering cluster corresponding to the image block to be denoised.

[0065] Then, the distribution position of each image block to be denoised in the vector space of the corresponding matching cluster is determined respectively.

[0066] The vector of each sample block in the sample cluster is used as a data point to form the vector space of the sample cluster. The greater the similarity between the sample blocks, the closer their positions in the vector space are; the smaller the similarity between the sample blocks, the farther their positions in the vector space are.

[0067] Similarly, the image block to be denoised is mapped to the vector space of the matching cluster of the image block to be denoised, and its distribution position in the vector space of the matching cluster is obtained.

[0068] Step S240: grouping the adjacent image blocks to be denoised into the same similar image block set, and fusing all the image blocks to be denoised in the similar image block set to obtain a denoised image block corresponding to each image block to be denoised in the similar image block set.

[0069] After all the denoised image blocks are mapped to the vector space of their corresponding matching clusters, the denoised image blocks with adjacent distribution positions can be determined according to the distribution positions of the denoised image blocks, so as to classify these denoised image blocks with adjacent distribution positions into the same similar image block set.

[0070] For example, the distances between the distribution positions of the denoised image blocks in the vector space of the same matching cluster may be calculated, and the denoised image blocks whose distances are less than a preset distance threshold may be regarded as the denoised image blocks whose distribution positions are adjacent to each other.

[0071] For another example, the vector space of the matching clusters may be partitioned, and the image blocks to be denoised whose distribution positions fall into the same partition are used as the image blocks to be denoised whose distribution positions are adjacent to each other.

[0072] It should be noted that the specific method for determining whether the distribution positions of the denoised blocks in the vector space of the matching clusters are adjacent to each other can be flexibly selected according to the actual situation, and this application does not limit this.

[0073] Then, all the image blocks to be denoised in the similar image block set are fused to obtain a denoised image block corresponding to each image block to be denoised in the similar image block set.

[0074] The conventional technology can be used to directly perform weighted fusion on each block to be denoised, and all the blocks to be denoised contained in the similar block set can be fused. The fusion method as specifically exemplified in the subsequent embodiments can also be used to fuse all the blocks to be denoised contained in the similar block set. This application does not limit this.

[0075] Step S250: All denoised image blocks are merged to obtain a denoised image corresponding to the image to be denoised.

[0076] All the obtained denoised image blocks are re-joined to obtain a denoised image corresponding to the image to be denoised.

[0077] The present application obtains a Gaussian mixture model by performing cluster analysis on sample blocks in advance, and then subsequently uses the Gaussian mixture model to match similar blocks to be denoised, thereby replacing direct comparison between blocks, thereby improving the accuracy of block matching without increasing the demand for computing resources.

[0078] Next, some embodiments of the present application are described in detail.

[0079] In some embodiments, a Gaussian mixture model may be constructed using any of the following Gaussian mixture model construction methods:

[0080] Method 1: Taking a preset number of sample clusters as the clustering target, the expectation maximization algorithm is used to iteratively solve the model parameters of the Gaussian mixture model of all sample blocks to obtain the Gaussian mixture model corresponding to each sample cluster.

[0081] The Expectation Maximization algorithm (EM) is an iterative method for finding the maximum likelihood or maximum a posteriori estimates of the parameters in a statistical model where the model depends on unobserved latent variables.

[0082] Specifically, the expectation maximization algorithm is used to solve the model parameters of the Gaussian mixture model, which is mainly divided into the expectation step E and the maximization step M. The expectation step E is calculated to obtain , expressed as the following formula 4:

[0083] (Formula 4)

[0084] Among them, the tile vectors corresponding to all sample tiles are expressed as , is the nth sample block, and N is the total number of sample blocks; Represents the probability that the nth sample block belongs to the kth sample cluster. For the symbolic interpretation of other formula parameters, please refer to the above formula 1 and formula 2.

[0085] Maximize step M and calculate the Gaussian mean and covariance matrix of each cluster as shown in the following formula 5 and formula 6:

[0086] (Formula 5)

[0087] (Formula 6)

[0088] in, The calculation formula is as follows: Formula 7:

[0089] (Formula 7)

[0090] N is the total number of sample tiles.

[0091] At the beginning of the iterative solution, each model parameter is initialized to a known parameter. Can be set to a splicing value, such as K is 512, then is 1 / 512; and, for the Gaussian mean u, 512 sample blocks are randomly selected, and the corresponding Gaussian means are calculated for the 512 randomly selected sample blocks respectively, and the calculation results are used as the initial Gaussian mean of each cluster; and the covariance matrix , the identity matrix can be used as the initial covariance matrix for each cluster.

[0092] The expectation maximization algorithm is iterated continuously until Converge, thereby constructing a Gaussian mixture model as shown in Formula 1 and Formula 2.

[0093] Method 2: Use a clustering algorithm to cluster all sample blocks to obtain a preset number of sample clusters. Based on the sample blocks contained in each sample cluster, calculate the model parameters of the Gaussian mixture model corresponding to each sample cluster, and obtain the Gaussian mixture model corresponding to each sample cluster.

[0094] The clustering algorithm includes but is not limited to a mean shift clustering algorithm, a K-means clustering algorithm, etc. The applicable clustering algorithm may be flexibly selected according to the actual application scenario, and this application does not limit this.

[0095] A clustering algorithm is used to pre-cluster all sample blocks to obtain a preset number of sample clusters. Then, the model parameters of the Gaussian mixture model are calculated for each sample cluster to obtain the Gaussian mixture model corresponding to each sample cluster.

[0096] For example, if the number of clusters K=512, 512 sample clusters are obtained after clustering all sample blocks. For each sample cluster, the Gaussian mean u and covariance matrix are calculated separately. ; Then, the ratio of the number of sample blocks in each sample cluster to the total number of sample blocks is calculated to obtain Of course, it can also be calculated by formula 4 and formula 7 .

[0097] Obtained by calculation , a Gaussian mixture model as shown in Formula 1 and Formula 2 is constructed.

[0098] Method three: Use a clustering algorithm to cluster all sample blocks to obtain a preset number of sample clusters. Based on the sample blocks contained in each sample cluster, calculate the model parameters of the Gaussian mixture model corresponding to each sample cluster to obtain the initial model parameters; use the expectation maximization algorithm to iteratively optimize the initial model parameters to obtain the Gaussian mixture model corresponding to each sample cluster.

[0099] The second method will be used to calculate As the initial model parameters, then use method one to iterate the initial model parameters and optimize , until Converge, thereby constructing a Gaussian mixture model as shown in Formula 1 and Formula 2.

[0100] Method three combines method one and method two, and improves the convergence speed of model parameters while ensuring the accuracy of the constructed Gaussian mixture model.

[0101] In some implementations, determining the distribution position of each image block to be denoised in the vector space of the corresponding matching cluster in step S230 includes:

[0102] Step S231: Calculate the vector distance between the cluster center of the matching cluster or the vectors corresponding to the sample image contained therein and the image block to be denoised.

[0103] Step S232: based on the vector distance, obtaining the distribution position of the image block to be denoised in the vector space of the corresponding matching cluster.

[0104] The distribution position of the image block to be denoised in the vector space of the corresponding matching clustering cluster can be determined based on the vector distance between the cluster center vector of the matching clustering cluster and the image block to be denoised vector; the distribution position of the image block to be denoised in the vector space of the corresponding matching clustering cluster can also be determined based on the vector distance between the sample image vector contained in the matching clustering cluster and the image block to be denoised vector; or, the distribution position of the image block to be denoised in the vector space of the corresponding matching clustering cluster can be comprehensively determined by combining the vector distance between the cluster center vector of the matching clustering cluster and the image block to be denoised vector and the vector distance between the sample image vector contained in the matching clustering cluster and the image block to be denoised vector.

[0105] Since the positions of the cluster centers of the matching clusters and the sample images they contain in the vector space of the matching clusters are known, the distribution positions of the image blocks to be denoised in the vector space of the corresponding matching clusters can be derived by calculating the vector distance between the image blocks to be denoised and the known positions.

[0106] In some implementations, taking the calculation of the vector distance between the cluster center of the matching cluster and the vectors corresponding to the image block to be denoised as an example; in step S232, based on the vector distance, obtaining the distribution position of the image block to be denoised in the vector space of the corresponding matching cluster, includes:

[0107] Step S2311: Taking the cluster center as the center point, divide the vector space of the matching cluster cluster into multiple grids.

[0108] Step S2312: Determine the grid to which the image block to be denoised belongs based on the vector distance between the image block to be denoised and the cluster center.

[0109] Step S2313: taking the grid to which the image block to be denoised belongs as the distribution position of the image block to be denoised in the vector space of the matching cluster.

[0110] The position coordinates of the image block to be denoised in the vector space are represented by dividing the grid, which facilitates the subsequent division of similar image blocks.

[0111] For an example, see Figure 4 , Figure 4 A schematic diagram of vector space grid division is shown in an exemplary embodiment of the present application, as shown in FIG. Figure 4 As shown, for the kth sample cluster, its Gaussian mean (i.e. cluster center) as the partition center point C, take 2 dimensions as an example, take s×s as the vector space size, where s refers to the number of grids contained in rows and columns, take s=5 as an example, the vector space corresponding to the kth sample cluster is represented as a 5×5 grid, based on the block vector and The vector distance between them is used to map the block B to be denoised to the corresponding grid.

[0112] It should be noted that Figure 4 This is only an exemplary explanation. In actual application scenarios, the tile vector corresponding to the tile to be denoised contains more dimensions. In this case, more dimensions need to be considered when performing grid division. For example, when the tile vector corresponding to the tile to be denoised is 81 dimensions, the grid dimension also needs to be 81 dimensions. In addition, the vector space can select other sizes, that is, s can take other values, and the size of the grid can also be flexibly set. This application does not limit this.

[0113] In addition, when the coordinate axis direction of the grid reference changes, the grid position of the denoised block mapping will also change, such as Figure 5 This is a schematic diagram showing changes in the grid position shown in an exemplary embodiment of the present application. However, after testing experimental data, it was found that the noise reduction effect is not much different when referring to different coordinate axis directions when dividing the grid.

[0114] Based on the above embodiment, in step S240, the adjacent blocks to be denoised are divided into the same similar block set, including: all the blocks to be denoised in the same grid are regarded as adjacent blocks to be denoised, and divided into the same similar block set.

[0115] Of course, if the vector space is not grid-partitioned, the vector distance between each denoised image block in the same vector space can also be calculated to divide the denoised image blocks whose vector distance is less than or equal to the preset distance threshold into the same similar image block set. This application does not limit the specific division method of similar image blocks.

[0116] In some implementations, any of the following denoising calculation strategies is used to calculate the denoised image block corresponding to each image block to be denoised:

[0117] Strategy 1: Combine the tile vectors corresponding to all the denoised tiles contained in the similar tile set to obtain the tile vector matrix, and obtain the eigenvector matrix of the covariance matrix corresponding to the matching clustering clusters associated with the similar tile set; based on the tile vector matrix and the eigenvector matrix, calculate the denoised tile corresponding to each denoised tile.

[0118] The eigenvector matrix of the covariance matrix refers to the matrix composed of all eigenvectors contained in the covariance matrix.

[0119] Exemplarily, the denoised image block is calculated using the following formula 8:

[0120] (Formula 8)

[0121] Where D is the covariance matrix corresponding to the matching clusters associated with the similar tile set The eigenvector matrix of ; Y is the tile vector matrix obtained by combining similar tile sets; R is the dimension of the tile vector, is a 1×R-dimensional vector to be solved. For example, the dimension of the tile vector corresponding to the 9pixel×9pixel denoising tile is 81. is a 1×81 dimensional vector to be solved; the value of weight w and the covariance matrix The eigenvalues ​​of are positively correlated to increase the contribution of the eigenvectors with large eigenvalues ​​to noise reduction.

[0122] With the goal of minimizing the value of j, the solution is , then, As the denoised tile.

[0123] Of course, in addition to using Formula 8 to solve the denoised image block, other methods can also be used to solve the denoised image block, such as using the following Formula 9 to calculate the denoised image block:

[0124] (Formula 9)

[0125] Among them, deY is the denoised block, and the weight w is the R in formula 8 The sum.

[0126] This application does not limit the specific formula used for solving the problem.

[0127] Strategy 2: Combine the tile vectors corresponding to all the denoised tiles in the similar tile set to obtain a tile vector matrix, and perform singular value decomposition on the tile vector matrix; subtract the decomposed singular values ​​from the preset threshold, and reintegrate the subtracted singular values ​​to obtain the denoised tile corresponding to each denoised tile.

[0128] Combine the tile vectors corresponding to all the tiles to be denoised in the similar tile set to obtain the tile vector matrix Y, and perform singular value decomposition on Y to obtain:

[0129] (Formula 10)

[0130] Among them, U is the left singular value matrix, V is the right singular value matrix, and S is the singular value obtained by decomposition.

[0131] The decomposed singular value is subtracted from the preset threshold to achieve the limiting of the singular value. For details, see the following formula 11:

[0132] (Formula 11)

[0133] Among them, deS is the singular value after subtraction, and thr is the preset threshold.

[0134] Thr can be set in advance based on experience, or it can be set flexibly according to actual conditions. For example, if the image quality of the image to be denoised is detected, if the image quality score is lower, the thr is larger to enhance the denoising effect; if the image quality score is higher, the thr is smaller to retain more original image information.

[0135] Then, the subtracted singular values ​​are re-fused to obtain the denoised image block corresponding to each image block to be denoised. For details, see the following formula 12:

[0136] (Formula 12)

[0137] Among them, deY is the denoised block.

[0138] Strategy three: The denoising result of the block calculated by strategy one is used as the first denoised block, and the denoising result of the block calculated by strategy two is used as the second denoised block. The first denoised block and the second denoised block are weightedly fused to obtain the denoised block corresponding to each block to be denoised.

[0139] That is, the block denoising result calculated by strategy one and the block denoising result calculated by strategy two are integrated to improve the image denoising effect.

[0140] Among them, when performing weighted fusion on the first denoised block and the second denoised block, the weighting coefficient used can be preset based on experience or flexibly calculated, such as setting weighted weights based on the number of blocks to be denoised contained in the similar block set. The larger the number of blocks, the greater the weight of the second denoised block, and the smaller the weight of the first denoised block. Conversely, the smaller the number of blocks, the smaller the weight of the second denoised block, and the greater the weight of the first denoised block.

[0141] In some embodiments, the number of tiles to be denoised contained in a similar tile set is counted; if the number of tiles is within a first threshold range, strategy one is used to calculate the denoised tile corresponding to each tile to be denoised in the similar tile set; if the number of tiles is within a second threshold range, strategy three is used to calculate the denoised tile corresponding to each tile to be denoised in the similar tile set; if the number of tiles is within a third threshold range, strategy two is used to calculate the denoised tile corresponding to each tile to be denoised in the similar tile set; wherein the value in the first threshold range is smaller than the value in the second threshold range, and the value in the second threshold range is smaller than the value in the third threshold range.

[0142] For example, if the number of tiles to be denoised in the similar tile set is more than 30, strategy 2 is used; if the number of tiles to be denoised in the similar tile set is less than 10, strategy 1 is used; if the number of tiles to be denoised in the similar tile set is between 10 and 30, strategy 3 is used.

[0143] By flexibly selecting a specific strategy for block fusion according to the number of blocks, the accuracy of the final blocks to be denoised can be improved.

[0144] In some implementations, there are multiple matching clusters corresponding to the image block to be denoised, each matching cluster corresponds to a similar image block set, and each similar image block set is respectively calculated to obtain a denoised image block. Therefore, after performing fusion processing on all the image blocks to be denoised contained in the similar image block set to obtain the denoised image block corresponding to each image block to be denoised in the similar image block set, the same image block to be denoised will obtain multiple denoised image blocks, and the method further includes:

[0145] Obtain a denoised image block calculated from each similar image block set of the image block to be denoised; and calculate the vector distance between the image block to be denoised and the vectors corresponding to the cluster centers of each matching cluster cluster; based on the vector distance corresponding to each matching cluster cluster, set the weight of the denoised image block corresponding to each associated similar image block set, and the weight is inversely correlated with the vector distance; perform weighted fusion on each denoised image block according to the weight of each denoised image block, and use the weighted fusion result as the final denoised image block.

[0146] For example, for the block to be denoised , select the first three sample clusters with the largest probability values ​​to obtain the image block to be denoised The corresponding matching clusters, the identifiers of the matching clusters are , The corresponding cluster centers are , then the calculation formula of the weight of the corresponding denoised block can be expressed as the following formula 13:

[0147] (Formula 13)

[0148] B represents any block to be denoised. Match the cluster center of any matching cluster cluster for the image block to be denoised. The weight of the denoised image block is calculated for the set of similar images corresponding to the image block to be denoised in the matching cluster.

[0149] Of course, other formulas that are inversely correlated with the vector distance may also be used to calculate the weight of the denoised image block, and this application does not limit this.

[0150] Then, according to the weight of each denoised image block, weighted fusion is performed on each denoised image block, and the weighted fusion result is used as the final denoised image block.

[0151] For example, the denoising tiles are still For example, the denoised blocks calculated based on each set of similar blocks include , the formula for weighted fusion of each denoised block can be found in the following formula 14:

[0152] (Formula 14)

[0153] in, They are the denoised blocks respectively The corresponding weight, The block to be denoised Final denoised tile.

[0154] In some implementations, there are overlapped regions between the multiple image blocks to be denoised extracted from the image to be denoised. Figure 3 There are overlapping areas between the extracted multiple denoised image blocks; in step S250, all the denoised image blocks are combined, and the denoised image corresponding to the denoised image to be denoised includes:

[0155] Step S251: for any pixel to be denoised of the image to be denoised, obtaining a denoised image block corresponding to all denoised image blocks containing the pixel to be denoised;

[0156] Step S252: performing weighted fusion on the denoised pixels corresponding to the pixels to be denoised in all the acquired denoised image blocks to obtain target denoised pixels corresponding to the pixels to be denoised;

[0157] Step S253: combining the target denoising pixels corresponding to all the pixels to be denoised, to obtain a denoised image corresponding to the image to be denoised.

[0158] Among them, when performing weighted fusion on all denoised pixels corresponding to the denoised pixels, the weight parameters used can be preset based on experience or flexibly calculated, such as being calculated based on the variance of the denoised image block corresponding to the denoised pixels. This application does not limit this.

[0159] For example, for any pixel to be denoised, if it exists in multiple blocks to be denoised, the denoised pixels of the multiple blocks to be denoised are extracted, and the denoised pixels corresponding to the pixel to be denoised include , G means that the pixel to be denoised is extracted by G blocks to be denoised, and the variance of the corresponding block to be denoised is used as the weighted weight. Then, the calculation formula of the target denoised pixel corresponding to the pixel to be denoised is as follows: Formula 15:

[0160] (Formula 15)

[0161] in, is the variance of the gth image block to be denoised, and deV is the target denoised pixel.

[0162] The above calculation is performed on each pixel in the denoised image to obtain the denoised image.

[0163] The image denoising method based on block matching provided by the present application clusters sample blocks and constructs a Gaussian mixture model for each sample cluster cluster obtained by clustering; extracts multiple blocks to be denoised from the image to be denoised, and calculates the probability value of each block to be denoised belonging to each sample cluster cluster based on the block vector corresponding to each block to be denoised and the Gaussian mixture model corresponding to each sample cluster cluster; selects the sample cluster cluster whose probability value meets the preset condition, obtains the matching cluster cluster corresponding to the block to be denoised, and determines the probability of each block to be denoised belonging to each sample cluster cluster respectively. The distribution position of the cluster in the vector space; the denoised blocks with adjacent distribution positions are divided into the same similar block set, and all the denoised blocks contained in the similar block set are fused to obtain the denoised blocks corresponding to each denoised block in the similar block set; all denoised blocks are fused to obtain the denoised image corresponding to the denoised image. The Gaussian mixture model can be used to match similar denoised blocks instead of direct comparison between blocks, thereby improving the accuracy of block matching without increasing the demand for computing resources.

[0164] Figure 6 FIG. 1 is a block diagram of an image denoising device based on block matching, shown as an exemplary embodiment of the present application. Figure 6 As shown, the exemplary image denoising device 600 based on block matching includes: a model building module 610, a clustering probability calculation module 620, a position mapping module 630, a block denoising module 640 and a block fusion module 650. Specifically:

[0165] The model building module 610 is used to cluster the sample blocks and build a Gaussian mixture model for each sample cluster obtained by clustering; wherein the sample blocks are obtained by performing block extraction on low-noise sample images, and the noise content of the low-noise sample images is lower than a threshold;

[0166] The clustering probability calculation module 620 is used to extract a plurality of image blocks to be denoised from the image to be denoised, and calculate the probability value of each image block to be denoised belonging to each sample cluster based on the image block vector corresponding to each image block to be denoised and the Gaussian mixture model corresponding to each sample cluster.

[0167] The position mapping module 630 is used to select the sample clusters whose probability values ​​meet the preset conditions, obtain the matching clusters corresponding to the image blocks to be denoised, and respectively determine the distribution position of each image block to be denoised in the vector space of the corresponding matching clusters;

[0168] The block denoising module 640 is used to divide the blocks to be denoised that are adjacent to each other into the same similar block set, and perform fusion processing on all the blocks to be denoised contained in the similar block set to obtain a denoised block corresponding to each block to be denoised in the similar block set;

[0169] The image block fusion module 650 is used to fuse all the denoised image blocks to obtain a denoised image corresponding to the image to be denoised.

[0170] It should be noted that the image denoising device based on block matching provided in the above embodiment and the image denoising method based on block matching provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here. In practical applications, the image denoising device based on block matching provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0171] See also Figure 7 , Figure 7 7 is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 700 includes a memory 701 and a processor 702, and the processor 702 is used to execute the program instructions stored in the memory 701 to implement the steps in any of the above-mentioned block matching-based image denoising method embodiments. In a specific implementation scenario, the electronic device 700 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 700 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.

[0172] Specifically, the processor 702 is used to control itself and the memory 701 to implement the steps in any of the above-mentioned block matching-based image denoising method embodiments. The processor 702 can also be called a central processing unit (CPU). The processor 702 may be an integrated circuit chip with signal processing capabilities. The processor 702 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 702 can be implemented by an integrated circuit chip.

[0173] See also Figure 8 , Figure 8The computer-readable storage medium 800 stores program instructions 810 that can be executed by a processor, and the program instructions 810 are used to implement the steps in any of the above-mentioned block matching-based image denoising method embodiments.

[0174] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0175] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0176] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0177] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.

Claims

1. A block matching-based image denoising method, characterized in that: include: Clustering the sample blocks, and constructing a Gaussian mixture model for each sample cluster obtained by clustering; wherein the sample blocks are obtained by performing block extraction on low-noise sample images, and the noise content of the low-noise sample images is lower than a threshold; Extracting a plurality of image blocks to be denoised from the image to be denoised, and calculating a probability value of each image block to be denoised belonging to each sample cluster based on the image block vector corresponding to each image block to be denoised and the Gaussian mixture model corresponding to each sample cluster; Selecting a sample cluster whose probability value meets a preset condition, obtaining a matching cluster corresponding to the image block to be denoised, and determining the distribution position of each image block to be denoised in the vector space of the corresponding matching cluster; The denoised image blocks that are adjacent to each other in distribution positions are divided into the same similar image block set, and all the denoised image blocks contained in the similar image block set are fused to obtain a denoised image block corresponding to each denoised image block in the similar image block set; wherein the number of matching clustering clusters corresponding to the denoised image block is multiple, each matching clustering cluster corresponds to a similar image block set, and a denoised image block is calculated for each similar image block set; Obtaining a denoised image block calculated from each similar image block set of the image block to be denoised, performing weighted fusion on the denoised image blocks calculated from each similar image block set, and using the weighted fusion result as the final denoised image block; All denoised image blocks are merged to obtain a denoised image corresponding to the image to be denoised.

2. The method according to claim 1, characterized in that The clustering of the sample blocks and building a Gaussian mixture model for each sample cluster obtained by clustering include: Taking a preset number of sample clusters as clustering targets, the expectation maximization algorithm is used to iteratively solve the model parameters of the Gaussian mixture model of all sample blocks to obtain the Gaussian mixture model corresponding to each sample cluster; Alternatively, a clustering algorithm is used to cluster all sample blocks to obtain a preset number of sample clusters, and based on the sample blocks contained in each sample cluster, the model parameters of the Gaussian mixture model corresponding to each sample cluster are calculated respectively to obtain the Gaussian mixture model corresponding to each sample cluster; Alternatively, a clustering algorithm is used to cluster all sample blocks to obtain a preset number of sample clusters, and based on the sample blocks contained in each sample cluster, the model parameters of the Gaussian mixture model corresponding to each sample cluster are calculated to obtain initial model parameters; the expectation maximization algorithm is used to iteratively optimize the initial model parameters to obtain the Gaussian mixture model corresponding to each sample cluster.

3. The method according to claim 1, characterized in that The respectively determining the distribution position of each to-be-denoised image block in the vector space of the corresponding matching cluster cluster comprises: Calculating the vector distance between the cluster center of the matching cluster or the sample image contained therein and the vectors corresponding to the image block to be denoised; Based on the vector distance, the distribution position of the image block to be denoised in the vector space of the corresponding matching cluster is obtained.

4. The method according to claim 3, characterized in that Calculating the vector distance between the cluster center of the matching cluster and the vectors corresponding to the image block to be denoised; and obtaining the distribution position of the image block to be denoised in the vector space of the corresponding matching cluster based on the vector distance, including: Taking the cluster center as the center point, dividing a plurality of grids in the vector space of the matching cluster cluster; Determining the grid to which the image block to be denoised belongs based on the vector distance between the image block to be denoised and the cluster center; Using the grid to which the image block to be denoised belongs as the distribution position of the image block to be denoised in the vector space of the matching cluster; The step of dividing the image blocks to be denoised that are adjacent to each other into the same similar image block set includes: All the tiles to be denoised in the same grid are regarded as adjacent tiles to be denoised and are divided into the same similar tile set.

5. The method according to claim 1, characterized in that The step of fusing all the image blocks to be denoised contained in the similar image block set to obtain a denoised image block corresponding to each image block to be denoised in the similar image block set includes: Use any of the following denoising calculation strategies to calculate the denoised image block corresponding to each image block to be denoised: Strategy 1: Combine the tile vectors corresponding to all the tiles to be denoised contained in the similar tile set to obtain a tile vector matrix, and obtain the eigenvector matrix of the covariance matrix corresponding to the matching clustering clusters associated with the similar tile set; based on the tile vector matrix and the eigenvector matrix, calculate and obtain the denoised tile corresponding to each tile to be denoised; Strategy 2: Combine the tile vectors corresponding to all the tiles to be denoised contained in the similar tile set to obtain a tile vector matrix, and perform singular value decomposition on the tile vector matrix; subtract the decomposed singular values ​​from a preset threshold, and re-integrate the subtracted singular values ​​to obtain a denoised tile corresponding to each tile to be denoised; Strategy three: Use the block denoising result calculated by strategy one as the first denoised block, and use the block denoising result calculated by strategy two as the second denoised block, perform weighted fusion on the first denoised block and the second denoised block to obtain the denoised block corresponding to each block to be denoised.

6. The method according to claim 5, characterized in that The step of fusing all the image blocks to be denoised contained in the similar image block set to obtain a denoised image block corresponding to each image block to be denoised in the similar image block set includes: Counting the number of the to-be-denoised blocks contained in the similar block set; If the number of image blocks is within the first threshold range, strategy 1 is used to calculate and obtain a denoised image block corresponding to each image block to be denoised in the set of similar image blocks; If the number of image blocks is within the second threshold range, strategy three is used to calculate and obtain a denoised image block corresponding to each image block to be denoised in the set of similar image blocks; If the number of image blocks is within the third threshold range, strategy 2 is used to calculate and obtain a denoised image block corresponding to each image block to be denoised in the set of similar image blocks; The value in the first threshold range is smaller than the value in the second threshold range, and the value in the second threshold range is smaller than the value in the third threshold range.

7. The method according to claim 1, characterized in that The weighted fusion of the denoised image blocks calculated from each set of similar image blocks, and taking the weighted fusion result as the final denoised image block, comprises: Calculating the vector distance between the image block to be denoised and the vectors corresponding to the cluster centers of each matching cluster cluster; Based on the vector distance corresponding to each matching cluster, respectively set the weight of the denoised image block corresponding to each associated similar image block set, wherein the weight is inversely correlated with the vector distance; According to the weight of each denoised image block, weighted fusion is performed on the denoised image blocks calculated from each set of similar image blocks, and the weighted fusion result is used as the final denoised image block.

8. The method according to claim 1, characterized in that There are overlapping areas between the plurality of image blocks to be denoised extracted from the image to be denoised; The step of fusing all the denoised blocks to obtain a denoised image corresponding to the image to be denoised includes: For any pixel to be denoised of the image to be denoised, obtaining denoised image blocks corresponding to all denoised image blocks containing the pixel to be denoised; Performing weighted fusion on the denoised pixels corresponding to the pixel to be denoised in all the acquired denoised image blocks to obtain the target denoised pixel corresponding to the pixel to be denoised; The target denoising pixels corresponding to all the pixels to be denoised are combined to obtain a denoised image corresponding to the image to be denoised.

9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the processor is configured to execute program instructions stored in the memory to implement the steps in the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and the program instructions can be executed by a processor to implement the steps in the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Image denoising method based on combination of multiple scales and generalized kernel norms

    CN114240772A

  • Image noise reduction method and device, equipment and medium

    CN115578288A

  • Product surface defect detecting and positioning method and device and terminal equipment

    CN116188445A