FILTERING DEVICE AND FILTER METHOD OF THE SAME
20170301071 · 2017-10-19
Inventors
- Hao-Tien CHIANG (Taipei City, TW)
- Tsung-Hsuan LI (Taichung City, TW)
- Shih-Tse Chen (Hsinchu County, TW)
Cpc classification
International classification
Abstract
An image-filtering device for filtering an image that includes a pixel difference computing module, an adaptive brightness adjusting module, a weighting computing module and a filter computing module is provided. The pixel difference computing module uses any one of the pixels as a central pixel within a pixel window to compute pixel absolute differences between the central pixel and every pixels within the pixel window. The adaptive brightness adjusting module multiplies each of the pixel absolute differences with an adjusting parameter to generate adjusted pixel absolute differences. The weighting computing module generates weighting values according to the adjusted pixel absolute differences. The filter computing module performs convolution according to the pixel value of each of the pixels within the pixel window and the corresponding weighting values to generate a filtering result of the central pixel.
Claims
1. An image-filtering device for filtering an image with a plurality of pixels each having a pixel value, comprising: a pixel difference computing module configured to use any one of the pixels as a central pixel within a pixel window to compute pixel absolute differences between the pixel value of the central pixel and the pixel value of every pixels within the pixel window; an adaptive brightness adjusting module configured to multiply each of the pixel absolute differences with an adjusting parameter to generate corresponding adjusted pixel absolute differences, wherein when a reference brightness of a pair of the pixels corresponding to the one of the pixel differences is smaller, the adjusting parameter is larger and when the reference brightness of a pair of the pixels corresponding to the one of the pixel absolute differences is larger, the adjusting parameter is smaller; a weighting computing module configured to generate weighting values according to the adjusted pixel absolute differences, wherein when one of the adjusted pixel absolute differences is smaller, the corresponding one of the weighting values is larger, and when one of the adjusted pixel absolute differences is larger, the corresponding one of the weighting values is smaller; and a filter computing module configured to perform convolution according to the pixel value of each of the pixels within the pixel window and the corresponding weighting values to generate a filtering result of the central pixel.
2. The image-filtering device of claim 1, further comprising: a pre-processing module configured to perform a pre-processing on the image according to a noise characteristic of an image-retrieving device that retrieves the image such that the pixel difference computing module computes the pixel absolute differences according to the pre-processed image.
3. The image-filtering device of claim 2, wherein when the noise characteristic of the image-retrieving device is an impulse form, the pre-processing is a median filtering process.
4. The image-filtering device of claim 3, wherein the pre-processing module comprises a comparison network to perform the median filtering process.
5. The image-filtering device of claim 2, wherein when the noise characteristic of the image-retrieving device is a Gaussian form or a random form, the pre-processing is a Gaussian filtering process.
6. The image-filtering device of claim 1, wherein the pixel difference computing module computes the pixel absolute differences according to a one-norm method or a two-norm method.
7. The image-filtering device of claim 1, wherein the reference brightness is a minimal pixel value of the corresponding pair of the pixels.
8. The image-filtering device of claim 1, wherein the adjusting parameter is a power of 2.
9. An image-filtering method for filtering an image with a plurality of pixels each having a pixel value, comprising: using any one of the pixels as a central pixel within a pixel window to compute pixel absolute differences between the pixel value of the central pixel and the pixel value of every pixels within the pixel window; multiplying each of the pixel absolute differences with an adjusting parameter to generate corresponding adjusted pixel absolute differences, wherein when a reference brightness of a pair of the pixels corresponding to the one of the pixel absolute differences is smaller, the adjusting parameter is larger and when the reference brightness of a pair of the pixels corresponding to the one of the pixel absolute differences is larger, the adjusting parameter is smaller; generating weighting values according to the adjusted pixel absolute differences, wherein when one of the adjusted pixel absolute differences is smaller, the corresponding one of the weighting values is larger, and when one of the adjusted pixel absolute differences is larger, the corresponding one of the weighting values is smaller; and performing convolution according to the pixel value of each of the pixels within the pixel window and the corresponding weighting values to generate a filtering result of the central pixel.
10. The image-filtering method of claim 9, further comprising: performing a pre-processing on the image according to a noise characteristic of an image-retrieving device that retrieves the image such that the pixel absolute differences are computed according to the pre-processed image.
11. The image-filtering method of claim 10, wherein when the noise characteristic of the image-retrieving device is an impulse form, the pre-processing is a median filtering process.
12. The image-filtering method of claim 11, wherein the median filtering process is performed by using a comparison network.
13. The image-filtering method of claim 10, wherein when the noise characteristic of the image-retrieving device is a Gaussian form or a random form, the pre-processing is a Gaussian filtering process.
14. The image-filtering method of claim 9, wherein the pixel absolute differences is computed according to a one-norm method or a two-norm method.
15. The image-filtering method of claim 9, wherein the reference brightness is a minimal pixel value of the corresponding pair of the pixels.
16. The image-filtering method of claim 9, wherein the adjusting parameter is a power of 2.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The disclosure can be more fully understood by reading the following detailed description of the embodiment, with reference made to the accompanying drawings as follows:
[0010]
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
DETAILED DESCRIPTION
[0017] In order to make the objects, technical solutions and advantages of the present disclosure apparent, diagrams in combination of examples are used to describe the present disclosure in further detail. It should be understood that the specific embodiments described herein are merely examples for explaining the present disclosure and are not intended to limit the present disclosure.
[0018]
[0019] In the present embodiment, the image-filtering device 1 includes a pre-processing module 100, a pixel difference computing module 102, an adaptive brightness adjusting module 104, a weighting computing module 106 and a filter computing module 108.
[0020] In different embodiments, the image-retrieving device 2 can be such as, but not limited to digital image-retrieving device having charge-coupled device (CCD) light sensors or complementary metal oxide semiconductor (CMOS) light sensors to generate the image 101.
[0021] The pre-processing module 100 is configured to receive the image 101 from the image-retrieving device 2 and perform pre-processing on the image 101 according to a noise characteristic of the image-retrieving device 2. The noise characteristic of the image-retrieving device 2 can be obtained based on a training process. In an embodiment, the noise characteristic of the image-retrieving device 2 is a Gaussian form or a random form. Accordingly, the pre-processing performed by the pre-processing module 100 is such as, but not limited to a Gaussian filtering process. In another embodiment, the noise characteristic of the image-retrieving device is an impulse form. The pre-processing performed by the pre-processing module 100 is such as, but not limited to a median filtering process.
[0022] Reference is now made to
[0023] In an embodiment, the pre-processing is performed on any one of the pixels in the image 101. The pre-processing uses the selected pixel as a central pixel to perform computation with the neighboring pixels within a pixel window having a size of such as, but not limited 3×3.
[0024] For example, the image 101 in
[0025] When the pre-processing is the Gaussian filtering process, the pre-processing module 100 averages the pixel values of the pixels P.sub.00-P.sub.22 directly or with weights. The generated value becomes the pixel value of the pixel P.sub.11 after the pre-processing process. Take the average operation as an example, if the pre-processing module 100 averages the pixel values of the pixels P.sub.00-P.sub.22 directly, the generated value 157 is the pixel value of the pixel P.sub.11 after the pre-processing process.
[0026] When the pre-processing is the median filtering process, the pre-processing module 100 selects the median of the values of the pixels P.sub.00-P.sub.22 as the pixel value of the pixel P.sub.11 after the pre-processing process. The median filtering process can efficiently remove the impulse noise that can not be removed by the Gaussian filtering process.
[0027] In an embodiment, the pre-processing module 100 includes such as, but not limited a circuit of a comparison network to perform the median filtering process. The comparison network circuit performs comparisons each comparing two of the pixels P.sub.00-P.sub.22 concurrently. The median of the values of the pixels P.sub.00-P.sub.22 can be obtained under a fixed number of comparisons, which is beneficial for parallel processing of the hardware.
[0028] Reference is now made to
[0029] Since the median of the pixels P.sub.00-P.sub.22 is 150, the pixel value of the P.sub.11 in the image 101′ is 150 after the median filtering process. Similarly, when each of the pixels P.sub.00-P.sub.10 and P.sub.12-P.sub.22 is used as a central pixel, the median filtering process can be performed thereon with the neighboring pixels. In the present embodiment, the pixel values of the pixels P.sub.00-P.sub.10 and P.sub.12-P.sub.22 after the pre-processing become 200, 220, 220, 150, 130, 120, 120 and 110 respectively.
[0030] The pixel difference computing module 102 receives the pre-processed image 101′ and uses any one of the pixels P.sub.00-P.sub.22 as a central pixel within a pixel window to compute pixel differences between the pixel value of the central pixel and the pixel value of every pixels within the pixel window. There are many ways to calculate the pixel difference, such as but not limited to one norm, two norms or infinity norm. The method described in the present disclosure is an exemplary description and is not a limitation. For example, when the pixel P.sub.11 is used as the central pixel to perform computation with the pixels within a 3×3 pixel window, the pixel absolute differences computation result 103 is obtained. The pixel absolute differences computation result 103 includes such as, but not limited to pixel absolute differences D.sub.00-D.sub.22. Each of the pixel absolute differences D.sub.00-D.sub.22 is the absolute difference between the central pixel P.sub.11 and each of the pixels P.sub.00-P.sub.22 within the pixel window.
[0031] Reference is now made to
[0032] In the present embodiment, each of the pixel absolute differences D.sub.00-D.sub.22 is the absolute difference between the central pixel P.sub.11 and each of the pixels P.sub.00-P.sub.22 within the pixel window. As a result, according to the pixel values of the pre-processed pixels, the pixel absolute differences D.sub.00-D.sub.22 are 50, 70, 80, 0, 0, 20, 30, 30 and 40 respectively. It is appreciated that the computation method is not limited thereto. In different embodiments, the pixel difference computing module 102 can compute the pixel absolute differences D.sub.00-D.sub.22 according to a one-norm method or a two-norm method.
[0033] Subsequently, the adaptive brightness adjusting module 104 multiplies each of the pixel absolute differences D.sub.00-D.sub.22 with an adjusting parameter to generate corresponding adjusted pixel absolute differences computation result 105 that includes such as, but not limited to adjusted pixel absolute differences D.sub.00′-D.sub.22′.
[0034] Reference is now made to
[0035] In an embodiment, when a reference brightness of a pair of the pixels corresponding to the one of the pixel values P.sub.00-P.sub.22 is smaller, the adjusting parameter is larger. When the reference brightness of a pair of the pixels corresponding to the one of the pixel values P.sub.00-P.sub.22 is larger, the adjusting parameter is smaller. In an embodiment, the minimal pixel value of the corresponding pair of the pixels is selected as the reference brightness. Further, the adjusting parameter can be determined according to a function related to the reference brightness.
[0036] For example, if a pixel value is between 0˜255, the adjusting parameter corresponding to a pair of pixels P.sub.i,j and P.sub.i+m, j+n is a power of 2, such as 2.sup.k. The amount of the power k is determined by such as, but not limited to a function of:
K=F.sub.1=[└(255−min(P.sub.i,j,P.sub.i+m,j+n))/32┘],
in which F.sub.1[0]=0, F.sub.1[1]=1, F.sub.1[2]=1, F.sub.1[3]=2, F.sub.1[4]=2, F.sub.1[5]=3, F.sub.1[6]=3 and F.sub.1[7]=3.
[0037] Take a pair of pixels P.sub.00 and P.sub.11 corresponding to the pixel absolute differences D.sub.00 as an example, the reference brightness is the minimal pixel value thereof, which is 150. The power k of the adjusting parameter is computed by the following equation:
K=F.sub.1[└255−min(P.sub.00,P.sub.11))/32┘]=F.sub.1[└(255−150)/32┘]=F.sub.1[3]=2.
[0038] As a result, the adjusted pixel absolute difference D.sub.00′ is the multiplied result of the pixel absolute difference D.sub.00 and the adjusting parameter 2.sup.k, which is D.sub.00′=D.sub.00×2.sup.K=D.sub.00×22=50×4=200. In an embodiment, if the computed adjusted pixel absolute difference exceeds 255, the value of such an adjusted pixel absolute difference, for example, is set to 255.
[0039] The adjusted pixel absolute differences D.sub.01′-D.sub.22′ can be computed by using the identical method to generate the values of 255, 255, 0, 0, 80, 120, 120 and 160 respectively.
[0040] The method described above is equivalent to classify the amount of the pixel values into several sections. Take eight sections as an example, each having the range of 0˜31, 32˜63, . . . and 224˜255 that reflect the brightness of the pixels and further perform different degrees of adjustment on the pixel absolute differences based on the brightness of the pixels. In general, the human eyes are sensitive to the change of the brightness within an area having lower brightness. As a result, a greater adjustment is performed on the pixel absolute differences corresponding to the pixels having a lower brightness. A smaller adjustment is performed on the pixel absolute differences corresponding to the pixels having a higher brightness. The requirement of the perception of the human eyes can be satisfied. Further, by using the adjusting parameter realized by the power of 2, the adjusted pixel absolute differences can be computed by simply left-shift the bit of the pixel absolute differences. The computation complexity is greatly reduced. When the adaptive brightness adjusting module 104 is realized by the hardware, it is not necessary to dispose a large amount of multipliers. The cost of the hardware and the computation time can both be reduced.
[0041] It is appreciated that the computation method of the adjusting parameter described above is merely an example. In other embodiments, the reference brightness is determined by such as, but not limited to an average pixel value of a pair of pixels or a weighted average pixel value of a pair of pixels. Further, the design of the function can be different depending on practical needs and is not limited thereto.
[0042] Subsequently, the weighting computing module 106 determines the amount of the adjusted pixel absolute differences D.sub.00′-D.sub.22′ to generate weighting values computation result 107 that includes weighting values W.sub.00-W.sub.22.
[0043] Reference is now made to
[0044] In an embodiment, when one of the adjusted pixel absolute differences D.sub.01′-D.sub.22′ is smaller, the corresponding one of the weighting values W.sub.00-W.sub.22 is larger. When one of the adjusted pixel absolute differences D.sub.01′-D.sub.22′ is larger, the corresponding one of the weighting values W.sub.00-W.sub.22 is smaller. In an embodiment, each of weighting values W.sub.00-W.sub.22 is a power of 2. In other embodiments, other methods can be used to generate the weighting values. The generation method of the weighting values is not limited thereto.
[0045] For example, if a value of the adjusted pixel absolute difference D.sub.00′ is between 0˜255, the corresponding weighting value W.sub.00 can be 2.sup.s, and the power s is determined by such as, but not limited to a function of:
S=F.sub.2[7−└D.sub.00′/32┘],
wherein F.sub.2[0]=0, F.sub.2[1]=1, F.sub.2[2]=2, F.sub.2[3]=3, F.sub.2[4]=4, F.sub.2[5]=5, F.sub.2[6]=6 and F.sub.2[7]=7.
[0046] Take the adjusted pixel absolute differences D.sub.00′ as an example, the corresponding weighting value W.sub.00 is computed by the following equation:
S=F.sub.2[7−└200/32┘]=F.sub.2[7−6]=F.sub.2[1]=1.
[0047] As a result, the weighting value W.sub.00 is 2.sup.S=2.sup.1=2.
[0048] The weighting value W.sub.00-W.sub.22 can be computed by using the identical method to generate the values of 2.sup.0, 2.sup.0, 2.sup.7, 2.sup.7, 2.sup.S, 2.sup.4, 2.sup.4 and 2.sup.2 respectively.
[0049] The method described above is equivalent to classify the amount of the pixel values into eight sections each having the range of 0˜31, 32˜63, . . . and 224˜255 and generate different weighting values according to the amount of the adjusted pixel absolute differences. It is appreciated that the computation method of the weighting values described above is merely an example. In other embodiments, the design of the function can be different depending on practical needs as well and is not limited thereto.
[0050] Subsequently, the filter computing module 108 performs computation according to the image 101′ and the weighting values computation result 107. More specifically, the filter computing module 108 performs convolution according to the pixel value of each of the pixels within the pixel window and the corresponding weighting values to generate a filtering result 109 of the central pixel. Take the condition of using the pixel P.sub.11 as the central pixel as an example, the convolution result performed according to each of the pixels P.sub.00-P.sub.22 and the corresponding weighting values is:
(200×2.sup.1+220×2.sup.0+240×2.sup.0+150×2.sup.7+70×2.sup.7+140×2.sup.5+180×2.sup.4+100×2.sup.4+120×2.sup.2)/(2.sup.1+2.sup.0+2.sup.0+2.sup.7+2.sup.7+2.sup.5+2.sup.4+2.sup.4+2.sup.2)=38460/328=117.
[0051] As a result, the filtering result 109, which is the value of the pixel P.sub.11 after the filtering process, is 117.
[0052] Since the weighting values are realized by the power of 2, a large amount of multiplication operation is not necessary in the computation of the filtering result 109 and is replaced by left-shift of the bits. The division is only needed to be performed once to greatly reduce the computation complexity. When the filter computing module 108 is realized by the hardware, it is not necessary to dispose a large amount of multipliers. The cost of the hardware and the computation time can both be reduced.
[0053] It is appreciated that for every image 101′, the operation process described above is performed on each of the pixels to accomplish the filtering of each of the pixels.
[0054] The image-filtering device 1 in the present disclosure uses the pixel difference computing module 102 to compute the pixel absolute differences and uses the adaptive brightness adjusting module 104 to adjust the pixel absolute differences. In one aspect, the weighting computing module 106 can generate the weighting values dynamically according to different contents of the image 101. In another aspect, the adjusted pixel absolute differences can reflect the characteristic of the perception of the human eyes toward the brightness to increase the quality of the filtering process and accomplish the preservation of edges. Further, by using the weighting computing module 106 to generate the weighing values of the power of two, the computation of the filtering process and the complexity of the hardware implementation are greatly reduced. Further, by using the pre-processing of the pre-processing module 100, the image-filtering device 1 can remove the noise by using the method suitable for the noise characteristic of the image-retrieving device 2 to lower the impact of different types of noise.
[0055] Reference is now made to
[0056] In step 301, the pre-processing module 100 performs the pre-processing on the image 101 according to the noise characteristic of the image-retrieving device 2.
[0057] In step 302, the pixel difference computing module 102 uses any one of the pixels, such as the pixel P.sub.11 in
[0058] In step 303, the adaptive brightness adjusting module 104 multiplies each of the pixel absolute differences D.sub.00-D.sub.22 with the adjusting parameter to generate corresponding adjusted pixel absolute differences D.sub.00′-D.sub.22′. When the reference brightness of the pair of the pixels corresponding to the one of the pixel values P.sub.00-P.sub.22 is smaller, the adjusting parameter is larger. When the reference brightness of the pair of the pixels corresponding to the one of the pixel values P.sub.00-P.sub.22 is larger, the adjusting parameter is smaller.
[0059] In step 304, the weighting computing module 106 generates weighting values according to the adjusted pixel absolute differences D.sub.00′-D.sub.22′. When one of the adjusted pixel absolute differences D.sub.00′-D.sub.22′ is smaller, the corresponding one of the weighting values is larger. When one of the adjusted pixel absolute differences D.sub.00′-D.sub.22′ is larger, the corresponding one of the weighting values is smaller. In an embodiment, each of the weighting values is the power of 2.
[0060] In step 305, the filter computing module 108 performs convolution according to the pixel value of each of the pixels P.sub.00-P.sub.22 within the pixel window and the corresponding weighting values W.sub.00-W.sub.22 to generate the filtering result 109 of the central pixel P.sub.11. It is noted that the pixels P.sub.00-P.sub.22 can be the original pixel values or the processed values.
[0061] It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present disclosure without departing from the scope or spirit of the disclosure. In view of the foregoing, it is intended that the present disclosure cover modifications and variations of this disclosure provided they fall within the scope of the following claims.