Image processing method and device, electronic device and storage medium

By splitting the color channel and correcting the grayscale value of the images captured by the under-screen camera, the color distortion and light and dark offset problems of the images captured by the under-screen camera are solved, and the clarity and quality of the image are improved.

CN114972109BActive Publication Date: 2025-08-15KUNSHAN GO VISIONOX OPTO ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210684788.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-17
Publication Date
2025-08-15
Estimated Expiration
2042-06-17

AI Technical Summary

Technical Problem

When using an under-screen camera to capture images containing external light sources, diffraction fringes are prone to the image, resulting in a decrease in clarity, and repair the problem of color distortion or light and dark distortion in the processed image.

Method used

The original image is split into the first single-channel image corresponding to N color channels, and then the repair process is performed to split into the second single-channel image corresponding to N color channels. The correction is sequentially based on the grayscale value distribution interval of the target color channel, and finally the corrected image is fused to restore color and brightness.

Benefits of technology

Through color correction and brightness reduction, color distortion and dark distortion in repaired images are improved, and the quality of the final processed image is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114972109B_ABST
    Figure CN114972109B_ABST
Patent Text Reader

Abstract

The present application provides an image processing method and device, an electronic device, and a storage medium, relating to the field of image processing technology. The method performs restoration processing on the original image by splitting the original image into first single-channel images corresponding to N color channels, splitting the obtained restoration image into second single-channel images corresponding to N color channels, and correcting the grayscale value of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel. The corrected images corresponding to the N color channels are fused to obtain the target image. Therefore, based on the grayscale value distribution interval of the first single-channel image and the second single-channel image, color correction can be performed on the restoration image after restoration processing to restore the color and brightness of the restoration image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method and device, an electronic device, and a storage medium. Background Art

[0002] With the continuous development of display technology, full-screen has gradually become the development trend of the industry. In order to make the display have a higher screen-to-body ratio, the front camera can be set below the display, that is, the under-screen camera is used as the front camera.

[0003] When using an under-screen camera to capture images containing external light sources (such as lights), diffraction stripes are likely to appear in the captured images, thereby affecting the clarity of the captured images.

[0004] In some related technologies, an image with diffraction fringes can be repaired to improve the diffraction problem of the captured image. However, the image after repair may have color distortion or brightness imbalance. Summary of the Invention

[0005] In view of the above problems, the embodiments of the present application provide an image processing method and device, an electronic device and a storage medium, which can restore the color and brightness of the repaired image by correcting the repaired image.

[0006] In order to achieve the above objectives, the embodiments of the present application provide the following technical solutions:

[0007] A first aspect of an embodiment of the present application provides an image processing method, including: acquiring an original image; splitting the original image into first single-channel images corresponding to N color channels, where N is an integer greater than 1; performing repair processing on the original image to obtain a repaired image; splitting the repaired image into second single-channel images corresponding to N color channels; correcting the grayscale value of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel, to obtain corrected images corresponding to the N color channels; the target color channel is any color channel among the N color channels; and fusing the corrected images corresponding to the N color channels to obtain a target image.

[0008] In this way, based on the grayscale value distribution interval of the first single-channel image corresponding to the target color channel, and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel, the repaired image after repair processing is color corrected to improve the color distortion and brightness imbalance problems of the repaired image, and the color and brightness of the repaired image are restored, thereby improving the image quality of the target image obtained by final processing.

[0009] In a feasible embodiment, the grayscale value of the second single-channel image corresponding to the target color channel is corrected according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel, to obtain corrected images corresponding to N color channels respectively, including: obtaining the first single-channel image corresponding to the target color channel and the second single-channel image corresponding to the target color channel from the N color channels in sequence; obtaining a first grayscale eigenvalue of the first single-channel image corresponding to the target color channel, the first grayscale eigenvalue being within the grayscale value distribution interval of the first single-channel image corresponding to the target color channel; obtaining a second grayscale eigenvalue of the second single-channel image corresponding to the target color channel, the second grayscale eigenvalue being within the grayscale value distribution interval of the second single-channel image corresponding to the target color channel; and correcting the grayscale value of the second single-channel image corresponding to the target color channel according to the first grayscale eigenvalue and the second grayscale eigenvalue to obtain the corrected image corresponding to the target color channel. In this way, a first grayscale eigenvalue can be obtained from the grayscale value distribution range of the first single-channel image corresponding to the target color channel, and a second eigenvalue can be obtained from the grayscale value distribution range of the second single-channel image corresponding to the target color channel, and color correction can be performed on the repaired image based on the first grayscale eigenvalue and the second grayscale eigenvalue.

[0010] In one achievable embodiment, obtaining a first grayscale characteristic value of a first single-channel image corresponding to a target color channel includes: determining the first grayscale characteristic value of the first single-channel image corresponding to the target color channel based on the grayscale values of each pixel in the first single-channel image corresponding to the target color channel; obtaining a second grayscale characteristic value of a second single-channel image corresponding to the target color channel includes: determining the second grayscale characteristic value of the second single-channel image corresponding to the target color channel based on the grayscale values of each pixel in the second single-channel image corresponding to the target color channel. The first grayscale characteristic value includes any one of an average value, a maximum value, and a minimum value of the grayscale values of each pixel in the first single-channel image corresponding to the target color channel; and the second grayscale characteristic value includes any one of an average value, a maximum value, and a minimum value of the grayscale values of each pixel in the second single-channel image corresponding to the target color channel. In this way, by counting the grayscale values of each pixel in the first single-channel image corresponding to the target color channel, the first grayscale eigenvalue can be easily determined, and by counting the grayscale values of each pixel in the second single-channel image corresponding to the target color channel, the second grayscale eigenvalue can be easily determined, making the calculation method of the first grayscale eigenvalue and the second grayscale eigenvalue relatively simple.

[0011] In one achievable embodiment, the grayscale value of the second single-channel image corresponding to the target color channel is corrected based on the first grayscale eigenvalue and the second grayscale eigenvalue to obtain a corrected image corresponding to the target color channel, including: calculating the difference between the first grayscale eigenvalue and the second grayscale eigenvalue to obtain the grayscale difference corresponding to the target color channel; summing the grayscale value of each pixel in the second single-channel image corresponding to the target color channel with the grayscale difference corresponding to the target color channel to obtain the corrected image corresponding to the target color channel. In this way, since the difference between the first grayscale eigenvalue and the second grayscale eigenvalue is the color offset value of the second single-channel image relative to the first single-channel image, the grayscale difference corresponding to the target color channel is added to the grayscale value of each pixel in the second single-channel image corresponding to the target color channel, thereby accurately correcting the color offset of the second single-channel image corresponding to the target color channel, thereby restoring the color and brightness of the repaired image to the greatest extent.

[0012] In a feasible embodiment, before correcting the grayscale value of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel to obtain the corrected images corresponding to N color channels respectively, it also includes: filtering the first single-channel image corresponding to the N color channels and the second single-channel image corresponding to the N color channels respectively; correcting the grayscale value of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel to obtain the corrected images corresponding to N color channels respectively, including: correcting the grayscale value of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel after filtering and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel after filtering to obtain the corrected images corresponding to N color channels respectively. In this way, by filtering the first single-channel image corresponding to the N color channels and the second single-channel image corresponding to the N color channels, the influence of noise on the first grayscale eigenvalue and the second grayscale eigenvalue calculated subsequently can be reduced, so that the calculated first grayscale eigenvalue and the second grayscale eigenvalue are more accurate, thereby making the effect of the corrected image better.

[0013] In one possible implementation, performing restoration processing on an original image to obtain a restored image includes: performing restoration processing on the original image using an image processing model to obtain the restored image; wherein the image processing model is trained based on a combination of multiple sample images, the sample image combination including a sample standard image and a sample image to be restored. Thus, performing restoration processing on the original image based on the image processing model can effectively eliminate diffraction fringes in the original image.

[0014] In one possible implementation, obtaining the original image includes: capturing the original image using an under-screen camera provided on the electronic device. Thus, the original image is captured by the under-screen camera of the electronic device, and the electronic device performs image processing on the original image to obtain the target image, thereby improving the image quality of the electronic device with the under-screen camera.

[0015] A second aspect of an embodiment of the present application provides an image processing device, comprising: an original image acquisition module for acquiring an original image; a first channel splitting module for splitting the original image into first single-channel images corresponding to N color channels, where N is an integer greater than 1; a repair processing module for performing repair processing on the original image to obtain a repaired image; a second channel splitting module for splitting the repaired image into second single-channel images corresponding to N color channels; an image correction module for correcting the grayscale value of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel, to obtain corrected images corresponding to the N color channels, where the target color channel is any color channel among the N color channels; and an image fusion module for fusing the corrected images corresponding to the N color channels to obtain a target image.

[0016] In one feasible embodiment, the image correction module includes: a single-channel image acquisition submodule, which is used to sequentially acquire a first single-channel image corresponding to the target color channel and a second single-channel image corresponding to the target color channel from N color channels; a first grayscale eigenvalue acquisition submodule, which is used to acquire a first grayscale eigenvalue of the first single-channel image corresponding to the target color channel, the first grayscale eigenvalue being within the grayscale value distribution interval of the first single-channel image corresponding to the target color channel; a second grayscale eigenvalue acquisition submodule, which is used to acquire a second grayscale eigenvalue of the second single-channel image corresponding to the target color channel, the second grayscale eigenvalue being within the grayscale value distribution interval of the second single-channel image corresponding to the target color channel; and a first image correction submodule, which is used to correct the grayscale value of the second single-channel image corresponding to the target color channel according to the first grayscale eigenvalue and the second grayscale eigenvalue to obtain a corrected image corresponding to the target color channel.

[0017] In one achievable embodiment, the first grayscale eigenvalue acquisition submodule includes: a first grayscale eigenvalue determination unit for determining a first grayscale eigenvalue of the first single-channel image corresponding to the target color channel based on the grayscale values of each pixel in the first single-channel image corresponding to the target color channel; and a second grayscale eigenvalue acquisition submodule includes: a second grayscale eigenvalue determination unit for determining a second grayscale eigenvalue of the second single-channel image corresponding to the target color channel based on the grayscale values of each pixel in the second single-channel image corresponding to the target color channel. The first grayscale eigenvalue includes any one of an average value, a maximum value, and a minimum value of the grayscale values of each pixel in the first single-channel image corresponding to the target color channel; and the second grayscale eigenvalue includes any one of an average value, a maximum value, and a minimum value of the grayscale values of each pixel in the second single-channel image corresponding to the target color channel.

[0018] In one feasible embodiment, the first image correction submodule includes: a grayscale difference calculation unit, used to calculate the difference between the first grayscale eigenvalue and the second grayscale eigenvalue to obtain the grayscale difference corresponding to the target color channel; an image correction unit, used to sum the grayscale value of each pixel point in the second single-channel image corresponding to the target color channel with the grayscale difference corresponding to the target color channel to obtain a corrected image corresponding to the target color channel.

[0019] In one achievable embodiment, the image processing device further includes a filtering processing module for performing filtering processing on the first single-channel image corresponding to each of the N color channels and the second single-channel image corresponding to each of the N color channels. The image correction module includes a second image correction submodule for sequentially correcting the grayscale value of the second single-channel image corresponding to the target color channel based on the grayscale value distribution interval of the first single-channel image corresponding to the target color channel after filtering processing and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel after filtering processing, to obtain corrected images corresponding to each of the N color channels.

[0020] In one possible implementation, the restoration processing module includes a restoration processing submodule configured to perform restoration processing on the original image using an image processing model to obtain a restored image. The image processing model is trained based on a combination of multiple sample images, including a sample standard image and a sample image to be restored.

[0021] In one possible implementation, the original image acquisition module includes an original image acquisition submodule, which is used to capture the original image through an under-screen camera provided on the electronic device.

[0022] A third aspect of an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call the computer program to execute the above-mentioned image processing method.

[0023] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed, the above-mentioned image processing method is implemented.

[0024] The possible implementation methods of the second to fourth aspects have effects similar to those of the first aspect and the possible designs of the first aspect, and will not be repeated here.

[0025] The construction of the present application as well as other objects and advantageous effects will become more apparent through the description of the preferred embodiments in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0027] Figure 1 A flowchart of an image processing method provided in an embodiment of the present application;

[0028] Figure 2 Schematic diagram of the original image, restored image, and target image provided in the embodiments of the present application;

[0029] Figure 3 A specific flow chart of an image processing method provided in an embodiment of the present application;

[0030] Figure 4 A structural block diagram of an image processing device provided in an embodiment of the present application;

[0031] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] With the continuous development of display technology, full-screen displays are gradually becoming an industry trend. In some display products (such as mobile phones, tablets, and laptops), grooves or openings are set in the display to accommodate the front-facing camera, which captures external images. However, the formation of grooves or openings in the display can reduce the screen-to-body ratio.

[0033] Therefore, for display products that use full-screen displays, under-screen cameras are gradually becoming an optional solution to achieve full-screen displays. Under-screen cameras are designed to place the front camera below the display without any grooves or holes in the display.

[0034] The display screen is distributed with metal traces and pixel structures, which will form hole area diffraction or slit diffraction, etc. Therefore, when using the under-screen camera to capture images containing external light sources (such as lights), the light emitted by the external light source will first pass through the transparent area of the display screen and then enter the under-screen camera, which can easily cause diffraction stripes in the image captured by the under-screen camera, thereby affecting the clarity of the captured image.

[0035] Some related technologies use algorithms to repair images with diffraction fringes, improving the diffraction problem and enhancing image clarity. However, after using these algorithms to repair images with diffraction fringes, the repaired images may suffer from color distortion (e.g., brighter colors) or imbalanced brightness.

[0036] In response to the above technical problems, the embodiments of the present application provide an image processing method and device, an electronic device, and a storage medium. The method comprises the following steps: splitting an original image into first single-channel images corresponding to N color channels, performing restoration processing on the original image to obtain a restoration image, splitting the restoration image into second single-channel images corresponding to N color channels, and correcting the grayscale values of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel, thereby obtaining correction images corresponding to the N color channels, where the target color channel is any color channel among the N color channels; and fusing the correction images corresponding to the N color channels to obtain a target image. Therefore, the embodiments of the present application perform color correction on the restoration image after restoration processing based on the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel, thereby improving the color distortion and brightness imbalance problems of the restoration image, restoring the color and brightness of the restoration image, and thus improving the image quality of the target image obtained by the final processing.

[0037] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be described in more detail below in conjunction with the drawings in the preferred embodiments of the present application. In the drawings, the same or similar reference numerals throughout represent the same or similar parts or parts with the same or similar functions. The described embodiments are part of the embodiments of the present application, not all of the embodiments. The embodiments described below with reference to the drawings are exemplary and are intended to be used to explain the present application, and should not be understood as limitations on the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0038] Reference Figure 1 As shown, in a first aspect, an embodiment of the present application provides a flowchart of an image processing method, which may specifically include the following steps:

[0039] Step 101: Acquire an original image.

[0040] In some embodiments, the original image may be an original image Image1 captured by an under-screen camera provided on an electronic device in an actual shooting scene.

[0041] Since the under-screen camera is set below the display screen, it can be considered that the under-screen camera captures the original image through the display screen. The above-mentioned shooting scene can be a scene with external light sources (such as lights), and the original image captured by the under-screen camera can be as follows: Figure 2 As shown in (a), the area where the external light source is located in the original image has obvious diffraction stripes, and the original image is relatively unclear.

[0042] It is understandable that in shooting scenes without external light sources, the original image captured by the under-screen camera may also contain diffraction fringes. In addition, the above-mentioned original image can also be an original image with diffraction fringes captured by a camera other than the under-screen camera.

[0043] Step 102: split the original image into first single-channel images corresponding to N color channels; N is an integer greater than 1.

[0044] In some embodiments, the original image is a color image, which includes single-channel images corresponding to N color channels. Therefore, the original image can be split into first single-channel images corresponding to N color channels.

[0045] Taking N equal to 3, and the three color channels are red channel (R), green channel (G) and blue channel (B) as an example, the original image Image1 can be split into: the first single-channel image Image corresponding to the red channel 1R, the first single channel image corresponding to the green channel Image 1G , and the first single-channel image Image corresponding to the blue channel 1B .

[0046] It is understood that in other embodiments, the original image may include two color channels, four color channels, or more color channels; accordingly, the original image may be split into first single-channel images corresponding to two color channels, first single-channel images corresponding to four color channels, or first single-channel images corresponding to more color channels. The embodiments of the present application do not limit the number of color channels included in the original image.

[0047] Step 103: Perform restoration processing on the original image to obtain a restored image.

[0048] In some embodiments, the original image is an image with diffraction fringes. Therefore, the original image can be repaired to eliminate the diffraction fringes in the original image to obtain a repaired image.

[0049] The original image can be Figure 2 The image shown in (a) can be used for Figure 2 The original image shown in (a) is repaired, and the repaired image obtained can be as follows Figure 2 The image shown in (b).

[0050] It can be seen that Figure 2 The repaired image shown in (b) is relative to Figure 2 The original image shown in (a) in FIG, which eliminates the diffraction fringes in the original image, but as Figure 2 The repaired image shown in (b) will have color distortion problems.

[0051] It is understandable that the order of step 102 and step 103 can be changed. Step 102 can be executed first and then step 103, or step 103 can be executed first and then step 102. The specific execution order can be set according to actual conditions and is not limited here.

[0052] Step 104: split the repaired image into second single-channel images corresponding to N color channels.

[0053] Since the original image is a color image, it includes single-channel images corresponding to each of the N color channels. Accordingly, after the original image is restored, the restored image obtained is also a color image, which also includes single-channel images corresponding to each of the N color channels. Therefore, the restored image can be split into second single-channel images corresponding to each of the N color channels.

[0054] Taking N equal to 3 and the three color channels as an example, the repaired image Image2 can be split into: the second single-channel image Image corresponding to the red channel 2R , the second single-channel image Image corresponding to the green channel 2G , and the second single-channel image Image corresponding to the blue channel 2B .

[0055] It is understandable that, in other embodiments, the repaired image may also include 2 color channels, 4 color channels or more color channels; accordingly, the repaired image may also be split into second single-channel images corresponding to 2 color channels, second single-channel images corresponding to 4 color channels, or second single-channel images corresponding to more color channels.

[0056] Step 105, correcting the grayscale value of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel, to obtain corrected images corresponding to N color channels respectively; the target color channel is any color channel among the N color channels.

[0057] After splitting the original image into first single-channel images corresponding to N color channels, one of the N color channels can be selected as the target color channel in sequence, and the grayscale value distribution range of the first single-channel image corresponding to the target color channel can be obtained by counting the grayscale values of each pixel in the first single-channel image corresponding to the target color channel. The grayscale values of each pixel in the first single-channel image corresponding to the target color channel are all within the grayscale value distribution range of the first single-channel image corresponding to the target color channel; and the minimum value of the grayscale value distribution range is the minimum value of the grayscale values of each pixel in the first single-channel image corresponding to the target color channel, and the maximum value of the grayscale value distribution range is the maximum value of the grayscale values of each pixel in the first single-channel image corresponding to the target color channel.

[0058] Accordingly, after splitting the repaired image into second single-channel images corresponding to N color channels, one of the color channels can be selected as the target color channel in turn from the N color channels, and by counting the grayscale values of each pixel in the second single-channel image corresponding to the target color channel, the grayscale value distribution range of the second single-channel image corresponding to the target color channel can be obtained. Among them, the grayscale values of each pixel in the second single-channel image corresponding to the target color channel are all within the grayscale value distribution range of the second single-channel image corresponding to the target color channel. Moreover, the minimum value of the grayscale value distribution range is the minimum value of the grayscale values of each pixel in the second single-channel image corresponding to the target color channel, and the maximum value of the grayscale value distribution range is the maximum value of the grayscale values of each pixel in the second single-channel image corresponding to the target color channel.

[0059] Then, the grayscale value of the second single-channel image corresponding to the target color channel is corrected according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel, and the corrected images corresponding to the N color channels are obtained.

[0060] Taking the N color channels as an example, which are a red channel, a green channel, and a blue channel, the target color channel can be any one of the red channel, the green channel, and the blue channel.

[0061] If the target color channel is the red channel, the first single-channel image Image corresponding to the red channel can be used. 1R Grayscale value distribution range, and the second single channel image Image corresponding to the red channel 2R Grayscale value distribution range, for the second single channel image Image corresponding to the red channel 2R Correct the grayscale value to get the corrected image Image' corresponding to the red channel 2R .

[0062] If the target color channel is the green channel, the first single-channel image Image corresponding to the green channel can be used. 1G Grayscale value distribution range, and the second single channel image Image corresponding to the green channel 2G Grayscale value distribution range, for the second single channel image Image corresponding to the green channel 2G Correct the grayscale value to get the corrected image Image' corresponding to the green channel 2G .

[0063] If the target color channel is the blue channel, you can use the first single-channel image Image corresponding to the blue channel 1B Grayscale value distribution range, and the second single-channel image Image corresponding to the blue channel2B Grayscale value distribution range, the second single channel image Image corresponding to the blue channel 2B Correct the grayscale value of the blue channel to obtain the corrected image Image' 2B .

[0064] In some embodiments, a first single-channel image corresponding to the target color channel and a second single-channel image corresponding to the target color channel are obtained from N color channels in sequence; a first grayscale eigenvalue of the first single-channel image corresponding to the target color channel is obtained, and the first grayscale eigenvalue is within the grayscale value distribution interval of the first single-channel image corresponding to the target color channel; a second grayscale eigenvalue of the second single-channel image corresponding to the target color channel is obtained, and the second grayscale eigenvalue is within the grayscale value distribution interval of the second single-channel image corresponding to the target color channel; and the grayscale value of the second single-channel image corresponding to the target color channel is corrected according to the first grayscale eigenvalue and the second grayscale eigenvalue to obtain a corrected image corresponding to the target color channel.

[0065] In other words, a first grayscale eigenvalue can be obtained from the grayscale value distribution range of the first single-channel image corresponding to the target color channel, and correspondingly, a second eigenvalue can be obtained from the grayscale value distribution range of the second single-channel image corresponding to the target color channel. Based on the first grayscale eigenvalue and the second grayscale eigenvalue, color correction is performed on the second single-channel image corresponding to the target color channel.

[0066] For example, if the N color channels are red, green, and blue, we can get the first single-channel image Image corresponding to the red channel. 1R The first grayscale eigenvalue and the first single-channel image Image corresponding to the green channel 1G The first grayscale eigenvalue of , and the first single-channel image Image corresponding to the blue channel 1B The first grayscale eigenvalue of ; Correspondingly, the second single-channel image Image corresponding to the red channel can also be obtained 2R The second grayscale eigenvalue and the second single-channel image Image corresponding to the green channel 2G The second grayscale eigenvalue of , and the second single-channel image Image corresponding to the blue channel 2B The second grayscale characteristic value of .

[0067] In one feasible method, the first grayscale eigenvalue and the second grayscale eigenvalue can be obtained in the following manner: according to the grayscale value of each pixel point in the first single-channel image corresponding to the target color channel, the first grayscale eigenvalue of the first single-channel image corresponding to the target color channel is determined; according to the grayscale value of each pixel point in the second single-channel image corresponding to the target color channel, the second grayscale eigenvalue of the second single-channel image corresponding to the target color channel is determined.

[0068] Among them, the first grayscale characteristic value includes any one of the average value, maximum value and minimum value of the grayscale values of each pixel point in the first single-channel image corresponding to the target color channel; the second grayscale characteristic value includes any one of the average value, maximum value and minimum value of the grayscale values of each pixel point in the second single-channel image corresponding to the target color channel.

[0069] The following describes how to determine the first grayscale characteristic value and the second grayscale characteristic value using three different scenarios. These scenarios take the N color channels, which are red, green, and blue, as an example, and the target color channel can be any one of the red, green, and blue channels.

[0070] In the first case, the first grayscale eigenvalue is the minimum grayscale value of each pixel point in the first single-channel image corresponding to the target color channel, and the second grayscale eigenvalue is the minimum grayscale value of each pixel point in the second single-channel image corresponding to the target color channel.

[0071] If the target color channel is the red channel, you can use the first single-channel image Image corresponding to the red channel 1R The minimum grayscale value of each pixel in is used as the first single-channel image corresponding to the red channel Image 1R The first grayscale eigenvalue MinGray(Image 1R ); the second single-channel image Image corresponding to the red channel can be 2R The minimum grayscale value of each pixel in is used as the second single-channel image Image corresponding to the red channel 2R The second grayscale eigenvalue MinGray(Image 2R ).

[0072] If the target color channel is the green channel, you can use the first single-channel image Image corresponding to the green channel 1G The minimum grayscale value of each pixel in is used as the first single-channel image Image corresponding to the green channel 1G The first grayscale eigenvalue MinGray(Image 1G ); the second single-channel image Image corresponding to the green channel can be2G The minimum grayscale value of each pixel in is used as the second single-channel image Image corresponding to the green channel 2G The second grayscale eigenvalue MinGray(Image 2G ).

[0073] If the target color channel is the blue channel, you can use the first single-channel image Image corresponding to the blue channel 1B The minimum grayscale value of each pixel in is used as the first single-channel image corresponding to the blue channel Image 1B The first grayscale eigenvalue MinGray(Image 1B ); the second single-channel image Image corresponding to the blue channel can be 2B The minimum grayscale value of each pixel in is used as the second single-channel image Image corresponding to the blue channel 2B The second grayscale eigenvalue MinGray(Image 2B ).

[0074] In the second case, the first grayscale eigenvalue is the maximum grayscale value of each pixel point in the first single-channel image corresponding to the target color channel, and the second grayscale eigenvalue is the maximum grayscale value of each pixel point in the second single-channel image corresponding to the target color channel.

[0075] If the target color channel is the red channel, you can use the first single-channel image Image corresponding to the red channel 1R The maximum grayscale value of each pixel in is used as the first single-channel image corresponding to the red channel Image 1R The first grayscale eigenvalue MaxGray(Image 1R ); the second single-channel image Image corresponding to the red channel can be 2R The maximum grayscale value of each pixel in is used as the second single-channel image Image corresponding to the red channel 2R The second grayscale eigenvalue MaxGray(Image 2R ).

[0076] If the target color channel is the green channel, you can use the first single-channel image Image corresponding to the green channel 1G The maximum value of the grayscale value of each pixel in is used as the first single-channel image Image corresponding to the green channel 1G The first grayscale eigenvalue MaxGray(Image 1G ); the second single-channel image Image corresponding to the green channel can be 2GThe maximum value of the grayscale value of each pixel in is used as the second single-channel image Image corresponding to the green channel 2G The second grayscale eigenvalue MaxGray(Image 2G ).

[0077] If the target color channel is the blue channel, you can use the first single-channel image Image corresponding to the blue channel 1B The maximum value of the grayscale value of each pixel in is used as the first single-channel image corresponding to the blue channel Image 1B The first grayscale eigenvalue MaxGray(Image 1B ); the second single-channel image Image corresponding to the blue channel can be 2B The maximum grayscale value of each pixel in is used as the second single-channel image Image corresponding to the blue channel 2B The second grayscale eigenvalue MaxGray(Image 2B ).

[0078] In the third case, the first grayscale eigenvalue is the average grayscale value of each pixel in the first single-channel image corresponding to the target color channel, and the second grayscale eigenvalue is the average grayscale value of each pixel in the second single-channel image corresponding to the target color channel.

[0079] If the target color channel is the red channel, the first single-channel image Image corresponding to the red channel can be calculated 1R The average grayscale value of each pixel in the image is used as the first single-channel image corresponding to the red channel. 1R The first grayscale eigenvalue AvgGray(Image 1R ); the second single-channel image Image corresponding to the red channel can be calculated 2R The average grayscale value of each pixel in the image is used as the second single-channel image corresponding to the red channel. 2R The second grayscale eigenvalue AvgGray(Image 2R ).

[0080] If the target color channel is the green channel, the first single-channel image Image corresponding to the green channel can be calculated 1G The average value of the grayscale values of each pixel in the image is used as the first single-channel image corresponding to the green channel. 1G The first grayscale eigenvalue AvgGray(Image 1G ); the second single-channel image Image corresponding to the green channel can be calculated 2GThe average grayscale value of each pixel in the image is used as the second single-channel image corresponding to the green channel. 2G The second grayscale eigenvalue AvgGray(Image 2G ).

[0081] If the target color channel is the blue channel, the first single-channel image Image corresponding to the blue channel can be calculated 1B The average value of the grayscale values of each pixel in the image is used as the first single-channel image corresponding to the blue channel. 1B The first grayscale eigenvalue AvgGray(Image 1B ); the second single-channel image Image corresponding to the blue channel can be calculated 2B The average grayscale value of each pixel in the image is used as the second single-channel image corresponding to the blue channel. 2B The second grayscale eigenvalue AvgGray(Image 2B ).

[0082] In one feasible manner, the grayscale value of the second single-channel image corresponding to the target color channel can be corrected based on the first grayscale eigenvalue and the second grayscale eigenvalue in the following manner: the difference between the first grayscale eigenvalue and the second grayscale eigenvalue is calculated to obtain the grayscale difference corresponding to the target color channel; the grayscale value of each pixel point in the second single-channel image corresponding to the target color channel is summed with the grayscale difference corresponding to the target color channel to obtain a corrected image corresponding to the target color channel.

[0083] For example, the N color channels are red, green, and blue, respectively, and the first grayscale eigenvalue is the minimum grayscale value of each pixel in a first single-channel image corresponding to the target color channel, and the second grayscale eigenvalue is the minimum grayscale value of each pixel in a second single-channel image corresponding to the target color channel. The target color channel can be any one of the red, green, and blue channels.

[0084] If the target color channel is the red channel, the first single-channel image Image corresponding to the red channel can be calculated 1R The first grayscale eigenvalue MinGray(Image 1R ), the second single-channel image Image corresponding to the red channel 2R The second grayscale eigenvalue MinGray(Image 2R ) to obtain the grayscale difference corresponding to the red channel; then, the second single-channel image Image corresponding to the red channel 2RThe grayscale value of each pixel in the image is summed with the grayscale difference corresponding to the red channel to obtain the corrected image Image' corresponding to the red channel 2R =MinGray(Image 1R )-MinGray(Image 2R )+Image 2R .

[0085] If the target color channel is the green channel, the first single-channel image Image corresponding to the green channel can be calculated 1G The first grayscale eigenvalue MinGray(Image 1G ), the second single-channel image Image corresponding to the green channel 2G The second grayscale eigenvalue MinGray(Image 2G ) to obtain the grayscale difference corresponding to the green channel; then, the second single-channel image Image corresponding to the green channel 2G The grayscale value of each pixel in the image is summed with the grayscale difference corresponding to the green channel to obtain the corrected image Image' corresponding to the green channel 2G =MinGray(Image 1G )-MinGray(Image 2G )+Image 2G .

[0086] If the target color channel is the blue channel, the first single-channel image Image corresponding to the blue channel can be calculated 1B The first grayscale eigenvalue MinGray(Image 1B ), the second single-channel image Image corresponding to the blue channel 2B The second grayscale eigenvalue MinGray(Image 2B ) to obtain the grayscale difference corresponding to the blue channel; then, the second single-channel image Image corresponding to the blue channel 2B The grayscale value of each pixel in the image is summed with the grayscale difference corresponding to the blue channel to obtain the corrected image Image' corresponding to the blue channel 2B =MinGray(Image 1B )-MinGray(Image 2B )+Image 2B .

[0087] Step 106: Fusing the corrected images corresponding to the N color channels to obtain a target image.

[0088] After obtaining the corrected images corresponding to the N color channels, the corrected images corresponding to the N color channels are synthesized to obtain a target image. The target image is an image after the color and brightness of the repaired image are restored.

[0089] Taking the N color channels as an example, the red channel, green channel and blue channel respectively, the correction image Image' 2R , the corrected image Image' corresponding to the green channel 2G , and the corrected image Image' corresponding to the blue channel 2B Merge and get the target image Image'.

[0090] The repaired image can be Figure 2 The image shown in (b) can be used for Figure 2 The color and brightness of the repaired image shown in (b) are restored, and the target image obtained can be as follows Figure 2 The image shown in (c) in .

[0091] It can be seen that Figure 2 The target image shown in (c) is relative to Figure 2 The repaired image shown in (b) restores the color distortion of the repaired image.

[0092] Therefore, the embodiment of the present application can perform color correction on the repaired image after repair processing based on the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel, improve the color distortion and brightness imbalance problems of the repaired image, and restore the color and brightness of the repaired image, thereby improving the image quality of the target image obtained by the final processing.

[0093] Reference Figure 3 As shown, in the first aspect, a specific flow chart of an image processing method provided by an embodiment of the present application may include the following steps:

[0094] Step 301: Capture an original image using an under-screen camera provided on an electronic device.

[0095] An under-screen camera may be provided below the display screen of the electronic device, and an original image may be captured based on the under-screen camera. The original image may be an image with diffraction fringes captured by the under-screen camera.

[0096] Step 302: split the original image into first single-channel images corresponding to N color channels; N is an integer greater than 1.

[0097] The specific implementation of the step is similar to the specific implementation of the above-mentioned step 102, and will not be repeated here to avoid repetition.

[0098] Step 303: Use the image processing model to perform restoration processing on the original image to obtain a restored image.

[0099] An image processing model can be trained in advance. After obtaining the original image, the original image is input into the image processing model, and the original image is repaired based on the image processing model. The image processing model can output the repaired image.

[0100] The image processing model is a neural network model, which may be a convolutional neural network or other types of neural network models.

[0101] The image processing model is trained based on a combination of multiple sample images, where the sample image combination includes a sample standard image and a sample image to be repaired.

[0102] The specific training process of the image processing model can be: obtaining multiple sample image combinations, each sample image combination includes a sample standard image and a sample image to be repaired; inputting the sample image to be repaired into the initial processing model, repairing the sample image to be repaired through the initial processing model to obtain a sample repaired image; calculating the loss function value of the initial processing model based on the sample repaired image and the sample standard image; iteratively updating the parameters in the initial processing model according to the loss function value until the final loss function value meets the requirements, thereby obtaining a trained image processing model.

[0103] The sample standard image is a sample image without diffraction fringes. It can be an image captured by an on-screen camera provided on an electronic device in a specified shooting scene. The on-screen camera can be a front-facing camera provided with a structure such as a groove or an opening, or a rear-facing camera provided on the electronic device. When the on-screen camera is used to capture the image, light emitted by the external light source does not need to pass through the display screen. Therefore, the image captured by the on-screen camera is less likely to have diffraction fringes, resulting in a sample standard image with relatively good clarity.

[0104] The sample image to be repaired is a sample image that exhibits diffraction fringes and can be an image captured by an under-screen camera on an electronic device in a specified shooting scene. The specified shooting scene corresponding to the sample standard image and the sample image to be repaired can be the same scene.

[0105] Step 304: split the repaired image into second single-channel images corresponding to N color channels.

[0106] The specific implementation of this step is similar to that of step 104 and will not be described again here to avoid repetition.

[0107] Step 305 : Filtering is performed on the first single-channel images corresponding to the N color channels and the second single-channel images corresponding to the N color channels.

[0108] After the original image is split into first single-channel images corresponding to N color channels, filtering processing can be performed on the first single-channel images corresponding to the N color channels to reduce noise in the first single-channel images corresponding to the N color channels.

[0109] Accordingly, after splitting the repaired image into second single-channel images corresponding to N color channels, the second single-channel images corresponding to the N color channels can be filtered to reduce noise in the second single-channel images corresponding to the N color channels.

[0110] The filtering process may be Gaussian filtering, which may be performed using a two-dimensional Gaussian filter function as shown in the following formula:

[0111]

[0112] Among them, i and j represent the position information of the two-dimensional Gaussian filter, G[i,j] is the grayscale value of the two-dimensional Gaussian filter at position i and j, and σ is the Gaussian distribution parameter, which determines the smoothness of the image after the two-dimensional Gaussian filter. The larger σ is, the smoother the image is, and the smaller σ is, the smoother the image is.

[0113] For example, N color channels are red, green, and blue. The first single-channel image Image corresponding to the red channel can be 1R Perform Gaussian filtering, and the first single-channel image Image corresponding to the red channel after filtering 1RG =GaussianFilter(Image 1R ); You can also use the first single channel image Image corresponding to the green channel 1G Perform Gaussian filtering, and the first single-channel image Image corresponding to the green channel after filtering 1GG =GaussianFilter(Image 1G ); You can also use the first single channel image Image corresponding to the blue channel 1B Perform Gaussian filtering, and the first single-channel image Image corresponding to the blue channel after filtering 1BG =GaussianFilter(Image 1B ).

[0114] Correspondingly, the second single-channel image Image corresponding to the red channel can be2R Perform Gaussian filtering, and the second single-channel image Image corresponding to the red channel after filtering 2RG =GaussianFilter(Image 2R ); You can also use the second single channel image Image corresponding to the green channel 2G Perform Gaussian filtering, and the second single-channel image Image corresponding to the green channel after filtering 2GG =GaussianFilter(Image 2G ); You can also use the second single channel image Image corresponding to the blue channel 2B Perform Gaussian filtering, and the second single-channel image Image corresponding to the blue channel after filtering 2BG =GaussianFilter(Image 2B ).

[0115] Step 306, correcting the grayscale value of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel after filtering, and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel after filtering, to obtain corrected images corresponding to the N color channels.

[0116] If the original image is split into first single-channel images corresponding to N color channels, and after filtering processing is performed on the first single-channel images corresponding to the N color channels, one of the color channels can be selected from the N color channels in turn as the target color channel, and the grayscale value distribution range of the first single-channel image corresponding to the target color channel after filtering processing can be obtained by statistically analyzing the grayscale values of each pixel point in the first single-channel image corresponding to the filtered target color channel.

[0117] Correspondingly, if the repaired image is split into second single-channel images corresponding to N color channels, and the second single-channel images corresponding to the N color channels are filtered, one of the N color channels can be selected as the target color channel in turn, and the grayscale value distribution range of the second single-channel image corresponding to the target color channel after filtering can be obtained by statistically analyzing the grayscale values of each pixel point in the second single-channel image corresponding to the target color channel after filtering.

[0118] Then, the grayscale value of the second single-channel image corresponding to the target color channel is corrected according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel after filtering, and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel after filtering, to obtain corrected images corresponding to the N color channels.

[0119] In some embodiments, a first single-channel image corresponding to the target color channel after filtering and a second single-channel image corresponding to the target color channel after filtering are obtained from N color channels in sequence; a first grayscale eigenvalue of the first single-channel image corresponding to the target color channel after filtering is obtained, and the first grayscale eigenvalue is within the grayscale value distribution interval of the first single-channel image corresponding to the target color channel after filtering; a second grayscale eigenvalue of the second single-channel image corresponding to the target color channel after filtering is obtained, and the second grayscale eigenvalue is within the grayscale value distribution interval of the second single-channel image corresponding to the target color channel after filtering; and the grayscale value of the second single-channel image corresponding to the target color channel is corrected according to the first grayscale eigenvalue and the second grayscale eigenvalue to obtain a corrected image corresponding to the target color channel.

[0120] Take N color channels as an example, which are red channel, green channel and blue channel respectively. The first single channel image Image corresponding to the red channel after filtering can be obtained 1RG The first grayscale eigenvalue and the first single-channel image Image corresponding to the green channel after filtering 1GG The first grayscale eigenvalue of , and the first single-channel image Image corresponding to the blue channel after filtering 1BG The first grayscale eigenvalue of ; Correspondingly, the second single-channel image Image corresponding to the red channel after filtering can also be obtained 2RG The second grayscale eigenvalue and the second single-channel image Image corresponding to the green channel after filtering 2GG The second grayscale eigenvalue of , and the second single-channel image Image corresponding to the blue channel after filtering 2BG The second grayscale characteristic value of .

[0121] In one feasible method, the first grayscale eigenvalue and the second grayscale eigenvalue can be obtained in the following manner: according to the grayscale value of each pixel point in the first single-channel image corresponding to the target color channel after filtering, the first grayscale eigenvalue of the first single-channel image corresponding to the target color channel after filtering is determined; according to the grayscale value of each pixel point in the second single-channel image corresponding to the target color channel after filtering, the second grayscale eigenvalue of the second single-channel image corresponding to the target color channel after filtering is determined.

[0122] Among them, the first grayscale eigenvalue includes any one of the average value, maximum value and minimum value of the grayscale value of each pixel point in the first single-channel image corresponding to the target color channel after filtering processing; the second grayscale eigenvalue includes any one of the average value, maximum value and minimum value of the grayscale value of each pixel point in the second single-channel image corresponding to the target color channel after filtering processing.

[0123] In one feasible manner, the grayscale value of the second single-channel image corresponding to the target color channel can be corrected based on the first grayscale eigenvalue and the second grayscale eigenvalue in the following manner: the difference between the first grayscale eigenvalue and the second grayscale eigenvalue is calculated to obtain the grayscale difference corresponding to the target color channel; the grayscale value of each pixel point in the second single-channel image corresponding to the target color channel is summed with the grayscale difference corresponding to the target color channel to obtain a corrected image corresponding to the target color channel.

[0124] For the target color channel, its corresponding grayscale difference is the color offset of the second single-channel image relative to the first single-channel image. Therefore, after calculating the grayscale difference corresponding to the target color channel, the grayscale difference corresponding to the target color channel can be added to the grayscale value of each pixel in the second single-channel image corresponding to the target color channel to obtain a corrected image corresponding to the target color channel, thereby correcting the color offset of the second single-channel image corresponding to the target color channel.

[0125] After the color shifts of the second single-channel images corresponding to the N color channels are corrected, the color and brightness of the repaired image can be restored.

[0126] For example, the N color channels are red, green, and blue, respectively, and the first grayscale eigenvalue is the minimum grayscale value of each pixel in a first single-channel image corresponding to the target color channel after filtering, and the second grayscale eigenvalue is the minimum grayscale value of each pixel in a second single-channel image corresponding to the target color channel after filtering. The target color channel can be any one of the red, green, and blue channels.

[0127] If the target color channel is the red channel, the first single-channel image Image corresponding to the red channel after filtering can be calculated 1RG The first grayscale eigenvalue MinGray(Image 1RG ), the second single-channel image Image corresponding to the red channel after filtering 2RG The second grayscale eigenvalue MinGray(Image 2RG ) to obtain the grayscale difference corresponding to the red channel; then, the second single-channel image Image corresponding to the red channel 2R The grayscale value of each pixel in the image is summed with the grayscale difference corresponding to the red channel to obtain the corrected image Image' corresponding to the red channel 2R =MinGray(Image 1RG )-MinGray(Image 2RG)+Image 2R .

[0128] If the target color channel is the green channel, the first single-channel image Image corresponding to the green channel after filtering can be calculated 1GG The first grayscale eigenvalue MinGray(Image 1GG ), the second single-channel image Image corresponding to the green channel after filtering 2GG The second grayscale eigenvalue MinGray(Image 2GG ) to obtain the grayscale difference corresponding to the green channel; then, the second single-channel image Image corresponding to the green channel 2G The grayscale value of each pixel in the image is summed with the grayscale difference corresponding to the green channel to obtain the corrected image Image' corresponding to the green channel 2G =MinGray(Image 1GG )-MinGray(Image 2GG )+Image 2G .

[0129] If the target color channel is the blue channel, the first single-channel image Image corresponding to the blue channel after filtering can be calculated 1BG The first grayscale eigenvalue MinGray(Image 1BG ), the second single-channel image Image corresponding to the blue channel after filtering 2BG The second grayscale eigenvalue MinGray(Image 2BG ) to obtain the grayscale difference corresponding to the blue channel; then, the second single-channel image Image corresponding to the blue channel 2B The grayscale value of each pixel in the image is summed with the grayscale difference corresponding to the blue channel to obtain the corrected image Image' corresponding to the blue channel 2B =MinGray(Image 1BG )-MinGray(Image 2BG )+Image 2B .

[0130] Step 307: fuse the corrected images corresponding to the N color channels to obtain a target image.

[0131] The specific implementation of this step is similar to that of step 106 and will not be described again here to avoid repetition.

[0132] Therefore, the present application can filter the first single-channel images corresponding to the N color channels obtained by splitting the original image, and the second single-channel images corresponding to the N color channels obtained by splitting the repaired image, thereby reducing the influence of noise on the first grayscale eigenvalue and the second grayscale eigenvalue calculated subsequently, making the calculated first grayscale eigenvalue and the second grayscale eigenvalue more accurate. Moreover, the difference between the first grayscale eigenvalue and the second grayscale eigenvalue is the color offset value of the second single-channel image relative to the first single-channel image. Therefore, based on the grayscale value of each pixel point in the second single-channel image corresponding to the target color channel, the grayscale difference corresponding to the target color channel is added, so that the color offset of the second single-channel image corresponding to the target color channel can be accurately corrected, thereby restoring the color and brightness of the repaired image to the greatest extent.

[0133] The image processing method according to the embodiment of the present application has been described above. The following describes the apparatus for performing the above-described image processing method provided in the embodiment of the present application. Those skilled in the art will appreciate that the method and apparatus may be combined and referenced with each other, and the image processing apparatus provided in the embodiment of the present application may perform the steps of the above-described image processing method.

[0134] Reference Figure 4 As shown, in the second aspect, an embodiment of the present application provides a structural block diagram of an image processing device. The image processing device includes: an original image acquisition module 401, a first channel splitting module 402, a restoration processing module 403, a second channel splitting module 404, an image correction module 405 and an image fusion module 406.

[0135] Among them, the original image acquisition module 401 is used to acquire the original image; the first channel splitting module 402 is used to split the original image into first single-channel images corresponding to N color channels, where N is an integer greater than 1; the repair processing module 403 is used to perform repair processing on the original image to obtain a repaired image; the second channel splitting module 404 is used to split the repaired image into second single-channel images corresponding to N color channels; the image correction module 405 is used to correct the grayscale value of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel, to obtain corrected images corresponding to N color channels, where the target color channel is any color channel among the N color channels; the image fusion module 406 is used to fuse the corrected images corresponding to the N color channels to obtain the target image.

[0136] In one achievable embodiment, the image correction module 405 includes: a single-channel image acquisition submodule, a first grayscale eigenvalue acquisition submodule, a second grayscale eigenvalue acquisition submodule, and a first image correction submodule. The single-channel image acquisition submodule is configured to sequentially acquire a first single-channel image corresponding to a target color channel and a second single-channel image corresponding to the target color channel from N color channels; the first grayscale eigenvalue acquisition submodule is configured to acquire a first grayscale eigenvalue of the first single-channel image corresponding to the target color channel, the first grayscale eigenvalue being within a grayscale value distribution interval of the first single-channel image corresponding to the target color channel; the second grayscale eigenvalue acquisition submodule is configured to acquire a second grayscale eigenvalue of the second single-channel image corresponding to the target color channel, the second grayscale eigenvalue being within a grayscale value distribution interval of the second single-channel image corresponding to the target color channel; and the first image correction submodule is configured to correct the grayscale value of the second single-channel image corresponding to the target color channel based on the first grayscale eigenvalue and the second grayscale eigenvalue to obtain a corrected image corresponding to the target color channel.

[0137] In one achievable embodiment, the first grayscale eigenvalue acquisition submodule includes: a first grayscale eigenvalue determination unit for determining a first grayscale eigenvalue of the first single-channel image corresponding to the target color channel based on the grayscale values of each pixel in the first single-channel image corresponding to the target color channel; and a second grayscale eigenvalue acquisition submodule includes: a second grayscale eigenvalue determination unit for determining a second grayscale eigenvalue of the second single-channel image corresponding to the target color channel based on the grayscale values of each pixel in the second single-channel image corresponding to the target color channel. The first grayscale eigenvalue includes any one of an average value, a maximum value, and a minimum value of the grayscale values of each pixel in the first single-channel image corresponding to the target color channel; and the second grayscale eigenvalue includes any one of an average value, a maximum value, and a minimum value of the grayscale values of each pixel in the second single-channel image corresponding to the target color channel.

[0138] In an optional embodiment, the first image correction submodule includes: a grayscale difference calculation unit and an image correction unit. The grayscale difference calculation unit is configured to calculate the difference between the first grayscale eigenvalue and the second grayscale eigenvalue to obtain the grayscale difference corresponding to the target color channel; and the image correction unit is configured to sum the grayscale value of each pixel in the second single-channel image corresponding to the target color channel with the grayscale difference corresponding to the target color channel to obtain a corrected image corresponding to the target color channel.

[0139] In an optional embodiment, the image processing device further includes a filtering processing module, which is configured to perform filtering processing on the first single-channel images corresponding to the N color channels and the second single-channel images corresponding to the N color channels. The image correction module 405 includes a second image correction submodule, which is configured to correct the grayscale value of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel after filtering processing and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel after filtering processing, to obtain corrected images corresponding to the N color channels.

[0140] In an optional embodiment, the restoration processing module 403 includes a restoration processing submodule, which is configured to perform restoration processing on the original image using an image processing model to obtain a restored image. The image processing model is trained based on a combination of multiple sample images, where the sample image combination includes a sample standard image and a sample image to be restored.

[0141] In an optional implementation, the original image acquisition module 401 includes an original image acquisition submodule, which is used to capture the original image through an under-screen camera provided on the electronic device.

[0142] The image processing device may be an electronic device such as a mobile phone, a desktop computer, a laptop computer, or a tablet computer.

[0143] The image processing device of the embodiment of the present application can be used to execute the steps executed in the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here. In addition, each module in the above image processing device can be implemented in whole or in part by software, hardware, firmware or any combination thereof. The above modules can be embedded in or independent of the processor of the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0144] Reference Figure 5 As shown, in the third aspect, an embodiment of the present application provides an electronic device 500, which may include: a memory 501, a processor 502 and a communication interface 503, wherein the memory 501, the processor 502 and the communication interface 503 can communicate; exemplarily, the memory 501, the processor 502 and the communication interface 503 can communicate through a communication bus.

[0145] The memory 501 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 501 may store computer programs, which are controlled and executed by the processor 502 and communicated with by the communication interface 503, thereby implementing the image processing method provided in the above-mentioned embodiments of the present application.

[0146] In some embodiments, the electronic device 500 further includes a display screen and an under-screen camera, and can capture original images based on the under-screen camera on the electronic device 500. In other words, the electronic device 500 can be an electronic device with an under-screen camera, and the display screen can be an organic light-emitting diode (OLED) display screen.

[0147] In other embodiments, the electronic device 500 may not include an under-screen camera. Another electronic device with an under-screen camera can capture an original image and send the original image to the electronic device 500. The electronic device 500 processes the original image using the image processing method in the above process to obtain a target image.

[0148] In a fourth aspect, embodiments of the present application further provide a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.

[0149] In one possible implementation, computer-readable media may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium designed to carry or store the desired program code in the form of instructions or data structures and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include optical disc, laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks typically reproduce data magnetically, while optical discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0150] In the description of the embodiments of this application, it should be noted that, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to a fixed connection, an indirect connection via an intermediate medium, internal communication between two components, or an interaction between two components. Those skilled in the art will understand the specific meanings of the above terms in this application based on the specific circumstances.

[0151] In the description of the embodiments of the present application, it should be understood that the terms "upper", "lower", "front", "back", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are only for the convenience of describing the present application and simplifying the description. They do not indicate or imply that the devices or elements referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore should not be understood as limiting the present application. In the description of the present application, "plurality" means two or more, unless otherwise specified.

[0152] The terms "first," "second," "third," "fourth," etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential sequence. It should be understood that the numbers used in this way are interchangeable where appropriate so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or apparatus.

[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. An image processing method, characterized in that: include; Get the original image; Splitting the original image into first single-channel images corresponding to N color channels, wherein N is an integer greater than 1; Performing restoration processing on the original image to eliminate diffraction fringes in the original image to obtain a restored image; Splitting the restored image into second single-channel images corresponding to N color channels; Correcting the grayscale values of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel, to obtain corrected images corresponding to the N color channels respectively; the target color channel is any color channel among the N color channels; The corrected images corresponding to the N color channels are fused to obtain a target image.

2. The method according to claim 1, characterized in that The method of correcting the grayscale value of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel to obtain the corrected images corresponding to the N color channels respectively includes: Sequentially acquiring a first single-channel image corresponding to the target color channel and a second single-channel image corresponding to the target color channel from the N color channels; Obtaining a first grayscale eigenvalue of a first single-channel image corresponding to the target color channel; wherein the first grayscale eigenvalue is within a grayscale value distribution interval of the first single-channel image corresponding to the target color channel; Obtaining a second grayscale eigenvalue of a second single-channel image corresponding to the target color channel; wherein the second grayscale eigenvalue is within a grayscale value distribution interval of the second single-channel image corresponding to the target color channel; The grayscale value of the second single-channel image corresponding to the target color channel is corrected according to the first grayscale eigenvalue and the second grayscale eigenvalue to obtain a corrected image corresponding to the target color channel.

3. The method according to claim 2, characterized in that The obtaining of a first grayscale characteristic value of a first single-channel image corresponding to the target color channel includes: Determining a first grayscale characteristic value of the first single-channel image corresponding to the target color channel according to the grayscale value of each pixel in the first single-channel image corresponding to the target color channel; The obtaining of a second grayscale characteristic value of a second single-channel image corresponding to the target color channel includes: A second grayscale characteristic value of the second single-channel image corresponding to the target color channel is determined according to the grayscale value of each pixel in the second single-channel image corresponding to the target color channel.

4. The method according to claim 3, characterized in that The first grayscale eigenvalue includes the average value of the grayscale values of each pixel in the first single-channel image corresponding to the target color channel; the second grayscale eigenvalue includes the average value of the grayscale values of each pixel in the second single-channel image corresponding to the target color channel; or, the first grayscale eigenvalue includes the maximum value of the grayscale values of each pixel in the first single-channel image corresponding to the target color channel; the second grayscale eigenvalue includes the maximum value of the grayscale values of each pixel in the second single-channel image corresponding to the target color channel; or, the first grayscale eigenvalue includes the minimum value of the grayscale values of each pixel in the first single-channel image corresponding to the target color channel; The second grayscale characteristic value includes the minimum grayscale value of each pixel in the second single-channel image corresponding to the target color channel.

5. The method according to claim 2, characterized in that Correcting the grayscale value of the second single-channel image corresponding to the target color channel according to the first grayscale eigenvalue and the second grayscale eigenvalue to obtain a corrected image corresponding to the target color channel includes: Calculating a difference between the first grayscale eigenvalue and the second grayscale eigenvalue to obtain a grayscale difference corresponding to the target color channel; The grayscale value of each pixel in the second single-channel image corresponding to the target color channel is summed with the grayscale difference value corresponding to the target color channel to obtain a corrected image corresponding to the target color channel.

6. The method according to claim 1, characterized in that Before correcting the grayscale value of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel, and obtaining the corrected images corresponding to the N color channels respectively, the method further includes: Performing filtering processing on the first single-channel images corresponding to the N color channels and the second single-channel images corresponding to the N color channels; The method of correcting the grayscale value of the second single-channel image corresponding to the target color channel according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel to obtain the corrected images corresponding to the N color channels respectively includes: The grayscale value of the second single-channel image corresponding to the target color channel is corrected according to the grayscale value distribution interval of the first single-channel image corresponding to the target color channel after filtering, and the grayscale value distribution interval of the second single-channel image corresponding to the target color channel after filtering, to obtain the corrected images corresponding to the N color channels respectively.

7. The method according to claim 1, characterized in that The repairing process of the original image to obtain the repaired image includes: Performing restoration processing on the original image using an image processing model to obtain a restored image; The image processing model is trained based on a combination of multiple sample images, and the sample image combination includes a sample standard image and a sample image to be repaired.

8. The method according to claim 1, characterized in that The obtaining of the original image comprises: The original image is captured by an under-screen camera provided on the electronic device.

9. An image processing device, characterized in that: include: An original image acquisition module, used for acquiring the original image; A first channel splitting module is used to split the original image into first single-channel images corresponding to N color channels; Said N is an integer greater than 1; A repair processing module, used to perform repair processing on the original image to eliminate diffraction fringes in the original image and obtain a repaired image; A second channel splitting module is used to split the repaired image into second single-channel images corresponding to N color channels; an image correction module, configured to correct the grayscale values of the second single-channel image corresponding to the target color channel according to a grayscale value distribution interval of the first single-channel image corresponding to the target color channel and a grayscale value distribution interval of the second single-channel image corresponding to the target color channel, to obtain corrected images corresponding to the N color channels, respectively; the target color channel being any color channel among the N color channels; The image fusion module is used to fuse the corrected images corresponding to the N color channels to obtain a target image.

10. An electronic device, characterized in that: The system comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call the computer program to execute the image processing method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program or instruction, and when the computer program or instruction is executed, the image processing method according to any one of claims 1 to 8 is implemented.

12. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, it is used to implement the image processing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Image processing method, storage medium and electronic device

    CN113287291A

  • Brightness compensation method and device, storage medium and electronic equipment

    CN114283732A