CN111402178A - Non-mean filtering method and non-mean filtering device - Google Patents

Non-mean filtering method and non-mean filtering device Download PDF

Info

Publication number
CN111402178A
CN111402178A CN202010212809.6A CN202010212809A CN111402178A CN 111402178 A CN111402178 A CN 111402178A CN 202010212809 A CN202010212809 A CN 202010212809A CN 111402178 A CN111402178 A CN 111402178A
Authority
CN
China
Prior art keywords
block
value
gray
current search
sum
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.)
Granted
Application number
CN202010212809.6A
Other languages
Chinese (zh)
Other versions
CN111402178B (en
Inventor
陈鹤林
王海波
曾纪国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Goke Microelectronics Co ltd
Original Assignee
Chengdu Goke Microelectronics Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chengdu Goke Microelectronics Co ltd filed Critical Chengdu Goke Microelectronics Co ltd
Priority to CN202010212809.6A priority Critical patent/CN111402178B/en
Publication of CN111402178A publication Critical patent/CN111402178A/en
Application granted granted Critical
Publication of CN111402178B publication Critical patent/CN111402178B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration by the use of local operators
    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20192Edge enhancement; Edge preservation

Abstract

The invention discloses a non-mean filtering method and a non-mean filtering device, which realize the controllable intensity of non-local mean filtering of a CFA image and avoid the resource consumption in the exponential operation process of Gaussian function mapping. The method comprises the following steps: determining a center block and a search block of a color filter array CFA image, wherein at least one search block is used; acquiring the gray value of each pixel point in the central block and the current search block, and dividing the gray value into a smooth part and an unsmooth part; calculating to obtain a difference value between the central block and the smooth part of the current search block; calculating to obtain the SAD value of the sum of absolute value differences of corresponding points of the central block and the unsmooth part of the current search block; obtaining a search address according to the difference value and the SAD value; obtaining a weighted value of the current search block from a preset lookup table according to the lookup address, wherein the lookup address and the weighted value in the preset lookup table conform to 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 center pixel points of the center block and all the search blocks.

Description

Non-mean filtering method and non-mean filtering device
Technical Field
The present invention relates to the field of digital image processing, and in particular, to a non-mean filtering method and a non-mean filtering apparatus.
Background
The Non-local-mean (N L M) technique searches for similar blocks around a current point as a center, and gives different weights according to different degrees of similarity, and the gray value of the current point is obtained by weighted averaging of surrounding points.
Generally, the weight of the center point of the search block needs to be obtained through Gaussian function printing, but the Gaussian function relates to exponential operation for hardware implementation, the algorithm complexity is high, and the required hardware resource overhead is also high.
Disclosure of Invention
The invention aims to provide a non-mean filtering method and a non-mean filtering device, which realize the controllable strength of the non-local mean filtering of a CFA image and avoid the resource consumption in the exponential operation process of Gaussian function mapping.
The first aspect of the present invention provides a non-mean 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;
acquiring the gray value of each pixel point in the central block and the current search block, and dividing the gray value into a smooth part and an unsmooth part;
calculating to obtain a difference value between the central block and the smooth part of the current search block;
calculating to obtain SAD values 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 weighted value of the current search block from a preset lookup table according to the lookup address, wherein the lookup address and the weighted value in the preset lookup table conform to 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 center pixel points of the center block and all the search blocks.
Further, acquiring a 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, including:
setting a smooth part weight value according to the noise condition of the CFA image;
acquiring the gray value of each pixel point in the central block and the current search block;
the gray values are divided into smooth and non-smooth portions according to the smooth portion weight values.
Further, calculating a difference value between the center block and the smooth part of the current search block includes:
calculating the sum of the gray values of the smooth part of each pixel point in the central block;
calculating the sum of the gray values of the smooth part of each pixel point in the current search block;
and subtracting the sum of the gray values of the smooth parts of the central block and the current search block, and solving an absolute value to obtain a difference value between the central block and the smooth part of the current search block.
Further, calculating the SAD value of the center block and the unsmoothed portion of the current search block includes:
determining the gray values of the unsmooth parts of each pixel point in the central 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 solving an absolute value to obtain a corresponding point difference absolute value 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.
Further, according to the gray values and the weight values of the center pixel points of the center block and all the search blocks, a filtering result of the CFA image is obtained by calculation, which includes:
calculating the sum of products of gray values and weighted values of central pixel points of the central block and all the search blocks to obtain a gray sum value;
calculating the sum of the weighted values of the center block and all the search blocks to obtain a weighted sum value;
and 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-mean filtering apparatus, including:
the determining module is used for determining a center block and a search block of the CFA image, wherein the number of the search blocks is at least one;
the acquisition module is used for acquiring the gray value of each pixel point in the central 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 between the central block and the smooth part of the current search block;
the second calculation module is used for calculating and obtaining SAD values of the unsmooth parts of the central block and 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 also used for obtaining the 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 a Gaussian curve;
and the filtering calculation module is used for 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, the obtaining module includes:
a setting unit for setting a smooth part 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 central 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.
Further, in the above-mentioned case,
the first calculation unit is specifically used for calculating the sum of the gray values of the smooth parts of all the pixel points in the central block;
the first calculation unit is also used for calculating the sum of the 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 the 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, in the above-mentioned case,
the second calculation unit is specifically used for determining the gray values of the unsmooth parts of all the pixel points in the central block and the current search block;
the second calculation unit is also 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 central block, and then solving an absolute value to obtain a corresponding point difference absolute value of each pixel point;
and the second calculating unit is also used for 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 searching block.
Further, the filter calculation module includes:
the gray summation unit is used for calculating the sum of products of gray values and weighted values of central pixel points of the central block and all the search blocks to obtain a gray sum value;
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 sum value by the weight sum value to obtain a filtering result.
Compared with the prior N L M technology, the addition of the smoothing part is equivalent to low-pass filtering on the gray value, so that the final result is smoother, the intensity of non-local mean filtering can be adjusted by adjusting the smoothing part and the non-smoothing part, and the searching address and the weighted value in the preset lookup table conform to a Gaussian curve, so that the intensity of the non-local mean filtering of the CFA image is controlled, 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 in the embodiments of the present invention, the drawings needed in the prior art and the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flow chart illustrating a non-mean filtering method according to an embodiment of 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-mean filtering method according to the present invention
FIG. 4 is a schematic structural diagram of a non-mean filtering apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of another embodiment of a non-mean filtering apparatus provided in the present invention;
fig. 6 is a schematic structural diagram of a non-mean filtering apparatus according to another embodiment of the present invention.
Detailed Description
The core of the invention is to provide a non-mean filtering method and a non-mean filtering device, which realize the controllable strength of the non-local mean filtering of the CFA image and avoid the resource consumption in the exponential operation process of Gaussian function mapping.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the invention provides a non-mean 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 an image in a Color Filter Array (CFA) format, each pixel point has only one component of RGB, and the existing N L M technique is to take the Sum of Absolute values (SAD) of Differences between corresponding points between a search block and a central block, and only take pixels having the same component as the central point of the central block (i.e., the central point of each search block) during weighting.
Figure BDA0002423390490000051
However, in the existing N L M technology, the smoothness of the gaussian curve needs to be controlled by a variable c, so that the filtering strength of the CFA image is not controllable, and the gaussian curve mapping needs to use exponential operation, which occupies computing resources.
As shown in fig. 2, assuming that a matrix of 7X7 is used as a search area, an R color channel is used as a center point of the matrix, a center block is a matrix of 3X3, all search blocks nearby are searched, and 8 search blocks other than the center block can be obtained in total, taking the current search block in fig. 2 as an example, the center point of the current search block is also an R color channel, and the size of the current search block is also a matrix of 3X 3.
102. Acquiring the gray value of each pixel point in the central block and the current search block, and dividing the gray value into a smooth part and an unsmooth part;
in this embodiment, the non-mean filtering actually needs to be calculated according to the gray values of the pixels, so that the gray values of each pixel in the central block and the current search block need to be obtained, and the gray values are divided into a smooth part and an unsmooth part.
Optionally, the specific process of dividing the smooth part and the unsmooth part by the gray value is as follows:
setting a weight value of a smooth part according to the noise condition of the CFA image, for example, setting the weight sum of the weight w _ lpf of the smooth part to 128, wherein generally, the higher the weight value of the smooth part is, the better the noise suppression condition is, but the more blurred the CFA image is, so that the CFA image needs to be set according to the noise condition, and the specific setting value is not limited; the gray values are divided into smooth and non-smooth portions according to the smooth portion weight values,
the smoothed fraction is denoted as cfa _ lpf (cfa × w _ lpf + 64)/128;
the unsmoothed fraction is denoted as cfa _ sad [ cfa (128-w _ lpf) +64 ]/128.
103. Calculating to obtain a difference value between the central block and the smooth part of the current search block;
in this embodiment, after the gray value is divided into the smoothed part and the unsmoothed part, the difference value between the center block and the smoothed part of the current search block is calculated, which indicates the difference between the center block and the whole block of the current search block.
104. Calculating to obtain SAD values of the unsmooth parts of the central block and the current search block;
in this embodiment, after the gray value is divided into the smooth part and the unsmooth part, the SAD value of the unsmooth part of the center block and the current search block is calculated, and the SAD value specifically means that the sum of absolute values is obtained by subtracting the gray value of the unsmooth part between corresponding points of two blocks, so as to obtain the SAD value of the unsmooth part.
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 weighted values which accord with Gaussian curves, so that corresponding weighted values can be found through the lookup addresses through preset setting, when a preset lookup table is generated, the value range of the lookup addresses needs to be considered, theoretically, the larger the preset lookup table is, the better the value range of the lookup addresses is, and the better the value range of the lookup addresses is, but the larger the preset lookup table is, the larger the space needing to be stored is, and the larger the resources consumed in the lookup process are.
106. Obtaining the weight value of the current search block from a preset lookup table according to the lookup address;
in this embodiment, a preset lookup table with 64 elements is usually adopted, and the weight values and lookup addresses (0-63) of the preset lookup table should conform to a gaussian curve. Since the value range of the search address is larger than 63, the search address is shifted by a certain number of bits, and the specific shift is determined according to the noise condition and the edge condition of the image. So that the lookup 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 field is [0:1023], but the preset lookup table is only [0:63 ]. This time it is common practice to shift the lookup address to the right by 2 bits. Look-up tables are looked up based on [9:2] bits, ignoring the effect of the last 2 bits. Of course, the adjustable value can be set to [8:1] bit of the search address. It is also possible to take the values corresponding to two adjacent lookup addresses, for example, 10 for the lookup address [9:2], and 10 and 11 for the table values, and as a result, the weighted average is performed according to the values of the lookup addresses [1:0 ]. It should be noted that, in the specific implementation, the search process may also be in other manners, and is not particularly limited.
107. And calculating to obtain 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 this embodiment, after the weighted values of the current search block are obtained through calculation, the weighted values of all the search blocks can be obtained in the same manner, weighted averaging is performed according to the gray values of the center block and the center pixel points of all the search blocks and the weighted values, and a filtering result of the CFA image is obtained through calculation.
Compared with the prior N L M technology, the addition of the smoothing part is equivalent to low-pass filtering on the gray value, so that the final result is smoother, the intensity of non-local mean filtering can be adjusted by adjusting the smoothing part and the non-smoothing part, and the searching address and the weighted value in the preset lookup table conform to a Gaussian curve, so that the intensity of the non-local mean filtering of the CFA image is controlled, and the resource consumption in the exponential operation process of the Gaussian function mapping is avoided.
The execution order of step 103 and step 104 is not divided into front and back, and may be executed simultaneously.
With reference to the embodiment shown in fig. 1, the calculation methods of the difference values of the smooth portions, the SAD values of the non-smooth portions, and the filtering results will be 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-mean 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;
please refer to step 101 of the embodiment shown in fig. 1 for details.
302. Acquiring the gray value of each pixel point in the central block and the current search block, and dividing the gray value into a smooth part and an unsmooth part;
please refer to step 102 of the embodiment shown in fig. 1 for details.
303. Calculating the sum of the gray values of the smooth part of each pixel point in the central block;
in this embodiment, a pixel cur [ i ] in the central block cur][j]Is given as cfa _ lpf _ cur [ i][j];i,j∈[0:2]Where i and j denote the positions of the pixels in the central block cur, e.g. the pixel of the R color channel in FIG. 2 is denoted cur [ 1]][1]Then sum of gray values
Figure BDA0002423390490000081
304. Calculating the sum of the 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 manner as the center block cur,
Figure BDA0002423390490000082
where x and y denote the positions of the pixels in the current search block ref, e.g., the pixel of the R color channel in the current search block ref in FIG. 2 is denoted as ref [ 1]][1]。
305. Subtracting the sum of the gray values of the smooth parts of the central block and the current search block, and solving an absolute value to obtain a difference value of the smooth parts of the central block and the current search block;
in this embodiment, the sum of the gray values of the smooth portions of the central block cur and the current search block ref is subtracted, and then the absolute value is obtained, so as to obtain a difference sum _ lpf between the central block cur and the smooth portion of the current search block ref.
306. Determining the gray values of the unsmooth parts of each pixel point in the central block and the current search block;
in this embodiment, the gray scale values (cfa _ sad _ cur [ i ] [ j ]; i, j ∈ [0:2]) of the unsmoothed portion of each pixel in the center block cur and the gray scale values cfa _ sad _ ref [ i ] [ j ]; i, j ∈ [0:2] of the unsmoothed portion of each pixel in the current search block ref are determined.
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 central block, and solving an absolute value to obtain a corresponding point difference absolute value 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 to obtain the absolute value of the difference between the corresponding points of each pixel point.
308. 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;
in this embodiment, the absolute values of the corresponding point differences of all the pixels are summed to obtain the SAD value of the unsmooth part of the center block and the current search block,
Figure BDA0002423390490000091
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 a lookup address index, which is sum _ SAD + sum _ lpf.
310. Obtaining the weight value of the current search block from a preset lookup table according to the lookup address;
refer to step 106 of the embodiment shown in FIG. 1 for details.
311. Calculating the sum of products of gray values and weighted values of central pixel points of the central block and all the search blocks to obtain a gray sum value;
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 weighted values is obtained to obtain a gray sum value
Figure BDA0002423390490000092
m denotes the number of the center block or the search block.
312. Calculating the sum of the weighted values of the center block and all the search blocks to obtain a weighted sum value;
in this embodiment, the sum of the weight values of the center block and all the search blocks is calculated
Figure BDA0002423390490000093
313. And dividing the gray sum value by the weight sum value to obtain a filtering result.
In this embodiment, the grayscale sum is divided by the weight sum to obtain a filtering result, which is summixels/sumWeights.
In the embodiment of the invention, the difference value of the smooth part, the SAD value of the unsmooth 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 to calculate the gray scale of the center block and the gray scale of the search block, and 303 and 304 may be performed simultaneously, or 304 may be performed before 303, or 305. 306. 307, 308 must be executed in sequence, but the execution sequence of 303 and 306 is not limited, and the execution sequence of 311 and 312 is not limited.
The non-mean filtering method is specifically described in the embodiments shown in fig. 1 and fig. 3, and the non-mean filtering apparatus to which the non-mean filtering method is applied is described in detail by the embodiments below.
As shown in fig. 4, an embodiment of the present invention provides a non-mean filtering apparatus, including:
a determining module 401, configured to determine a center block and a search block of a color filter array CFA image, where the number of the search blocks 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 part and an unsmooth part;
a first calculating module 403, configured to calculate a difference value between the central block and a smooth portion of the current search block;
a second calculating module 404, configured to calculate a sum SAD value of absolute difference values of corresponding points of the central block and the unsmooth part of the current search block;
a weight search module 405, configured to obtain a search 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 search address, where the search address and the weight value in the preset lookup table conform to a gaussian curve;
and 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 invention, after a determining module 401 determines a central block and a current search block in a CFA image, an obtaining module 402 divides a gray value of each pixel point into a smooth part and an unsmooth part, when the difference between the search block and the central block is calculated, a first calculating module 403 calculates a difference value of the smooth part, a second calculating module 404 calculates an SAD value of the unsmooth part, a weight searching module 405 adds the SAD values to obtain a table look-up address, a preset look-up table is used for obtaining a weight value of the current search block, a filtering calculating module 406 obtains a filtering result by using the gray value and the weight value of the central pixel point of each block in the CFA image.
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, configured to set a smooth part weight value according to a noise condition of the CFA image;
an obtaining unit 502, configured to obtain a gray value of each pixel point in the center block and the current search block;
a dividing unit 503 for dividing the gray value into a smooth part and an unsmooth part according to the smooth part 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 part 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 the smooth part and the unsmooth part according to the weight value of the smooth part, so as to realize division of the gray value, and the smooth part and the unsmooth part facilitate strength adjustment of non-mean filtering.
Alternatively, in conjunction 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 smooth portions of each pixel point in the central block;
the first calculating unit 403 is further configured to calculate a sum of gray values of the smooth portions of each pixel point in the current search block;
the first calculating unit 403 is further configured to subtract the sum of the 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, a process of specifically calculating the difference value of the smooth part by the first calculating unit 403 is described, and please refer to step 303-305 of the embodiment shown in fig. 3 for details.
Alternatively, in conjunction with the embodiment shown in fig. 5, in some embodiments of the invention,
a second calculating unit 404, specifically configured to determine a gray value of an unsmooth portion 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 point in the current search block from the gray value of the unsmooth portion of each pixel point of the center block, and then calculate an absolute value to obtain a corresponding point difference absolute value of each pixel point;
the second calculating unit 404 is further configured to sum absolute values of differences between corresponding points of all the pixels to obtain SAD values of the central block and the unsmooth portion of the current search block.
In the embodiment of the present invention, the process of specifically calculating the SAD value of the unsmooth section by the second calculating unit 404 is described, please refer to step 306 and step 308 of the embodiment shown in fig. 3 in detail.
Optionally, in combination 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:
a gray summation unit 601, configured to calculate the sum of products of gray values and weighted values of central pixels of the central block and all 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 search blocks to obtain a weight sum value;
and a filter calculation unit 603 configured to divide the grayscale sum by the weight sum to obtain a filter result.
In the embodiment of the present invention, the gray summation unit 601 in the filtering calculation module 406 first calculates the sum of products of gray values and weighted values of central pixel points of the central block and all the search blocks to obtain a gray sum value; 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 filter calculation unit 603 divides the grayscale sum by the weight sum to obtain a filter result.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
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 an … …" does not exclude the presence of other identical 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 non-mean filtering method, comprising:
determining a center block and at least one search block of a Color Filter Array (CFA) image;
acquiring the gray value of each pixel point in the central block and the current search block, and dividing the gray value into a smooth part and an unsmooth part;
calculating to obtain a difference value between the smooth part of the central block and the smooth part of the current search block;
calculating to obtain the SAD value of the sum of absolute value differences of corresponding points of the central block and the unsmooth part of 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 conform to 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 center pixel points of the center block and all the search blocks.
2. The method of claim 1, wherein the obtaining a 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 comprises:
setting a smooth part weight value according to the noise condition of the CFA image;
acquiring the gray value of each pixel point in the central block and the current search block;
and dividing the gray value into a smooth part and an unsmooth part according to the smooth part weight value.
3. The method of claim 2, wherein the calculating a difference value between the center block and the smooth portion of the current search block comprises:
calculating the sum of the gray values of the smooth part of each pixel point in the central block;
calculating the sum of the gray values of the smooth part of each pixel point in the current search block;
and subtracting the sum of the gray values of the smooth parts of the central block and the current search block, and solving an absolute value to obtain a difference value between the central block and the smooth part of the current search block.
4. The method of claim 2, wherein the calculating the SAD value of the center block and the unsmoothed portion of the current search block comprises:
determining the gray value of the unsmooth part of each pixel point in the central 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 solving an absolute value to obtain a corresponding point difference absolute value 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 to 4, wherein the calculating 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 includes:
calculating the sum of products of gray values and weighted values of the center blocks and the center pixel points of all the search blocks to obtain a gray sum value;
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-mean filtering apparatus, comprising:
the determining module is used for determining a center block and at least one searching block of the color filter array CFA image;
the acquisition module is used for acquiring the gray value of each pixel point in the central 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 between the central block and the smooth part of the current search block;
the second calculation module is used for calculating and obtaining the SAD value of the sum of the absolute value differences of corresponding points of the central block and the unsmooth part 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 search address, where the search address and the weight value in the preset lookup table conform to a gaussian curve;
and the filtering calculation module is used for 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.
7. The apparatus of claim 6, wherein the obtaining module comprises:
a setting unit, configured to set a smooth part 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 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,
the first calculating unit is specifically configured to calculate a sum of gray values of a smooth portion of each pixel point in the central block;
the first calculating unit is further configured to calculate a sum of gray values of a smooth portion of each pixel point in the current search block;
the first calculating unit is further configured to subtract the sum of the gray values of the smooth part 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 part of the current search block.
9. The apparatus of claim 7,
the second calculating unit is specifically configured to determine a gray value of an unsmooth portion 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 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 calculate an absolute value to obtain a corresponding point difference absolute value of each pixel point;
the second calculating unit is further configured to sum absolute values of differences between corresponding points of all the pixels to obtain SAD values of the unsmooth portions of the center 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 summation unit is used for calculating the sum of products of gray values and weighted values of central pixel points of the central block and all the search blocks to obtain a gray sum value;
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 sum value by the weight sum value to obtain a filtering result.
CN202010212809.6A 2020-03-24 2020-03-24 Non-average filtering method and non-average filtering device Active CN111402178B (en)

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 true CN111402178A (en) 2020-07-10
CN111402178B 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)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100066868A1 (en) * 2008-09-12 2010-03-18 Canon Kabushiki Kaisha Image processing apparatus and method of processing image
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100066868A1 (en) * 2008-09-12 2010-03-18 Canon Kabushiki Kaisha Image processing apparatus and method of processing image
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)

* Cited by examiner, † Cited by third party
Title
张书豪: "一种改进权重的非局部均值滤波算法" *

Also Published As

Publication number Publication date
CN111402178B (en) 2023-06-02

Similar Documents

Publication Publication Date Title
CN109191395B (en) Image contrast enhancement method, device, equipment and storage medium
JP6052902B2 (en) Methods for processing highlight and saturation areas in digital images
EP1368960A2 (en) Digital image appearance enhancement and compressibility improvement method and system
US8406559B2 (en) Method and system for enhancing image sharpness based on local features of image
US8248662B2 (en) Image forming apparatus and method thereof
CN107993189B (en) Image tone dynamic adjustment method and device based on local blocking
US20160343113A1 (en) System for enhanced images
US20060182364A1 (en) System and method for sharpening vector-valued digital images
US9761003B2 (en) Stereo image depth map generation device and method
CN106683063A (en) Method and device of image denoising
CN112819721A (en) Method and system for reducing noise of image color noise
CN107808404A (en) Image processing method, system, readable storage medium storing program for executing and dollying equipment
CN110827212A (en) Image restoration method based on overlapping combination sparse high-order total variation
US7978910B2 (en) Method and apparatus for adaptively filtering input image in color domains
US8265419B2 (en) Image processing apparatus and image processing method
US20050078884A1 (en) Method and apparatus for interpolating a digital image
CN111402178A (en) Non-mean filtering method and non-mean filtering device
KR101101434B1 (en) Apparatus for improving sharpness of image
JP2003234901A (en) Image processing apparatus and image processing method
US7437020B2 (en) Digital image processing device and method
JP5558431B2 (en) Image processing apparatus, method, and program
JPH04297962A (en) Method and apparatus for emphasizing image
CN112200730B (en) Image filtering processing method, device, equipment and storage medium
Zhou et al. Color images enhancement for edge information protection based on second order Taylor series expansion approximation
JP2006031682A (en) Lookup table creation device, method and 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