This application claims the priority benefit of Taiwan application serial no. 102149149, filed on Dec. 31, 2013. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification.
The technical field relates to a method and an apparatus for image processing, more particularly, to a method and an apparatus for estimating image noise.
When ambient light is insufficient, images captured by electronic image capturing apparatuses, such as digital cameras and digital camcorders, are very much likely to encounter the issue of image noise. To resolve said issue, the noise level must be estimated at first.
In a conventional noise estimation method, a calibration process is performed in advance; that is, the noise levels corresponding to various light sources and various sensor gain are measured to create a lookup table in advance. The lookup table provides the reference to the noise levels of the images, so as to eliminate the noise. However, the calibration process in advance is complicated; in addition, if the parameters related to the front-stage processing circuit are changed, recalibration is required to rebuild the lookup table.
Therefore, the calibration process is not performed in advance according to the common noise estimation; instead, the noise level of the images is estimated in real time. To perform such real-time estimation, how to exclude the non-planar regions in the images should be taken into consideration. In the images, the so-called planar regions refer to the regions that are monotonous and lack of changes, such as a desktop or a wall. The non-planar regions are rather complex and delicate, such as the edge of an object, the complex structure of the object, or complex textures.
In order to perform said real-time estimation, the signal-dependent characteristics of noise should also be taken into account; i.e., the noise level of the image may vary together with the pixel intensity in the image, so as to prevent excessive blur or insufficient filter strength in some regions in the image due to the constant noise level.
One of exemplary embodiments provides a method and an apparatus for estimating image noise, so as to solve the above problems occurring during the real-time estimation.
In an exemplary embodiment of the disclosed example, a method for estimating image noise comprises: determining a plurality of sample blocks of an image; calculating the mean of at least one color component of each of the sample blocks and the standard deviation of at least one color component of each of the sample blocks; distributing the sample blocks into a plurality segments based on the mean; calculating a weighted average of the standard deviations of all of the sample blocks of each of the segments according to at least one threshold value. The at least one threshold value is determined according to the minimum standard deviation among the standard deviations of all of the sample blocks of each of the segments. The weighted average is applied for noise reduction, edge detection, or motion detection of the image.
In an exemplary embodiment of the disclosed example, an apparatus for estimating image noise includes a memory for storing an image and a processor. The processor coupled to the memory executes said method for estimating image noise.
In view of the above, in the method and the apparatus for estimating image noise as provided in an exemplary embodiment of the disclosed example, the non-planar regions in the image are excluded according to the threshold value, the sample blocks are distributed into a plurality of segments according to the pixel intensity, and the noise level of each segment (i.e., said weighted average) is provided to avoid excessive blur or insufficient filter strength in some regions in the image due to the constant noise level.
In order to make the aforementioned and other features and advantages of the disclosed example understandable, several embodiments accompanied with figures are described in detail below.
The accompanying drawings are included to provide further understanding, and are incorporated in and constitute a part of this specification. The drawings illustrate exemplary embodiments and, together with the description, serve to explain the principles of the disclosure.
The apparatus 100 for estimating image noise includes a memory 120 and a processor 140. The processor 140 is coupled to the memory 120. With reference to
The statistics of each sample block are calculated in step 220. The said statistics include the mean and the standard deviation of at least one color component of each said sample block.
For example, if the image 111 is in a YUV color format, each pixel of the image 111 has three color components Y, U, and V. The three color components in each sample block may be calculated to obtain four statistics, i.e., mean_Y, std_Y, std_U, and std_V. Here, the mean_Y is the mean of the Y components of all pixels of the sample block, std_Y is the standard deviation of the Y components of all the pixels of the sample block, std_U is the standard deviation of the U components of all the pixels of the sample block, and std_V is the standard deviation of the V components of all the pixels of the sample block. In the present exemplary embodiment, the value of each color component in each pixel is, for instance, 8 bits, i.e., within the range from 0 to 255. However, the value of each color component in the disclosed example is not limited to 8 bits. The above statistics are shown in
In another embodiment, if the image 111 is in the RGB color format, each pixel of the image 111 has three color components R, G, and B. The three color components in each sample block may be calculated to obtain six statistics, i.e., mean_R, mean_G, mean_B, std_R, std_G, and std_B. Here, the mean_R is the mean of the R components of all pixels of the sample block, and std_R is the standard deviation of the R components of all the pixels of the sample block. The other four statistics, i.e., the mean_G, the mean_B, the std_G, and the std_B may be deduced from the above, respectively, and the above statistics are shown in
In step 230, the sample blocks are distributed into a plurality of segments according to the means of said sample blocks. As exemplarily shown in
In step 240, the noise level of the image 111 is calculated. Step 240 may be performed once in each segment for each color component in the image 111 to calculate the noise level of each segment for each color component of the image 111. For example, if the image 111 is in the YUV color format,
In step 240, the noise level noise_cur of the segment seg0 is calculated by the following equation.
The noise level noise_cur is a weighted average, wherein N is the number of sample blocks in the segment seg0, std(i) is the standard deviation std_R of the i-th sample block in the segment seg0, and w(i) is the weight corresponding to the i-th sample block in the segment seg0. The weight w(i) is determined by comparing the standard deviation std(i) and at least one threshold value. For instance, a threshold value std_Th is calculated by the following equation (2) at first.
std
—
Th=k×std_Min (2)
In the equation (2), k is the default parameter, and k≧1; std_Min is the minimum standard deviation among the standard deviations std_R of all of the sample blocks in the segment seg0. Therefore, the sample block having the standard deviation std_Min may represent the planar region in the image 111. The standard deviation std_Min and the threshold value std_Th are proportional to each other according to the equation (2). If std(i)≦std_Th, set w(i)=1. If std(i)>std_Th, set w(i)=0. If the standard deviation std(i) of a certain sample block is greater than the threshold value std_Th, the sample block is a non-planar region, and the weight of such sample block is zero.
Therefore, the threshold value std_Th may be used to exclude non-planar regions in the image, so as not to affect the noise estimation.
The above description is an example for determining the weight w(i) based on the standard deviation std(i) and a threshold value std_Th. The following example for determining the weight w(i) is based on the standard deviation std(i) and the two threshold values std_Th and std_Th2. First, the threshold values std_Th1 and std_Th2 are calculated by the following equations (3) and (4).
std
—
Th1=k1×std_Min (3)
std
—
Th2=k2×std_Min (4)
k1 and k2 are the default parameters of the equations (3) and (4), where k1≧1, k2≧1 and k1<k2. If std(i)≦std_Th1, set w(i)=w1; if std_Th1<std(i)≦std_Th2, set w(i)=w2; if std(i)>std_Th2, set w(i)=0. Note that w1 and w2 are also the default parameters, where 0≦w1≦1, 0≦w2≦1, and w1≧w2.
The number of the threshold values of the weight is not limited in the disclosed example; in another embodiment three or more threshold values may be applied, and how to determine the weight w(i) may be deduced from the above.
In step 240, the noise level noise_cur in each segment for each color component in the image 111 is calculated by equation (1). For instance,
According to the exemplary embodiment shown in
For example, if the number of the sample blocks in the first segment seg0 is lesser than or equal to the threshold value, a default scale ratio of the noise level noise_cur of the segment which is closest to the first segment seg0 and whose number of sample blocks is greater than the threshold value may be set as the noise level noise_cur of the first segment seg0. Said default scale ratio may be 40%, 50%, 60%, or another ratio. If the number of the sample block in the last segment seg7 is lesser than or equal to the threshold value, the above principle may be applied. If the number of the sample blocks in a middle segment (i.e., any one of the segments seg1 to seg6) is lesser than or equal to the threshold value, the noise levels noise_cur of the two closest segments at both sides of the middle segment whose numbers of sample blocks are greater than the threshold value may be interpolated, so as to obtain the noise level noise_cur of the middle segment.
In an exemplary embodiment of the disclosed example, the apparatus 100 for estimating image noise may omit the step 250 and output the combination of the noise level noise_cur of each color component in each segment in the image 111. The combination is the noise profile 112 of the image 111. If the image 111 is in the YUV color format, the noise profile 112 is the combination of the noise levels noise_cur in 24 segments seg0 to seg7 shown in
In another embodiment, the image 111 is a frame in a video clip, and the noise level is updated by a recursive filter through further performing the step 250. By means of the following equation (5) and equation (6), the recursive average noise(t) acting as a new noise level for each segment is updated by calculating noise(t−1) and noise_cur(t) in each segment. Similar to step 240, step 250 may be executed once respectively for each color component in each segment in the image 111.
noise(t)=(1−k3)×noise(t−1)+k3×noise—cur(t) (5)
noise(0)=noise—cur(0) (6)
Here, k3 is the default parameter, and 0≦k3≦1; t is the corresponding time of the image 111 in said video clip and may also represent the frame number of the image 111 in the said video clip, and t is a positive integer; noise_cur(t) is the weighted average noise_cur calculated by the equation (1) according to the image 111, noise_cur(t−1) is the weighted average noise_cur calculated by the equation (1) according to the previous image of the image 111, and the rest may be deduced therefrom. Therefore, noise(t−1) is the noise level at the time before the image 111 in said video clip, and noise(t) is the noise level at the time of the image 111 in said video clip.
If step 250 is executed, the apparatus 100 for estimating image noise may output the combination of the recursive average noise(t) of each color component in each segment in the image 111, and the combination serves as the noise profile 112 of the image 111.
The above default parameters, e.g., k, k1, k2, k3, w1, w2, etc., are allowed to be adjusted by the users.
To sum up, the noise estimation only requires one single image according to an exemplary embodiment of the disclosed example. The statistics of color components may be distributed into a plurality of segments for calculating the noise levels of the segments, thereby avoiding excessive blur or insufficient filter strength in some regions in the image due to the constant noise level. The non-planar regions in the image are excluded by calculations of the threshold value and the weighted average, and thus edge detection is not required for detecting the planar regions in the image. In addition, the recursive filter may be applied to obtain the estimated noise level stably and reduce the estimation errors in an exemplary embodiment of the disclosed example. It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the disclosed embodiments without departing from the scope or spirit of the disclosure. In view of the foregoing, it is intended that the disclosure cover modifications and variations of this disclosure provided they fall within the scope of the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
102149149 | Dec 2013 | TW | national |