Filtering correction method and device

By using color difference information and color saturation frequency in the RGB domain, the problem of high-frequency pseudo-color in the image is solved, and the image quality is significantly improved.

CN120166306APending Publication Date: 2025-06-17SHENZHEN MICROBT ELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311733792.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-15
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The prior art is difficult to effectively solve the problem of high-frequency pseudo-color in images, resulting in a decline in image quality.

Method used

By using color difference information in the RGB domain to low-pass filter the pixels in the high-frequency pseudo-color area, and combining the color saturation frequency to determine the high-frequency pseudo-color pixel points, improving the recognition accuracy.

Benefits of technology

Effectively reduce or eliminate high-frequency fake color phenomena, and improve image quality and visual appearance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120166306A_ABST
    Figure CN120166306A_ABST
Patent Text Reader

Abstract

The invention relates to a filtering correction method and device used for high-frequency pseudo-color suppression, and the method comprises the steps: obtaining an original RGB image; obtaining an original color difference value of each pixel point according to the original color channel value of each pixel point in the original RGB image; according to the original color channel value of each pixel point and a preset filtering window size, determining a to-be-corrected pixel point; performing low-pass filtering on the to-be-corrected pixel points in the chromatic aberration plane to obtain filtered chromatic aberration values of the to-be-corrected pixel points; obtaining a filtered color channel value of the pixel point to be corrected according to the filtered color difference value and the original color channel value; and obtaining a filtered and corrected RGB image according to the filtered color channel value of the pixel point to be corrected and the original color channel values of other pixel points. According to the method and the device, the high-frequency false color is suppressed by using the color difference information, and the possibility of the high-frequency false color is determined by using the color saturation frequency, so that the accuracy of high-frequency false color identification can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technologies, and particularly relates to a filtering and correction method and device. Background Art

[0002] During daily photography or videography, color deviation often occurs in the high-frequency information part of the picture of a photo or video image, resulting in the presented content not matching the color of the actual scene. For example, in the case of a grass-green background, pink or yellow lines may appear in the picture; when shooting against the light towards the leaves, edges composed of multiple colors often appear in the high-contrast area of the image. Among them, the high-frequency color noise where the shooting result does not match the true color can be called high-frequency false color.

[0003] The reasons for the generation of high-frequency false color are roughly divided into two types. One is that during the interpolation process of the CFA (Color Filter Array) in the Bayer image, color deviation occurs due to inaccurate interpolation at the hypotenuse or continuous uneven edges presented in the image; the other is caused by lens chromatic aberration. There is a difference between the focusing of light of different wavelengths and the theory, resulting in the appearance of false color edges.

[0004] High-frequency false color appears in outdoor, indoor, and night scenes, and has a wide range of impacts on image quality. Correcting or suppressing high-frequency false color in an image can improve the quality and visual perception of the image. To optimize the high-frequency false color problem, one way is to use a better lens to reduce color anomalies caused by chromatic aberration, and another way is to improve the accuracy of interpolation of the CFA algorithm in the edge and texture regions. However, both of these methods can only reduce a part of the high-frequency false color in the image, and subsequent further processing of the image is still required to further reduce or eliminate high-frequency false color. Summary of the Invention

[0005] In view of this, the present disclosure provides a filtering and correction method and device, which realizes low-pass filtering of pixels in the high-frequency false color area using chromatic aberration information in the RGB domain to reduce or eliminate the high-frequency false color phenomenon. Among them, the color saturation frequency obtained based on color saturation is used to determine the possibility that a pixel point in the image is high-frequency false color, which can effectively improve the accuracy of high-frequency false color recognition.

[0006] The technical solution of the present disclosure is implemented as follows:

[0007] A filtering and correction method for high-frequency false color suppression, the method includes:

[0008] Obtain an original RGB image, where the original RGB image contains the original color channel values of each pixel point;

[0009] Based on the original color channel values of each pixel in the original RGB image, obtain the original color difference values of each pixel in the original RGB image, and form the color difference plane of the original RGB image from the original color difference values of each pixel;

[0010] Based on the original color channel values of each pixel and the size of a preset filtering window, determine the pixels to be corrected contained in the original RGB image;

[0011] In the color difference plane, perform low-pass filtering on the pixels to be corrected to obtain the filtered color difference values of the pixels to be corrected;

[0012] Based on the filtered color difference values of the pixels to be corrected and the original color channel values of the pixels to be corrected, obtain the filtered color channel values of the pixels to be corrected;

[0013] Based on the filtered color channel values of the pixels to be corrected and the original color channel values of other pixels in the original RGB image except the pixels to be corrected, obtain the filtered and corrected RGB image.

[0014] In a possible implementation manner, the original color channel values include an original R channel value, an original G channel value, and an original B channel value, the original color difference values include at least one of an original Gr color difference value and an original Gb color difference value, and the color difference plane includes at least one of a Gr color difference plane and a Gb color difference plane, where the Gr color difference plane is formed from the original Gr color difference values of each pixel, and the Gb color difference plane is formed from the original Gb color difference values of each pixel;

[0015] Among them, the step of obtaining the original color difference values of each pixel in the original RGB image based on the original color channel values of each pixel includes:

[0016] For any one pixel among each pixel, determine the original Gr color difference value of the any one pixel as the difference between the original G channel value and the original R channel value of the any one pixel;

[0017] And / or,

[0018] For any one pixel among each pixel, determine the original Gb color difference value of the any one pixel as the difference between the original G channel value and the original B channel value of the any one pixel;

[0019] Among them, the step of obtaining the filtered color channel values of the pixels to be corrected based on the filtered color difference values of the pixels to be corrected and the original color channel values of the pixels to be corrected includes:

[0020] For any pixel to be corrected, determine the filtered R-channel value of the any pixel to be corrected as the difference between the original G-channel value of the any pixel to be corrected and the filtered Gr color difference value of the any pixel to be corrected;

[0021] and / or,

[0022] For any pixel to be corrected, determine the filtered B-channel value of the any pixel to be corrected as the difference between the original G-channel value of the any pixel to be corrected and the filtered Gb color difference value of the any pixel to be corrected.

[0023] In a possible implementation manner, the determining the pixels to be corrected included in the original RGB image according to the original color channel values of the respective pixels and the size of a preset filtering window includes:

[0024] Obtain the color saturation frequencies of the respective pixels according to the original color channel values of the respective pixels and the size of the preset filtering window;

[0025] Determine the pixels with the color saturation frequencies within a preset color saturation frequency threshold range as the pixels to be corrected.

[0026] In a possible implementation manner, the obtaining the color saturation frequencies of the respective pixels according to the original color channel values of the respective pixels and the size of the preset filtering window includes the following steps respectively performed for each pixel among the respective pixels:

[0027] Within the coverage of the filtering window centered on the current pixel, obtain the color saturation of each pixel within the filtering window according to the original color channel values, where the current pixel is any one of the respective pixels;

[0028] Obtain the color saturation differences between all adjacent pixels within the filtering window according to the color saturation of each pixel within the filtering window;

[0029] Add the absolute values of the color saturation differences between all adjacent pixels within the filtering window to obtain the color saturation frequency of the current pixel.

[0030] In a possible implementation manner, the performing low-pass filtering on the pixels to be corrected in the color difference plane to obtain the filtered color difference values of the pixels to be corrected includes the following steps respectively performed for each of the pixels to be corrected:

[0031] Obtain a first low-pass filter, the size of the first low-pass filter being equal to the size of the filtering window;

[0032] According to the color saturation frequency of the current pixel to be corrected, adjust the weights of the first low-pass filter to obtain a second low-pass filter, such that the filtering intensity of the second low-pass filter on the current pixel to be corrected is greater than the filtering intensity of the first low-pass filter on the current pixel to be corrected;

[0033] In the color difference plane, use the second low-pass filter to perform low-pass filtering on the current pixel to be corrected to obtain the filtered color difference value of the current pixel to be corrected.

[0034] In a possible implementation manner, the adjusting the weights of the first low-pass filter according to the color saturation frequency of the current pixel to be corrected to obtain a second low-pass filter includes:

[0035] According to the mapping relationship between the color saturation frequency and a preset first weight adjustment coefficient, obtain the first weight adjustment coefficient corresponding to the color saturation frequency;

[0036] Multiply the obtained first weight adjustment coefficient by the weights of the first low-pass filter to obtain the second low-pass filter.

[0037] In a possible implementation manner, after obtaining the filtered color difference value of the pixel to be corrected and before obtaining the filtered color channel value of the pixel to be corrected, the method further includes:

[0038] According to the original color channel values of each pixel in the original RGB image and the size of the preset filtering window, obtain the brightness frequency of the pixel to be corrected;

[0039] According to the mapping relationship between the preset brightness frequency and the callback coefficient, obtain the color difference callback coefficient of the pixel to be corrected;

[0040] In the color difference plane, according to the original color difference value, the filtered color difference value, and the color difference callback coefficient of the pixel to be corrected, obtain the color difference value of the pixel to be corrected after color difference callback;

[0041] Determine the color difference value of the pixel to be corrected after color difference callback as the filtered color difference value of the pixel to be corrected.

[0042] In a possible implementation manner, obtaining the brightness frequency of the to-be-corrected pixel point according to the original color channel values of each pixel point in the original RGB image and the size of a preset filtering window includes the following steps performed respectively for each to-be-corrected pixel point among all the to-be-corrected pixel points:

[0043] Within the coverage of the filtering window with the current to-be-corrected pixel point as the center point, obtain the brightness value of each pixel point within the filtering window according to the color channel value, where the current to-be-corrected pixel point is any one of all the to-be-corrected pixel points;

[0044] According to the brightness values of each pixel point within the filtering window, obtain the brightness differences between all adjacent pixel points within the filtering window;

[0045] Add up the absolute values of the brightness differences between all adjacent pixel points within the filtering window to obtain the brightness frequency of the current to-be-corrected pixel point.

[0046] In a possible implementation manner, after obtaining the filtered color difference value of the to-be-corrected pixel point and before obtaining the filtered color channel value of the to-be-corrected pixel point, the method further includes:

[0047] According to the filtered color difference value of the to-be-corrected pixel point, obtain the absolute value of the filtered color difference of the to-be-corrected pixel point;

[0048] According to the original color difference value of the to-be-corrected pixel point, obtain the absolute value of the original color difference of the to-be-corrected pixel point;

[0049] In the case where the absolute value of the filtered color difference of the to-be-corrected pixel point is greater than the absolute value of the original color difference of the to-be-corrected pixel point, replace the filtered color difference value of the to-be-corrected pixel point with the absolute value of the original color difference of the to-be-corrected pixel point.

[0050] In a possible implementation manner, the method further includes the following steps performed respectively for each pixel point among all the pixel points:

[0051] Within the coverage of the filtering window with the current pixel point as the center point, in the case where the original color difference value of the current pixel point is the maximum value among the original color difference values of all pixel points within the filtering window, or in the case where the original color difference value of the current pixel point is the minimum value among the original color difference values of all pixel points within the filtering window, determine the current pixel point as an isolated pixel point;

[0052] Obtain a first low-pass filter, adjust the weights of the first low-pass filter to obtain a third low-pass filter, such that the filtering intensity of the third low-pass filter for the isolated pixel point is greater than the filtering intensity of the first low-pass filter for the isolated pixel point;

[0053] In the color difference plane, use the third low-pass filter to perform low-pass filtering on the isolated pixel point to obtain the filtered color difference value of the isolated pixel point, and determine the filtered color difference value of the isolated pixel point as the filtered color difference value of the pixel point to be corrected.

[0054] In a possible implementation manner, the method further includes the following steps respectively performed for each pixel point among the respective pixel points:

[0055] Within the coverage of the filtering window centered on the current pixel point, obtain the color edge position judgment result of the current pixel point through color direction detection;

[0056] In the case where the current pixel point is a color edge position, obtain a first low-pass filter, adjust the weights of the first low-pass filter to obtain a fourth low-pass filter, such that the gray level after filtering the color edge position by the fourth low-pass filter is greater than the gray level before filtering;

[0057] In the color difference plane, use the fourth low-pass filter to perform low-pass filtering on the color edge position to obtain the filtered color difference value of the color edge position, and determine the filtered color difference value of the color edge position as the filtered color difference value of the pixel point to be corrected.

[0058] A filtering and correction device for high-frequency pseudo-color suppression, the device includes:

[0059] An image acquisition module, configured to execute acquiring an original RGB image, where the original RGB image contains the original color channel values of each pixel point;

[0060] An original color difference value acquisition module, configured to execute obtaining the original color difference values of each pixel point in the original RGB image according to the original color channel values of each pixel point in the original RGB image, and forming the color difference plane of the original RGB image from the original color difference values of each pixel point;

[0061] A pixel point to be corrected determination module, configured to execute determining the pixel points to be corrected contained in the original RGB image according to the original color channel values of each pixel point and the size of a preset filtering window;

[0062] A filtering module, configured to execute performing low-pass filtering on the pixel point to be corrected in the color difference plane to obtain the filtered color difference value of the pixel point to be corrected;

[0063] A filtered color channel value obtaining module, configured to execute obtaining a filtered color channel value of the pixel to be corrected according to the filtered color difference value of the pixel to be corrected and the original color channel value of the pixel to be corrected;

[0064] A filtered image obtaining module, configured to execute obtaining a filtered and corrected RGB image according to the filtered color channel value of the pixel to be corrected and the original color channel values of other pixels except the pixel to be corrected in the original RGB image.

[0065] As can be seen from the above solution, the filtering and correction method and device of the present disclosure perform low-pass filtering on the pixels with high-frequency false colors in the color difference plane, achieving the effect of reducing color difference, being able to reduce or even eliminate the high-frequency false colors of the pixels after low-pass filtering. At the same time, the present disclosure uses the color saturation frequency to determine the pixels with high-frequency false colors, improving the recognition accuracy of the pixels with high-frequency false colors. In addition, the technical solution of the present disclosure can also simultaneously realize the detection of isolated pixels and color edge points based on the color difference plane, and achieve the purpose of reducing the color difference between the isolated pixels and the surrounding pixels and reducing or even eliminating the color edge false colors through low-pass filtering. The filtering and correction method and device of the present disclosure realize the suppression of high-frequency false colors, isolated pixels, or color edge false colors based on the RGB image, and play a good role in suppressing the false colors in the image caused by the defects of the Bayer image interpolation algorithm and lens color difference. Description of the Drawings

[0066] Figure 1 is a schematic flowchart of a filtering and correction method shown according to an exemplary embodiment;

[0067] Figure 2 is a schematic diagram of a filtering window and a filter shown according to an exemplary embodiment;

[0068] Figure 3 is a schematic flowchart of a process for determining a pixel to be corrected shown according to an exemplary embodiment;

[0069] Figure 4 is a schematic flowchart of a process for obtaining a color saturation frequency shown according to an exemplary embodiment;

[0070] Figure 5 is a schematic flowchart of a process for obtaining a filtered color difference value of a pixel to be corrected shown according to an exemplary embodiment;

[0071] Figure 6 is a schematic flowchart of a process for obtaining a second low-pass filter shown according to an exemplary embodiment;

[0072] Figure 7It is a schematic flowchart showing the callback of the filtered color difference value according to the brightness frequency according to a schematic embodiment;

[0073] Figure 8 It is a schematic flowchart showing the process of obtaining the brightness frequency according to a schematic embodiment;

[0074] Figure 9 It is a schematic flowchart showing the process of the color saturation protection mechanism according to a schematic embodiment;

[0075] Figure 10 It is a schematic flowchart showing the process of eliminating isolated pixel points according to a schematic embodiment;

[0076] Figure 11 It is a schematic flowchart showing the suppression of color edges according to a schematic embodiment;

[0077] Figure 12 It is a schematic flowchart of the application scenario of the filtering correction method according to a schematic embodiment;

[0078] Figure 13 It is a schematic diagram of the logical structure of a filtering correction device according to a schematic embodiment;

[0079] Figure 14 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0080] In order to make the objectives, technical solutions and advantages of the present disclosure clearer and more understandable, the following examples are given with reference to the accompanying drawings to further elaborate on the present disclosure in detail.

[0081] It should be noted that the terms "first", "second", etc. in the description and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are only examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0082] Figure 1 It is a schematic flowchart of a filtering correction method according to a schematic embodiment. The filtering correction method is used for high-frequency false color suppression, as Figure 1 shown. The filtering correction method mainly includes the following steps 101 to 106.

[0083] Step 101: Obtain the original RGB image, where the original RGB image contains the original color channel values of each pixel point.

[0084] In a schematic embodiment, the original RGB image may be obtained by CFA interpolation of a Bayer image. Based on this, the filtering and correction method of the embodiments of the present disclosure can further filter and suppress or even eliminate the high-frequency false colors that cannot be eliminated during the CFA interpolation process.

[0085] In a schematic embodiment, the original color channel values of each pixel point include the original R channel value, the original G channel value, and the original B channel value. Among them, the R channel is the red channel, the G channel is the green channel, and the B channel is the blue channel. In order to distinguish from the RGB image after filtering and correction, here, the color channel values of each pixel point in the original RGB image are named the original color channel values, specifically, named the original R channel value, the original G channel value, and the original B channel value.

[0086] Step 102: According to the original color channel values of each pixel point in the original RGB image, obtain the original color difference values of each pixel point in the original RGB image, and form the color difference plane of the original RGB image from the original color difference values of each pixel point.

[0087] In a schematic embodiment, each pixel point refers to the original color channel values of each pixel point in the original RGB image, and the original color channel values include the original R channel value, the original G channel value, and the original B channel value.

[0088] In a schematic embodiment, the original color difference values include at least one of the original Gr color difference value and the original Gb color difference value. Among them, the original Gr color difference value is the difference between the original G channel value and the original R channel value, and the original Gb color difference value is the difference between the original G channel value and the original B channel value.

[0089] In a schematic embodiment, the color difference plane includes at least one of the Gr color difference plane and the Gb color difference plane. Among them, the Gr color difference plane is formed by the original Gr color difference values of each pixel point, and the Gb color difference plane is formed by the original Gb color difference values of each pixel point.

[0090] In a schematic embodiment, the original color difference value of any pixel point in the original RGB image is the difference between the G channel value and the R channel value of the any pixel point, or the original color difference value of any pixel point in the original RGB image is the difference between the G channel value and the B channel value of the any pixel point.

[0091] Based on this, in a schematic embodiment, step 102 may include:

[0092] For any one of the individual pixel points, the difference between the original G-channel value and the original R-channel value of the any one pixel point is determined as the original Gr color difference value of the any one pixel point;

[0093] and / or,

[0094] For any one of the individual pixel points, the difference between the original G-channel value and the original B-channel value of the any one pixel point is determined as the original Gb color difference value of the any one pixel point.

[0095] Expressed by a formula, step 102 may include obtaining the original color difference value through the following formula:

[0096] Gr = G – R

[0097] Gb = G – B

[0098] where Gr is the original Gr color difference value, Gb is the original Gb color difference value, G is the original G-channel value, R is the original R-channel value, and B is the original B-channel value.

[0099] Through the above formula, the original Gr color difference value of each pixel point in the original RGB image is obtained. The Gr color difference plane of the original RGB image is constituted by the original Gr color difference values of each pixel point, and the Gb color difference plane of the original RGB image is constituted by the original Gb color difference values of each pixel point. In step 102, the color difference plane of the original RGB image includes: the Gr color difference plane of the original RGB image, and / or, the Gb color difference plane of the original RGB image.

[0100] Step 103: Determine the pixel points to be corrected contained in the original RGB image according to the original color channel values of each pixel point and the size of a preset filtering window.

[0101] Generally speaking, the filtering method for an image is to perform a filtering operation on each pixel point in the image according to the filtering requirement by using a preset filter, such as a high-pass filter or a low-pass filter.

[0102] Figure 2 is a schematic diagram of a filtering window and a filter shown according to an exemplary embodiment. Referring to Figure 2 as shown, the size of the filtering window 202 corresponds to the number of pixel points in the area where the pixel point to be filtered in the image 201 is located. For example Figure 2 as shown, the area of the filtering window 202 contains 25 pixel points b 11 to pixel point b 55, these pixel points are arranged in a 5×5 matrix. Based on this, if the size of the filtering window is set to 5×5, it means that the size of the filtering window is an area that horizontally contains 5 pixel points and vertically contains 5 pixel points. Similarly, if the size of the filtering window is set to 3×3, it means that the size of the filtering window is an area that horizontally contains 3 pixel points and vertically contains 3 pixel points, and so on. The size of the filtering window can be set according to actual needs. For example, in the embodiments of the present disclosure, the size of the filtering window can be set to 5×5. Figure 2 In the illustrated embodiment, if the pixel point to be filtered currently is pixel point b 33 , the range covered by the filtering window 202 is the range covered by the filtering window 202 centered on pixel point b 33 , that is, the range covered by the filtering window 202 is from pixel point b 11 to pixel point b 55 .

[0103] Continuing to refer to Figure 2 as shown, the size of the filter 203 is the same as that of the filtering window 202, and also corresponds to the number of pixel points in the image 201. The weight of the filter refers to the weight values respectively corresponding to the individual pixel points within the filtering window. For example Figure 2 as shown, the weight of the filter 203 includes weight values a 11 to a 55 , which respectively correspond to the weight values of the pixel points b 11 to pixel point b 55 within the filtering window 202, that is, the weight value a 11 is the weight value corresponding to pixel point b 11 ... The weight value a 55 is the weight value corresponding to pixel point b 55 .

[0104] In the illustrative embodiment, filtering a certain pixel point in the image means performing a convolution operation on the pixel points within the filtering window centered on this pixel point using the filter to obtain the pixel value of this pixel point after filtering. For example Figure 2 as shown, filtering pixel point b 33 in the image 201 is to perform a convolution operation on the pixel points b 33 to b 11 within the filtering window 202 centered on this pixel point b 55 using the filter 203 to obtain the pixel value of this pixel point b 33 after filtering. Among them, the convolution operation is for pixel point b 11 to b 55The convolution operation performed on the pixel values. In this description, the pixel values can be the brightness values of pixel points, the values of a certain color channel, or color difference values, etc. According to the needs, the convolution operation can be performed on the parameter values such as the brightness value, the value of a certain color channel, or the color difference value that are used to represent the pixel values of pixel points to achieve the desired filtering purpose.

[0105] Figure 3 is a flowchart showing the process of determining the pixel points to be corrected according to a schematic embodiment. As Figure 3 shown, in the schematic embodiment, step 103 may include obtaining the pixel points to be corrected through the following steps 301 to 302.

[0106] Step 301: Obtain the color saturation frequency of each pixel point according to the original color channel values of each pixel point and the size of the preset filtering window.

[0107] Among them, the color saturation frequency refers to the spatial frequency of the change in color saturation, which reflects the fluctuation of the color saturation of the image in spatial change. Since the color saturation in the high-frequency false color area of the image shows the characteristics of high-frequency change in spatial change, therefore, using the color saturation frequency to determine whether the area where the pixel point is located is a high-frequency false color area can obtain reliable results. Furthermore, after using the color saturation frequency to determine that the pixel point is a pixel point in the high-frequency false color area, performing targeted low-pass filtering on the pixel points in the high-frequency false color area can well suppress the high-frequency false color.

[0108] In the schematic embodiment, the color saturation frequency of any pixel point in the original RGB image can be obtained by processing the original color channel values of each pixel point within the filtering window range for the any pixel point. Figure 4 is a flowchart showing the process of obtaining the color saturation frequency according to a schematic embodiment. As Figure 4 shown, step 301 may include the following steps 401 to 403 performed for each pixel point among all pixel points respectively.

[0109] Step 401: Within the coverage range of the filtering window with the current pixel point as the center point, obtain the color saturation of each pixel point within the filtering window according to the original color channel values.

[0110] In the schematic embodiment, the current pixel point is any pixel point among all pixel points.

[0111] In a schematic embodiment, filtering of an image is achieved by performing a convolution operation on each pixel point in the image one by one using a filter. On this basis, in the schematic embodiment, to obtain the color saturation frequency of each pixel point in the original RGB image, each pixel point in the original RGB image can be processed one by one using a filtering window (the size of the filtering window is the same as the size of the low-pass filter).

[0112] Combined Figure 2 As shown, for example, for pixel point b 33 to obtain the color saturation frequency, in step 401, within the coverage of the filtering window 202 centered on pixel point b 33 , the color saturation of each pixel point (from pixel point b 11 to pixel point b 55 ) within the filtering window 202 is obtained based on the original color channel values of the original RGB image.

[0113] In the schematic embodiment, expressed by a formula, for any arbitrary pixel point, step 401 may include obtaining the color saturation of the arbitrary pixel point through the following formula:

[0114] Max_clr = MAX(R, G, B)

[0115] Min_clr = MIN(R, G, B)

[0116] Sat = Max_clr – Min_clr

[0117] Wherein, Max_clr represents the maximum color value of the arbitrary pixel point, Min_clr represents the minimum color value of the arbitrary pixel point, R is the original R channel value of the arbitrary pixel point, G is the original G channel value of the arbitrary pixel point, B is the original B channel value of the arbitrary pixel point, MAX(R, G, B) represents taking the maximum value among R, G, and B, MIN(R, G, B) represents taking the minimum value among R, G, and B, and Sat is the color saturation of the arbitrary pixel point.

[0118] In step 401, by executing the above formula for each pixel point within the filtering window, the color saturation of each pixel point within the filtering window can be obtained.

[0119] Step 402: Obtain the color saturation differences between all adjacent pixel points within the filtering window based on the color saturation of each pixel point within the filtering window.

[0120] Taking Figure 2 as an example, in the filtering window 202, pixel point b 11 and pixel point b 12are adjacent pixel points, pixel point b 12 and pixel point b 13 are adjacent pixel points, pixel point b 11 and pixel point b 21 are adjacent pixel points, pixel point b 21 and pixel point b 31 are adjacent pixel points, and so on. In the process of obtaining the color saturation frequency of pixel point b 33 Step 402 includes: within the filtering window 202, based on the color saturation of pixel point b 11 within the filtering window and the color saturation of pixel point b 12 to obtain the color saturation difference between pixel point b 11 and pixel point b 12 , that is, subtracting the color saturation of pixel point b 11 within the filtering window from the color saturation of pixel point b 12 to obtain the color saturation difference between pixel point b 11 and pixel point b 12 . In this way, the color saturation differences between pixel point b 12 and pixel point b 13 , the color saturation differences between pixel point b 11 and pixel point b 21 , the color saturation differences between pixel point b 21 and pixel point b 31 , etc. are obtained.

[0121] Step 403: Add up the absolute values of the color saturation differences between all adjacent pixel points within the filtering window to obtain the color saturation frequency of the current pixel point.

[0122] Taking Figure 2 as an example, in the process of obtaining the color saturation frequency of pixel point b 33 , Step 403 includes: within the filtering window 202, taking the absolute value of the color saturation difference between pixel point b 11 and pixel point b 12 , taking the absolute value of the color saturation difference between pixel point b 12 and pixel point b 13 , taking the absolute value of the color saturation difference between pixel point b 11 and pixel point b 21 , taking the absolute value of the color saturation difference between pixel point b 21 and pixel point b 31 , etc.; after obtaining the absolute values of all color saturation differences within the filtering window 202, add up the absolute values of all color saturation differences within the filtering window 202 to obtain the color saturation frequency of pixel point b 33Color saturation frequency.

[0123] From the above Figure 2 example, it can be seen that the color saturation frequency of pixel point b 33 reflects the degree of change in color saturation among all pixel points in the local area where pixel point b 33 is located (i.e., the area covered by the filtering window 202). If the obtained color saturation frequency of pixel point b 33 is high, it represents that the color change in this local area (i.e., the area covered by the filtering window 202) is very intense, meaning there is a very high possibility of high-frequency false color. If the obtained color saturation frequency of pixel point b 33 is low, it represents that the color change in this local area (i.e., the area covered by the filtering window 202) is very flat, meaning there is a very low possibility of high-frequency false color. In an extreme example, if the obtained color saturation frequency of pixel point b 33 is 0, it represents that there is no color change in this local area (i.e., the area covered by the filtering window 202), that is, the colors of all pixel points in this local area (i.e., the area covered by the filtering window 202) are exactly the same, indicating that this local area (i.e., the area covered by the filtering window 202) is not a high-frequency false color area.

[0124] The following uses an example to illustrate how to obtain the color saturation frequency:

[0125] Assume that the color saturation matrix composed of the color saturations of all pixel points within a 5×5 filtering window centered on the current pixel point obtained through step 401 is:

[0126]

[0127]

[0128] Among them, the color saturation of the current pixel point is 22.

[0129] Among them, in the horizontal direction, the absolute values of the color saturation differences between adjacent pixel points obtained through step 402 and step 403 are as described below:

[0130] Row 0: abs(00 - 01), abs(01 - 02), abs(02 - 03), abs(03 - 04);

[0131] Row 1: abs(10 - 11), abs(11 - 12), abs(12 - 13), abs(13 - 14);

[0132] Line 2: abs(20 - 21), abs(21 - 22), abs(22 - 23), abs(23 - 24);

[0133] Line 3: abs(30 - 31), abs(31 - 32), abs(32 - 33), abs(33 - 34);

[0134] Line 4: abs(40 - 41), abs(41 - 42), abs(42 - 43), abs(43 - 44);

[0135] In the vertical direction, the absolute value of the color saturation difference between adjacent pixel points obtained after steps 402 and 403 is as described below:

[0136] Column 0: abs(00 - 10), abs(10 - 20), abs(20 - 30), abs(30 - 40);

[0137] Column 1: abs(01 - 11), abs(11 - 21), abs(21 - 31), abs(31 - 41);

[0138] Column 2: abs(02 - 12), abs(12 - 22), abs(22 - 32), abs(32 - 42);

[0139] Column 3: abs(03 - 13), abs(13 - 23), abs(23 - 33), abs(33 - 43);

[0140] Column 4: abs(04 - 14), abs(14 - 24), abs(24 - 34), abs(34 - 44);

[0141] Furthermore, in step 403, the result of adding up the absolute values of the color saturation differences between all adjacent pixel points from row 0 to row 4 and from column 0 to column 4 is determined as the color saturation frequency of the current pixel point, i.e.:

[0142] abs(00 - 01) + abs(01 - 02) + abs(02 - 03) + abs(03 - 04) + abs(10 - 11) + abs(11 - 12) + abs(12 - 13) + abs(13 - 14) + abs(20 - 21) + abs(21 - 22) + abs(22 - 23) + abs(23 - 24) + abs(30 - 31) + abs(31 - 32) + abs(32 - 33) + abs(33 - 34) + abs(40 - 41) + abs(41 - 42) + abs(42 - 43) + abs(43 - 44) + abs(00 - 10) + abs(10 - 20) + abs(20 - 30) + abs(30 - 40) + abs(01 - 11) + abs(11 - 21) + abs(21 - 31) + abs(31 - 41) + abs(02 - 12) + abs(12 - 22) + abs(22 - 32) + abs(32 - 42) + abs(03 - 13) + abs(13 - 23) + abs(23 - 33) + abs(33 - 43) + abs(04 - 14) + abs(14 - 24) + abs(24 - 34) + abs(34 - 44) = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 = 220

[0143] That is, the color saturation frequency of the current pixel is 220.

[0144] Step 302: Determine the pixels whose color saturation frequencies are within the preset color saturation frequency threshold range as the pixels to be corrected.

[0145] The magnitude of the color saturation frequency reflects the severity of the spatial variation of colors in the image. Since the pixel values of each pixel in the image, the image as a whole presents the content recorded in the image. That is to say, from a certain perspective, the content of the image is also reflected by the spatial variation of colors in the image. Therefore, there is a connection between the magnitude of the color saturation frequency and whether it is high-frequency false color, but it does not mean that the existence of a color saturation frequency necessarily means high-frequency false color. In fact, there is a certain correlation between high-frequency false color and the color saturation frequency, that is, when the color saturation frequency is within a certain or certain ranges, it means a higher possibility of high-frequency false color.

[0146] Under normal circumstances, when the color saturation frequency is lower than a certain value, it means that the colors in the image are real in terms of spatial variation rather than false colors. Based on this, in the illustrative embodiment, in step 302, the color saturation frequency threshold range can be higher than a certain set color saturation frequency threshold. Furthermore, step 302 includes: determining the pixel points with a color saturation frequency greater than the preset color saturation frequency threshold as the pixel points to be corrected.

[0147] Among them, the color saturation frequency threshold range may be affected by the size of the filtering window and the content presented in the image. Therefore, in the illustrative embodiment, the color saturation frequency threshold range can be adjusted according to experience and needs to achieve an ideal screening effect for the pixel points to be corrected.

[0148] It can be seen from the above description that high-frequency false colors will appear in places with a relatively large color saturation frequency. Therefore, the pixel points to be corrected determined through the above steps indicate the highest possibility of being pixel points in the high-frequency false color area.

[0149] According to the setting of the color saturation frequency threshold range, the pixel points to be corrected obtained after step 302 mean that they are pixel points in the high-frequency false color area. By performing the above steps on each pixel point in the original RGB image, all the pixel points in the high-frequency false color area of the original RGB image can be determined. On this basis, through subsequent low-pass filtering steps, all the pixel points in the high-frequency false color area can be individually low-pass filtered to reduce or even eliminate high-frequency false colors.

[0150] Step 104: In the color difference plane, perform low-pass filtering on the pixel points to be corrected to obtain the filtered color difference values of the pixel points to be corrected.

[0151] Low-pass filtering means filtering out high-frequency information and retaining low-frequency information. The high-frequency false color area contains high-frequency information, and low-pass filtering can reduce or even eliminate the high-frequency information therein. However, there are also differences in the frequency levels of high-frequency false colors. Therefore, the weight values in the filter used play a decisive role in the degree of eliminating high-frequency false colors. Therefore, it is necessary to adaptively adjust the weight values of the filter when performing low-pass filtering.

[0152] In the illustrative embodiment, in step 104, low-pass filtering is performed in the color difference plane, which can achieve the effect of reducing the color difference. It means that after reducing the color difference and then restoring it to the RGB color channels, the color differences of each pixel point corresponding to the high-frequency false color area in the original RGB image are significantly reduced, thereby achieving the purpose of reducing or even eliminating high-frequency false colors.

[0153] Figure 5 It is a schematic flowchart of obtaining the filtered color difference values of the pixel points to be corrected shown according to an illustrative embodiment, asFigure 5 As shown, in the illustrative embodiment, step 104 may specifically include the processes of steps 501 to 503 performed for each pixel to be corrected respectively.

[0154] Step 501: Obtain a first low-pass filter, and the size of the first low-pass filter is equal to the size of the filtering window.

[0155] In the illustrative embodiment, the first low-pass filter may be a general low-pass filter with initialized weight values.

[0156] Step 502: Adjust the weights of the first low-pass filter according to the color saturation frequency of the current pixel to be corrected, to obtain a second low-pass filter, such that the filtering intensity of the second low-pass filter for the current pixel to be corrected is greater than the filtering intensity of the first low-pass filter for the current pixel to be corrected.

[0157] Since the first low-pass filter may be a general low-pass filter with initialized weight values, there may be a problem that the suppression effect of high-frequency false colors is insufficient due to insufficient filtering intensity. Therefore, it is necessary to adjust the weights of the first low-pass filter to obtain a second low-pass filter, so that the filtering intensity of the second low-pass filter for the current pixel to be corrected is greater than the filtering intensity of the first low-pass filter for the current pixel to be corrected, to achieve the purpose of suppressing high-frequency false colors.

[0158] As above, the high-frequency false colors have different frequency degrees. Therefore, different low-pass filter weights are required to perform corresponding processing for high-frequency false colors with different frequency degrees, so as to achieve a better effect of suppressing high-frequency false colors. In this case, there is an inevitable connection between the determination of the weights of the second low-pass filter and the color saturation frequency, and it is necessary to determine the weights of the second low-pass filter according to the color saturation frequency. Figure 6 is a schematic flowchart of obtaining the second low-pass filter shown according to an illustrative embodiment. As Figure 6 shown, step 502 may specifically include the following steps 601 to 602.

[0159] Step 601: Obtain a first weight adjustment coefficient corresponding to the color saturation frequency according to the mapping relationship between the color saturation frequency and a preset first weight adjustment coefficient.

[0160] In the illustrative embodiment, the mapping relationship between the color saturation frequency and the preset first weight adjustment coefficient may be set according to needs and / or experience. In the illustrative embodiment, the first weight adjustment coefficient may be a set of parameters, corresponding to each weight value in the low-pass filter. For example Figure 2As shown, the filter 203 is a 5×5 filter, which contains 25 weight values. The first weight adjustment coefficient for the filter 203 can include 25 parameters, and each parameter corresponds to one weight value respectively.

[0161] Step 602: Multiply the obtained first weight adjustment coefficient by the weights of the first low-pass filter to obtain a second low-pass filter.

[0162] Taking Figure 2 the filter 203 shown as an example, in step 602, the obtained first weight adjustment coefficient is a set of parameters, including 25 parameters. Multiply these 25 parameters by the corresponding weight values in the filter 203 representing the first filter respectively to obtain the second low-pass filter.

[0163] Step 503: Perform low-pass filtering on the current pixel to be corrected using the second low-pass filter to obtain the filtered color difference value of the current pixel to be corrected.

[0164] In the illustrative embodiment, the filtering of a certain pixel is achieved by performing a convolution operation of the filter within a filtering window centered on this pixel. Taking Figure 2 the example shown, the pixel point b 33 represents the current pixel to be corrected, and the filter 203 represents the second low-pass filter. The filtering of the pixel point b 33 is performed by using the filter 203 to perform a convolution operation within the filtering window 202.

[0165] It should be emphasized again that the low-pass filtering is performed in the color difference plane.

[0166] Step 105: Obtain the filtered color channel value of the pixel to be corrected according to the filtered color difference value of the pixel to be corrected and the original color channel value of the pixel to be corrected.

[0167] As described above, in the illustrative embodiment, step 102 may include: for any one pixel among all pixel points, determining the difference between the original G channel value and the original R channel value of this any one pixel as the original Gr color difference value of this any one pixel; and / or, for any one pixel among all pixel points, determining the difference between the original G channel value and the original B channel value of this any one pixel as the original Gb color difference value of this any one pixel. On this basis, step 105 may include:

[0168] For any one pixel to be corrected, determining the difference between the original G channel value of this any one pixel to be corrected and the filtered Gr color difference value of this any one pixel to be corrected as the filtered R channel value of this any one pixel to be corrected;

[0169] and / or,

[0170] For any pixel to be corrected, the difference between the original G-channel value of the any pixel to be corrected and the filtered Gb color difference value of the any pixel to be corrected is determined as the filtered B-channel value of the any pixel to be corrected.

[0171] In the exemplary embodiment, the color difference plane includes at least one of the Gr color difference plane and the Gb color difference plane.

[0172] In the exemplary embodiment, if the operation is based on the Gr color difference plane, step 102 includes: for any one of the pixels in each pixel, the difference between the original G-channel value of the any pixel and the original R-channel value of the any pixel is determined as the original Gr color difference value of the any pixel; and step 105 includes: for any pixel to be corrected, the difference between the original G-channel value of the any pixel to be corrected and the filtered Gr color difference value of the any pixel to be corrected is determined as the filtered R-channel value of the any pixel to be corrected.

[0173] In the exemplary embodiment, if the operation is based on the Gb color difference plane, step 102 includes: for any one of the pixels in each pixel, the difference between the original G-channel value of the any pixel and the original B-channel value of the any pixel is determined as the original Gb color difference value of the any pixel; and step 105 includes: for any pixel to be corrected, the difference between the original G-channel value of the any pixel to be corrected and the filtered Gb color difference value of the any pixel to be corrected is determined as the filtered B-channel value of the any pixel to be corrected.

[0174] In the exemplary embodiment, in the filtering and correction method of the present disclosure embodiment, the above operations are performed on both the Gr color difference plane and the Gb color difference plane to suppress the high-frequency false color based on the Gr color difference and the Gb color difference, ensuring a good high-frequency false color suppression effect.

[0175] Expressed by a formula, step 105 may include obtaining the filtered R-channel value of any pixel to be corrected through the following formula:

[0176] R_new = G – Gr_flt

[0177] Wherein, R_new is the filtered R-channel value of the any pixel to be corrected, G is the original G-channel value of the any pixel to be corrected, and Gr_flt is the difference between the filtered Gr color difference values of the any pixel to be corrected;

[0178] And / or, step 105 may include obtaining the filtered B channel value of any pixel to be corrected by the following formula:

[0179] B_new=G–Gb_flt

[0180] Wherein, B_new is the filtered B channel value of any pixel to be corrected, and Gb_flt is the difference of the filtered Gb color difference values ​​of any pixel to be corrected.

[0181] In the disclosed embodiment, low-pass filtering is performed based on the color difference plane, and in step 105, the Gr and / or Gb color difference values ​​of the pixel to be corrected after filtering are obtained according to the difference between the original G channel value of the pixel to be corrected and the Gr and / or Gb color difference values ​​after filtering. It can be seen that the G channel value of the pixel to be corrected remains unchanged before and after filtering. In the disclosed embodiment, the original G channel value of the pixel to be corrected is controlled to remain unchanged because if the G channel value of the pixel to be corrected is also changed, then the values ​​of the three channels of R, G, and B after the adjustment of the pixel to be corrected will all change, which is likely to cause the color difference between the pixel to be corrected and the pixel not to be corrected after low-pass filtering to change too much, causing the problem of poor RGB image presentation effect. In the disclosed embodiment, the original G channel value is controlled to remain unchanged, so that after filtering, the color transition between the pixel to be corrected and the pixel not to be corrected is natural, while achieving the purpose of high-frequency pseudo-color suppression, it also ensures the naturalness of the content presented by the RGB image, so that the color of the RGB image can be closer to the real color of the real scene captured.

[0182] Step 106: Obtain a filtered and corrected RGB image according to the filtered color channel values ​​of the to-be-corrected pixel and the original color channel values ​​of other pixels in the original RGB image except the to-be-corrected pixel.

[0183] In the exemplary embodiment, the filtered color channel value of the pixel to be corrected includes the filtered R channel value, the original G channel value and the filtered B channel value, and the original color channel values ​​of other pixels in the original RGB image except the pixel to be corrected include the original R channel value, the original G channel value and the original B channel value. After step 105, the R channel value, the G channel value and the B channel value of all pixels in the RGB image are complete information, except that the R channel value and / or the B channel value of the pixel in the high-frequency pseudo-color area has changed. Therefore, the filtered and corrected RGB image reconstructed after step 106 will reduce the effect of its high-frequency pseudo-color due to the adjustment of the R channel value and / or the B channel value of the pixel in the high-frequency pseudo-color area, thereby achieving the purpose of suppressing the high-frequency pseudo-color.

[0184] In the solutions mentioned in the above embodiments, using the color saturation frequency to determine the pixel points to be corrected can distinguish the high-frequency false colors in the image. However, through the analysis of the image, using the means of color saturation frequency will also misjudge the color edges or small color areas of some valid colors as high-frequency false colors. Through the analysis of the image, it is found that high-frequency false colors not only exist in areas with large color saturation changes, but also often appear in areas with high brightness contrast. Therefore, the high-frequency false colors and some valid colors can also be distinguished by using the brightness frequency information. Based on this, in the illustrative embodiment, corresponding corrections can be performed based on the brightness frequency after step 105 and before step 106.

[0185] In the illustrative embodiment, after obtaining the filtered color difference value of the pixel points to be corrected in step 104 and before obtaining the filtered color channel value of the pixel points to be corrected in step 105, the filtering correction method of the embodiments of the present disclosure further includes: performing a callback on the filtered color difference value according to the brightness frequency. Figure 7 FIG. is a schematic flowchart of performing a callback on the filtered color difference value according to the brightness frequency shown in an illustrative embodiment. In the illustrative embodiment, this process is performed after obtaining the filtered color difference value of the pixel points to be corrected in step 104 and before obtaining the filtered color channel value of the pixel points to be corrected in step 105. As Figure 7 shown, in the illustrative embodiment, the filtering correction method of the embodiments of the present disclosure further includes the processes of steps 701 to 704 performed after step 104 and before step 105.

[0186] Step 701: Obtain the brightness frequency of the pixel points to be corrected according to the original color channel values of each pixel point in the original RGB image and the size of the preset filtering window.

[0187] Among them, the brightness frequency refers to the spatial frequency of brightness change, which reflects the fluctuation of the brightness of the image in spatial change. In the illustrative embodiment, similar to the process of obtaining the color saturation frequency above, the brightness frequency is obtained by processing the brightness of the pixel points within the coverage of the filtering window.

[0188] Figure 8 FIG. is a schematic flowchart of obtaining the brightness frequency shown in an illustrative embodiment. As Figure 8 shown, in the illustrative embodiment, step 701 specifically includes the following steps 801 to 803 performed for each pixel point to be corrected among each pixel point to be corrected.

[0189] Step 801: Within the coverage of the filtering window with the current pixel point to be corrected as the center point, obtain the brightness value of each pixel point within the filtering window according to the color channel value.

[0190] In a schematic embodiment, the current pixel point to be corrected is any one of the pixel points to be corrected.

[0191] In a schematic embodiment, the brightness value of a pixel point can be obtained by the following formula:

[0192] Y = 0.299×R + 0.587×G + 0.114×B

[0193] Wherein, Y represents the brightness value of the pixel point, R represents the original R channel value of the pixel point, G represents the original G channel value of the pixel point, and B represents the original B channel value of the pixel point.

[0194] Combined with Figure 2 As shown, assuming that pixel point b 33 is the current pixel point to be corrected, then in step 801, within the coverage of the filtering window 202 centered on pixel point b 33 , the brightness value of each pixel point (from pixel point b 11 to pixel point b 55 ) is obtained through the above formula.

[0195] Step 802: Obtain the brightness difference between all adjacent pixel points within the filtering window according to the brightness value of each pixel point within the filtering window.

[0196] Taking Figure 2 as an example, in the process of obtaining the brightness frequency of pixel point b 33 , step 802 includes: within the filtering window 202, according to the brightness value of pixel point b 11 and the brightness value of pixel point b 12 , obtain the brightness difference between pixel point b 11 and pixel point b 12 , that is, subtract the brightness value of pixel point b 11 from the brightness value of pixel point b 12 to obtain the brightness difference between pixel point b 11 and pixel point b 12 , and so on, to obtain the brightness difference between pixel point b 12 and pixel point b 13 , the brightness difference between pixel point b 11 and pixel point b 21 , the brightness difference between pixel point b 21 and pixel point b 31 , and so on.

[0197] Step 803: Add the absolute values of the brightness differences between all adjacent pixel points within the filtering window to obtain the brightness frequency of the current pixel point to be corrected.

[0198] TakingFigure 2 Taking the example shown, in the process of obtaining the luminance frequency of pixel b 33 Step 803 includes: within the filtering window 202, taking the absolute value of the luminance difference between pixel b 11 and pixel b 12 , taking the absolute value of the luminance difference between pixel b 12 and pixel b 13 , taking the absolute value of the luminance difference between pixel b 11 and pixel b 21 , taking the absolute value of the luminance difference between pixel b 21 and pixel b 31 , and so on; after obtaining the absolute values of all the luminance differences within the filtering window 202, adding up the absolute values of all the luminance differences within the filtering window 202, the luminance frequency of pixel b 33 is obtained.

[0199] From the above Figure 2 example, it can be seen that the luminance frequency of pixel b 33 reflects the degree of change in the luminance values among all the pixels in the local area where pixel b 33 is located (i.e., the area covered by the filtering window 202). If the obtained luminance frequency of pixel b 33 is high, it represents that the luminance change in this local area (i.e., the area covered by the filtering window 202) is very intense, meaning that this local area may belong to the color edge of the effective color or a small color area. Therefore, the luminance frequency can be used to screen out the pixels misidentified as high-frequency false colors.

[0200] Step 702: Obtain the color difference callback coefficient of the pixel to be corrected according to the mapping relationship between the preset luminance frequency and the callback coefficient.

[0201] Different brightness frequencies reflect different degrees of change of brightness values. A high brightness frequency means that the brightness value changes more violently, which also means that the filtering intensity of the pixel to be corrected in the previous step is relatively large. Since in the previous step, while suppressing high-frequency pseudo-color, some effective color areas in the image (effective colors that truly reflect the content of the image) may also be lost due to filtering, that is to say, the colors of some pixels to be corrected actually belong to effective colors rather than high-frequency pseudo-colors. Therefore, for this situation, the color difference callback of the pixel to be corrected using the brightness frequency can reduce the influence of the filtering process on the pixels of effective colors. Based on this, the mapping relationship between the brightness frequency and the callback coefficient can be set according to experience or demand. Generally speaking, the brightness frequency of the high-frequency pseudo-color area may appear in a certain brightness frequency interval or certain brightness frequency intervals, which can be obtained by analyzing the image. Therefore, the brightness frequency interval where the brightness frequency of the high-frequency pseudo-color area is located can be obtained from multiple sample images by analyzing the relationship between the brightness frequency and the high-frequency pseudo-color area (such as higher than the first brightness frequency threshold and lower than the second brightness frequency threshold, wherein the second brightness frequency threshold is greater than the first brightness frequency threshold). On this basis, the mapping relationship between the brightness frequency and the callback coefficient is set so that the pixels to be corrected whose brightness frequency is within the brightness frequency interval of the high-frequency pseudo-color area (meaning that the possibility that the pixels to be corrected are high-frequency pseudo-color pixels is very small) can achieve a smaller color difference callback or even no color difference callback, and the pixels to be corrected whose brightness frequency is outside the brightness frequency interval of the high-frequency pseudo-color area (meaning that the possibility that the pixels to be corrected are high-frequency pseudo-color pixels is very small) can achieve a larger color difference callback. This reduces the impact of filtering the pixels to be corrected in the previous step on non-high-frequency pseudo-color pixels.

[0202] Step 703: In the color difference plane, according to the original color difference value of the pixel to be corrected, the filtered color difference value, and the color difference correction coefficient, the color difference value of the pixel to be corrected after the color difference correction is obtained.

[0203] In an exemplary embodiment, step 703 includes obtaining the Gr color difference value of the pixel to be corrected after the color difference is adjusted in the Gr color difference plane, and obtaining the Gb color difference value of the pixel to be corrected after the color difference is adjusted in the Gb color difference plane.

[0204] In an exemplary embodiment, in the Gr color difference plane, step 703 can obtain the Gr color difference value of the pixel to be corrected after the color difference is adjusted back by the following formula:

[0205] GR=GR_re+(GR_src–GR_re)*ratio

[0206] Among them, GR_src is the original Gr color difference value of the pixel point to be corrected, GR_re is the filtered Gr color difference value of the pixel point to be corrected, ratio is the color difference callback coefficient of the pixel point to be corrected, and GR is the Gr color difference value after color difference callback of the pixel point to be corrected.

[0207] In the illustrative embodiment, in the Gb color difference plane, step 703 can obtain the Gb color difference value after color difference callback of the pixel point to be corrected through the following formula:

[0208] GB = GB_re + (GB_src – GB_re) * ratio

[0209] Among them, GB_src is the original Gb color difference value of the pixel point to be corrected, GB_re is the filtered Gb color difference value of the pixel point to be corrected, ratio is the color difference callback coefficient of the pixel point to be corrected, and GB is the Gb color difference value after color difference callback of the pixel point to be corrected.

[0210] In the above embodiment, the setting range of ratio is [0, 1]. If ratio is 1, then the Gr color difference value after color difference callback is GR_src (the original Gr color difference value of the pixel point to be corrected), and the Gb color difference value after color difference callback is GB_src (the original Gb color difference value of the pixel point to be corrected), which is equivalent to that the pixel point to be corrected has not undergone the previous filtering process. This situation means that the color of the pixel point to be corrected should be the true image color in the image rather than the high-frequency false color. Therefore, based on the formula of the above embodiment, in the mapping relationship between the brightness frequency and the callback coefficient, the color difference callback coefficient corresponding to the brightness frequency within the brightness frequency interval of the high-frequency false color region is less than the color difference callback coefficient corresponding to the brightness frequency outside the brightness frequency interval of the high-frequency false color region, and moreover, the color difference callback coefficient corresponding to the brightness frequency farther away from the brightness frequency interval of the high-frequency false color region is larger.

[0211] Step 704: Determine the color difference value after color difference callback of the pixel point to be corrected as the filtered color difference value of the pixel point to be corrected.

[0212] It can be seen that there may be differences between the filtered color difference value of the pixel point to be corrected obtained after steps 701 to 704 and the filtered color channel value of the pixel point to be corrected obtained after step 104. Steps 701 to 704 are the correction of the pixel point to be corrected, which is the compensation for the pixel point to be corrected that may be misjudged based on the brightness. After combining steps 701 to 704, the filtering and correction method of the embodiments of the present disclosure can make the color difference of the pixel points misrecognized as high-frequency false colors be callback, which helps to obtain a better high-frequency false color suppression effect.

[0213] In addition, in combination with the correction of isolated pixel points and color edge suppression described later, in the exemplary embodiment, the callback of color channel values according to the brightness frequency in the above steps 701 to 704 is also applicable to be executed after isolated pixel filtering and color edge filtering, so as to callback the color difference of the pixel points misidentified as isolated pixel points or color edge positions. In the exemplary embodiment, the process of the correction of isolated pixel points and color edge suppression described later can be executed synchronously with the above process of high-frequency false color suppression. For example, if the current pixel point is determined to be a high-frequency false color pixel point, a low-pass filter corresponding to high-frequency false color is executed; if the current pixel point is determined to be an isolated pixel point, a low-pass filter corresponding to the isolated pixel point is executed; if the current pixel point is determined to be a color edge position, a low-pass filter corresponding to the color edge position is executed, and then the process of callback of color channel values according to the brightness frequency in steps 701 to 704 is executed for the current pixel point.

[0214] The core idea of high-frequency false color suppression is to reduce the color saturation of high-frequency false colors. In the exemplary embodiment, there may be a situation where the absolute value of the color difference after filtering of individual pixel points is greater than the absolute value of the original color difference due to improper weight values of the low-pass filter or other reasons. This situation will lead to an increase in the color saturation of individual pixel points after filtering, which is not conducive to high-frequency false color suppression. Therefore, in order to eliminate this influence, in the exemplary embodiment, the filtering correction method of the present disclosure embodiment can further include a color saturation protection mechanism process, which is specifically as follows.

[0215] Figure 9 is a flowchart of a color saturation protection mechanism process shown according to an exemplary embodiment, as Figure 9 shown, in the exemplary embodiment, after obtaining the color difference value after filtering of the pixel point to be corrected in step 104 and before obtaining the color channel value after filtering of the pixel point to be corrected in step 105, the filtering correction method of the present disclosure embodiment can further include the following steps 901 to 903 of the color saturation protection mechanism process.

[0216] Step 901: Obtain the absolute value of the color difference after filtering of the pixel point to be corrected according to the color difference value after filtering of the pixel point to be corrected.

[0217] Step 902: Obtain the absolute value of the original color difference of the pixel point to be corrected according to the original color difference value of the pixel point to be corrected.

[0218] Step 903: In the case where the absolute value of the color difference after filtering of the pixel point to be corrected is greater than the absolute value of the original color difference of the pixel point to be corrected, replace the color difference value after filtering of the pixel point to be corrected with the absolute value of the original color difference of the pixel point to be corrected.

[0219] In a schematic embodiment, the process of the color saturation protection mechanism in the above steps 901 to 903 may be executed after the color channel values are called back according to the brightness frequency in steps 701 to 704 are completed.

[0220] In a schematic embodiment, after replacing back the original absolute color difference value, the filtered color channel value of the pixel point to be corrected obtained through step 105 is the original color channel value of the pixel point to be corrected. That is to say, for the pixel point to be corrected whose color saturation is increased after filtering, it is restored to the original color channel value through the process of the color saturation protection mechanism in steps 901 to 903, thereby eliminating the influence that is not conducive to high-frequency false color suppression.

[0221] In an image, in addition to high-frequency false colors, there may also be problems with isolated pixel points. In a schematic embodiment, an isolated pixel point refers to an obvious difference in color or brightness between the color or brightness of the current pixel point and the color or brightness of surrounding pixel points, such as noise, or for example, a red dot that suddenly appears in the green leaves presented in the image (and the red dot obviously does not belong to the true color of the shooting object). Based on this, the filtering and correction method of the embodiments of the present disclosure may further include the detection and correction of isolated pixel points, as follows.

[0222] Figure 10 is a flowchart showing the process of eliminating isolated pixel points according to a schematic embodiment, as Figure 10 shown, in a schematic embodiment, the filtering and correction method of the embodiments of the present disclosure may further include the process of eliminating isolated pixel points in the following steps 1001 to 1003 respectively performed for each pixel point in each pixel point of the original RGB image.

[0223] Step 1001, within the coverage of the filtering window with the current pixel point as the center point, when the original color difference value of the current pixel point is the maximum value among the original color difference values of all pixel points within the filtering window, or when the original color difference value of the current pixel point is the minimum value among the original color difference values of all pixel points within the filtering window, determine the current pixel point as an isolated pixel point.

[0224] In a schematic embodiment, step 1001 may include: within the coverage of the filtering window with the current pixel point as the center point, comparing the original color difference value of the current pixel point with the original color difference values of other pixel points to obtain whether the original color difference value of the current pixel point is the maximum original color difference value or the minimum original color difference value of all pixel points within the coverage of the filtering window; if the original color difference value of the current pixel point is the maximum original color difference value or the minimum original color difference value of all pixel points within the coverage of the filtering window, determine the current pixel point as an isolated pixel point.

[0225] In step 1001, an isolated pixel point indicates that its color difference is a peak within its filtering window. There may be a situation where the color change presented by the isolated pixel point is inconsistent with that of other surrounding pixel points. The isolated pixel point may belong to an error value in the color channel value or may belong to noise. Therefore, it is necessary to pay attention to the isolated pixel point and consider whether to reduce the color difference between the isolated pixel point and the surrounding pixel points as needed.

[0226] Step 1002: Obtain a first low-pass filter, adjust the weight of the first low-pass filter to obtain a third low-pass filter, such that the filtering intensity of the third low-pass filter for the isolated pixel point is greater than the filtering intensity of the first low-pass filter for the isolated pixel point.

[0227] In the illustrative embodiment, the color difference between the isolated pixel point and the surrounding pixel points is only caused by the color change of the actual content presented in the image. The isolated pixel point is not actually an error value in the color channel value, or the isolated pixel point is not noise. In this case, the color difference between the isolated pixel point and the surrounding pixel points may actually be very small. That is to say, only when the color of the isolated pixel point is significantly different from that of other surrounding pixel points, there may be a problem with the color of the isolated pixel point. Therefore, it is necessary to consider adjusting the weight of the low-pass filter according to the degree of the color difference between the isolated pixel point and the surrounding pixel points, such that the weight of the low-pass filter remains unchanged when the color difference between the isolated pixel point and the surrounding pixel points is extremely small or slightly small, the weight of the low-pass filter is changed to increase the filtering intensity of the low-pass filter for the isolated pixel point when the color difference between the isolated pixel point and the surrounding pixel points is slightly large, and the weight of the low-pass filter is changed to further increase the filtering intensity of the low-pass filter for the isolated pixel point when the color difference between the isolated pixel point and the surrounding pixel points is extremely large, so as to minimize the color difference between the isolated pixel point and the surrounding pixel points as much as possible. The determination of the degrees such as extremely small, slightly small, slightly large, and extremely large for the color difference between the isolated pixel point and the surrounding pixel points can be determined according to experience, requirements, etc.

[0228] In a schematic embodiment, in step 1002, different threshold intervals and corresponding second weight adjustment coefficients can be set. When the color difference between an isolated pixel and surrounding pixels falls within different threshold intervals, different second weight adjustment coefficients are obtained. The third low-pass filter is obtained by adjusting the first low-pass filter weights using the obtained second weight adjustment coefficients, such that when the color difference between the isolated pixel and surrounding pixels is extremely small, the filtering intensity of the third low-pass filter is equivalent to that of the first low-pass filter (for example, the weight value of the third low-pass filter is the same as or close to the weight value of the first low-pass filter). Corresponding to the color difference between the isolated pixel and surrounding pixels increasing from small to large, the filtering intensity of the third low-pass filter increases accordingly.

[0229] In a schematic embodiment, the mapping relationship between the threshold interval and the second weight adjustment coefficient can be set according to needs and experience. In a schematic embodiment, step 1002 may specifically include: within the coverage of a filtering window centered on the current pixel, the average original color difference of other pixels is obtained according to the original color differences of other pixels except the current pixel, where the average original color difference of other pixels is the average of the original color differences of other pixels; subtracting the original color difference of the current pixel from the average of the original color differences of other pixels to obtain the difference value of the original color difference; according to the mapping relationship between the preset difference value threshold interval and the second weight adjustment coefficient, when the difference value of the original color difference falls into a certain threshold interval, the second weight adjustment coefficient corresponding to the certain threshold interval is obtained; the weight value of the first low-pass filter is adjusted using the obtained second weight adjustment coefficient to obtain the third low-pass filter.

[0230] Step 1003: In the color difference plane, the isolated pixel is low-pass filtered using the third low-pass filter to obtain the filtered color difference value of the isolated pixel, and the filtered color difference value of the isolated pixel is determined as the filtered color difference value of the pixel to be corrected.

[0231] Since the color change degree between an isolated pixel and other surrounding pixels is intense, it means that it belongs to high-frequency information, and low-pass filtering can reduce or even eliminate this high-frequency information.

[0232] In a schematic embodiment, since low-pass filtering is performed in the color difference plane in step 1003, the effect of reducing the color difference can be achieved, such that after the isolated pixel after low-pass filtering is restored to the RGB color channel, the color difference between it and other surrounding pixels is significantly reduced, thereby achieving the purpose of adjusting the color of the isolated pixel to make its presentation effect better.

[0233] Among the content presented in the image, there are usually a large number of line contents. In addition to high-frequency false colors and isolated pixel points in the image, there may also be problems with incorrect colors at the line positions. For example, the edge pixels of a black line in a color image may appear in other colors (false colors). In this case, the chroma of gray can be increased in these areas to reduce the false color saturation. Based on this, the embodiments of the present disclosure may also include a process for suppressing false-color edges.

[0234] Figure 11 is a schematic flowchart of false-color edge suppression shown according to an exemplary embodiment, as Figure 11 shown. In the exemplary embodiment, the filtering and correction method of the embodiments of the present disclosure may further include a false-color edge suppression process of the following steps 1101 to 1103 respectively performed for each pixel point among all pixel points.

[0235] Step 1101: Within the coverage range of a filtering window centered on the current pixel point, obtain a color edge position judgment result of the current pixel point through color direction detection.

[0236] In the exemplary embodiment, color direction detection may be implemented using existing technologies. The specific idea may be to determine whether the current pixel point is a color edge position according to the original color channel values. If the original color channel values of the current pixel point and its adjacent pixel points in a certain direction are equal, and the original color channel values of the current pixel point and the adjacent pixel points outside the certain direction are not equal, then the current pixel point is a color edge position. The specific implementation process can refer to the existing technologies and will not be elaborated here.

[0237] Step 1102: When the current pixel point is a color edge position, obtain a first low-pass filter, adjust the weight of the first low-pass filter to obtain a fourth low-pass filter, so that the gray level of the color edge position after being filtered by the fourth low-pass filter is greater than that before filtering.

[0238] In the exemplary embodiment, different threshold intervals and corresponding third weight adjustment coefficients may be set. The threshold intervals may be threshold intervals for the color difference plane. When the color difference of the color edge position is in different threshold intervals, different third weight adjustment coefficients are obtained, and the weight of the first low-pass filter is adjusted using the obtained third weight adjustment coefficients to obtain the fourth low-pass filter. It should be emphasized that the purpose of setting the third weight adjustment coefficient is to make the gray level of the color edge position after being filtered by the fourth low-pass filter greater than that before filtering.

[0239] Step 1103: In the color difference plane, perform low-pass filtering on the color edge position using the fourth low-pass filter to obtain the filtered color difference of the color edge position, and determine the filtered color difference of the color edge position as the filtered color difference of the pixel point to be corrected.

[0240] Due to the lens chromatic aberration, false color edges will appear in the image, and false colors will also appear at the positions of the false color edges. In the embodiments of the present disclosure, by detecting and low-pass filtering the color edges in the above steps 1101 to 1103, the false color problem that appears at the position of the false color edge can be alleviated or eliminated.

[0241] The correction of isolated pixel points and the suppression of color edges are similar to the color saturation frequency described above. They are all based on a basic low-pass filter and add a special mechanism for the removal intensity of false colors. As long as any of the triggering conditions of isolated pixel points, color edge positions, and color saturation frequencies are met, the intensity of the corresponding low-pass filtering will be enhanced accordingly.

[0242] The filtering correction method of the embodiments of the present disclosure performs low-pass filtering on the pixel points of high-frequency false colors in the chromatic aberration plane, achieving the effect of reducing chromatic aberration, and can alleviate or even eliminate the high-frequency false colors of the pixel points after low-pass filtering. At the same time, the present disclosure uses the color saturation frequency to determine the high-frequency false color pixel points, improving the recognition accuracy of the high-frequency false color pixel points. In addition, the embodiments of the present disclosure further implement the detection of isolated pixel points and color edge positions based on the chromatic aberration plane, and through low-pass filtering, achieve the purpose of reducing the color difference between the isolated pixel points and the surrounding pixel points and alleviating or even eliminating the color edge false colors. The filtering correction method of the embodiments of the present disclosure realizes the suppression of high-frequency false colors, isolated pixel points, or color edge false colors based on the RGB image, and plays a good role in suppressing the false colors in the image caused by the defects of the Bayer image interpolation algorithm and the lens chromatic aberration.

[0243] Figure 12 is a schematic flow diagram of the application scenario of the filtering correction method shown in an exemplary embodiment. As Figure 12 shown, this application scenario includes the following steps 1201 to 1210.

[0244] Step 1201: Obtain the original RGB image, and then enter step 1202.

[0245] Step 1202: Obtain the original Gr color difference value and the original Gb color difference value of each pixel point in the original RGB image, and then enter steps 1203, 1204, and 1205.

[0246] In the exemplary embodiment, in step 1202, the original Gr color difference value and the original Gb color difference value are obtained through the following formula:

[0247] Gr = G – R

[0248] Gb = G – B

[0249] Among them, Gr is the original Gr color difference value of the pixel, Gb is the original Gb color difference value of the pixel, G is the original G channel value of the pixel, R is the original R channel value of the pixel, and B is the original B channel value of the pixel.

[0250] Step 1203: Calculate the color saturation frequency of the pixel, and then proceed to step 1206.

[0251] In the illustrative embodiment, for the color saturation frequency of any pixel, it can be obtained through the following process.

[0252] In the illustrative embodiment, since the color saturation frequency is obtained from the color saturation, it is necessary to first obtain the color saturation. In the illustrative embodiment, the color saturation of any pixel is obtained through the following formula:

[0253] Max_clr = MAX(R, G, B)

[0254] Min_clr = MIN(R, G, B)

[0255] Sat = Max_clr – Min_clr

[0256] Among them, Max_clr represents the maximum color value of any pixel, Min_clr represents the minimum color value of any pixel, R is the original R channel value of any pixel, G is the original G channel value of any pixel, B is the original B channel value of any pixel, MAX(R, G, B) represents taking the maximum value among R, G, and B, MIN(R, G, B) represents taking the minimum value among R, G, and B, and Sat is the color saturation of any pixel.

[0257] In the illustrative embodiment, in step 1203, for the pixel to be low-pass filtered currently, the color saturations of all pixels within its filtering window are obtained through the above formula. Then, according to the color saturation of each pixel within the filtering window, the color saturation differences between all adjacent pixels within the filtering window are obtained. Then, the absolute values of the color saturation differences between all adjacent pixels within the filtering window are added together to obtain the color saturation frequency of the current pixel.

[0258] Step 1204: Determine isolated pixels, and then proceed to step 1206.

[0259] In a schematic embodiment, step 1204 may include, for a pixel point to be low-pass filtered currently, in the color difference plane, determining whether the original color difference value of the pixel point is the maximum or minimum value among the original color difference values of all pixel points within its filtering window. If it is the maximum or minimum value, then the pixel point to be low-pass filtered currently is determined as an isolated pixel point.

[0260] In a schematic embodiment, step 1204 performs the determination of isolated pixel points in the Gr color difference plane and the Gb color difference plane respectively. For example, for an isolated pixel point that tends to be red in the presentation content of green leaves, it can be determined as an isolated pixel point in the Gr color difference plane, while in the Gb color difference plane, it may or may not be an isolated pixel point, which is determined by its B-channel pixel value and G-channel pixel value.

[0261] Step 1205: Perform color edge point position detection, and then enter step 1206.

[0262] In a schematic embodiment, step 1205 may implement color edge point position detection through color direction detection based on the original color channel values of pixel points. In a schematic embodiment, step 1205 may specifically include, for a pixel point to be low-pass filtered currently, performing color edge point position detection on it based on the original color channel values to obtain the result of whether the pixel point is a color edge point position. The specific color edge point position detection can be implemented using existing technologies.

[0263] Step 1206: Perform low-pass filtering, and then enter step 1207.

[0264] In a schematic embodiment, in step 1206, low-pass filtering is performed specifically according to the results of steps 1203, 1204, and 1205. Among them, the low-pass filtering for step 1203 can achieve the main purpose of the present disclosure, that is, high-frequency false color suppression; the low-pass filtering for step 1204 can eliminate the excessive color difference between the isolated pixel point and the surrounding pixel points, playing a role in noise reduction; the low-pass filtering for step 1205 can suppress and even eliminate the false color of the false color edge.

[0265] In a schematic embodiment, for the result of step 1203, step 1206 may include the following process:

[0266] Obtain a first low-pass filter, and the size of the first low-pass filter is equal to the size of the filtering window;

[0267] According to the mapping relationship between the color saturation frequency and a preset first weight adjustment coefficient, obtain the first weight adjustment coefficient corresponding to the color saturation frequency;

[0268] Multiply the obtained first weight adjustment coefficient by the weight of the first low-pass filter to obtain a second low-pass filter;

[0269] In the chromatic aberration plane, use the second low-pass filter to perform low-pass filtering on the pixel points to be low-pass filtered currently.

[0270] In the illustrative embodiment, the filtering intensity of the second low-pass filter for the currently to-be-corrected pixel points is greater than the filtering intensity of the first low-pass filter for the currently to-be-corrected pixel points.

[0271] Among them, the second low-pass filter is a low-pass filter used for suppressing high-frequency false colors, and its weight is suitable for suppressing high-frequency false colors.

[0272] In the illustrative embodiment, for the result of step 1203, in step 1206, obtain the corresponding second low-pass filters in the Gr chromatic aberration plane and the Gb chromatic aberration plane respectively and perform low-pass filtering.

[0273] In the illustrative embodiment, for the result of step 1204, step 1206 may include the following process:

[0274] Obtain a first low-pass filter, and the size of the first low-pass filter is equal to the size of the filtering window;

[0275] According to the mapping relationship between preset different threshold intervals and corresponding second weight adjustment coefficients, obtain the second weight adjustment coefficient corresponding to the color difference between the isolated pixel points and the surrounding pixel points;

[0276] Multiply the obtained second weight adjustment coefficient by the weight of the first low-pass filter to obtain a third low-pass filter;

[0277] In the chromatic aberration plane, use the third low-pass filter to perform low-pass filtering on the pixel points to be low-pass filtered currently.

[0278] Among them, the third low-pass filter is a low-pass filter used for isolated pixel points. In the case where the color difference between the isolated pixel points (the pixel points to be low-pass filtered currently) and the surrounding pixel points is extremely small, the filtering intensity of the third low-pass filter is equivalent to the filtering intensity of the first low-pass filter (for example, the weight value of the third low-pass filter is the same as or close to the weight value of the first low-pass filter). Corresponding to the color difference between the isolated pixel points (the pixel points to be low-pass filtered currently) and the surrounding pixel points from small to large, the filtering intensity of the third low-pass filter increases accordingly.

[0279] In the illustrative embodiment, for the result of step 1204, in step 1206, obtain the corresponding third low-pass filters in the Gr chromatic aberration plane and the Gb chromatic aberration plane respectively and perform low-pass filtering.

[0280] In a schematic embodiment, for the result of step 1205, the following process may be included in step 1206:

[0281] Obtain a first low-pass filter, the size of the first low-pass filter being equal to the size of the filtering window;

[0282] According to the mapping relationship between preset different threshold intervals and corresponding third weight adjustment coefficients, obtain the third weight adjustment coefficient corresponding to the threshold interval where the color difference value difference of the color edge points is located;

[0283] Multiply the obtained third weight adjustment coefficient by the weight of the first low-pass filter to obtain a fourth low-pass filter;

[0284] In the color difference plane, use the fourth low-pass filter to perform low-pass filtering on the pixel points (color edge points) to be low-pass filtered currently.

[0285] Among them, the gray level of the color edge points after being filtered by the fourth low-pass filter is greater than the gray level before filtering.

[0286] Among them, the purpose of setting the third weight adjustment coefficient is to make the gray level of the color edge points after being filtered by the fourth low-pass filter greater than the gray level before filtering.

[0287] In a schematic embodiment, for the result of step 1205, in step 1206, obtain the corresponding fourth low-pass filters in the Gr color difference plane and the Gb color difference plane respectively and perform low-pass filtering.

[0288] Step 1207: Calculate the brightness frequency, perform a callback on the filtered color difference value of the filtered pixel points according to the brightness frequency, and then enter step 1208.

[0289] Step 1207 is a correction for the pixel points that may be over-suppressed in step 1206. In a schematic embodiment, step 1207 may include the following process.

[0290] Within the coverage of the filtering window with the pixel point to be corrected as the center point, obtain the brightness value of each pixel point within the filtering window according to the color channel value. Among them, the current pixel point to be corrected may be the pixel point that performs low-pass filtering in the above step 1206, and the brightness value of the pixel point may be obtained through the following formula:

[0291] Y = 0.299×R + 0.587×G + 0.114×B

[0292] Among them, Y represents the brightness value of the pixel point, R represents the original R channel value of the pixel point, G represents the original G channel value of the pixel point, and B represents the original B channel value of the pixel point;

[0293] According to the brightness values of each pixel point within the filtering window, obtain the brightness differences between all adjacent pixel points within the filtering window;

[0294] Add up the absolute values of the brightness differences between all adjacent pixel points within the filtering window to obtain the brightness frequency of the currently pixel to be corrected;

[0295] According to the mapping relationship between the preset brightness frequency and the callback coefficient, obtain the color difference callback coefficient of the pixel to be corrected;

[0296] In the color difference plane, according to the original color difference value, the filtered color difference value, and the color difference callback coefficient of the pixel to be corrected, obtain the color difference value after color difference callback of the pixel to be corrected;

[0297] Determine the color difference value after color difference callback of the pixel to be corrected as the filtered color difference value of the pixel to be corrected.

[0298] Step 1208: Execute the color saturation protection mechanism process, and then enter step 1209.

[0299] In the illustrative embodiment, step 1208 may specifically include the following process:

[0300] According to the filtered color difference value of the pixel to be corrected, obtain the absolute value of the filtered color difference of the pixel to be corrected;

[0301] According to the original color difference value of the pixel to be corrected, obtain the absolute value of the original color difference of the pixel to be corrected;

[0302] Judge whether the absolute value of the filtered color difference of the pixel to be corrected is greater than the absolute value of the original color difference of the pixel to be corrected. If so, replace the filtered color difference value of the pixel to be corrected with the absolute value of the original color difference of the pixel to be corrected; otherwise, retain the filtered color difference value of the pixel to be corrected.

[0303] Step 1209: According to the filtered color difference value of the pixel to be corrected, obtain the filtered color difference value of the pixel to be corrected, and then execute step 1210.

[0304] In the illustrative embodiment, step 1209 may include obtaining the filtered R channel value and the filtered B channel value of the pixel through the following formula:

[0305] R_new = G – Gr_flt

[0306] B_new = G – Gb_flt

[0307] Wherein, R_new is the filtered R channel value of any pixel to be corrected, G is the original G channel value of the any pixel to be corrected, Gr_flt is the difference between the filtered Gr color differences of the any pixel to be corrected, B_new is the filtered B channel value of the any pixel to be corrected, and Gb_flt is the difference between the filtered Gb color differences of the any pixel to be corrected.

[0308] Step 1210: Generate a filtered and corrected RGB image according to the filtered color channel values of the pixels to be corrected in the original RGB image and the original color channel values of the other pixels except the pixels to be corrected.

[0309] Figure 13 FIG. shows a schematic logical structure diagram of a filtering and correction device according to an exemplary embodiment. The filtering and correction device is used for high-frequency false color suppression, such as Figure 13 shown. The filtering and correction device includes an image acquisition module 1301, an original color difference acquisition module 1302, a pixel to be corrected determination module 1303, a filtering module 1304, a filtered color channel value acquisition module 1305, and a filtered image acquisition module 1306.

[0310] Among them, the image acquisition module 1301 is configured to acquire an original RGB image, and the original RGB image contains the original color channel values of each pixel.

[0311] The original color difference acquisition module 1302 is configured to obtain the original color differences of each pixel in the original RGB image according to the original color channel values of each pixel in the original RGB image, and form a color difference plane of the original RGB image from the original color differences of each pixel. Wherein, the original color difference of any pixel in the original RGB image is the difference between the G channel value and the R channel value of the any pixel, or the original color difference of any pixel in the original RGB image is the difference between the G channel value and the B channel value of the any pixel.

[0312] The pixel to be corrected determination module 1303 is configured to determine the pixels to be corrected contained in the original RGB image according to the original color channel values of each pixel and the size of a preset filtering window.

[0313] The filtering module 1304 is configured to perform low-pass filtering on the pixels to be corrected in the color difference plane to obtain the filtered color differences of the pixels to be corrected.

[0314] The filtered color channel value acquisition module 1305 is configured to obtain the filtered color channel values of the pixels to be corrected according to the filtered color differences of the pixels to be corrected and the original color channel values of the pixels to be corrected.

[0315] The filtered image acquisition module 1306 is configured to obtain a filtered and corrected RGB image according to the filtered color channel value of the pixel to be corrected and the original color channel values of other pixels in the original RGB image except the pixel to be corrected.

[0316] In the illustrative embodiment, the original color channel values include the original R channel value, the original G channel value, and the original B channel value, the original color difference values include at least one of the original Gr color difference value and the original Gb color difference value, and the color difference planes include at least one of the Gr color difference plane and the Gb color difference plane. Among them, the Gr color difference plane is constituted by the original Gr color difference values of each pixel, and the Gb color difference plane is constituted by the original Gb color difference values of each pixel;

[0317] The original color difference value acquisition module 1302 is further configured to perform: for any one pixel among each pixel, determine the difference between the original G channel value of the any one pixel and the original R channel value of the any one pixel as the original Gr color difference value of the any one pixel; and / or, for any one pixel among each pixel, determine the difference between the original G channel value of the any one pixel and the original B channel value of the any one pixel as the original Gb color difference value of the any one pixel;

[0318] The filtered color channel value acquisition module 1305 is further configured to perform:

[0319] For any one pixel to be corrected, determine the difference between the original G channel value of the any one pixel to be corrected and the filtered Gr color difference value of the any one pixel to be corrected as the filtered R channel value of the any one pixel to be corrected; and / or, for any one pixel to be corrected, determine the difference between the original G channel value of the any one pixel to be corrected and the filtered Gb color difference value of the any one pixel to be corrected as the filtered B channel value of the any one pixel to be corrected.

[0320] In the illustrative embodiment, the pixel to be corrected determination module 1303 includes:

[0321] The color saturation frequency acquisition sub-module is configured to obtain the color saturation frequency of each pixel according to the original color channel values of each pixel and the size of a preset filtering window;

[0322] The pixel to be corrected determination sub-module is configured to determine the pixels whose color saturation frequencies are within a preset color saturation frequency threshold range as the pixels to be corrected.

[0323] In a schematic embodiment, the color saturation frequency acquisition sub-module is further configured to perform the following steps for each pixel point among all pixel points respectively:

[0324] Within the coverage of a filtering window centered on the current pixel point, obtain the color saturation of each pixel point within the filtering window according to the original color channel values, where the current pixel point is any one of all pixel points;

[0325] According to the color saturation of each pixel point within the filtering window, obtain the color saturation differences between all adjacent pixel points within the filtering window;

[0326] Add up the absolute values of the color saturation differences between all adjacent pixel points within the filtering window to obtain the color saturation frequency of the current pixel point.

[0327] In a schematic embodiment, the filtering module 1304 is further configured to perform the following steps for each pixel point to be corrected respectively:

[0328] Obtain a first low-pass filter, and the size of the first low-pass filter is equal to the size of the filtering window;

[0329] According to the color saturation frequency of the current pixel point to be corrected, adjust the weights of the first low-pass filter to obtain a second low-pass filter, such that the filtering intensity of the second low-pass filter for the current pixel point to be corrected is greater than the filtering intensity of the first low-pass filter for the current pixel point to be corrected;

[0330] In the color difference plane, perform low-pass filtering on the current pixel point to be corrected by using the second low-pass filter to obtain the filtered color difference value of the current pixel point to be corrected.

[0331] In a schematic embodiment, the wave module 1304 is further configured to perform:

[0332] According to the mapping relationship between the color saturation frequency and a preset first weight adjustment coefficient, obtain the first weight adjustment coefficient corresponding to the color saturation frequency;

[0333] Multiply the obtained first weight adjustment coefficient by the weights of the first low-pass filter to obtain the second low-pass filter.

[0334] In a schematic embodiment, between the filtered color channel value acquisition module 1305 and the filtered image acquisition module 1306, the filtering correction device further includes:

[0335] A brightness frequency acquisition module, configured to perform obtaining the brightness frequency of the pixel point to be corrected according to the original color channel values of each pixel point in the original RGB image and the size of a preset filtering window;

[0336] The color difference callback coefficient obtaining module is configured to obtain the color difference callback coefficient of the pixel to be corrected according to the mapping relationship between the preset brightness frequency and the callback coefficient;

[0337] The color difference callback module is configured to obtain the color difference value after callback of the pixel to be corrected in the color difference plane according to the original color difference value, the filtered color difference value, and the color difference callback coefficient of the pixel to be corrected;

[0338] The filtered color difference value determining module is configured to determine the color difference value after callback of the pixel to be corrected as the filtered color difference value of the pixel to be corrected.

[0339] In the illustrative embodiment, the brightness frequency obtaining module is further configured to perform the following steps for each pixel to be corrected among all the pixels to be corrected:

[0340] Within the coverage of the filtering window with the current pixel to be corrected as the center point, obtain the brightness value of each pixel within the filtering window according to the color channel value, where the current pixel to be corrected is any one of all the pixels to be corrected;

[0341] According to the brightness value of each pixel within the filtering window, obtain the brightness difference between all adjacent pixels within the filtering window;

[0342] Add the absolute values of the brightness differences between all adjacent pixels within the filtering window to obtain the brightness frequency of the current pixel to be corrected.

[0343] In the illustrative embodiment, between the filtering module 1304 and the filtered color channel value obtaining module 1305, the filtering correction device may further include:

[0344] The filtered color difference absolute value obtaining module is configured to obtain the absolute value of the filtered color difference of the pixel to be corrected according to the filtered color difference value of the pixel to be corrected;

[0345] The original color difference absolute value obtaining module is configured to obtain the absolute value of the original color difference of the pixel to be corrected according to the original color difference value of the pixel to be corrected;

[0346] The color difference value replacement module is configured to replace the filtered color difference value of the pixel to be corrected with the original color difference value of the pixel to be corrected when the absolute value of the filtered color difference of the pixel to be corrected is greater than the absolute value of the original color difference of the pixel to be corrected.

[0347] In a schematic embodiment, the filtering and correction device further includes an isolated pixel point processing module, which is configured to perform the following steps for each pixel point among all pixel points:

[0348] Within the coverage of a filtering window centered on the current pixel point, when the original color difference value of the current pixel point is the maximum among the original color difference values of all pixel points within the filtering window, or when the original color difference value of the current pixel point is the minimum among the original color difference values of all pixel points within the filtering window, the current pixel point is determined as an isolated pixel point;

[0349] Obtain a first low-pass filter, adjust the weights of the first low-pass filter to obtain a third low-pass filter, such that the filtering intensity of the third low-pass filter for the isolated pixel point is greater than the filtering intensity of the first low-pass filter for the isolated pixel point;

[0350] In the color difference plane, use the third low-pass filter to perform low-pass filtering on the isolated pixel point to obtain the filtered color difference value of the isolated pixel point, and determine the filtered color difference value of the isolated pixel point as the filtered color difference value of the pixel point to be corrected.

[0351] In a schematic embodiment, the filtering and correction device further includes a color edge position processing module, which is configured to perform the following steps for each pixel point among all pixel points:

[0352] Within the coverage of a filtering window centered on the current pixel point, obtain the color edge position judgment result of the current pixel point through color direction detection;

[0353] When the current pixel point is a color edge position, obtain a first low-pass filter, adjust the weights of the first low-pass filter to obtain a fourth low-pass filter, such that the gray level after filtering the color edge position by the fourth low-pass filter is greater than the gray level before filtering;

[0354] In the color difference plane, use the fourth low-pass filter to perform low-pass filtering on the color edge position to obtain the filtered color difference value of the color edge position, and determine the filtered color difference value of the color edge position as the filtered color difference value of the pixel point to be corrected.

[0355] All of the above optional technical solutions can be combined arbitrarily to form alternative embodiments of the present disclosure, which will not be elaborated one by one here.

[0356] Regarding the filtering and correction device in the above embodiments, the specific manners in which each unit performs operations have been described in detail in the embodiments related to the filtering and correction method, and will not be elaborated in detail here.

[0357] It should be noted that the above embodiments are only illustrative examples divided by the above functional modules. In practical applications, the above functions can be allocated to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0358] Figure 14 This is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. In some embodiments, the electronic device is a server. The electronic device 1400 may vary greatly due to configuration or performance differences, and may include one or more processors (Central Processing Units, CPUs) 1401 and one or more memories 1402. Among them, at least one program code is stored in the memory 1402, and the at least one program code is loaded and executed by the processor 1401 to implement the filtering and correction methods provided by the above various embodiments. Of course, the electronic device 1400 may also have components such as wired or wireless network interfaces, keyboards, and input / output interfaces for input and output. The electronic device 1400 may also include other components for implementing device functions, which will not be elaborated here.

[0359] In an exemplary embodiment, there is also provided a computer-readable storage medium including at least one instruction, such as a memory including at least one instruction. The at least one instruction can be executed by a processor in a computer device to complete the filtering and correction method in the above embodiment.

[0360] Optionally, the above computer-readable storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may include ROM (Read-Only Memory), RAM (Random-Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tapes, floppy disks, and optical data storage devices, etc.

[0361] The above are only the preferred embodiments of the present disclosure and are not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure shall be included within the scope of protection of the present disclosure.

Claims

1. A filtering and correction method, the method comprising: Obtain the original RGB image, where the original RGB image contains the original color channel values of each pixel point; According to the original color channel values of each pixel point in the original RGB image, obtain the original color difference values of each pixel point in the original RGB image, and form the color difference plane of the original RGB image from the original color difference values of each pixel point; Determine the pixel points to be corrected contained in the original RGB image according to the original color channel values of each pixel point and the size of a preset filtering window; Perform low-pass filtering on the pixel points to be corrected in the color difference plane to obtain the filtered color difference values of the pixel points to be corrected; According to the filtered color difference values of the pixel points to be corrected and the original color channel values of the pixel points to be corrected, obtain the filtered color channel values of the pixel points to be corrected; According to the filtered color channel values of the pixel points to be corrected and the original color channel values of other pixel points in the original RGB image except the pixel points to be corrected, obtain the filtered and corrected RGB image.

2. The filtering and correction method according to claim 1, characterized in that: The original color channel values include the original R channel value, the original G channel value, and the original B channel value. The original color difference values include at least one of the original Gr color difference value and the original Gb color difference value. The color difference plane includes at least one of the Gr color difference plane and the Gb color difference plane. Among them, the Gr color difference plane is formed by the original Gr color difference values of each pixel point, and the Gb color difference plane is formed by the original Gb color difference values of each pixel point; Among them, the obtaining the original color difference values of each pixel point in the original RGB image according to the original color channel values of each pixel point includes: For any one pixel point among each pixel point, determine the difference between the original G channel value of the any one pixel point and the original R channel value of the any one pixel point as the original Gr color difference value of the any one pixel point; And / or, For any one pixel point among each pixel point, determine the difference between the original G channel value of the any one pixel point and the original B channel value of the any one pixel point as the original Gb color difference value of the any one pixel point; Among them, the obtaining the filtered color channel values of the pixel points to be corrected according to the filtered color difference values of the pixel points to be corrected and the original color channel values of the pixel points to be corrected includes: For any one pixel point to be corrected, determine the difference between the original G channel value of the any one pixel point to be corrected and the filtered Gr color difference value of the any one pixel point to be corrected as the filtered R channel value of the any one pixel point to be corrected; And / or, For any one pixel point to be corrected, determine the difference between the original G channel value of the any one pixel point to be corrected and the filtered Gb color difference value of the any one pixel point to be corrected as the filtered B channel value of the any one pixel point to be corrected.

3. The filtering and correction method according to claim 1, characterized in that, The determining the pixel points to be corrected contained in the original RGB image according to the original color channel values of each pixel point and the size of a preset filtering window includes: Obtain the color saturation frequency of each pixel point according to the original color channel values of each pixel point and the size of a preset filtering window. Determine the pixel points whose color saturation frequency is within a preset color saturation frequency threshold range as the pixel points to be corrected.

4. The filtering and correction method according to claim 3, characterized in that, The obtaining the color saturation frequency of each pixel point according to the original color channel values of each pixel point and the size of a preset filtering window includes the following steps performed respectively for each pixel point among the each pixel points: Within the coverage of the filtering window centered on the current pixel point, obtain the color saturation of each pixel point within the filtering window according to the original color channel values, where the current pixel point is any one of the each pixel points. Obtain the color saturation difference between all adjacent pixel points within the filtering window according to the color saturation of each pixel point within the filtering window. Add the absolute values of the color saturation differences between all adjacent pixel points within the filtering window to obtain the color saturation frequency of the current pixel point.

5. The filtering and correction method according to claim 3, characterized in that, The performing low-pass filtering on the pixel points to be corrected in the color difference plane to obtain the filtered color difference values of the pixel points to be corrected includes the following steps performed respectively for each of the pixel points to be corrected: Obtain a first low-pass filter, where the size of the first low-pass filter is equal to the size of the filtering window. Adjust the weight of the first low-pass filter according to the color saturation frequency of the current pixel point to be corrected to obtain a second low-pass filter, such that the filtering intensity of the second low-pass filter for the current pixel point to be corrected is greater than the filtering intensity of the first low-pass filter for the current pixel point to be corrected. In the color difference plane, perform low-pass filtering on the current pixel point to be corrected using the second low-pass filter to obtain the filtered color difference value of the current pixel point to be corrected.

6. The filtering and correction method according to claim 5, characterized in that, The adjusting the weight of the first low-pass filter according to the color saturation frequency of the current pixel point to be corrected to obtain a second low-pass filter includes: Obtain a first weight adjustment coefficient corresponding to the color saturation frequency according to the mapping relationship between the color saturation frequency and a preset first weight adjustment coefficient. Multiply the obtained first weight adjustment coefficient by the weight of the first low-pass filter to obtain the second low-pass filter.

7. The filtering and correction method according to claim 1, characterized in that, After obtaining the filtered color difference value of the pixel point to be corrected and before obtaining the filtered color channel value of the pixel point to be corrected, the method further includes: Obtain the brightness frequency of the pixel point to be corrected according to the original color channel values of each pixel point in the original RGB image and the size of a preset filtering window. Obtain the color difference callback coefficient of the pixel point to be corrected according to the mapping relationship between a preset brightness frequency and a callback coefficient. In the color difference plane, obtain the color difference value after callback of the pixel point to be corrected according to the original color difference value, the filtered color difference value, and the color difference callback coefficient of the pixel point to be corrected. Determine the color difference value after callback of the color difference of the pixel to be corrected as the color difference value after filtering of the pixel to be corrected.

8. The filtering and correction method according to claim 7, characterized in that The obtaining the brightness frequency of the pixel to be corrected according to the original color channel values of each pixel in the original RGB image and the size of a preset filtering window includes the following steps performed respectively for each pixel to be corrected among the pixels to be corrected: Within the coverage of the filtering window centered on the current pixel to be corrected, obtain the brightness value of each pixel within the filtering window according to the color channel value, where the current pixel to be corrected is any one of the pixels to be corrected; According to the brightness values of each pixel within the filtering window, obtain the brightness differences between all adjacent pixels within the filtering window; Add up the absolute values of the brightness differences between all adjacent pixels within the filtering window to obtain the brightness frequency of the current pixel to be corrected.

9. The filtering and correction method according to claim 1, characterized in that After obtaining the color difference value after filtering of the pixel to be corrected and before obtaining the color channel value after filtering of the pixel to be corrected, the method further includes: According to the color difference value after filtering of the pixel to be corrected, obtain the absolute value of the color difference after filtering of the pixel to be corrected; According to the original color difference value of the pixel to be corrected, obtain the absolute value of the original color difference of the pixel to be corrected; In the case where the absolute value of the color difference after filtering of the pixel to be corrected is greater than the absolute value of the original color difference of the pixel to be corrected, replace the color difference value after filtering of the pixel to be corrected with the absolute value of the original color difference of the pixel to be corrected.

10. The filtering and correction method according to any one of claims 1 to 9, characterized in that The method further includes the following steps performed respectively for each pixel among the respective pixels: Within the coverage of the filtering window centered on the current pixel, in the case where the original color difference value of the current pixel is the maximum value among the original color difference values of all pixels within the filtering window, or in the case where the original color difference value of the current pixel is the minimum value among the original color difference values of all pixels within the filtering window, determine the current pixel as an isolated pixel; Obtain a first low-pass filter, adjust the weights of the first low-pass filter to obtain a third low-pass filter, such that the filtering intensity of the third low-pass filter for the isolated pixel is greater than the filtering intensity of the first low-pass filter for the isolated pixel; In the color difference plane, perform low-pass filtering on the isolated pixel using the third low-pass filter to obtain the color difference value after filtering of the isolated pixel, and determine the color difference value after filtering of the isolated pixel as the color difference value after filtering of the pixel to be corrected.

11. The filtering and correction method according to any one of claims 1 to 9, characterized in that The method further includes the following steps performed respectively for each pixel among the respective pixels: Within the coverage of the filtering window centered on the current pixel, obtain the color edge position judgment result of the current pixel through color direction detection; When the current pixel point is a color edge point, obtain a first low-pass filter, adjust the weights of the first low-pass filter to obtain a fourth low-pass filter, such that the gray level of the color edge point after being filtered by the fourth low-pass filter is greater than the gray level before filtering; In the color difference plane, use the fourth low-pass filter to perform low-pass filtering on the color edge point to obtain the color difference value after filtering of the color edge point, and determine the color difference value after filtering of the color edge point as the color difference value after filtering of the pixel point to be corrected.

12. A filtering and correction device for high-frequency pseudo-color suppression, characterized in that The device includes: An image acquisition module, configured to acquire an original RGB image, where the original RGB image contains the original color channel values of each pixel point; An original color difference value acquisition module, configured to obtain the original color difference values of each pixel point in the original RGB image according to the original color channel values of each pixel point in the original RGB image, and form the color difference plane of the original RGB image from the original color difference values of each pixel point; A pixel point to be corrected determination module, configured to determine the pixel points to be corrected contained in the original RGB image according to the original color channel values of each pixel point and the size of a preset filtering window; A filtering module, configured to perform low-pass filtering on the pixel point to be corrected in the color difference plane to obtain the color difference value after filtering of the pixel point to be corrected; A color channel value after filtering acquisition module, configured to obtain the color channel value after filtering of the pixel point to be corrected according to the color difference value after filtering of the pixel point to be corrected and the original color channel value of the pixel point to be corrected; An image after filtering acquisition module, configured to obtain an RGB image after filtering correction according to the color channel value after filtering of the pixel point to be corrected and the original color channel values of other pixel points in the original RGB image except the pixel point to be corrected.