Image processing method and electronic device

By migrating the information of the normal exposure image into the short exposure image under the stroboscopic light source environment, and using the statistically matched LSC gain for processing, the stripe and color cast problems in the image are solved, the image quality is improved, and the color cast is avoided. Over correction.

WO2024174625A1PCT designated stage expired Publication Date: 2024-08-29HONOR DEVICE CO LTD

Patent Information

Application Number
PCT/CN2023/133529
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-24
Filing Date
2023-11-23
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

In a stroboscopic light source environment, it is difficult for electronic equipment to effectively remove stripes and color casts in images when shooting moving objects, resulting in poor image quality, and conventional LSC processing can easily cause excessive color correction.

Method used

By migrating the color information and brightness information of the normal exposure image to the short exposure image, LSC processing is performed based on the LSC gain information obtained from the statistical information to ensure that the color information and brightness information match during the image processing process and avoid excessive color correction.

Benefits of technology

Effectively remove stripes and color cast areas in images, improve image quality, avoid the problem of excessive color correction, and ensure that the image quality is optimized when shooting at moving moments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023133529_29082024_PF_FP_ABST
    Figure CN2023133529_29082024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the field of images, and provides an image processing method and an electronic device. The image processing method comprises: starting a camera application; displaying a first image, the first image comprising banding and / or a color cast image region; detecting a first operation; acquiring a second image in response to the first operation; obtaining a color conversion matrix and / or brightness parameter on the basis of the first image and the second image; performing first image processing on the first image on the basis of the color conversion matrix and / or the brightness parameter, to obtain a third image, the third image being an image from which the banding and / or the color cast image region is removed; acquiring a first parameter on the basis of brightness information of the second image; performing lens shading correction processing on the third image on the basis of the first parameter, to obtain a fourth image; displaying or saving the fourth image. On the basis of a solution of the present application, banding and / or local color cast in an image can be removed when photographing a moving object, and the problem of excessive color correction in the image can be avoided, improving image quality.
Need to check novelty before this filing date? Find Prior Art

Description

Image processing method and electronic device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 24, 2023, with application number 202310207723.8 and application name “Image Processing Method and Electronic Device,” the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present application relates to the field of images, and in particular, to an image processing method and electronic device. Background Art

[0003] With the development of imaging technology in electronic devices, users have increasingly higher requirements for shooting functions. For example, when shooting a moving object, users generally expect the electronic device to capture an image of the moving object at the moment of motion. Because the subject is in motion, the electronic device generally needs to reduce motion blur in the image. To reduce motion blur in the image, the electronic device can generally shorten the exposure time and increase the sensitivity value. In shooting scenes with a stroboscopic light source (for example, a 50Hz AC light source), shortening the exposure time will cause the exposure time to not meet an integer multiple of 10ms, so banding will appear in the image captured by the electronic device. For example, the banding phenomenon includes the appearance of light and dark stripes in the image, or color cast in local image areas, resulting in poor image quality.

[0004] Therefore, when shooting moving objects, how to improve image quality becomes an urgent problem to be solved.

[0005] Summary of the Invention

[0006] The present application provides an image processing method and electronic device that can ensure that when capturing images of moving objects at the moment of motion, stripes and / or color cast image areas in the image are removed; and the problem of excessive color correction in the image is avoided, thereby improving image quality.

[0007] In a first aspect, an image processing method is provided, which is applied to an electronic device, wherein the light source of a shooting environment in which the electronic device is located is a stroboscopic light source, and the image processing method includes:

[0008] Open the Camera app;

[0009] displaying a first image, where the first image is an image of a photographic object captured based on a first exposure time, the photographic object is a moving object, the first exposure time is less than a first duration, and the first image includes stripes and / or color cast image areas;

[0010] detecting a first operation, wherein the first operation instructs the electronic device to take a photo or record a video;

[0011] In response to the first operation, acquiring a second image, where the second image is an image of the subject captured based on a second exposure time, where the second exposure time is an integer multiple of the first exposure time;

[0012] Based on the first image and the second image, a color conversion matrix and / or a brightness parameter are obtained, wherein the color conversion matrix is ​​used to perform color adjustment on the first image, and the brightness parameter is used to represent a grayscale of brightness;

[0013] performing a first image processing on the first image based on the color conversion matrix and / or the brightness parameter to obtain a third image, wherein the third image is an image in which the stripes and / or the color cast image area are removed;

[0014] acquiring a first parameter based on brightness information of the second image, where the first parameter is used for lens shading correction processing;

[0015] performing the lens shading correction process on the third image based on the first parameter to obtain a fourth image;

[0016] The fourth image is displayed or saved.

[0017] In an embodiment of the present application, when the light source of the shooting environment in which the electronic device is located is a stroboscopic light source, and the electronic device needs to shoot a moving object so as to reduce the exposure time, resulting in banding stripes in the image; in an embodiment of the present application, by migrating the color information and brightness information of the second image (for example, the normal exposure image) to the first image (for example, the short exposure image), a third image is obtained by removing the stripes and / or the color cast image area in the first image; if the LSC gain information of the short exposure image is used to perform LSC processing on the third image, since the LSC gain information does not match the color information and brightness information in the third image, the third image after LSC processing is obtained. The problem of excessive color correction will appear in the fourth image after LSC processing; in an embodiment of the present application, the LSC gain information of each frame of exposure image can be obtained based on statistical information. Therefore, when LSC processing is performed on the third image, the third image can be LSC processed according to the LSC gain information of the second image, so that the LSC gain information matches the third image, thereby avoiding the problem of excessive color correction in the fourth image after LSC processing; in summary, through the embodiments of the present application, it is possible to ensure that when capturing the image of the motion moment of a moving subject, the stripes and / or color cast image areas in the image are removed; and the problem of excessive color correction in the image is avoided, thereby improving image quality. In combination with the first aspect, in certain implementations of the first aspect, the brightness information of the second image includes: data of the brightness channel of the second image, or the brightness value of the pixel point of the second image.

[0018] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes:

[0019] The first image and the second image are input into an image processing model to obtain bilateral grid data; wherein the bilateral grid data includes the color conversion matrix and / or the brightness parameter, and the size of the first image is the same as the size of the second image.

[0020] In an embodiment of the present application, a bilateral grid for migrating the color and brightness of an image frame obtained with a normal exposure time or a long exposure time to an image frame with a short exposure time can be obtained through an image processing model; in a shooting scene with a stroboscopic light source having an alternating current of 50 Hz, since the normal exposure time or the long exposure time is an integer multiple of 10 ms, there are usually no image stripes or color cast image areas in the long exposure image and the normal exposure image; a color conversion matrix and / or brightness parameters are obtained based on the bilateral grid output by the image processing model; when the color and brightness migration are performed on the first image through the image processing model, the difference in image content between the first image and the second image can be identified; therefore, the color conversion matrix and / or brightness parameters obtained through the image processing model will not introduce ghost areas when the color and / or brightness adjustment is performed on the first image, thereby improving image quality.

[0021] In combination with the first aspect, in some implementations of the first aspect, performing first image processing on the first image based on the color conversion matrix and / or brightness parameter to obtain a third image includes:

[0022] The first image is interpolated based on the color conversion matrix and / or the brightness parameter to obtain the third image.

[0023] In a possible implementation, the third image is obtained by multiplying the color conversion matrix and / or the brightness parameter with the matrix of the first image.

[0024] In combination with the first aspect, in some implementations of the first aspect, performing interpolation processing on the first image based on the color conversion matrix and / or brightness parameter to obtain the third image includes:

[0025] performing the first image processing on the first image based on the color conversion matrix and / or the brightness parameter in a first color space to obtain a processed image;

[0026] In the first color space, a second image processing is performed on the processed image to obtain the third image, where the second image processing is a color processing algorithm in the first color space.

[0027] In an embodiment of the present application, in the process of the image signal processor processing the Raw image captured by the electronic device, when executing the algorithm of the first color space, the first image processing based on the color conversion matrix and / or brightness parameter can be performed on the first image first, and then other algorithms of the first color space can be executed; because the first image processing can obtain an image with banding stripes and / or color cast image areas removed; in other words, the first image processing can correct the color and brightness of the image; when the accuracy of color and brightness is high, executing other algorithms of the first color space can ensure that the image with banding stripes and / or color cast image areas removed is processed by other algorithms of the first color space on the basis of high accuracy of color and brightness of the image, thereby improving image quality.

[0028] In combination with the first aspect, in some implementations of the first aspect, the lens shading correction processing includes color shading correction and brightness shading correction, and the obtaining the first parameter based on the brightness information of the second image includes:

[0029] Obtaining lens shading correction calibration parameters based on brightness information of the second image;

[0030] multiplying the lens shading correction calibration parameter by the pixel points in the second image to obtain a processed second image;

[0031] obtaining a second parameter based on statistical information of the processed second image, where the statistical information of the second image includes a brightness histogram of the processed second image or a brightness gradient map of the processed second image, and the second parameter is used for the color shading correction;

[0032] The lens shading correction calibration parameter is multiplied by the second parameter to obtain the first parameter, where the first parameter is used for the color shading correction and the brightness shading correction.

[0033] In conjunction with the first aspect, in certain implementations of the first aspect, before acquiring the second image, the method further includes:

[0034] detecting a shooting scene in which the electronic device is located, and detecting the moving object;

[0035] Furthermore, it is detected that the stripes and / or color cast image areas exist in the first image.

[0036] In combination with the first aspect, in certain implementations of the first aspect, the first duration is obtained based on the number of times the stroboscopic light source flashes on and off per second.

[0037] In combination with the first aspect, in certain implementations of the first aspect, the first duration=1000 / number of times the stroboscopic light source switches on and off per second.

[0038] In a possible implementation, the number of times the stroboscopic light source switches on and off per second is associated with the frequency of an operating voltage of the stroboscopic light source.

[0039] In one possible implementation, the frequency of the operating voltage of the stroboscopic light source is 50 Hz, that is, the stroboscopic light source switches on and off 100 times per second, and the first duration is 10 ms; at this time, the exposure time of the first image is less than 10 ms, and the exposure time of the second image is an integer multiple of 10 ms.

[0040] In one possible implementation, the frequency of the operating voltage of the stroboscopic light source is 60 Hz, that is, the stroboscopic light source switches on and off 120 times per second, and the first duration is 8.3 ms; at this time, the exposure time of the first image is less than 8.3 ms, and the exposure time of the second image is an integer multiple of 8.3 ms.

[0041] In combination with the first aspect, in some implementations of the first aspect, the image processing model is a convolutional neural network.

[0042] In conjunction with the first aspect, in certain implementations of the first aspect, the image processing model is trained by the following method:

[0043] Acquiring sample data, the sample data including a first sample image, a second sample image, and a third sample image, wherein the second sample image includes image content, stripes, and / or color cast image areas of the first sample image, the third sample image has the same image content as the first sample image, and image quality of the third sample image is higher than that of the first sample image;

[0044] Inputting the first sample image and the second sample image into an image processing model to be trained to obtain predicted bilateral grid data;

[0045] performing interpolation processing on the second sample image based on the predicted bilateral grid data to obtain a predicted image;

[0046] The image processing model to be trained is trained based on the difference between the predicted image and the third sample image to obtain the image processing model.

[0047] In a possible implementation manner, the electronic device includes an image signal processor, and the first image is an image output by the image signal processor.

[0048] In a possible implementation, the second image is an image obtained by performing a third image processing on a Raw image captured by the electronic device, where the third image processing includes a color space conversion process.

[0049] In a second aspect, an image processing method is provided, which is applied to an electronic device, wherein the light source of a shooting environment in which the electronic device is located is a stroboscopic light source, and the image processing method includes:

[0050] Open the Camera app;

[0051] displaying a first image, where the first image is an image of a photographic object captured based on a first exposure time, the photographic object is a moving object, the first exposure time is less than a first duration, and the first image includes stripes and / or color cast image areas;

[0052] detecting a first operation, wherein the first operation instructs the electronic device to take a photo or record a video;

[0053] In response to the first operation, acquiring a second image, where the second image is an image of the subject captured based on a second exposure time, where the second exposure time is an integer multiple of the first exposure time;

[0054] acquiring a first parameter based on brightness information of the second image, where the first parameter is used for lens shading correction processing;

[0055] performing the lens shading correction process on the second image based on the first parameters to obtain a fifth image;

[0056] obtaining a color conversion matrix and / or a brightness parameter based on the first image and the fifth image, wherein the color conversion matrix is ​​used to perform color adjustment on the first image, and the brightness parameter is used to represent a grayscale of brightness;

[0057] performing a first image processing on the first image based on the color conversion matrix and / or the brightness parameter to obtain a fourth image, wherein the fourth image is an image in which the stripes and / or the color cast image area are removed;

[0058] The fourth image is displayed or saved.

[0059] In an embodiment of the present application, if LSC gain information of a first image (e.g., a short-exposure image) is used to perform LSC processing on a second image (e.g., a normal-exposure image), the LSC gain information of the short-exposure image does not match the color information and brightness information in the normal-exposure image, resulting in a problem of excessive color correction in the image after the LSC processing of the normal-exposure image. In an embodiment of the present application, the LSC gain information (e.g., a first parameter) of the normal-exposure image can be obtained based on the brightness statistical information of the second image. Therefore, when performing LSC processing on the second image, the first parameter can be used to perform LSC processing on the second image so that the LSC gain information matches the second image. , avoiding the problem of excessive color correction in the image after LSC processing; in addition, since there are no light and dark stripes and local color cast problems in the fifth image; by migrating the color information and brightness information of the fifth image to the first image, the light and dark stripes and local color cast problems in the first image are removed, and the fourth image is obtained; it can be understood that the fourth image includes the image content information of the first image and the color information and brightness information of the fifth image; in summary, through the embodiments of the present application, it is possible to ensure that when capturing the motion moment image of a moving subject, the stripes and / or color cast image areas in the image are removed; and the problem of excessive color correction in the image is avoided, thereby improving the image quality.

[0060] In combination with the second aspect, in some implementations of the second aspect, the brightness information of the second image includes: data of a brightness channel of the second image, or brightness values ​​of pixels of the second image.

[0061] In combination with the second aspect, in certain implementations of the second aspect, the first image is an image after the lens shading correction processing is performed based on the first parameters.

[0062] In a possible implementation, the first image is an image obtained by performing image processing on a short-exposure Raw image captured by the electronic device, where the image processing includes performing lens shading correction processing based on the first parameter.

[0063] In conjunction with the second aspect, in some implementations of the second aspect, the method further includes:

[0064] The first image and the fifth image are input into an image processing model to obtain bilateral grid data; wherein the bilateral grid data includes the color conversion matrix and / or the brightness parameter, and the size of the first image is the same as the size of the fifth image.

[0065] In an embodiment of the present application, a bilateral grid for migrating the color and brightness of an image frame obtained with a normal exposure time or a long exposure time to an image frame with a short exposure time can be obtained through an image processing model; in a shooting scene with a stroboscopic light source having an alternating current of 50 Hz, since the normal exposure time or the long exposure time is an integer multiple of 10 ms, there are usually no image stripes or color cast image areas in the long exposure image and the normal exposure image; a color conversion matrix and / or brightness parameters are obtained based on the bilateral grid output by the image processing model; when the color and brightness migration are performed on the first image through the image processing model, the difference in image content between the first image and the fifth image can be identified; therefore, the color conversion matrix and / or brightness parameters obtained through the image processing model will not introduce ghost areas when the color and / or brightness adjustment are performed on the first image, thereby improving image quality.

[0066] In combination with the second aspect, in some implementations of the second aspect, performing first image processing on the first image based on the color conversion matrix and / or brightness parameter to obtain a fourth image includes:

[0067] The first image is interpolated based on the color conversion matrix and / or the brightness parameter to obtain the fourth image.

[0068] In combination with the second aspect, in some implementations of the second aspect, performing interpolation processing on the first image based on the color conversion matrix and / or brightness parameter to obtain the fourth image includes:

[0069] performing the first image processing on the first image based on the color conversion matrix and / or the brightness parameter in a first color space to obtain a processed image;

[0070] In the first color space, a second image processing is performed on the processed image to obtain the fourth image, where the second image processing is a color processing algorithm in the first color space.

[0071] In conjunction with the second aspect, in certain implementations of the second aspect, the lens shading correction processing includes color shading correction and brightness shading correction, and obtaining the first parameter based on brightness information of the second image includes:

[0072] Obtaining lens shading correction calibration parameters based on brightness information of the second image;

[0073] multiplying the lens shading correction calibration parameter by the pixel points in the second image to obtain a processed second image;

[0074] obtaining a second parameter based on statistical information of the processed second image, where the statistical information of the second image includes a brightness histogram of the processed second image or a brightness gradient map of the processed second image, and the second parameter is used for the color shading correction;

[0075] The lens shading correction calibration parameter is multiplied by the second parameter to obtain the first parameter, where the first parameter is used for the color shading correction and the brightness shading correction.

[0076] In conjunction with the second aspect, in certain implementations of the second aspect, before acquiring the second image, the method further includes:

[0077] detecting a shooting scene in which the electronic device is located, and detecting the moving object;

[0078] Furthermore, it is detected that the stripes and / or color cast image areas exist in the first image.

[0079] In combination with the second aspect, in certain implementations of the second aspect, the first duration is obtained based on the number of times the stroboscopic light source flashes on and off per second.

[0080] In combination with the second aspect, in certain implementations of the second aspect, the first duration=1000 / number of times the stroboscopic light source switches on and off per second.

[0081] In a possible implementation, the number of times the stroboscopic light source switches on and off per second is associated with the frequency of an operating voltage of the stroboscopic light source.

[0082] In combination with the second aspect, in some implementations of the second aspect, the image processing model is a convolutional neural network.

[0083] In conjunction with the second aspect, in certain implementations of the second aspect, the image processing model is trained by the following method:

[0084] Acquiring sample data, the sample data including a first sample image, a second sample image, and a third sample image, wherein the second sample image includes image content, stripes, and / or color cast image areas of the first sample image, the third sample image has the same image content as the first sample image, and image quality of the third sample image is higher than that of the first sample image;

[0085] Inputting the first sample image and the second sample image into an image processing model to be trained to obtain predicted bilateral grid data;

[0086] performing interpolation processing on the second sample image based on the predicted bilateral grid data to obtain a predicted image;

[0087] The image processing model to be trained is trained based on the difference between the predicted image and the third sample image to obtain the image processing model.

[0088] In a possible implementation manner, the electronic device includes an image signal processor, and the first image is an image output by the image signal processor.

[0089] In a possible implementation, the second image is an image obtained by performing a third image processing on a Raw image captured by the electronic device, where the third image processing includes a color space conversion process.

[0090] In a third aspect, an electronic device is provided. The electronic device includes one or more processors and a memory. The memory is coupled to the one or more processors, and the memory is used to store computer program code. The computer program code includes computer instructions. The one or more processors invoke the computer instructions to cause the electronic device to execute:

[0091] Open the Camera app;

[0092] displaying a first image, where the first image is an image of a photographic object captured based on a first exposure time, the photographic object is a moving object, the first exposure time is less than a first duration, and the first image includes stripes and / or color cast image areas;

[0093] detecting a first operation, wherein the first operation instructs the electronic device to take a photo or record a video;

[0094] In response to the first operation, acquiring a second image, where the second image is an image of the subject captured based on a second exposure time, where the second exposure time is an integer multiple of the first exposure time;

[0095] Based on the first image and the second image, a color conversion matrix and / or a brightness parameter are obtained, wherein the color conversion matrix is ​​used to perform color adjustment on the first image, and the brightness parameter is used to represent a grayscale of brightness;

[0096] performing a first image processing on the first image based on the color conversion matrix and / or the brightness parameter to obtain a third image, wherein the third image is an image in which the stripes and / or the color cast image area are removed;

[0097] acquiring a first parameter based on brightness information of the second image, where the first parameter is used for lens shading correction processing;

[0098] performing the lens shading correction process on the third image based on the first parameter to obtain a fourth image;

[0099] The fourth image is displayed or saved.

[0100] Optionally, one or more processors call computer instructions to enable the electronic device to execute the image processing method in any one of the implementations of the first aspect.

[0101] In a fourth aspect, an electronic device is provided. The electronic device includes one or more processors and a memory. The memory is coupled to the one or more processors, and the memory is used to store computer program code. The computer program code includes computer instructions. The one or more processors invoke the computer instructions to cause the electronic device to execute:

[0102] Open the Camera app;

[0103] displaying a first image, where the first image is an image of a photographic object captured based on a first exposure time, the photographic object is a moving object, the first exposure time is less than a first duration, and the first image includes stripes and / or color cast image areas;

[0104] detecting a first operation, wherein the first operation instructs the electronic device to take a photo or record a video;

[0105] In response to the first operation, acquiring a second image, where the second image is an image of the subject captured based on a second exposure time, where the second exposure time is an integer multiple of the first exposure time;

[0106] acquiring a first parameter based on brightness information of the second image, where the first parameter is used for lens shading correction processing;

[0107] performing the lens shading correction process on the second image based on the first parameters to obtain a fifth image;

[0108] obtaining a color conversion matrix and / or a brightness parameter based on the first image and the fifth image, wherein the color conversion matrix is ​​used to perform color adjustment on the first image, and the brightness parameter is used to represent a grayscale of brightness;

[0109] performing a first image processing on the first image based on the color conversion matrix and / or the brightness parameter to obtain a fourth image, wherein the fourth image is an image in which the stripes and / or the color cast image area are removed;

[0110] The fourth image is displayed or saved.

[0111] Optionally, one or more processors call computer instructions to enable the electronic device to execute the image processing method in any one of the implementations of the second aspect.

[0112] In a fifth aspect, an electronic device is provided, comprising a module / unit for executing the image processing method in the first aspect or any one of the implementations of the first aspect.

[0113] In a sixth aspect, an electronic device is provided, comprising a module / unit for executing the image processing method in the second aspect or any one of the implementations of the second aspect.

[0114] In the seventh aspect, an electronic device is provided, comprising one or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code comprising computer instructions, and the one or more processors calling the computer instructions to enable the electronic device to execute the image processing method in any aspect (for example, the first aspect or the second aspect) or any implementation of any aspect.

[0115] In an eighth aspect, a chip system is provided, which is applied to an electronic device, and the chip system includes one or more processors, and the processor is used to call computer instructions to enable the electronic device to execute any aspect or any one of the image processing methods in any aspect.

[0116] In the ninth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program code. When the computer program code is executed by an electronic device, the electronic device executes the image processing method in any aspect or any implementation of any aspect.

[0117] In a tenth aspect, a computer program product is provided, comprising: a computer program code, which, when executed by an electronic device, enables the electronic device to execute the image processing method in any aspect or any implementation of any aspect.

[0118] In an embodiment of the present application, when the light source of the shooting environment in which the electronic device is located is a stroboscopic light source, and the electronic device needs to shoot a moving object so as to reduce the exposure time, resulting in banding stripes in the image; in an embodiment of the present application, by migrating the color information and brightness information of the second image (for example, the normal exposure image) to the first image (for example, the short exposure image), a third image is obtained by removing the stripes and / or the color cast image area in the first image; if the LSC gain information of the short exposure image is used to perform LSC processing on the third image, since the LSC gain information does not match the color information and brightness information in the third image, the third image after LSC processing is obtained. The problem of excessive color correction will appear in the fourth image after LSC processing; in the embodiment of the present application, the LSC gain information of each frame of exposure image can be obtained based on statistical information. Therefore, when LSC processing is performed on the third image, LSC processing can be performed on the third image according to the LSC gain information of the second image, so that the LSC gain information matches the third image, thereby avoiding the problem of excessive color correction in the fourth image after LSC processing; in summary, through the embodiments of the present application, it is possible to ensure that when capturing the motion moment image of the moving subject, the stripes and / or color cast image areas in the image are removed; and the problem of excessive color correction in the image is avoided, thereby improving the image quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0119] FIG1 provides a schematic diagram of lens shading correction;

[0120] FIG2 is a schematic diagram of a hardware system of an electronic device applicable to the present application;

[0121] FIG3 is a schematic diagram of a software system of an electronic device applicable to the present application;

[0122] FIG4 is a schematic diagram of an application scenario applicable to an embodiment of the present application;

[0123] FIG5 is a schematic diagram of a graphical user interface applicable to an embodiment of the present application;

[0124] FIG6 is a schematic diagram of gain information processed by LSC according to an embodiment of the present application;

[0125] FIG7 is a schematic flowchart of an image signal processor processing method provided by an embodiment of the present application;

[0126] FIG8 is a schematic flow chart of an image processing method provided in an embodiment of the present application;

[0127] FIG9 is a schematic diagram of gain information of an LSC process provided by an embodiment of the present application;

[0128] FIG10 is a schematic flow chart of another image processing method provided in an embodiment of the present application;

[0129] FIG11 is a schematic flow chart of another image processing method provided in an embodiment of the present application;

[0130] FIG12 is a schematic flow chart of another image processing method provided in an embodiment of the present application;

[0131] FIG13 is a schematic diagram of a graphical user interface applicable to an embodiment of the present application;

[0132] FIG14 is a schematic diagram of a graphical user interface applicable to an embodiment of the present application;

[0133] FIG15 is a schematic diagram of a graphical user interface applicable to an embodiment of the present application;

[0134] FIG16 is a schematic diagram of a graphical user interface applicable to an embodiment of the present application;

[0135] FIG17 is a schematic diagram of a graphical user interface applicable to an embodiment of the present application;

[0136] FIG18 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;

[0137] FIG19 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0138] In the embodiments of this application, the terms "first," "second," and the like are used for descriptive purposes only and should not be understood to indicate or imply relative importance or to implicitly indicate the number of the technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0139] In order to facilitate the understanding of the embodiments of the present application, the relevant concepts involved in the embodiments of the present application are first briefly described.

[0140] 1. Flicker

[0141] The energy transmitted in the AC power grid is not stable, but changes with a fixed frequency, which is generally called the power frequency; the energy change brought about by the power frequency is called flicker.

[0142] 2. Image banding

[0143] In a shooting environment with a stroboscopic light source, the phenomenon of stripes formed on the image when the image sensor in the electronic device captures the flicker is called image banding, which can be generally referred to as banding.

[0144] For example, for 50HZ alternating current, that is, a charged light source that turns on and off 100 times per second; if the exposure time of the electronic device meets the integer multiples of 10ms, the exposure integration period can offset the banding; if the exposure time of the electronic device does not meet the integer multiples of 10ms, the amount of light entering when collecting the image will fluctuate according to the law of the alternating current sine wave, resulting in regular stripes in the image.

[0145] 3. Lens shading correction (LSC)

[0146] Lens shading correction (LSC) refers to correcting lens shading. Lens shading refers to uneven image brightness and / or color caused by the optical properties of the lens, as shown in FIG1(a). In FIG1(a), image area 196 represents the area of ​​uneven image color. LSC typically includes two parts: luma shading correction and color shading correction. Luma shading correction occurs when the light received by the edge of the image sensor is weaker than that received by the center of the image sensor, resulting in a gradual darkening of the image from the center to the periphery, as shown in FIG1(b). Color shading is generally caused by the use of an infrared cutoff filter (IR-cut filter), whose cutoff frequency varies with the incident light angle; or when the chief ray angle (CRA) of the image sensor does not match the CRA of the lens; or when components are incorrectly installed, resulting in a gradual color change from the center to the periphery of the image, as shown in FIG1(c). After LSC, both the image brightness and color unevenness issues are resolved, as shown in FIG1(d).

[0147] 4. Bilateral grid

[0148] A bilateral grid is essentially a data structure; for example, for a single-channel grayscale value, the bilateral grid can be a three-dimensional array obtained by combining the two-dimensional spatial domain information of the image and the one-dimensional grayscale information.

[0149] 5. Exposure time

[0150] Exposure time refers to the time from when the camera shutter opens to when it closes that light strikes the film or sensor.

[0151] 6. Neural Networks

[0152] A neural network refers to a network formed by connecting multiple single neural units together, that is, the output of one neural unit can be the input of another neural unit; the input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field, which can be an area composed of several neural units.

[0153] 7. Convolutional neural network (CNN)

[0154] A convolutional neural network is a deep neural network with a convolutional architecture. It consists of a feature extractor consisting of convolutional layers and subsampling layers, which can be viewed as a filter. A convolutional layer is a layer of neurons in a convolutional neural network that performs convolution processing on the input signal. In a convolutional layer of a convolutional neural network, a neuron can only connect to a subset of neurons in adjacent layers. A convolutional layer typically contains several feature planes, each of which is composed of a rectangular arrangement of neurons. Neurons in the same feature plane share weights, which are referred to as convolution kernels. Shared weights can be understood as extracting image information in a position-independent manner. The convolution kernel can be initialized as a matrix of random size, and during the training process of the convolutional neural network, the convolution kernel can be learned to acquire appropriate weights. Furthermore, shared weights have the direct benefit of reducing the number of connections between layers of the convolutional neural network, thereby reducing the risk of overfitting.

[0155] 8. HDRnet

[0156] HDRNet is a typical 3D interpolation grid; for example, the spatial domain can be divided into 16x16, and the value domain can be divided into 8 intervals.

[0157] 9. Backpropagation algorithm

[0158] Neural networks can use the back propagation (BP) algorithm to correct the size of the parameters in the initial neural network model during training, reducing the reconstruction error loss of the neural network model. Specifically, the forward propagation of the input signal to the output generates error loss. This error loss information is then backpropagated to update the parameters in the initial neural network model, thereby converging the error loss. The BP algorithm is a backward propagation movement dominated by error loss, aiming to obtain the optimal parameters of the neural network model, such as the weight matrix.

[0159] The image processing method and electronic device provided in the embodiments of the present application will be described below with reference to the accompanying drawings.

[0160] FIG2 shows a hardware system of an electronic device suitable for the present application.

[0161] Exemplarily, the electronic device 100 may be a mobile phone, a smart screen, a tablet computer, a wearable electronic device, an in-vehicle electronic device, an augmented reality (AR) device, a virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a projector, etc. The embodiments of the present application do not impose any restrictions on the specific type of the electronic device 100.

[0162] Exemplarily, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0163] It should be noted that the structure shown in FIG2 does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in FIG2, or the electronic device 100 may include a combination of some of the components shown in FIG2, or the electronic device 100 may include sub-components of some of the components shown in FIG2. The components shown in FIG2 may be implemented in hardware, software, or a combination of software and hardware.

[0164] The processor 110 may include one or more processing units. For example, the processor 110 may include at least one of the following processing units: an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and a neural-network processing unit (NPU). The different processing units may be independent devices or integrated devices. The controller may generate an operation control signal based on the instruction opcode and timing signal to complete the control of instruction fetching and execution.

[0165] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0166] In some embodiments, the processor 110 may include one or more interfaces. For example, the processor 110 may include at least one of the following interfaces: an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM interface, and a USB interface.

[0167] Exemplarily, in an embodiment of the present application, the processor 110 can be used to execute the image processing method provided by the embodiment of the present application; for example, start a camera application; display a first image, the first image is an image of a photographic object acquired based on a first exposure time, the photographic object is a moving object, the first exposure time is less than a first duration, and the first image includes stripes and / or color cast image areas; detect a first operation, the first operation instructs the electronic device to take a photo or record a video; in response to the first operation, obtain a second image, the second image is an image of the photographic object acquired based on a second exposure time, and the second exposure time is an integer multiple of the first duration; based on the first image and the second image to obtain a color conversion matrix and / or brightness parameters, the color conversion matrix is ​​used to perform color adjustment on the first image, and the brightness parameters are used to characterize the grayscale of brightness; based on the color conversion matrix and / or brightness parameters, first image processing is performed on the first image to obtain a third image, and the third image is an image with stripes and / or color cast image areas removed; based on the brightness information of the second image, first parameters are obtained, and the first parameters are used for lens shading correction processing; based on the first parameters, lens shading correction processing is performed on the third image to obtain a fourth image; the fourth image is displayed or saved; optionally, see the subsequent Figure 10, or see the subsequent Figure 12.

[0168] Exemplarily, in an embodiment of the present application, the processor 110 can be used to execute the image processing method provided by the embodiment of the present application; for example, open a camera application; display a first image, where the first image is an image of a photographed object captured based on a first exposure time, the photographed object is a moving object, the first exposure time is less than a first duration, and the first image includes stripes and / or color cast image areas; detect a first operation, where the first operation instructs the electronic device to take a photo or record a video; in response to the first operation, obtain a second image, where the second image is an image of the photographed object captured based on a second exposure time, where the second exposure time is an integer multiple of the first duration; obtain a first parameter based on brightness information of the second image, where the first parameter is used for lens shading correction processing; perform lens shading correction processing on the second image based on the first parameter to obtain a fifth image; obtain a color conversion matrix and / or brightness parameter based on the first image and the fifth image, where the color conversion matrix is ​​used to adjust the color of the first image, and the brightness parameter is used to characterize the grayscale of brightness; perform first image processing on the first image based on the color conversion matrix and / or brightness parameter to obtain a fourth image, where the fourth image is an image with stripes and / or color cast image areas removed; display or save the fourth image; optionally, refer to the subsequent Figure 11.

[0169] 2 is merely a schematic illustration and does not limit the connection relationship between the modules of the electronic device 100. Optionally, the modules of the electronic device 100 may also adopt a combination of the multiple connection modes in the above embodiments.

[0170] The wireless communication function of the electronic device 100 can be implemented through components such as the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.

[0171] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0172] Electronic device 100 can implement display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0173] Display screen 194 may be used to display images or videos.

[0174] Optionally, the display screen 194 can be used to display images or videos. The display screen 194 includes a display panel. The display panel can use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a mini light-emitting diode (Mini LED), a micro light-emitting diode (Micro LED), a micro OLED, or a quantum dot light-emitting diode (QLED). In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0175] Exemplarily, the electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0176] Exemplarily, the ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the camera to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can perform algorithmic optimization on image noise, brightness, and color. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0177] Exemplarily, the camera 193 (also referred to as a lens) is used to capture still images or videos. It can be triggered to turn on through application instructions to implement the photo function, such as capturing images of any scene. The camera may include components such as an imaging lens, a filter, and an image sensor. The light emitted or reflected by the object enters the imaging lens, passes through the filter, and is finally converged on the image sensor. The imaging lens is mainly used to converge the light emitted or reflected by all objects in the photographic field of view (also referred to as the scene to be photographed, the target scene, or the scene image that the user expects to capture) to form an image; the filter is mainly used to filter out excess light waves in the light (for example, light waves other than visible light, such as infrared); the image sensor can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The image sensor is mainly used to perform photoelectric conversion on the received light signal, convert it into an electrical signal, and then transmit the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format such as RGB or YUV.

[0178] Exemplarily, the digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0179] For example, a video codec is used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. This allows the electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0180] Exemplarily, the gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., the x-axis, the y-axis, and the z-axis) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse motion to achieve anti-shake. The gyroscope sensor 180B can also be used in scenarios such as navigation and somatosensory games.

[0181] For example, the accelerometer 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (typically the x-axis, y-axis, and z-axis). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. The accelerometer 180E can also be used to identify the posture of the electronic device 100, which can be used as an input parameter for applications such as landscape / portrait switching and pedometers.

[0182] Exemplarily, the distance sensor 180F is used to measure distance. The electronic device 100 can measure distance by infrared or laser. In some embodiments, for example, in a shooting scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0183] For example, ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light brightness. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.

[0184] For example, the fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement functions such as unlocking, accessing application locks, taking photos, and answering calls.

[0185] For example, the touch sensor 180K is also referred to as a touch-sensitive device. The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, which is also referred to as a touch screen. The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor 180K can transmit the detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100 and at a different location from the display screen 194.

[0186] The hardware system of the electronic device 100 is described in detail above. The software system of the electronic device 100 is introduced below.

[0187] FIG3 is a schematic diagram of a software system of an electronic device provided in an embodiment of the present application.

[0188] As shown in FIG. 3 , the system architecture may include an application layer 210 , an application framework layer 220 , a hardware abstraction layer 230 , a driver layer 240 , and a hardware layer 250 .

[0189] The application layer 210 may include a camera application.

[0190] Optionally, the application layer 210 may also include applications such as gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0191] The application framework layer 220 provides an application programming interface (API) and a programming framework for the applications in the application layer; the application framework layer may include some predefined functions.

[0192] For example, the application framework layer 220 may include a camera access interface, which may include camera management and camera devices. The camera management may be used to provide an access interface for managing the camera, and the camera device may be used to provide an interface for accessing the camera.

[0193] The hardware abstraction layer 230 is used to abstract hardware. For example, the hardware abstraction layer can include a camera abstraction layer and other hardware device abstraction layers. The camera abstraction layer can include camera device 1, camera device 2, etc. The camera hardware abstraction layer can be connected to the camera algorithm library, and the camera hardware abstraction layer can call the algorithms in the camera algorithm library.

[0194] Exemplarily, the camera algorithm library may include an image processing algorithm, which is used to execute the image processing method provided in the embodiment of the present application when the image processing algorithm is run.

[0195] The driver layer 240 is used to provide drivers for different hardware devices. For example, the driver layer may include a camera device driver.

[0196] The hardware layer 250 may include an image sensor, an image signal processor, and other hardware devices.

[0197] At present, when users shoot moving objects, they usually expect electronic devices to be able to capture images of moving objects at the moment of movement; since the object is moving, electronic devices usually need to reduce motion blur in the image; in order to reduce motion blur in the image, electronic devices can usually shorten the exposure time and increase the sensitivity value; however, in the shooting scene of a stroboscopic light source (for example, 50HZ alternating current), the exposure time will not meet the integer multiple of 10ms due to the shortened exposure time; if the exposure time does not meet the integer multiple of 10ms, image banding problems will appear in the image captured by the electronic device, that is, light and dark alternating banding stripes will appear in the image; wherein, banding can include Luma banding and Chroma banding; Luma banding refers to the banding stripes generated by shortening the exposure time; wherein, Luma banding only has light and dark changes, no color changes; Chroma banding refers to the image color cast in the local area of ​​the image, the local area in the image does not match the overall color of the image, and red, green or blue color cast appears; Luma banding The reason for banding is that for shooting scenes with a 50Hz AC stroboscopic light source, if the exposure time of the electronic device is not an integer multiple of 10ms, the AC sinusoidal wave band generated by the stroboscopic light source in the shooting environment cannot offset the exposure integration period, resulting in regular brightness stripes in the captured image. The reason for chroma banding is that when the voltage of the stroboscopic light source changes by 10%, the color temperature of the light source will change significantly (for example, around 1000K). The imaging of the image is related to the color temperature. Since the color temperature will change significantly when the voltage of the charged light source changes slightly, the color cast problem will appear in the image. Therefore, if banding occurs in the image, it will seriously affect the image quality.

[0198] In addition, in the current ISP processing flow, for LSC processing, the electronic device can only obtain the LSC gain information of the preview image, or obtain the LSC gain information of the image 3 frames before the current frame image. Since the gain information during LSC processing does not match the image frame, the problem of excessive color correction may occur in the image after LSC processing of the debanding image; for example, before debanding processing, the image includes red color cast and alternating light and dark stripes; after debanding processing and LSC processing, since the gain information during LSC processing does not match the image frame, the overall brightness of the processed image is basically consistent, but the problem of excessive color correction will occur in the image, as shown in 272 in (b) of Figure 5.

[0199] Exemplarily, FIG6 shows a comparison between the LSC gain information of the preview image 1 (for example, 3ms) and the LSC gain information of the preview image 2 (for example, 10ms); wherein, as shown in FIG6(a), image 291 represents the LSC gain information of the red channel (R channel) of the preview image 1; image 292 represents the LSC gain information of the R channel of the preview image 2; image 293 represents the difference information between the LSC gain information of the R channel of the preview image 1 and the LSC gain information of the R channel of the preview image 2; in image 293, the darker the color, the greater the difference, and the lighter the color, the smaller the difference; based on image 293, it can be seen that the difference between the LSC gain information of the R channel of the preview image 1 and the LSC gain information of the R channel of the preview image 2 is large; as shown in FIG6(b), image 294 represents the LSC gain information of the green channel (G channel) of the preview image 1; image 295 represents the LSC gain information of the G channel of the preview image 2; image 296 represents the LSC gain information of the G channel of the preview image 1 6 , image 297 represents the LSC gain information of the blue channel (B channel) of preview image 1; image 298 represents the LSC gain information of the B channel of preview image 2; image 299 represents the difference information between the LSC gain information of the B channel of preview image 1 and the LSC gain information of the B channel of preview image 2; in image 299, the darker the color, the greater the difference, and the lighter the color, the smaller the difference; based on image 299, it can be seen that the difference between the LSC gain information of the B channel of preview image 1 and the LSC gain information of the B channel of preview image 2 is large; based on FIG6 , it can be seen that when LSC is performed on images with different exposure times, the LSC gain information is different.

[0200] FIG4 is a schematic diagram of an application scenario of the image processing method provided in an embodiment of the present application.

[0201] Exemplarily, the image processing method in the embodiments of the present application can be applied to the field of photography or video recording; for example, the image processing method of the present application can be applied to capturing a moving object in a shooting environment with a stroboscopic light source (for example, an indoor shooting environment); wherein the moving object can refer to a moving user, a moving object, or an image played in a video (for example, a movie), etc.

[0202] For example, as shown in FIG4 , a subject 270 is moving in an indoor location with a stroboscopic light source, and indoor lighting equipment (e.g., lamp 260) provides illumination. The electronic device 100 runs a camera application. During the process of the electronic device 100 capturing an image including the subject 270, a preview image including the subject 270 can be displayed in real time on the display screen. When the user views the preview image on the display screen of the electronic device 100, if they want to capture an image of the subject 270 in motion, they can click a capture control on the capture interface. When the capture control on the electronic device 100 is triggered, the electronic device 100 can capture an image of the subject 270 in motion.

[0203] Optionally, FIG4 illustrates an example of a user as subject 270; the subject may also be an animal, a vehicle, a robot, etc. For example, a subject exercising in a stroboscopic light environment may be a user playing badminton, table tennis, or practicing yoga indoors. The subject in the electronic device's shooting perspective may be a single user or multiple users.

[0204] For example, the photographed subject is moving in a photographing environment with a stroboscopic light source, and may be an animal (eg, a rabbit, a cat, or a dog, etc.) running indoors.

[0205] Indoor spaces also require lighting equipment, which can operate under alternating current (AC). For example, a fluorescent lamp operates by discharging the inert gas inside the tube under the action of a high-voltage current. The generated electrons reach the tube, causing the lamp to emit light. For example, if the operating voltage of a fluorescent lamp is 50Hz AC, the 50Hz AC current will cause the lamp to flicker 100 times per second.

[0206] Optionally, taking the working voltage of the fluorescent lamp as 60 Hz alternating current as an example, when the fluorescent lamp is driven by the alternating current, the 60 Hz alternating current causes the fluorescent lamp to flash 120 times in 1 second.

[0207] For example, in an embodiment of the present application, the electronic device is in a photo mode, and the display screen of the electronic device can display a preview image. When the shooting control of the electronic device is triggered, the electronic device can generate a captured image (also referred to as a captured image). When the electronic device captures the motion of the subject, the stroboscopic light source in the shooting scene will affect the image captured by the image sensor, which may cause the image captured by the electronic device to have banding stripes, as shown in (a) of FIG5 , and / or, local color cast areas, such as 271 shown in (a) of FIG5 ; after the debanding process and the related algorithms of the LSC process, the image shown in (b) of FIG5 is obtained; as shown in (b) of FIG5 , a local color cast area 272 will appear in the debanded image, wherein the local color cast area 272 is different from the local color cast area 271; for example, the local color cast area 271 can be a red color cast area, and the local color cast area 272 can be a cyan color cast area; that is, the red color cast area in the image before the debanding process may become a cyan color cast area after the debanding process and the LSC process.

[0208] In view of this, an embodiment of the present application provides an image processing method and an electronic device; in the case where the light source of the shooting environment in which the electronic device is located is a stroboscopic light source, and the electronic device needs to shoot a moving object, thereby reducing the exposure time, resulting in banding stripes and color cast image areas in the image; in the embodiment of the present application, on the one hand, by performing color migration and brightness migration on the short exposure image based on the normal exposure image, the banding stripes and color cast image areas in the short exposure image are removed; on the other hand, when LSC is performed on the short exposure image, the LSC gain information of the normal exposure image is used for LSC processing, ensuring that when capturing the moving moment image of the moving object, when the banding stripes and color cast image areas in the image are removed, there will be no excessive color correction in the image, thereby improving the image quality.

[0209] The image processing method of the embodiment of the present application can be applied to any shooting mode of the camera application (for example, the photo mode); through the image processing method provided by the embodiment of the present application, when the electronic device is in a shooting environment with a stroboscopic light source and shoots moving objects, the banding phenomenon in the image can be removed, for example, removing the light and dark stripes and local color cast areas in the image; further, it can also avoid the problem of excessive color correction in the image after debanding is removed, thereby improving the image quality.

[0210] Optionally, when the camera application is in a preview state (for example, a photo preview), the preview image displayed by the electronic device includes banding stripes. After the shooting control of the electronic device is triggered, the image processing method provided in the embodiment of the present application can be executed to obtain an image with the banding removed and no local color cast.

[0211] Optionally, the shooting modes of the camera application may include: photo mode, portrait mode, large aperture mode, professional mode, etc.

[0212] Optionally, if the electronic device has sufficient computing power, the image processing method in the embodiment of the present application can also be applied to the field of video recording, video calling or other image processing fields.

[0213] For example, video call scenarios may include but are not limited to the following scenarios:

[0214] Video calls, video conferencing applications, long and short video applications, live video applications, online video courses, portrait intelligent mirroring application scenarios, system camera recording function video recording, video surveillance, or smart cat-eye and other portrait shooting scenarios, etc.

[0215] It should be understood that the above is an example of an application scenario and does not limit the application scenario of this application.

[0216] The image processing method provided in the embodiment of the present application is described in detail below with reference to FIG. 7 to FIG. 12 .

[0217] Figure 7 is a schematic flow chart of a processing flow of an image signal processor provided by an embodiment of the present application. The method 300 can be executed by the electronic device shown in Figure 1; the method 300 includes S310 to S360, which are described in detail below.

[0218] Step S310: The image sensor collects a Raw image.

[0219] It should be understood that a Raw image refers to an image in a Raw color space; a Raw image may refer to original image data output from an image sensor without undergoing interpolation or color mixing.

[0220] Step S320: Perform a first color space conversion process on the Raw image.

[0221] Exemplarily, the Raw image may be converted into an RGB color space to obtain an RGB image.

[0222] Step S330: RGB domain algorithm processing.

[0223] Optionally, S330 includes S331 and S332; wherein, S331 is a debanding process; S332 is an LSC process based on the first gain information; wherein, the first gain information may refer to gain information obtained based on statistical information of a normal exposure image; for example, for a multi-frame exposure image, the first gain information may be gain information obtained based on statistical information of the first frame of a normal exposure image in the multi-frame exposure image.

[0224] Optionally, S331 may be executed first and then S332, as shown in FIG10 .

[0225] Optionally, S332 may be executed first and then S331 , as shown in FIG11 .

[0226] In the embodiment of the present application, S331 can be used to remove light and dark stripes and local color cast areas in the image; S332 can be used to effectively avoid the problem of excessive color correction, so that the color and brightness of the image are more accurate.

[0227] Optionally, the RGB domain algorithm processing of the RGB image in S330 includes: color-related algorithm processing and other RGB domain algorithm processing; when performing the color-related algorithm processing, first perform S331 and S332 to obtain an image with banding removed and no excessive color correction; then perform other color-related algorithm processing.

[0228] In an embodiment of the present application, before executing color-related algorithm processing, the image processing method provided in the embodiment of the present application can be executed first, that is, image band removal processing and LSC processing based on the first gain information are executed; by removing image banding processing, the light and dark stripes and local color cast areas in the image can be removed; by LSC processing based on the first gain information, the problem of excessive color correction can be effectively avoided, so that the color and brightness accuracy of the image is higher; when the color and brightness accuracy is high, the color-related algorithm processing is executed again, so that other color-related algorithm processing can be performed on the image with banding removed and no excessive color correction on the basis of high accuracy of the color and brightness of the image, thereby improving the image quality.

[0229] Optionally, the image processing method provided in the embodiment of the present application, i.e., image strip removal processing, may not be limited to the execution time in the RGB domain algorithm.

[0230] Optionally, the implementation of S331 and S332 may refer to FIG10 or FIG11 .

[0231] Step S340: Perform a second color space conversion process on the processed RGB image.

[0232] Exemplarily, the second color space may be a YUV color space; the processed RGB image may be converted to a YUV color space; and YUV domain arithmetic processing may be performed.

[0233] Step S350: YUV domain algorithm processing.

[0234] Exemplarily, YUV domain algorithm processing includes but is not limited to:

[0235] Brightness noise reduction processing, edge enhancement processing, contrast processing, etc.

[0236] Step S360: output the processed image.

[0237] Optionally, an image in a storage format is output; for example, the storage format includes: JPEG format (JPG format), GIF format, PNG format, PPM format or BMP format, etc.

[0238] In an embodiment of the present application, by adding image strip removal processing and LSC processing based on the first gain information to the RGB domain algorithm processing, it is possible to remove banding in a short-exposure image when the light source of the shooting environment in which the electronic device is located is a stroboscopic light source, and the electronic device needs to shoot a moving object, thereby reducing the exposure time and causing banding in the image. The problem of excessive color correction can also be effectively avoided, so that the color and brightness of the image are more accurate, thereby improving image quality.

[0239] FIG8 is a schematic flow chart of an image processing method provided by an embodiment of the present application. The method 400 can be executed by the electronic device shown in FIG1 ; the method 400 includes S401 to S410 , which are described in detail below.

[0240] S401. Open the camera application.

[0241] For example, a user can instruct the electronic device to open the camera application by clicking the icon of the "Camera" application; or, when the electronic device is in the lock screen state, the user can instruct the electronic device to open the camera application by sliding to the right on the display screen of the electronic device. Alternatively, the electronic device is in the lock screen state, and the lock screen interface includes the icon of the camera application. The user instructs the electronic device to open the camera application by clicking the icon of the camera application. Alternatively, when the electronic device is running other applications, the application has the permission to call the camera application; the user can instruct the electronic device to open the camera application by clicking the corresponding control. For example, when the electronic device is running an instant messaging application, the user can instruct the electronic device to open the camera application by selecting the control of the camera function.

[0242] It should be understood that the above is an example of the operation of opening the camera application; the camera application can also be opened by voice instructions or other operations to instruct the electronic device; this application does not impose any limitation on this.

[0243] Optionally, after the camera application is started, the image sensor in the electronic device captures a Raw image.

[0244] It should be understood that a Raw image refers to an image in a Raw color space; a Raw image may refer to original image data output from an image sensor without undergoing interpolation or color mixing.

[0245] S402: Scene detection processing.

[0246] Optionally, the scene detection process includes S4021 and S4022; wherein, S4021, detecting that the shooting scene includes a moving object; and S4022, detecting the presence of image banding.

[0247] It should be understood that image stripes may refer to stripes of light and dark, and / or image areas with local color cast.

[0248] Optionally, the electronic device may calculate the motion amplitude based on the optical flow information of the two preceding and following frames of the preview stream; if the motion amplitude is greater than a threshold, it indicates that the captured scene includes a moving object.

[0249] It should be understood that optical flow is the instantaneous speed of pixel movement of a spatially moving object on the observation imaging plane; generally speaking, optical flow is generated by the movement of the foreground target itself in the scene and / or the movement of the camera; optical flow information can be used to represent the displacement deviation of pixels between two frames of images.

[0250] Exemplarily, a moving object may refer to a moving user, a moving animal, a moving object, or an image played in a video.

[0251] Optionally, the presence of image stripes can be detected by calculating and outputting the frequency and amplitude of the light source in the current shooting scene through statistical data of a flicker device.

[0252] For example, an anti-flicker sensor (Flicker Sensor) in an electronic device may be used to detect whether image striping exists; wherein the anti-flicker sensor (Flicker Sensor) may be a sensor that samples ambient light.

[0253] Optionally, when executing S4022, in order to match the exposure period with the frame rate, the preview stream may be frame-rate controlled so that the exposure period is an integer multiple of the light source energy period.

[0254] For example, if the light source energy cycle is 10ms and the preview frame rate is 30, that is, each exposure cycle is 33.33ms, then the integer multiples of the light source energy cycle cannot match the exposure cycle. In this case, the preview frame rate can be adjusted to 25, that is, each exposure cycle is 40ms, so that the integer multiples of the light source energy cycle match the exposure cycle.

[0255] S403: Shorten the duration of automatic exposure.

[0256] Optionally, if the electronic device detects that the shooting scene includes a moving object, the electronic device may be triggered to shorten the automatic exposure time; in addition, the exposure time is subject to constraints imposed by the scene detection results; for example, if the image includes a moving object, the electronic device is triggered to shorten the exposure time; if the image also includes banding, in order to avoid the stripes in the image being too dark, the exposure time is shortened to a smaller extent, i.e., the exposure is reduced to a smaller extent.

[0257] S404: Acquire a short exposure image.

[0258] The short exposure image includes a moving object.

[0259] Optionally, the short exposure image may refer to an RGB image after multi-frame fusion; for example, the short exposure image may be a short exposure image after ISP processing; the short exposure image output after ISP processing may refer to an RGB image obtained by using the short exposure Raw image in the multi-frame Raw image as a reference frame.

[0260] It should be understood that due to the short exposure time of short-exposure images, the exposure time of short-exposure images is generally not an integer multiple of 10ms; therefore, banding may be present in short-exposure images. Furthermore, since a 10% change in the stroboscopic light source voltage can significantly change the color temperature of the light source (for example, by approximately 1000K), image formation is related to color temperature. Since a small change in the stroboscopic light source voltage can significantly change the color temperature, this can lead to color casts in the image. Therefore, short-exposure images may also contain areas of color casts.

[0261] Optionally, a full-size short-exposure Raw image may be acquired, and an ISP process may be performed on the short-exposure Raw image to obtain a short-exposure image (eg, a 512*512 RGB image).

[0262] For example, if the maximum resolution supported by the camera in the camera module is 4096*2160, the resolution of the acquired full-size short-exposure Raw image may be 4096*2160.

[0263] S405: Detecting a first operation of instructing to take a photo.

[0264] Optionally, detecting the first operation of instructing to take a photo may be detecting a click operation on a shutter button.

[0265] It should be understood that the above description uses the first operation as a click operation as an example; the first operation can also be an operation through voice instructions, or an operation of taking a photo through instructions of other operations; this application does not impose any limitation on this.

[0266] S406 : In response to the first operation, acquire a normally exposed image.

[0267] The normal exposure image and the short exposure image include the same moving object.

[0268] For example, in a shooting scenario with a stroboscopic light source having an alternating current of 50 Hz, a normal exposure image may refer to a Raw image with an exposure time that is an integer multiple of 10 ms; that is, when capturing a normal exposure image, the exposure time of the electronic device is an integer multiple of 10 ms.

[0269] Optionally, in an embodiment of the present application, the electronic device may collect multiple frames of Raw images, including S A N B ; Among them, S A Represents A frame short exposure image, N B represents a B-frame normally exposed image; wherein A is an integer greater than or equal to 1, and B is an integer greater than or equal to 1; the exposure time of a short exposure image is less than 10ms; the exposure time of a normally exposed image is an integer multiple of 10ms. Optionally, S A N B The A-frame short-exposure Raw image in may be the image captured in S404.

[0270] Optionally, in an embodiment of the present application, the electronic device may collect multiple frames of Raw images, including S A N B L C ; Among them, S A Represents A frame short exposure image, N B Indicates the B frame normal exposure image, L C Represents C frames of long-exposure images; where A is an integer greater than or equal to 1, B is an integer greater than or equal to 1, and C is an integer greater than or equal to 0. The exposure time of a short-exposure image is less than 10 ms; the exposure time of a normal-exposure image is an integer multiple of 10 ms; and the exposure time of a long-exposure image is greater than that of a normal-exposure image.

[0271] For example, multiple frames of Raw images can refer to 5 frames of S2N2L; that is, Raw images of SSNNL, where 2 frames S are short-exposure Raw images in the preview frames; 2 frames N represent normal exposure images with an exposure value greater than or equal to 2 frames of short-exposure images and an exposure time that is an integer multiple of 10ms; 1 frame L represents a long-exposure image.

[0272] Optionally, a color space conversion process (eg, demosaicing process) may be performed on the first frame of normally exposed Raw image among the one or more frames of normally exposed Raw images collected to obtain an RGB image.

[0273] S407: Obtain LSC gain information of the normal exposure image.

[0274] Optionally, the normally exposed image may be input into the ISP for processing, and the LSC gain information of the normally exposed image may be obtained based on statistical information of the normally exposed image.

[0275] Optionally, if the camera module captures multiple frames of exposure images, the multiple frames can be input into the ISP for processing respectively, and the LSC gain information (eg, LSC map) corresponding to each frame of exposure image can be obtained based on the statistical information of the frame of exposure image.

[0276] Exemplarily, based on the brightness information of the current frame image (for example, the normal exposure image or multi-frame exposure image input to the ISP), the LSC calibration parameters of the current frame image are obtained, which are recorded as fixed gain table; the LSC calibration parameters are multiplied by the current frame image to obtain the processed image; based on the statistical information of the processed image (for example, histogram information or gradient information of different image blocks), the color shading gain of the processed image is statistically calculated, which is recorded as color shading gain; the LSC calibration parameters are multiplied by the color shading gain to obtain the gain information of the current frame image, which is recorded as gain table; the gain information includes both the correction of brightness shading and the correction of color shading gain.

[0277] Optionally, the brightness information of the current frame image includes: data of a brightness channel of the current frame image, or brightness values ​​of pixels of the current frame image.

[0278] For example, FIG9 shows a comparison between LSC gain information obtained based on statistical information (e.g., an image with an exposure time of 10 ms) and LSC gain information of preview image 2 (e.g., an image with an exposure time of 10 ms). As shown in FIG9(a), image 421 represents the LSC gain information of the red channel (R channel) obtained based on statistical information; image 422 represents the LSC gain information of the R channel of preview image 2; image 423 represents the difference information between the LSC gain information of the R channel obtained based on statistical information and the LSC gain information of the R channel of preview image 2; in image 423, the darker the color, the greater the difference, and the lighter the color, the smaller the difference; based on image 423, it can be seen that the difference between the LSC gain information of the red channel obtained based on statistical information and the LSC gain information of the R channel of preview image 2 is small; as shown in FIG9(b), image 424 represents the LSC gain information of the green channel (G channel) obtained based on statistical information; image 425 represents the LSC gain information of the G channel of preview image 2; and image 426 represents the LSC gain information of the G channel obtained based on statistical information. 9 , it can be seen that the difference between the LSC gain information of the G channel obtained based on the statistical information and the LSC gain information of the G channel of the preview image 2 is small. As shown in (c) of FIG9 , image 427 represents the LSC gain information of the blue channel (B channel) obtained based on the statistical information; image 428 represents the LSC gain information of the B channel of the preview image 2; image 429 represents the difference between the LSC gain information of the B channel obtained based on the statistical information and the LSC gain information of the B channel of the preview image 2; in image 429, the darker the color, the greater the difference, and the lighter the color, the smaller the difference; based on image 429, it can be seen that the difference between the LSC gain information of the B channel obtained based on the statistical information and the LSC gain information of the B channel of the preview image 2 is small. As can be seen from FIG9 , the difference between the LSC gain information obtained based on the statistical information of the image with an exposure time of 10 ms and the actual LSC gain information of the preview image with an exposure time of 10 ms is small.

[0279] S408 , performing stripe removal and local color cast processing on the short exposure image based on the normal exposure image to obtain a processed short exposure image.

[0280] It should be understood that since the exposure time of a normally exposed image is an integer multiple of 10ms, there are no banding stripes in the normally exposed image, that is, there is no Luma banding in the image. In addition, the reason for Chroma banding is that the energy changes, accompanied by the change of color temperature, resulting in color cast problems in the image. For example, if the light and dark stripes in the Luma banding show different colors, Chroma banding will appear in the image. For example, the position of the dark stripes is reddish, and the position of the light stripes is blue. For a normally exposed image, each row of pixels receives the same energy, so there will be no energy fluctuation and no color cast problems in the normally exposed image. Therefore, Luma banding and Chroma banding will not appear in a normally exposed image. Banding: By transferring the color and brightness information of the normal exposure image to the short exposure image, the light and dark stripes and local color cast problems in the short exposure image are removed. It can be understood that the processed short exposure image includes the image content information of the short exposure image and the color and brightness information of the normal exposure image. This ensures that when capturing images of moving objects in motion, the stripes and / or color cast image areas in the image are removed, thereby improving image quality.

[0281] Optionally, the short exposure image and the normal exposure image are input into an image processing model for processing to obtain a bilateral grid; stripes and local color cast are removed from the short exposure image based on the bilateral grid to obtain a processed image; for example, the processed image is obtained by multiplying the bilateral grid with the short exposure image.

[0282] It should be understood that the bilateral grid refers to a data structure; in the embodiments of the present application, the bilateral grid can be a grid matrix; the grid matrix includes a color conversion matrix and brightness parameters (for example, grayscale values ​​of brightness), wherein the color conversion matrix includes red pixel gain (R gain), green pixel gain (G gain), and blue pixel gain (B gain); based on the data in the bilateral grid, the color and brightness of the normal exposure image can be transferred to the short exposure image, thereby removing the light and dark stripes and color cast image areas in the short exposure image.

[0283] Exemplarily, the bilateral grid can be a 32*32*8*9 grid matrix; where 32*32 can represent the width and height, 8 can represent the brightness level, that is, the grayscale value of the brightness; and 9 can represent the color conversion matrix, that is, a 3*3 matrix acting on each RGB value.

[0284] It should be understood that grayscale refers to dividing the brightness changes between the brightest and darkest into different levels, and each level is used to represent a brightness change interval; it can be understood that the larger the grayscale value of the brightness, the more brightness change intervals there are; and the finer the division of the brightness change intervals.

[0285] Optionally, the network structure of the image processing model can be a convolutional neural network; for example, the image processing model can be an HDR Net; the training data includes a first sample image, a second sample image and a third sample image; wherein the first sample image is an image without banding; the second sample image is an image after banding is added to the first image; the third sample image is an image without banding and the image quality of the third sample image is higher than the image quality of the first sample image; the first sample image and the second sample image are input into the image processing model to be trained to obtain a predicted bilateral grid; the first sample image is interpolated based on the predicted bilateral grid to obtain a predicted image; based on the difference between the predicted image and the third sample image, the parameters of the image processing model are updated to obtain a trained image processing model.

[0286] For example, the third sample image can be an RGB image without banding after ISP processing; the first sample image can be an RGB image obtained after color space conversion based on the normally exposed sample Raw image; therefore, the image quality of the third sample image is higher than that of the first sample image.

[0287] Exemplarily, the difference between each pixel in the predicted image and the third sample image can be calculated, and the image processing model to be trained can be trained by the back propagation algorithm so that the loss function of the image processing model to be trained converges to obtain the trained image processing model.

[0288] Optionally, in an embodiment of the present application, it is considered that the Chroma Banding image processing model may include 8 parameters; the 8 parameters are A*3, a*1, b*1, c*3; where A represents the amplitude; a represents the frequency; b represents the initial phase; c represents the offset term; A*3 represents the amplitude corresponding to the RGB pixels respectively; c*3 represents the offset term corresponding to the RGB pixels respectively.

[0289] Optionally, color migration processing can be performed on the short exposure image based on the color conversion matrix in the bilateral grid to remove the color cast image area in the short exposure image; brightness migration processing can be performed on the short exposure image based on the brightness parameters in the bilateral grid to remove the light and dark stripes in the short exposure image.

[0290] Optionally, interpolation processing may be performed based on the data in the bilateral grid and the short exposure image to obtain a processed short exposure image.

[0291] For example, the data in the bilateral grid is multiplied by the pixel matrix of the short exposure image to obtain a processed short exposure image.

[0292] Optionally, in an embodiment of the present application, the exposure time of the short exposure image and the exposure time of the normal exposure image are related to the number of times the stroboscopic light source of the shooting environment in which the electronic device is located brightens and darkens per second; for example, the exposure time of the normal exposure image = an integer multiple of (1000 / the number of times the stroboscopic light source brightens and darkens per second) milliseconds.

[0293] For example, if the operating voltage frequency of the stroboscopic light source in the shooting environment is 50HZ, that is, the stroboscopic light source lights up and dims 100 times per second, then the short exposure image refers to an image with an exposure time less than 10ms; the normal exposure image refers to an image with an exposure time that is an integer multiple of 10ms.

[0294] For example, the operating voltage frequency of the stroboscopic light source in the shooting environment is 60HZ, that is, the stroboscopic light source turns on and off 120 times per second. Then the short exposure image refers to an image with an exposure time less than 8.3ms; the normal exposure image refers to an image with an exposure time that is an integer multiple of 8.3ms.

[0295] S409 , performing LSC processing on the processed short exposure image based on the LSC gain information of the normal exposure image.

[0296] Optionally, LSC processing may be performed on the processed short exposure image based on the red pixel gain, the green pixel gain, or the blue pixel gain in the gain information of the normal exposure image to obtain the LSC-processed short exposure image.

[0297] Optionally, other RGB domain algorithms or YUV domain algorithms may be executed after LSC processing to obtain a processed image.

[0298] Optionally, in an embodiment of the present application, S408 may be executed first and then S409; for example, see the subsequent FIG10; or, S409 may be executed on the short exposure image and the normal exposure image respectively, and then S408 may be executed; for example, see the subsequent FIG11; the present application does not impose any limitation on this.

[0299] S410: Output the processed image.

[0300] Optionally, an image in a storage format is output; for example, the storage format includes: JPEG format (JPG format), GIF format, PNG format, PPM format or BMP format, etc.

[0301] Example 1

[0302] Optionally, in an embodiment of the present application, debanding processing can be first performed on the short exposure image based on the normal exposure image; and LSC processing can be performed on the short exposure image after debanding processing based on the LSC gain information of the normal exposure image to obtain an image with light and dark stripes removed and color cast image areas removed, and the problem of excessive color correction in the image can be avoided.

[0303] FIG10 is a schematic flow chart of an image processing method provided by an embodiment of the present application. The method 500 can be executed by the electronic device shown in FIG1 ; the method 500 includes S501 to S509 , which are described in detail below.

[0304] S501: Collect Raw images.

[0305] Optionally, the electronic device may capture multiple frames of Raw images.

[0306] For example, multiple frames of Raw images include S A N B ; Among them, S A Indicates the A-frame short exposure image in the preview stream, N B Represents the B-frame normally exposed image in the photo stream; where A is an integer greater than or equal to 1, and B is an integer greater than or equal to 1. If the operating voltage frequency of the stroboscopic light source in the shooting environment is 50 Hz, the exposure time of a short-exposure image is less than 10 ms; the exposure time of a normally exposed image is an integer multiple of 10 ms. If the operating voltage frequency of the stroboscopic light source in the shooting environment is 60 Hz, a short-exposure image refers to an image with an exposure time less than 8.3 ms; a normally exposed image refers to an image with an exposure time that is an integer multiple of 8.3 ms.

[0307] For example, the frame Raw image includes S A N B L C ; Among them, S A Indicates the A-frame short exposure image in the preview stream, N B Indicates the normal exposure image of the B frame in the photo stream, L C Represents C long-exposure images in the photo stream; where A is an integer greater than or equal to 1, B is an integer greater than or equal to 1, and C is an integer greater than or equal to 0. If the operating voltage frequency of the stroboscopic light source in the shooting environment is 50 Hz, the exposure time of a short-exposure image is less than 10 ms; the exposure time of a normal-exposure image is an integer multiple of 10 ms. If the operating voltage frequency of the stroboscopic light source in the shooting environment is 60 Hz, a short-exposure image refers to an image with an exposure time less than 8.3 ms; a normal-exposure image refers to an image with an exposure time that is an integer multiple of 8.3 ms; and the exposure time of a long-exposure image is greater than that of a normal-exposure image.

[0308] For example, multiple frames of Raw images can refer to 5 frames of S2N2L; that is, Raw images of SSNNL, where 2 frames S are short-exposure Raw images in the preview frames; 2 frames N are normal exposure images in the photo frames with an exposure value greater than or equal to 4 frames of short-exposure images and an exposure time that is an integer multiple of 10ms; 1 frame L represents a long-exposure image.

[0309] Optionally, the preview stream is a data stream collected by the image sensor before the electronic device detects a click operation on the shutter key; the photo stream is a data stream collected by the image sensor after the electronic device detects a click operation on the shutter key.

[0310] S502: Obtain LSC gain information of the normally exposed image based on the statistical information.

[0311] Optionally, the LSC gain information includes gain information of red pixels (eg, R gain), gain information of green pixels (eg, G gain), and gain information of blue pixels (eg, B gain).

[0312] Optionally, the implementation of S502 may refer to the relevant description of S407 in FIG8 , which will not be repeated here.

[0313] S503: Automatic white balance processing.

[0314] For example, automatic white balance processing is used to ensure that the camera can restore white to white at any color temperature. Due to the influence of color temperature, white paper will appear yellowish at low color temperature and bluish at high color temperature. The purpose of white balance processing is to ensure that white objects appear white with R=G=B at any color temperature.

[0315] Optionally, S503 may adopt any existing automatic white balance processing method, and this application does not impose any limitation on this.

[0316] S504: De-mosaicing and noise reduction processing.

[0317] For example, the demosaicing process may refer to converting a Raw domain image of a Bayer array structure into an RGB domain image; and the noise reduction process is to reduce noise in the image.

[0318] It should be understood that a Raw domain image refers to an image in a Raw color space; similarly, an RGB domain image refers to an image in an RGB color space.

[0319] Optionally, S504 may adopt any existing demosaicing method and noise reduction method, and this application does not impose any limitation on this.

[0320] Optionally, S504 may further include multi-frame fusion, that is, a fusion process may be performed on multiple frames of Raw images with the first frame of short exposure image being used as a reference frame to obtain a fused frame of short exposure image.

[0321] For example, the first short-exposure Raw image in the multiple Raw images may be used as a reference, and the color information and brightness information in other Raw images in the multiple Raw images may be fused with the first short-exposure Raw image to obtain a fused short-exposure image.

[0322] S505: Debanding the image.

[0323] Optionally, debanding processing can be performed on the short exposure image based on the normal exposure image. The implementation method can be found in the relevant description of S408 in FIG8 , which will not be repeated here.

[0324] S506: Color space conversion and downsampling.

[0325] Optionally, the image sensor collects multiple frames of Raw images; the multiple frames of Raw images include S A N B or S A N B L C ; The first frame N image (for example, the first frame normally exposed image) can be subjected to color space conversion processing and downsampling processing.

[0326] Illustratively, the color conversion process includes a demosaicing process.

[0327] S507, LSC processing.

[0328] Exemplarily, LSC processing refers to correcting lens shading, wherein lens shading refers to the phenomenon of uneven image brightness and / or image color caused by the optical characteristics of the lens. LSC processing can generally include two parts: luma shading correction and color shading correction.

[0329] Optionally, when performing LSC processing on the short exposure image after debanding processing, the LSC processing may be performed based on LSC gain information of the normal exposure image obtained based on statistical information.

[0330] In an embodiment of the present application, the color information and brightness information of the normal exposure image are transferred to the short exposure image, thereby removing the light and dark stripes and local color cast problems in the short exposure image, and obtaining a processed short exposure image; if the LSC gain information of the short exposure image is used to perform LSC processing on the processed short exposure image, since the LSC gain information does not match the color information and brightness information in the processed short exposure image, the problem of excessive color correction will occur in the processed short exposure image after the LSC processing; in an embodiment of the present application, since the LSC gain information of each frame of exposure image can be obtained based on statistical information, when performing LSC processing on the processed short exposure image, the processed short exposure image can be LSC processed according to the LSC gain information of the normal exposure image, so that the LSC gain information matches the processed short exposure image, thereby avoiding the problem of excessive color correction in the LSC-processed image and improving image quality.

[0331] S508, post-processing.

[0332] Optionally, post-processing may include:

[0333] Part or all of Color Correction Matrix (CCM) processing, Global Tone Mapping (GTM) processing, Local Tone Mapping (LTM) processing, or gamma processing.

[0334] Among them, CCM processing is used to calibrate the accuracy of colors other than white; GTM processing is used to solve the problem of uneven grayscale value distribution of high-dynamic images; LTM processing is used to enhance the local contrast of the image; gamma processing is used to adjust the brightness, contrast and dynamic range of the image by adjusting the gamma curve.

[0335] S509: Output the processed image.

[0336] Optionally, an image in a storage format is output; for example, the storage format includes: JPEG format (JPG format), GIF format, PNG format, PPM format or BMP format, etc.

[0337] In the embodiment of the present application, since there are no light and dark stripes and local color cast problems in the normal exposure image, the color information and brightness information of the normal exposure image are transferred to the short exposure image, thereby removing the light and dark stripes and local color cast problems in the short exposure image, and obtaining a processed short exposure image. It can be understood that the processed short exposure image includes the image content information of the short exposure image and the color information and brightness information in the normal exposure image. In addition, if the LSC gain information of the short exposure image is used to perform LSC processing on the processed short exposure image, since the LSC gain information of the short exposure image does not match the color information and brightness information in the processed short exposure image, the image after LSC processing of the processed short exposure image is The problem of excessive color correction may occur in the image; in an embodiment of the present application, the LSC gain information of each frame of exposure image (for example, the LSC gain information of the normal exposure image) can be obtained based on statistical information. Therefore, when LSC processing is performed on the processed short exposure image, LSC processing can be performed on the processed short exposure image according to the LSC gain information of the normal exposure image, so that the LSC gain information matches the processed short exposure image, thereby avoiding the problem of excessive color correction in the image after LSC processing; in summary, through the embodiments of the present application, it is possible to ensure that when capturing the motion moment image of the moving subject, the stripes and / or color cast image areas in the image are removed; and the problem of excessive color correction in the image is avoided, thereby improving the image quality.

[0338] Example 2

[0339] Optionally, in an embodiment of the present application, LSC processing can be performed on the normal exposure image and the short exposure image based on the LSC gain information of the normal exposure image; then, debanding processing can be performed on the short exposure image after LSC processing to obtain an image with light and dark stripes removed and color cast image areas removed, and the problem of excessive color correction in the image can be avoided.

[0340] FIG11 is a schematic flow chart of an image processing method provided by an embodiment of the present application. The method 500 can be executed by the electronic device shown in FIG1 ; the method 600 includes S601 to S610 , which are described in detail below.

[0341] S601: Collect Raw images.

[0342] Optionally, the implementation of S601 may refer to the relevant description of S501 in FIG10 , which will not be repeated here.

[0343] S602: Obtain LSC gain information of the normally exposed image based on the statistical information.

[0344] Optionally, the implementation of S602 may refer to the relevant description of S502 in FIG10 , which will not be repeated here.

[0345] S603: Automatic white balance processing.

[0346] Optionally, the implementation of S603 may refer to the relevant description of S503 in FIG10 , which will not be repeated here.

[0347] S604: De-mosaicing and noise reduction processing.

[0348] Optionally, the implementation of S604 may refer to the relevant description of S504 in FIG10 , which will not be repeated here.

[0349] S605: First LSC processing.

[0350] Optionally, the short exposure image is subjected to a first LSC process based on the LSC gain information of the normal exposure image; for example, multiple frames of Raw images are collected, and the multiple frames of Raw images include S A N B or S A N B L C , the LSC processing can be performed on the first frame S image (for example, the first frame short exposure image).

[0351] Exemplarily, LSC processing refers to correcting lens shading, wherein lens shading refers to the phenomenon of uneven image brightness and / or image color caused by the optical characteristics of the lens. LSC processing can generally include two parts: luma shading correction and color shading correction.

[0352] Optionally, since the color information and brightness information of the normal exposure image are transferred to the short exposure image in S608 , in a possible implementation, S605 may use the LSC gain information of the short exposure image.

[0353] S606: Color conversion and downsampling.

[0354] Optionally, the implementation of S606 may refer to the relevant description of S506 in FIG10 , which will not be repeated here.

[0355] S607: Second LSC processing.

[0356] Optionally, the image sensor collects multiple frames of Raw images; the multiple frames of Raw images include S A N B or S A N B L C; The second LSC processing can be performed on the first frame N image (for example, the first frame normal exposure image) based on the LSC gain information of the normal exposure image.

[0357] S608: Debanding the image.

[0358] Optionally, the implementation of S608 may refer to the relevant description of S505 in FIG10 , which will not be repeated here.

[0359] S609, post-processing.

[0360] Optionally, the implementation of S609 may refer to the relevant description of S508 in FIG10 , which will not be repeated here.

[0361] S610: Output the processed image.

[0362] Optionally, the implementation of S610 may refer to the relevant description of S509 in FIG10 , which will not be repeated here.

[0363] In an embodiment of the present application, if the LSC gain information of the short exposure image is used to perform LSC processing on the normal exposure image after color space conversion processing and downsampling processing, since the LSC gain information of the short exposure image does not match the color information and brightness information in the positive exposure image, the problem of excessive color correction will appear in the image after the LSC processing of the positive exposure image; in an embodiment of the present application, the LSC gain information of each frame of exposure image (for example, the LSC gain information of the normal exposure image) can be obtained based on statistical information. Therefore, when performing LSC processing on the normal exposure image, the normal exposure image can be LSC processed according to the LSC gain information of the normal exposure image, so that the LSC gain information matches the normal exposure image. , avoiding the problem of excessive color correction in the image after LSC processing; in addition, since there are no light and dark stripes and local color cast problems in the normal exposure image; by migrating the color information and brightness information of the normal exposure image to the short exposure image, the light and dark stripes and local color cast problems in the short exposure image are removed, and a processed short exposure image is obtained; it can be understood that the processed short exposure image includes the image content information of the short exposure image and the color information and brightness information of the normal exposure image; in summary, through the embodiments of the present application, it is possible to ensure that when capturing the moving moment image of a moving subject, the stripes and / or color cast image areas in the image are removed; and the problem of excessive color correction in the image is avoided, thereby improving the image quality. It should be noted that Example 1 shown in FIG10 only requires one LSC process compared to Example 2 shown in FIG11; therefore, compared to Example 2, Example 1 has a relatively small amount of computation required by the electronic device, resulting in a relatively small power consumption of the electronic device.

[0364] FIG12 is a schematic flow chart of an image processing method provided by an embodiment of the present application. The method 700 can be executed by the electronic device shown in FIG1 ; the method 700 includes S710 to S790 , which are described in detail below.

[0365] It should be understood that the method shown in Figure 12 is applied to the shooting environment where the light source of the electronic device is a stroboscopic light source; since the light source of the solution of the present application is a stroboscopic light source, when the exposure time when the electronic device acquires an image does not meet an integer multiple of milliseconds (for example, 1000 / the number of times the light source is on and off per second), banding stripes will appear in the image.

[0366] S710, open the camera application.

[0367] Optionally, please refer to the relevant description of S401, which will not be repeated here.

[0368] S720: Display a first image, where the first image includes stripes and / or color cast image areas.

[0369] The first image is an image of a shooting object captured based on a first exposure time, the shooting object is a moving object, and the first exposure time is less than the first duration.

[0370] Optionally, the first image may include stripes, that is, the first image includes Luma banding.

[0371] Optionally, the first image may include stripes and a color cast image area, that is, the first image includes Luma banding and Chroma banding.

[0372] It should be understood that Luma banding refers to the banding stripes caused by shortening the exposure time. Among them, Luma banding only changes in brightness and darkness, without any color change. The reason for Luma banding is that the AC sinusoidal wave band generated by the stroboscopic light source in the shooting environment cannot offset the exposure integration period, resulting in regular brightness stripes in the captured image.

[0373] Chroma banding refers to the color cast in localized areas of an image, where the localized area does not match the overall color of the image, resulting in a red, green, or blue cast. Chroma banding occurs because energy changes are accompanied by changes in color temperature, leading to color casts in the image. For example, Chroma banding occurs when the light and dark stripes in Luma banding appear different colors.

[0374] It should also be understood that stripes can refer to global banding, that is, light and dark stripes appear in the overall area of ​​the image; color cast image area can refer to local banding, that is, local color cast areas appear in the image, and the color cast areas do not match the overall color of the image; for example, red, green or blue color casts may appear.

[0375] It should also be understood that since the exposure time of the first image is less than the first duration, the exposure integration period cannot offset the banding; therefore, banding stripes may appear in the first image; in addition, when the voltage of the stroboscopic light source changes by 10%, the color temperature of the light source will change significantly (for example, around 1000K); the imaging of the image is related to the color temperature; since the color temperature will change significantly when the voltage of the charged light source changes slightly, a color cast problem will appear in the image.

[0376] Optionally, the first image may refer to a preview image in a preview interface of an electronic device; wherein the preview interface may refer to a photo taking preview interface or a video recording preview interface.

[0377] S730: A first operation is detected, where the first operation instructs the electronic device to take a photo or record a video.

[0378] For example, when the camera application is in a photo-taking mode, the first operation may refer to an operation of clicking a shutter button.

[0379] For example, when the camera application is in recording mode, the first operation may be clicking the recording control. It should be understood that the above is an example of the first operation; the electronic device may also be instructed to take a photo or record a video through voice commands or other operations; this application does not impose any limitations on this.

[0380] Optionally, the motion object may refer to a moving user, a moving object, or an image played in a video (eg, a movie).

[0381] Optionally, the electronic device includes an image signal processor, and the first image may be an image output by the image signal processor.

[0382] In an embodiment of the present application, the first image may be an image output by an image signal processor; since the first image is an image output by the signal processor, the image signal processor may perform denoising on the short-exposure Raw image, and therefore, although the first image includes banding stripes, the image detail information in the first image is relatively rich.

[0383] S740: In response to the first operation, acquire a second image.

[0384] The second image is an image of the subject captured based on a second exposure time, and the second exposure time is an integer multiple of the first exposure time. Optionally, the integer multiple includes 0.

[0385] It should be understood that, since the exposure time of the second image is an integer multiple of the first time length, the exposure integration period can offset the banding; therefore, no banding stripes appear in the second image.

[0386] For example, for a 50 Hz alternating current stroboscopic light source, the exposure time of the second image may be an integer multiple of 10 ms.

[0387] It should be understood that since the exposure time of the second image is an integer multiple of the first time length, each row of pixels in the second image receives the same energy, so there will be no energy fluctuation and no color cast problem in the second image; therefore, no stripes and color cast image areas will appear in the second image, that is, there is no Luma banding and Chroma banding in the second image.

[0388] Optionally, the first duration is obtained based on the number of times the stroboscopic light source switches on and off per second.

[0389] Optionally, the number of times the stroboscopic light source switches on and off per second is associated with the frequency of an operating voltage of the stroboscopic light source.

[0390] For example, the first duration=1000 / number of times the stroboscopic light source switches on and off per second.

[0391] In one example, the frequency of the operating voltage of the stroboscopic light source is 50 Hz, that is, the stroboscopic light source switches on and off 100 times per second, and the first duration is 10 ms; at this time, the exposure time of the first image is less than 10 ms, and the exposure time of the second image is an integer multiple of 10 ms.

[0392] In one example, the frequency of the operating voltage of the stroboscopic light source is 60 Hz, that is, the stroboscopic light source lights up and darkens 120 times per second, and the first duration is 8.3 ms; at this time, the exposure time of the first image is less than 8.3 ms, and the exposure time of the second image is an integer multiple of 8.3 ms.

[0393] It should be understood that the above is an example of the first duration; this application does not impose any limitation on the size of the first duration.

[0394] Optionally, the second image is an image obtained by performing a third image processing on a Raw image captured by the electronic device, and the third image processing includes a color space conversion process.

[0395] Illustratively, the electronic device may capture a normally exposed Raw image, and perform color space conversion processing on the normally exposed Raw image to obtain a second image.

[0396] For example, the second image may be an image in an RGB color space, or an image in a YUV color space.

[0397] It should be understood that in the embodiments of the present application, the second image is a normally exposed image; for example, the second image can be an image obtained by downsampling and color space conversion of the normally exposed Raw image; since in the embodiments of the present application, the color information and brightness information in the second image are required to perform migration processing on the first image, the requirements for the detail information in the second image are relatively low, that is, the second image does not need to be processed by the image signal processor.

[0398] Optionally, before acquiring the second image, the method further includes:

[0399] Detecting a shooting scene in which the electronic device is located and detecting a moving object;

[0400] Furthermore, it is detected that stripes and / or color cast image areas exist in the first image.

[0401] Exemplarily, the electronic device may include a detection module, which may detect the photographed object; when the photographed object includes a moving object, the detection module outputs an identifier, which may indicate that the photographed scene includes a moving object.

[0402] For example, an anti-flicker sensor (Flicker Sensor) in an electronic device may be used to detect whether stripes exist; wherein the anti-flicker sensor (Flicker Sensor) may be a sensor that samples ambient light.

[0403] In an embodiment of the present application, when there is a moving object in the shooting scene and the captured image includes banding, the electronic device can be triggered to execute the image processing method provided in the embodiment of the present application, that is, the method for removing banding from the image.

[0404] It should be understood that if the shooting scene includes a moving object, the electronic device will capture an image of the moving object at the moment of movement; since the shooting object is moving, the electronic device usually needs to reduce motion blur in the image; in order to reduce motion blur in the image, the electronic device can usually shorten the exposure time and increase the sensitivity value; however, for the shooting environment of a stroboscopic light source, reducing the exposure time will cause banding to appear in the image, so the banding in the image needs to be processed.

[0405] S750: Obtain a color conversion matrix and / or brightness parameters based on the first image and the second image.

[0406] The color conversion matrix is ​​used to perform color adjustment on the first image, and the brightness parameter is used to represent the grayscale of brightness.

[0407] Exemplarily, the brightness parameter may include a grayscale value of brightness. In the embodiment of the present application, since the second image is an image with a normal exposure time, there is no banding in the second image; the color conversion matrix and brightness parameters can be obtained by migrating the color and brightness of the second image to the first image.

[0408] It should be understood that the color conversion matrix may represent the color difference between pixels in the first image and the second image; for example, the color conversion matrix may include red pixel gain (R gain), green pixel gain (G gain), and blue pixel gain (B gain).

[0409] Optionally, a grid matrix can be obtained based on the pixels in the first image and the pixels in the second image; the data in the grid matrix can be used to characterize the difference in color and brightness between the first image and the second image; for example, the grid matrix can be a 32*32*8*9 grid matrix; where 32*32 can represent the width and height of the grid matrix, and 8 can represent the grayscale value of the brightness; 9 can represent a color conversion matrix, that is, a 3*3 matrix acting on each RGB value; the grid matrix can be a bilateral grid, which is a data structure.

[0410] Optionally, the above method further includes:

[0411] The first image and the second image are input into an image processing model to obtain bilateral grid data; wherein the image processing model is used to perform color migration processing and brightness migration processing on the first image based on the second image, the bilateral grid data includes a color conversion matrix and / or brightness parameters, and the size of the first image is the same as the size of the second image.

[0412] Exemplarily, the image processing model is a convolutional neural network; for example, the image processing model may be HDRnet.

[0413] In an embodiment of the present application, a color conversion matrix and / or brightness parameters are obtained based on a bilateral grid output by an image processing model; when the first image is subjected to color migration and brightness migration through the image processing model, the deviation area where the image content difference between the first image and the second image is relatively large, that is, the image processing model can identify the ghost area between the second image and the first image; therefore, the color conversion matrix and / or brightness parameters obtained through the image processing model will not introduce ghost areas when the color adjustment and / or brightness adjustment is performed on the first image, thereby improving the image quality.

[0414] Optionally, the first image and the second image may be firstly subjected to registration processing and smoothing processing; and pixel-by-pixel difference may be performed on the first image and the second image after the registration processing to obtain a color conversion matrix and / or brightness parameters.

[0415] S760: Perform first image processing on the first image based on the color conversion matrix and / or the brightness parameter to obtain a third image.

[0416] The third image is an image with stripes and / or color cast image areas removed.

[0417] Exemplarily, the color of the first image may be adjusted based on the color conversion matrix to remove the color cast image area in the first image; and the brightness of the first image may be adjusted based on the brightness parameter to remove the banding stripes in the first image.

[0418] Optionally, performing first image processing on the first image based on the color conversion matrix and / or the brightness parameter to obtain a third image includes:

[0419] The first image is interpolated based on the color conversion matrix and / or the brightness parameter to obtain a third image.

[0420] Exemplarily, the color conversion matrix and / or the brightness parameter may be multiplied by the matrix of the first image to obtain the third image.

[0421] Optionally, performing interpolation processing on the first image based on the color conversion matrix and / or the brightness parameter to obtain the third image includes:

[0422] performing first image processing on the first image based on a color conversion matrix and / or a brightness parameter in a first color space to obtain a processed image;

[0423] In the first color space, a second image processing is performed on the processed image to obtain a third image, where the second image processing is a color processing algorithm in the first color space.

[0424] Exemplarily, the first color space may be an RGB color space; that is, the first image processing may be performed in the RGB color space.

[0425] For example, in the RGB color space, the first image processing may be performed first, and then other algorithms related to color processing in the RGB color space may be performed.

[0426] Optionally, the image processing model is trained by:

[0427] Acquiring sample data, where the sample data includes a first sample image, a second sample image, and a third sample image, wherein the second sample image includes image content, stripes, and / or color cast image areas of the first sample image, the third sample image has the same image content as the first sample image, and image quality of the third sample image is higher than that of the first sample image;

[0428] Inputting the first sample image and the second sample image into the image processing model to be trained to obtain predicted bilateral grid data;

[0429] interpolating the second sample image based on the predicted bilateral grid data to obtain a predicted image;

[0430] The image processing model to be trained is trained based on the difference between the predicted image and the third sample image to obtain an image processing model.

[0431] S770: Obtain a first parameter based on the brightness information of the second image, wherein the first parameter is used for lens shading correction processing.

[0432] Optionally, the brightness information of the second image includes: data of a brightness channel of the second image, or brightness values ​​of pixels of the second image.

[0433] Optionally, the lens shading correction process includes color shading correction and brightness shading correction, and obtaining the first parameter based on brightness information of the second image includes:

[0434] Obtaining lens shading correction calibration parameters based on brightness information of the second image;

[0435] Multiplying the lens shading correction calibration parameters by the pixels in the second image to obtain a processed second image;

[0436] Obtaining a second parameter based on statistical information of the processed second image, where the statistical information of the second image includes a brightness histogram of the processed second image or a brightness gradient map of the processed second image, and the second parameter is used for color shading correction;

[0437] The lens shading correction calibration parameter is multiplied by the second parameter to obtain a first parameter, which is used for color shading correction and brightness shading correction.

[0438] For example, please refer to the relevant description of S407 in Figure 8, which will not be repeated here.

[0439] S780: Perform lens shading correction on the third image based on the first parameter to obtain a fourth image.

[0440] Optionally, the fourth image may be obtained by multiplying the third image by the first parameter.

[0441] S790: Display or save the fourth image.

[0442] For example, when the electronic device is running another application, the application has permission to call the camera application; when the other application calls the camera application to acquire an image, the fourth image can be displayed. For example, when the electronic device is running the camera application in shooting mode (or video recording mode), after the electronic device detects an operation indicating a photo capture (or an operation indicating a video capture), the fourth image can be saved.

[0443] In an embodiment of the present application, when the light source of the shooting environment in which the electronic device is located is a stroboscopic light source, and the electronic device needs to shoot a moving object so as to reduce the exposure time, resulting in banding stripes in the image; in an embodiment of the present application, by migrating the color information and brightness information of the second image (for example, the normal exposure image) to the first image (for example, the short exposure image), a third image is obtained by removing the stripes and / or the color cast image area in the first image; if the LSC gain information of the short exposure image is used to perform LSC processing on the third image, since the LSC gain information does not match the color information and brightness information in the third image, the third image after LSC processing is obtained. The problem of excessive color correction will appear in the fourth image after LSC processing; in the embodiment of the present application, the LSC gain information of each frame of exposure image can be obtained based on statistical information. Therefore, when LSC processing is performed on the third image, LSC processing can be performed on the third image according to the LSC gain information of the second image, so that the LSC gain information matches the third image, thereby avoiding the problem of excessive color correction in the fourth image after LSC processing; in summary, through the embodiments of the present application, it is possible to ensure that when capturing the motion moment image of the moving subject, the stripes and / or color cast image areas in the image are removed; and the problem of excessive color correction in the image is avoided, thereby improving the image quality.

[0444] The following describes an example of an interface schematic diagram in an electronic device with reference to FIG13 to FIG17.

[0445] FIG13 is a schematic diagram of an interface of an electronic device provided in an embodiment of the present application.

[0446] In an embodiment of the present application, after the electronic device runs a camera application, the preview image displayed in the preview interface displayed in the electronic device includes banding stripes and color cast image areas; after the electronic device detects a click operation on the smart control, the image processing method provided in the embodiment of the present application can be executed; that is, an image processing method that removes image stripes and performs LSC based on the gain information of the normally exposed image.

[0447] In one example, as shown in (b) of FIG14 , after the electronic device detects the operation of clicking the control 703 , it executes the image processing method provided in an embodiment of the present application.

[0448] For example, as shown in FIG13 , the graphical user interface (GUI) shown in (a) of FIG13 is the desktop 901 of the electronic device; the electronic device detects a click operation on the control 902 of the camera application on the desktop 901, as shown in (b) of FIG13 ; after the electronic device detects the click operation on the control 902 of the camera application on the desktop 901, the electronic device starts the camera application; for example, as shown in (a) of FIG14 , the electronic device can display a photo preview interface; the photo preview interface includes a preview image and a smart control 903, wherein the preview image includes light and dark stripes and a color cast image area 904; the color cast image area 904 can be red, green, blue or other colors; the electronic device detects a click operation on the smart control 903, as shown in (b) of FIG14 ; when the electronic device detects a click operation on the smart control 903 After the click operation on the photo control, if the electronic device detects the click operation on the photo control, the electronic device can execute the image processing method provided by the embodiment of the present application; for example, after the electronic device detects the operation on the smart control 903, the electronic device displays a preview interface, as shown in (a) in Figure 15; the preview interface includes a photo control 905; the electronic device detects the click operation on the photo control 905, as shown in (b) in Figure 15; after the electronic device detects the click operation on the photo control 905, it displays a preview interface; the preview interface includes a thumbnail 906, as shown in (c) in Figure 15; the electronic device detects the click operation on the thumbnail 906, as shown in (d) in Figure 15; after the electronic device detects the click operation on the thumbnail 906, it displays an image display interface, as shown in Figure 16.

[0449] In one example, as shown in (d) in FIG17 , after the electronic device detects a click operation on the control 909 , if the electronic device detects a click operation on the photo taking control, the image processing method provided in the embodiment of the present application is executed.

[0450] Exemplarily, after the camera application is opened in the electronic device, a preview interface as shown in (a) of Figure 17 can be displayed; the preview interface includes a preview image and a setting control 907, wherein the preview image includes light and dark stripes and a color cast image area 904, and the color cast image area 904 can be red, green, blue or other colors; the electronic device detects a click operation on the setting control 907, as shown in (b) of Figure 17; after the electronic device detects the click operation on the setting control 907, the setting interface is displayed, as shown in (c) of Figure 17; the setting interface includes a control 909 for removing image strips; the electronic device detects a click operation on the control 909 for removing image strips, as shown in (d) of Figure 17; after the electronic device detects the click operation on the control 909 for removing image strips, if the electronic device detects a click operation on the photo taking control, the image processing method provided in the embodiment of the present application is executed.

[0451] It should be noted that the above is an example description of the display interface in an electronic device, and this application does not impose any limitation on this.

[0452] It should be understood that the above examples are intended to help those skilled in the art understand the embodiments of the present application, and are not intended to limit the embodiments of the present application to the specific numerical values ​​or specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or variations based on the above examples, and such modifications or variations also fall within the scope of the embodiments of the present application.

[0453] The image processing method provided by the embodiments of the present application is described in detail above with reference to Figures 1 to 17 ; the device embodiment of the present application will be described in detail below with reference to Figures 18 and 19 . It should be understood that the device in the embodiments of the present application can perform the various methods of the aforementioned embodiments of the present application. That is, the specific working processes of the various products below can refer to the corresponding processes in the aforementioned method embodiments.

[0454] FIG18 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 1000 includes a processing module 1010 and a display module 1020 .

[0455] It should be understood that the light source of the shooting environment where the electronic device 1000 is located is a stroboscopic light source.

[0456] In one implementation, the processing module 1010 is used to: start a camera application; the display module 1020 is used to: display a first image, the first image is an image of a photographic object captured based on a first exposure time, the photographic object is a moving object, the first exposure time is less than a first duration, and the first image includes stripes and / or color cast image areas; the processing module 1010 is also used to: detect a first operation, the first operation instructs the electronic device to take a photo or record a video; in response to the first operation, obtain a second image, the second image is an image of the photographic object captured based on a second exposure time, the second exposure time is an integer multiple of the first duration; based on the The first image and the second image are used to obtain a color conversion matrix and / or brightness parameters, wherein the color conversion matrix is ​​used to perform color adjustment on the first image, and the brightness parameters are used to characterize the grayscale of brightness; based on the color conversion matrix and / or brightness parameters, the first image is processed first to obtain a third image, wherein the third image is an image in which the stripes and / or color cast image areas are removed; based on the brightness information of the second image, a first parameter is obtained, and the first parameter is used for lens shading correction processing; based on the first parameter, the lens shading correction processing is performed on the third image to obtain a fourth image; the display module 1020 is also used to: display or save the fourth image.

[0457] Optionally, as an embodiment, the processing module 1010 is further configured to:

[0458] The first image and the second image are input into an image processing model to obtain bilateral grid data; wherein the bilateral grid data includes the color conversion matrix and / or the brightness parameter, and the size of the first image is the same as the size of the second image.

[0459] Optionally, as an embodiment, the processing module 1010 is specifically configured to:

[0460] The first image is interpolated based on the color conversion matrix and / or the brightness parameter to obtain the third image.

[0461] Optionally, as an embodiment, the processing module 1010 is specifically configured to:

[0462] performing the first image processing on the first image based on the color conversion matrix and / or the brightness parameter in a first color space to obtain a processed image;

[0463] In the first color space, a second image processing is performed on the processed image to obtain the third image, where the second image processing is a color processing algorithm in the first color space.

[0464] Optionally, as an embodiment, the lens shading correction processing includes color shading correction and brightness shading correction, and the processing module 1010 is specifically configured to: obtain lens shading correction calibration parameters based on brightness information of the second image;

[0465] multiplying the lens shading correction calibration parameter by the pixel points in the second image to obtain a processed second image;

[0466] obtaining a second parameter based on statistical information of the processed second image, where the statistical information of the second image includes a brightness histogram of the processed second image or a brightness gradient map of the processed second image, and the second parameter is used for the color shading correction;

[0467] The lens shading correction calibration parameter is multiplied by the second parameter to obtain the first parameter, where the first parameter is used for the color shading correction and the brightness shading correction.

[0468] Optionally, as an embodiment, before acquiring the second image, the processing module 1010 is specifically configured to:

[0469] detecting a shooting scene in which the electronic device is located, and detecting the moving object;

[0470] Furthermore, it is detected that the stripes and / or color cast image areas exist in the first image.

[0471] Optionally, as an embodiment, the first duration is obtained based on the number of times the stroboscopic light source switches on and off per second.

[0472] Optionally, as an embodiment, the first duration=1000 / number of times the stroboscopic light source switches on and off per second.

[0473] Optionally, as an embodiment, the image processing model is a convolutional neural network.

[0474] Optionally, as an embodiment, the image processing model is trained by the following method:

[0475] Acquiring sample data, the sample data including a first sample image, a second sample image, and a third sample image, wherein the second sample image includes image content, stripes, and / or color cast image areas of the first sample image, the third sample image has the same image content as the first sample image, and image quality of the third sample image is higher than that of the first sample image;

[0476] Inputting the first sample image and the second sample image into an image processing model to be trained to obtain predicted bilateral grid data;

[0477] performing interpolation processing on the second sample image based on the predicted bilateral grid data to obtain a predicted image;

[0478] The image processing model to be trained is trained based on the difference between the predicted image and the third sample image to obtain the image processing model.

[0479] In another implementation, the processing module 1010 is used to: start a camera application; the display module 1020 is used to: display a first image, the first image is an image of a photographic object captured based on a first exposure time, the photographic object is a moving object, the first exposure time is less than a first duration, and the first image includes stripes and / or color cast image areas; the processing module 1010 is also used to: detect a first operation, the first operation instructs the electronic device to take a photo or record a video; in response to the first operation, obtain a second image, the second image is an image of the photographic object captured based on a second exposure time, the second exposure time is an integer multiple of the first duration; based on the The brightness information of the second image is used to obtain a first parameter, and the first parameter is used for lens shading correction processing; the lens shading correction processing is performed on the second image based on the first parameter to obtain a fifth image; based on the first image and the fifth image, a color conversion matrix and / or brightness parameters are obtained, the color conversion matrix is ​​used to adjust the color of the first image, and the brightness parameter is used to represent the grayscale of brightness; the first image is processed based on the color conversion matrix and / or brightness parameters to obtain a fourth image, and the fourth image is an image in which the stripes and / or color cast image areas are removed; the display module 1020 is also used to: display or save the fourth image.

[0480] Optionally, as an embodiment, the first image is an image after the lens shading correction processing is performed based on the first parameters.

[0481] Optionally, as an embodiment, the processing module 1010 is further configured to:

[0482] The first image and the fifth image are input into an image processing model to obtain bilateral grid data; wherein the bilateral grid data includes the color conversion matrix and / or the brightness parameter, and the size of the first image is the same as the size of the fifth image.

[0483] Optionally, as an embodiment, the processing module 1010 is specifically configured to:

[0484] The first image is interpolated based on the color conversion matrix and / or the brightness parameter to obtain the fourth image.

[0485] Optionally, as an embodiment, the processing module 1010 is further configured to:

[0486] performing the first image processing on the first image based on the color conversion matrix and / or the brightness parameter in a first color space to obtain a processed image;

[0487] In the first color space, a second image processing is performed on the processed image to obtain the fourth image, where the second image processing is a color processing algorithm in the first color space.

[0488] Optionally, as an embodiment, the lens shading correction process includes color shading correction and brightness shading correction, and the processing module 1010 is specifically configured to:

[0489] Obtaining lens shading correction calibration parameters based on brightness information of the second image;

[0490] multiplying the lens shading correction calibration parameter by the pixel points in the second image to obtain a processed second image;

[0491] obtaining a second parameter based on statistical information of the processed second image, where the statistical information of the second image includes a brightness histogram of the processed second image or a brightness gradient map of the processed second image, and the second parameter is used for the color shading correction;

[0492] The lens shading correction calibration parameter is multiplied by the second parameter to obtain the first parameter, where the first parameter is used for the color shading correction and the brightness shading correction.

[0493] Optionally, as an embodiment, before acquiring the second image, the processing module 1010 is further configured to:

[0494] detecting a shooting scene in which the electronic device is located, and detecting the moving object;

[0495] Furthermore, it is detected that the stripes and / or color cast image areas exist in the first image.

[0496] Optionally, as an embodiment, the first duration is obtained based on the number of times the stroboscopic light source switches on and off per second.

[0497] Optionally, as an embodiment, the first duration=1000 / number of times the stroboscopic light source switches on and off per second.

[0498] In a possible implementation, the number of times the stroboscopic light source switches on and off per second is associated with the frequency of an operating voltage of the stroboscopic light source.

[0499] Optionally, as an embodiment, the image processing model is a convolutional neural network.

[0500] Optionally, as an embodiment, the image processing model is trained by the following method:

[0501] Acquiring sample data, the sample data including a first sample image, a second sample image, and a third sample image, wherein the second sample image includes image content, stripes, and / or color cast image areas of the first sample image, the third sample image has the same image content as the first sample image, and image quality of the third sample image is higher than that of the first sample image;

[0502] Inputting the first sample image and the second sample image into an image processing model to be trained to obtain predicted bilateral grid data;

[0503] performing interpolation processing on the second sample image based on the predicted bilateral grid data to obtain a predicted image;

[0504] The image processing model to be trained is trained based on the difference between the predicted image and the third sample image to obtain the image processing model.

[0505] It should be noted that the electronic device 1000 is implemented in the form of a functional module. The term "module" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.

[0506] For example, a "module" may be a software program, a hardware circuit, or a combination of the two that implements the aforementioned functionality. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a dedicated processor, or a group processor) and memory for executing one or more software or firmware programs, combined logic circuits, and / or other suitable components that support the described functionality.

[0507] Therefore, the units of each example described in the embodiments of this application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0508] Figure 19 shows a schematic diagram of the structure of an electronic device provided by the present application. The dotted lines in Figure 19 indicate that the unit or module is optional; the electronic device 1100 can be used to implement the image processing method described in the above method embodiment.

[0509] Exemplarily, the electronic device 1100 includes one or more processors 1101, which can support the electronic device 1100 to implement the image processing method in the method embodiment. The processor 1101 can be a general-purpose processor or a special-purpose processor. For example, the processor 1101 can be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.

[0510] Optionally, the processor 1101 may be used to control the electronic device 1100, execute software programs, and process data of the software programs. The electronic device 1100 may further include a communication unit 1105 for implementing signal input (reception) and output (transmission).

[0511] For example, the electronic device 1100 may be a chip, the communication unit 1105 may be an input and / or output circuit of the chip, or the communication unit 1105 may be a communication interface of the chip, and the chip may be a component of a terminal device or other electronic device.

[0512] For another example, the electronic device 1100 may be a terminal device, and the communication unit 1105 may be a transceiver of the terminal device, or the communication unit 1105 may include one or more memories 1102 in 1100, on which a program 1104 is stored. The program 1104 can be executed by the processor 1101 to generate instructions 1103, so that the processor 1101 executes the image processing method described in the above method embodiment according to the instructions 1103.

[0513] Optionally, data may also be stored in the memory 1102 .

[0514] Optionally, the processor 1101 may also read data stored in the memory 1102 . The data may be stored at the same storage address as the program 1104 , or may be stored at a different storage address from the program 1104 .

[0515] Optionally, the processor 1101 and the memory 1102 may be provided separately or integrated together, for example, integrated on a system on chip (SOC) of the terminal device.

[0516] Exemplarily, the memory 1102 can be used to store the related program 1104 of the image processing method provided in the embodiment of the present application, and the processor 1101 can be used to call the related program 1104 of the image processing method stored in the memory 1102 when executing the image processing method, and execute the image processing method of the embodiment of the present application; for example, open the camera application; display a first image, the first image is an image of a photographing object captured based on a first exposure time, the photographing object is a moving object, the first exposure time is less than the first duration, and the first image includes stripes and / or color cast image areas; detect a first operation, the first operation instructs the electronic device to take a photo or record a video; in response to the first operation, obtain a second image, the second image is based on the second An image of the photographed object is captured with an exposure time, and the second exposure time is an integer multiple of the first exposure time; based on the first image and the second image, a color conversion matrix and / or brightness parameters are obtained, the color conversion matrix is ​​used to adjust the color of the first image, and the brightness parameter is used to characterize the grayscale of the brightness; based on the color conversion matrix and / or the brightness parameter, a first image processing is performed on the first image to obtain a third image, and the third image is an image with stripes and / or color cast image areas removed; based on the brightness information of the second image, a first parameter is obtained, and the first parameter is used for lens shading correction processing; based on the first parameter, a lens shading correction processing is performed on the third image to obtain a fourth image; the fourth image is displayed or saved; optionally, see Figure 10 or Figure 12.

[0517] Exemplarily, the memory 1102 can be used to store the related program 1104 of the image processing method provided in the embodiment of the present application, and the processor 1101 can be used to call the related program 1104 of the image processing method stored in the memory 1102 when executing the image processing method, and execute the image processing method of the embodiment of the present application; for example, open the camera application; display a first image, the first image is an image of the photographing object captured based on a first exposure time, the photographing object is a moving object, the first exposure time is less than the first duration, and the first image includes stripes and / or color cast image areas; detect a first operation, the first operation instructs the electronic device to take a photo or record a video; in response to the first operation, obtain a second image, the second image is An image of the photographed object is captured based on a second exposure time, where the second exposure time is an integer multiple of the first exposure time; a first parameter is obtained based on brightness information of the second image, and the first parameter is used for lens shading correction processing; lens shading correction processing is performed on the second image based on the first parameter to obtain a fifth image; a color conversion matrix and / or brightness parameters are obtained based on the first image and the fifth image, and the color conversion matrix is ​​used to adjust the color of the first image, and the brightness parameter is used to represent the grayscale of the brightness; a first image processing is performed on the first image based on the color conversion matrix and / or the brightness parameter to obtain a fourth image, and the fourth image is an image with stripes and / or color cast image areas removed; the fourth image is displayed or saved; optionally, see Figure 11.

[0518] Optionally, the present application further provides a computer program product, which, when executed by the processor 1101, implements the image processing method in any method embodiment of the present application.

[0519] For example, the computer program product may be stored in the memory 1102 , such as a program 1104 , which is converted into an executable target file that can be executed by the processor 1101 after undergoing preprocessing, compilation, assembly, and linking.

[0520] Optionally, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, implements the image processing method described in any method embodiment of the present application. The computer program may be a high-level language program or an executable target program.

[0521] For example, the computer-readable storage medium is memory 1102. Memory 1102 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

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

[0523] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0524] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the embodiments of the electronic device described above are merely illustrative. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

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

[0526] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0527] It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0528] In addition, the term "and / or" in this document simply describes an association between related objects, indicating that three possible relationships exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Furthermore, the character " / " in this document generally indicates that the related objects are in an "or" relationship.

[0529] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0530] The above is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the present application, which should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims. In short, the above is only a preferred embodiment of the technical solution of the present application, and is not used to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. An image processing method, characterized in that: Applied to an electronic device, the light source of the shooting environment of the electronic device is a stroboscopic light source, and the image processing method includes: Open the Camera app; Displaying a first image, where the first image is an image of a photographed object acquired based on a first exposure time, the photographed object is a moving object, the first exposure time is less than a first duration, and the first image includes stripes and / or a color cast image area; A first operation is detected, where the first operation instructs the electronic device to take a photo or record a video; In response to the first operation, a second image is acquired, where the second image is an image of the photographed object acquired based on a second exposure time, and the second exposure time is an integer multiple of the first time length; Based on the first image and the second image, a color conversion matrix and / or a brightness parameter are obtained, wherein the color conversion matrix is ​​used to perform color adjustment on the first image, and the brightness parameter is used to characterize a grayscale of brightness; Performing first image processing on the first image based on the color conversion matrix and / or brightness parameter to obtain a third image, wherein the third image is an image in which the stripes and / or the color cast image area are removed; Acquire a first parameter based on brightness information of the second image, where the first parameter is used for lens shading correction processing; Perform the lens shading correction process on the third image based on the first parameter to obtain a fourth image; The fourth image is displayed or saved.

2. The image processing method according to claim 1, characterized in that: Also includes: The first image and the second image are input into an image processing model to obtain bilateral grid data; wherein the bilateral grid data includes the color conversion matrix and / or the brightness parameter, and the size of the first image is the same as the size of the second image.

3. The image processing method according to claim 1 or 2, characterized in that: The performing first image processing on the first image based on the color conversion matrix and / or the brightness parameter to obtain a third image includes: The first image is interpolated based on the color conversion matrix and / or the brightness parameter to obtain the third image.

4. The image processing method according to claim 3, characterized in that: The interpolation processing of the first image based on the color conversion matrix and / or the brightness parameter to obtain the third image includes: In a first color space, performing the first image processing on the first image based on the color conversion matrix and / or the brightness parameter to obtain a processed image; In the first color space, a second image processing is performed on the processed image to obtain the third image, and the second image processing is a color processing algorithm in the first color space.

5. The image processing method according to any one of claims 1 to 4, characterized in that: The lens shading correction process includes color shading correction and brightness shading correction, and acquiring the first parameter based on the brightness information of the second image includes: Obtaining lens shading correction calibration parameters based on brightness information of the second image; Multiplying the lens shading correction calibration parameter with the pixel points in the second image to obtain a processed second image; Obtaining a second parameter based on statistical information of the processed second image, wherein the statistical information of the second image includes a brightness histogram of the processed second image or a brightness gradient map of the processed second image, and the second parameter is used for the color shading correction; The lens shading correction calibration parameter is multiplied by the second parameter to obtain the first parameter, where the first parameter is used for the color shading correction and the brightness shading correction.

6. The image processing method according to any one of claims 1 to 5, characterized in that: Before acquiring the second image, the method further includes: Detecting a shooting scene in which the electronic device is located, and detecting the moving object; Furthermore, it is detected that the stripes and / or the color cast image area exist in the first image.

7. The image processing method according to any one of claims 1 to 6, characterized in that: The first duration is obtained based on the number of times the stroboscopic light source switches on and off per second.

8. The image processing method according to claim 7, characterized in that: The first duration=1000 / number of times the stroboscopic light source turns on and off per second.

9. The image processing method according to claim 2, characterized in that: The image processing model is a convolutional neural network.

10. The image processing method according to claim 2 or 9, characterized in that: The image processing model is trained by the following method: Acquire sample data, the sample data comprising a first sample image, a second sample image and a third sample image, the second sample image comprising image content, stripes and / or color cast image areas of the first sample image, the third sample image having the same image content as the first sample image, and image quality of the third sample image being higher than that of the first sample image; Inputting the first sample image and the second sample image into the image processing model to be trained to obtain predicted bilateral grid data; performing interpolation processing on the second sample image based on the predicted bilateral grid data to obtain a predicted image; The image processing model to be trained is trained based on the difference between the predicted image and the third sample image to obtain the image processing model.

11. The image processing method according to any one of claims 1 to 10, characterized in that: The brightness information of the second image includes: data of a brightness channel of the second image, or brightness values ​​of pixels of the second image.

12. An image processing method, characterized in that: Applied to an electronic device, the light source of the shooting environment of the electronic device is a stroboscopic light source, and the image processing method includes: Open the Camera app; Displaying a first image, where the first image is an image of a photographed object acquired based on a first exposure time, the photographed object is a moving object, the first exposure time is less than a first duration, and the first image includes stripes and / or a color cast image area; A first operation is detected, where the first operation instructs the electronic device to take a photo or record a video; In response to the first operation, a second image is acquired, where the second image is an image of the photographed object acquired based on a second exposure time, and the second exposure time is an integer multiple of the first time length; A first parameter is obtained based on the brightness information of the second image, and the first parameter is used for lens shading correction. reason; Perform the lens shading correction process on the second image based on the first parameter to obtain a fifth image; Based on the first image and the fifth image, a color conversion matrix and / or a brightness parameter are obtained, wherein the color conversion matrix is ​​used to perform color adjustment on the first image, and the brightness parameter is used to characterize a grayscale of brightness; Performing first image processing on the first image based on the color conversion matrix and / or brightness parameter to obtain a fourth image, wherein the fourth image is an image in which the stripes and / or the color cast image area are removed; The fourth image is displayed or saved.

13. The image processing method according to claim 12, characterized in that: The first image is an image after the lens shading correction process is performed based on the first parameter.

14. The image processing method according to claim 12 or 13, characterized in that: Also includes: The first image and the fifth image are input into an image processing model to obtain bilateral grid data; wherein the bilateral grid data includes the color conversion matrix and / or the brightness parameter, and the size of the first image is the same as the size of the fifth image.

15. The image processing method according to any one of claims 12 to 14, characterized in that: The performing first image processing on the first image based on the color conversion matrix and / or the brightness parameter to obtain a fourth image includes: The first image is interpolated based on the color conversion matrix and / or the brightness parameter to obtain the fourth image.

16. The image processing method according to claim 15, characterized in that: The interpolation processing of the first image based on the color conversion matrix and / or the brightness parameter to obtain the fourth image includes: In a first color space, performing the first image processing on the first image based on the color conversion matrix and / or the brightness parameter to obtain a processed image; In the first color space, a second image processing is performed on the processed image to obtain the fourth image, where the second image processing is a color processing algorithm in the first color space.

17. The image processing method according to any one of claims 12 to 16, characterized in that: The brightness information of the second image includes: data of a brightness channel of the second image, or brightness values ​​of pixels of the second image.

18. An electronic device, characterized in that: include: one or more processors and memory; The memory is coupled to the one or more processors, and the memory is used to store computer program code, wherein the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the image processing method as described in any one of claims 1 to 11, or any one of claims 12 to 17.

19. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the processor is used to call computer instructions so that the electronic device executes the image processing method as described in any one of claims 1 to 11, or any one of 12 to 17.

20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the image processing method according to any one of claims 1 to 11, or any one of claims 12 to 17.

Citation Information

Patent Citations

  • Image processing method and electronic equipment

    CN117135293A

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

    CN110381263A

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

    CN110445988A

  • Image processing method and electronic equipment

    CN115633262A

  • System and method for raw image processing using conversion matrix interpolated from predetermined camera characterization matrices

    US20080089580A1

Cited By

  • Illegal parking snapshot image correction method and system based on brightness difference

    CN119152175A

  • Image processing method, electronic device, chip system and storage medium

    WO2026065518A1