CN108122214B - Method and device for removing false color - Google Patents

Method and device for removing false color Download PDF

Info

Publication number
CN108122214B
CN108122214B CN201711433473.0A CN201711433473A CN108122214B CN 108122214 B CN108122214 B CN 108122214B CN 201711433473 A CN201711433473 A CN 201711433473A CN 108122214 B CN108122214 B CN 108122214B
Authority
CN
China
Prior art keywords
color channel
value
channel component
pixel
color
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
Application number
CN201711433473.0A
Other languages
Chinese (zh)
Other versions
CN108122214A (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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201711433473.0A priority Critical patent/CN108122214B/en
Publication of CN108122214A publication Critical patent/CN108122214A/en
Application granted granted Critical
Publication of CN108122214B publication Critical patent/CN108122214B/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/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • 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/20024Filtering details
    • G06T2207/20032Median filtering

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Color Television Image Signal Generators (AREA)

Abstract

The invention discloses a method and a device for removing false colors, which can improve the false color removing effect of an image by determining the edge direction information entropy of an image area, dividing the image according to the edge direction information entropy to obtain different areas, and respectively adopting different methods to remove the false colors aiming at the different divided areas.

Description

Method and device for removing false color
Technical Field
The invention relates to the field of image processing, in particular to a method and a device for removing false colors.
Background
Currently, some image capturing apparatuses capture an image using an image pickup element of a bayer array color filter, and the image captured by such an image pickup element is an image of bayer format data, which is generally a raw image, and the image stored in a memory card is generally an image converted from the raw image of bayer format data.
Generally, an image is composed of three elements of RGB, where R is a red channel, G is a green channel, and B is a blue channel, and each pixel in the bayer format data usually has only one color channel, so that the other two color channels need to be complemented. A commonly used method for complementing color channels is to interpolate an unknown color channel value of a current pixel by using color channel information existing in surrounding pixels. The interpolation and completion method needs to accurately judge the direction of the edge gradient, and if the direction judgment is not accurate, the generated RGB image has a false color phenomenon.
For the generated false color phenomenon, the currently adopted measure for eliminating the false color is to continuously process the interpolation result by using a median filtering method, so as to eliminate partial false color noise generated in the interpolation.
The method for removing the false color by median filtering is to remove the false color in all the areas of the image by the same false color removing method, so that the false color removing effect of the image is poor.
Disclosure of Invention
The invention aims to provide a method and a device for removing false colors, which are used for solving the problems of how to remove the false colors in different areas of an image of Bayer format data in the interpolation process and improving the false color removing effect.
The purpose of the invention is realized by the following technical scheme:
one aspect of the present invention provides a method for removing a false color, including:
determining an image area from which false colors are to be removed, and determining the edge direction information entropy of the image area; determining the image area as a first area or a second area according to the edge direction information entropy; carrying out false color removal on the first region by adopting a first false color removal method; and removing the false color of the second region by adopting a second false color removing method.
Optionally, the determining an image area from which a false color is to be removed and determining an edge direction information entropy of the image area include:
selecting pixel points from pixel points of an image, and selecting a region with a set size from the image as an image region to be subjected to false color removal by taking the selected pixel points as a center; counting the edge gradient direction of each pixel point in the image region, and obtaining the probability of each pixel point in the image region appearing in each edge gradient direction; and determining the edge direction information entropy of the image area according to the probability of each pixel point in the image area appearing in each edge gradient direction and the logarithm of the probability of each pixel point in the image area appearing in each edge gradient direction.
Optionally, the determining, according to the edge direction information entropy, that the image area is a first area or a second area includes:
judging whether the value of the edge direction information entropy is larger than a set threshold value or not; if the value of the edge direction information entropy is larger than a set threshold value, determining that the image area is a first area; and if the value of the edge direction information entropy is smaller than a set threshold value, determining that the image area is a second area.
Optionally, performing false color removal by using a first false color removal method for the first region includes:
obtaining the correction values of the other two color channel components except the color channel component of the pixel by respectively adopting the following modes for each pixel in the first area, and removing the false color by using the correction values of the other two color channel components:
performing color channel interpolation on the color channel component value of the pixel to obtain color channel component values of the other two color channel components except the color channel component of the pixel; and performing median filtering on each color channel component value obtained after interpolation by using a difference value between the color channel component value and the color channel component value of the pixel to obtain a median filtered color channel differential value, and taking the sum of the median filtered color channel differential value and the color channel component value of the pixel as a correction value of the color channel component.
Optionally, performing false color removal by using a second false color removal method for the second region, includes:
obtaining a correction value of an R color channel component and a correction value of a B color channel component for each pixel in the second area by adopting the following modes respectively, and removing false colors by using the correction values of the R color channel component and the correction values of the B color channel component:
if the pixel is a G pixel, performing color channel interpolation on the color channel component value of the G pixel to obtain an R color channel component value and a B color channel component value; performing median filtering on a difference value between the R color channel component value obtained after interpolation and the G color channel component value of the pixel to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the G color channel component value as a correction value of the R color channel component obtained after interpolation; performing median filtering on a difference value between the B color channel component value obtained after interpolation and the G color channel component value of the pixel to obtain a B color channel differential value, and taking the sum of the B color channel differential value and the G color channel component value after median filtering as a correction value of the B color channel component obtained after interpolation; if the pixel is an R pixel, performing color channel interpolation on the color channel component value of the R pixel to obtain a G color channel component value and a B color channel component value; performing median filtering on a difference value between the R color channel component value and the G color channel component value obtained after interpolation to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the G color channel component value obtained after interpolation as a correction value of the R color channel component; performing median filtering on a difference value between the B color channel component value obtained after interpolation and the G color channel component value obtained after interpolation to obtain a B color channel differential value after median filtering, and taking the sum of the B color channel differential value after median filtering and the G color channel component value after interpolation as a correction value of the B color channel component; if the pixel is a B pixel, performing color channel interpolation on the color channel component value of the B pixel to obtain a G color channel component value and an R color channel component value; performing median filtering on a difference value between the R color channel component value obtained after interpolation and the G color channel component value obtained after interpolation to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the interpolated G color channel component value as a correction value of the R color channel component; and performing median filtering on the difference value between the B color channel component value and the G color channel component value obtained after interpolation to obtain a B color channel differential value after median filtering, and taking the sum of the B color channel differential value after median filtering and the G color channel component value obtained after interpolation as a correction value of the B color channel component.
In another aspect, the present invention provides an apparatus for removing a false color, including:
the device comprises a determining unit, a judging unit and a judging unit, wherein the determining unit is used for determining an image area from which a false color is to be removed, determining the edge direction information entropy of the image area, and determining the image area as a first area or a second area according to the edge direction information entropy; and the processing unit is used for removing the false color of the first area determined by the determining unit by adopting a first false color removing method and removing the false color of the second area determined by the determining unit by adopting a second false color removing method.
Optionally, the determining unit is specifically configured to determine an image area from which a false color is to be removed, and determine an edge direction information entropy of the image area as follows:
selecting pixel points from pixel points of an image, and selecting a region with a set size from the image as an image region to be subjected to false color removal by taking the selected pixel points as a center; counting the edge gradient direction of each pixel point in the image region, and obtaining the probability of each pixel point in the image region appearing in each edge gradient direction; and determining the edge direction information entropy of the image area according to the probability of each pixel point in the image area appearing in each edge gradient direction and the logarithm of the probability of each pixel point in the image area appearing in each edge gradient direction.
Optionally, the determining unit is specifically configured to determine that the image area is the first area or the second area according to the edge direction information entropy as follows:
judging whether the value of the edge direction information entropy is larger than a set threshold value or not; if the value of the edge direction information entropy is larger than a set threshold value, determining that the image area is a first area; and if the value of the edge direction information entropy is smaller than a set threshold value, determining that the image area is a second area.
Optionally, the processing unit is specifically configured to perform false color removal on the first region by using a first false color removal method as follows:
obtaining the correction values of the other two color channel components except the color channel component of the pixel by respectively adopting the following modes for each pixel in the first area, and removing the false color by using the correction values of the other two color channel components:
performing color channel interpolation on the color channel component value of the pixel to obtain color channel component values of the other two color channel components except the color channel component of the pixel; and performing median filtering on each color channel component value obtained after interpolation by using a difference value between the color channel component value and the color channel component value of the pixel to obtain a median filtered color channel differential value, and taking the sum of the median filtered color channel differential value and the color channel component value of the pixel as a correction value of the color channel component.
Optionally, the processing unit is specifically configured to perform false color removal on the second region by using a second false color removal method as follows:
obtaining a correction value of an R color channel component and a correction value of a B color channel component for each pixel in the second area by adopting the following modes respectively, and removing false colors by using the correction values of the R color channel component and the correction values of the B color channel component: if the pixel is a G pixel, performing color channel interpolation on the color channel component value of the G pixel to obtain an R color channel component value and a B color channel component value; performing median filtering on a difference value between the R color channel component value obtained after interpolation and the G color channel component value of the pixel to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the G color channel component value as a correction value of the R color channel component obtained after interpolation; performing median filtering on a difference value between the B color channel component value obtained after interpolation and the G color channel component value of the pixel to obtain a B color channel differential value, and taking the sum of the B color channel differential value and the G color channel component value after median filtering as a correction value of the B color channel component obtained after interpolation; if the pixel is an R pixel, performing color channel interpolation on the color channel component value of the R pixel to obtain a G color channel component value and a B color channel component value; performing median filtering on a difference value between the R color channel component value and the G color channel component value obtained after interpolation to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the G color channel component value obtained after interpolation as a correction value of the R color channel component; performing median filtering on a difference value between the B color channel component value obtained after interpolation and the G color channel component value obtained after interpolation to obtain a B color channel differential value after median filtering, and taking the sum of the B color channel differential value after median filtering and the G color channel component value after interpolation as a correction value of the B color channel component; if the pixel is a B pixel, performing color channel interpolation on the color channel component value of the B pixel to obtain a G color channel component value and an R color channel component value; performing median filtering on a difference value between the R color channel component value obtained after interpolation and the G color channel component value obtained after interpolation to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the interpolated G color channel component value as a correction value of the R color channel component; and performing median filtering on the difference value between the B color channel component value and the G color channel component value obtained after interpolation to obtain a B color channel differential value after median filtering, and taking the sum of the B color channel differential value after median filtering and the G color channel component value obtained after interpolation as a correction value of the B color channel component.
The invention provides a method and a device for removing false colors, which are characterized in that the edge direction information entropy of an image area is determined, the image is divided according to the edge direction information entropy to obtain different areas, different methods are respectively adopted for removing the false colors aiming at the different divided areas, and the false color removing effect is better compared with the false color removing method which is adopted for all the areas in the image.
Drawings
Fig. 1 is a flowchart of an embodiment of a method for removing a false color;
fig. 2 is a flowchart of an implementation of a method for determining an image area that needs to be subjected to pseudo color removal and determining an edge direction information entropy of the image area according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an image region provided by an embodiment of the invention;
FIG. 4 is a flowchart of an embodiment of a method for determining an image region as a first region or a second region according to an entropy of edge direction information;
fig. 5 is a flowchart of a method shown in fig. 5, where a first false color removal method is used for removing false colors from a first region according to an embodiment of the present invention;
fig. 6 is a flowchart of a method for removing a false color by using a second false color removal method for a second region according to an embodiment of the present invention;
fig. 7 is a block diagram of a device for removing a false color according to an embodiment of the present invention.
Detailed Description
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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
The embodiment of the invention provides a method and a device for removing false colors.
Fig. 1 is a flowchart of a method for removing a false color according to an embodiment of the present invention, where an execution subject of the method shown in fig. 1 may be an apparatus for removing a false color, and referring to fig. 1, the method includes:
s101: determining an image area from which the false color is to be removed, and determining the edge direction information entropy of the image area.
Generally, images acquired by a camera are images of bayer format data, generally, the images of bayer format data need to be converted into RGB images, and false colors may appear in the images during the conversion process, so that false color removal processing needs to be performed on the images.
In the embodiment of the invention, the edge direction disorder degree of the image area can be represented according to the edge direction information entropy.
S102: and determining the image area as the first area or the second area according to the edge direction information entropy.
In the embodiment of the invention, the image area can be divided into different areas according to the edge direction information entropy. For convenience of description, in the embodiment of the present invention, the image area may be divided into a first area and a second area, and the first area may be considered as an area with more pseudo color noise in the image and the second area may be considered as a large edge area or a flat area in the image, corresponding to the degree of disorder in the edge direction of the image.
S103: and removing the false color by adopting a first false color removing method aiming at the first area.
S104: and removing the false color by adopting a second false color removing method aiming at the second area.
For convenience of description, in the embodiment of the present invention, a method for removing a false color in the first region may be referred to as a first false color removing method, and a method for removing a false color in the second region may be referred to as a second false color removing method.
In a possible implementation manner, an image region that needs to be subjected to pseudo color removal is determined, and the entropy of the edge direction information of the image region is determined, and the specific implementation flow may refer to the method shown in fig. 2.
Fig. 2 is a flowchart of a method for determining an image area from which a false color is to be removed and determining an entropy of edge direction information of the image area according to an embodiment of the present invention, and referring to fig. 2, the method includes:
s1011: selecting pixel points from the pixel points of the image, and selecting a region with a set size from the image as an image region to be subjected to false color removal by taking the selected pixel points as the center.
In a possible implementation manner, one of the pixel points of the image is selected, and a region with a certain size is selected as an image region to be subjected to false color removal by taking the selected pixel point as a center. Fig. 3 is a schematic diagram of an image area according to an embodiment of the present invention. Referring to fig. 3, assuming that a 3 × 3 region is selected with B7 pixels as the center, the selected region is taken as an image region from which a false color is to be removed. Of course, the size of the image area is not limited in the embodiments of the present invention, and may be, for example, 3 × 3, 5 × 5, 7 × 7, or the like.
S1012: and counting the edge gradient direction of each pixel point in the image region, and obtaining the probability of each pixel point in the image region in each edge gradient direction.
In this embodiment of the present invention, there are multiple edge gradient directions of each pixel, for example, the edge gradient directions may be a vertical direction, a horizontal direction, a 45-degree direction, and the like, and the embodiment of the present invention is not limited.
In a possible implementation manner, the edge gradient direction of each pixel point in the image region may be counted, and the probability of the pixel point appearing in each direction may be determined. In order to intuitively reverse map the relationship between the edge gradient direction of a pixel and the probability magnitude of the pixel appearing in each direction, the statistical edge gradient direction and the probability magnitude of the pixel appearing in each direction may be represented in the form of a histogram, or may be represented in other forms such as a table, which is not limited in the embodiment of the present invention.
S1013: and determining the edge direction information entropy of the image area according to the probability of each pixel point in the image area appearing in each edge gradient direction and the logarithm of the probability of each pixel point in the image area appearing in each edge gradient direction.
Specifically, in the embodiment of the present invention, the entropy of the edge direction information of the image area may be determined according to the following formula:
Figure BDA0001525346890000081
h represents the edge direction information entropy, Pi is the probability of each pixel point in the image area appearing in each edge gradient direction, and logPi is the logarithm of the probability of each pixel point in the image area appearing in each edge gradient direction.
In one possible embodiment, a flowchart for determining the first region or the second region of the image region is shown in fig. 4.
Fig. 4 is a flowchart illustrating an implementation of a method for determining an image region as a first region or a second region according to entropy of edge direction information according to an embodiment of the present invention, and referring to fig. 4, the method includes:
s1021: and judging whether the value of the edge direction information entropy is larger than a set threshold value or not.
S1022: and if the value of the edge direction information entropy is larger than the set threshold value, determining that the image area is the first area.
In the embodiment of the present invention, a threshold of the edge direction information entropy may be preset, and if the value of the edge direction information entropy of the selected image area is greater than the set threshold, it may be considered that the edge direction of the image area is relatively disordered, and the image area may be considered as an area with more pseudo color noise.
S1023: and if the value of the edge direction information entropy is smaller than the set threshold value, determining the image area as a second area.
In the embodiment of the present invention, if the value of the entropy of the edge direction information of the selected image area is smaller than the set threshold, it can be considered that the edge directions of the area are relatively consistent, and the image area can be considered as a large edge area or a flat area.
Specifically, how to perform the false color removal by using the first false color removal method for the first region may refer to a method flowchart shown in fig. 5, as shown in fig. 5, where the method includes:
s1031: and carrying out color channel interpolation on the color channel component value of the pixel to obtain the color channel component values of the other two color channel components except the color channel component of the pixel.
Generally, because pixel points in bayer pattern data are pixel points with only one color channel, and an image generally consists of three RGB color channels, interpolation and completion need to be performed on the other two color channels of the pixel points.
S1032: and performing median filtering on each color channel component value obtained after interpolation by using a difference value between the color channel component value and the color channel component value of the pixel to obtain a median filtered color channel differential value, and taking the sum of the median filtered color channel differential value and the color channel component value of the pixel as a correction value of the color channel component.
In one possible implementation, which is illustrated in fig. 3 as an example, for G1 pixels, it is necessary to interpolate R color channel and B color channel to obtain interpolated color channel component values of R1 'and B1', for R2 pixels, interpolated G color channel component values and B color channel component values of G2 'and B2', respectively, and for B5 pixels, interpolated G color channel component values and G color channel component values of R5 'and G5', respectively, and then median filtering the difference between RGB components is performed.
Assuming that a 3 × 3 filter window is selected, taking G6 pixels as an example, R6' and G6 are used as differential signals to perform median filtering, and obtain a corrected value R6outG6+ mid (R6 '-G6), B6' and G6 were median-filtered as differential signals, and a correction value B6 was obtainedout=G6+mid(B6’-G6)。
Similarly, the correction value of the R10 pixel is:
G10out=R10+mid(G10’-R10),B10out=R10+mid(B10’-R10)。
the same correction values for B7 pixels are:
G7out=B7+mid(G7’-B7),R7out=B7+mid(B7-R7’)。
in the embodiment of the present invention, the correction values of the other two color channel components except the color channel component of the pixel are obtained in the manner of S1031 to S1032 for each pixel in the first region, and the false color removal is performed by using the correction values of the other two color channel components.
The specific method calculation of the first median filtering method is related in the prior art, and is not described herein again.
Fig. 6 is a flowchart of a method for specifically removing a false color by using a second false color removal method for a second region according to an embodiment of the present invention, with reference to fig. 6, where the method includes:
s1041: and if the pixel is a G pixel, performing color channel interpolation on the color channel component value of the G pixel to obtain an R color channel component value and a B color channel component value.
S1042: and performing median filtering on the difference value between the R color channel component value obtained after interpolation and the G color channel component value of the pixel to obtain a median filtered R color channel differential value, and taking the sum of the median filtered R color channel differential value and the G color channel component value as a correction value of the R color channel component obtained after interpolation.
S1043: and performing median filtering on the difference value between the B color channel component value obtained after interpolation and the G color channel component value of the pixel to obtain a B color channel differential value, and taking the sum of the B color channel differential value and the G color channel component value after median filtering as a correction value of the B color channel component obtained after interpolation.
And performing color channel interpolation on the G pixel to obtain an R color channel component value and a B color channel component value, and performing median filtering on the difference between the interpolated R color channel component value and B color channel component value and the G color channel component value respectively to obtain an R color channel differential value and a B color channel differential value. And taking the sum of the R color channel differential value and the B color channel differential value and the G color channel component value as an R color channel component correction value and a B color channel component correction value respectively.
In the embodiment of the present invention, because the G value has a relatively large influence on the brightness, it is easy to cause brightness abrupt change in some regions (for example, large edge regions) in the image, and therefore, when performing false color removal on the second region, the processing on the G pixel remains the same as the first false color removal method, and is not described herein again.
S1044: and if the pixel is an R pixel, performing color channel interpolation on the color channel component value of the R pixel to obtain a G color channel component value and a B color channel component value.
S1045: and performing median filtering on the difference value between the R color channel component value and the interpolated G color channel component value to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the interpolated G color channel component value as a correction value of the R color channel component.
S1046: and performing median filtering on the difference value between the B color channel component value obtained after interpolation and the G color channel component value obtained after interpolation to obtain a B color channel differential value after median filtering, and taking the sum of the B color channel differential value after median filtering and the G color channel component value after interpolation as a correction value of the B color channel component.
Specifically, in the embodiment of the present invention, fig. 3 is taken as an example to describe in detail.
For R10 pixels: obtaining a G color channel component value G10 ' after interpolation, carrying out median filtering according to the G color channel component value G10 ' and the R color channel component value to obtain an R color channel differential value mid (R10-G10 '), and taking the sum of the differential value mid (R10-G10 ') after median filtering and the G color channel component value G10 ' as the correction value of the R color channel component: r10out=G10’+mid(R10-G10’)。
For the same reason, B10out=G10’+mid(B10’-G10’)。
S1047: and if the pixel is a B pixel, performing color channel interpolation on the color channel component value of the B pixel to obtain a G color channel component value and an R color channel component value.
S1048: and performing median filtering on the difference value between the R color channel component value and the G color channel component value obtained after interpolation to obtain a median filtered R color channel differential value, and taking the sum of the median filtered R color channel differential value and the G color channel component value obtained after interpolation as a correction value of the R color channel component.
S1049: and performing median filtering on the difference value between the B color channel component value and the interpolated G color channel component value to obtain a median-filtered B color channel differential value, and taking the sum of the median-filtered B color channel differential value and the interpolated G color channel component value as a correction value of the B color channel component.
Specifically, in the embodiment of the present invention, the detailed description is given by taking fig. 3 as an example.
For B7 pixels: obtaining a G color channel component value G7 ' after interpolation, carrying out median filtering according to the G color channel component value G7 ' and the R color channel component value to obtain an R color channel differential value mid (R7 ' -G7 '), and obtaining the sum of the R color channel differential value obtained after median filtering and the G color channel component value G7 ' as a correction value: r7out=G7’+mid(R7’-G7’)。
For the same reason, B7out=G7’+mid(B7-G7’)。
In the embodiment of the invention, the image areas are determined to be different areas by utilizing the edge direction information entropy, and compared with the prior art that the false color is removed by adopting the same method for all the image areas, the false color removing effect can be improved.
Based on the same concept as the above method for removing a false color, an embodiment of the present invention further provides a device for removing a false color, and fig. 7 is a block diagram of a structure of the device for removing a false color provided by an embodiment of the present invention, and referring to fig. 7, the device includes: a determining unit 101 and a processing unit 102, wherein:
the determining unit 101 is configured to determine an image area from which a false color is to be removed, determine an edge direction information entropy of the image area, and determine that the image area is a first area or a second area according to the edge direction information entropy.
And the processing unit 102 is configured to perform false color removal by using a first false color removal method for the first region, and perform false color removal by using a second false color removal method for the second region.
The determining unit 101 is specifically configured to determine an image area from which a false color is to be removed, and determine an edge direction information entropy of the image area as follows:
selecting pixel points from the pixel points of the image, and selecting a region with a set size as an image region to be subjected to false color removal in the image by taking the selected pixel points as a center; counting the edge gradient direction of each pixel point in the image region, and obtaining the probability of each pixel point in the image region appearing in each edge gradient direction; and determining the edge direction information entropy of the image area according to the probability of each pixel point in the image area appearing in each edge gradient direction and the logarithm of the probability of each pixel point in the image area appearing in each edge gradient direction.
Optionally, the determining unit 101 is specifically configured to determine the image area as the first area or the second area according to the edge direction information entropy as follows:
judging whether the value of the edge direction information entropy is larger than a set threshold value or not; if the value of the edge direction information entropy is larger than a set threshold value, determining that the image area is a first area; and if the value of the edge direction information entropy is smaller than the set threshold value, determining the image area as a second area.
Further, the processing unit 102 is specifically configured to perform false color removal on the first region by using a first false color removal method as follows:
and respectively obtaining the correction values of the other two color channel components except the color channel component of the pixel by aiming at each pixel in the first area in the following mode, and removing the false color by using the correction values of the other two color channel components:
performing color channel interpolation on the color channel component value of the pixel to obtain color channel component values of the other two color channel components except the color channel component of the pixel; and performing median filtering on each color channel component value obtained after interpolation by using a difference value between the color channel component value and the color channel component value of the pixel to obtain a median filtered color channel differential value, and taking the sum of the median filtered color channel differential value and the color channel component value of the pixel as a correction value of the color channel component.
Further, the processing unit 102 is specifically configured to perform the false color removal by using a second false color removal method for the second region as follows:
obtaining a correction value of the R color channel component and a correction value of the B color channel component for each pixel in the second area by adopting the following modes respectively, and removing false color by using the correction value of the R color channel component and the correction value of the B color channel component:
if the pixel is a G pixel, performing color channel interpolation on the color channel component value of the G pixel to obtain an R color channel component value and a B color channel component value; performing median filtering on a difference value between the R color channel component value obtained after interpolation and the G color channel component value of the pixel to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the G color channel component value as a correction value of the R color channel component obtained after interpolation; and performing median filtering on the difference value between the B color channel component value obtained after interpolation and the G color channel component value of the pixel to obtain a B color channel differential value, and taking the sum of the B color channel differential value and the G color channel component value after median filtering as a correction value of the B color channel component obtained after interpolation.
If the pixel is an R pixel, performing color channel interpolation on the color channel component value of the R pixel to obtain a G color channel component value and a B color channel component value; performing median filtering on a difference value between the R color channel component value and the G color channel component value obtained after interpolation to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the G color channel component value obtained after interpolation as a correction value of the R color channel component; and performing median filtering on the difference value between the B color channel component value obtained after interpolation and the G color channel component value obtained after interpolation to obtain a B color channel differential value after median filtering, and taking the sum of the B color channel differential value after median filtering and the G color channel component value after interpolation as a correction value of the B color channel component.
If the pixel is a B pixel, performing color channel interpolation on the color channel component value of the B pixel to obtain a G color channel component value and an R color channel component value; performing median filtering on a difference value between the R color channel component value obtained after interpolation and the G color channel component value obtained after interpolation to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the G color channel component value obtained after interpolation as a correction value of the R color channel component; and performing median filtering on the difference value between the B color channel component value and the G color channel component value obtained after interpolation to obtain a B color channel differential value after median filtering, and taking the sum of the B color channel differential value after median filtering and the G color channel component value obtained after interpolation as a correction value of the B color channel component.
It should be noted that, for the function implementation of each unit in the apparatus for removing a false color in the embodiment of the present invention, further reference may be made to the description of the related method embodiment, which is not described herein again.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (6)

1. A method of removing false colors, comprising:
determining an image area from which false colors are to be removed, and determining the edge direction information entropy of the image area;
determining the image area as a first area or a second area according to the edge direction information entropy;
carrying out false color removal on the first region by adopting a first false color removal method;
performing false color removal on the second region by adopting a second false color removal method;
and performing false color removal on the first region by adopting a first false color removal method, wherein the false color removal method comprises the following steps:
obtaining the correction values of the other two color channel components except the color channel component of the pixel by respectively adopting the following modes for each pixel in the first area, and removing the false color by using the correction values of the other two color channel components:
performing color channel interpolation on the color channel component value of the pixel to obtain color channel component values of the other two color channel components except the color channel component of the pixel;
performing median filtering on each color channel component value obtained after interpolation by using a difference value between the color channel component value and the color channel component value of the pixel to obtain a median filtered color channel differential value, and taking the sum of the median filtered color channel differential value and the color channel component value of the pixel as a correction value of the color channel component;
and performing false color removal on the second region by adopting a second false color removal method, wherein the false color removal method comprises the following steps:
obtaining a correction value of an R color channel component and a correction value of a B color channel component for each pixel in the second area by adopting the following modes respectively, and removing false colors by using the correction values of the R color channel component and the correction values of the B color channel component:
if the pixel is a G pixel, performing color channel interpolation on the color channel component value of the G pixel to obtain an R color channel component value and a B color channel component value;
performing median filtering on a difference value between the R color channel component value obtained after interpolation and the G color channel component value of the pixel to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the G color channel component value as a correction value of the R color channel component obtained after interpolation;
performing median filtering on a difference value between the B color channel component value obtained after interpolation and the G color channel component value of the pixel to obtain a B color channel differential value, and taking the sum of the B color channel differential value and the G color channel component value after median filtering as a correction value of the B color channel component obtained after interpolation;
if the pixel is an R pixel, performing color channel interpolation on the color channel component value of the R pixel to obtain a G color channel component value and a B color channel component value;
performing median filtering on a difference value between the R color channel component value and the G color channel component value obtained after interpolation to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the G color channel component value obtained after interpolation as a correction value of the R color channel component;
performing median filtering on a difference value between the B color channel component value obtained after interpolation and the G color channel component value obtained after interpolation to obtain a B color channel differential value after median filtering, and taking the sum of the B color channel differential value after median filtering and the G color channel component value after interpolation as a correction value of the B color channel component;
if the pixel is a B pixel, performing color channel interpolation on the color channel component value of the B pixel to obtain a G color channel component value and an R color channel component value;
performing median filtering on a difference value between the R color channel component value obtained after interpolation and the G color channel component value obtained after interpolation to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the interpolated G color channel component value as a correction value of the R color channel component;
and performing median filtering on the difference value between the B color channel component value and the G color channel component value obtained after interpolation to obtain a B color channel differential value after median filtering, and taking the sum of the B color channel differential value after median filtering and the G color channel component value obtained after interpolation as a correction value of the B color channel component.
2. The method of claim 1, wherein the determining an image area from which a false color is to be removed and determining an edge direction information entropy of the image area comprises:
selecting pixel points from pixel points of an image, and selecting a region with a set size from the image as an image region to be subjected to false color removal by taking the selected pixel points as a center;
counting the edge gradient direction of each pixel point in the image region, and obtaining the probability of each pixel point in the image region appearing in each edge gradient direction;
and determining the edge direction information entropy of the image area according to the probability of each pixel point in the image area appearing in each edge gradient direction and the logarithm of the probability of each pixel point in the image area appearing in each edge gradient direction.
3. The method according to claim 1 or 2, wherein the entropy-determining the image region as the first region or the second region according to the edge direction information comprises:
judging whether the value of the edge direction information entropy is larger than a set threshold value or not;
if the value of the edge direction information entropy is larger than a set threshold value, determining that the image area is a first area;
and if the value of the edge direction information entropy is smaller than a set threshold value, determining that the image area is a second area.
4. An apparatus for removing false colors, comprising:
the device comprises a determining unit, a judging unit and a judging unit, wherein the determining unit is used for determining an image area from which a false color is to be removed, determining the edge direction information entropy of the image area, and determining the image area as a first area or a second area according to the edge direction information entropy;
the processing unit is used for removing the false color of the first area determined by the determining unit by adopting a first false color removing method and removing the false color of the second area determined by the determining unit by adopting a second false color removing method;
the processing unit is specifically configured to perform false color removal for the first region by using a first false color removal method as follows:
obtaining the correction values of the other two color channel components except the color channel component of the pixel by respectively adopting the following modes for each pixel in the first area, and removing the false color by using the correction values of the other two color channel components:
performing color channel interpolation on the color channel component value of the pixel to obtain color channel component values of the other two color channel components except the color channel component of the pixel;
performing median filtering on each color channel component value obtained after interpolation by using a difference value between the color channel component value and the color channel component value of the pixel to obtain a median filtered color channel differential value, and taking the sum of the median filtered color channel differential value and the color channel component value of the pixel as a correction value of the color channel component;
the processing unit is specifically configured to perform false color removal for the second region by using a second false color removal method as follows:
obtaining a correction value of an R color channel component and a correction value of a B color channel component for each pixel in the second area by adopting the following modes respectively, and removing false colors by using the correction values of the R color channel component and the correction values of the B color channel component:
if the pixel is a G pixel, performing color channel interpolation on the color channel component value of the G pixel to obtain an R color channel component value and a B color channel component value;
performing median filtering on a difference value between the R color channel component value obtained after interpolation and the G color channel component value of the pixel to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the G color channel component value as a correction value of the R color channel component obtained after interpolation;
performing median filtering on a difference value between the B color channel component value obtained after interpolation and the G color channel component value of the pixel to obtain a B color channel differential value, and taking the sum of the B color channel differential value and the G color channel component value after median filtering as a correction value of the B color channel component obtained after interpolation;
if the pixel is an R pixel, performing color channel interpolation on the color channel component value of the R pixel to obtain a G color channel component value and a B color channel component value;
performing median filtering on a difference value between the R color channel component value and the G color channel component value obtained after interpolation to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the G color channel component value obtained after interpolation as a correction value of the R color channel component;
performing median filtering on a difference value between the B color channel component value obtained after interpolation and the G color channel component value obtained after interpolation to obtain a B color channel differential value after median filtering, and taking the sum of the B color channel differential value after median filtering and the G color channel component value after interpolation as a correction value of the B color channel component;
if the pixel is a B pixel, performing color channel interpolation on the color channel component value of the B pixel to obtain a G color channel component value and an R color channel component value;
performing median filtering on a difference value between the R color channel component value obtained after interpolation and the G color channel component value obtained after interpolation to obtain a median-filtered R color channel differential value, and taking the sum of the median-filtered R color channel differential value and the interpolated G color channel component value as a correction value of the R color channel component;
and performing median filtering on the difference value between the B color channel component value and the G color channel component value obtained after interpolation to obtain a B color channel differential value after median filtering, and taking the sum of the B color channel differential value after median filtering and the G color channel component value obtained after interpolation as a correction value of the B color channel component.
5. The apparatus according to claim 4, wherein the determining unit is specifically configured to determine the image area from which the false color is to be removed, and to determine the entropy of the edge direction information of the image area as follows:
selecting pixel points from pixel points of an image, and selecting a region with a set size from the image as an image region to be subjected to false color removal by taking the selected pixel points as a center;
counting the edge gradient direction of each pixel point in the image region, and obtaining the probability of each pixel point in the image region appearing in each edge gradient direction;
and determining the edge direction information entropy of the image area according to the probability of each pixel point in the image area appearing in each edge gradient direction and the logarithm of the probability of each pixel point in the image area appearing in each edge gradient direction.
6. The apparatus according to claim 4 or 5, wherein the determining unit is specifically configured to determine the image region as the first region or the second region depending on the edge direction information entropy as follows:
judging whether the value of the edge direction information entropy is larger than a set threshold value or not;
if the value of the edge direction information entropy is larger than a set threshold value, determining that the image area is a first area;
and if the value of the edge direction information entropy is smaller than a set threshold value, determining that the image area is a second area.
CN201711433473.0A 2017-12-26 2017-12-26 Method and device for removing false color Active CN108122214B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711433473.0A CN108122214B (en) 2017-12-26 2017-12-26 Method and device for removing false color

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711433473.0A CN108122214B (en) 2017-12-26 2017-12-26 Method and device for removing false color

Publications (2)

Publication Number Publication Date
CN108122214A CN108122214A (en) 2018-06-05
CN108122214B true CN108122214B (en) 2020-12-08

Family

ID=62231853

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711433473.0A Active CN108122214B (en) 2017-12-26 2017-12-26 Method and device for removing false color

Country Status (1)

Country Link
CN (1) CN108122214B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478687A (en) * 2008-01-04 2009-07-08 华晶科技股份有限公司 Correcting method for pseudo color pixel in digital image
CN102045574A (en) * 2009-10-21 2011-05-04 比亚迪股份有限公司 Equipment and method for processing false color of image
CN106485715A (en) * 2016-09-09 2017-03-08 电子科技大学成都研究院 A kind of unstructured road recognition methods
CN106911918A (en) * 2015-12-23 2017-06-30 展讯通信(上海)有限公司 The method and device of image pixel correction

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478687A (en) * 2008-01-04 2009-07-08 华晶科技股份有限公司 Correcting method for pseudo color pixel in digital image
CN102045574A (en) * 2009-10-21 2011-05-04 比亚迪股份有限公司 Equipment and method for processing false color of image
CN106911918A (en) * 2015-12-23 2017-06-30 展讯通信(上海)有限公司 The method and device of image pixel correction
CN106485715A (en) * 2016-09-09 2017-03-08 电子科技大学成都研究院 A kind of unstructured road recognition methods

Also Published As

Publication number Publication date
CN108122214A (en) 2018-06-05

Similar Documents

Publication Publication Date Title
JP6643525B2 (en) Image purple fringe removal system, method, computer-readable recording medium, and imaging apparatus
US8363123B2 (en) Image pickup apparatus, color noise reduction method, and color noise reduction program
JP4815807B2 (en) Image processing apparatus, image processing program, and electronic camera for detecting chromatic aberration of magnification from RAW data
CN111784603B (en) RAW domain image denoising method, computer device and computer readable storage medium
CN111784605B (en) Image noise reduction method based on region guidance, computer device and computer readable storage medium
CN107395991B (en) Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment
JP2008113222A (en) Image processing apparatus, imaging apparatus, image processing method in these apparatuses, and program allowing computer to execute the method
TW201742001A (en) Method and device for image noise estimation and image capture apparatus
EP2293238A2 (en) Edge-adaptive interpolation and noise filtering method, computer-readable recording medium, and portable terminal
CN110517206B (en) Method and device for eliminating color moire
CN111368819B (en) Light spot detection method and device
CN113168669A (en) Image processing method and device, electronic equipment and readable storage medium
US8471933B2 (en) Image processing apparatus, image processing method and computer program
JP4717371B2 (en) Image processing apparatus and image processing program
TWI741305B (en) Image processing method and device
CN114584700A (en) Focusing marking method, marking device and electronic equipment
CN105809677B (en) Image edge detection method and system based on bilateral filter
KR100869134B1 (en) Image processing apparatus and method
CN108122214B (en) Method and device for removing false color
JP5738904B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
US8629917B2 (en) Image processing apparatus, method, and recording medium
TWI524729B (en) A real-time false color reduction system and method for color interpolation
CN111340863B (en) Moire pixel point determination method and device and electronic equipment
CN108810320B (en) Image quality improving method and device
KR101644268B1 (en) Method and Apparatus for Estimating Hue Modification of Digital Image Using Sensor Pattern Noise

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