Image processing method and device, computer readable storage medium

CN123015336APending Publication Date: 2026-10-30BRIGATES MICROELECTRONICS (KUNSHAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611207378.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-07
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

但是,由于色度通道中色度噪声的空间频率较低,需要较大的滤波窗口才能够抑制色度噪声,一方面会造成计算资源的浪费,另一方面会造成颜色边界的溢出和相邻颜色之间的颜色渗透现象

Benefits of technology

[0006]在滑动窗口中选择第一和值最小或者次小的像素作为目标像素,并将滑动窗口的中心像素的第一色彩通道取值更新为目标像素的第一色彩通道取值,将滑动窗口的中心像素的第二色彩通道取值更新为目标像素的第二色彩通道取值。由于黑、白、灰色像素对应的第一和值较小,在含有色度噪声的图像区域中,小尺寸滑动窗口内很大概率存在仍为黑、白、灰色的无彩噪像素,使用该无噪像素的色度值替换中心像素的色度值,即可在较小的窗口内有效去除彩噪,从而避免已有技术大窗口导致的颜色边界溢出和颜色渗透问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015336A_ABST
    Figure CN123015336A_ABST
Patent Text Reader

Abstract

An image processing method and device, and a computer readable storage medium, the image processing method comprising: converting a to-be-processed image to a color space to obtain a first color space image; the to-be-processed image being an RGB image; updating a first color channel value and a second color channel value of a corresponding pixel in the first color space image to obtain a second color space image; the updating of the first color channel value and the second color channel value of the corresponding pixel in the first color space image comprising: determining a target pixel in a sliding window based on a first sum value corresponding to each pixel in the sliding window, and updating a first color channel value of a center pixel of the sliding window to be the first color channel value of the target pixel, and updating a second color channel value of the center pixel to be the second color channel value of the target pixel. The above scheme can effectively suppress chroma noise in an image.
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 an image processing method and apparatus, and a computer-readable storage medium. Background Technology

[0002] Chromatic noise in an image manifests as colored spots (such as purple or green noise) appearing in the dark or monochrome areas of the image.

[0003] To address chroma noise in images, existing solutions typically perform denoising on the chroma channels (U and V channels) separately for YUV format images. However, because the spatial frequency of chroma noise in the chroma channels is low, a large filtering window is required to suppress it. This wastes computational resources and can lead to color boundary overflow and color bleeding between adjacent colors. Furthermore, existing solutions process the U and V channels separately, neglecting the interrelationship between them, thus failing to fully utilize image information during chroma denoising. Summary of the Invention

[0004] The purpose of this invention is at least to provide an image processing method and apparatus, and a computer-readable storage medium, which can effectively suppress chromatic noise in images.

[0005] To achieve the above objectives, the present invention provides an image processing method, comprising: converting an image to be processed to a color space to obtain a first color space image; wherein the image to be processed is an RGB image; updating the first color channel values ​​and second color channel values ​​of corresponding pixels in the first color space image to obtain a second color space image; wherein updating the first color channel values ​​and second color channel values ​​of corresponding pixels in the first color space image comprises: determining a target pixel within the sliding window based on a first sum value corresponding to each pixel within the sliding window, updating the first color channel value of the center pixel of the sliding window to the first color channel value of the target pixel, and updating the second color channel value of the center pixel to the second color channel value of the target pixel; wherein the target pixel is the pixel with the smallest or second smallest first sum value within the sliding window; the first sum value is the sum of the absolute value of the first color channel value and the absolute value of the second color channel value corresponding to the pixel.

[0006] In the sliding window, the pixel with the smallest or second smallest sum is selected as the target pixel. The first color channel value of the center pixel of the sliding window is updated to the first color channel value of the target pixel, and the second color channel value of the center pixel of the sliding window is updated to the second color channel value of the target pixel. Since the first sum values ​​of black, white, and gray pixels are relatively small, in image areas containing chromatic noise, there is a high probability that there are noise-free pixels that are still black, white, or gray within the small sliding window. Replacing the chromatic value of the center pixel with the chromatic value of this noise-free pixel can effectively remove chromatic noise within a smaller window, thereby avoiding the color boundary overflow and color penetration problems caused by the large window in existing technologies.

[0007] Optionally, before updating the first color channel value and the second color channel value of the center pixel within the sliding window, the method further includes: filtering the first color channel values ​​and the second color channel values ​​corresponding to all pixels within the sliding window.

[0008] Optionally, the image processing method further includes: weighted mixing of the second color space image and the first color space image to obtain a target image, including: using the sum of the first product and the second product as the value of the first color channel of the i-th pixel in the target image; using the sum of the third product and the fourth product as the value of the second color channel of the i-th pixel in the target image; wherein, the first product is: the product of the first color channel value of the i-th pixel in the first color space image and the first weight; the second product is: the product of the first color channel value of the i-th pixel in the second color space image and the second weight; the third product is: the product of the second color channel value of the i-th pixel in the first color space image and the first weight; the fourth product is: the product of the second color channel value of the i-th pixel in the second color space image and the second weight; 1≤i≤N, i and N are both positive integers and N is the total number of pixels in the first color space image; the sum of the first weight and the second weight is 1.

[0009] Optionally, the value of the first weight is inversely correlated with the photosensitivity, and the value of the second weight is positively correlated with the photosensitivity, wherein the photosensitivity is the photosensitivity used by the image acquisition device when acquiring the image to be processed.

[0010] Optionally, the image processing method further includes increasing the saturation of the target image.

[0011] Optionally, the sliding window has 5 pixels in both the horizontal and vertical directions, or the sliding window has 3 pixels in both the horizontal and vertical directions.

[0012] Optionally, the color space is the YUV color space, the first color channel is the U channel, and the second color channel is the V channel; or, the color space is the CIE-Lab color space, the first color channel is the a channel, and the second color channel is the b channel.

[0013] Secondly, the present invention provides an image processing apparatus, comprising: a conversion unit for converting an image to be processed to a color space to obtain a first color space image; wherein the image to be processed is an RGB image; and a processing unit for updating the first color channel value and the second color channel value of corresponding pixels in the first color space image to obtain a second color space image; wherein updating the first color channel value and the second color channel value of corresponding pixels in the first color space image comprises: determining a target pixel in the sliding window based on a first sum value corresponding to each pixel in the sliding window, updating the first color channel value of the center pixel of the sliding window to the first color channel value of the target pixel, and updating the second color channel value of the center pixel to the second color channel value of the target pixel; wherein the target pixel is the pixel with the smallest or second smallest first sum value in the sliding window; the first sum value is the sum of the absolute value of the first color channel value and the absolute value of the second color channel value corresponding to the corresponding pixel.

[0014] Optionally, the processing unit is further adapted to perform filtering processing on the first color channel values ​​corresponding to all pixels in the sliding window and the second color channel values ​​corresponding to all pixels in the sliding window before updating the first color channel value and the second color channel value of the center pixel in the sliding window.

[0015] Optionally, the processing unit is further configured to perform a weighted mixing of the second color space image and the first color space image to obtain a target image, including: using the sum of the first product and the second product as the first color channel value of the i-th pixel in the target image; using the sum of the third product and the fourth product as the second color channel value of the i-th pixel in the target image; wherein, the first product is: the product of the first color channel value of the i-th pixel in the first color space image and the first weight; the second product is: the product of the first color channel value of the i-th pixel in the second color space image and the second weight; the third product is: the product of the second color channel value of the i-th pixel in the first color space image and the first weight; the fourth product is: the product of the second color channel value of the i-th pixel in the second color space image and the second weight; 1≤i≤N, i and N are both positive integers and N is the total number of pixels in the first color space image; the sum of the first weight and the second weight is 1.

[0016] Optionally, the value of the first weight is inversely correlated with the photosensitivity, and the value of the second weight is positively correlated with the photosensitivity, wherein the photosensitivity is the photosensitivity used by the image acquisition device when acquiring the image to be processed.

[0017] Optionally, the processing unit is also used to increase the saturation of the target image.

[0018] Optionally, the sliding window has 5 pixels in both the horizontal and vertical directions, or the sliding window has 3 pixels in both the horizontal and vertical directions.

[0019] Optionally, the color space is the YUV color space, the first color channel is the U channel, and the second color channel is the V channel; or, the color space is the CIE-Lab color space, the first color channel is the a channel, and the second color channel is the b channel.

[0020] Thirdly, the present invention also provides a computer-readable storage medium, which is a non-volatile storage medium or a non-transient storage medium, on which a computer program is stored, wherein the computer program is executed by a processor to perform the steps of any of the above-described image processing methods.

[0021] Fourthly, the present invention also provides another image processing apparatus, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor executes the steps of any of the image processing methods described above when running the computer program.

[0022] Fifthly, the present invention also provides a computer program product, including a computer program / instructions, wherein when the computer program / instructions are executed by a computer, any of the above-described image processing methods are executed. Attached Figure Description

[0023] Figure 1 This is a flowchart of an image processing method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a sliding window; Figure 3 This is a diagram illustrating the sliding window after shifting one pixel to the right. Figure 4 This is a schematic diagram of the image to be processed; Figure 5 Yes Figure 4 A schematic diagram of the image obtained after processing the image to be processed in the image; Figure 6 Yes Figure 4 A schematic diagram of the image obtained after processing the image to be processed in the image; Figure 7 This is a schematic diagram of the structure of an image processing device according to an embodiment of the present invention. Detailed Implementation

[0024] As described in the background section, when denoising is performed on the chroma channels (U channel and V channel) separately, a large filtering window is required to suppress the chroma noise because the spatial frequency of the chroma noise in the chroma channel is low. This will waste computing resources on the one hand, and cause color boundary overflow and color penetration between adjacent colors on the other hand.

[0025] In this embodiment of the invention, the pixel with the smallest or second smallest sum is selected as the target pixel within the sliding window. The first color channel value of the center pixel of the sliding window is updated to the first color channel value of the target pixel, and the second color channel value of the center pixel of the sliding window is updated to the second color channel value of the target pixel. This effectively suppresses chromatic noise in the center pixel within the sliding window. By traversing the first color space image through the sliding window, chromatic noise in each pixel of the first color space image is suppressed. Furthermore, since a large filtering window is not required, computational resources are not wasted, and color bleeding is not caused.

[0026] To make the above-mentioned objectives, features and beneficial effects of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0027] This invention provides an image processing method, referring to... Figure 1 The following will provide a detailed explanation through specific steps.

[0028] Step 101: Convert the image to be processed to a color space to obtain a first color space image.

[0029] In this embodiment of the invention, the image to be processed can be an RGB image. The image to be processed can be converted to a color space to obtain a first color space image.

[0030] In practice, the color space can be the YUV color space or the CIE-Lab color space. It is understood that other types of color spaces can also be used, but these will not be listed here.

[0031] Step 102: Update the first color channel value and the second color channel value of the corresponding pixels in the first color space image to obtain the second color space image.

[0032] In this embodiment of the invention, after obtaining the first color space image, the first color channel values ​​and second color channel values ​​of corresponding pixels in the first color space image can be updated. After updating the corresponding pixels, the second color space image is obtained.

[0033] In practice, when the color space is YUV, the first color channel can be the U channel and the second color channel can be the V channel. When the color space is CIE-Lab, the first color channel can be the a channel and the second color channel can be the b channel.

[0034] In this embodiment of the invention, a sliding window can be preset. Based on the first sum value corresponding to each pixel within the sliding window, a target pixel within the sliding window is determined. The first color channel value of the center pixel within the sliding window is updated to the first color channel value of the target pixel, and the second color channel value of the center pixel is updated to the second color channel value of the target pixel. The aforementioned first sum value is the sum of the absolute values ​​of the first and second color channels of the corresponding pixels within the sliding window.

[0035] In practice, the size of the sliding window can be preset.

[0036] In some embodiments, the size of the sliding window can be set to 5×5, that is, the number of consecutive pixels in both the horizontal and vertical directions is 5, and the sliding window includes 25 pixels.

[0037] like Figure 2 As shown, a schematic diagram of a sliding window is presented. Figure 2 In the sliding window, the first row consists of 5 pixels, numbered a1 to a5; the second row consists of 5 pixels, numbered b1 to b5; the third row consists of 5 pixels, numbered c1 to c5; the fourth row consists of 5 pixels, numbered d1 to d5; and the fifth row consists of 5 pixels, numbered e1 to e5.

[0038] In other embodiments, the size of the sliding window can be set to 3×3, that is, the sliding window has 3 consecutive pixels in both the horizontal and vertical directions, and the sliding window includes 9 pixels.

[0039] In some other embodiments, the size of the sliding window can also be set to 7×7 or other values, which will not be listed here.

[0040] In this embodiment of the invention, the target pixel can be the pixel with the smallest sum within the sliding window, or the pixel with the second smallest sum within the sliding window.

[0041] by Figure 2For example, the center pixel of the sliding window is pixel c3. The first color space image is a YUV color space image. The sum of the absolute values ​​of the U channel and V channel for pixel a1 is obtained as the first sum for pixel a1. The sum of the absolute values ​​of the U channel and V channel for pixel a2 is obtained as the first sum for pixel a2. This process is repeated to obtain the first sum for each of the 25 pixels within the sliding window.

[0042] The pixel with the smallest sum within the sliding window is selected as the target pixel. If the first sum of pixel d2 within the sliding window is found to be the smallest, then pixel d2 is selected as the target pixel, the U channel value of the center pixel c3 is updated to the U channel value of pixel d2, and the V channel value of the center pixel c3 is updated to the V channel value of pixel d2.

[0043] The pixel with the second smallest sum within the sliding window is selected as the target pixel. If the second smallest sum is detected for pixel b4 within the sliding window, then pixel b4 is selected as the target pixel, the U channel value of the center pixel c3 is updated to the U channel value of pixel b4, and the V channel value of the center pixel c3 is updated to the V channel value of pixel b4.

[0044] In practice, the aforementioned corresponding pixels are the center pixels of all sliding windows. After updating the first and second color channels of the center pixel of one sliding window, the sliding window can be slid to continue updating the first and second color channel values ​​of the center pixel of the next sliding window. After traversing the first color space image through the sliding windows, the corresponding second color space image can be obtained.

[0045] For example, after updating the U and V channel values ​​of pixel c3, the sliding window is slid to the right to obtain a new sliding window. (See reference...) Figure 3 A schematic diagram of the sliding window after shifting one pixel to the right is given. Figure 3 In the first row, the five pixels are pixels a2 to a6; the second row contains five pixels, b2 to b6; the third row contains five pixels, c2 to c6; the fourth row contains five pixels, d2 to d6; and the fifth row contains five pixels, e2 to e6. In the new sliding window, the center pixel is c4. The U and V channel values ​​of pixel c4 are updated.

[0046] Similarly, by updating the sliding windows, the first color space image is traversed, and the U channel and V channel values ​​of the center pixels of all sliding windows are updated to obtain the second color space image.

[0047] It is understandable that if the center pixel is the target pixel in a certain sliding window, then there is no need to update the U channel and V channel values ​​of the center pixel.

[0048] It should be noted that the target pixel is determined based on the first sum value of the corresponding pixel in the first color space image.

[0049] Continue to refer to Figure 2 For example, the U channel value Uc3 of pixel c3 is updated to the U channel value Ud2 of pixel d2, and the V channel value Vc3 of pixel c3 is updated to the V channel value Vd2 of pixel d2. After moving the sliding window, the center pixel is pixel c4. When determining the target pixel in the updated sliding window, the first sum value corresponding to pixel c3 refers to the sum of the absolute values ​​of Uc3 and Vc3, not the sum of the absolute values ​​of Ud2 and Vd2.

[0050] In practical applications, it is known that within a sliding window, there may be black, white, and gray pixels. The first sum value corresponding to black, white, and gray pixels is relatively small. Therefore, by updating the first and second color channel values ​​of the center pixel within the sliding window, the chromaticity noise of the center pixel can be effectively suppressed. Furthermore, by traversing the first color space image through the sliding window, the chromaticity noise of the resulting second color space image is effectively suppressed.

[0051] In this embodiment of the invention, before updating the first color channel value and the second color channel value of the center pixel within the sliding window, filtering can be performed on the first color channel values ​​and the second color channel values ​​corresponding to all pixels within the sliding window. This filtering process maintains the saturation of the first color space image.

[0052] By filtering the first and second color channel values ​​of the center pixel within the sliding window, low-saturation noise (i.e., pixels with smaller first sum values) can be eliminated in colored areas, thereby improving the problem of saturation degradation.

[0053] In some embodiments, Gaussian filtering can be applied to the first color channel values ​​and the second color channel values ​​corresponding to all pixels within the sliding window. In other embodiments, other types of filtering methods can also be used to filter the first color channel values ​​and the second color channel values ​​corresponding to all pixels within the sliding window.

[0054] In this embodiment of the invention, after obtaining the second color space image, the second color space image and the first color space image can be weighted and mixed to obtain the target image.

[0055] In practice, the first color channel value of the i-th pixel in the first color space image can be multiplied by the first weight to obtain the first product; the first color channel value of the i-th pixel in the second color space image can be multiplied by the second weight to obtain the second product. The first product and the second product are then added together, and the sum is used as the first color channel value of the i-th pixel in the target image.

[0056] Accordingly, the value of the second color channel of the i-th pixel in the first color space image is multiplied by the first weight to obtain the third product; the value of the second color channel of the i-th pixel in the second color space image is multiplied by the second weight to obtain the fourth product. The third product and the fourth product are added together, and the sum is used as the value of the second color channel of the i-th pixel in the target image. Both the first and second weights are positive numbers, and their sum is 1.

[0057] In this embodiment of the invention, the values ​​of the first weight and the second weight are both related to the ISO sensitivity set when the image acquisition device acquires the image to be processed. The image acquisition device can be a camera.

[0058] In practice, the value of the first weight is inversely correlated with the photosensitivity, while the value of the second weight is positively correlated with the photosensitivity. That is, if the photosensitivity used by the image acquisition device is high, the value of the first weight is low, and correspondingly, the value of the second weight is high.

[0059] Specifically, when the light is dim, the camera's ISO setting is higher, resulting in more noticeable chromatic noise in the image being processed. When the light is strong, the camera's ISO setting is lower, resulting in less chromatic noise in the image being processed.

[0060] Therefore, in low light conditions, a smaller first weight and a larger second weight are set. Thus, the value of the first color channel of the i-th pixel in the target image is primarily related to the value of the first color channel of the i-th pixel in the second color space image; similarly, the value of the second color channel of the i-th pixel in the target image is primarily related to the value of the second color channel of the i-th pixel in the second color space image. As a result, the chromatic noise in the obtained target image is lower.

[0061] When the light is strong, a larger first weight and a smaller second weight are set. Therefore, the value of the first color channel of the i-th pixel in the target image is mainly related to the value of the first color channel of the i-th pixel in the first color space image; the value of the second color channel of the i-th pixel in the target image is also mainly related to the value of the second color channel of the i-th pixel in the first color space image. This prevents the image saturation from decreasing.

[0062] In practical applications, it is known that in the field of digital camera technology, an ISO value below 800 is considered low ISO, an ISO value between 800 and 6400 is considered medium ISO, and an ISO value above 6400 is considered high ISO. The lower the ISO, the stronger the light intensity.

[0063] For example, when the ISO is 800, the first weight is 0.8 and the second weight is 0.2; when the ISO is 7000, the first weight is 0.15 and the second weight is 0.85.

[0064] It is understood that this example is only intended to illustrate the relationship between ISO sensitivity and the first and second weights. In actual implementation, the relationship between ISO sensitivity and the first and second weights can be set according to specific application requirements.

[0065] In this embodiment of the invention, after obtaining the target image, the saturation of the target image can be increased. Since the chromatic noise in the target image has been well suppressed, appropriately increasing the saturation of the target image will not significantly increase the chromatic noise in the target image.

[0066] In practice, a saturation increase threshold can be preset. This threshold can be set according to the specific application scenario. For example, the saturation increase threshold can be set to 1% to 50%.

[0067] In some embodiments, after obtaining the target image, the saturation of the target image can be increased by 5% based on the initial saturation. In other embodiments, after obtaining the target image, the saturation of the target image can be increased by 10% based on the initial saturation.

[0068] For example, the saturation of the target image is 30%. Increasing the saturation of the target image by 5% updates its saturation to 35%.

[0069] In this embodiment of the invention, after obtaining the second color space image, the second color space image can be converted into an RGB image. Alternatively, after obtaining the target image, the target image can be converted into an RGB image. Thus, the processed RGB image corresponding to the image to be processed is obtained.

[0070] Reference Figure 4 A schematic diagram of the image to be processed is given.

[0071] Using the image processing method provided in the above embodiments, the sliding window is 5×5, for Figure 4 The image to be processed is subjected to image processing. After the above processing, the resulting RGB image is as follows: Figure 5 As shown.

[0072] Using the image processing method provided in the above embodiments, the sliding window is 3×3, for Figure 4 The image to be processed is subjected to image processing. After the above processing, the resulting RGB image is as follows: Figure 6 As shown.

[0073] Will Figure 4 and Figure 5 , Figure 6 A comparison reveals that, Figure 4 In the image to be processed, there is a significant amount of chroma noise. Figure 5 , Figure 6 In the processed RGB image, there are fewer chromatic noise points, which means that chromatic noise has been effectively eliminated.

[0074] Furthermore, due to Figure 6 The corresponding sliding window (3×3) is smaller, and its effect on eliminating chroma noise is worse than that of the sliding window with a size of 5×5, but its computational complexity is lower. Therefore, a balance can be struck between computational complexity and the effect of eliminating chroma noise to choose the appropriate sliding window size.

[0075] In summary, the image processing method provided in this embodiment of the invention selects the pixel with the smallest or second smallest sum as the target pixel within the sliding window, updates the first color channel value of the center pixel of the sliding window to the first color channel value of the target pixel, and updates the second color channel value of the center pixel of the sliding window to the second color channel value of the target pixel. This effectively suppresses chromatic noise in the center pixel within the sliding window. By traversing the first color space image through the sliding window, chromatic noise suppression of each pixel in the first color space image is achieved.

[0076] In addition, since the selected sliding window size is 5×5 or 3×3, the number of pixels in the sliding window is small, which can avoid color boundary overflow and color bleeding between adjacent colors.

[0077] Reference Figure 7 An image processing apparatus 70 according to an embodiment of the present invention is provided, comprising: a conversion unit 701 and a processing unit 702, wherein: The conversion unit 701 is used to convert the image to be processed to a color space to obtain a first color space image; the image to be processed is an RGB image. Processing unit 702 is used to update the first color channel values ​​and second color channel values ​​of corresponding pixels in the first color space image to obtain a second color space image; the updating of the first color channel values ​​and second color channel values ​​of corresponding pixels in the first color space image includes: determining a target pixel in the sliding window based on the first sum value corresponding to each pixel in the sliding window, updating the first color channel value of the center pixel of the sliding window to the first color channel value of the target pixel, and updating the second color channel value of the center pixel to the second color channel value of the target pixel; wherein, the target pixel is the pixel with the smallest or second smallest first sum value in the sliding window; the first sum value is the sum of the absolute value of the first color channel value and the absolute value of the second color channel value corresponding to the corresponding pixel.

[0078] In specific implementation, the specific execution process of the above-mentioned conversion unit 701 and processing unit 702 can be referred to the above-mentioned steps 101 to 102, which will not be repeated here.

[0079] In specific implementation, the modules / units included in the various devices and products described in the above embodiments can be software modules / units, hardware modules / units, or a combination of both.

[0080] For example, for various devices and products applied to or integrated into a chip, each module / unit can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits; for various devices and products applied to or integrated into a chip module, each module / unit can be implemented using hardware methods such as circuits, and different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The components can be implemented using software programs that run on the processor integrated within the chip module. The remaining (if any) modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into the terminal, each of its components / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or in different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on the processor integrated within the terminal, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits.

[0081] This invention also provides a computer-readable storage medium, which is a non-volatile or non-transient storage medium, storing a computer program thereon. When the computer program is run by a processor, it executes the steps of the image processing method provided in any of the above embodiments.

[0082] This invention also provides another image processing apparatus, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the steps of the image processing method provided in any of the above embodiments when running the computer program.

[0083] This invention also provides a computer program product, including a computer program / instructions, wherein when the computer program / instructions are executed by a computer, the image processing method provided in any of the above embodiments is executed.

[0084] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include ROM, RAM, disk, or optical disk, etc.

[0085] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.

Claims

1. An image processing method, characterized in that, include: The image to be processed is converted to a color space to obtain a first color space image; The image to be processed is an RGB image; The values ​​of the first color channel and the second color channel of the corresponding pixels in the first color space image are updated to obtain the second color space image; The step of updating the first color channel value and the second color channel value of the corresponding pixel in the first color space image includes: determining the target pixel in the sliding window based on the first sum value corresponding to each pixel in the sliding window, updating the first color channel value of the center pixel of the sliding window to the first color channel value of the target pixel, and updating the second color channel value of the center pixel to the second color channel value of the target pixel. Wherein, the target pixel is the pixel with the smallest or second smallest sum within the sliding window; the first sum is the sum of the absolute values ​​of the first color channel and the absolute values ​​of the second color channel corresponding to the pixel.

2. The image processing method as described in claim 1, characterized in that, Before updating the first color channel value and the second color channel value of the center pixel within the sliding window, the process also includes: The values ​​of the first color channel corresponding to all pixels within the sliding window and the values ​​of the second color channel corresponding to all pixels within the sliding window are filtered.

3. The image processing method as described in claim 1, characterized in that, Also includes: The second color space image and the first color space image are weighted and mixed to obtain the target image, including: using the sum of the first product and the second product as the value of the first color channel of the i-th pixel in the target image; and using the sum of the third product and the fourth product as the value of the second color channel of the i-th pixel in the target image. Wherein, the first product is: the product of the first color channel value of the i-th pixel in the first color space image and the first weight; the second product is: the product of the first color channel value of the i-th pixel in the second color space image and the second weight; the third product is: the product of the second color channel value of the i-th pixel in the first color space image and the first weight; the fourth product is: the product of the second color channel value of the i-th pixel in the second color space image and the second weight; 1≤i≤N, i and N are both positive integers and N is the total number of pixels in the first color space image; the sum of the first weight and the second weight is 1.

4. The image processing method as described in claim 3, characterized in that, The value of the first weight is inversely correlated with the photosensitivity, and the value of the second weight is positively correlated with the photosensitivity, wherein the photosensitivity is the photosensitivity used by the image acquisition device when acquiring the image to be processed.

5. The image processing method as described in claim 3, characterized in that, Also includes: Increase the saturation of the target image.

6. The image processing method according to any one of claims 1 to 5, characterized in that, The sliding window has 5 pixels in both the horizontal and vertical directions, or the sliding window has 3 pixels in both the horizontal and vertical directions.

7. The image processing method according to any one of claims 1 to 5, characterized in that, The color space is the YUV color space, the first color channel is the U channel, and the second color channel is the V channel; or, the color space is the CIE-Lab color space, the first color channel is the a channel, and the second color channel is the b channel.

8. An image processing apparatus, characterized in that, include: The conversion unit is used to convert the image to be processed to a color space to obtain a first color space image; The image to be processed is an RGB image; The processing unit is used to update the first color channel value and the second color channel value of the corresponding pixel in the first color space image to obtain the second color space image; The step of updating the first color channel value and the second color channel value of the corresponding pixel in the first color space image includes: determining the target pixel in the sliding window based on the first sum value corresponding to each pixel in the sliding window, updating the first color channel value of the center pixel of the sliding window to the first color channel value of the target pixel, and updating the second color channel value of the center pixel to the second color channel value of the target pixel. Wherein, the target pixel is the pixel with the smallest or second smallest sum within the sliding window; the first sum is the sum of the absolute values ​​of the first color channel and the absolute values ​​of the second color channel corresponding to the pixel.

9. A computer-readable storage medium, wherein the computer-readable storage medium is a non-volatile storage medium or a non-transient storage medium, and a computer program is stored thereon, characterized in that, The computer program, when run by a processor, performs the steps of the image processing method according to any one of claims 1 to 7.

10. An image processing apparatus, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor runs the computer program, it performs the steps of the image processing method according to any one of claims 1 to 7.