Image pseudo-color removal method and device based on interpolation, system-on-chip and computer storage medium
By extracting the cache window in the image processing, calculating the color difference channel value and filtering according to the direction information, the problem of removing pseudo-color in the image is solved and the image quality is improved.
Patent Information
- Application Number
- CN202480001816.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-02-07
AI Technical Summary
Existing image processing methods cannot efficiently remove pseudo-color from images, affecting image quality.
By acquiring the original image, extracting the cache window, calculating the color difference channel value, and filtering according to the direction information of the target pixel to remove pseudo-color.
While ensuring image clarity, it accurately removes pseudo-colors at edge areas and textures, effectively improving image quality.
Smart Images

Figure CN119404216A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an interpolation-based image pseudo-color removal method and device, a system-level chip, and a computer storage medium. Background Art
[0002] Current imaging devices, such as cameras, usually use a single image sensor with a filter for cost considerations. After the image sensor captures the image, the ISP (Image Signal Processing) system is used to process the captured image, and finally outputs an RGB color image. ISP usually includes linear error correction, denoising, bad pixel removal, white balance, color correction, tone mapping, demosaicing, etc.
[0003] However, when processing images, false colors often appear in complex texture areas, or errors are made in averaging local pixel values during interpolation, or images do not overlap as expected, which seriously affects the quality of the final output color image. Therefore, false colors must be removed to ensure that the image color is clear and accurate, and the visual experience is good. Summary of the invention
[0004] The purpose of the present invention is to provide a method and device for removing false colors from images based on interpolation, a system-level chip, and a computer storage medium to solve the problem that existing image processing methods cannot efficiently remove false colors in images.
[0005] In order to solve the above technical problems, the present invention provides an image false color removal method based on interpolation, comprising:
[0006] Get the original image;
[0007] Taking the current target pixel in the original image as a reference, extract the cache window;
[0008] In the cache window, calculate the color difference channel value;
[0009] According to the direction information of the current target pixel, the color difference channel value is filtered to remove the false color;
[0010] The filtered color difference channel values are used to calculate the full channel values after the pseudo color is removed, so as to output the image after the pseudo color is removed.
[0011] Optionally, in the interpolation-based image false color removal method, the step of filtering the color difference channel value according to the direction information of the current target pixel to remove the false color includes:
[0012] According to the direction information of the current target pixel, a number of candidate filtering points are extracted from the cache window to obtain a set of filtering points;
[0013] Obtain the color difference channel values corresponding to all the candidate filter points in the filter point set to obtain a filter data set;
[0014] The filtered data set is processed by classified median filtering to obtain the color difference channel values of all the candidate filtering points after removing the pseudo-color.
[0015] Optionally, in the interpolation-based image false color removal method, the step of extracting the cache window based on the current target pixel in the original image includes:
[0016] Taking the current target pixel in the original image as a reference, extract a cache window of m rows and n columns, where m is an odd number greater than or equal to 3, and n is an odd number greater than or equal to 3;
[0017] The current target pixel is located in the middle row and middle column of the cache window.
[0018] Optionally, in the interpolation-based image pseudo-color removal method, the step of calculating the color difference channel value in the cache window includes:
[0019] If the original image is an RGB image, RG and BG are calculated as two color difference channels;
[0020] If the original image is a YUV image, U and V are taken as the two color difference channels.
[0021] Optionally, in the interpolation-based image false color removal method, the direction information of the current target pixel includes whether the current target pixel is at an edge, whether the current target pixel is a directional point, and the edge direction of the current target pixel.
[0022] Optionally, in the interpolation-based image false color removal method, the step of extracting filter candidate points from the cache window according to the direction information of the current target pixel to obtain a filter point set includes:
[0023] Determine whether the current target pixel is on the edge, and if so, determine whether the current target pixel is a directional point;
[0024] If the current target pixel is determined to be a point with a direction, the vertical direction of the edge direction of the current target pixel is selected as the direction for selecting the candidate point, and more than or equal to 8 filtering candidate points are extracted from the cache window along the direction of the selected candidate point;
[0025] If the current target pixel is determined to be a point without direction, greater than or equal to 8 filtering candidate points are extracted from the cache window in an isotropic distribution manner.
[0026] Optionally, in the interpolation-based image false color removal method, 8 of the extracted filtering candidate points are adjacent to the current target pixel.
[0027] Optionally, in the interpolation-based image pseudo-color removal method, the step of performing classified median filtering on the filtered data set to obtain color difference channel values of all filtered candidate points after pseudo-color removal includes:
[0028] According to the preset color difference channel threshold, the color difference channel values in the filtered data set are divided into an outlier color difference area or a target color difference area;
[0029] Determine whether the current target pixel is located in the target color difference area;
[0030] If the color difference channel value of the current target pixel is in the target color difference area, then its color difference channel value is retained;
[0031] If the color difference channel value of the current target pixel is located in the outlier color difference area, the color difference channel value of the current target pixel is replaced by the color difference channel value of the current target pixel in the target color difference area that is closest to the current target pixel.
[0032] Optionally, in the interpolation-based image false color removal method, the step of determining whether the current target pixel is located in the target color difference area includes:
[0033] Sort the color difference channel values in the filter data set in a preset manner;
[0034] Get the position of the color difference channel value of the current target pixel in the sorted filter data set;
[0035] Determine whether the current target pixel is located in the target color difference area according to the position.
[0036] In order to solve the above technical problems, the present invention further provides an image false color removal device based on interpolation, which is used to implement the image false color removal method based on interpolation as described in any one of the above items, and the image false color removal device based on interpolation includes:
[0037] An image acquisition module, used for acquiring original images;
[0038] A color difference calculation module is used to extract a buffer window and calculate a color difference channel value in the buffer window;
[0039] A filtering processing module is used to filter the color difference channel value according to the direction information of the current target pixel to remove the false color;
[0040] The image output module is used to calculate the full channel value after the pseudo color is removed by using the filtered color difference channel value, so as to output the image after the pseudo color is removed.
[0041] In order to solve the above technical problems, the present invention also provides a system-level chip, which includes a processor and a memory, the processor and the memory are coupled, and the processor is used to execute a computer program stored in the memory to execute the interpolation-based image false color removal method as described in any of the above items.
[0042] In order to solve the above technical problems, the present invention also provides a computer storage medium, wherein the computer storage medium stores an executable program; when the executable program is executed, the interpolation-based image false color removal method as described in any one of the above items is implemented.
[0043] The interpolation-based image pseudo-color removal method and device, system-level chip, and computer storage medium provided by the present invention locate the edge area where pseudo-color is likely to appear through the direction information of the current target pixel, and then filter the color difference channel value obtained by difference calculation. It can accurately remove the pseudo-color in the edge area and texture while ensuring the image clarity, thereby effectively improving the image quality and efficiently removing the pseudo-color in the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of the process of removing false color from an image based on interpolation provided in this embodiment;
[0045] Figure 2 A schematic diagram of the coordinate positions of each pixel in a 5×5 cache window provided in this embodiment;
[0046] Figure 3 A schematic diagram of the process of step S4 provided in this embodiment;
[0047] Figure 4 A schematic diagram of filtering candidate points extracted when the direction of selecting filtering candidate points provided in this embodiment is a vertical direction;
[0048] Figure 5 A schematic diagram of filtering candidate points extracted when the direction of selecting filtering candidate points provided in this embodiment is the horizontal direction;
[0049] Figure 6 A schematic diagram of filtering candidate points extracted when the direction of selecting filtering candidate points provided in this embodiment is a diagonal direction;
[0050] Figure 7 A schematic diagram of filtering candidate points extracted when the direction of selecting filtering candidate points provided by this embodiment is the anti-diagonal direction;
[0051] Figure 8 A schematic diagram of the filtering candidate points extracted when there is no direction for selecting the filtering candidate points provided in this embodiment;
[0052] Fig. 9 A schematic diagram of the classified median filtering provided in this embodiment;
[0053] Fig.10 A schematic diagram of the structure of the interpolation-based image false color removal device provided in this embodiment;
[0054] Fig.11 This is a schematic diagram of the structure of the system-on-chip provided in this embodiment. DETAILED DESCRIPTION
[0055] The interpolation-based image pseudo-color removal method and device, system-level chip, and computer storage medium proposed in the present invention are further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the accompanying drawings are all in a very simplified form and use non-precise proportions, which are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. In addition, the structure shown in the accompanying drawings is often a part of the actual structure. In particular, the emphasis that each drawing needs to show is different, and sometimes different proportions are used.
[0056] It should be noted that the terms "first", "second", etc. in the specification, claims and drawings of the present invention are used to distinguish similar objects in order to describe the embodiments of the present invention, rather than to describe a specific order or sequence. It should be understood that the structures used in this way can be interchanged under appropriate circumstances. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0057] At present, the main causes of false colors in images come from the lens or ISP processing. Among them, the false colors related to the lens usually appear at the edge of the object, mostly in purple, yellow-green, magenta, with variable width and radial trend; while the false colors related to the ISP processing process usually appear at the edge of the object and in the texture-dense area, with a small width (generally about 2 pixels) and high saturation. Therefore, if the false colors at the edge of the object can be effectively removed, the effect of removing false colors can be effectively improved, and the image quality can be improved.
[0058] Based on this, this embodiment provides an image pseudo-color removal method based on interpolation, such as Figure 1 As shown, including:
[0059] S1, obtain the original image;
[0060] S2, extracting the cache window based on the current target pixel in the original image;
[0061] S3, calculating the color difference channel value in the cache window;
[0062] S4, filtering the color difference channel value according to the direction information of the current target pixel to remove the false color;
[0063] S5, using the filtered color difference channel values, calculating the full channel values after the pseudo color is removed, so as to output the image after the pseudo color is removed.
[0064] The interpolation-based image pseudo-color removal method provided in this embodiment locates the edge area where pseudo-color is likely to appear through the direction information of the current target pixel, and then filters the color difference channel value obtained by difference calculation. It can accurately remove pseudo-colors in edge areas and textures while ensuring image clarity, thereby effectively improving image quality and efficiently removing pseudo-colors in the image.
[0065] Specifically, in this embodiment, in step S1, the original image obtained may be an original image obtained from various photographic and video equipment, or an image output after undergoing some image processing steps. The format of the original image obtained may be a RAW image (an original image obtained from an image sensor), an RGB image (an image composed of the color intensities of the three channels of red (R), green (G), and blue (B)), or a YUV image (an image composed of a brightness signal (Y) and chrominance signals (U and V)).
[0066] Furthermore, in the present embodiment, step S2, extracting a cache window based on the current target pixel in the original image, can be specifically: extracting a cache window of m rows and n columns based on the current target pixel in the original image, wherein m is an odd number greater than or equal to 3, and n is an odd number greater than or equal to 3; the current target pixel is located in the middle row and the middle column of the cache window.
[0067] In this embodiment, the pixel value of the pixel in the buffer window is recorded as P x,y , where x represents the row coordinate of the pixel in the cache window, in the order from left to right, x = 0, 1, ..., m-1; y represents the column coordinate of the pixel in the cache window, in the order from top to bottom, y = 0, 1, ..., n-1; the pixel value of the current target pixel is recorded as P i,j ,in,
[0068] like Figure 2As shown, in this embodiment, m=5, n=5 are set, so as to extract a 5×5 cache window. At this time, the current target pixel is located in the third row and the third column, that is, i=2, j=2, and the pixel value of the current target pixel is recorded as P 2,2 .
[0069] Of course, in actual applications, the size of the cache window can be determined according to the hardware resources or the image capture content, and the cache window can be square or rectangular.
[0070] Further, according to different formats of the original image, in this embodiment, in step S3, the method for calculating the color difference channel value in the cache window specifically includes:
[0071] S3-1, if the original image is an RGB image, RG and BG are calculated as two color difference channels. The method of calculating the RG color difference value and the BG color difference value in the RGB domain is well known to those skilled in the art, and this application will not elaborate on this.
[0072] S3-2, if the original image is a YUV image, take U and V as two color difference channels. The method of taking the values of the U and V channels in the YUV domain is also well known to those skilled in the art, and this application will not elaborate on it.
[0073] In practical applications, if the original image is a non-RGB or YUV format image such as a RAW image, the format of the original image can be converted to RGB format or YUV format by color gamut conversion, and then the color difference channel value is calculated using the above steps. The color gamut conversion method is well known to those skilled in the art and will not be described in detail in this application.
[0074] Furthermore, in the cache window, if the current target pixel is in a flat area, most of the color difference values in the area are relatively close, but due to the influence of noise, there may be very few outlier color difference values; if the current target pixel is in an edge area, the color difference values in the area may be clustered into two groups, corresponding to the two sides of the edge, and a group of clusters with larger color difference values can be identified as the color difference value on the edge side where the current target pixel is located. When pseudo-color appears in the edge area, in addition to the large cluster of color difference values on the edge side where the current target pixel is located, there are additional pixels with larger color difference values that are not included in the cluster, and this part is usually the pseudo-color that needs to be removed.
[0075] Therefore, in this embodiment, if Figure 3 As shown, step S4, filtering the color difference channel value according to the direction information of the current target pixel to remove the false color method includes:
[0076] S41, extracting a number of candidate filtering points from the cache window according to the direction information of the current target pixel to obtain a filtering point set.
[0077] Specifically, in this embodiment, the direction information of the current target pixel includes whether the current target pixel is at an edge, whether the current target pixel is a point with a direction, and the edge direction of the current target pixel.
[0078] In practical applications, whether the current target pixel is at the edge can be judged based on the interpolation calculation in the demosaicing process, or it can be judged by using other processing modules containing edge calculation in the ISP. Even, edge detection can be performed separately to judge whether the current target pixel is at the edge. When judging whether the current target pixel is a directional point, the calculation result of the interpolation direction in the demosaicing process can be used to make a judgment. If the interpolation direction is calculated in the demosaicing process, the current target pixel is considered to be a directional point. Since the interpolation direction obtained in the demosaicing process is generally consistent with the edge direction, in practical applications, the edge direction of the current target pixel can be defined as the interpolation direction.
[0079] When extracting the candidate filtering points, first, it is determined whether the current target pixel is at the edge. If so, it is determined whether the current target pixel is a directional point.
[0080] If the current target pixel is determined to be a point with a direction, the vertical direction of the edge direction of the current target pixel is selected as the direction of selecting the candidate point, that is, the vertical direction of the interpolation direction is selected as the direction of selecting the filtering candidate point. Since the direction of selecting the candidate point is perpendicular to the edge direction, the extracted filtering candidate point can contain more normal pixels on both sides of the edge, thereby improving the accuracy of the judgment when performing pseudo-color judgment. Then, more than or equal to 8 filtering candidate points are extracted from the cache window along the direction of the selected candidate point.
[0081] If the current target pixel is determined to be a point without direction, then more than or equal to 8 candidate filter points are extracted from the cache window in an isotropic distribution manner. Since the current target pixel is determined to be a point without direction, it can be determined that the current target pixel is in a flat area. Flat areas themselves are not prone to false colors. Therefore, there are no strict requirements for the extraction method of candidate filter points in flat areas. It is sufficient to ensure that the number of candidate filter points extracted is consistent with the number of candidate filter points extracted when the current target pixel is a point with direction, so as to facilitate the subsequent filtering process.
[0082] In a specific embodiment, taking a 5×5 cache window as an example, when the direction of selecting the candidate point is the vertical direction, such as Figure 4As shown, the three middle columns of pixels in the vertical direction are extracted as candidate filtering points ( Figure 4 The gray square represents the extracted filtering candidate point). At this time, the current target pixel and its surrounding 8 pixels are all extracted as filtering candidate points. When the direction of selecting the candidate point is horizontal, such as Figure 5 As shown, the pixels in the middle three columns in the horizontal direction are extracted as candidate filtering points ( Figure 5 The gray square represents the extracted filtering candidate point). At this time, the current target pixel and its surrounding 8 pixels are all extracted as filtering candidate points. When the direction of selecting the candidate point is the diagonal direction, such as Figure 6 As shown, 15 pixels in the diagonal direction are extracted as candidate filtering points ( Figure 6 The gray square represents the extracted filtering candidate point). At this time, the current target pixel and its surrounding 8 pixels are all extracted as filtering candidate points. When the direction of selecting the candidate point is the anti-diagonal direction, such as Figure 7 As shown, 15 pixels in the anti-diagonal direction are extracted as candidate filtering points ( Figure 7 The gray square represents the extracted filtering candidate point). At this time, the current target pixel and its surrounding 8 pixels are all extracted as filtering candidate points. When the current target pixel is a point without direction (no direction for selecting candidate points), Figure 8 As shown in the figure, with the current target as the center, 15 pixels are uniformly extracted in all directions as candidate filtering points ( Figure 8 The medium gray square represents the extracted filtering candidate point). At this time, the current target pixel and its surrounding 8 adjacent pixels are all extracted as filtering candidate points.
[0083] Of course, those skilled in the art will be able to learn methods for extracting filter candidate points in cache windows of other sizes, such as taking the current target pixel as the center and extracting several symmetrical columns, rows, diagonal or anti-diagonal pixels as filter candidate points; or, when the size of the cache window is less than 5×5 (such as the size of the cache window is 3×3, 3×5 or 5×3), taking the current target pixel as the center, extracting several symmetrical columns, rows, diagonal or anti-diagonal pixels as filter candidate points, wherein when the size of the cache window is 3×3, the extracted filter candidate points are 8 pixel points surrounding the current target pixel; or, when the size of the cache window is greater than 5×5, taking the current target pixel as the center, still within the 5×5 size range, extracting several symmetrical columns, rows, diagonal or anti-diagonal pixels as filter candidate points, and the present application does not impose any restrictions on this.
[0084] In practical applications, it is necessary to reasonably set the number of extraction filter candidate points and the positions of the extracted pixels according to the actual size of the cache window and the accuracy requirements of pseudo-color removal.
[0085] Preferably, in order to facilitate subsequent filtering processing, the number of extracted pixel points needs to be consistent; at the same time, in order to ensure the continuity of edge judgment and the accuracy of pseudo-color judgment, the area formed by the extracted filter candidate points should be continuous and complete, and all the filter candidate points are adjacent to each other, that is, there are no non-filter candidate points in the area formed by all the filter candidate points. In addition, the current target pixel is included in the extracted filter candidate points, and 8 of the filter candidate points are adjacent to the current target pixel.
[0086] S42, obtaining the color difference channel values corresponding to all the candidate filtering points in the filtering point set to obtain a filtering data set.
[0087] Specifically, the color difference channel values of the extracted filter candidate points are calculated according to the format of the image. For example, for an RGB image, it is necessary to calculate the BG color difference channel value and the RG color difference channel value of each filter candidate point, which can be denoted as Cb and Cr. The filter data sets need to be established separately for different types of color difference channel values. For example, the BG color difference channel values Cb of all filter candidate points together constitute the Cb filter data set, denoted as Cb[T]; the RG color difference channel values Cr of all filter candidate points together constitute the Cr filter data set, denoted as Cr[T]; where T is the total number of filter candidate points. Taking the above 5×5 cache window to extract 15 filter candidate points as an example, the filter data sets are Cb
[15] and Cr
[15] .
[0088] S43, performing classified median filtering on the filter data set to obtain color difference channel values of all filter candidate points after removing pseudo colors.
[0089] Specifically, in this embodiment, first, according to a preset color difference channel threshold, the color difference channel values in the filtered data set are divided into an outlier color difference area or a target color difference area; then, it is determined whether the current target pixel is located in the target color difference area; if the color difference channel value of the current target pixel is located in the target color difference area, its color difference channel value is retained; if the color difference channel value of the current target pixel is located in the outlier color difference area, the color difference channel value of the current target pixel is replaced by the color difference channel value in the target color difference area that is closest to the current target pixel.
[0090] Among them, the preset color difference channel threshold needs to be reasonably set according to the clustering of the color difference channel values in the image and the accuracy requirements of pseudo color removal, so as to ensure that the details of the image are not lost while removing pseudo colors, thereby making the output image quality higher.
[0091] In practical applications, the color difference channel threshold under the current cache window can be confirmed by adaptive adjustment. For example, all color difference channel values in the filter data set are arranged from small to large, and the color difference channel values that account for 60% of all color difference channel values in the filter data set are selected symmetrically from the median to both sides as the target color difference area, and the color difference channel values at the two end points are the color difference channel thresholds. Of course, the selected ratio is not limited to 60%, and can be set according to the actual clustering of color difference channel values and the accuracy requirements of pseudo-color removal.
[0092] In a specific embodiment, if Fig. 9 As shown, first, the color difference channel values in the filter data set are sorted in a preset manner, for example, in an ascending order.
[0093] Then, according to the preset color difference channel threshold, the color difference channel values in the sorted filtered data set are divided into the first outlier color difference area, the target color difference area and the second outlier color difference area in turn. At this time, it is necessary to set the color difference channel minimum threshold and the color difference channel maximum threshold. The color difference channel values less than the color difference channel minimum threshold are divided into the first outlier color difference area, the color difference channel values greater than the color difference channel maximum threshold are divided into the second outlier color difference area, and the remaining color difference channel values are divided into the target color difference area. Since the color difference channel values in the target color difference area are clustered, the range of the target color difference area can be obtained according to the clustering relationship, and the minimum value of the color difference channel values in the target color difference area is the color difference channel minimum threshold, and the maximum value is the color difference channel maximum threshold.
[0094] At this time, since the order of each color difference channel value is sorted by the size of the color difference channel value, if the order of the color difference channel value closest to the color difference channel threshold in the sorted filtered data set is known, or the order of the color difference channel threshold in the sorted filtered data set is known, the area where each color difference channel value is located can be known.
[0095] Afterwards, it is determined whether the current target pixel is located in the target color difference area. Specifically, the position of the color difference channel value of the current target pixel in the sorted filter data set can be obtained; then, it is determined whether the current target pixel is located in the target color difference area according to the position. Of course, it is also possible to determine whether the current target pixel is located in the target color difference area according to the judgment result of the color difference channel value of the current target pixel and the color difference channel threshold.
[0096] Finally, if the color difference channel value of the current target pixel is located in the target color difference area, it means that the current target pixel is in the cluster, so its color difference channel value is retained; if the color difference channel value of the current target pixel is located in the first outlier color difference area, it means that the current target pixel is outlier, and the color difference channel value is small, so the color difference channel value of the current target pixel is replaced by the color difference channel value closest to the first outlier color difference area in the target color difference area (that is, the minimum color difference channel value in the target color difference area); if the color difference channel value of the current target pixel is located in the second outlier color difference area, it means that the current target pixel is outlier, and the color difference channel value is large, so the color difference channel value of the current target pixel is replaced by the color difference channel value closest to the second outlier color difference area in the target color difference area (that is, the maximum color difference channel value in the target color difference area).
[0097] In this way, by judging whether the color difference channel value of the current target pixel is within the cluster, it is confirmed whether the current target pixel has pseudo color, and the color difference channel value closest to the current target pixel in the cluster is used to replace its original color difference channel value. It is possible to ensure the rationality and coordination of the overall color difference of the image while ensuring the removal of pseudo color, thereby improving the image quality while effectively removing pseudo color.
[0098] Furthermore, in this embodiment, in step S5, the filtered color difference channel values are used to calculate the full channel values after the pseudo color is removed, so as to output the image after the pseudo color is removed.
[0099] Still taking the above example, let the BG color difference channel value after filtering of the current target pixel be recorded as Cbs, and the RG color difference channel value after filtering be recorded as Crs. Correspondingly, the color difference channel values after removing the pseudo color are Cb_new and Cr_new respectively. Then, the B channel value of the current target pixel after removing the pseudo color is Cb_new+G, and the R channel value is Cr_new+G.
[0100] By traversing all the pixels of the image, the image with pseudo-color removed can be obtained.
[0101] The interpolation-based image false color removal method provided in this embodiment targets edge and texture areas where false colors are prone to appear, and selects different filter candidate points along the vertical direction of the edge direction according to different edge directions, thereby introducing as many candidate points of correct colors as possible into the filter, thereby enabling the false colors to be replaced by the largest cluster in the classification filter, thereby correctly filtering out outlier false colors and effectively avoiding false positives.
[0102] The interpolation-based image pseudo-color removal method and the classified median filtering method provided in this embodiment can make the filtered color difference approach the main clustered color difference instead of approaching "lower color and lower saturation", thereby protecting the true color of the edge and avoiding the problem of gray or obvious saturation reduction at the edge.
[0103] This embodiment also provides an interpolation-based image false color removal device, which is used to implement the above-mentioned interpolation-based image false color removal method, such as Fig.10 As shown, the interpolation-based image false color removal device includes:
[0104] An image acquisition module, used for acquiring original images;
[0105] A color difference calculation module is used to extract a buffer window and calculate a color difference channel value in the buffer window;
[0106] A filtering processing module is used to filter the color difference channel value according to the direction information of the current target pixel to remove the false color;
[0107] The image output module is used to calculate the full channel value after the pseudo color is removed by using the filtered color difference channel value, so as to output the image after the pseudo color is removed.
[0108] The interpolation-based image pseudo-color removal device provided in this embodiment calculates the direction information of the current target pixel through a filtering processing module, and locates the edge area where pseudo-color is likely to appear, and then filters the color difference channel value output by the color difference calculation module. It can accurately remove pseudo-colors in edge areas and textures while ensuring image clarity, thereby effectively improving image quality and efficiently removing pseudo-colors in the image.
[0109] Furthermore, this embodiment further provides a system-level chip, which includes a processor and a memory, wherein the processor and the memory are coupled, and the processor is used to execute a computer program stored in the memory to perform the interpolation-based image pseudo-color removal method as described above.
[0110] Furthermore, this embodiment further provides a computer storage medium, wherein the computer storage medium stores an executable program; when the executable program is executed, the interpolation-based image false color removal method as described in any one of the above items is implemented.
[0111] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other. In addition, the different parts between the various embodiments can also be used in combination with each other, and the present invention is not limited to this.
[0112] The interpolation-based image pseudo-color removal method and device, and system-level chip provided in this embodiment locate the edge area where pseudo-color is likely to appear through the direction information of the current target pixel, and then filter the color difference channel value obtained by difference calculation. It can accurately remove pseudo-colors in edge areas and textures while ensuring image clarity, thereby effectively improving image quality and efficiently removing pseudo-colors in images.
[0113] The above description is only a description of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention. Any changes or modifications made by a person skilled in the art in the field of the present invention based on the above disclosure shall fall within the scope of protection of the claims.
Claims
1. A method for removing false color from an image based on interpolation, characterized in that: include: Get the original image; Taking the current target pixel in the original image as a reference, extract the cache window; In the cache window, calculate the color difference channel value; According to the direction information of the current target pixel, the color difference channel value is filtered to remove the false color; The filtered color difference channel values are used to calculate the full channel values after the pseudo color is removed, so as to output the image after the pseudo color is removed.
2. The interpolation-based image false color removal method according to claim 1, characterized in that: The step of filtering the color difference channel value according to the direction information of the current target pixel to remove the false color comprises: According to the direction information of the current target pixel, a number of candidate filtering points are extracted from the cache window to obtain a set of filtering points; Obtain the color difference channel values corresponding to all the candidate filter points in the filter point set to obtain a filter data set; The filtered data set is processed by classified median filtering to obtain the color difference channel values of all the candidate filtering points after removing the pseudo-color.
3. The interpolation-based image false color removal method according to any one of claims 1 or 2, characterized in that: The step of extracting the cache window based on the current target pixel in the original image comprises: Taking the current target pixel in the original image as a reference, extract a cache window of m rows and n columns, where m is an odd number greater than or equal to 3, and n is an odd number greater than or equal to 3; The current target pixel is located in the middle row and middle column of the cache window.
4. The image false color removal method based on interpolation according to any one of claims 1 or 2, characterized in that: The step of calculating the color difference channel value in the cache window includes: If the original image is an RGB image, RG and BG are calculated as two color difference channels; If the original image is a YUV image, U and V are taken as the two color difference channels.
5. The interpolation-based image false color removal method according to claim 2, characterized in that: The direction information of the current target pixel includes whether the current target pixel is at an edge, whether the current target pixel is a point with a direction, and the edge direction of the current target pixel.
6. The interpolation-based image false color removal method according to claim 5, characterized in that: The step of extracting filtering candidate points from the cache window according to the direction information of the current target pixel to obtain a filtering point set includes: Determine whether the current target pixel is on the edge, and if so, determine whether the current target pixel is a directional point; If the current target pixel is determined to be a point with a direction, the vertical direction of the edge direction of the current target pixel is selected as the direction for selecting the candidate point, and more than or equal to 8 filtering candidate points are extracted from the cache window along the direction of the selected candidate point; If the current target pixel is determined to be a point without direction, greater than or equal to 8 filtering candidate points are extracted from the cache window in an isotropic distribution manner.
7. The interpolation-based image false color removal method according to claim 6, characterized in that: Among the extracted filtering candidate points, 8 of the filtering candidate points are adjacent to the current target pixel.
8. The interpolation-based image false color removal method according to claim 2, characterized in that: The step of performing classified median filtering on the filter data set to obtain the color difference channel values of all the filter candidate points after removing the pseudo color comprises: According to the preset color difference channel threshold, the color difference channel values in the filtered data set are divided into an outlier color difference area or a target color difference area; Determine whether the current target pixel is located in the target color difference area; If the color difference channel value of the current target pixel is in the target color difference area, then its color difference channel value is retained; If the color difference channel value of the current target pixel is located in the outlier color difference area, the color difference channel value of the current target pixel is replaced by the color difference channel value of the current target pixel in the target color difference area that is closest to the current target pixel.
9. The interpolation-based image false color removal method according to claim 8, characterized in that: The step of determining whether the current target pixel is located in the target color difference area comprises: Sort the color difference channel values in the filter data set in a preset manner; Get the position of the color difference channel value of the current target pixel in the sorted filter data set; Determine whether the current target pixel is located in the target color difference area according to the position.
10. An interpolation-based image false color removal device, used to implement the interpolation-based image false color removal method according to any one of claims 1 to 9, characterized in that: The interpolation-based image false color removal device comprises: An image acquisition module, used for acquiring original images; A color difference calculation module is used to extract a buffer window and calculate a color difference channel value in the buffer window; A filtering processing module is used to filter the color difference channel value according to the direction information of the current target pixel to remove the false color; The image output module is used to calculate the full channel value after the pseudo color is removed by using the filtered color difference channel value, so as to output the image after the pseudo color is removed.
11. A system-on-chip, characterized in that: The system-level chip includes a processor and a memory, wherein the processor and the memory are coupled, and the processor is used to execute a computer program stored in the memory to execute the interpolation-based image false color removal method according to any one of claims 1 to 9.
12. A computer storage medium, characterized in that: The computer storage medium stores an executable program; when the executable program is executed, the interpolation-based image false color removal method according to any one of claims 1 to 9 is implemented.
Citation Information
Cited By
Image color abnormal region processing method and device, electronic equipment and computer storage medium
CN121661157A