Background
The image is an important carrier for information recording and transmission in modern society, but the image is inevitably affected by noise in the processes of acquisition, storage and transmission, so that the quality of the image is reduced. The noise level is an important parameter of image processing optimization algorithms such as image denoising, image compression, image splicing and the like, so that accurately estimating the noise level has a very important meaning for image denoising. With the development of CMOS image sensors, in order to reduce the influence of noise, some manufacturers directly embed a noise reduction module in an image sensor chip, which can effectively suppress noise independent of a signal whose noise component is becoming a main noise source of the CMOS image sensor. At present, most of estimation of signal dependent noise is based on weak texture image blocks, and the method has the difficulty that the weak texture image blocks are selected, then a pair of pixel values and noise variance are estimated for each image block, and finally, noise parameters are fitted. The weak texture image blocks may be obtained using a clustering algorithm.
Clustering is a process of grouping different objects according to similarity, and objects with high similarity are grouped into the same group. Clustering analysis, which is the main content of unsupervised learning, has been an important component in the fields of machine learning, pattern recognition, data mining, and the like. At present, many clustering algorithms have appeared, and can be roughly divided into a partition clustering method, a hierarchical clustering method, a density clustering method, a model clustering method, a grid clustering method and the like.
In 2014, Rodriguez and Laio proposed a density peak Clustering algorithm (DPC) based on density and distance on Science, which can search and find density peaks quickly, then determine cluster centers, and assign the remaining points to corresponding clusters. The DPC algorithm has the advantages of low parameter requirement, non-iteration and the like, and can effectively detect the clusters of any shapes from a large-scale data set with low calculation complexity. However, the existing density peak clustering algorithm is more prone to select the clustering center of the dense region, and the clustering of the sparse region is often ignored. For a data set with large density difference, the DPC algorithm often determines density points of a sparse region as abnormal values or allocates the abnormal values to adjacent dense clusters in a staggered manner, so that the cluster center of the sparse cluster is ignored, and thus the inaccuracy of a clustering result is caused. Some existing DPC-based improved clustering algorithms often improve the clustering effect by introducing K Nearest Neighbor (KNN), but the parameter k is a numerical value set artificially and subjectively according to past experience, and the size of the k value often has a large influence on the clustering result, so that the clustering accuracy is further influenced.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a signal dependent noise parameter estimation method based on improved density peak value clustering, relative density definition is introduced, a clustering center is determined according to picture characteristic distribution, parameter values do not need to be defined artificially, clustering precision is improved, and accurate estimation of noise parameters is realized.
The signal dependent noise parameter estimation method based on the improved density peak clustering specifically comprises the following steps:
step one, extracting a plurality of samples with the same size from an original image containing noise by using a sliding window. And calculating the mean value, entropy and gradient of each sample as the characteristic data of the sample. And (4) forming a feature data set by the feature data of all the samples, and then carrying out normalization processing.
Step two, calculating the following parameters aiming at the feature data set X after normalization processing in the step one:
characteristic data xiEuclidean distance d from other characteristic dataij:
dij=||xi-xj||
② characteristic data xiLocal density of (p)i:
③ characteristic data xiDistance δ from nearest higher density feature datai:
Characteristic data xiDistance θ from nearest lower density feature datai:
Wherein x isi、xj∈X,dcThe cutoff distance is a value at 1% to 2% after arranging the distances between all feature data in ascending order.
Step three, dividing the characteristic data x according to the calculation result of the step twoiRelative density comparison range η ofiAnd calculating the relative density ρ thereofi':
ηi=max(θi,δi)
Wherein N is
iIs a relative density comparison range eta
iThe number of characteristic data in the table.
Representing characteristic data x
jWherein the distance characteristic data x
iThe more recent, the feature data x
iThe greater the relative density contribution of (a), the greater the weight occupied. Defining feature data x
iIs the ratio of its local density to the cumulative average of the local densities of the surrounding feature data.
Step four, using the characteristic data x obtained in the step threeiRelative density of (g)i' alternative local Density ρiRecalculating the feature data xiDistance δ from nearest higher density feature datai. Then, the feature data x is calculatediCluster value of gammai:
γi=ρi'·δi
Calculating to obtain a clustering value gammaiSorting according to descending order, selecting two feature data with the highest clustering value as clustering centers, distributing other feature data to clusters with the clustering centers closer to each other, and outputting each feature dataAnd finishing the clustering process by using the cluster labels corresponding to the characteristic data.
Step five, calculating the estimated pixel level of the weak texture sample according to the clustering result of the step four
And variance of noise
Where N is the side length of the sample, wk denotes the index of the weak texture sample, B _ bead _ N is the number of weak texture samples, I
wk(m, n) represents a weak texture sample I
wkThe pixel value of the mth row and the nth column.
Is the minimum variance direction vector of the weak texture samples, and the covariance matrix C
PCorrelation of minimum eigenvalues of:
step six, configuring the noise in the original image into a Poisson-Gaussian noise model, and then carrying out a total noise method sigma of (p, q) positions in the original image2(p, q) is:
σ2(p,q)=ax(p,q)+b
where x (p, q) represents the noise-free pixel value at the (p, q) position in the original image. a. b is a noise parameter. Fitting weak texture samples I using least squares
wkPixel value-to-noise variance estimation pair of
Obtaining the estimated value of the noise parameter of the original image
And
the invention has the following beneficial effects:
1. according to the method, for a data set with uneven density distribution of characteristic data of signal-related noise of a CMOS image sensor, in the clustering process of samples, relative density is defined, the density is calculated according to the data distribution characteristics of the data set, so that the central point of a sparse cluster can have a larger density value, the density value of a sparse cluster in the data set with large density difference is prevented from being always lower than that of a dense cluster, and the sparse cluster is prevented from being taken as an outlier or wrongly distributed to other high-density clusters.
2. The comparison areas are divided according to the data distribution characteristics of the data sets, and subjectively determined parameter values are not introduced, so that different data sets have different relative density comparison ranges in a self-adaptive manner, and the influence of artificial experience judgment on experimental results is avoided.
3. The accuracy of the clustering result is improved by introducing the relative density, so that a more accurate weak texture region is selected, the noise estimation of the whole image is further carried out, the estimation accuracy is improved, and the later-stage image denoising is facilitated.
Detailed Description
The invention is further explained in the following with reference to the accompanying drawings; the raw image used in this embodiment is derived from an image captured by a CMOS image sensor, and noise in the raw image is a signal-dependent noise component generated by a noise reduction module of the CMOS image sensor during the capturing process.
The signal dependent noise parameter estimation method based on the improved density peak clustering specifically comprises the following steps:
step one, using a sliding window with the size of 16 x 16, sliding the distance of one pixel point at a time according to the sequence from top to bottom and from left to right, and extracting n samples with the size of 16 x 16 from an original image containing noise. Calculating the mean, entropy, and gradient of each sample as the characteristic data of the sample:
where, gray represents the magnitude of the gray value, and p (gray) represents the probability that the gray value is gray. W, H is the width and height of the sample, pw,hThe pixel value of the (w, h) position in the sample.
I.e. feature data x for each samplei’Has three attributes of mean, entropy, and gradient, xi'={xi1,xi2,xi3}. And (4) forming a feature data set by the feature data of all the samples, and performing normalization processing.
Step two, calculating the following parameters aiming at the feature data set X after normalization processing in the step one:
characteristic data xiEuclidean distance d from other characteristic dataij:
dij=||xi-xj||
② characteristic data xiLocal density of (p)i:
③ characteristic data xiDistance δ from nearest higher density feature datai:
Characteristic data xiDistance θ from nearest lower density feature datai:
Wherein x isi、xj∈X,dcThe size is a value at 1% to 2% after arranging the distances between all feature data in ascending order, as the cutoff distance. When the feature data xiIs the global lowest, thetai=δi。
Step three, dividing the characteristic data x according to the calculation result of the step twoiRelative density comparison range η ofiAnd calculating the relative density ρ thereofi':
ηi=max(θi,δi)
When etai=δiTime, description feature data xiSurrounded by feature data of lower density than the feature data, and more likely to become the center point.
When etai=θiTime, description feature data xiSurrounded by feature data with a higher density than the density, the probability of becoming a center point is small.
Wherein N is
iIs a relative density comparison range eta
iThe number of characteristic data in the table.
Representing characteristic data x
jWherein the distance characteristic data x
iThe more recent, the feature data x
iThe greater the relative density contribution of (A), is occupiedThe greater the weight. Defining feature data x
iIs the ratio of its local density to the cumulative average of the local densities of the surrounding feature data. Thus, the density value calculated by each point is the relative size, not the absolute size, compared with the density of the points around the point, the local structure of the cluster is better considered, and even the cluster center of the sparse cluster can obtain a larger density value, so that the sparse cluster is better identified.
Step four, using the characteristic data x obtained in the step threeiRelative density of (g)i' alternative local Density ρiRecalculating the feature data xiDistance δ from nearest higher density feature datai. A traditional DPC algorithm needs to draw a decision diagram according to rho and delta, and then manually selects a point with larger rho and delta as a clustering center. The subjective factors of the method account for a great proportion, and the condition that the clustering center cannot be easily selected by naked eyes exists, so that the domino effect is directly caused in the subsequent distribution step, the final clustering result is influenced, and therefore the product of the calculated relative density and the calculated distance is selected as the characteristic data xiCluster value of gammai:
γi=ρi'·δi
Calculating to obtain a clustering value gammaiAnd sorting according to a descending order, selecting two feature data with the highest clustering value as clustering centers, distributing other feature data into clusters with the clustering centers which are closer to each other, outputting a cluster label corresponding to each feature data, dividing the cluster label into a weak texture sample and a strong texture sample, and finding the weak texture sample after finishing the clustering process.
Step five, calculating the estimated pixel level of the weak texture sample according to the clustering result of the step four
And variance of noise
Where N is the side length of each sample, N is 16 in this embodiment, wk denotes the index of the weak texture sample, B _ bead _ N is the number of weak texture samples, I
wk(m, n) represents a weak texture sample I
wkThe pixel value of the mth row and the nth column.
Is the minimum variance direction vector of the weak texture samples, and the covariance matrix C
PCorrelation of minimum eigenvalues of:
step six, configuring the noise in the original image into a Poisson-Gaussian noise model, and then carrying out a total noise method sigma of (p, q) positions in the original image2(p, q) is:
σ2(p,q)=ax(p,q)+b
where x (p, q) represents the noise-free pixel value at the (p, q) position in the original image. a. b is a noise parameter. Fitting weak texture samples I using least squares
wkPixel value-to-noise variance estimation pair of
Obtaining the estimated value of the noise parameter of the original image
And
after determining the noise estimate in the image, the magnitude of the noise component in the image may be determined for use in subsequent CMOS image sensor signalsThe number depends on the removal of noise.