A color noise suppression method, a color noise suppression device, an electronic device, and a storage medium

By statistically analyzing the color histogram of an image to identify the primary and secondary colors, and establishing a color mapping relationship to adjust the image, the problem of balancing noise reduction effect and complexity in existing technologies is solved, enabling the rapid acquisition of low-noise images.

CN115937014BActive Publication Date: 2026-04-14杭州普联系统技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
杭州普联系统技术有限公司
Filing Date
2022-10-14
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing color noise suppression methods struggle to balance denoising effectiveness and processing complexity, making it difficult to quickly obtain low-color-noise images.

Method used

By statistically analyzing the color histogram of the image based on a preset first and second color dimension, the dominant and minor colors are identified, a color mapping relationship is established, and the image is adjusted according to this relationship to remove noise.

Benefits of technology

It achieves image processing with good noise reduction effect and low processing complexity, and can quickly obtain low color noise images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115937014B_ABST
    Figure CN115937014B_ABST
Patent Text Reader

Abstract

The application discloses a color noise suppression method, a color noise suppression device, an electronic device and a computer readable storage medium. The method comprises the following steps: counting a color histogram of a to-be-processed image based on a preset first color dimension and a second color dimension, wherein the horizontal axis of the color histogram is the first color dimension, the vertical axis of the color histogram is the second color dimension, and the value of each coordinate point in the color histogram is used to represent the number of pixels; finding the main color and the trace color of the to-be-processed image through the color histogram; establishing a color mapping relationship of the to-be-processed image according to the main color, the trace color and the color histogram; and adjusting the to-be-processed image according to the color mapping relationship to obtain a color noise-removed image. The application can balance the denoising effect and the processing complexity, and help to quickly obtain an image with low color noise.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, and in particular relates to a color noise suppression method, a color noise suppression device, an electronic device, and a computer-readable storage medium. Background Technology

[0002] Color noise (also known as color artifacts) is a significant factor affecting image quality. Currently, common color noise reduction methods include traditional filtering-based denoising methods, machine learning-based denoising methods, and neural network-based denoising methods. However, these methods all struggle to achieve a balance between denoising effectiveness and processing complexity. Summary of the Invention

[0003] This application provides a color noise suppression method, a color noise suppression device, an electronic device, and a computer-readable storage medium, which can achieve a balance between noise reduction effect and processing complexity, and help to quickly obtain low color noise images.

[0004] In a first aspect, this application provides a color noise suppression method, comprising:

[0005] Based on the preset first color dimension and second color dimension, the color histogram of the image to be processed is calculated. The horizontal axis of the color histogram is the first color dimension, the vertical axis of the color histogram is the second color dimension, and the value of each coordinate point in the color histogram is used to represent the number of pixels.

[0006] Use the color histogram to identify the dominant and trace colors in the image to be processed.

[0007] Based on the primary color, trace colors, and color histogram, establish the color mapping relationship of the image to be processed;

[0008] The image to be processed is adjusted according to the color mapping relationship to obtain a de-noiseed image.

[0009] Secondly, this application provides a color noise suppression device, comprising:

[0010] The statistics module is used to calculate the color histogram of the image to be processed based on the preset first color dimension and second color dimension. The horizontal axis of the color histogram is the first color dimension, the vertical axis of the color histogram is the second color dimension, and the value of each coordinate point in the color histogram is used to represent the number of pixels.

[0011] The search module is used to find the main and trace colors of the image to be processed by using the color histogram;

[0012] A module is established to create a color mapping relationship for the image to be processed based on the primary color, minor colors, and color histogram.

[0013] The adjustment module is used to adjust the image to be processed according to the color mapping relationship to obtain a de-noiseed image.

[0014] Thirdly, this application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method described in the first aspect.

[0015] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect above.

[0016] Fifthly, this application provides a computer program product comprising a computer program that, when executed by one or more processors, implements the steps of the method described in the first aspect.

[0017] The beneficial effects of this application compared to existing technologies are as follows: In this application, the electronic device first calculates the color histogram of the image to be processed based on a preset first color dimension and a second color dimension. Then, through the color histogram, it identifies the dominant color and minor colors of the image to be processed. Next, based on the dominant color, the minor colors, and the color histogram, it establishes a color mapping relationship for the image to be processed. Finally, it adjusts the image to be processed according to the color mapping relationship to obtain a de-noising image. The above process, through analysis of the color histogram of the image to be processed, identifies two different types of colors involved in the image to be processed: the dominant color and the minor colors. The dominant color is the color that dominates the image to be processed, and it can play a guiding role in the process of color noise suppression. The minor colors are colors with a small number of pixels in the image to be processed, and they are more likely to be color noise points in the image to be processed. Through the dominant color, minor colors, and the color histogram, the electronic device establishes a targeted color mapping relationship for the image to be processed. On the one hand, based on this targeted color mapping relationship, a de-noising image with good denoising effect can be obtained; on the other hand, the above process involves relatively little computation and has relatively low processing complexity. In summary, the solution of this application achieves a balance between denoising effect and processing complexity, and can help electronic devices quickly obtain low-noise images.

[0018] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram illustrating the implementation process of the color noise suppression method provided in the embodiments of this application;

[0021] Figure 2 This is a schematic diagram illustrating the specific process of finding the main color in the color noise suppression method provided in this application embodiment;

[0022] Figure 3 This is an example diagram of the searchable range in the color histogram provided in the embodiments of this application;

[0023] Figure 4 This is another example diagram of the searchable range in the color histogram provided in the embodiments of this application;

[0024] Figure 5 This is yet another example of the searchable range in the color histogram provided in the embodiments of this application;

[0025] Figure 6 This is a schematic diagram illustrating the specific process of establishing a color mapping relationship in the color noise suppression method provided in this application embodiment;

[0026] Figure 7 This is a structural block diagram of the color noise suppression device provided in the embodiments of this application;

[0027] Figure 8 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0028] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0029] To illustrate the technical solution proposed in this application, specific embodiments are described below.

[0030] The color noise suppression method provided in this application is applied to an electronic device with image processing capabilities. This is merely an example; the electronic device could be a smartphone, tablet, surveillance camera, or server, etc., and is not limited thereto. Please refer to... Figure 1 The implementation process of this color noise suppression method is detailed below:

[0031] Step 101: Based on the preset first color dimension and second color dimension, calculate the color histogram of the image to be processed.

[0032] When an electronic device is equipped with a camera, it can acquire the image to be processed through its shooting function; alternatively, it can acquire the image to be processed through data interaction with other devices. The method of acquiring the image to be processed is not limited here. As an example, taking a surveillance camera as the electronic device, the image to be processed can be any frame from the video stream captured by the surveillance camera.

[0033] After acquiring an image to be processed, the electronic device can verify its color space. If the color space of the image to be processed is not the specified color space, the electronic device can first convert the color space of the image to the specified color space. The specified color space refers to a color space where the color channels and luminance channels are separate. For example, the specified color space can be either the YUV color space or the Lab color space; no limitation is made here.

[0034] It is understood that a given color space typically contains one luminance channel and two color channels; that is, different colors can be described using two color dimensions within that color space. For ease of description, the two color dimensions in the given color space can be referred to as the first color dimension and the second color dimension, respectively. As an example, when the given color space is the YUV color space, U can be used as the first color dimension and V as the second color dimension; similarly, when the given color space is the Lab color space, a can be used as the first color dimension and b as the second color dimension. It should be noted that the color in this embodiment refers specifically to the concept of chromaticity.

[0035] Using the first color dimension as the horizontal axis and the second color dimension as the vertical axis, an electronic device can statistically analyze the pixels of different colors in an image to be processed, obtaining a color histogram. For ease of description, the values ​​under the first color dimension are denoted as the first color value, and the values ​​under the second dimension are denoted as the second color value. Then, a first color value and a second color value represent a color and correspond to a coordinate point in the color histogram; the value of this coordinate point represents the number of pixels of that color in the image to be processed. That is, for any coordinate point in the color histogram, the coordinate value corresponding to that coordinate point represents the color, and the value of the coordinate point itself represents the number of pixels. As an example, assuming that after converting the image to be processed to the YUV color space, it is found that there are Q pixels of color (Ux, Vx), then the value of coordinate point (Ux, Vx) in the final color histogram is Q.

[0036] In fact, a color histogram can also be understood as a two-dimensional matrix M[U][V], where the subscripts (i.e., UV) of each element in the two-dimensional matrix are used to represent the color corresponding to the element, and the value of each element is used to represent the number of pixels of the color corresponding to the element in the image to be processed.

[0037] Step 102: Use the color histogram to find the main color and trace colors of the image to be processed.

[0038] In the image to be processed, some colors objectively or subjectively dominate, and these colors can be considered to help establish the overall tone of the image; for ease of description, these colors can be referred to as dominant colors. Correspondingly, some colors in the image to be processed are relatively scattered and appear less frequently; these colors can be considered to potentially represent noise; for ease of description, these colors can be referred to as trace colors. In addition, there are some colors in the image to be processed that are neither dominant nor trace colors; for ease of description, these colors can be referred to as general colors.

[0039] Once an electronic device has obtained a color histogram, since this histogram is a statistical result, the dominant and trace colors of the image to be processed can be identified through analysis of the color histogram. It can be understood that, for the image to be processed, once the dominant and trace colors are determined, the general colors are also determined accordingly.

[0040] Step 103: Establish the color mapping relationship of the image to be processed based on the primary color, trace colors, and color histogram.

[0041] As described above, trace colors may contain noise, allowing the electronic device to identify the source object of interest in the color mapping relationship. Furthermore, as also described above, the dominant color occupies a dominant position in the image to be processed; therefore, the electronic device can determine the target object of interest in the color mapping relationship based on the dominant color. To ensure that the color mapping relationship does not deviate from the color representation of the image to be processed, the electronic device can determine the mapping basis between colors based on a color histogram. Specifically, the establishment of this color mapping relationship draws on the idea of ​​clustering to some extent; that is, the color mapping relationship, to a certain extent, reflects the color-based clustering results in the image to be processed.

[0042] Step 104: Adjust the image to be processed according to the color mapping relationship to obtain the de-noiseed image.

[0043] Electronic devices can process each pixel in the image to be processed based on the obtained color mapping relationship. After traversing and processing all pixels in the image to be processed, a de-noising image is obtained.

[0044] Taking any pixel as an example, the specific processing procedure for that pixel is as follows: First, the electronic device determines the original color of the pixel; then, the electronic device finds the color mapped to the original color in the color mapping relationship, and records it as the mapped color; finally, the electronic device changes the color of the pixel from the original color to the mapped color.

[0045] In some embodiments, to obtain better noise reduction effect, a block-segmentation scheme is proposed based on steps 101 to 104: after obtaining the image to be processed, the image to be processed can be divided into blocks to obtain at least two image blocks to be processed; correspondingly, the processing objects of steps 101 to 104 are no longer the image to be processed itself, but each image block to be processed; in addition, the electronic device can also add a merging operation of the image blocks at the end. Combining steps 101 to 104, the above process can be summarized as follows: The image to be processed is divided into blocks to obtain at least two image blocks to be processed; based on a preset first color dimension and a second color dimension, the color histogram of each image block to be processed is calculated; through each color histogram, the dominant color and minor color of each image block to be processed are found; based on the dominant color, minor color, and color histogram of each image block to be processed, a color mapping relationship is established for each image block to be processed; the corresponding image blocks to be processed are adjusted according to each color mapping relationship to obtain denoised image blocks, and the number of denoised image blocks is equal to the number of image blocks to be processed; the denoised image blocks are merged to obtain a complete denoised image.

[0046] It is understandable that the denoised image obtained through the above process has a better denoising effect, but the processing complexity also increases accordingly. Therefore, in application scenarios with strict requirements for processing complexity, electronic devices can choose to process the entire image, that is, not use the block-based scheme; in scenarios with low requirements for processing complexity but high requirements for denoising effect, electronic devices can use the block-based scheme.

[0047] Furthermore, the segmentation scheme can be subdivided into overlapping and non-overlapping segmentation schemes; that is, at least two image blocks to be processed obtained from segmentation may or may not overlap. In the overlapping segmentation scheme, for any two overlapping image blocks to be processed, the corresponding two de-denoised image blocks will also overlap; the electronic device can thus fuse the overlapping areas when merging the de-denoised image blocks, helping to reduce the boundary effect between different de-denoised image blocks in the de-denoised image. Based on this, in scenarios where the processing complexity requirements are relatively relaxed but the denoising effect requirements are high, the electronic device can adopt the overlapping segmentation scheme.

[0048] In some embodiments, considering that adjacent images in a video stream typically have high similarity when the scene presented in the video stream does not change significantly, to reduce the processing load of the electronic device, when the image to be processed is not the first frame image in the video stream, the electronic device can, after acquiring the image to be processed, first determine whether there is a scene change compared to the reference frame image of the video stream; if there is a scene change, the various steps proposed in the embodiments of this application can be executed normally; if there is no scene change, the color mapping relationship of the reference frame image can be directly used as the color mapping relationship of the image to be processed (i.e., the existing color mapping relationship is used), and the image to be processed is adjusted based on the existing color mapping relationship to obtain a de-noising image. Of course, when the image to be processed is the first frame image in the video stream, there is necessarily no existing color mapping relationship, so the various steps proposed in the embodiments of this application can be directly executed for the image to be processed, which will not be elaborated here.

[0049] Specifically, electronic devices can use the frame difference method to determine whether there is a scene change in the image to be processed. The process is briefly described as follows: calculate the pixel value difference between each pixel in the image to be processed and the corresponding pixel in the reference frame image; determine the moving pixels in the image to be processed, which are pixels in the image to be processed whose calculated pixel value difference is greater than a preset difference threshold; if the number of moving pixels in the image to be processed reaches a preset pixel number threshold, it is considered that there is a scene change in the image to be processed compared with the reference frame.

[0050] Of course, electronic devices can also use other methods to determine whether there is a scene change in the image to be processed, such as background modeling, Gaussian mixture model, optical flow, or motion energy method, etc., which are not limited here.

[0051] In some embodiments, when the noise in the image to be processed is strong (i.e., the noise intensity is greater than a preset noise intensity threshold), in order to improve the processing efficiency of steps 101 to 104, the electronic device may perform preprocessing operations on the image to be processed after obtaining it. These preprocessing operations may include, but are not limited to, the following: pre-filtering, color grayscale compression, and downsampling. These preprocessing operations are briefly described below:

[0052] Through pre-filtering, electronic devices can perform preliminary noise reduction on images to be processed. Pre-filtering includes, but is not limited to, the following filtering methods: mean filtering, Gaussian filtering, bilateral filtering, non-local mean (NLM) filtering, guided filtering, and homomorphic filtering.

[0053] Color grayscale compression enhances noise reduction in electronic devices. Grayscale compression refers to compressing the color values ​​of an image from their current precision to a specified precision. For example, if the image to be processed is 8-bit precision and the specified precision is 6-bit precision, then the grayscale compression operation means compressing the colors (i.e., chromaticity values) of the image at 8-bit precision to colors (i.e., chromaticity values) at 6-bit precision. For example, when the image is in the YUV color space, the chromaticity value specifically refers to the UV values; when the image is in the Lab color space, the chromaticity value specifically refers to the ab values.

[0054] By performing downsampling, electronic devices can enhance noise reduction. Downsampling reduces the number of pixels in the image to be processed (i.e., reduces the size of the image), thereby reducing the amount of data in subsequent processing. In this embodiment, the downsampling factor used in the downsampling operation is not limited.

[0055] When processing offline video streams or images, electronic devices can evaluate the noise intensity of the image to be processed by calculating indicators such as signal-to-noise ratio (SNR), peak signal-to-noise ratio (PSNR), and / or local variance. When processing online video streams, electronic devices can not only evaluate the noise intensity of the image to be processed by indicators such as SNR, PSNR, and / or local variance, but also dynamically observe the changes in the video stream after enabling / disabling preprocessing operations or adjusting preprocessing parameters, thereby adjusting the preprocessing intensity in real time.

[0056] In some embodiments, to enable rapid searching of appropriate amounts of primary and secondary colors, step 102 may include:

[0057] Step 1021: Based on the preset upper limit value of the number of primary colors, the preset lower limit value of the number of primary colors, and the preset threshold value of the number of first pixels, find the primary colors of the image to be processed in the color histogram.

[0058] As described above, primary colors include colors that objectively or subjectively dominate the image to be processed. For objectively dominant primary colors in the image, users can pre-set upper and lower limits for the number of primary colors and a first pixel count threshold in the electronic device to help the device locate such primary colors.

[0059] The upper limit for the number of primary colors indicates the maximum number of primary colors that can be selected; the lower limit indicates the minimum number of primary colors that must be selected. These upper and lower limits define the range of primary colors that must be met in the determination of a primary color. As for the first pixel count threshold, if the number of pixels of a certain color in the image being processed exceeds this threshold, that color may be determined as a primary color. Therefore, having a pixel count greater than this first pixel count threshold is a preferred condition in the determination of a primary color.

[0060] For ease of explanation later, the upper limit of the number of primary colors can be denoted as N_TH_MAX, the lower limit of the number of primary colors as N_TH_MIN, and the threshold of the number of first pixels as NUM_TH_1.

[0061] Step 1022: Based on the preset second pixel quantity threshold, find the trace colors of the image to be processed in the color histogram.

[0062] Users can pre-set a second pixel count threshold in their electronic devices. For this second pixel count threshold, if the number of pixels of a certain color in the image to be processed is less than the threshold, that color is determined to be a trace color. It can be understood that having a pixel count less than the second pixel count threshold is a necessary condition to be met in the trace color determination process.

[0063] It should be noted that the second pixel count threshold should be less than the first pixel count threshold used to find the primary color. Furthermore, this embodiment does not limit the number of trace colors found.

[0064] In some embodiments, the process of finding the primary color (specifically, the dominant color that objectively occupies the dominant position in the image to be processed) may be as follows:

[0065] A1. Within the specified search range, find the coordinates of the first target point.

[0066] The initial search scope includes all coordinate points in the color histogram. That is, when initially searching for the first target coordinate point, all coordinate points in the color histogram can be traversed. The first target coordinate point is the coordinate point with the largest value.

[0067] A2. If the number of primary colors does not reach the lower limit of the number of primary colors, or if the number of primary colors reaches the lower limit of the number of primary colors but does not reach the upper limit of the number of primary colors and the value of the first target coordinate point is greater than or equal to the first pixel number threshold, the color corresponding to the first target coordinate point shall be determined as the primary color.

[0068] As described earlier, the minimum number of primary colors indicates the minimum number of primary colors to be selected. Since the number of primary colors must gradually increase from 0, if the number of primary colors has not reached this minimum number, regardless of the specific value of the first target coordinate point, the color corresponding to the first target coordinate point can be immediately determined as the primary color, that is, the color represented by the coordinate value of the first target coordinate point is determined as the primary color.

[0069] As described earlier, the upper limit of the number of primary colors represents the maximum number of primary colors that can be selected, while the first pixel number threshold limits the minimum number of pixels that a primary color should have in the image to be processed. Therefore, when the number of primary colors has reached the lower limit, the electronic device can take into account both the upper limit of the number of primary colors and the first pixel number threshold when determining whether the color corresponding to the first target coordinate point is a primary color. Specifically, if the value of the first target coordinate point is greater than the first pixel number threshold, and the number of primary colors has not yet reached the upper limit of the number of primary colors, then the color corresponding to the first target coordinate point can be determined as the primary color, that is, the color represented by the coordinate value of the first target coordinate point can be determined as the primary color.

[0070] A3. After determining the color corresponding to the first target coordinate point as the primary color, update the search range based on the first target coordinate point, and return to execute step A1 and subsequent steps.

[0071] After determining the color corresponding to the first target coordinate point as the primary color, the electronic device can set the first target coordinate point and all coordinate points in its neighborhood as unsearchable areas. In this embodiment, the size of the neighborhood is not limited; that is, the updated search range is: all coordinate points outside the neighborhood of the first target coordinate point, based on the original search range.

[0072] The electronic device can re-execute steps A1-A3 according to the updated search range to find a new first target coordinate point and determine whether the color corresponding to the new first target coordinate point is the primary color, until the color corresponding to the new first target coordinate point is not determined to be the primary color, and then the search for the primary color is completed.

[0073] Please see Figure 2 , Figure 2 The detailed process for finding the primary color is illustrated below:

[0074] B1. Parameter initialization, including: initializing the searchable range to all coordinate points of the color histogram; and initializing the number of primary colors N to 0.

[0075] B2. Traverse within the searchable range to find the first target coordinate point (Un, Vn), whose value is pix_num.

[0076] B3. Determine if N < N_TH_MIN is true. If true, proceed to step B6. If false, proceed to step B4.

[0077] B4. Determine if N ≥ N_TH_MAX or pix_num < NUM_TH_1 is true. If true, proceed to step B5. If false, proceed to step B6.

[0078] B5. End.

[0079] B6. Set the color corresponding to the first target coordinate point as the primary color. That is, set the color (Un, Vn) as the primary color.

[0080] B7. Remove the first target coordinate point and its neighborhood from the searchable range to update the searchable range.

[0081] B8. Update the quantity of the primary color and return to step B2.

[0082] To better understand the process of finding the primary color, a specific example is provided below:

[0083] Assume N_TH_MIN=3, N_TH_MAX=5, and NUM_TH_1=30.

[0084] First, the electronic device locates the first target pixel (U_1, V_1) in the color histogram. Since the primary color count is 0, color (U_1, V_1) can be identified as the primary color. Afterward, the searchable range and the number of primary colors are updated. The updated searchable range is as follows: Figure 3 As shown, the number of primary colors has been updated from 0 to 1.

[0085] Subsequently, electronic devices Figure 3 Within the searchable range shown, the first target pixel (U_2, V_2) is found. Since the primary color has a quantity of 1, color (U_2, V_2) can be determined as the primary color. Afterwards, the searchable range and the quantity of primary colors are updated. The updated searchable range is as follows: Figure 4 As shown, the number of primary colors has been updated from 1 to 2.

[0086] Next, the electronic device in Figure 4 Within the searchable range shown, the first target pixel (U_3, V_3) is found. Since the number of primary colors is 2, color (U_3, V_3) can be determined as the primary color. Afterwards, the searchable range and the number of primary colors are updated. The updated searchable range is as follows: Figure 5 As shown, the number of primary colors has been updated from 2 to 3.

[0087] Then, electronic devices in Figure 5 Within the searchable range shown, the first target pixel (U_4, V_4) is found. Since the number of primary colors is 3, which has reached the lower limit for the number of primary colors, it is necessary to compare whether the value of the first target pixel (U_4, V_4) is less than the first pixel number threshold. Assuming the value of the first target pixel (U_4, V_4) is 28, since 28 < 30, the color corresponding to this first target pixel cannot be determined as the primary color.

[0088] At this point, the electronic device ended its search for the primary colors and finally found the three primary colors: (U_1,V_1), (U_2,V_2), and (U_3,V_3).

[0089] in, Figure 3 , Figure 4 and Figure 5 In the diagram, the gray area represents the unsearchable area, and the white area represents the searchable area.

[0090] In some embodiments, as described above, the primary color includes a color that objectively or subjectively dominates the image to be processed. Based on this, after identifying the objectively dominant primary color in the image to be processed in step 1021, the electronic device can supplement the primary color in the following manner:

[0091] C1. Match each of the found primary colors with the preset protection colors.

[0092] When setting a protective color, the user can also define its radiation range (i.e., the neighborhood centered on the protective color, the size of which can be set by the user). Using the protective color and its radiation range, the electronic device can determine the coordinate region corresponding to the protective color in a color histogram. For any found primary color, the electronic device can determine whether the coordinate point corresponding to the primary color falls within the coordinate region. If the primary color falls within the coordinate region, it matches the protective color; otherwise, if the primary color does not fall within the coordinate region, it does not match the protective color.

[0093] C2. If a target protection color exists, add the target protection color as the main color of the image to be processed.

[0094] The target protective color is defined as a protective color that does not match any of the identified primary colors. In other words, if a protective color does not have a corresponding coordinate point for any primary color in the corresponding coordinate region of the color histogram, then that protective color is the target protective color.

[0095] It should be noted that users can choose not to set a protection color, or to set one, two, or more protection colors, depending on their actual application needs. That is, in this embodiment of the application, the number of protection colors is not limited.

[0096] It is understandable that, given that N primary colors have been identified through step 1021, and assuming the number of protected colors is M, the electronic device can ultimately determine a minimum of N and a maximum of N+M primary colors.

[0097] In some embodiments, the process of finding trace colors can be specifically as follows:

[0098] D1. Locate the coordinates of the second target point in the color histogram.

[0099] The electronic device can traverse all coordinate points of the color histogram. If the value of the coordinate point currently traversed by the electronic device is less than the second pixel count threshold, then the coordinate point can be determined as the second target coordinate point. It is understood that after the electronic device completes the traversal of the color histogram, it may obtain multiple second target points. This application embodiment does not limit the number of second target coordinate points found.

[0100] D2. Determine the color corresponding to each second target coordinate point as a micro-color.

[0101] The electronic device can determine the color corresponding to each second target coordinate point as a minute color. It can be understood that if the electronic device finds N second target coordinate points, it can determine N minute colors accordingly.

[0102] In some embodiments, to make the established color mapping relationship more targeted, step 103 may include:

[0103] Step 1031: For each coordinate point in the color histogram, if the color corresponding to the coordinate point is not a trace color, determine the mapping result associated with the coordinate point as follows: the color corresponding to the coordinate point is mapped to itself.

[0104] Step 1032: When the color corresponding to the coordinate point is a minor color, detect whether there is a third target coordinate point in the neighborhood of the coordinate point. The third target coordinate point is the coordinate point whose corresponding color is the primary color.

[0105] Step 1033: If there is no third target coordinate point in the neighborhood of the coordinate point, determine the mapping result associated with the coordinate point as follows: the color corresponding to the coordinate point is mapped to itself.

[0106] Step 1034: If a third target coordinate point exists in the neighborhood of the coordinate point, determine the mapping result associated with the coordinate point as follows: the color corresponding to the coordinate point is mapped to the target color, wherein the target color is calculated based on the color corresponding to the third target coordinate point.

[0107] Step 1035: Establish the color mapping relationship of the image to be processed based on the mapping results associated with each coordinate point in the color histogram.

[0108] As can be seen from steps 1031-1034, for the main and general colors in the image to be processed, the electronic device can be set to still map these colors to itself; for the trace colors in the image to be processed, when the electronic device traverses the coordinate points corresponding to these trace colors, it can classify the trace colors according to whether there is a third target coordinate point (i.e., the coordinate point corresponding to the main color) in the neighborhood of the coordinate point, specifically as follows:

[0109] First trace color: Within the neighborhood of the corresponding coordinate point, there exists a third target coordinate point.

[0110] Second micro-color: There is no third target coordinate point in the neighborhood of the corresponding coordinate point.

[0111] The size of the neighborhood involved here may be changed according to the actual application requirements of the electronic device, and this application embodiment does not limit it.

[0112] It is understandable that, according to the definition of a first trace color, for any given first trace color, there exists a primary color in the image to be processed that is close to the first trace color. When performing color noise suppression, the electronic device can consider making the first trace color move closer to the primary color that is close to it. Based on this, the electronic device can calculate the target color that maps to the first trace color according to these primary colors.

[0113] It is understandable that, according to the definition of the second trace color, for any second trace color, there is no primary color in the image to be processed that is close to the first trace color; based on this, the electronic device can set these colors (i.e., the second trace colors) to still map to itself.

[0114] As an example only, using the YUV color space, when a third target coordinate point exists in the neighborhood of a given coordinate point, the calculation process for the target color can be represented by the following formula:

[0115]

[0116] Where (U',V') represents the target color; (U,V) are the coordinates of the point, representing the first minor color corresponding to that point; S represents the set of primary colors close to the first minor color, which includes the colors corresponding to all three target coordinates within the neighborhood of the point (all are primary colors); n represents the number of primary colors in the set S; (U',V') represents the number of primary colors in the set S. i V i ) is used to represent the i-th primary color in the set S of primary colors.

[0117] As an example only, suppose that the color represented by a certain coordinate point (U1, V1) is the first minor color, and there is only one third target coordinate point (U1', V1') in the neighborhood of the coordinate point (U1, V1). Then, in the set S of the corresponding major colors, there is only one major color (U1', V1'). Based on this, (U1, V1) can be mapped to (U1', V1'). Assuming that the color represented by a certain coordinate point (U2,V2) is the first minor color, and that there are two third target coordinate points (U2',V2') and (U3',V3') in the neighborhood of this coordinate point (U2,V2), then there are two major colors (U2',V2') and (U3',V3') in the set S of major colors. Based on this, by substituting (U2',V2'), (U3',V3'), and (U2,V2) into the above formula, the corresponding target color (U',V') can be calculated, and (U2,V2) can be mapped to (U',V').

[0118] Please see Figure 6 , Figure 6 The specific process for establishing color mapping relationships is illustrated below:

[0119] E1. Determine if the coordinates in the color histogram have been traversed. If yes, proceed to step E8. If no, proceed to step E2.

[0120] E2. Determine any coordinate point that has not yet been traversed as the current coordinate point for traversal.

[0121] E3. Determine if the color corresponding to the currently traversed coordinate point is a minor color. If yes, proceed to step E4. If no, proceed to step E5.

[0122] E4. Determine if a third target point exists within the neighborhood of the currently traversed coordinate point. If yes, proceed to step E6. If no, proceed to step E5.

[0123] E5. Determine the mapping result as follows: the color corresponding to the currently traversed coordinate point is mapped to itself, and execute step E7.

[0124] E6. Determine the mapping result as follows: map the color corresponding to the currently traversed coordinate point to the target color, and execute step E7. The target color is calculated based on the third target point.

[0125] E7. Record the mapping results in the color mapping table and return to step E1.

[0126] E8, End.

[0127] In some embodiments, to facilitate adjustment of the intensity of color denoising, the user can pre-set an intensity mapping relationship in the electronic device. Accordingly, step 104 can specifically be manifested as: adjusting the image to be processed according to the color mapping relationship and the preset intensity mapping relationship to obtain a denoised image.

[0128] The electronic device can process each pixel in the image to be processed according to the obtained color mapping relationship and the preset intensity mapping relationship. After traversing and processing all pixels in the image to be processed, the de-noising image is obtained.

[0129] Taking any pixel as an example, the processing procedure for that pixel is as follows: First, the electronic device determines the original color of the pixel; then, the electronic device finds the color mapped to the original color in the color mapping relationship, and records it as the mapped color; next, the electronic device obtains an intensity adjustment value based on the original color and the mapped color through the intensity mapping relationship; finally, the electronic device adjusts the color of the pixel according to the intensity adjustment value, so that the color of the pixel changes from the original color to the intensity-adjusted mapped color. Taking the YUV color space as an example, the above process can be represented by the following formula:

[0130]

[0131] Where (U',V') represents the mapped color; (U,V) represents the original color; mapping represents the preset intensity mapping relationship, which can be expressed in tabular or vector form; diff_U' represents the intensity adjustment value for the first color dimension U; diff_V' represents the intensity adjustment value for the second color dimension V; (U dst V dst The values ​​() are used to represent the mapped color after intensity adjustment. Different color dimensions can use the same intensity mapping relationship; that is, the electronic device can use the same intensity mapping relationship for the first color dimension U and the second color dimension V. It should be noted that this application does not limit the positive or negative sign of diff_U and diff_V.

[0132] As an example only, the intensity mapping relationship can be expressed as a vector [0, 1, 2, 2, 3, 3, 3], representing:

[0133] When diff_U is 0, diff_U' = 0; when diff_V is 0, diff_V' = 0.

[0134] When diff_U is 1, diff_U' = 1; when diff_V is 1, diff_V' = 1.

[0135] When diff_U is 2, diff_U'=2; when diff_V is 2, diff_V'=2;

[0136] When diff_U is 3, diff_U'=2; when diff_V is 3, diff_V'=2;

[0137] When diff_U is 4, diff_U'=3; when diff_V is 4, diff_V'=3;

[0138] When diff_U is 5, diff_U'=3; when diff_V is 5, diff_V'=3;

[0139] When diff_U is 6, diff_U'=3; when diff_V is 6, diff_V'=3.

[0140] Based on this intensity mapping relationship, we know that: assuming the original color of a pixel is (U1, V1), the mapped color is (U1', V1'), and U1' - U1 = 4, V1' - If V1=1, then: U dst =U1+3,V dst =V1+1.

[0141] Using this intensity mapping table, when U' and U are very close, the denoising result U' can be fully trusted; when U' and U differ greatly, the denoising intensity of U is reduced to prevent denoising errors. Similarly, when V' and V are very close, the denoising result V' can be fully trusted; when V' and V differ greatly, the denoising intensity of V is reduced to prevent denoising errors.

[0142] In some embodiments, when the image to be processed is a non-first frame image in a video stream, the electronic device can divide the image to be processed into a moving region and a stationary region by the frame difference method or other methods mentioned above. For the moving region and the stationary region, the electronic device can set different intensity mapping relationships, different first pixel number thresholds, different second pixel number thresholds, different upper limits of the number of primary colors and / or different lower limits of the number of primary colors, so as to achieve more targeted color noise suppression and obtain better noise reduction effect.

[0143] As can be seen from the above, this embodiment of the application identifies two different types of colors involved in the image to be processed by analyzing the color histogram: the dominant color and the trace color. The dominant color is the color that dominates the image to be processed, and it plays a guiding role in the color noise suppression process. The trace color is the color with a small number of pixels in the image to be processed, and it is more likely to be color noise in the image. Through the dominant color, trace color, and color histogram, the electronic device establishes a targeted color mapping relationship for the image to be processed. On the one hand, based on this targeted color mapping relationship, a de-noising image with better denoising effect can be obtained; on the other hand, the above process involves a small amount of computation and has relatively low processing complexity. In summary, the solution of this application achieves a balance between denoising effect and processing complexity, enabling electronic devices to quickly obtain low-noise images.

[0144] Corresponding to the color noise suppression method provided above, this application also provides a color noise suppression device. For example... Figure 7 As shown, the color noise suppression device 7 includes:

[0145] The statistics module 701 is used to calculate the color histogram of the image to be processed based on the preset first color dimension and second color dimension. The horizontal axis of the color histogram is the first color dimension, the vertical axis of the color histogram is the second color dimension, and the value of each coordinate point in the color histogram is used to represent the number of pixels.

[0146] The lookup module 702 is used to find the main color and trace colors of the image to be processed by using the color histogram;

[0147] Module 703 is established to establish the color mapping relationship of the image to be processed based on the primary color, minor colors and color histogram;

[0148] The adjustment module 704 is used to adjust the image to be processed according to the color mapping relationship to obtain a de-noiseed image.

[0149] In some embodiments, the lookup module 702 includes:

[0150] The first search unit is used to find the main color of the image to be processed in the color histogram based on the preset upper limit value of the number of main colors, the preset lower limit value of the number of main colors and the preset threshold value of the number of first pixels.

[0151] The second search unit is used to find trace colors of the image to be processed in the color histogram according to a preset second pixel number threshold, wherein the second pixel number threshold is less than the first pixel number threshold.

[0152] In some embodiments, the first lookup unit includes:

[0153] The first target coordinate point search sub-unit is used to find the first target coordinate point within a specified search range. The search range is initially all coordinate points in the color histogram, and the first target coordinate point is the coordinate point with the largest value.

[0154] The primary color determination subunit is used to determine the color corresponding to the first target coordinate point as the primary color when the number of primary colors does not reach the preset lower limit of the number of primary colors, or when the number of primary colors reaches the lower limit of the number of primary colors but does not reach the preset upper limit of the number of primary colors and the value of the first target coordinate point is greater than or equal to the preset first pixel number threshold.

[0155] The search range update subunit is used to update the search range based on the first target coordinate point after the primary color determination subunit determines the color corresponding to the first target coordinate point as the primary color, and to trigger the execution of the first target coordinate point search subunit after the search range is updated.

[0156] In some embodiments, the second lookup unit includes:

[0157] The second target coordinate point search sub-unit searches for the second target coordinate point in the color histogram. The second target coordinate point is the coordinate point whose value is less than the preset second pixel number threshold.

[0158] The micro-color determination sub-unit determines the color corresponding to each second target coordinate point as a micro-color.

[0159] In some embodiments, the first lookup unit further includes:

[0160] The matching subunit is used to match each of the found primary colors with the preset protection colors.

[0161] A new sub-unit for primary color is added to add the target protection color as the primary color of the image to be processed, when a target protection color exists. The target protection color is a protection color that does not match any of the found primary colors.

[0162] In some embodiments, the establishment module 703 includes:

[0163] The first result determination unit is used to determine the mapping result associated with each coordinate point in the color histogram, in the case that the color corresponding to the coordinate point is not a trace color: the color corresponding to the coordinate point is mapped to itself.

[0164] The detection unit is used to detect whether there is a third target coordinate point in the neighborhood of the coordinate point when the color corresponding to the coordinate point is a trace color. The third target coordinate point is the coordinate point whose corresponding color is the main color.

[0165] The second result determination unit is used to determine the mapping result associated with the coordinate point when there is no third target coordinate point in the neighborhood of the coordinate point: the color corresponding to the coordinate point is mapped to itself.

[0166] The third result determination unit is used to determine the mapping result associated with the coordinate point when there is a third target coordinate point in the neighborhood of the coordinate point: the color corresponding to the coordinate point is mapped to the target color, wherein the target color is calculated based on the color corresponding to the third target coordinate point.

[0167] The mapping relationship establishment unit is used to establish the color mapping relationship of the image to be processed based on the mapping results associated with each coordinate point in the color histogram.

[0168] In some embodiments, the adjustment module 704 is specifically used to adjust the image to be processed according to the color mapping relationship and the preset intensity mapping relationship to obtain a de-noiseed image.

[0169] As can be seen from the above, this embodiment of the application identifies two different types of colors involved in the image to be processed by analyzing the color histogram: the dominant color and the trace color. The dominant color is the color that dominates the image to be processed, and it plays a guiding role in the color noise suppression process. The trace color is the color with a small number of pixels in the image to be processed, and it is more likely to be color noise in the image. Through the dominant color, trace color, and color histogram, the electronic device establishes a targeted color mapping relationship for the image to be processed. On the one hand, based on this targeted color mapping relationship, a de-noising image with better denoising effect can be obtained; on the other hand, the above process involves a small amount of computation and has relatively low processing complexity. In summary, the solution of this application achieves a balance between denoising effect and processing complexity, enabling electronic devices to quickly obtain low-noise images.

[0170] Corresponding to the color noise suppression method provided above, this application also provides an electronic device. This is merely an example; the electronic device may be a smartphone, tablet, surveillance camera, or server, etc., and is not limited thereto. Please refer to... Figure 8 The electronic device 8 in this embodiment includes: a memory 801, and one or more processors 802. Figure 8(Only one is shown) and a computer program stored in memory 801 and executable on the processor. Memory 801 stores software programs and units. Processor 802 executes various functional applications and data processing by running the software programs and units stored in memory 801 to obtain resources corresponding to the aforementioned preset events. Specifically, processor 802 performs the following steps when running the aforementioned computer program stored in memory 801:

[0171] Based on the preset first color dimension and second color dimension, the color histogram of the image to be processed is calculated. The horizontal axis of the color histogram is the first color dimension, the vertical axis of the color histogram is the second color dimension, and the value of each coordinate point in the color histogram is used to represent the number of pixels.

[0172] Use the color histogram to identify the dominant and trace colors in the image to be processed.

[0173] Based on the primary color, trace colors, and color histogram, establish the color mapping relationship of the image to be processed;

[0174] The image to be processed is adjusted according to the color mapping relationship to obtain a de-noiseed image.

[0175] Assuming the above is the first possible implementation, then in the second possible implementation based on the first possible implementation, the primary and secondary colors of the image to be processed are found using a color histogram, including:

[0176] Based on the preset upper limit of the number of primary colors, the preset lower limit of the number of primary colors, and the preset threshold of the number of first pixels, the primary colors of the image to be processed are found in the color histogram.

[0177] Based on a preset second pixel count threshold, trace colors of the image to be processed are found in the color histogram, where the second pixel count threshold is less than the first pixel count threshold.

[0178] In a third possible implementation based on the second possible implementation described above, the main colors of the image to be processed are found in the color histogram according to a preset upper limit value for the number of main colors, a preset lower limit value for the number of main colors, and a preset first pixel number threshold, including:

[0179] Within the specified search range, find the first target coordinate point, where the initial search range is all coordinate points in the color histogram, and the first target coordinate point is the coordinate point with the largest value.

[0180] If the number of primary colors does not reach the preset lower limit of the number of primary colors, or if the number of primary colors reaches the lower limit of the number of primary colors but does not reach the preset upper limit of the number of primary colors and the value of the first target coordinate point is greater than or equal to the preset first pixel number threshold, the color corresponding to the first target coordinate point shall be determined as the primary color.

[0181] After determining the color corresponding to the first target coordinate point as the primary color, the search range is updated based on the first target coordinate point, and the process of finding the first target coordinate point within the specified search range and subsequent steps is returned.

[0182] In the fourth possible implementation provided based on the second possible implementation described above, the trace colors of the image to be processed are found in the color histogram according to a preset second pixel number threshold, including:

[0183] In the color histogram, find the second target coordinate point. The second target coordinate point is the coordinate point whose value is less than the preset second pixel number threshold.

[0184] The color corresponding to each second target coordinate point is determined as a micro-color.

[0185] In the fifth possible implementation provided based on the second possible implementation described above, after finding the main color of the image to be processed in the color histogram according to the preset upper limit value of the main color quantity, the preset lower limit value of the main color quantity, and the preset first pixel quantity threshold, the processor 802 further performs the following steps when running the computer program stored in the memory 801:

[0186] Each of the identified primary colors is matched with a preset protective color.

[0187] If a target protection color exists, add the target protection color as the primary color of the image to be processed. The target protection color is a protection color that does not match any of the found primary colors.

[0188] In a sixth possible implementation based on the first possible implementation described above, a color mapping relationship for the image to be processed is established according to the primary color, minor colors, and a color histogram, including:

[0189] For each coordinate point in the color histogram, if the color corresponding to the coordinate point is not a trace color, the mapping result associated with the coordinate point is determined as follows: the color corresponding to the coordinate point is mapped to itself.

[0190] When the color corresponding to a coordinate point is a minor color, detect whether there is a third target coordinate point in the neighborhood of the coordinate point. The third target coordinate point is the coordinate point whose corresponding color is the primary color.

[0191] If there is no third target coordinate point in the neighborhood of the coordinate point, the mapping result associated with the coordinate point is determined as follows: the color corresponding to the coordinate point is mapped to itself;

[0192] If a third target coordinate point exists in the neighborhood of a coordinate point, the mapping result associated with the coordinate point is determined as follows: the color corresponding to the coordinate point is mapped to the target color, wherein the target color is calculated based on the color corresponding to the third target coordinate point.

[0193] Based on the mapping results associated with each coordinate point in the color histogram, a color mapping relationship is established for the image to be processed.

[0194] In a seventh possible implementation based on the above-described possible implementation, adjusting the image to be processed according to the color mapping relationship to obtain a de-noising image includes:

[0195] The image to be processed is adjusted according to the color mapping relationship and the preset intensity mapping relationship to obtain a de-noiseed image.

[0196] It should be understood that, in the embodiments of this application, the processor 802 may be a central processing unit (CPU), but it may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0197] Memory 801 may include read-only memory and random access memory, and provides instructions and data to processor 802. Some or all of memory 801 may also include non-volatile random access memory. For example, memory 801 may also store device class information.

[0198] As can be seen from the above, this embodiment of the application identifies two different types of colors involved in the image to be processed by analyzing the color histogram: the dominant color and the trace color. The dominant color is the color that dominates the image to be processed, and it plays a guiding role in the color noise suppression process. The trace color is the color with a small number of pixels in the image to be processed, and it is more likely to be color noise in the image. Through the dominant color, trace color, and color histogram, the electronic device establishes a targeted color mapping relationship for the image to be processed. On the one hand, based on this targeted color mapping relationship, a de-noising image with better denoising effect can be obtained; on the other hand, the above process involves a small amount of computation and has relatively low processing complexity. In summary, the solution of this application achieves a balance between denoising effect and processing complexity, enabling electronic devices to quickly obtain low-noise images.

[0199] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0200] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0201] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of external device software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0202] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules or units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.

[0203] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0204] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing associated hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer-readable storage device, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0205] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for suppressing color noise, characterized in that, include: Based on the preset first color dimension and second color dimension, a color histogram of the image to be processed is calculated. The horizontal axis of the color histogram is the first color dimension, the vertical axis of the color histogram is the second color dimension, and the value of each coordinate point in the color histogram is used to represent the number of pixels. The primary and trace colors of the image to be processed are identified using the color histogram. Based on the primary color, the trace colors, and the color histogram, establish the color mapping relationship of the image to be processed; The image to be processed is adjusted according to the color mapping relationship to obtain a de-noiseed image; The step of establishing the color mapping relationship of the image to be processed based on the primary color, the trace colors, and the color histogram includes: For each coordinate point in the color histogram, when the color corresponding to the coordinate point is not the trace color, the mapping result associated with the coordinate point is determined as follows: the color corresponding to the coordinate point is mapped to itself; When the color corresponding to the coordinate point is the trace color, detect whether there is a third target coordinate point in the neighborhood of the coordinate point. The third target coordinate point is: the coordinate point whose corresponding color is the main color. When there is no third target coordinate point in the neighborhood of the coordinate point, the mapping result associated with the coordinate point is determined as follows: the color corresponding to the coordinate point is mapped to itself; When the third target coordinate point exists in the neighborhood of the coordinate point, the mapping result associated with the coordinate point is determined as follows: the color corresponding to the coordinate point is mapped to the target color, wherein the target color is calculated based on the color corresponding to the third target coordinate point; The color mapping relationship of the image to be processed is established based on the mapping results associated with each coordinate point in the color histogram.

2. The color noise suppression method as described in claim 1, characterized in that, The step of finding the dominant and trace colors of the image to be processed using the color histogram includes: Based on the preset upper limit value of the number of main colors, the preset lower limit value of the number of main colors, and the preset threshold value of the number of first pixels, the main colors of the image to be processed are found in the color histogram. Based on a preset second pixel count threshold, a trace color of the image to be processed is found in the color histogram, wherein the second pixel count threshold is less than the first pixel count threshold.

3. The color noise suppression method as described in claim 2, characterized in that, The step of finding the main colors of the image to be processed in the color histogram based on a preset upper limit value for the number of main colors, a preset lower limit value for the number of main colors, and a preset first pixel number threshold includes: Within a specified search range, find the first target coordinate point, wherein the specified search range is initially all coordinate points in the color histogram, and the first target coordinate point is the coordinate point with the largest value. When the number of primary colors does not reach the preset lower limit of the number of primary colors, or when the number of primary colors reaches the lower limit of the number of primary colors and the number of primary colors does not reach the preset upper limit of the number of primary colors and the value of the first target coordinate point is greater than or equal to the preset first pixel number threshold, the color corresponding to the first target coordinate point is determined as the primary color. After determining the color corresponding to the first target coordinate point as the primary color, the specified search range is updated based on the first target coordinate point, and the process returns to the steps of finding the first target coordinate point within the specified search range and determining whether the color corresponding to the first target coordinate point is the primary color.

4. The color noise suppression method as described in claim 2, characterized in that, The step of finding trace colors of the image to be processed in the color histogram according to a preset second pixel number threshold includes: In the color histogram, find the second target coordinate point, which is the coordinate point whose value is less than the preset second pixel number threshold; The color corresponding to each of the second target coordinate points is determined as a micro-color.

5. The color noise suppression method as described in claim 2, characterized in that, After identifying the primary colors of the image to be processed in the color histogram based on a preset upper limit for the number of primary colors, a preset lower limit for the number of primary colors, and a preset first pixel number threshold, the color noise suppression method further includes: Each of the identified primary colors is matched with a preset protective color. When a target protection color exists, the target protection color is added as the primary color of the image to be processed, wherein the target protection color is a protection color that does not match any of the found primary colors.

6. The color noise suppression method as described in claim 1, characterized in that, The step of adjusting the image to be processed according to the color mapping relationship to obtain a de-noiseed image includes: The image to be processed is adjusted according to the color mapping relationship and the preset intensity mapping relationship to obtain a de-noiseed image.

7. A color noise suppression device, characterized in that, include: The statistics module is used to calculate the color histogram of the image to be processed based on a preset first color dimension and a second color dimension, wherein the horizontal axis of the color histogram is the first color dimension, the vertical axis of the color histogram is the second color dimension, and the value of each coordinate point in the color histogram is used to represent the number of pixels. The search module is used to find the main color and trace colors of the image to be processed through the color histogram; A module is established to establish a color mapping relationship for the image to be processed based on the primary color, the trace colors, and the color histogram. The adjustment module is used to adjust the image to be processed according to the color mapping relationship to obtain a de-noising image; The establishment module includes: The first result determination unit is used to determine the mapping result associated with each coordinate point in the color histogram as follows: when the color corresponding to the coordinate point is not the trace color, the mapping result associated with the coordinate point is: the color corresponding to the coordinate point is mapped to itself. The detection unit is used to detect whether there is a third target coordinate point in the neighborhood of the coordinate point when the color corresponding to the coordinate point is the trace color. The third target coordinate point is: the coordinate point whose corresponding color is the main color. The second result determination unit is used to determine the mapping result associated with the coordinate point as follows when there is no third target coordinate point in the neighborhood of the coordinate point: the color corresponding to the coordinate point maps to itself. The third result determination unit is used to determine the mapping result associated with the coordinate point when the third target coordinate point exists in the neighborhood of the coordinate point: the color corresponding to the coordinate point is mapped to the target color, wherein the target color is calculated based on the color corresponding to the third target coordinate point. The mapping relationship establishment unit is used to establish the color mapping relationship of the image to be processed based on the mapping results associated with each coordinate point in the color histogram.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and storage medium

    CN114676360A

  • Image processing method and apparatus, and computer-readable storage medium

    WO2022151320A1