CN111402178B - Non-average filtering method and non-average filtering device - Google Patents
Non-average filtering method and non-average filtering device Download PDFInfo
- Publication number
- CN111402178B CN111402178B CN202010212809.6A CN202010212809A CN111402178B CN 111402178 B CN111402178 B CN 111402178B CN 202010212809 A CN202010212809 A CN 202010212809A CN 111402178 B CN111402178 B CN 111402178B
- Authority
- CN
- China
- Prior art keywords
- block
- value
- gray
- current search
- values
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001914 filtration Methods 0.000 title claims abstract description 75
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000004364 calculation method Methods 0.000 claims description 27
- 238000013507 mapping Methods 0.000 abstract description 8
- 238000009499 grossing Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 239000011159 matrix material Substances 0.000 description 4
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000013215 result calculation Methods 0.000 description 1
- 230000001629 suppression Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20172—Image enhancement details
- G06T2207/20192—Edge enhancement; Edge preservation
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a non-average filtering method and a device, which realize that the intensity of non-local average filtering of CFA images is controllable and avoid resource consumption in the exponential operation process of Gaussian function mapping. The method comprises the following steps: determining a central block and a search block of the CFA image of the color filter array, wherein the number of the search blocks is at least one; the gray value of each pixel point in the center block and the current search block is obtained, and the gray value is divided into a smooth part and an unsmooth part; calculating to obtain a difference value of the smooth part of the center block and the current search block; calculating to obtain a sum SAD value of absolute value differences of corresponding points of the unsmooth parts of the center block and the current search block; obtaining a search address according to the difference value and the SAD value; obtaining a weight value of a current search block from a preset lookup table according to the lookup address, wherein the lookup address and the weight value in the preset lookup table accord with a Gaussian curve; and calculating to obtain a filtering result of the CFA image according to the gray values and the weight values of the central pixel points of the central block and all the search blocks.
Description
Technical Field
The present invention relates to the field of digital image processing, and in particular, to a non-average filtering method and a non-average filtering device.
Background
The Non-local-mean (NLM) technique is to search for surrounding similar blocks with the current point as the center, and assign different weights according to the difference of the similarity, and the gray value of the current point is obtained by the weighted average of the surrounding points.
Compared with mean value filtering, NLM can protect image edges and prevent the image from being too blurred under the condition of filtering noise to a certain extent. The weights of the center points of the general search blocks are needed to be obtained through Gaussian function printing, but the Gaussian function relates to exponential operation for hardware realization, the algorithm complexity is high, and the needed hardware resource cost is high.
Disclosure of Invention
The invention aims to provide a non-average filtering method and device, which realize the controllable intensity of non-local average filtering of CFA images and avoid the resource consumption in the exponential operation process of Gaussian function mapping.
The first aspect of the present invention provides a non-average filtering method, including:
determining a center block and a search block of the CFA image, wherein the number of the search blocks is at least one;
the gray value of each pixel point in the center block and the current search block is obtained, and the gray value is divided into a smooth part and an unsmooth part;
calculating to obtain a difference value of the smooth part of the center block and the current search block;
calculating SAD values of the unsmooth parts of the center block and the current search block;
obtaining a search address according to the difference value and the SAD value;
obtaining a weight value of a current search block from a preset lookup table according to the lookup address, wherein the lookup address and the weight value in the preset lookup table accord with a Gaussian curve;
and calculating to obtain a filtering result of the CFA image according to the gray values and the weight values of the central pixel points of the central block and all the search blocks.
Further, acquiring the gray value of each pixel point in the center block and the current search block, and dividing the gray value into a smooth portion and an unsmooth portion, including:
setting a smooth part weight value according to the noise condition of the CFA image;
acquiring gray values of each pixel point in the center block and the current search block;
the gray value is divided into a smoothed portion and an unsmooth portion according to the smoothed portion weight value.
Further, calculating a difference value between the center block and the smooth portion of the current search block includes:
calculating the sum of gray values of the smooth part of each pixel point in the center block;
calculating the sum of gray values of the smooth part of each pixel point in the current search block;
and subtracting the gray value sum of the smooth part of the current search block from the center block, and obtaining an absolute value to obtain a difference value of the smooth part of the current search block and the center block.
Further, calculating the SAD value of the unsmooth portions of the center block and the current search block includes:
determining gray values of unsmooth parts of each pixel point in the center block and the current search block;
subtracting the gray value of the unsmooth part of the corresponding pixel point in the current search block from the gray value of the unsmooth part of each pixel point of the center block, and then solving the absolute value to obtain the absolute value of the corresponding point difference of each pixel point;
and summing the absolute values of the corresponding point differences of all the pixel points to obtain SAD values of the unsmooth parts of the central block and the current search block.
Further, according to the gray value and the weight value of the central pixel point of the central block and all the search blocks, a filtering result of the CFA image is obtained by calculation, including:
calculating the sum of products of gray values and weight values of the central pixel points of the central block and all the search blocks to obtain gray sum values;
calculating the sum of the weight values of the center block and all the search blocks to obtain a weight sum value;
dividing the gray sum value by the weight sum value to obtain a filtering result.
A second aspect of the present invention provides a non-average filtering apparatus, comprising:
the determining module is used for determining a center block and a searching block of the CFA image, and the searching block is at least one;
the acquisition module is used for acquiring the gray value of each pixel point in the center block and the current search block and dividing the gray value into a smooth part and an unsmooth part;
the first calculation module is used for calculating and obtaining a difference value of the smooth part of the center block and the current search block;
a second calculation module, configured to calculate a SAD value of the central block and the unsmooth portion of the current search block;
the weight searching module is used for obtaining a searching address according to the difference value and the SAD value;
the weight searching module is further used for obtaining a weight value of the current searching block from a preset searching table according to the searching address, and the searching address and the weight value in the preset searching table accord with the Gaussian curve;
and the filtering calculation module is used for calculating and obtaining a filtering result of the CFA image according to the gray values and the weight values of the central pixel points of the central block and all the search blocks.
Further, the obtaining module includes:
a setting unit for setting a smoothed portion weight value according to a noise condition of the CFA image;
the acquisition unit is used for acquiring the gray value of each pixel point in the center block and the current search block;
and a dividing unit for dividing the gray value into a smoothed portion and an unsmooth portion according to the smoothed portion weight value.
Further, the method comprises the steps of,
a first calculation unit for calculating a sum of gray values of the smoothed portion of each pixel point in the center block;
the first calculation unit is also used for calculating the sum of gray values of the smooth part of each pixel point in the current search block;
the first calculating unit is further configured to subtract the sum of gray values of the smooth portions of the center block and the current search block, and then calculate an absolute value to obtain a difference value between the center block and the smooth portion of the current search block.
Further, the method comprises the steps of,
the second calculation unit is specifically used for determining gray values of the unsmooth parts of each pixel point in the center block and the current search block;
the second calculation unit is further used for subtracting the gray value of the unsmooth part of the corresponding pixel point in the current search block from the gray value of the unsmooth part of each pixel point of the center block, and then obtaining an absolute value to obtain the absolute value of the corresponding point difference of each pixel point;
and the second calculation unit is also used for summing the absolute values of the corresponding point differences of all the pixel points to obtain SAD values of the unsmooth parts of the central block and the current search block.
Further, the filtering calculation module includes:
the gray summing unit is used for calculating the sum of products of gray values and weight values of the central pixel points of the central block and all the search blocks to obtain gray sum values;
the weight summation unit is used for calculating the sum of the weight values of the center block and all the search blocks to obtain a weight sum value;
and the filtering calculation unit is used for dividing the gray level sum value by the weight sum value to obtain a filtering result.
Therefore, the gray value of each pixel point is divided into a smooth part and an unsmooth part, when the difference between the search block and the central block is calculated, the difference value of the smooth part and the SAD value of the unsmooth part are respectively obtained, the lookup address is obtained after the difference value and the SAD value of the unsmooth part are added, and the weight value of the current search block is obtained through a preset lookup table, so that the filtering result is obtained by utilizing the gray value and the weight value of the central pixel point of each block in the CFA image. Compared with the existing NLM technology, the addition of the smoothing part is equivalent to low-pass filtering of gray values, so that the final result is smoother, and the intensity of the non-local mean filtering can be adjusted by adjusting the smoothing part and the non-smoothing part; and searching addresses and weight values in a preset lookup table to accord with the Gaussian curve, and replacing exponential operation mapped by the Gaussian function with a lookup table mode. Therefore, the intensity of the non-local mean filtering of the CFA image is controllable, and the resource consumption in the exponential operation process of the Gaussian function mapping is avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required in the prior art and the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an embodiment of a non-average filtering method according to the present invention;
FIG. 2 is a schematic diagram of a center block and a current search block of a CFA image provided by the present invention;
FIG. 3 is a flow chart illustrating another embodiment of a non-average filtering method according to the present invention
FIG. 4 is a schematic diagram illustrating a structure of an embodiment of a non-average filtering apparatus according to the present invention;
FIG. 5 is a schematic diagram illustrating a structure of another embodiment of a non-average filtering apparatus according to the present invention;
fig. 6 is a schematic structural diagram of another embodiment of a non-average filtering apparatus according to the present invention.
Detailed Description
The core of the invention is to provide a non-average filtering method and device, which realize the controllable intensity of the non-local average filtering of CFA images and avoid the resource consumption in the exponential operation process of Gaussian function mapping.
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, an embodiment of the present invention provides a non-average filtering method, including:
101. determining a center block and a search block of the CFA image, wherein the number of the search blocks is at least one;
in this embodiment, in the image in color filter array (Color Filter Array, CFA) format, each pixel has only one component of RGB, and the existing NLM technique takes the sum of absolute values (Sum of Absolute Differences, SAD) of the corresponding point differences between the search block and the center block, and only the pixels having the same component as the center point of the center block (i.e., the center point of each search block) can be weighted. And obtaining the weight corresponding to the center point of the search block after the Gaussian function mapping. The formula adopted is:
where a controls the peak value of the gaussian and c controls the width of the gaussian, i.e. the smoothness of the gaussian. However, in the existing NLM technology, the smoothness of the Gaussian curve needs to be controlled through a variable c, so that the filtering strength of the CFA image is uncontrollable, and the Gaussian curve mapping needs to use exponential operation, so that the computational resource is occupied.
As shown in fig. 2, assuming that a 7X7 matrix is used as a search area, an R color channel is used as a center point of the matrix, a center block is a 3X3 matrix, searching all search blocks in the vicinity can obtain 8 search blocks except the center block, taking the current search block in fig. 2 as an example, the center point is also an R color channel, and the size is also a 3X3 matrix.
102. The gray value of each pixel point in the center block and the current search block is obtained, and the gray value is divided into a smooth part and an unsmooth part;
in this embodiment, the non-average filtering is actually calculated according to the gray values of the pixels, and therefore, the gray values of each pixel in the center block and the current search block need to be obtained, and the gray values are divided into a smooth portion and an unsmooth portion.
Optionally, the specific process of dividing the gray value into the smooth portion and the non-smooth portion is as follows:
setting the weight sum of the smoothing part weight w_lpf to 128 according to the noise condition of the CFA image, wherein the higher the smoothing part weight value is, the better the noise suppression condition is, but the more blurred the final CFA image is, so that the smoothing part weight value needs to be set according to the noise condition, and the specific setting value is not limited; the gray value is divided into a smooth portion and an unsmooth portion according to the smooth portion weight value,
the smoothed portion is denoted cfa_lpf= (cfa x w_lpf+64)/128;
the unsmooth portion is noted cfa_sad= [ cfa + (128-w_lpf) +64]/128.
103. Calculating to obtain a difference value of the smooth part of the center block and the current search block;
in this embodiment, after the gradation value is divided into a smoothed portion and an unsmooth portion, a difference value between the center block and the smoothed portion of the current search block is calculated, representing the difference between the center block and the entire block of the current search block.
104. Calculating SAD values of the unsmooth parts of the center block and the current search block;
in this embodiment, after dividing the gray level value into a smoothed portion and an unsmoothed portion, the SAD value of the unsmoothed portion of the center block and the current search block is calculated, and the specific meaning of the SAD value is that the difference between the gray level values of the unsmoothed portions between the corresponding points of the two blocks is summed up with the absolute value, thereby obtaining the SAD value of the unsmoothed portion.
105. Obtaining a search address according to the difference value and the SAD value;
in this embodiment, the difference value and the SAD value are added to obtain the search address. The lookup table is composed of lookup addresses and weight values conforming to Gaussian curves, so that the corresponding weight values can be found through the lookup addresses through preset setting, when the preset lookup table is generated, the value range of the lookup addresses needs to be considered, in theory, the larger the preset lookup table is, the better the value range of the lookup address is, but the larger the preset lookup table is, the larger the space needed to be stored is, and the larger the resources consumed in the lookup process are.
106. Obtaining a weight value of a current search block from a preset lookup table according to the lookup address;
in this embodiment, a preset lookup table of 64 elements is generally adopted, and the weight value and the lookup address (0-63) of the preset lookup table should conform to the gaussian curve. Because the value range of the lookup address is greater than 63, the lookup address is shifted by a certain number of bits, the specific shift being dependent on the noise condition and the edge condition of the image. So that the seek address falls between 0 and 63. Then looking up a table to obtain the weight value of the current search block;
specifically, for example, the lookup address is 10 bits, the value range is [0:1023], but the preset lookup table is only [0:63]. This time is typically done by right shifting the lookup address by 2 bits. Look-up table based on [9:2] bit ignoring the effect of the last 2 bits. Of course, the bit is made adjustable, and the bit of [8:1] of the search address is also required. It is also possible to take the values corresponding to two adjacent lookup addresses, for example, lookup address [9:2] =10, take the values of two tables of 10 and 11, and weight average the result according to the value of lookup address [1:0 ]. It should be noted that, in the specific implementation, the searching process may also be other manners, which is not limited in particular.
107. And calculating to obtain a filtering result of the CFA image according to the gray values and the weight values of the central pixel points of the central block and all the search blocks.
In this embodiment, after the weight value of the current search block is obtained by calculation, the weight values of all the search blocks can be obtained in the same manner, weighted average is performed according to the gray values and the weight values of the center pixel points of the center block and all the search blocks, and the filtering result of the CFA image is obtained by calculation.
In the embodiment of the invention, the gray value of each pixel point is divided into a smooth part and an unsmooth part, when the difference between a search block and a central block is calculated, the difference value of the smooth part and the SAD value of the unsmooth part are respectively obtained, a table lookup address is obtained after addition, and then the weight value of the current search block is obtained through a preset table lookup, so that the filtering result is obtained by utilizing the gray value and the weight value of the central pixel point of each block in the CFA image. Compared with the existing NLM technology, the addition of the smoothing part is equivalent to low-pass filtering of gray values, so that the final result is smoother, and the intensity of the non-local mean filtering can be adjusted by adjusting the smoothing part and the non-smoothing part; and searching addresses and weight values in a preset lookup table to accord with the Gaussian curve, and replacing exponential operation mapped by the Gaussian function with a lookup table mode. Therefore, the intensity of the non-local mean filtering of the CFA image is controllable, and the resource consumption in the exponential operation process of the Gaussian function mapping is avoided.
The above steps 103 and 104 may be executed simultaneously, regardless of the order of execution.
In the embodiment shown in fig. 1, the difference value of the smoothed portion, the SAD value of the unsmooth portion, and the calculation method of the filtering result are specifically described with reference to the embodiment shown in fig. 3.
As shown in fig. 3, an embodiment of the present invention provides a non-average filtering method, including:
301. determining a center block and a search block of the CFA image, wherein the number of the search blocks is at least one;
for details, please refer to step 101 of the embodiment shown in fig. 1.
302. The gray value of each pixel point in the center block and the current search block is obtained, and the gray value is divided into a smooth part and an unsmooth part;
for details, please refer to step 102 of the embodiment shown in fig. 1.
303. Calculating the sum of gray values of the smooth part of each pixel point in the center block;
in this embodiment, a pixel point cur [ i ] in the center block cur][j]The smoothed portion of the gray value of (2) is denoted cfa_lpf_cur [ i ]][j];i,j∈[0:2]Where i and j represent the locations of the pixel points in the center block cur, e.g., the pixel point of the R color channel in FIG. 2 is denoted cur [ 1]][1]Then the sum of the gray values
304. Calculating the sum of gray values of the smooth part of each pixel point in the current search block;
in this embodiment, the current search block ref is calculated in the same way as the center block cur,where x and y represent the locations of the pixels in the current search block ref, e.g., the pixels of the R color channel in the current search block ref in FIG. 2 are denoted as ref [ 1]][1]。
305. Subtracting the gray value sum of the smooth part of the current searching block from the center block, and obtaining the absolute value to obtain the difference value of the smooth part of the current searching block and the center block;
in this embodiment, the sum of gray values of the smoothed portions of the center block cur and the current search block ref is subtracted, and then the absolute value is obtained, so as to obtain a difference value sum_lpf= |sum_cur-sum_ref| of the smoothed portions of the center block and the current search block.
306. Determining gray values of unsmooth parts of each pixel point in the center block and the current search block;
in this embodiment, the gray value (cfa_sad_cur [ i ] [ j ]; i, j e [0:2 ]) of the unsmooth portion of each pixel point in the center block cur, and the gray value cfa_sad_ref [ i ] [ j ] of the unsmooth portion of each pixel point in the current search block ref are determined; i, j E [0:2].
307. Subtracting the gray value of the unsmooth part of the corresponding pixel point in the current search block from the gray value of the unsmooth part of each pixel point of the center block, and then solving the absolute value to obtain the absolute value of the corresponding point difference of each pixel point;
in this embodiment, the gray value of the unsmooth portion of each pixel point of the central block cur is subtracted from the gray value of the unsmooth portion of the corresponding pixel point in the current search block ref, and then the absolute value is obtained, so as to obtain the absolute value of the corresponding point difference of each pixel point.
308. Summing the absolute values of the corresponding point differences of all the pixel points to obtain SAD values of the unsmooth parts of the central block and the current search block;
in this embodiment, the absolute values of the corresponding point differences for all the pixels are summed to obtain the SAD value for the unsmooth portion of the center block and the current search block,
309. obtaining a search address according to the difference value and the SAD value;
in this embodiment, the difference value and the SAD value are added to obtain the search address index, index=sum_sad+sum_lpf.
310. Obtaining a weight value of a current search block from a preset lookup table according to the lookup address;
for details, please refer to step 106 of the embodiment shown in fig. 1.
311. Calculating the sum of products of gray values and weight values of the central pixel points of the central block and all the search blocks to obtain gray sum values;
in this embodiment, the gray value R [ m ] of the center pixel point of the center block and all the search blocks is calculated]The sum of the products of the weight values to obtain gray sum valuesm represents the number of the center block or the search block.
312. Calculating the sum of the weight values of the center block and all the search blocks to obtain a weight sum value;
in this embodiment, the sum of the weight values of the center block and all the search blocks is calculated
313. Dividing the gray sum value by the weight sum value to obtain a filtering result.
In this embodiment, the gray scale and the value are divided by the weight and the value, and a filtering result is obtained, result=sumpixels/sumbeelight.
In the embodiment of the invention, the difference value of the smooth part, the SAD value of the non-smooth part and the filtering result calculation mode are described in detail, so that the scheme can be implemented specifically. In the above steps, 303 and 304 are respectively the gray sum of the calculation center block and the gray sum of the search block, and 303 and 304 may be performed simultaneously, or 304 may be performed before 303 and 305. 306. 307, 308 must be performed sequentially, but the execution order of 303 and 306 is not limited, and the execution order of steps 311 and 312 is not limited.
The non-average filtering method is specifically described in the embodiments shown in fig. 1 and 3, and a non-average filtering apparatus to which the non-average filtering method is applied will be described in detail by way of embodiments.
As shown in fig. 4, an embodiment of the present invention provides a non-average filtering apparatus, including:
a determining module 401, configured to determine a center block and a search block of the color filter array CFA image, where the search block is at least one;
an obtaining module 402, configured to obtain a gray value of each pixel point in the center block and the current search block, and divide the gray value into a smooth portion and an unsmooth portion;
a first calculating module 403, configured to calculate a difference value between the center block and the smooth portion of the current search block;
a second calculation module 404, configured to calculate a sum SAD value of absolute value differences of corresponding points of the central block and the unsmooth portion of the current search block;
the weight searching module 405 is configured to obtain a searching address according to the difference value and the SAD value;
the weight searching module 405 is further configured to obtain a weight value of the current search block from a preset lookup table according to the lookup address, where the lookup address and the weight value in the preset lookup table conform to the gaussian curve;
the filtering calculation module 406 is configured to calculate a filtering result of the CFA image according to the gray values and the weight values of the center pixel points of the center block and all the search blocks.
In the embodiment of the present invention, after the determining module 401 determines the center block and the current search block in the CFA image, the obtaining module 402 divides the gray value of each pixel into a smooth portion and an unsmooth portion, when calculating the difference between the search block and the center block, the first calculating module 403 calculates to obtain the difference value of the smooth portion, the second calculating module 404 calculates to obtain the SAD value of the unsmooth portion, the weight searching module 405 obtains the table lookup address after adding, and then obtains the weight value of the current search block through the preset table lookup, and the filtering calculating module 406 obtains the filtering result by using the gray value and the weight value of the center pixel of each block in the CFA image. Compared with the existing NLM technology, the addition of the smoothing part is equivalent to low-pass filtering of gray values, so that the final result is smoother, and the intensity of the non-local mean filtering can be adjusted by adjusting the smoothing part and the non-smoothing part; and searching addresses and weight values in a preset lookup table to accord with the Gaussian curve, and replacing exponential operation mapped by the Gaussian function with a lookup table mode. Therefore, the intensity of the non-local mean filtering of the CFA image is controllable, and the resource consumption in the exponential operation process of the Gaussian function mapping is avoided.
Optionally, in combination with the embodiment shown in fig. 4, as shown in fig. 5, in some embodiments of the present invention, the obtaining module 402 includes:
a setting unit 501 for setting a smoothed portion weight value according to a noise condition of the CFA image;
an obtaining unit 502, configured to obtain gray values of each pixel point in the center block and the current search block;
a dividing unit 503 for dividing the gray value into a smoothed portion and an unsmooth portion according to the smoothed portion weight value.
In the embodiment of the present invention, the setting unit 501 of the obtaining module 402 sets the weight value of the smooth portion according to the noise condition, the obtaining unit 502 obtains the gray value of each pixel point in the center block and the current search block, and the dividing unit 503 divides the gray value into a smooth portion and an unsmooth portion according to the weight value of the smooth portion, so that the gray value is divided, and the smooth portion and the unsmooth portion facilitate the intensity adjustment of the non-average filtering.
Alternatively, in connection with the embodiment shown in fig. 5, in some embodiments of the invention,
a first calculating unit 403, specifically configured to calculate a sum of gray values of the smoothed portion of each pixel point in the center block;
the first calculating unit 403 is further configured to calculate a sum of gray values of the smoothed portion of each pixel point in the current search block;
the first calculating unit 403 is further configured to subtract the sum of gray values of the smooth portions of the center block and the current search block, and then calculate an absolute value to obtain a difference value between the center block and the smooth portion of the current search block.
In the embodiment of the present invention, the process of specifically calculating the difference value of the smoothed portion by the first calculating unit 403 is described, and the details refer to steps 303-305 of the embodiment shown in fig. 3.
Alternatively, in connection with the embodiment shown in fig. 5, in some embodiments of the invention,
a second calculating unit 404, configured to determine gray values of the unsmooth portions of each pixel point in the center block and the current search block;
the second calculating unit 404 is further configured to subtract the gray value of the unsmooth portion of the corresponding pixel in the current search block from the gray value of the unsmooth portion of each pixel in the center block, and calculate an absolute value to obtain a corresponding point difference absolute value of each pixel;
the second calculating unit 404 is further configured to sum the absolute values of the corresponding point differences of all the pixels to obtain a SAD value of the unsmooth portion of the center block and the current search block.
In the embodiment of the present invention, the process of calculating the SAD value of the unsmooth portion by the second calculating unit 404 is described specifically, and the details refer to steps 306-308 of the embodiment shown in fig. 3.
Optionally, in conjunction with the embodiment shown in fig. 5, as shown in fig. 6, in some embodiments of the present invention, the filtering calculation module 406 includes:
the gray summing unit 601 is configured to calculate the sum of products of gray values and weight values of the center pixel points of the center block and all the search blocks, so as to obtain a gray sum value;
a weight summation unit 602, configured to calculate a sum of weight values of the center block and all the search blocks, to obtain a weight sum value;
the filtering calculation unit 603 is configured to divide the gray sum value by the weight sum value to obtain a filtering result.
In the embodiment of the present invention, the gray summing unit 601 in the filtering calculation module 406 calculates the sum of products of gray values and weight values of the center pixel points of the center block and all the search blocks to obtain gray sum values; the weight summation unit 602 calculates the sum of the weight values of the center block and all the search blocks to obtain a weight sum value; the filtering calculation unit 603 divides the gray scale sum value by the weight sum value to obtain a filtering result.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A method of non-average filtering, comprising:
determining a central block and search blocks of a color filter array CFA image, wherein at least one search block is arranged;
acquiring gray values of each pixel point in the center block and the current search block, and dividing the gray values into a smooth part and an unsmooth part;
calculating to obtain a difference value of the smooth part of the center block and the current search block;
calculating to obtain a sum SAD value of absolute value differences of corresponding points of the unsmooth parts of the central block and the current search block;
obtaining a search address according to the difference value and the SAD value;
obtaining a weight value of the current search block from a preset lookup table according to the lookup address, wherein the lookup address and the weight value in the preset lookup table accord with a Gaussian curve;
and calculating to obtain a filtering result of the CFA image according to the gray values and the weight values of the central pixel points of the central block and all the search blocks.
2. The method of claim 1, wherein the obtaining the gray value of each pixel point in the center block and the current search block, and dividing the gray value into a smoothed portion and an unsmooth portion, comprises:
setting a smooth part weight value according to the noise condition of the CFA image;
acquiring gray values of each pixel point in the center block and the current search block;
the gray scale value is divided into a smoothed portion and an unsmooth portion according to the smoothed portion weight value.
3. The method of claim 2, wherein said calculating a difference value of the smoothed portion of the center block and the current search block comprises:
calculating the sum of gray values of the smooth part of each pixel point in the center block;
calculating the sum of gray values of the smooth part of each pixel point in the current search block;
and subtracting the sum of gray values of the smooth parts of the central block and the current search block, and obtaining an absolute value to obtain a difference value of the smooth parts of the central block and the current search block.
4. The method of claim 2, wherein said calculating a SAD value for the center block and the unsmoothed portion of the current search block comprises:
determining the gray value of an unsmooth part of each pixel point in the center block and the current search block;
subtracting the gray value of the unsmooth part of the corresponding pixel point in the current search block from the gray value of the unsmooth part of each pixel point of the central block, and then solving the absolute value to obtain the absolute value of the corresponding point difference of each pixel point;
and summing the absolute values of the corresponding point differences of all the pixel points to obtain the SAD value of the unsmooth part of the central block and the current search block.
5. The method according to any one of claims 1-4, wherein the calculating the filtering result of the CFA image according to the center pixel gray values and the weight values of the center block and all the search blocks includes:
calculating the sum of products of gray values and weight values of the central pixel points of the central block and all the search blocks to obtain gray sum values;
calculating the sum of the weight values of the center block and all the search blocks to obtain a weight sum value;
and dividing the gray sum value by the weight sum value to obtain a filtering result.
6. A non-average filtering apparatus, comprising:
the determining module is used for determining a center block and a searching block of the CFA image of the color filter array, and the searching block is at least one;
the acquisition module is used for acquiring the gray value of each pixel point in the center block and the current search block and dividing the gray value into a smooth part and an unsmooth part;
the first calculation module is used for calculating and obtaining a difference value of the smooth part of the center block and the current search block;
a second calculation module, configured to calculate a sum SAD value of absolute value differences between corresponding points of the central block and the unsmooth portion of the current search block;
the weight searching module is used for obtaining a searching address according to the difference value and the SAD value;
the weight searching module is further configured to obtain a weight value of the current search block from a preset lookup table according to the searching address, where the searching address and the weight value in the preset lookup table conform to a gaussian curve;
and the filtering calculation module is used for calculating and obtaining a filtering result of the CFA image according to the gray values and the weight values of the central pixel points of the central block and all the search blocks.
7. The apparatus of claim 6, wherein the acquisition module comprises:
a setting unit configured to set a smoothed portion weight value according to a noise condition of the CFA image;
an obtaining unit, configured to obtain a gray value of each pixel point in the center block and the current search block;
and the dividing unit is used for dividing the gray value into a smooth part and an unsmooth part according to the weight value of the smooth part.
8. The apparatus of claim 7, wherein the device comprises a plurality of sensors,
the first calculating unit is specifically configured to calculate a sum of gray values of the smoothed portion of each pixel point in the center block;
the first calculating unit is further configured to calculate a sum of gray values of the smoothed portion of each pixel point in the current search block;
the first calculation unit is further configured to subtract the sum of gray values of the smooth portions of the center block and the current search block, and calculate an absolute value to obtain a difference value between the center block and the smooth portion of the current search block.
9. The apparatus of claim 7, wherein the device comprises a plurality of sensors,
the second calculating unit is specifically configured to determine gray values of the unsmooth portions of each pixel point in the center block and the current search block;
the second calculating unit is further configured to subtract the gray value of the unsmooth portion of the corresponding pixel in the current search block from the gray value of the unsmooth portion of each pixel in the center block, and calculate an absolute value to obtain a corresponding point difference absolute value of each pixel;
and the second calculation unit is further used for summing the absolute values of the corresponding point differences of all the pixel points to obtain SAD values of the unsmooth parts of the central block and the current search block.
10. The apparatus according to any one of claims 6-9, wherein the filter calculation module comprises:
the gray summing unit is used for calculating the sum of products of gray values and weight values of the central pixel points of the central block and all the search blocks to obtain gray sum values;
the weight summation unit is used for calculating the sum of the weight values of the center block and all the search blocks to obtain a weight sum value;
and the filtering calculation unit is used for dividing the gray level sum value by the weight sum value to obtain a filtering result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010212809.6A CN111402178B (en) | 2020-03-24 | 2020-03-24 | Non-average filtering method and non-average filtering device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010212809.6A CN111402178B (en) | 2020-03-24 | 2020-03-24 | Non-average filtering method and non-average filtering device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111402178A CN111402178A (en) | 2020-07-10 |
CN111402178B true CN111402178B (en) | 2023-06-02 |
Family
ID=71431157
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010212809.6A Active CN111402178B (en) | 2020-03-24 | 2020-03-24 | Non-average filtering method and non-average filtering device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111402178B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115372933A (en) * | 2022-08-31 | 2022-11-22 | 深圳市欢创科技有限公司 | Stray light filtering method and device and laser radar |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103745447A (en) * | 2014-02-17 | 2014-04-23 | 东南大学 | Fast parallel achieving method for non-local average filtering |
CN103927737A (en) * | 2013-10-31 | 2014-07-16 | 王浩然 | SAR image change detecting method based on non-local mean |
CN104809705A (en) * | 2015-04-29 | 2015-07-29 | 厦门美图之家科技有限公司 | Image denoising method and system based on threshold value block matching |
CN107025640A (en) * | 2017-04-28 | 2017-08-08 | 南京觅踪电子科技有限公司 | The Medical Image Denoising method of non-local mean based on optimization |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5315158B2 (en) * | 2008-09-12 | 2013-10-16 | キヤノン株式会社 | Image processing apparatus and image processing method |
-
2020
- 2020-03-24 CN CN202010212809.6A patent/CN111402178B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103927737A (en) * | 2013-10-31 | 2014-07-16 | 王浩然 | SAR image change detecting method based on non-local mean |
CN103745447A (en) * | 2014-02-17 | 2014-04-23 | 东南大学 | Fast parallel achieving method for non-local average filtering |
CN104809705A (en) * | 2015-04-29 | 2015-07-29 | 厦门美图之家科技有限公司 | Image denoising method and system based on threshold value block matching |
CN107025640A (en) * | 2017-04-28 | 2017-08-08 | 南京觅踪电子科技有限公司 | The Medical Image Denoising method of non-local mean based on optimization |
Non-Patent Citations (1)
Title |
---|
张书豪.一种改进权重的非局部均值滤波算法.《信息通信》.2017,第1-3页. * |
Also Published As
Publication number | Publication date |
---|---|
CN111402178A (en) | 2020-07-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109191395A (en) | Method for enhancing picture contrast, device, equipment and storage medium | |
JP5469209B2 (en) | Luminance conversion curve creation device and method, and brightness conversion curve creation program | |
JP6052902B2 (en) | Methods for processing highlight and saturation areas in digital images | |
EP1368960A2 (en) | Digital image appearance enhancement and compressibility improvement method and system | |
CN101409783B (en) | Image processing filter, image processing method, and image processing circuit | |
US8406559B2 (en) | Method and system for enhancing image sharpness based on local features of image | |
CN107993189B (en) | Image tone dynamic adjustment method and device based on local blocking | |
WO2007036853A2 (en) | Image detail enhancement | |
CN109599054A (en) | The control method and device of display panel brightness | |
US20080278762A1 (en) | Image forming apparatus and method thereof | |
CN111402178B (en) | Non-average filtering method and non-average filtering device | |
US20160343113A1 (en) | System for enhanced images | |
US7289666B2 (en) | Image processing utilizing local color correction and cumulative histograms | |
US7978910B2 (en) | Method and apparatus for adaptively filtering input image in color domains | |
JP4536015B2 (en) | Luminance conversion curve creation device and method, and brightness conversion curve creation program | |
US8265419B2 (en) | Image processing apparatus and image processing method | |
US20050078884A1 (en) | Method and apparatus for interpolating a digital image | |
US7437020B2 (en) | Digital image processing device and method | |
JP5365878B2 (en) | Filter device and filtering method | |
KR100900678B1 (en) | Image quality enhancement method using dynamic range segmentation | |
KR102303666B1 (en) | Method of image processing, image processor performing the method and display device having the image processor | |
JP4708866B2 (en) | Lookup table creation device and method, and lookup table creation program | |
CN103137098A (en) | Tone corresponding method and imaging processing device | |
JP2986625B2 (en) | Skin color detection circuit and imaging device | |
JP4805590B2 (en) | Image processing apparatus and image processing program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |