Image color abnormal region processing method and device, electronic equipment and computer storage medium

By adjusting the pixels in areas of abnormal color in the image to gray and performing median filtering on the UV channels, the problems of abnormal areas such as moiré patterns and purple fringing in the image were solved, improving the image quality and visual appeal.

CN121661157APending Publication Date: 2026-03-13CHENGDU LIGHT COLLECTOR TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

The image contains areas of abnormal image color such as moiré patterns and purple fringing, which seriously affect the image quality and visual appeal.

Method used

The pixel colors in the areas of color abnormality in the image are adjusted to gray, and then UV channel median filtering is performed in YUV format before being converted back to RGB format.

Benefits of technology

While maintaining the image texture and colors of other areas, the colors of areas with color abnormalities in the image are adjusted to harmonize with the surrounding areas, thereby improving image quality and visual appeal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121661157A_ABST
    Figure CN121661157A_ABST
Patent Text Reader

Abstract

The invention provides a method and a device for processing an image color abnormal region, electronic equipment and a computer storage medium. The method comprises the following steps: acquiring an RGB image with the image color abnormal region; adjusting the pixel color of the image color abnormal region to gray; in the YUV format, performing median filtering on a UV channel on the image color abnormal region to obtain a filtered YUV image; and converting the YUV image after median filtering back to an RGB format to obtain a processed RGB image. The pixel color of the image color abnormal region is adjusted to be gray, and the median filtering on the UV channel is performed on the image color abnormal region, so that the color of the image color abnormal region can be adjusted while the image texture is kept unchanged and the color and the image quality of other regions are not influenced, and the image quality is improved. Therefore, the color of the image color abnormal region is coordinated with the color of the surrounding region, the quality and impression of the output image are improved, and the problem of how to effectively process and correct the image color abnormal region is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method and apparatus for processing abnormal color areas in an image, an electronic device, and a computer storage medium. Background Technology

[0002] After acquiring the raw image captured by the image sensor, image signal processing (ISP) algorithms are typically used to perform a series of processing steps on the raw image, such as black level correction, white balance, depigmentation, noise reduction, and sharpening, in order to ensure the quality and appearance of the output color image.

[0003] However, due to the limited resolution of image sensors, areas with dense stripes in the image are prone to exhibiting moiré patterns with bright, incorrect colors in the final image due to insufficient sampling rate or a mismatch between the stripe tilt angle and the sensor's pixel arrangement direction. Additionally, purple fringing is likely to appear at the boundaries between bright and dark areas of the image or at the lens edges.

[0004] Areas exhibiting moiré patterns and purple fringing, along with other areas potentially containing incorrect colors, are collectively referred to as image color anomaly areas. Image color anomaly areas severely impact the quality and visual appeal of the final output image; therefore, they must be processed and corrected to ensure the quality and visual appeal of the output image. Summary of the Invention

[0005] The purpose of this invention is to provide a method, apparatus, electronic device, and computer storage medium for processing abnormal color areas in images, so as to solve the problem of how to effectively process and correct abnormal color areas in images.

[0006] To address the aforementioned technical problems, this invention provides a method for processing image color anomaly regions, comprising: Obtain an RGB image with regions exhibiting color anomalies; Adjust the pixel color in the area of ​​color abnormality in the image to gray; In YUV format, median filtering is performed on the UV channels of the image to obtain the filtered YUV image; The median-filtered YUV image is converted back to RGB format to obtain the processed RGB image.

[0007] Optionally, in the method for processing image color abnormalities, the method for adjusting the pixel color of the image color abnormality area to gray includes: Adjust the RGB values ​​of pixels in the color abnormality area of ​​the image to be equal, while keeping the brightness of the Y channel unchanged, so as to adjust the color of the pixels in the color abnormality area of ​​the image to gray.

[0008] Optionally, in the method for processing image color abnormalities, the method of performing median filtering on the UV channels of the image color abnormality region in YUV format to obtain a filtered YUV image includes: Convert an RGB image to a YUV image; Median filtering is applied to the UV channels of the YUV image to obtain the filtered YUV image.

[0009] Optionally, in the method for processing abnormal color regions in the image, the size of the filtering window used for median filtering is determined according to the distribution density of abnormal color regions in the YUV image.

[0010] Optionally, in the method for processing image color abnormalities, the method further includes: Obtain the location marker data of color anomaly regions in the RGB image; Use location-marked data to identify regions of abnormal image color in RGB or YUV images.

[0011] To address the aforementioned technical problems, the present invention also provides an image color abnormality region processing apparatus, used to implement the image color abnormality region processing method as described in any of the preceding claims, wherein the image color abnormality region processing apparatus includes: The image acquisition module is used to acquire RGB images with regions of abnormal image color. The color adjustment module is used to adjust the pixel color in areas of abnormal color in the image to gray. The filtering module is used to perform median filtering on the UV channels of the image in YUV format to obtain the filtered YUV image. The format conversion module is used to convert the median-filtered YUV image into RGB format to obtain the processed RGB image.

[0012] Optionally, in the processing device for abnormal color areas of the image, the format conversion module is also used to convert the RGB image into a YUV image.

[0013] Optionally, in the image color abnormality area processing device, the image color abnormality area processing device further includes an image output module, which is used to output the processed RGB image.

[0014] To address the aforementioned technical problems, the present invention also provides an electronic device, including a memory, a processor, and an executable program stored in the memory and capable of being run by the processor; when the processor runs the executable program, it performs the image color abnormality region processing method as described in any of the preceding claims.

[0015] To address the aforementioned technical problems, the present invention also provides a computer storage medium storing an executable program; when the executable program is executed, it implements the image color abnormality region processing method as described in any of the preceding claims.

[0016] The present invention provides a method, apparatus, electronic device, and computer storage medium for processing image color aberration regions, comprising: acquiring an RGB image with image color aberration regions; adjusting the pixel colors of the image color aberration regions to gray; performing median filtering on the UV channels of the image color aberration regions in YUV format to obtain a filtered YUV image; and converting the median-filtered YUV image back to RGB format to obtain a processed RGB image. By adjusting the pixel colors of the image color aberration regions to gray and performing median filtering on the UV channels of the image color aberration regions, the color of the image color aberration regions can be adjusted while maintaining the image texture and not affecting the colors and image quality of other areas. This makes the color of the image color aberration regions coordinate with the colors of the surrounding areas, improving the quality and visual appeal of the output image, and solving the problem of how to effectively process and correct image color aberration regions. Attached Figure Description

[0017] Figure 1 This is a flowchart of the image color anomaly processing method provided in this embodiment; Figure 2 This is a schematic diagram of the structure of the image color abnormality processing device provided in this embodiment. Detailed Implementation

[0018] The following detailed description, in conjunction with the accompanying drawings and specific embodiments, provides a more comprehensive overview of the image color anomaly processing method and apparatus, electronic device, and computer storage medium proposed in this invention. It should be noted that the accompanying drawings are all in a very simplified form and use non-precise scales, intended only to facilitate and clarify the illustration of the embodiments of this invention. Furthermore, the structures shown in the drawings are often part of the actual structures. In particular, different figures may emphasize different aspects and sometimes use different scales.

[0019] It should be noted that the terms "first," "second," etc., used in the specification, claims, and drawings of this invention are used to distinguish similar objects in order to describe embodiments of the invention, and are not used to describe a specific order or sequence. It should be understood that such uses of terminology are interchangeable where appropriate. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0020] This embodiment provides a method for processing areas with abnormal image colors, such as... Figure 1 As shown, it includes: S1, acquire the RGB image with regions of abnormal image color; S2, adjust the pixel color of the image's color abnormality area to gray; S3, in YUV format, perform median filtering on the UV channels in the regions of abnormal color in the image to obtain the filtered YUV image; S4 converts the median-filtered YUV image back to RGB format to obtain the processed RGB image.

[0021] The image color abnormality region processing method provided in this embodiment adjusts the pixel color of the image color abnormality region to gray and performs median filtering on the UV channel of the image color abnormality region. It can adjust the color of the image color abnormality region while keeping the image texture unchanged and not affecting the color and image quality of other areas. This makes the color of the image color abnormality region coordinate with the color of the surrounding area, improves the quality and appearance of the output image, and solves the problem of how to effectively process and correct image color abnormality regions.

[0022] Specifically, in this embodiment, step S1 involves acquiring an RGB image with regions exhibiting abnormal image colors.

[0023] In practical applications, when acquiring an RGB image, the location marker data of the color anomaly regions within the RGB image is also acquired simultaneously. This location marker data can be the coordinates of the color anomaly regions within the RGB image. This allows for accurate identification and location of color anomaly regions not only in the RGB image but also in the YUV image after conversion, facilitating subsequent image processing steps.

[0024] Of course, in other embodiments, the location marker data can also be other data, such as markers, etc., which will not be elaborated further in this application. The selection of other location marker data without departing from the spirit of this application should also fall within the protection scope of this application.

[0025] Furthermore, in this embodiment, step S2 involves adjusting the pixel color of the image color abnormality area to gray.

[0026] Specifically, in this embodiment, the RGB three-channel values ​​of pixels in the image color abnormality area are adjusted to be equal, while the brightness of the Y channel remains unchanged, so as to adjust the color of the pixels in the image color abnormality area to gray.

[0027] This embodiment provides a specific implementation scheme: In this embodiment, the conversion formula between RGB and YUV formats uses the following formula for the Y channel:

[0028] Where R represents the R channel value of the current pixel, G represents the G channel value of the current pixel, B represents the B channel value of the current pixel, and Y represents the Y channel value of the current pixel in YUV format.

[0029] To make a pixel color gray, the adjusted RGB three channel values ​​need to be equal, which means:

[0030] Where X represents the channel value when the adjusted RGB three-channel values ​​of the current pixel are equal.

[0031] Since the Y channel reflects image brightness, in order to keep the adjusted brightness constant, we have:

[0032] Right now:

[0033] Therefore, when the current pixel is adjusted to gray, the values ​​X of the three channels are:

[0034] In this way, the pixel color in the area of ​​abnormal color in the image can be adjusted to gray.

[0035] In practical applications, since there are various conversion formulas between RGB and YUV formats, those skilled in the art can, based on the examples above, understand how to adjust the pixel color of an image with abnormal color areas to gray while maintaining the Y channel brightness under other conversion formulas. This application will not elaborate on these methods further. Furthermore, other schemes for adjusting the pixel color of an image with abnormal color areas to gray without departing from the spirit of this application should also fall within the scope of protection of this application.

[0036] Furthermore, in this embodiment, in step S3, in YUV format, median filtering is performed on the UV channels of the image color abnormality area to obtain a filtered YUV image.

[0037] Specifically, in this embodiment, the RGB image first needs to be converted into a YUV image.

[0038] In practical applications, there are various conversion formulas used to convert RGB images to YUV images. This embodiment only uses one of them as an example for illustration:

[0039]

[0040]

[0041] Of course, in other embodiments, other conversion formulas can also be used to convert RGB images to YUV images.

[0042] Preferably, in order to simplify the computational complexity and hardware resources occupied by the system, and in order to ensure the processing effect on the abnormal color areas of the image, in this embodiment, the conversion formula based on step S2 is the same as the conversion formula used in step S3.

[0043] Then, median filtering is performed on the UV channels of the YUV image to obtain the filtered YUV image.

[0044] Median filtering is a non-linear smoothing technique that sets the pixel value of each pixel to the median of the pixel values ​​of all pixels within the filtering window. Median filtering is effective at removing impulse noise, and particularly in that it preserves signal edges while filtering noise, preventing blurring and thus ensuring the quality of the filtered image. Furthermore, the algorithm for median filtering is relatively simple and easy to implement in hardware.

[0045] The specific implementation of using median filtering to filter the UV channel is well known to those skilled in the art, and will not be described in detail here.

[0046] In practical applications, the size of the filtering window used for median filtering is determined based on the distribution density of color aberration regions in the YUV image. For example, when the color aberration regions are densely distributed, a larger filtering window is used to ensure a sufficient number of non-abnormal pixels are available for calculation during median filtering to guarantee the filtering effect; conversely, when the color aberration regions are sparsely distributed, a smaller filtering window is used to improve filtering efficiency and minimize hardware resource consumption.

[0047] Furthermore, in practical applications, the kernel size of median filtering can be set according to actual needs, and this application does not impose any restrictions on it.

[0048] In step S2, adjusting the pixel color of the color-abnormal area to gray makes the adjusted pixel color more consistent with the surrounding pixels compared to the original RGB image. However, in practical applications, it's easy for a single pixel or a small pixel block composed of several pixels in a normal image area to be incorrectly identified as a color-abnormal area. Therefore, in step S3, by performing median filtering on the UV channels, the single pixels or small pixel blocks that were mistakenly identified as color-abnormal areas and turned gray can be treated as pseudo-color, restoring the color of these mistakenly identified and grayed-out pixels to their original correct color. Simultaneously, since step S2 ensures that the Y channel (brightness) of the gray pixels remains unchanged, after median filtering, the pixels that were mistakenly identified as color-abnormal areas can maintain consistency with the color and brightness of their surrounding pixels. In this way, for the entire YUV format image, while ensuring that the brightness and texture remain unchanged, the original normal color of the pixels that were misjudged as areas of abnormal image color can be effectively adjusted and restored. This avoids the introduction of new defects due to pixels being misjudged as areas of abnormal image color, and improves the quality and appearance of the output image.

[0049] Furthermore, in this embodiment, step S4 involves converting the median-filtered YUV image back to RGB format to obtain the processed RGB image.

[0050] Specifically, in this embodiment, the same conversion formula used in step S3 to convert the RGB image to a YUV image is employed to convert the median-filtered YUV image back to RGB format. This reduces system computational complexity and hardware resource consumption while ensuring the quality and visual appeal of the output image.

[0051] Of course, in other embodiments, a different conversion formula than step S3 can be used to convert the median-filtered YUV image back to RGB format. This application does not impose any restrictions on this.

[0052] Furthermore, in this embodiment, the method for processing the image color abnormality region further includes: S5 outputs the processed RGB image.

[0053] The image color anomaly processing method provided in this embodiment, through simple calculation and processing, can adjust the color of the image color anomaly areas while maintaining image texture and brightness balance. This makes the color of the image color anomaly areas harmonize with the colors of the surrounding areas, improving the quality and visual appeal of the output image and solving the problem of how to effectively process and correct image color anomaly areas. The image color anomaly processing method provided in this embodiment can reduce color defects in images, and is particularly suitable for scenarios with high color accuracy requirements, such as automotive applications.

[0054] This embodiment also provides a processing device for image color abnormality regions, used to implement the image color abnormality region processing method described above, such as... Figure 2 As shown, the processing device for the abnormal color area of ​​the image includes: The image acquisition module is used to acquire RGB images with regions of abnormal image color. The color adjustment module is used to adjust the pixel color in areas of abnormal color in the image to gray. The filtering module is used to perform median filtering on the UV channels of the image in YUV format to obtain the filtered YUV image. The format conversion module is used to convert the median-filtered YUV image into RGB format to obtain the processed RGB image.

[0055] The image color abnormality region processing device provided in this embodiment adjusts the pixel color of the image color abnormality region to gray through the color adjustment module, and performs median filtering on the UV channel of the image color abnormality region through the filtering processing module. It can adjust the color of the image color abnormality region while keeping the image texture unchanged and not affecting the color and image quality of other areas, so that the color of the image color abnormality region is coordinated with the color of the surrounding area, improving the quality and appearance of the output image, and solving the problem of how to effectively process and correct image color abnormality regions.

[0056] Furthermore, in this embodiment, the format conversion module is also used to convert the RGB image into a YUV image, so that the filtering module can perform median filtering on the UV channel for areas with abnormal colors in the image under the YUV format.

[0057] Furthermore, in this embodiment, the processing device for abnormal color areas in the image also includes an image output module, which is used to output the processed RGB image.

[0058] Preferably, in order to accurately identify image color abnormality areas so that the color adjustment module and the filtering module can process the image color abnormality areas, in this embodiment, the image color abnormality area processing device further includes a position marking module, which is used to obtain the position marking data of the image color abnormality area in the RGB image.

[0059] Furthermore, this embodiment also provides an electronic device, including a memory, a processor, and an executable program stored in the memory and capable of being run by the processor; when the processor runs the executable program, it performs the image color abnormality region processing method described above.

[0060] Furthermore, this embodiment also provides a computer storage medium storing an executable program; when the executable program is executed, it implements the image color abnormality region processing method described above.

[0061] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to mutually. In addition, different parts between embodiments can also be combined with each other, and this invention does not limit this.

[0062] This embodiment provides a method, apparatus, electronic device, and computer storage medium for processing image color abnormalities, including: acquiring an RGB image with image color abnormalities; adjusting the pixel colors of the image color abnormalities to gray; performing median filtering on the UV channels of the image color abnormalities in YUV format to obtain a filtered YUV image; and converting the median-filtered YUV image back to RGB format to obtain a processed RGB image. By adjusting the pixel colors of the image color abnormalities to gray and performing median filtering on the UV channels of the image color abnormalities, the color of the image color abnormalities can be adjusted while maintaining the image texture and not affecting the colors and image quality of other areas. This makes the color of the image color abnormalities in the image coordinate with the colors of the surrounding areas, improving the quality and visual appeal of the output image and solving the problem of how to effectively process and correct image color abnormalities.

[0063] The above description is merely a description of preferred embodiments of the present invention and is not intended to limit the scope of the present invention in any way. Any changes or modifications made by those skilled in the art based on the above disclosure shall fall within the protection scope of the claims.

Claims

1. A method for processing color abnormality regions in an image, characterized in that, include: Obtain an RGB image with regions exhibiting color anomalies; Adjust the pixel color in the area of ​​color abnormality in the image to gray; In YUV format, median filtering is performed on the UV channels of the image to obtain the filtered YUV image; The median-filtered YUV image is converted back to RGB format to obtain the processed RGB image.

2. The method for processing image color abnormality areas according to claim 1, characterized in that, The method for adjusting the pixel color of an image color abnormality region to gray includes: Adjust the RGB values ​​of pixels in the color abnormality area of ​​the image to be equal, while keeping the brightness of the Y channel unchanged, so as to adjust the color of the pixels in the color abnormality area of ​​the image to gray.

3. The method for processing image color abnormality areas according to claim 1, characterized in that, The method for performing median filtering on the UV channels of an image with color anomalies in YUV format to obtain a filtered YUV image includes: Convert an RGB image to a YUV image; Median filtering is applied to the UV channels of the YUV image to obtain the filtered YUV image.

4. The method for processing image color abnormality areas according to claim 3, characterized in that, The size of the filtering window used in the median filtering is determined based on the distribution density of color aberration regions in the YUV image.

5. The method for processing image color abnormality areas according to claim 1, characterized in that, The method for processing abnormal color regions in the image also includes: Obtain the location marker data of color anomaly regions in the RGB image; Use location-marked data to identify regions of abnormal image color in RGB or YUV images.

6. An apparatus for processing image color abnormality regions, used to implement the image color abnormality region processing method as described in any one of claims 1 to 5, characterized in that, The processing device for the abnormal color region of the image includes: The image acquisition module is used to acquire RGB images with regions of abnormal image color. The color adjustment module is used to adjust the pixel color in areas of abnormal color in the image to gray. The filtering module is used to perform median filtering on the UV channels of the image in YUV format to obtain the filtered YUV image. The format conversion module is used to convert the median-filtered YUV image into RGB format to obtain the processed RGB image.

7. The image color abnormality region processing apparatus according to claim 6, characterized in that, The format conversion module is also used to convert RGB images to YUV images.

8. The image color abnormality region processing apparatus according to claim 6, characterized in that, The device for processing abnormal color areas in an image also includes an image output module, which is used to output the processed RGB image.

9. An electronic device, characterized in that, It includes a memory, a processor, and an executable program stored in the memory and capable of being run by the processor; when the processor runs the executable program, it performs the image color abnormality region processing method as described in any one of claims 1 to 5.

10. A computer storage medium, characterized in that, The computer storage medium stores an executable program; when the executable program is executed, it implements the image color abnormality region processing method as described in any one of claims 1 to 5.