CN116721038A - Color correction methods, electronic equipment and storage media - Google Patents

Color correction methods, electronic equipment and storage media Download PDF

Info

Publication number
CN116721038A
CN116721038A CN202310983691.0A CN202310983691A CN116721038A CN 116721038 A CN116721038 A CN 116721038A CN 202310983691 A CN202310983691 A CN 202310983691A CN 116721038 A CN116721038 A CN 116721038A
Authority
CN
China
Prior art keywords
image
color
model
color correction
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310983691.0A
Other languages
Chinese (zh)
Inventor
王敏刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310983691.0A priority Critical patent/CN116721038A/en
Publication of CN116721038A publication Critical patent/CN116721038A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4053Scaling of whole images or parts thereof, e.g. expanding or contracting based on super-resolution, i.e. the output image resolution being higher than the sensor resolution

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

本申请公开了一种颜色修正方法、电子设备及存储介质,涉及图像处理技术领域,用于实现针对图像的颜色修正,从而提升图像处理的效果。该方法包括:获取待处理图像;获取待处理图像的颜色修正系数,颜色修正系数用于对待处理图像中包括的各像素点在不同颜色通道上的颜色进行修正;基于颜色修正系数,在电子设备的显示屏上显示第一图像。

This application discloses a color correction method, electronic device and storage medium, which relate to the technical field of image processing and are used to implement color correction of images, thereby improving the effect of image processing. The method includes: obtaining an image to be processed; obtaining a color correction coefficient of the image to be processed, which is used to correct the color of each pixel point included in the image to be processed on different color channels; based on the color correction coefficient, in the electronic device The first image is displayed on the display.

Description

颜色修正方法、电子设备及存储介质Color correction methods, electronic equipment and storage media

技术领域Technical field

本申请涉及图像处理技术领域,尤其涉及一种颜色修正方法、电子设备及存储介质。The present application relates to the field of image processing technology, and in particular to a color correction method, electronic equipment and storage media.

背景技术Background technique

在图像处理技术领域中,高质量图像是进行图像处理工作的重要前提。然而,由于受到环境因素、相机参数等的影响,使得采集到的图像经常存在图像失真、图像模糊、图像缺损等问题,导致采集到的图像质量偏低,为后续的图像处理工作增加了难度。In the field of image processing technology, high-quality images are an important prerequisite for image processing work. However, due to the influence of environmental factors, camera parameters, etc., the collected images often have problems such as image distortion, image blur, and image defects, resulting in low quality of the collected images and making subsequent image processing more difficult.

目前,在采集到低质量图像时,通常会利用图像增强、图像去模糊、图像还原等中的一种或多种技术,对所采集的图像进行处理,以提升图像的质量。At present, when low-quality images are collected, one or more technologies such as image enhancement, image deblurring, and image restoration are usually used to process the collected images to improve the quality of the images.

然而,上述技术中,仅依赖于图像增强、图像去模糊、图像还原等技术,图像处理的效果较差。However, the above-mentioned technologies only rely on image enhancement, image deblurring, image restoration and other technologies, and the effect of image processing is poor.

发明内容Contents of the invention

本申请提供了一种颜色修正方法、电子设备及存储介质,用于实现针对图像的颜色修正,从而提升图像处理的效果。This application provides a color correction method, electronic device and storage medium for realizing color correction of images, thereby improving the effect of image processing.

为达到上述目的,本申请采用如下技术方案:In order to achieve the above purpose, this application adopts the following technical solutions:

第一方面,提供了一种颜色修正方法,应用于电子设备。The first aspect provides a color correction method applied to electronic devices.

该方法可以包括:获取待处理图像;获取该待处理图像的颜色修正系数;基于该颜色修正系数,在该电子设备的显示屏上显示第一图像。The method may include: obtaining an image to be processed; obtaining a color correction coefficient of the image to be processed; and displaying the first image on the display screen of the electronic device based on the color correction coefficient.

其中,该颜色修正系数用于对该待处理图像中包括的各像素点在不同颜色通道上的颜色进行修正。如此,能够从像素点维度出发实现对不同颜色通道上颜色的修正,从而实现针对图像的颜色修正,以提升图像处理的效果。The color correction coefficient is used to correct the color of each pixel included in the image to be processed on different color channels. In this way, the color correction on different color channels can be realized from the pixel dimension, thereby achieving color correction for the image to improve the effect of image processing.

该第一图像是基于该颜色修正系数对该待处理图像进行颜色修正后得到的图像。这样,通过在该电子设备的显示屏上显示颜色修正后得到的图像,能够为用户显示出颜色质量更高、更加贴近真实颜色效果的图像,提高了图像的显示效果。The first image is an image obtained by performing color correction on the image to be processed based on the color correction coefficient. In this way, by displaying the color-corrected image on the display screen of the electronic device, an image with higher color quality and closer to the true color effect can be displayed to the user, thereby improving the display effect of the image.

在第一方面的一种可能的实现方式中,该待处理图像可以为第二图像,或者,该待处理图像也可以为对该第二图像进行图像处理后得到的图像。也就是说,本申请提供的颜色修正方法,不仅可以针对原始的第二图像进行颜色修正,也可以针对基于第二图像经图像处理后的图像进行颜色修正。如此,丰富了待处理图像的类型,提升了颜色修正的灵活性。In a possible implementation of the first aspect, the image to be processed may be a second image, or the image to be processed may also be an image obtained by image processing the second image. That is to say, the color correction method provided by this application can not only perform color correction on the original second image, but also can perform color correction on the image processed based on the second image. In this way, the types of images to be processed are enriched and the flexibility of color correction is improved.

其中,该第二图像为第一应用的待在该显示屏上显示的图像。例如,第一应用可以是相机应用、图库应用、视频应用、游戏应用或剪辑应用。相应地,上述第二图像可以是相机应用中的预览图像或拍摄图像、图库应用中保存的图像、视频应用中待播放的视频图像、游戏应用中的游戏图像或用户在剪辑应用中上传的待剪辑图像。Wherein, the second image is an image of the first application to be displayed on the display screen. For example, the first application may be a camera application, a gallery application, a video application, a game application, or an editing application. Correspondingly, the above-mentioned second image may be a preview image or a captured image in a camera application, an image saved in a gallery application, a video image to be played in a video application, a game image in a game application, or an image to be uploaded by the user in an editing application. Clip the image.

相应地,在该待处理图像为对该第二图像进行图像处理后得到的图像的情况下,该获取待处理图像,包括:接收用户触发该第一应用显示图像的操作;响应于该触发该第一应用显示图像的操作,获取待显示的该第二图像;对该第二图像进行图像处理,以获得该待处理图像。也就是说,用户通过在第一应用中实施触发操作,能够触发该第一应用显示第二图像,此时可以直接获取待显示的第二图像,进而,通过图像处理即可获得经图像处理后的待处理图像。如此,提供了一种基于第一应用来获取待处理图像的方式,能够快速且高效的获取到待显示的该第二图像,进而,也能够快速且高效的获取到经图像处理后的待处理图像。Correspondingly, when the image to be processed is an image obtained by performing image processing on the second image, obtaining the image to be processed includes: receiving an operation by the user to trigger the first application to display the image; and responding to the triggering of the image display. The first application displays an image to obtain the second image to be displayed; and performs image processing on the second image to obtain the image to be processed. That is to say, the user can trigger the first application to display the second image by performing a trigger operation in the first application. At this time, the user can directly obtain the second image to be displayed, and further, the image-processed image can be obtained through image processing. of images to be processed. In this way, a method of obtaining an image to be processed based on the first application is provided, which can quickly and efficiently obtain the second image to be displayed, and furthermore, can also quickly and efficiently obtain the image-processed image to be processed. image.

并且,在该电子设备的显示屏上显示第一图像,包括:在该第一应用的界面中显示该第一图像。此时,在该第一应用的界面中所显示的该第一图像,也即是对待处理图像进行颜色修正后得到的图像。Furthermore, displaying the first image on the display screen of the electronic device includes: displaying the first image in the interface of the first application. At this time, the first image displayed in the interface of the first application is an image obtained after color correction of the image to be processed.

下面以上述所示的第一应用为例,以该待处理图像为对该第二图像进行图像处理后得到的图像为例,对获取待处理图像的过程进行示例性说明。The following takes the first application shown above as an example, and takes the image to be processed as an image obtained by performing image processing on the second image as an example to illustrate the process of obtaining the image to be processed.

在第一方面的另一种可能的实现方式中,该第一应用为相机应用,该第二图像为响应于用户开启该相机应用的操作该电子设备采集到的预览图像,或,响应于用户在该相机应用中的拍摄操作该电子设备拍摄到的拍摄图像。In another possible implementation of the first aspect, the first application is a camera application, and the second image is a preview image collected by the electronic device in response to the user's operation of opening the camera application, or in response to the user's operation of opening the camera application. The photographing operation in the camera application captures the photographed image captured by the electronic device.

在该待处理图像为对该第二图像进行图像处理后得到的图像的情况下,该获取待处理图像,包括:接收用户开启该相机应用的操作;响应于该开启该相机应用的操作,获取该电子设备采集到的该第二图像;对该第二图像进行图像处理,以获得该待处理图像;或,接收用户在该相机应用中的拍摄操作;响应于该拍摄操作,获取该电子设备拍摄到的该第二图像;对该第二图像进行图像处理,以获得该待处理图像。也就是说,用户通过在相机应用中实施触发操作(如相机应用的开启操作或相机应用的拍摄操作),能够触发该相机应用显示预览图像或拍摄图像,此时可以直接获取到预览图像或拍摄图像,进而,通过图像处理即可获得经图像处理后的预览图像或拍摄图像。In the case where the image to be processed is an image obtained after image processing of the second image, obtaining the image to be processed includes: receiving an operation of the user to open the camera application; in response to the operation of opening the camera application, obtaining The second image collected by the electronic device; perform image processing on the second image to obtain the image to be processed; or receive the user's shooting operation in the camera application; in response to the shooting operation, obtain the electronic device The captured second image is image-processed to obtain the image to be processed. That is to say, by performing a trigger operation in the camera application (such as the opening operation of the camera application or the shooting operation of the camera application), the user can trigger the camera application to display the preview image or capture the image. At this time, the user can directly obtain the preview image or capture the image. image, and then, through image processing, a preview image or a captured image can be obtained after image processing.

并且,在该电子设备的显示屏上显示第一图像,包括:在该相机应用的预览界面中显示该第一图像;或,在该相机应用的图像查看界面中显示该第一图像。此时,在该相机应用的界面中所显示的预览图像或拍摄图像,也即是经颜色修正后得到的预览图像或拍摄图像。Furthermore, displaying the first image on the display screen of the electronic device includes: displaying the first image in a preview interface of the camera application; or displaying the first image in an image viewing interface of the camera application. At this time, the preview image or captured image displayed in the interface of the camera application is the preview image or captured image obtained after color correction.

在第一方面的另一种可能的实现方式中,该第一应用为图库应用,该第二图像为图库应用中保存的图像。In another possible implementation of the first aspect, the first application is a gallery application, and the second image is an image saved in the gallery application.

在该待处理图像为对该第二图像进行图像处理后得到的图像的情况下,该获取待处理图像,包括:接收用户开启该图库应用的操作;响应于该开启该图库应用的操作,从本地图库获取该第二图像;对该第二图像进行图像处理,以获得该待处理图像。也就是说,用户通过在图库应用中实施触发操作(如图库应用的开启操作),能够触发该图库应用显示图库应用中保存的图像,此时可以直接获取到图库应用中保存的图像,进而,通过图像处理即可获得经图像处理后的图库应用中保存的图像。In the case where the image to be processed is an image obtained by performing image processing on the second image, obtaining the image to be processed includes: receiving an operation of the user to open the gallery application; in response to the operation of opening the gallery application, from The local gallery obtains the second image; performs image processing on the second image to obtain the image to be processed. That is to say, by performing a triggering operation in the gallery application (such as the opening operation of the gallery application), the user can trigger the gallery application to display the images saved in the gallery application. At this time, the user can directly obtain the images saved in the gallery application, and then, Through image processing, the image saved in the gallery application can be obtained after image processing.

并且,在该电子设备的显示屏上显示第一图像,包括:在该图库应用的图像列表界面中显示该第一图像的缩略图。此时,在该图库应用的界面中所显示的图库应用中保存的图像,也即是经颜色修正后得到的图库应用中保存的图像。Furthermore, displaying the first image on the display screen of the electronic device includes: displaying a thumbnail of the first image in an image list interface of the gallery application. At this time, the image saved in the gallery application displayed in the interface of the gallery application is the image saved in the gallery application obtained after color correction.

在第一方面的另一种可能的实现方式中,该第一应用为视频应用,该第二图像为视频应用中待播放的视频图像。In another possible implementation of the first aspect, the first application is a video application, and the second image is a video image to be played in the video application.

在该待处理图像为对该第二图像进行图像处理后得到的图像的情况下,该获取待处理图像,包括:接收用户在该视频应用中播放视频的操作;响应于该播放视频的操作,从服务器获取待播放的该第二图像;对该第二图像进行图像处理,以获得该待处理图像。也就是说,用户通过在视频应用中实施触发操作(如视频应用的播放操作),能够触发该视频应用显示待播放的视频图像,此时可以直接获取到待播放的视频图像,进而,通过图像处理即可获得经图像处理后的待播放的视频图像。In the case where the image to be processed is an image obtained by performing image processing on the second image, obtaining the image to be processed includes: receiving an operation of the user to play a video in the video application; in response to the operation of playing the video, Obtain the second image to be played from the server; perform image processing on the second image to obtain the image to be processed. That is to say, the user can trigger the video application to display the video image to be played by performing a trigger operation in the video application (such as the playback operation of the video application). At this time, the user can directly obtain the video image to be played, and then, through the image After processing, the video image to be played can be obtained after image processing.

并且,在该电子设备的显示屏上显示第一图像,包括:在该视频应用的播放界面中显示该第一图像。此时,在该视频应用的界面中所显示的待播放的视频图像,也即是经颜色修正后得到的待播放的视频图像。Furthermore, displaying the first image on the display screen of the electronic device includes: displaying the first image in a playback interface of the video application. At this time, the video image to be played displayed in the interface of the video application is the video image to be played after color correction.

在第一方面的另一种可能的实现方式中,该第一应用为游戏应用,该第二图像为游戏图像。In another possible implementation of the first aspect, the first application is a game application, and the second image is a game image.

在该待处理图像为对该第二图像进行图像处理后得到的图像的情况下,该获取待处理图像,包括:接收用户开启该游戏应用的操作;响应于该开启该游戏应用的操作,从服务器获取待显示的该第二图像;对该第二图像进行图像处理,以获得该待处理图像。也就是说,用户通过在游戏应用中实施触发操作(如游戏应用的开启操作),能够触发该游戏应用显示游戏图像,此时可以直接获取到游戏图像,进而,通过图像处理即可获得经图像处理后的游戏图像。In the case where the image to be processed is an image obtained by performing image processing on the second image, obtaining the image to be processed includes: receiving an operation of the user to start the game application; in response to the operation of starting the game application, from The server obtains the second image to be displayed and performs image processing on the second image to obtain the image to be processed. That is to say, the user can trigger the game application to display the game image by performing a trigger operation in the game application (such as the opening operation of the game application). At this time, the game image can be obtained directly, and then the image can be obtained through image processing. Processed game image.

并且,在该电子设备的显示屏上显示第一图像,包括:在该游戏应用的游戏界面中显示该第一图像。此时,在该游戏应用的界面中所显示的游戏图像,也即是经颜色修正后得到的游戏图像。Furthermore, displaying the first image on the display screen of the electronic device includes: displaying the first image in a game interface of the game application. At this time, the game image displayed in the interface of the game application is the game image obtained after color correction.

在第一方面的另一种可能的实现方式中,该第一应用为剪辑应用,该第二图像为用户在剪辑应用中上传的待剪辑图像。In another possible implementation of the first aspect, the first application is an editing application, and the second image is an image to be edited uploaded by the user in the editing application.

在该待处理图像为对该第二图像进行图像处理后得到的图像的情况下,该获取待处理图像,包括:接收用户在剪辑应用中上传图像的操作;响应于该上传图像的操作,获取所上传的第二图像;对该第二图像进行图像处理,以获得该待处理图像。也就是说,用户通过在剪辑应用中实施触发操作(如上传图像的操作),能够触发该剪辑应用显示所上传的待剪辑图像,此时可以直接获取到所上传的待剪辑图像,进而,通过图像处理即可获得经图像处理后的待剪辑图像。In the case where the image to be processed is an image obtained by performing image processing on the second image, obtaining the image to be processed includes: receiving an operation of the user to upload an image in the editing application; in response to the operation of uploading the image, obtaining The uploaded second image; perform image processing on the second image to obtain the image to be processed. That is to say, by performing a trigger operation (such as uploading an image) in the editing application, the user can trigger the editing application to display the uploaded image to be edited. At this time, the user can directly obtain the uploaded image to be edited, and then, through Image processing can obtain the image to be edited after image processing.

并且,在该电子设备的显示屏上显示第一图像,包括:在该剪辑应用的剪辑界面中显示该第一图像。此时,在该剪辑应用的界面中所显示的待剪辑图像,也即是经颜色修正后得到的待剪辑图像。Furthermore, displaying the first image on the display screen of the electronic device includes: displaying the first image in an editing interface of the editing application. At this time, the image to be edited displayed in the interface of the editing application is the image to be edited after color correction.

综上,提供了多种类型的第一应用以及基于对应类型的应用来获取待处理图像的过程。如此,能够快速且高效的获取到待显示的该第二图像,进而,通过图像处理即可获得经图像处理后的图像。In summary, multiple types of first applications and processes for obtaining images to be processed based on corresponding types of applications are provided. In this way, the second image to be displayed can be obtained quickly and efficiently, and further, the image-processed image can be obtained through image processing.

在第一方面的另一种可能的实现方式中,可采用第一颜色修正模型,来执行本申请提供的颜色修正方法。其中:In another possible implementation of the first aspect, the first color correction model can be used to execute the color correction method provided by the present application. in:

获取该待处理图像的颜色修正系数,包括:将该待处理图像输入第一颜色修正模型,通过该第一颜色修正模型的预测子模型,预测该待处理图像的颜色修正系数。如此,通过在第一颜色修正模型中设置用于预测颜色修正系数的预测子模型,来实现对待处理图像的颜色修正系数的预测。Obtaining the color correction coefficient of the image to be processed includes: inputting the image to be processed into a first color correction model, and predicting the color correction coefficient of the image to be processed through the prediction sub-model of the first color correction model. In this way, by setting the prediction sub-model for predicting the color correction coefficient in the first color correction model, prediction of the color correction coefficient of the image to be processed is achieved.

基于该颜色修正系数,在该电子设备的显示屏上显示第一图像,包括:通过该第一颜色修正模型的修正子模型,基于该颜色修正系数对该待处理图像进行颜色修正,得到该第一图像;在该电子设备的显示屏上显示该第一图像。如此,通过在第一颜色修正模型中设置用于颜色修正的修正子模型,来实现对待处理图像的颜色修正。Based on the color correction coefficient, displaying the first image on the display screen of the electronic device includes: performing color correction on the image to be processed based on the color correction coefficient through the correction sub-model of the first color correction model to obtain the third An image; displaying the first image on the display screen of the electronic device. In this way, by setting the correction sub-model for color correction in the first color correction model, color correction of the image to be processed is achieved.

在该种可能的实现方式中,提供了一种基于第一颜色修正模型来进行颜色修正的方案。通过第一颜色修正模型,能够从像素点维度出发实现对不同颜色通道上颜色的修正,从而实现针对图像的颜色修正,以提升图像处理的效果。进而,通过在该电子设备的显示屏上显示颜色修正后得到的图像,能够为用户显示出颜色质量更高、更加贴近真实颜色效果的图像,提高了图像的显示效果。In this possible implementation, a color correction solution based on the first color correction model is provided. Through the first color correction model, the color correction on different color channels can be implemented from the pixel dimension, thereby achieving color correction for the image to improve the effect of image processing. Furthermore, by displaying the color-corrected image on the display screen of the electronic device, an image with higher color quality and closer to the real color effect can be displayed to the user, thereby improving the display effect of the image.

下面基于该待处理图像所包括的两种类型,对上述基于第一颜色修正模型来进行颜色修正的方案进行示例性说明。Based on the two types of images to be processed, the above-mentioned color correction scheme based on the first color correction model will be exemplified below.

例如,在该待处理图像为该第二图像的情况下,获取该待处理图像的颜色修正系数,包括:将该第二图像输入第一颜色修正模型,通过该第一颜色修正模型的预测子模型,预测该第二图像的颜色修正系数。基于该颜色修正系数,在该电子设备的显示屏上显示第一图像,包括:通过该第一颜色修正模型的修正子模型,基于该颜色修正系数对该第二图像进行颜色修正,得到该第一图像;在该电子设备的显示屏上显示该第一图像。For example, when the image to be processed is the second image, obtaining the color correction coefficient of the image to be processed includes: inputting the second image into a first color correction model, and using the predictor of the first color correction model. model to predict the color correction coefficient of the second image. Based on the color correction coefficient, displaying the first image on the display screen of the electronic device includes: performing color correction on the second image based on the color correction coefficient through the correction sub-model of the first color correction model to obtain the third An image; displaying the first image on the display screen of the electronic device.

又如,在该待处理图像为对该第二图像进行图像处理后得到的图像的情况下,该获取该待处理图像的颜色修正系数,包括:将图像处理后的图像输入第一颜色修正模型,通过该第一颜色修正模型的预测子模型,预测该图像处理后的图像的颜色修正系数。基于该颜色修正系数,在该电子设备的显示屏上显示第一图像,包括:通过该第一颜色修正模型的修正子模型,基于该颜色修正系数对该图像处理后的图像进行颜色修正,得到该第一图像;在该电子设备的显示屏上显示该第一图像。For another example, when the image to be processed is an image obtained by performing image processing on the second image, obtaining the color correction coefficient of the image to be processed includes: inputting the image processed image into a first color correction model , predict the color correction coefficient of the image after image processing through the prediction sub-model of the first color correction model. Based on the color correction coefficient, displaying the first image on the display screen of the electronic device includes: performing color correction on the processed image based on the color correction coefficient through the correction sub-model of the first color correction model, to obtain The first image; display the first image on the display screen of the electronic device.

在第一方面的另一种可能的实现方式中,通过该第一颜色修正模型的预测子模型,预测该待处理图像的颜色修正系数,包括:通过该预测子模型的特征提取层,对该待处理图像进行特征提取,得到该待处理图像在不同颜色通道上的颜色特征;通过该预测子模型的卷积层,对该待处理图像在不同颜色通道上的颜色特征进行卷积处理,得到该待处理图像在不同颜色通道上的颜色修正系数。In another possible implementation of the first aspect, predicting the color correction coefficient of the image to be processed through the prediction sub-model of the first color correction model includes: using the feature extraction layer of the prediction sub-model, Feature extraction is performed on the image to be processed to obtain the color features of the image to be processed on different color channels; through the convolution layer of the prediction sub-model, the color features of the image to be processed on different color channels are convolved to obtain Color correction coefficients on different color channels of the image to be processed.

在该种可能的实现方式中,通过在预测子模型中设置特征提取层和卷积层,利用特征提取层提取待处理图像在不同颜色通道上的颜色特征,利用卷积层对提取到的颜色特征进行卷积处理,以得到该颜色修正系数。如此,提供了一种基于特征提取层和卷积层构成的预测子模型,能够预测得到待处理图像在不同颜色通道上的颜色修正系数。In this possible implementation, a feature extraction layer and a convolution layer are set up in the prediction sub-model, the feature extraction layer is used to extract the color features of the image to be processed on different color channels, and the convolution layer is used to extract the extracted color The features are convolved to obtain the color correction coefficient. In this way, a prediction sub-model based on the feature extraction layer and the convolution layer is provided, which can predict the color correction coefficients of the image to be processed on different color channels.

在第一方面的另一种可能的实现方式中,在该待处理图像为对该第二图像进行图像处理后得到的图像的情况下,可采用第二颜色修正模型,来执行本申请提供的颜色修正方法。其中:In another possible implementation of the first aspect, when the image to be processed is an image obtained by image processing the second image, a second color correction model can be used to perform the method provided by this application. Color correction methods. in:

获取待处理图像,包括:将该第二图像输入第二颜色修正模型,通过该第二颜色修正模型的处理子模型对该第二图像进行图像处理,得到该待处理图像。如此,通过在第二颜色修正模型中设置用于图像处理的处理子模型,来实现对待处理图像的图像处理。Obtaining the image to be processed includes: inputting the second image into a second color correction model, performing image processing on the second image through the processing sub-model of the second color correction model, and obtaining the image to be processed. In this way, by setting the processing sub-model for image processing in the second color correction model, image processing of the image to be processed is achieved.

获取该待处理图像的颜色修正系数,包括:通过该第二颜色修正模型的预测子模型,预测该第二图像的颜色修正系数,作为该待处理图像的颜色修正系数。如此,通过在第二颜色修正模型中设置用于预测颜色修正系数的预测子模型,来实现对颜色修正系数的预测。Obtaining the color correction coefficient of the image to be processed includes: predicting the color correction coefficient of the second image through the prediction sub-model of the second color correction model as the color correction coefficient of the image to be processed. In this way, by setting the prediction sub-model for predicting the color correction coefficient in the second color correction model, prediction of the color correction coefficient is achieved.

基于该颜色修正系数,在该电子设备的显示屏上显示第一图像,包括:通过该第二颜色修正模型的修正子模型,基于该颜色修正系数对该待处理图像进行颜色修正,得到该第一图像;在该电子设备的显示屏上显示该第一图像。如此,通过在第一颜色修正模型中设置用于颜色修正的修正子模型,来实现对图像处理后的图像的颜色修正。Based on the color correction coefficient, displaying the first image on the display screen of the electronic device includes: performing color correction on the image to be processed based on the color correction coefficient through the correction sub-model of the second color correction model to obtain the third An image; displaying the first image on the display screen of the electronic device. In this way, by setting the correction sub-model for color correction in the first color correction model, color correction of the image after image processing is achieved.

在该种可能的实现方式中,提供了一种基于第二颜色修正模型来进行颜色修正的方案。其中,具体提供了一种兼具颜色修正功能以及图像处理功能的模型,不仅可以对待处理图像进行图像处理,还能够有效提升图像的颜色质量,从而提升图像处理的效果。进而,通过在该电子设备的显示屏上显示颜色修正后得到的图像,能够为用户显示出颜色质量更高、更加贴近真实颜色效果的图像,提高了图像的显示效果。In this possible implementation, a color correction solution based on the second color correction model is provided. Among them, a model with both color correction function and image processing function is provided, which can not only perform image processing on the image to be processed, but also effectively improve the color quality of the image, thereby improving the effect of image processing. Furthermore, by displaying the color-corrected image on the display screen of the electronic device, an image with higher color quality and closer to the real color effect can be displayed to the user, thereby improving the display effect of the image.

在第一方面的另一种可能的实现方式中,通过该第二颜色修正模型的预测子模型,预测该第二图像的颜色修正系数,包括:通过该预测子模型的特征提取层,对该第二图像进行特征提取,得到该第二图像在不同颜色通道上的颜色特征;通过该预测子模型的卷积层,对该第二图像在不同颜色通道上的颜色特征进行卷积处理,得到该第二图像在不同颜色通道上的颜色修正系数。In another possible implementation of the first aspect, predicting the color correction coefficient of the second image through a prediction sub-model of the second color correction model includes: using a feature extraction layer of the prediction sub-model to predict the color correction coefficient of the second image. Feature extraction is performed on the second image to obtain the color features of the second image on different color channels; through the convolution layer of the prediction sub-model, the color features of the second image on different color channels are convolved to obtain Color correction coefficients for the second image on different color channels.

在该种可能的实现方式中,通过在预测子模型中设置特征提取层和卷积层,利用特征提取层提取第二图像在不同颜色通道上的颜色特征,利用卷积层对提取到的颜色特征进行卷积处理,以得到该颜色修正系数。如此,提供了一种基于特征提取层和卷积层构成的预测子模型,能够预测得到第二图像在不同颜色通道上的颜色修正系数。In this possible implementation, a feature extraction layer and a convolution layer are set up in the prediction sub-model, the feature extraction layer is used to extract the color features of the second image on different color channels, and the convolution layer is used to extract the extracted color The features are convolved to obtain the color correction coefficient. In this way, a prediction sub-model based on the feature extraction layer and the convolution layer is provided, which can predict the color correction coefficients of the second image on different color channels.

在第一方面的另一种可能的实现方式中,该特征提取层包括至少两层目标模型结构,该目标模型结构包括卷积层、批标准化层及激活函数层。In another possible implementation of the first aspect, the feature extraction layer includes at least two layers of target model structures, and the target model structure includes a convolution layer, a batch normalization layer, and an activation function layer.

在该种可能的实现方式中,提供了一种基于至少两层目标模型结构构成的特征提取层。其中,该目标模型结构包括卷积层、批标准化层及激活函数层。这样,构成的特征提取层具备良好的特征提取能力,能够提取得到更加丰富且有效的颜色特征,从而基于所提取的颜色特征来预测待处理图像的颜色修正系数,能够提升颜色修正系数的预测准确性。In this possible implementation, a feature extraction layer based on at least two layers of target model structure is provided. Among them, the target model structure includes a convolution layer, a batch normalization layer and an activation function layer. In this way, the feature extraction layer formed has good feature extraction capabilities and can extract richer and more effective color features, thereby predicting the color correction coefficient of the image to be processed based on the extracted color features, which can improve the accuracy of prediction of the color correction coefficient. sex.

在第一方面的另一种可能的实现方式中,该颜色修正系数包括该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数。相应地,可基于颜色修正系数包括的各像素点在不同颜色通道上的第一修正系数,来进行颜色修正。In another possible implementation of the first aspect, the color correction coefficient includes a first correction coefficient on different color channels for each pixel included in the image to be processed. Correspondingly, color correction can be performed based on the first correction coefficient on different color channels of each pixel included in the color correction coefficient.

相应过程可以包括:基于该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数,对该待处理图像中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到该第一图像。The corresponding process may include: based on the first correction coefficient of each pixel point included in the image to be processed on different color channels, performing a first adjustment on the color value of each pixel point included in the image to be processed on the corresponding color channel. Process to obtain the first image.

也就是说,结合不同颜色通道上的第一修正系数以及对应颜色通道上的颜色值进行第一调节处理,能够从像素点维度出发实现对颜色通道上的颜色值的修正,也就实现了对待处理图像的颜色修正,从而获得颜色质量更高的第一图像。That is to say, by combining the first correction coefficients on different color channels and the color values on the corresponding color channels for the first adjustment process, the color values on the color channels can be corrected from the pixel point dimension, thus achieving the treatment Process the color correction of the image, resulting in a first image with higher color quality.

在第一方面的另一种可能的实现方式中,该颜色修正系数还包括该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数和第二修正系数。相应地,可结合颜色修正系数包括的各像素点在不同颜色通道上的第一修正系数以及第二修正系数,来进行颜色修正。In another possible implementation of the first aspect, the color correction coefficient further includes a first correction coefficient and a second correction coefficient on different color channels for each pixel included in the image to be processed. Correspondingly, color correction can be performed in combination with the first correction coefficient and the second correction coefficient on different color channels of each pixel included in the color correction coefficient.

相应过程可以包括:基于该待处理图像中包括的各像素点在不同颜色通道上的第二修正系数,对该待处理图像中包括的各像素点在对应颜色通道上的颜色值进行第二调节处理,得到第二调节处理后的图像。也就是说,先结合不同颜色通道上的第二修正系数以及对应颜色通道上的颜色值进行第二调节处理,能够从像素点维度出发快速且高效的实现对颜色通道上的颜色值的初步修正。The corresponding process may include: based on the second correction coefficient of each pixel point included in the image to be processed on different color channels, performing a second adjustment on the color value of each pixel point included in the image to be processed on the corresponding color channel. Process to obtain the image after the second adjustment process. That is to say, by first combining the second correction coefficients on different color channels and the color values on the corresponding color channels for the second adjustment process, the preliminary correction of the color values on the color channels can be quickly and efficiently implemented from the pixel dimension. .

并且,基于该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数,对第二调节处理后的图像中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到该第一图像。也就是说,再结合不同颜色通道上的第一修正系数以及第二调节处理后的对应颜色通道上的颜色值进行第一调节处理,能够从像素点维度出发进一步实现对颜色通道上的颜色值的二次修正,进而实现对待处理图像的颜色修正,从而获得颜色质量更高的第一图像。Furthermore, based on the first correction coefficients of each pixel point included in the image to be processed on different color channels, a first adjustment is performed on the color value of each pixel point included in the image after the second adjustment process on the corresponding color channel. Process to obtain the first image. That is to say, by combining the first correction coefficients on different color channels and the color values on the corresponding color channels after the second adjustment process to perform the first adjustment process, the color values on the color channels can be further adjusted from the pixel dimension. Secondary correction to achieve color correction of the image to be processed, thereby obtaining the first image with higher color quality.

在该种可能的实现方式中,提供了一种结合颜色修正系数包括的各像素点在不同颜色通道上的第一修正系数以及第二修正系数,来进行颜色修正的方式。In this possible implementation, a method of performing color correction is provided by combining the first correction coefficient and the second correction coefficient of each pixel on different color channels included in the color correction coefficient.

在第一方面的另一种可能的实现方式中,基于该待处理图像中包括的各像素点在不同颜色通道上的第二修正系数,对该待处理图像中包括的各像素点在对应颜色通道上的颜色值进行第二调节处理之前,该方法还包括:对该第二修正系数进行归一化处理。In another possible implementation of the first aspect, based on the second correction coefficient of each pixel included in the image to be processed on different color channels, the corresponding color of each pixel included in the image to be processed is Before performing the second adjustment process on the color value on the channel, the method further includes: normalizing the second correction coefficient.

在该种可能的实现方式中,通过对第二修正系数进行归一化处理,以消除第二修正系数中不同特征值之间的量纲影响,以便基于归一化处理后的第二修正系数,来执行后续针对颜色值的初步修正,从而确保颜色修正的顺利进行。In this possible implementation, the second correction coefficient is normalized to eliminate the dimensional influence between different eigenvalues in the second correction coefficient, so that based on the normalized second correction coefficient , to perform the subsequent preliminary correction of the color value to ensure the smooth progress of the color correction.

在第一方面的另一种可能的实现方式中,该方法还包括:对该第一图像进行图像处理,得到图像处理后的第一图像。也就是说,在对待处理图像进行颜色修正得到第一图像之后,还能够对第一图像进行图像处理,以得到图像质量更高的图像。In another possible implementation of the first aspect, the method further includes: performing image processing on the first image to obtain a processed first image. That is to say, after performing color correction on the image to be processed to obtain the first image, image processing can also be performed on the first image to obtain an image with higher image quality.

在该电子设备的显示屏上显示第一图像,包括:在该电子设备的显示屏上显示该图像处理后的第一图像。如此,能够为用户显示图像质量更高的图像。Displaying the first image on the display screen of the electronic device includes: displaying the image-processed first image on the display screen of the electronic device. In this way, images with higher image quality can be displayed to the user.

在第一方面的另一种可能的实现方式中,该图像处理为图像增强处理、图像超分处理、图像恢复处理、图像修复处理、图像去模糊处理、图像去噪处理、图像去雨处理、图像去雾处理、质量提升处理或高动态范围处理中的至少一项。In another possible implementation of the first aspect, the image processing is image enhancement processing, image super-resolution processing, image restoration processing, image repair processing, image deblurring processing, image denoising processing, image rain removal processing, At least one of image defogging, quality improvement, or high dynamic range processing.

在该种可能的实现方式中,示出了多种类型的图像处理功能。如此,可以在上述图像增强场景、图像超分场景、图像恢复场景、图像修复场景、图像去模糊场景、图像去噪场景、图像去雨场景、图像去雾场景、质量提升场景或高动态范围场景中至少一项场景中,针对待处理图像进行颜色修正,拓宽了颜色修正的适用范围。In this possible implementation, various types of image processing functions are shown. In this way, the image enhancement scene, image super-resolution scene, image restoration scene, image repair scene, image deblurring scene, image denoising scene, image rain removal scene, image dehazing scene, quality improvement scene or high dynamic range scene can be used. In at least one of the scenarios, color correction is performed on the image to be processed, which broadens the applicable scope of color correction.

第二方面,提供了一种颜色修正模型的训练方法,应用于电子设备。In the second aspect, a color correction model training method is provided, which is applied to electronic devices.

该方法可以包括:基于图像训练数据对初始模型进行迭代训练,以获得该颜色修正模型。The method may include iteratively training an initial model based on image training data to obtain the color correction model.

其中,在任一次迭代训练的过程中,将该图像训练数据输入上一次迭代训练后得到的模型中,通过该模型获取该图像训练数据的颜色修正系数,基于该颜色修正系数对该图像训练数据进行颜色修正,得到颜色修正后的输出图像。该颜色修正系数用于对该图像训练数据中包括的各像素点在不同颜色通道上的颜色进行修正。Among them, during any iterative training process, the image training data is input into the model obtained after the previous iterative training, the color correction coefficient of the image training data is obtained through the model, and the image training data is processed based on the color correction coefficient. Color correction to obtain a color-corrected output image. The color correction coefficient is used to correct the color of each pixel included in the image training data on different color channels.

进而,基于该输出图像和该图像训练数据对应的样本图像,调整模型参数。其中,该样本图像为颜色质量达到预设要求的图像。也就是说,在模型训练的过程中,基于模型的输出图像和该图像训练数据的样本图像,调整模型参数,以便实现对模型的训练优化,能够训练得到颜色修正能力较优的模型。Furthermore, the model parameters are adjusted based on the output image and the sample image corresponding to the image training data. Among them, the sample image is an image whose color quality meets the preset requirements. That is to say, in the process of model training, the model parameters are adjusted based on the output image of the model and the sample image of the image training data in order to optimize the training of the model and train a model with better color correction capabilities.

在上述技术方案中,提供了一种颜色修正模型的训练方法,利用图像训练数据对初始模型进行迭代训练,能够训练得到颜色修正能力较优的模型。In the above technical solution, a method for training a color correction model is provided. Image training data is used to iteratively train the initial model, which can train a model with better color correction capabilities.

在第二方面的一种可能的实现方式中,通过该模型获取该图像训练数据的颜色修正系数,基于该颜色修正系数对该图像训练数据进行颜色修正,得到颜色修正后的输出图像,包括:通过该模型的预测子模型,预测该图像训练数据的颜色修正系数。也就是说,通过在模型中设置预测子模型,使得在任一次迭代训练的过程中,利用预测子模型预测图像训练数据的颜色修正系数。In a possible implementation of the second aspect, the color correction coefficient of the image training data is obtained through the model, the color correction is performed on the image training data based on the color correction coefficient, and a color-corrected output image is obtained, including: Through the prediction sub-model of the model, the color correction coefficients of the image training data are predicted. That is to say, by setting the prediction sub-model in the model, the prediction sub-model can be used to predict the color correction coefficient of the image training data during any iterative training process.

并且,通过该模型的修正子模型,基于该颜色修正系数对该图像训练数据进行颜色修正,得到该输出图像。也就是说,通过在模型中设置修正子模型,使得在任一次迭代训练的过程中,利用修正子模型对图像训练数据进行颜色修正,得到输出图像。And, through the correction sub-model of the model, the image training data is color corrected based on the color correction coefficient to obtain the output image. That is to say, by setting the correction sub-model in the model, during any iterative training process, the correction sub-model is used to perform color correction on the image training data to obtain the output image.

进而,基于该输出图像和该样本图像,调整模型参数,以便实现对模型的训练优化,从而训练得到具备颜色修正功能的模型。Furthermore, based on the output image and the sample image, the model parameters are adjusted to achieve training optimization of the model, thereby training a model with a color correction function.

在第二方面的另一种可能的实现方式中,通过该模型获取该图像训练数据的颜色修正系数,基于该颜色修正系数对该图像训练数据进行颜色修正,得到颜色修正后的输出图像,包括:通过该模型的处理子模型对该图像训练数据进行图像处理,得到图像处理后的图像。也就是说,通过在模型中设置处理子模型,使得在任一次迭代训练的过程中,利用处理子模型对图像训练数据进行图像处理,以得到图像处理后的图像。In another possible implementation of the second aspect, the color correction coefficient of the image training data is obtained through the model, the color correction coefficient is performed on the image training data based on the color correction coefficient, and a color-corrected output image is obtained, including : Perform image processing on the image training data through the processing sub-model of the model to obtain the image after image processing. That is to say, by setting the processing sub-model in the model, during any iterative training process, the processing sub-model is used to perform image processing on the image training data to obtain the image-processed image.

且,通过该模型的预测子模型,预测该图像训练数据的颜色修正系数。也就是说,通过在模型中设置预测子模型,使得在任一次迭代训练的过程中,利用预测子模型预测图像训练数据的颜色修正系数。And, through the prediction sub-model of the model, the color correction coefficient of the image training data is predicted. That is to say, by setting the prediction sub-model in the model, the prediction sub-model can be used to predict the color correction coefficient of the image training data during any iterative training process.

且,通过该模型的修正子模型,基于该颜色修正系数对该图像处理后的图像进行颜色修正,得到该输出图像。也就是说,通过在模型中设置修正子模型,使得在任一次迭代训练的过程中,利用修正子模型对图像训练数据进行颜色修正,得到输出图像。And, through the correction sub-model of the model, the color correction is performed on the image after image processing based on the color correction coefficient to obtain the output image. That is to say, by setting the correction sub-model in the model, during any iterative training process, the correction sub-model is used to perform color correction on the image training data to obtain the output image.

进而,基于该输出图像和该样本图像,调整模型参数,以便实现对模型的训练优化,从而训练得到兼具颜色修正功能和图像处理功能的模型。Furthermore, based on the output image and the sample image, the model parameters are adjusted to achieve training optimization of the model, thereby training a model that has both color correction function and image processing function.

在第二方面的另一种可能的实现方式中,该图像处理为图像增强处理、图像超分处理、图像恢复处理、图像修复处理、图像去模糊处理、图像去噪处理、图像去雨处理、图像去雾处理、质量提升处理或高动态范围处理中的至少一项。In another possible implementation of the second aspect, the image processing is image enhancement processing, image super-resolution processing, image restoration processing, image repair processing, image deblurring processing, image denoising processing, image rain removal processing, At least one of image defogging, quality improvement, or high dynamic range processing.

在该种可能的实现方式中,示出了多种类型的图像处理功能。如此,可以结合图像增强、图像超分、图像恢复、图像修复、图像去模糊、图像去噪、图像去雨、图像去雾、质量提升或高动态范围中至少一项功能,训练得到具备其中至少一项图像处理功能的模型。In this possible implementation, various types of image processing functions are shown. In this way, at least one of the functions of image enhancement, image super-resolution, image restoration, image repair, image deblurring, image denoising, image rain removal, image dehazing, quality improvement or high dynamic range can be combined to train to obtain at least one of them. A model of image processing functions.

在第二方面的另一种可能的实现方式中,通过该模型的预测子模型,预测该图像训练数据的颜色修正系数,包括:通过该预测子模型的特征提取层,对该图像训练数据进行特征提取,得到该图像训练数据在不同颜色通道上的颜色特征;通过该预测子模型的卷积层,对该图像训练数据在不同颜色通道上的颜色特征进行卷积处理,得到该图像训练数据在不同颜色通道上的颜色修正系数。In another possible implementation of the second aspect, predicting the color correction coefficient of the image training data through the prediction sub-model of the model includes: performing the following steps on the image training data through the feature extraction layer of the prediction sub-model. Feature extraction is used to obtain the color features of the image training data on different color channels; through the convolution layer of the prediction sub-model, the color features of the image training data on different color channels are convolved to obtain the image training data. Color correction coefficients on different color channels.

在该种可能的实现方式中,通过在预测子模型中设置特征提取层和卷积层,利用特征提取层提取图像训练数据在不同颜色通道上的颜色特征,利用卷积层对提取到的颜色特征进行卷积处理,以得到该颜色修正系数。如此,提供了一种基于特征提取层和卷积层构成的预测子模型,能够预测得到图像训练数据的颜色修正系数。In this possible implementation, a feature extraction layer and a convolution layer are set up in the prediction sub-model, the feature extraction layer is used to extract the color features of the image training data on different color channels, and the convolution layer is used to extract the extracted color The features are convolved to obtain the color correction coefficient. In this way, a prediction sub-model based on the feature extraction layer and the convolution layer is provided, which can predict the color correction coefficient of the image training data.

在第二方面的另一种可能的实现方式中,该特征提取层包括至少两层目标模型结构,该目标模型结构包括卷积层、批标准化层及激活函数层。In another possible implementation of the second aspect, the feature extraction layer includes at least two layers of target model structures, and the target model structure includes a convolution layer, a batch normalization layer, and an activation function layer.

在该种可能的实现方式中,提供了一种基于至少两层目标模型结构构成的特征提取层。其中,该目标模型结构包括卷积层、批标准化层及激活函数层。这样,构成的特征提取层具备良好的特征提取能力,能够提取得到更加丰富且有效的颜色特征,从而基于所提取的颜色特征来预测图像训练数据的颜色修正系数,能够提升颜色修正系数的预测准确性。In this possible implementation, a feature extraction layer based on at least two layers of target model structure is provided. Among them, the target model structure includes a convolution layer, a batch normalization layer and an activation function layer. In this way, the feature extraction layer formed has good feature extraction capabilities and can extract richer and more effective color features, thereby predicting the color correction coefficients of image training data based on the extracted color features, which can improve the accuracy of prediction of color correction coefficients. sex.

在第二方面的另一种可能的实现方式中,该颜色修正系数包括该图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数。相应地,可基于颜色修正系数包括的各像素点在不同颜色通道上的第一修正系数,来进行颜色修正。In another possible implementation of the second aspect, the color correction coefficient includes a first correction coefficient on different color channels of each pixel included in the image training data. Correspondingly, color correction can be performed based on the first correction coefficient on different color channels of each pixel included in the color correction coefficient.

相应过程可以包括:基于该图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数,对该图像训练数据中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到该输出图像。The corresponding process may include: based on the first correction coefficient of each pixel point included in the image training data on different color channels, performing a first adjustment on the color value of each pixel point included in the image training data on the corresponding color channel. Process to get the output image.

也就是说,结合不同颜色通道上的第一修正系数以及对应颜色通道上的颜色值进行第一调节处理,能够从像素点维度出发实现对颜色通道上的颜色值的修正,也就实现了对图像训练数据的颜色修正,从而获得颜色质量更高的输出图像。That is to say, by combining the first correction coefficients on different color channels and the color values on the corresponding color channels for the first adjustment process, the color values on the color channels can be corrected from the pixel point dimension, which also realizes the correction of the color values on the color channels. Color correction of image training data, resulting in output images with higher color quality.

在第二方面的另一种可能的实现方式中,该颜色修正系数包括该图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数和第二修正系数。相应地,可结合颜色修正系数包括的各像素点在不同颜色通道上的第一修正系数以及第二修正系数,来进行颜色修正。In another possible implementation of the second aspect, the color correction coefficient includes a first correction coefficient and a second correction coefficient on different color channels for each pixel included in the image training data. Correspondingly, color correction can be performed in combination with the first correction coefficient and the second correction coefficient on different color channels of each pixel included in the color correction coefficient.

相应过程可以包括:基于该图像训练数据中包括的各像素点在不同颜色通道上的第二修正系数,对该图像训练数据中包括的各像素点在对应颜色通道上的颜色值进行第二调节处理,得到第二调节处理后的图像。也就是说,先结合不同颜色通道上的第二修正系数以及对应颜色通道上的颜色值进行第二调节处理,能够从像素点维度出发快速且高效的实现对颜色通道上的颜色值的初步修正。The corresponding process may include: based on the second correction coefficient of each pixel point included in the image training data on different color channels, performing a second adjustment on the color value of each pixel point included in the image training data on the corresponding color channel. Process to obtain the image after the second adjustment process. That is to say, by first combining the second correction coefficients on different color channels and the color values on the corresponding color channels for the second adjustment process, the preliminary correction of the color values on the color channels can be quickly and efficiently implemented from the pixel dimension. .

并且,基于该图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数,对第二调节处理后的图像中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到该输出图像。也就是说,再结合不同颜色通道上的第一修正系数以及第二调节处理后的对应颜色通道上的颜色值进行第一调节处理,能够从像素点维度出发进一步实现对颜色通道上的颜色值的二次修正,进而实现对图像训练数据的颜色修正,从而获得颜色质量更高的输出图像。Furthermore, based on the first correction coefficients of each pixel point included in the image training data on different color channels, a first adjustment is performed on the color value of each pixel point included in the second adjustment processed image on the corresponding color channel. Process to get the output image. That is to say, by combining the first correction coefficients on different color channels and the color values on the corresponding color channels after the second adjustment process to perform the first adjustment process, the color values on the color channels can be further adjusted from the pixel dimension. Secondary correction, thereby achieving color correction of the image training data, thereby obtaining an output image with higher color quality.

在该种可能的实现方式中,提供了一种结合颜色修正系数包括的各像素点在不同颜色通道上的第一修正系数以及第二修正系数,来进行颜色修正的方式。In this possible implementation, a method of performing color correction is provided by combining the first correction coefficient and the second correction coefficient of each pixel on different color channels included in the color correction coefficient.

在第二方面的另一种可能的实现方式中,基于该图像训练数据中包括的各像素点在不同颜色通道上的第二修正系数,对该图像训练数据中包括的各像素点在对应颜色通道上的颜色值进行第二调节处理之前,该方法还包括:对该第二修正系数进行归一化处理。In another possible implementation of the second aspect, based on the second correction coefficient of each pixel included in the image training data on different color channels, the corresponding color of each pixel included in the image training data is Before performing the second adjustment process on the color value on the channel, the method further includes: normalizing the second correction coefficient.

在该种可能的实现方式中,通过对第二修正系数进行归一化处理,以消除第二修正系数中不同特征值之间的量纲影响,以便基于归一化处理后的第二修正系数,来执行后续针对颜色值的初步修正,从而确保颜色修正的顺利进行。In this possible implementation, the second correction coefficient is normalized to eliminate the dimensional influence between different eigenvalues in the second correction coefficient, so that based on the normalized second correction coefficient , to perform the subsequent preliminary correction of the color value to ensure the smooth progress of the color correction.

第三方面,本申请提供了一种电子设备,包括:显示屏、处理器和存储器。显示屏提供有显示功能。存储器用于存储程序代码,处理器用于调用存储器存储的程序代码,从而实现第一方面或第二方面提供的任意一种方法。In a third aspect, this application provides an electronic device, including: a display screen, a processor, and a memory. The display screen provides a display function. The memory is used to store the program code, and the processor is used to call the program code stored in the memory, thereby implementing any method provided in the first aspect or the second aspect.

第四方面,提供了一种计算机可读存储介质,包括程序代码,程序代码在电子设备上运行时,使得电子设备执行第一方面或第二方面提供的任意一种方法。A fourth aspect provides a computer-readable storage medium, including program code. When the program code is run on an electronic device, it causes the electronic device to execute any method provided in the first aspect or the second aspect.

第五方面,提供了一种计算机程序产品,包括程序代码,当程序代码在电子设备上运行时,使得电子设备执行第一方面或第二方面提供的任意一种方法。A fifth aspect provides a computer program product, including program code. When the program code is run on an electronic device, it causes the electronic device to execute any method provided in the first aspect or the second aspect.

需要说明的是,第三方面至第五方面中的任一种实现方式所带来的技术效果可参见第一方面中对应实现方式所带来的技术效果,此处不再赘述。It should be noted that the technical effects brought by any implementation method in the third to fifth aspects can be referred to the technical effects brought by the corresponding implementation method in the first aspect, and will not be described again here.

附图说明Description of the drawings

图1为本申请实施例提供的一种电子设备的示意图;Figure 1 is a schematic diagram of an electronic device provided by an embodiment of the present application;

图2为本申请实施例提供的一种电子设备的硬件结构示意图;Figure 2 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application;

图3为本申请实施例提供的一种电子设备的软件结构示意图;Figure 3 is a schematic diagram of the software structure of an electronic device provided by an embodiment of the present application;

图4为本申请实施例提供的一种颜色修正方法的流程示意图;Figure 4 is a schematic flow chart of a color correction method provided by an embodiment of the present application;

图5为本申请实施例提供的一种颜色修正方法的流程示意图;Figure 5 is a schematic flow chart of a color correction method provided by an embodiment of the present application;

图6为本申请实施例提供的一种颜色修正的前后对比示意图;Figure 6 is a schematic diagram of a before and after comparison of color correction provided by an embodiment of the present application;

图7为本申请实施例提供的一种第一颜色修正模型的训练方法的流程示意图;Figure 7 is a schematic flowchart of a training method for a first color correction model provided by an embodiment of the present application;

图8为本申请实施例提供的一种第二颜色修正模型的训练方法的流程示意图;Figure 8 is a schematic flowchart of a training method for a second color correction model provided by an embodiment of the present application;

图9为本申请实施例提供的一种颜色修正模型的训练装置的框架示意图;Figure 9 is a schematic framework diagram of a color correction model training device provided by an embodiment of the present application;

图10为本申请实施例提供的一种颜色修正模型的训练装置的框架示意图。Figure 10 is a schematic framework diagram of a color correction model training device provided by an embodiment of the present application.

具体实施方式Detailed ways

在本申请的描述中,除非另有说明,“/”表示“或”的意思,例如,A/B可以表示A或B。本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。此外,“至少一个”是指一个或多个,“多个”是指两个或两个以上。“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。In the description of this application, unless otherwise stated, "/" means "or". For example, A/B can mean A or B. "And/or" in this article is just an association relationship that describes related objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone these three situations. In addition, "at least one" means one or more, and "plurality" means two or more. Words such as "first" and "second" do not limit the quantity and order of execution, and words such as "first" and "second" do not limit the number or order of execution.

需要说明的是,本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "such as" is not intended to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary" or "such as" is intended to present the concept in a concrete manner.

本申请实施例提供的颜色修正方法,可应用于图像处理技术领域中,具体可应用于针对待处理图像的颜色修正场景中。The color correction method provided by the embodiments of the present application can be applied in the field of image processing technology, and specifically can be applied in color correction scenarios for images to be processed.

进一步地,在一些实施例中,本申请实施例提供的颜色修正方法,可应用于如图像增强(image enhancement)、图像超分(super-resolution)、图像恢复(imagerestoration)、图像修复(inpainting)、图像去模糊(deblurring)、图像去燥(denoising)、图像去雨(image deraining)、图像去雾(image dehazing)、质量提升算法(low-level算法)、高动态范围(high-dynamic range,HDR)等图像处理的场景。Furthermore, in some embodiments, the color correction method provided by the embodiments of the present application can be applied to image enhancement (image enhancement), image super-resolution (super-resolution), image restoration (imagerestoration), and image inpainting (inpainting). , image deblurring, image denoising, image deraining, image dehazing, quality improvement algorithm (low-level algorithm), high-dynamic range, HDR) and other image processing scenarios.

其中,图像增强是指增强图像的对比度,以使原本不清晰的图像变得清晰或强调某些感兴趣的特征。图像超分是指提高图像的分辨率,以丰富图像的纹理细节。图像恢复是指从所得的退化图像中以最大的保真度复原出真实图像。图像修复是指修复图像损失的部分并基于背景信息将其重建。图像去模糊是指去除模糊图像的运动模糊,以将模糊图像还原为清晰图像。图像去燥是指减少数字图像中的噪声。图像去雨是指去除图像画面中的雨滴。图像去雾是指针对雾霾图像进行处理,以消除或减弱雾霾对图像的影响。质量提升算法是指将低质量的图像恢复成高质量的图像的算法。高动态范围用于提供更多的色彩范围和图像细节,以提高图像明暗对比度。Among them, image enhancement refers to enhancing the contrast of an image to make an originally unclear image clear or to emphasize certain features of interest. Image super-resolution refers to increasing the resolution of the image to enrich the texture details of the image. Image restoration refers to restoring the real image with maximum fidelity from the obtained degraded image. Image restoration refers to repairing the lost parts of the image and reconstructing them based on background information. Image deblurring refers to removing motion blur from a blurred image to restore the blurred image to a clear image. Image denoising refers to reducing noise in digital images. Image rain removal refers to removing raindrops from images. Image defogging refers to processing haze images to eliminate or weaken the impact of haze on the image. Quality improvement algorithm refers to an algorithm that restores low-quality images to high-quality images. High dynamic range is used to provide more color range and image details to improve image contrast between light and dark.

在上述图像处理的场景中,还可以应用本申请实施例提供的颜色修正方法。这样,不仅能够对待处理图像执行上述图像处理,还可实现针对待处理图像的颜色修正。In the above image processing scenario, the color correction method provided by the embodiment of the present application can also be applied. In this way, not only the above image processing can be performed on the image to be processed, but also the color correction of the image to be processed can be achieved.

上述图像处理的场景可以是电子设备中需进行图像处理的场景。示例性的,图像处理的场景可以处于电子设备的拍摄场景中。相应地,针对拍摄过程中的预览图像或拍摄得到的拍摄图像,利用本申请实施例提供的颜色修正方法,能够对预览图像或拍摄图像进行颜色修正。或者,图像处理的场景可以处于电子设备的视频播放场景中。相应地,针对待播放的视频图像,利用本申请实施例提供的颜色修正方法,能够对待播放的视频图像进行颜色修正。当然,上述图像处理的场景还能够处于电子设备的其他场景,如图像剪辑的场景、游戏画面显示场景等等,本申请实施例对此不作限定。The above image processing scene may be a scene requiring image processing in an electronic device. For example, the image processing scene may be in the shooting scene of the electronic device. Correspondingly, for the preview image or the photographed image obtained during the photographing process, the color correction method provided by the embodiment of the present application can be used to perform color correction on the preview image or the photographed image. Alternatively, the image processing scene may be in the video playback scene of the electronic device. Correspondingly, for the video image to be played, the color correction method provided by the embodiment of the present application can be used to perform color correction on the video image to be played. Of course, the above image processing scenes can also be in other scenes of electronic devices, such as image editing scenes, game screen display scenes, etc., which are not limited in the embodiments of the present application.

相关技术中,在采集到低质量图像时,通常会利用上述图像增强、图像去模糊、图像还原等中的一种或多种技术,对所采集的图像进行处理,以提升图像的质量。然而,相关技术中,仅依赖于图像增强、图像去模糊、图像还原等技术,图像处理的效果较差。In related technologies, when low-quality images are collected, one or more of the above-mentioned image enhancement, image deblurring, image restoration, etc. technologies are usually used to process the collected images to improve the quality of the images. However, in related technologies, only relying on image enhancement, image deblurring, image restoration and other technologies, the effect of image processing is poor.

鉴于此,本申请实施例提供了一种颜色修正方法,通过获取该待处理图像的颜色修正系数,能够从像素点维度出发实现对不同颜色通道上颜色的修正,从而实现针对图像的颜色修正,以提升图像处理的效果。进而,通过在该电子设备的显示屏上显示颜色修正后得到的图像,能够为用户显示出颜色质量更高、更加贴近真实颜色效果的图像,提高了图像的显示效果。In view of this, embodiments of the present application provide a color correction method. By obtaining the color correction coefficient of the image to be processed, the color correction on different color channels can be implemented from the pixel point dimension, thereby achieving color correction for the image. to improve the effect of image processing. Furthermore, by displaying the color-corrected image on the display screen of the electronic device, an image with higher color quality and closer to the real color effect can be displayed to the user, thereby improving the display effect of the image.

在一种可能的实现方式中,本申请实施例提供的颜色修正方法,可应用于如图1所示的电子设备100。示例性的,图1为本申请实施例提供的一种电子设备的示意图。In a possible implementation, the color correction method provided by the embodiment of the present application can be applied to the electronic device 100 as shown in FIG. 1 . Illustratively, FIG. 1 is a schematic diagram of an electronic device provided by an embodiment of the present application.

其中,电子设备100可以是智能手机、智能手表、台式电脑、手提电脑、虚拟现实终端、增强现实终端、无线终端和膝上型便携计算机等设备中的至少一种。The electronic device 100 may be at least one of a smart phone, a smart watch, a desktop computer, a laptop computer, a virtual reality terminal, an augmented reality terminal, a wireless terminal, a laptop computer, and other devices.

电子设备100提供有图像处理的功能。在一些实施例中,电子设备100可运行有相机、图库、地图、导航、视频、游戏等支持图像处理的应用程序。示例性的,在利用电子设备100所运行的相机应用拍摄图像时,可以应用本申请实施例提供的颜色修正方法,对预览图像或拍摄图像进行颜色修正。或者,在利用电子设备100所运行的视频应用播放视频时,可以应用本申请实施例提供的颜色修正方法,对待播放的视频图像进行颜色修正。当然,电子设备100还可以运行其他类型的支持图像处理的应用程序,如剪辑、修图等应用程序。The electronic device 100 provides an image processing function. In some embodiments, the electronic device 100 may run applications such as cameras, galleries, maps, navigation, videos, games, etc. that support image processing. For example, when the camera application running on the electronic device 100 is used to capture an image, the color correction method provided by the embodiment of the present application can be applied to perform color correction on the preview image or the captured image. Alternatively, when a video application running on the electronic device 100 is used to play a video, the color correction method provided by the embodiment of the present application can be applied to perform color correction on the video image to be played. Of course, the electronic device 100 can also run other types of applications that support image processing, such as editing, photo editing, and other applications.

本申请实施例中,电子设备100用于获取待处理图像;获取该待处理图像的颜色修正系数,基于该颜色修正系数对该待处理图像中包括的各像素点在不同颜色通道上的颜色进行修正,得到颜色修正后的第一图像,在电子设备100的显示屏上显示第一图像。In the embodiment of the present application, the electronic device 100 is used to obtain an image to be processed; obtain a color correction coefficient of the image to be processed, and perform color correction on different color channels of each pixel included in the image to be processed based on the color correction coefficient. Correction is performed to obtain a color-corrected first image, and the first image is displayed on the display screen of the electronic device 100 .

示例性的,图1中的电子设备100的结构示意图如图2所示。图2为本申请实施例提供的一种电子设备的硬件结构示意图。For example, a schematic structural diagram of the electronic device 100 in FIG. 1 is shown in FIG. 2 . FIG. 2 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.

参见图2,电子设备100可以包括处理器210、外部存储器接口220、内部存储器221、通用串行总线(universal serial bus,USB)接口230、充电管理模块240、天线1、天线2、移动通信模块250、无线通信模块260、音频模块270、传感器模块280、按键290、马达291、指示器292、摄像头293、显示屏294以及用户标识模块(subscriber identification module,SIM)卡接口295等。其中传感器模块280可以包括压力传感器280A、触摸传感器280B等。Referring to FIG. 2 , the electronic device 100 may include a processor 210 , an external memory interface 220 , an internal memory 221 , a universal serial bus (USB) interface 230 , a charging management module 240 , an antenna 1 , an antenna 2 , and a mobile communication module. 250. Wireless communication module 260, audio module 270, sensor module 280, button 290, motor 291, indicator 292, camera 293, display screen 294, subscriber identification module (subscriber identification module, SIM) card interface 295, etc. The sensor module 280 may include a pressure sensor 280A, a touch sensor 280B, and the like.

可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件、软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present application 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 shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.

处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP)、调制解调处理器、图形处理器(graphics processingunit,GPU)、图像信号处理器(image signal processor,ISP)、控制器、存储器、视频编解码器、数字信号处理器(digital signal processor,DSP)、基带处理器、和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), an image signal processor ( image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and/or neural-network processing unit (NPU), etc. . Among them, different processing units can be independent devices or integrated in one or more processors.

其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100 . The controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.

存储器用于存储指令(程序代码)和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从该存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。Memory is used to store instructions (program code) and data. In some embodiments, the memory in processor 210 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 210 is reduced, thus improving the efficiency of the system.

NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。例如,在本申请实施例中,电子设备100可以通过NPU提供第一颜色修正模型或第二颜色修正模型,以实现本申请实施例提供的颜色修正方法,从而实现对待处理图像的颜色修正。NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can continuously learn by itself. Intelligent cognitive applications of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, etc. For example, in this embodiment of the present application, the electronic device 100 can provide a first color correction model or a second color correction model through the NPU to implement the color correction method provided by the embodiment of the present application, thereby achieving color correction of the image to be processed.

在一些实施例中,处理器210可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口、集成电路内置音频(inter-integrated circuitsound,I2S)接口、脉冲编码调制(pulse code modulation,PCM)接口、通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口、移动产业处理器接口(mobile industry processor interface,MIPI)、通用输入输出(general-purposeinput/output,GPIO)接口、用户标识模块(subscriber identity module,SIM)接口、和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, processor 210 may include one or more interfaces. Interfaces may include integrated circuit (inter-integrated circuit, I2C) interface, integrated circuit built-in audio (inter-integrated circuitsound, I2S) interface, pulse code modulation (PCM) interface, universal asynchronous receiver (universal asynchronous receiver) /transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and/or Universal serial bus (USB) interface, etc.

本申请实施例中,处理器210用于调用存储器存储的程序代码,当程序代码在电子设备100上运行时,使得电子设备100执行本申请实施例中的颜色修正方法。In the embodiment of the present application, the processor 210 is used to call the program code stored in the memory. When the program code is run on the electronic device 100, the electronic device 100 executes the color correction method in the embodiment of the present application.

充电管理模块240用于从充电器接收充电输入。The charge management module 240 is used to receive charging input from the charger.

电子设备100的无线通信功能可以通过天线1、天线2、移动通信模块250、无线通信模块260、调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor and the baseband processor, etc.

天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands.

移动通信模块250可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块250可以包括至少一个滤波器、开关、功率放大器、低噪声放大器(low noise amplifier,LNA)等。移动通信模块250可以由天线1接收电磁波,并对接收的电磁波进行滤波、放大等处理,传送至调制解调处理器进行解调。移动通信模块250还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块250的至少部分功能模块可以被设置于处理器210中。在一些实施例中,移动通信模块250的至少部分功能模块可以与处理器210的至少部分模块被设置在同一个器件中。The mobile communication module 250 can provide solutions for wireless communication including 2G/3G/4G/5G applied on the electronic device 100 . The mobile communication module 250 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves through the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least part of the functional modules of the mobile communication module 250 may be disposed in the processor 210 . In some embodiments, at least part of the functional modules of the mobile communication module 250 and at least part of the modules of the processor 210 may be provided in the same device.

无线通信模块260可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetoo2,BT)、全球导航卫星系统(global navigation satellite system,GNSS)、调频(frequency modulation,FM)、近距离无线通信技术(near field communication,NFC)、红外技术(infrared,IR)等无线通信的解决方案。无线通信模块260可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块260经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块260还可以从处理器210接收待发送的信号,对其进行调频、放大,经天线2转为电磁波辐射出去。The wireless communication module 260 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (wireless fidelity, Wi-Fi) network), Bluetooth (bluetoo2, BT), global navigation satellite system Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR), etc. The wireless communication module 260 may be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 . The wireless communication module 260 can also receive the signal to be sent from the processor 210, perform frequency modulation and amplification on it, and convert it into electromagnetic waves through the antenna 2 for radiation.

在一些实施例中,电子设备100的天线1和移动通信模块250耦合,天线2和无线通信模块260耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。该无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM)、通用分组无线服务(general packet radio service,GPRS)、码分多址接入(codedivision multiple access,CDMA)、宽带码分多址(wideband code division multipleaccess,WCDMA)、时分码分多址(time-division code division multiple access,TD-SCDMA)、长期演进(long term evolution,LTE)、BT、GNSS、WLAN、NFC、FM、和/或IR技术等。In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (codedivision multiple access, CDMA), broadband code division Multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technology, etc.

电子设备100通过GPU、显示屏294以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏294和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements display functions through a GPU, a display screen 294, an application processor, and the like. The GPU is an image processing microprocessor and is connected to the display screen 294 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.

显示屏294用于显示图像、视频等。显示屏294包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD)、有机发光二极管(organic light-emittingdiode,OLED)、有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED)、柔性发光二极管(flex light-emittingdiode,FLED)、Miniled、MicroLed、Micro-oLed、量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏294,N为大于1的正整数。例如,在本申请实施例中,显示屏294用于显示经颜色修正得到的第一图像。The display screen 294 is used to display images, videos, etc. Display 294 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 or an active matrix organic light emitting diode (active-matrix organic light emitting diode). (AMOLED), flexible light-emitting diodes (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 294, where N is a positive integer greater than 1. For example, in the embodiment of the present application, the display screen 294 is used to display the first image obtained through color correction.

电子设备100可以通过ISP、摄像头293、视频编解码器、GPU、显示屏294以及应用处理器等实现拍摄功能。例如,在本申请实施例中,电子设备100通过ISP、摄像头293、视频编解码器、GPU、显示屏294以及应用处理器等实现拍摄功能时,可以应用本申请实施例提供的颜色修正方法,对拍摄过程中的预览图像或拍摄得到的拍摄图像进行颜色修正。The electronic device 100 can implement the shooting function through an ISP, a camera 293, a video codec, a GPU, a display screen 294, an application processor, and the like. For example, in the embodiment of the present application, when the electronic device 100 implements the shooting function through the ISP, camera 293, video codec, GPU, display screen 294, application processor, etc., the color correction method provided by the embodiment of the present application can be applied. Color correct the preview image during shooting or the captured image after shooting.

摄像头293用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头293,N为大于1的正整数。Camera 293 is used to capture still images or video. The object passes through the lens to produce an optical image that is projected onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to convert it into a digital image signal. ISP outputs digital image signals to DSP for processing. DSP converts digital image signals into standard RGB, YUV and other format image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 293, where N is a positive integer greater than 1.

外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口220与处理器210通信,实现数据存储功能。例如将音乐、视频等文件保存在外部存储卡中。The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 . The external memory card communicates with the processor 210 through the external memory interface 220 to implement the data storage function. For example, save music, video and other files on an external memory card.

内部存储器221可以用于存储计算机可执行程序代码,该可执行程序代码包括指令。处理器210通过运行存储在内部存储器221的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、通用闪存存储器(universal flash storage,UFS)等。Internal memory 221 may be used to store computer executable program code, which includes instructions. The processor 210 executes instructions stored in the internal memory 221 to execute various functional applications and data processing of the electronic device 100 . The internal memory 221 may include a program storage area and a data storage area. Among them, the stored program area can store the operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.), etc. The storage data area may store data created during use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

电子设备100可以通过音频模块270实现音频功能。例如音乐播放、录音等。The electronic device 100 may implement audio functions through the audio module 270 . For example, music playback, recording, etc.

压力传感器280A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器280A可以设置于显示屏294。The pressure sensor 280A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, pressure sensor 280A may be disposed on display screen 294.

触摸传感器280B,也称“触控面板”。触摸传感器280B可以设置于显示屏294,由触摸传感器280B与显示屏294组成触摸屏,也称“触控屏”。触摸传感器280B用于检测作用于其上或附近的触摸操作。Touch sensor 280B is also called a "touch panel". The touch sensor 280B can be disposed on the display screen 294. The touch sensor 280B and the display screen 294 form a touch screen, which is also called a "touch screen". Touch sensor 280B is used to detect touch operations on or near it.

按键290包括开机键,音量键等。按键290可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The buttons 290 include a power button, a volume button, etc. Key 290 may be a mechanical key. It can also be a touch button. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .

马达291可以产生振动提示。马达291可以用于来电振动提示,也可以用于触摸振动反馈。The motor 291 can generate vibration prompts. The motor 291 can be used for vibration prompts for incoming calls and can also be used for touch vibration feedback.

指示器292可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 292 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc.

SIM卡接口295用于连接SIM卡。SIM卡可以通过插入SIM卡接口295,或从SIM卡接口295拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。The SIM card interface 295 is used to connect a SIM card. The SIM card can be connected to or separated from the electronic device 100 by inserting it into the SIM card interface 295 or pulling it out from the SIM card interface 295 . The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.

需要指出的是,图2中示出的结构并不构成对该电子设备的限定,除图2所示部件之外,该电子设备还可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。It should be noted that the structure shown in Figure 2 does not constitute a limitation of the electronic device. In addition to the components shown in Figure 2, the electronic device may also include more or less components than those shown in the figure, or a combination thereof. Certain parts, or different arrangements of parts.

电子设备的软件系统可以采用分层架构、事件驱动架构、微核架构、微服务架构或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备的软件结构。示例性的,图3为本申请实施例提供的一种电子设备的软件结构示意图。Software systems of electronic devices can adopt layered architecture, event-driven architecture, microkernel architecture, microservice architecture or cloud architecture. The embodiment of this application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device. Exemplarily, FIG. 3 is a schematic diagram of the software structure of an electronic device provided by an embodiment of the present application.

分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)、系统库以及内核层。The layered architecture divides the software into several layers, and each layer has clear roles and division of labor. The layers communicate through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: application layer, application framework layer, Android runtime (Android runtime), system library and kernel layer.

应用程序层可以包括一系列应用程序包。如图3所示,应用程序包可以包括相机、图库、日历、通话、地图、导航、WLAN、蓝牙、音乐、视频、游戏、短信息等应用程序。The application layer can include a series of application packages. As shown in Figure 3, the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, game, short message, etc.

其中,针对图库、地图、导航、视频、游戏等支持图像处理的应用程序,可以应用本申请实施例提供的颜色修正方法,对待显示或待播放的图像进行颜色修正。Among them, for applications that support image processing, such as galleries, maps, navigation, videos, games, etc., the color correction method provided by the embodiments of the present application can be used to perform color correction on images to be displayed or played.

应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

如图3所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 3, the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

系统库可以包括多个功能模块。例如:表面管理器(surface manager)、媒体库(Media Libraries)、三维图形处理库(例如:OpenGL ES)、二维(2D)图形引擎(例如:SGL)等。System libraries can include multiple functional modules. For example: surface manager, media libraries, three-dimensional graphics processing library (for example: OpenGL ES), two-dimensional (2D) graphics engine (for example: SGL), etc.

内核层是硬件和软件之间的层。内核层至少包含显示驱动、摄像头驱动、音频驱动、传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

图4为本申请实施例提供的一种颜色修正方法的流程示意图。参见图4,以基于第一颜色修正模型来进行颜色修正为例对方案进行说明,该方法包括以下S401-S404:FIG. 4 is a schematic flowchart of a color correction method provided by an embodiment of the present application. Referring to Figure 4, the solution is explained by taking color correction based on the first color correction model as an example. The method includes the following S401-S404:

S401、电子设备获取待处理图像。S401. The electronic device obtains the image to be processed.

本申请实施例中,待处理图像可以为第二图像。或者,待处理图像可以为对该第二图像进行图像处理后得到的图像。如此,提供了两种类型的待处理图像,丰富了待处理图像的类型。进而,不仅可以针对待显示的原始图像进行颜色修正,还可以对经图像处理后的图像进行颜色修正,提升了颜色修正的灵活性。In this embodiment of the present application, the image to be processed may be the second image. Alternatively, the image to be processed may be an image obtained by performing image processing on the second image. In this way, two types of images to be processed are provided, enriching the types of images to be processed. Furthermore, color correction can be performed not only on the original image to be displayed, but also on the image after image processing, which improves the flexibility of color correction.

其中,第二图像为第一应用的待在该显示屏上显示的图像。在一些实施例中,在待处理图像为第二图像的情况下,获取待处理图像的过程可以是:接收用户触发该第一应用显示图像的操作,响应于该触发该第一应用显示图像的操作,获取待显示的该第二图像。The second image is an image of the first application to be displayed on the display screen. In some embodiments, when the image to be processed is a second image, the process of obtaining the image to be processed may be: receiving an operation by the user to trigger the first application to display the image, and responding to the operation of triggering the first application to display the image. Operation to obtain the second image to be displayed.

在上述实施例中,提供了一种基于第一应用来获取待处理图像的过程。其中,通过用户触发该第一应用显示图像的操作,能够快速且高效的获取到待显示的该第二图像。In the above embodiment, a process of obtaining an image to be processed based on the first application is provided. Wherein, by the user triggering the operation of the first application to display an image, the second image to be displayed can be obtained quickly and efficiently.

例如,以第一应用为相机应用为例,第二图像可以为响应于用户开启该相机应用的操作该电子设备采集到的预览图像,或,响应于用户在该相机应用中的拍摄操作该电子设备拍摄到的拍摄图像。相应地,以预览图像为例,获取待处理图像的过程可以是:接收用户开启该相机应用的操作,响应于该开启该相机应用的操作,获取该电子设备(摄像头)采集到的该第二图像。应理解地,预览图像是指未执行拍摄操作时所采集的图像。以拍摄图像为例,获取待处理图像的过程可以是:接收用户在该相机应用中的拍摄操作,响应于该拍摄操作,获取该电子设备拍摄到的该第二图像。应理解地,拍摄图像是指执行拍摄操作后所采集的图像。For example, taking the first application as a camera application as an example, the second image may be a preview image collected by the electronic device in response to the user's operation of opening the camera application, or in response to the user's shooting operation in the camera application. Captured images captured by the device. Correspondingly, taking the preview image as an example, the process of obtaining the image to be processed may be: receiving the user's operation of opening the camera application, and in response to the operation of opening the camera application, obtaining the second image collected by the electronic device (camera). image. It should be understood that the preview image refers to an image collected when the shooting operation is not performed. Taking photographing an image as an example, the process of obtaining an image to be processed may be: receiving a user's photographing operation in the camera application, and in response to the photographing operation, obtaining the second image photographed by the electronic device. It should be understood that the captured image refers to the image collected after performing the capturing operation.

又如,以第一应用为图库应用为例,第二图像可以是图库应用中保存的图像。相应地,以图库应用中保存的图像为例,获取待处理图像的过程可以是:接收用户开启该图库应用的操作,响应于该开启该图库应用的操作,从本地图库获取该第二图像。For another example, assuming that the first application is a gallery application, the second image may be an image saved in the gallery application. Correspondingly, taking the image saved in the gallery application as an example, the process of obtaining the image to be processed may be: receiving the user's operation of opening the gallery application, and in response to the operation of opening the gallery application, obtaining the second image from the local gallery.

又如,以第一应用为视频应用为例,第二图像可以是视频应用中待播放的视频图像。相应地,以待播放的视频图像为例,获取待处理图像的过程可以是:接收用户在该视频应用中播放视频的操作,响应于该播放视频的操作,从服务器获取待播放的该第二图像。其中,服务器可存储有待播放视频的视频流(包含多帧图像)。For another example, assuming that the first application is a video application, the second image may be a video image to be played in the video application. Correspondingly, taking the video image to be played as an example, the process of obtaining the image to be processed may be: receiving the user's operation of playing the video in the video application, and in response to the operation of playing the video, obtaining the second image to be played from the server. image. Among them, the server can store the video stream (including multiple frames of images) of the video to be played.

又如,以第一应用为游戏应用为例,第二图像可以是游戏应用中的游戏图像。相应地,以游戏图像为例,获取待处理图像的过程可以是:接收用户开启该游戏应用的操作,响应于该开启该游戏应用的操作,从服务器获取待显示的该第二图像。其中,服务器还可存储有待显示的游戏图像。For another example, assuming that the first application is a game application, the second image may be a game image in the game application. Correspondingly, taking game images as an example, the process of obtaining the image to be processed may be: receiving the user's operation to start the game application, and in response to the operation of starting the game application, obtaining the second image to be displayed from the server. Among them, the server can also store game images to be displayed.

又如,以第一应用为剪辑应用为例,第二图像可以是用户在剪辑应用中上传的待剪辑图像。相应地,以待剪辑图像为例,获取待处理图像的过程可以是:接收用户在剪辑应用中上传图像的操作,响应于该上传图像的操作,获取所上传的第二图像。For another example, assuming that the first application is an editing application, the second image may be an image to be edited uploaded by the user in the editing application. Correspondingly, taking the image to be edited as an example, the process of obtaining the image to be processed may be: receiving an operation of the user to upload an image in the editing application, and in response to the operation of uploading the image, obtaining the uploaded second image.

本申请实施例中,图像处理可以为图像增强处理、图像超分处理、图像恢复处理、图像修复处理、图像去模糊处理、图像去噪处理、图像去雨处理、图像去雾处理、质量提升处理或高动态范围处理中的至少一项。在该实施例中,示出了多种类型的图像处理功能。如此,可以在上述图像增强场景、图像超分场景、图像恢复场景、图像修复场景、图像去模糊场景、图像去噪场景、图像去雨场景、图像去雾场景、质量提升场景或高动态范围场景中至少一项场景中,针对待处理图像进行颜色修正,拓宽了颜色修正的适用范围。In the embodiment of the present application, image processing may be image enhancement processing, image super-resolution processing, image restoration processing, image repair processing, image deblurring processing, image denoising processing, image rain removal processing, image dehazing processing, and quality improvement processing. or at least one of high dynamic range processing. In this embodiment, various types of image processing functions are shown. In this way, the image enhancement scene, image super-resolution scene, image restoration scene, image repair scene, image deblurring scene, image denoising scene, image rain removal scene, image dehazing scene, quality improvement scene or high dynamic range scene can be used. In at least one of the scenarios, color correction is performed on the image to be processed, which broadens the applicable scope of color correction.

在一些实施例中,在该待处理图像为对该第二图像进行图像处理后得到的图像的情况下,上述获取待处理图像的过程可以是:接收用户触发该第一应用显示图像的操作,响应于该触发该第一应用显示图像的操作,获取待显示的该第二图像。对该第二图像进行图像处理,以获得该待处理图像。In some embodiments, when the image to be processed is an image obtained by performing image processing on the second image, the above process of obtaining the image to be processed may be: receiving an operation from the user to trigger the first application to display the image, In response to the operation of triggering the first application to display an image, the second image to be displayed is obtained. Perform image processing on the second image to obtain the image to be processed.

在上述实施例中,提供了一种基于第一应用来获取待处理图像的过程。其中,通过用户触发该第一应用显示图像的操作,能够快速且高效的获取到待显示的该第二图像,进而,通过图像处理即可获得经图像处理后的待处理图像。In the above embodiment, a process of obtaining an image to be processed based on the first application is provided. Among them, by the user triggering the operation of the first application to display the image, the second image to be displayed can be quickly and efficiently obtained, and further, the image-processed image to be processed can be obtained through image processing.

例如,以预览图像为例,获取待处理图像的过程可以是:接收用户开启该相机应用的操作,响应于该开启该相机应用的操作,获取该电子设备采集到的该第二图像。对该第二图像进行图像处理,以获得该待处理图像。以拍摄图像为例,获取待处理图像的过程可以是:接收用户在该相机应用中的拍摄操作,响应于该拍摄操作,获取该电子设备拍摄到的该第二图像。对该第二图像进行图像处理,以获得该待处理图像。For example, taking the preview image as an example, the process of obtaining the image to be processed may be: receiving the user's operation of opening the camera application, and in response to the operation of opening the camera application, obtaining the second image collected by the electronic device. Perform image processing on the second image to obtain the image to be processed. Taking photographing an image as an example, the process of obtaining an image to be processed may be: receiving a user's photographing operation in the camera application, and in response to the photographing operation, obtaining the second image photographed by the electronic device. Perform image processing on the second image to obtain the image to be processed.

又如,以图库应用中保存的图像为例,获取待处理图像的过程可以是:接收用户开启该图库应用的操作,响应于该开启该图库应用的操作,从本地图库获取该第二图像。对该第二图像进行图像处理,以获得该待处理图像。For another example, taking the image saved in the gallery application as an example, the process of obtaining the image to be processed may be: receiving the user's operation to open the gallery application, and in response to the operation of opening the gallery application, obtaining the second image from the local gallery. Perform image processing on the second image to obtain the image to be processed.

又如,以待播放的视频图像为例,获取待处理图像的过程可以是:接收用户在该视频应用中播放视频的操作,响应于该播放视频的操作,从服务器获取待播放的该第二图像。对该第二图像进行图像处理,以获得该待处理图像。For another example, taking the video image to be played as an example, the process of obtaining the image to be processed may be: receiving the user's operation of playing the video in the video application, and in response to the operation of playing the video, obtaining the second image to be played from the server. image. Perform image processing on the second image to obtain the image to be processed.

又如,以游戏图像为例,获取待处理图像的过程可以是:接收用户开启该游戏应用的操作,响应于该开启该游戏应用的操作,从服务器获取待显示的该第二图像。对该第二图像进行图像处理,以获得该待处理图像。For another example, taking a game image as an example, the process of obtaining the image to be processed may be: receiving the user's operation of opening the game application, and in response to the operation of opening the game application, obtaining the second image to be displayed from the server. Perform image processing on the second image to obtain the image to be processed.

又如,以待剪辑图像为例,获取待处理图像的过程可以是:接收用户在剪辑应用中上传图像的操作,响应于该上传图像的操作,获取所上传的第二图像。对该第二图像进行图像处理,以获得该待处理图像。For another example, taking the image to be edited as an example, the process of obtaining the image to be processed may be: receiving the user's operation of uploading an image in the editing application, and in response to the operation of uploading the image, obtaining the uploaded second image. Perform image processing on the second image to obtain the image to be processed.

在上述示例中,提供了多种类型的第一应用以及基于对应类型的应用来获取待处理图像的过程。如此,能够快速且高效的获取到待显示的该第二图像,进而,通过图像处理即可获得经图像处理后的图像。In the above example, multiple types of first applications and a process of obtaining an image to be processed based on the corresponding types of applications are provided. In this way, the second image to be displayed can be obtained quickly and efficiently, and further, the image-processed image can be obtained through image processing.

需要说明的是,上述所示的各种待处理图像仅作为示例,对电子设备获取待处理图像的过程进行说明。而在另一些实施例中,待处理图像还可以是其他类型的图像,相应地,电子设备还能够采用其他方式,来获取该待处理图像。本申请实施例对如何获取待处理图像的过程不作限定。It should be noted that the various images to be processed shown above are only used as examples to illustrate the process of the electronic device acquiring the images to be processed. In other embodiments, the image to be processed can also be other types of images, and accordingly, the electronic device can also use other methods to obtain the image to be processed. The embodiments of this application do not limit the process of obtaining the image to be processed.

S402、电子设备将该待处理图像输入第一颜色修正模型,通过第一颜色修正模型的预测子模型,预测该待处理图像的颜色修正系数。S402. The electronic device inputs the image to be processed into the first color correction model, and predicts the color correction coefficient of the image to be processed through the prediction sub-model of the first color correction model.

本申请实施例中,预测子模型用于预测待处理图像的颜色修正系数。在一些实施例中,预测子模型可以是第一颜色修正模型中的颜色系数预测模块。In the embodiment of the present application, the prediction sub-model is used to predict the color correction coefficient of the image to be processed. In some embodiments, the prediction sub-model may be a color coefficient prediction module in the first color correction model.

颜色修正系数用于对该待处理图像中包括的各像素点在不同颜色通道上的颜色进行修正。应理解地,待处理图像可以包括各像素点在不同颜色通道上的颜色值。The color correction coefficient is used to correct the color of each pixel included in the image to be processed on different color channels. It should be understood that the image to be processed may include color values of each pixel on different color channels.

其中,颜色修正系数可以是n*3的特征向量的形式。其中,n表示该待处理图像中像素点的总数量,n为大于1的正整数。3表示RGB的3个颜色通道(即红-R、绿-G、蓝-B)。相应地,待处理图像也可以是n*3的特征向量的形式。应理解地,在n*3的特征向量中,1个像素点对应3个颜色通道上的修正系数值。The color correction coefficient may be in the form of an n*3 feature vector. Among them, n represents the total number of pixels in the image to be processed, and n is a positive integer greater than 1. 3 represents the three color channels of RGB (i.e. red-R, green-G, blue-B). Correspondingly, the image to be processed can also be in the form of n*3 feature vectors. It should be understood that in the n*3 feature vector, one pixel corresponds to the correction coefficient values on three color channels.

在一些实施例中,颜色修正系数可以包括该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数。本申请实施例中,第一修正系数用于通过第一调节处理(如求和运算)的方式来进行颜色修正。In some embodiments, the color correction coefficient may include a first correction coefficient on different color channels for each pixel included in the image to be processed. In the embodiment of the present application, the first correction coefficient is used to perform color correction through a first adjustment process (such as a summation operation).

进一步地,该颜色修正系数还可以包括该待处理图像中包括的各像素点在不同颜色通道上的第二修正系数。本申请实施例中,第二修正系数用于通过第二调节处理(如乘积运算)的方式来进行颜色修正。其中,第一调节处理的调节力度比第二调节处理的调节力度小。Further, the color correction coefficient may also include a second correction coefficient on different color channels for each pixel included in the image to be processed. In the embodiment of the present application, the second correction coefficient is used to perform color correction through a second adjustment process (such as a product operation). Wherein, the adjustment intensity of the first adjustment process is smaller than the adjustment intensity of the second adjustment process.

参见图4,第一修正系数可以是偏移系数tensor,也即图4所示的n*3的特征向量(r4,r5,r6)。第二修正系数可以是调节系数tensor,也即图4所示的n*3的特征向量(r1,r2,r3)。Referring to Figure 4, the first correction coefficient may be an offset coefficient tensor, that is, the n*3 feature vector (r 4 , r 5 , r 6 ) shown in Figure 4. The second correction coefficient may be an adjustment coefficient tensor, that is, the n*3 feature vector (r 1 , r 2 , r 3 ) shown in Figure 4 .

在一些实施例中,上述通过预测子模型,预测该待处理图像的颜色修正系数的过程可以是:通过该预测子模型的特征提取层,对该待处理图像进行特征提取,得到该待处理图像在不同颜色通道上的颜色特征。通过该预测子模型的卷积层,对该待处理图像在不同颜色通道上的颜色特征进行卷积处理,得到该待处理图像在不同颜色通道上的颜色修正系数。In some embodiments, the above-mentioned process of predicting the color correction coefficient of the image to be processed through the prediction sub-model may be: performing feature extraction on the image to be processed through the feature extraction layer of the prediction sub-model to obtain the image to be processed. Color features on different color channels. Through the convolution layer of the prediction sub-model, the color features of the image to be processed on different color channels are convolved to obtain the color correction coefficients of the image to be processed on different color channels.

上述S402所示过程中,对电子设备获取该待处理图像的颜色修正系数的过程进行了说明。其中,通过在预测子模型中设置特征提取层和卷积层,利用特征提取层提取待处理图像在不同颜色通道上的颜色特征,利用卷积层对提取到的颜色特征进行卷积处理,以得到该颜色修正系数。如此,提供了一种基于特征提取层和卷积层构成的预测子模型,能够预测得到待处理图像在不同颜色通道上的颜色修正系数。In the process shown in S402 above, the process of the electronic device obtaining the color correction coefficient of the image to be processed is explained. Among them, by setting up a feature extraction layer and a convolution layer in the prediction sub-model, the feature extraction layer is used to extract the color features of the image to be processed on different color channels, and the convolution layer is used to perform convolution processing on the extracted color features. Get the color correction coefficient. In this way, a prediction sub-model based on the feature extraction layer and the convolution layer is provided, which can predict the color correction coefficients of the image to be processed on different color channels.

其中,特征提取层可以包括至少两层目标模型结构,该目标模型结构包括卷积层、批标准化层及激活函数层。示例性的,该目标模型结构可以是conv+bn+relu模型结构。参见图4,以该特征提取层包括两层目标模型结构为例,该两层目标模型结构可以是图4所示的两层conv+bn+relu模型结构。该预测子模型的卷积层可以是图4所示的conv层。Wherein, the feature extraction layer may include at least two layers of target model structure, and the target model structure includes a convolution layer, a batch normalization layer and an activation function layer. For example, the target model structure may be a conv+bn+relu model structure. Referring to Figure 4, take the feature extraction layer including a two-layer target model structure as an example. The two-layer target model structure can be the two-layer conv+bn+relu model structure shown in Figure 4. The convolutional layer of the prediction sub-model can be the conv layer shown in Figure 4.

应理解地,在conv+bn+relu模型结构中,conv表示卷积层,用于进行卷积运算。bn(batch normalization)表示批标准化层,用于调整卷积层输出数据的分布,使其进入激活函数层的作用区,以加快模型的收敛速度,提高模型的泛化能力以及防止梯度消失。relu表示激活函数层,用于增加各层之间的非线性关系,从而定义模型的输出。It should be understood that in the conv+bn+relu model structure, conv represents the convolution layer, which is used to perform convolution operations. bn (batch normalization) represents the batch normalization layer, which is used to adjust the distribution of the output data of the convolution layer so that it enters the action area of the activation function layer to speed up the convergence speed of the model, improve the generalization ability of the model and prevent the gradient from disappearing. relu represents the activation function layer, which is used to increase the nonlinear relationship between each layer to define the output of the model.

在上述实施例中,提供了一种基于至少两层目标模型结构构成的特征提取层。其中,该目标模型结构包括卷积层、批标准化层及激活函数层。这样,构成的特征提取层具备良好的特征提取能力,能够提取得到更加丰富且有效的颜色特征,从而基于所提取的颜色特征来预测待处理图像的颜色修正系数,能够提升颜色修正系数的预测准确性。In the above embodiment, a feature extraction layer based on at least two layers of target model structure is provided. Among them, the target model structure includes a convolution layer, a batch normalization layer and an activation function layer. In this way, the feature extraction layer formed has good feature extraction capabilities and can extract richer and more effective color features, thereby predicting the color correction coefficient of the image to be processed based on the extracted color features, which can improve the accuracy of prediction of the color correction coefficient. sex.

S403、电子设备通过该第一颜色修正模型的修正子模型,基于该颜色修正系数对该待处理图像进行颜色修正,得到该第一图像。S403. The electronic device uses the correction sub-model of the first color correction model to perform color correction on the image to be processed based on the color correction coefficient to obtain the first image.

本申请实施例中,第一图像是基于该颜色修正系数对该待处理图像进行颜色修正后得到的图像。示例性的,以待处理图像为n*3的特征向量的形式为例,相应地,第一图像同样是n*3的特征向量的形式。In the embodiment of the present application, the first image is an image obtained by performing color correction on the image to be processed based on the color correction coefficient. For example, assuming that the image to be processed is in the form of n*3 feature vectors, correspondingly, the first image is also in the form of n*3 feature vectors.

在一些实施例中,以颜色修正系数包括该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数为例,相应地,上述颜色修正的过程可以包括:基于该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数,对该待处理图像中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到该第一图像。In some embodiments, for example, the color correction coefficient includes the first correction coefficient on different color channels of each pixel included in the image to be processed. Correspondingly, the above color correction process may include: based on the image to be processed The first correction coefficient of each pixel included in the image on different color channels is used to perform a first adjustment process on the color value of each pixel included in the image to be processed on the corresponding color channel to obtain the first image.

其中,上述第一调节处理的过程可以是:基于该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数,与待处理图像中包括的各像素点在对应颜色通道上的颜色值进行求和运算,得到第一图像。Wherein, the above-mentioned first adjustment process may be: based on the first correction coefficient of each pixel point included in the image to be processed on different color channels, and the first correction coefficient of each pixel point included in the image to be processed on the corresponding color channel. The color values are summed to obtain the first image.

上述实施例以基于颜色修正系数所包括的第一修正系数为例,对颜色修正的过程进行了说明。如此,提供了一种基于颜色修正系数包括的各像素点在不同颜色通道上的第一修正系数,来进行颜色修正的方式。其中,结合不同颜色通道上的第一修正系数以及对应颜色通道上的颜色值进行第一调节处理,能够从像素点维度出发实现对颜色通道上的颜色值的修正,也就实现了对待处理图像的颜色修正,从而获得颜色质量更高的第一图像。The above embodiment describes the color correction process by taking the first correction coefficient included in the color correction coefficient as an example. In this way, a method of performing color correction based on the first correction coefficient on different color channels of each pixel included in the color correction coefficient is provided. Among them, by combining the first correction coefficients on different color channels and the color values on the corresponding color channels for the first adjustment process, the color values on the color channels can be corrected from the pixel point dimension, which also realizes the image to be processed. of color correction, resulting in a first image with higher color quality.

在另一些实施例中,以颜色修正系数包括该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数和第二修正系数为例,相应地,上述颜色修正的过程可以包括:基于该待处理图像中包括的各像素点在不同颜色通道上的第二修正系数,对该待处理图像中包括的各像素点在对应颜色通道上的颜色值进行第二调节处理,得到第二调节处理后的图像。基于该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数,对第二调节处理后的图像中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到该第一图像。In other embodiments, for example, the color correction coefficient includes the first correction coefficient and the second correction coefficient on different color channels of each pixel included in the image to be processed. Correspondingly, the above color correction process may include : Based on the second correction coefficient of each pixel point included in the image to be processed on different color channels, perform a second adjustment process on the color value of each pixel point included in the image to be processed on the corresponding color channel to obtain the second correction coefficient 2. Adjust the processed image. Based on the first correction coefficients of each pixel point included in the image to be processed on different color channels, perform a first adjustment process on the color value of each pixel point included in the image after the second adjustment process on the corresponding color channel, Get the first image.

其中,上述第二调节处理的过程可以是:基于该待处理图像中包括的各像素点在不同颜色通道上的第二修正系数,与该待处理图像中包括的各像素点在对应颜色通道上的颜色值进行乘积运算,得到第二调节处理后的图像。进而,基于该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数,与第二调节处理后的图像中包括的各像素点在对应颜色通道上的颜色值进行求和运算,得到该第一图像。Wherein, the process of the above-mentioned second adjustment process may be: based on the second correction coefficient of each pixel included in the image to be processed on different color channels, and the second correction coefficient of each pixel included in the image to be processed on the corresponding color channel. The color values are multiplied to obtain the image after the second adjustment process. Furthermore, based on the first correction coefficient of each pixel point included in the image to be processed on different color channels, a summation operation is performed with the color value of each pixel point included in the second adjusted image on the corresponding color channel. , get the first image.

上述实施例以结合颜色修正系数所包括的第一修正系数与第二修正系数为例,对颜色修正的过程进行了说明。如此,提供了一种结合颜色修正系数包括的各像素点在不同颜色通道上的第一修正系数以及第二修正系数,来进行颜色修正的方式。其中,先结合不同颜色通道上的第二修正系数以及对应颜色通道上的颜色值进行第二调节处理,能够从像素点维度出发快速且高效的实现对颜色通道上的颜色值的初步修正。进而,再结合不同颜色通道上的第一修正系数以及第二调节处理后的对应颜色通道上的颜色值进行第一调节处理,能够从像素点维度出发进一步实现对颜色通道上的颜色值的二次修正,进而实现对待处理图像的颜色修正,从而获得颜色质量更高的第一图像。The above embodiment describes the color correction process by taking the combination of the first correction coefficient and the second correction coefficient included in the color correction coefficient as an example. In this way, a method of performing color correction is provided by combining the first correction coefficient and the second correction coefficient of each pixel included in the color correction coefficient on different color channels. Among them, the second adjustment process is first performed by combining the second correction coefficients on different color channels and the color values on the corresponding color channels, so that the preliminary correction of the color values on the color channels can be quickly and efficiently implemented from the pixel point dimension. Furthermore, by performing the first adjustment process in combination with the first correction coefficients on different color channels and the color values on the corresponding color channels after the second adjustment process, it is possible to further realize the second adjustment of the color values on the color channels from the pixel point dimension. correction, thereby achieving color correction of the image to be processed, thereby obtaining a first image with higher color quality.

在一些实施例中,在执行上述第二调节处理之前,还对该第二修正系数进行归一化处理。进而基于归一化处理后的该第二修正系数,执行后续第二调节处理的过程。In some embodiments, before performing the above-mentioned second adjustment process, the second correction coefficient is also normalized. Then, based on the normalized second correction coefficient, a subsequent second adjustment process is performed.

其中,归一化处理是指将颜色修正系数的特征值缩放至[0,1]区间内。Among them, the normalization process refers to scaling the characteristic value of the color correction coefficient to the [0,1] interval.

在一些实施例中,通过sigmoid函数,对该颜色修正系数包括的各像素点在不同颜色通道上的第二修正系数进行归一化处理,得到归一化处理后的该第二修正系数。In some embodiments, the second correction coefficients on different color channels of each pixel included in the color correction coefficient are normalized through a sigmoid function to obtain the normalized second correction coefficient.

示例性的,参见图4,通过sigmoid函数,对上述调节系数tensor,也即图4所示的n*3的特征向量(r1,r2,r3)进行归一化处理,进而,利用归一化处理后的调节系数tensor执行后续第二调节处理的过程。For example, referring to Figure 4, the above-mentioned adjustment coefficient tensor, that is, the n*3 feature vector (r 1 , r 2 , r 3 ) shown in Figure 4, is normalized through the sigmoid function, and then, using The normalized adjustment coefficient tensor performs the subsequent second adjustment process.

如此,通过对第二修正系数进行归一化处理,以消除第二修正系数中不同特征值之间的量纲影响,以便基于归一化处理后的第二修正系数,来执行后续针对颜色值的初步修正,从而确保颜色修正的顺利进行。In this way, the second correction coefficient is normalized to eliminate the dimensional influence between different eigenvalues in the second correction coefficient, so that subsequent color values can be performed based on the normalized second correction coefficient. preliminary correction to ensure the smooth progress of color correction.

基于上述S402至S403,提供了一种颜色修正方法,能够实现针对待处理图像的颜色修正。其中,通过获取该待处理图像的颜色修正系数,能够从像素点维度出发实现对不同颜色通道上颜色的修正,从而实现针对图像的颜色修正,以提升图像处理的效果。进而,通过在该电子设备的显示屏上显示颜色修正后得到的图像,能够为用户显示出颜色质量更高、更加贴近真实颜色效果的图像,提高了图像的显示效果。Based on the above S402 to S403, a color correction method is provided, which can realize color correction for the image to be processed. Among them, by obtaining the color correction coefficient of the image to be processed, the color correction on different color channels can be implemented from the pixel point dimension, thereby achieving color correction for the image to improve the effect of image processing. Furthermore, by displaying the color-corrected image on the display screen of the electronic device, an image with higher color quality and closer to the real color effect can be displayed to the user, thereby improving the display effect of the image.

在一些实施例中,电子设备可设置有第一控制控件,该第一控制控件用于触发颜色修正功能的开启或关闭。例如,用户可通过对该第一控制控件实施触发操作,来开启或关闭颜色修正功能。示例性的,触发操作可以是点击操作、滑动操作或其他操作。In some embodiments, the electronic device may be provided with a first control control for triggering turning on or off the color correction function. For example, the user can turn on or off the color correction function by performing a triggering operation on the first control control. For example, the trigger operation may be a click operation, a sliding operation, or other operations.

相应地,在一些实施例中,电子设备响应于用户对第一控制控件的开启操作,在获取待处理图像之后,执行后续S402至S403,以在该电子设备的显示屏上显示颜色修正后的第一图像。或,在另一些实施例中,电子设备响应于用户对第一控制控件的关闭操作,在获取待处理图像之后,无需执行后续S402至S403,在该电子设备的显示屏上显示该待处理图像。Accordingly, in some embodiments, in response to the user's opening operation of the first control control, after acquiring the image to be processed, the electronic device performs subsequent S402 to S403 to display the color-corrected image on the display screen of the electronic device. First image. Or, in other embodiments, in response to the user's closing operation of the first control control, the electronic device displays the image to be processed on the display screen of the electronic device without performing subsequent S402 to S403 after acquiring the image to be processed. .

S404、电子设备在该电子设备的显示屏上显示该第一图像。S404. The electronic device displays the first image on the display screen of the electronic device.

在一些实施例中,电子设备在该第一应用的界面中显示该第一图像。In some embodiments, the electronic device displays the first image in an interface of the first application.

例如,以第一应用为相机应用为例,在该相机应用的预览界面中显示该第一图像。其中,预览界面可以是相机应用中包含拍摄控件的界面。或,在该相机应用的图像查看界面中显示该第一图像。其中,图像查看界面可以是相机应用中用于触发查看已拍摄的图像的界面。For example, assuming that the first application is a camera application, the first image is displayed in the preview interface of the camera application. The preview interface may be an interface including shooting controls in a camera application. Or, display the first image in the image viewing interface of the camera application. The image viewing interface may be an interface in a camera application used to trigger viewing of captured images.

又如,以第一应用为图库应用为例,在该图库应用的图像列表界面中显示该第一图像的缩略图。又如,以第一应用为视频应用为例,在该视频应用的播放界面中显示该第一图像。又如,以第一应用为游戏应用为例,在该游戏应用的游戏界面中显示该第一图像。又如,以第一应用为剪辑应用为例,在该剪辑应用的剪辑界面中显示该第一图像。For another example, assuming that the first application is a gallery application, the thumbnail of the first image is displayed in the image list interface of the gallery application. For another example, taking the first application as a video application, the first image is displayed in the playback interface of the video application. For another example, taking the first application as a game application, the first image is displayed in the game interface of the game application. For another example, taking the first application as an editing application, the first image is displayed in the editing interface of the editing application.

需要说明的是,上述所示的各种第一应用仅作为示例,对电子设备显示该第一图像的过程进行说明。而在另一些实施例中,第一应用还可以是其他类型的应用,相应地,电子设备还能够采用其他方式,来显示该第一图像。本申请实施例对如何显示该第一图像的过程不作限定。It should be noted that the various first applications shown above are only examples to illustrate the process of the electronic device displaying the first image. In other embodiments, the first application can also be other types of applications, and accordingly, the electronic device can also use other methods to display the first image. The embodiment of the present application does not limit the process of how to display the first image.

上述S403至S404,对电子设备基于该颜色修正系数,在该电子设备的显示屏上显示第一图像的过程进行了说明。如此,能够为用户显示出颜色质量更高、更加贴近真实颜色效果的图像,提高了图像的显示效果。The above S403 to S404 describe the process of the electronic device displaying the first image on the display screen of the electronic device based on the color correction coefficient. In this way, images with higher color quality and closer to real color effects can be displayed to the user, thereby improving the display effect of the image.

在一些实施例中,电子设备基于S403得到第一图像后,还可以对该第一图像进行图像处理,得到图像处理后的第一图像。进而,在电子设备的显示屏上显示该图像处理后的第一图像。这样,在对待处理图像进行颜色修正得到第一图像之后,还能够对第一图像进行图像处理,以得到图像质量更高的图像。In some embodiments, after the electronic device obtains the first image based on S403, it may also perform image processing on the first image to obtain a processed first image. Then, the image-processed first image is displayed on the display screen of the electronic device. In this way, after performing color correction on the image to be processed to obtain the first image, image processing can also be performed on the first image to obtain an image with higher image quality.

上述图4所示实施例提供的技术方案,提供了一种基于第一颜色修正模型来进行颜色修正的方案。其中,通过在第一颜色修正模型中设置用于预测颜色修正系数的预测子模型,来实现对待处理图像的颜色修正系数的预测。通过在第一颜色修正模型中设置用于颜色修正的修正子模型,来实现对待处理图像的颜色修正。如此,通过第一颜色修正模型,能够从像素点维度出发实现对不同颜色通道上颜色的修正,从而实现针对图像的颜色修正,以提升图像处理的效果。进而,通过在该电子设备的显示屏上显示颜色修正后得到的图像,能够为用户显示出颜色质量更高、更加贴近真实颜色效果的图像,提高了图像的显示效果。The technical solution provided by the embodiment shown in FIG. 4 above provides a solution for color correction based on the first color correction model. Prediction of the color correction coefficient of the image to be processed is achieved by setting a prediction sub-model for predicting the color correction coefficient in the first color correction model. Color correction of the image to be processed is achieved by setting a correction sub-model for color correction in the first color correction model. In this way, through the first color correction model, the color correction on different color channels can be implemented from the pixel dimension, thereby achieving color correction for the image to improve the effect of image processing. Furthermore, by displaying the color-corrected image on the display screen of the electronic device, an image with higher color quality and closer to the real color effect can be displayed to the user, thereby improving the display effect of the image.

示例性的,在该待处理图像为该第二图像的情况下,上述图4所示流程可替换为:将该第二图像输入第一颜色修正模型,通过该第一颜色修正模型的预测子模型,预测该第二图像的颜色修正系数。通过该第一颜色修正模型的修正子模型,基于该颜色修正系数对该第二图像进行颜色修正,得到该第一图像。在该电子设备的显示屏上显示该第一图像。For example, when the image to be processed is the second image, the process shown in Figure 4 can be replaced by: inputting the second image into the first color correction model, and using the predictor of the first color correction model to model to predict the color correction coefficient of the second image. Through the correction sub-model of the first color correction model, the second image is color corrected based on the color correction coefficient to obtain the first image. The first image is displayed on the display screen of the electronic device.

又示例性的,在该待处理图像为对该第二图像进行图像处理后得到的图像的情况下,上述图4所示流程可替换为:将图像处理后的图像输入第一颜色修正模型,通过该第一颜色修正模型的预测子模型,预测该图像处理后的图像的颜色修正系数。通过该第一颜色修正模型的修正子模型,基于该颜色修正系数对该图像处理后的图像进行颜色修正,得到该第一图像。在该电子设备的显示屏上显示该第一图像。As another example, in the case where the image to be processed is an image obtained by image processing the second image, the process shown in Figure 4 above can be replaced by: inputting the image processed image into the first color correction model, The color correction coefficient of the image after image processing is predicted through the prediction sub-model of the first color correction model. Through the correction sub-model of the first color correction model, color correction is performed on the image processed image based on the color correction coefficient to obtain the first image. The first image is displayed on the display screen of the electronic device.

需要说明的是,在该待处理图像为对该第二图像进行图像处理后得到的图像的情况下,除上述示例所示流程以外,还能够有其他实现方式。示例性的,图5为本申请实施例提供的一种颜色修正方法的流程示意图。参见图5,以基于第二颜色修正模型来进行颜色修正为例对方案进行说明,该方法包括以下S501-S504:It should be noted that, when the image to be processed is an image obtained by performing image processing on the second image, other implementations are possible in addition to the process shown in the above example. For example, FIG. 5 is a schematic flowchart of a color correction method provided by an embodiment of the present application. Referring to Figure 5, the solution is explained by taking color correction based on the second color correction model as an example. The method includes the following S501-S504:

S501、电子设备将第二图像输入第二颜色修正模型,通过该第二颜色修正模型的处理子模型对该第二图像进行图像处理,得到待处理图像。S501. The electronic device inputs the second image into the second color correction model, and performs image processing on the second image through the processing sub-model of the second color correction model to obtain the image to be processed.

本申请实施例中,处理子模型用于对待处理图像进行处理,以获得图像处理后的图像。参见图5,图像处理后的图像也即是处理子模型的输出图像。In the embodiment of the present application, the processing sub-model is used to process the image to be processed to obtain a processed image. Referring to Figure 5, the image after image processing is also the output image of the processing sub-model.

在一些实施例中,图像处理后的图像可以是n*3的特征向量的形式。应理解地,图像处理后的图像可以包括各像素点在不同颜色通道上的颜色值。In some embodiments, the image processed image may be in the form of n*3 feature vectors. It should be understood that the image processed may include the color values of each pixel on different color channels.

在一些实施例中,该处理子模型为用于提供图像增强功能、图像超分功能、图像恢复功能、图像修复功能、图像去模糊功能、图像去噪功能、图像去雨功能、图像去雾功能、质量提升功能或高动态范围功能中至少一项功能的模型。In some embodiments, the processing sub-model is used to provide an image enhancement function, an image super-resolution function, an image restoration function, an image repair function, an image deblurring function, an image denoising function, an image rain removal function, and an image dehazing function. , quality improvement function or high dynamic range function.

示例性的,以处理子模型为用于提供图像增强功能的模型为例,上述图像处理后的图像也即是经图像增强处理后得到的图像。以处理子模型为用于提供图像超分功能的模型为例,上述图像处理后的图像也即是经图像超分处理后得到的图像。其他图像处理功能类似,不再赘述。For example, taking the processing sub-model as a model used to provide an image enhancement function, the above-mentioned image processed image is also an image obtained after image enhancement processing. Taking the processing sub-model as a model used to provide image super-resolution function as an example, the above-mentioned image processed image is also an image obtained after image super-resolution processing. Other image processing functions are similar and will not be described again.

在上述实施例中,示出了多种类型的图像处理功能,处理子模型可以是提供有多种类型的图像处理功能中至少一项功能的模型。如此,可以在上述图像增强场景、图像超分场景、图像恢复场景、图像修复场景、图像去模糊场景、图像去噪场景、图像去雨场景、图像去雾场景、质量提升场景或高动态范围场景中至少一个场景中,针对图像处理后的图像进行颜色修正,拓宽了颜色修正的适用范围。In the above embodiments, multiple types of image processing functions are shown, and the processing sub-model may be a model provided with at least one function of the multiple types of image processing functions. In this way, the image enhancement scene, image super-resolution scene, image restoration scene, image repair scene, image deblurring scene, image denoising scene, image rain removal scene, image dehazing scene, quality improvement scene or high dynamic range scene can be used. In at least one scene, color correction is performed on the image after image processing, which broadens the applicable scope of color correction.

在一些实施例中,该处理子模型可以是Unet网络模型、transformer网络模型、生成对抗网络(vector quantized generative adversarial network,VQ-GAN)网络模型中的任一项。In some embodiments, the processing sub-model may be any one of a Unet network model, a transformer network model, and a generative adversarial network (vector quantized generative adversarial network, VQ-GAN) network model.

其中,Unet网络模型是图像分割领域中常用的分割网络。在一些实施例中,Unet网络模型可以是基于卷积神经网络的编码器-解码器架构,将输入图像分割成多个像素级别的类别。transformer网络模型是一种利用注意力机制来提高模型训练速度的模型。VQ-GAN网络模型是一种基于GAN的图像生成模型,能够将低质量的图像转换为高质量的图像。Among them, the Unet network model is a commonly used segmentation network in the field of image segmentation. In some embodiments, the Unet network model may be an encoder-decoder architecture based on a convolutional neural network that segments the input image into multiple pixel-level categories. The transformer network model is a model that uses the attention mechanism to improve the speed of model training. The VQ-GAN network model is a GAN-based image generation model that can convert low-quality images into high-quality images.

示例性的,以Unet网络模型为例,处理子模型可以包括特征提取层(或称作下采样模块)和反卷积层(或称作上采样模块)。相应地,通过处理子模型对待处理图像进行上述处理的过程可以是:通过该处理子模型的特征提取层,对该待处理图像进行特征提取,得到该待处理图像的图像特征。进而,通过该处理子模型的反卷积层,对该图像特征进行反卷积处理,得到图像处理后的图像。For example, taking the Unet network model as an example, the processing sub-model may include a feature extraction layer (or called a downsampling module) and a deconvolution layer (or called an upsampling module). Correspondingly, the process of performing the above processing on the image to be processed through the processing sub-model may be: performing feature extraction on the image to be processed through the feature extraction layer of the processing sub-model to obtain the image features of the image to be processed. Furthermore, the image features are deconvolved through the deconvolution layer of the processing sub-model to obtain the image after image processing.

上述S501所示过程中,对电子设备获取待处理图像的过程进行了说明。其中,通过在处理子模型中设置特征提取层和反卷积层,利用特征提取层提取待处理图像的图像特征,利用反卷积层对提取到的图像特征进行反卷积处理,以得到图像处理后的图像。如此,提供了一种基于特征提取层和反卷积层构成的处理子模型,能够预测得到图像处理后的图像。In the process shown in S501 above, the process of the electronic device acquiring the image to be processed is explained. Among them, by setting up a feature extraction layer and a deconvolution layer in the processing sub-model, the feature extraction layer is used to extract the image features of the image to be processed, and the deconvolution layer is used to deconvolve the extracted image features to obtain the image Processed image. In this way, a processing sub-model based on the feature extraction layer and the deconvolution layer is provided, which can predict the image after image processing.

S502、电子设备通过该第二颜色修正模型的预测子模型,预测该第二图像的颜色修正系数,作为该待处理图像的颜色修正系数。S502. The electronic device uses the prediction sub-model of the second color correction model to predict the color correction coefficient of the second image as the color correction coefficient of the image to be processed.

在一些实施例中,上述通过预测子模型,预测该第二图像的颜色修正系数的过程可以是:通过该预测子模型的特征提取层,对该第二图像进行特征提取,得到该第二图像在不同颜色通道上的颜色特征。通过该预测子模型的卷积层,对该第二图像在不同颜色通道上的颜色特征进行卷积处理,得到该第二图像在不同颜色通道上的颜色修正系数。In some embodiments, the above-mentioned process of predicting the color correction coefficient of the second image through the prediction sub-model may be: performing feature extraction on the second image through the feature extraction layer of the prediction sub-model to obtain the second image Color features on different color channels. Through the convolution layer of the prediction sub-model, the color features of the second image on different color channels are convolved to obtain the color correction coefficients of the second image on different color channels.

上述S502所示过程中,对电子设备获取该待处理图像的颜色修正系数的过程进行了说明。其中,通过在预测子模型中设置特征提取层和卷积层,利用特征提取层提取第二图像在不同颜色通道上的颜色特征,利用卷积层对提取到的颜色特征进行卷积处理,以得到该颜色修正系数。如此,提供了一种基于特征提取层和卷积层构成的预测子模型,能够预测得到第二图像在不同颜色通道上的颜色修正系数。In the process shown in S502 above, the process of the electronic device obtaining the color correction coefficient of the image to be processed is explained. Among them, by setting up a feature extraction layer and a convolution layer in the prediction sub-model, the feature extraction layer is used to extract the color features of the second image on different color channels, and the convolution layer is used to perform convolution processing on the extracted color features. Get the color correction coefficient. In this way, a prediction sub-model based on the feature extraction layer and the convolution layer is provided, which can predict the color correction coefficients of the second image on different color channels.

需要说明的是,第二颜色修正模型的预测子模型与图4中的S402所示第一颜色修正模型的预测子模型的结构相同。通过该第二颜色修正模型的预测子模型预测第二图像的颜色修正系数的过程可参见图4中的S402,不再赘述。It should be noted that the prediction sub-model of the second color correction model has the same structure as the prediction sub-model of the first color correction model shown in S402 in FIG. 4 . The process of predicting the color correction coefficient of the second image through the prediction sub-model of the second color correction model can be referred to S402 in Figure 4 and will not be described again.

S503、电子设备通过该第二颜色修正模型的修正子模型,基于该颜色修正系数对该待处理图像进行颜色修正,得到该第一图像。S503. The electronic device uses the correction sub-model of the second color correction model to perform color correction on the image to be processed based on the color correction coefficient to obtain the first image.

需要说明的是,第二颜色修正模型的修正子模型与图4中的S403所示第一颜色修正模型的修正子模型的结构相同。通过该第二颜色修正模型的修正子模型执行颜色修正的过程可参见图4中的S403,不再赘述。It should be noted that the correction sub-model of the second color correction model has the same structure as the correction sub-model of the first color correction model shown in S403 in FIG. 4 . The process of performing color correction through the correction sub-model of the second color correction model can be referred to S403 in Figure 4 and will not be described again.

基于上述S502至S503,提供了一种颜色修正方法,不仅能够对待处理图像执行图像处理(如图像增强等),还能够实现针对图像处理后的图像的颜色修正。Based on the above-mentioned S502 to S503, a color correction method is provided, which can not only perform image processing (such as image enhancement, etc.) on the image to be processed, but also achieve color correction for the image after image processing.

在一些实施例中,电子设备可设置有第一控制控件。相应地,在一些实施例中,电子设备响应于用户对第一控制控件的开启操作,在获取待处理图像之后,执行后续S502至S503,以在该电子设备的显示屏上显示颜色修正后的第一图像。或,在另一些实施例中,电子设备响应于用户对第一控制控件的关闭操作,在获取待处理图像之后,无需执行后续S502至S503,在该电子设备的显示屏上显示该图像处理后的待处理图像。In some embodiments, the electronic device may be provided with a first control control. Accordingly, in some embodiments, in response to the user's opening operation of the first control control, after acquiring the image to be processed, the electronic device performs subsequent S502 to S503 to display the color-corrected image on the display screen of the electronic device. First image. Or, in other embodiments, in response to the user's closing operation of the first control control, the electronic device does not need to perform subsequent S502 to S503 after acquiring the image to be processed, and displays the processed image on the display screen of the electronic device. of images to be processed.

在其他一些实施例中,电子设备可设置有第二控制控件,该第二控制控件用于触发图像处理功能的开启或关闭。其中,图像处理功能包括上述图像处理与颜色修正的功能。例如,用户可通过对该第二控制控件实施触发操作,来开启或关闭图像处理功能。In some other embodiments, the electronic device may be provided with a second control control, and the second control control is used to trigger turning on or off the image processing function. Among them, the image processing function includes the above-mentioned image processing and color correction functions. For example, the user can turn on or off the image processing function by performing a triggering operation on the second control control.

相应地,在一些实施例中,电子设备响应于用户对第二控制控件的开启操作,在获取第二图像之后,执行后续S501至S503,以在该电子设备的显示屏上显示经图像处理和颜色修正后的第一图像。或,在另一些实施例中,电子设备响应于用户对第二控制控件的关闭操作,在获取第二图像之后,无需执行后续S501至S503,在该电子设备的显示屏上显示第二图像。Correspondingly, in some embodiments, in response to the user's opening operation of the second control control, after acquiring the second image, the electronic device performs subsequent S501 to S503 to display the image-processed and image-processed image on the display screen of the electronic device. The first image after color correction. Or, in other embodiments, in response to the user's closing operation of the second control, the electronic device displays the second image on the display screen of the electronic device without performing subsequent S501 to S503 after acquiring the second image.

在又一些实施例中,电子设备可设置上述第一控制控件和上述第二控制控件。进而,用户可选择相应的控制控件,来灵活控制颜色修正功能或图像处理功能的开启或关闭。In some embodiments, the electronic device may be provided with the above-mentioned first control control and the above-mentioned second control control. Furthermore, users can select corresponding control controls to flexibly control the turning on or off of the color correction function or image processing function.

S504、电子设备在该电子设备的显示屏上显示该第一图像。S504. The electronic device displays the first image on the display screen of the electronic device.

需要说明的是,S504的内容参见图4中的S404,不再赘述。It should be noted that the content of S504 refers to S404 in Figure 4 and will not be described again.

上述S503至S504,对电子设备基于该颜色修正系数,在该电子设备的显示屏上显示第一图像的过程进行了说明。如此,能够为用户显示出颜色质量更高、更加贴近真实颜色效果的图像,提高了图像的显示效果。The above S503 to S504 describe the process of the electronic device displaying the first image on the display screen of the electronic device based on the color correction coefficient. In this way, images with higher color quality and closer to real color effects can be displayed to the user, thereby improving the display effect of the image.

上述图5所示实施例提供的技术方案,提供了一种基于第二颜色修正模型来进行颜色修正的方案。其中,通过在第二颜色修正模型中设置用于图像处理的处理子模型,来实现对待处理图像的图像处理。通过在第二颜色修正模型中设置用于预测颜色修正系数的预测子模型,来实现对颜色修正系数的预测。通过在第一颜色修正模型中设置用于颜色修正的修正子模型,来实现对图像处理后的图像的颜色修正。如此,提供了一种兼具颜色修正功能以及图像处理功能的模型,不仅可以对待处理图像进行图像处理,还能够有效提升图像的颜色质量,从而提升图像处理的效果。进而,通过在该电子设备的显示屏上显示颜色修正后得到的图像,能够为用户显示出颜色质量更高、更加贴近真实颜色效果的图像,提高了图像的显示效果。The technical solution provided by the embodiment shown in FIG. 5 above provides a solution for color correction based on the second color correction model. Wherein, image processing of the image to be processed is implemented by setting a processing sub-model for image processing in the second color correction model. Prediction of the color correction coefficient is achieved by setting a prediction sub-model for predicting the color correction coefficient in the second color correction model. By setting a correction sub-model for color correction in the first color correction model, color correction of the image after image processing is achieved. In this way, a model with both color correction function and image processing function is provided, which can not only perform image processing on the image to be processed, but also effectively improve the color quality of the image, thereby improving the effect of image processing. Furthermore, by displaying the color-corrected image on the display screen of the electronic device, an image with higher color quality and closer to the real color effect can be displayed to the user, thereby improving the display effect of the image.

示例性的,图6为本申请实施例提供的一种颜色修正的前后对比示意图。参见图6,图6中的A所示的图像用于指代本申请实施例中的待处理图像,也即是颜色修正前的图像。图6中的B所示的图像用于指代本申请实施例中经颜色修正后的第一图像。例如,参见图6中A所示的“车顶”A1,需要说明的是,在待处理图像中,“车顶”A1的颜色呈现较为不明显,通过肉眼无法明确其实际颜色。在应用本申请实施例提供的颜色修正方法经过颜色修正后,参见图6中B所示的“车顶”B1,在第一图像中,“车顶”B1的颜色呈现较为明显,肉眼能够明确车顶的颜色为红色。又如,参见图6中A所示的“树木”A2,需要说明的是,在待处理图像中,“树木”A2的颜色呈现较为不明显,肉眼无法明确其实际颜色,甚至无法区分树木和建筑物。在应用本申请实施例提供的颜色修正方法经过颜色修正后,参见图6中B所示的“树木”B2,在第一图像中,“树木”B2的颜色呈现较为明显,肉眼能够明确树木和建筑物,且能够明确树木的颜色为绿色。可见,通过在A所示的图像上应用本申请实施例提供的颜色修正方法,能够从像素点维度出发实现对不同颜色通道上颜色的修正,实现了针对图像的颜色修正,从而提升图像处理的效果。Illustratively, FIG. 6 is a schematic diagram of before and after color correction provided by an embodiment of the present application. Referring to Figure 6, the image shown in A in Figure 6 is used to refer to the image to be processed in the embodiment of the present application, that is, the image before color correction. The image shown as B in FIG. 6 is used to refer to the first image after color correction in the embodiment of the present application. For example, refer to the "roof" A1 shown in A in Figure 6. It should be noted that in the image to be processed, the color of the "roof" A1 is not obvious, and its actual color cannot be determined by the naked eye. After color correction using the color correction method provided by the embodiment of the present application, refer to the "roof" B1 shown in B in Figure 6. In the first image, the color of the "roof" B1 is relatively obvious and can be clearly understood by the naked eye. The color of the roof is red. For another example, refer to the "tree" A2 shown in A in Figure 6. It should be noted that in the image to be processed, the color of the "tree" A2 is relatively unobvious, and its actual color cannot be clear to the naked eye, and it is even impossible to distinguish between trees and trees. building. After applying the color correction method provided by the embodiment of the present application for color correction, refer to the "tree" B2 shown in B in Figure 6. In the first image, the color of the "tree" B2 is relatively obvious, and the naked eye can clearly distinguish between the tree and the tree. buildings, and it is clear that the color of trees is green. It can be seen that by applying the color correction method provided by the embodiment of the present application on the image shown in A, the color correction on different color channels can be realized from the pixel dimension, achieving color correction for the image, thereby improving the efficiency of image processing. Effect.

针对上述图4或图5所提到的颜色修正模型,在实施本方案之前,还需要基于图像训练数据对初始模型进行迭代训练,以获得该颜色修正模型。Regarding the color correction model mentioned in Figure 4 or Figure 5 above, before implementing this solution, it is necessary to iteratively train the initial model based on image training data to obtain the color correction model.

其中,在任一次迭代训练的过程中,将该图像训练数据输入上一次迭代训练后得到的模型中,通过该模型获取该图像训练数据的颜色修正系数,基于该颜色修正系数对该图像训练数据进行颜色修正,得到颜色修正后的输出图像。基于该输出图像和该图像训练数据对应的样本图像,调整模型参数。如此,提供了一种颜色修正模型的训练方法,利用图像训练数据对初始模型进行迭代训练,能够训练得到颜色修正能力较优的模型。Among them, during any iterative training process, the image training data is input into the model obtained after the previous iterative training, the color correction coefficient of the image training data is obtained through the model, and the image training data is processed based on the color correction coefficient. Color correction to obtain a color-corrected output image. Based on the output image and the sample image corresponding to the image training data, adjust the model parameters. In this way, a color correction model training method is provided, which uses image training data to iteratively train the initial model, and can train a model with better color correction capabilities.

针对图4所示的第一颜色修正模型,图7为本申请实施例提供的一种第一颜色修正模型的训练方法的流程示意图。参见图7,以模型训练中的任一次迭代训练的过程为例,该方法包括以下S701-S705:Regarding the first color correction model shown in Figure 4, Figure 7 is a schematic flowchart of a training method for the first color correction model provided by an embodiment of the present application. Referring to Figure 7, taking any iterative training process in model training as an example, the method includes the following S701-S705:

S701、电子设备在任一次迭代训练的过程中,将图像训练数据输入上一次迭代训练后得到的模型中。S701. During any iterative training process, the electronic device inputs the image training data into the model obtained after the previous iterative training.

其中,图像训练数据是指初始模型的训练数据。Among them, the image training data refers to the training data of the initial model.

S702、通过该模型的预测子模型,预测该图像训练数据的颜色修正系数。S702: Predict the color correction coefficient of the image training data through the prediction sub-model of the model.

在一些实施例中,通过该预测子模型的特征提取层,对该图像训练数据进行特征提取,得到该图像训练数据在不同颜色通道上的颜色特征。进而,通过该预测子模型的卷积层,对该图像训练数据在不同颜色通道上的颜色特征进行卷积处理,得到该图像训练数据在不同颜色通道上的颜色修正系数。In some embodiments, feature extraction is performed on the image training data through the feature extraction layer of the prediction sub-model to obtain color features of the image training data on different color channels. Furthermore, through the convolution layer of the prediction sub-model, the color features of the image training data on different color channels are convolved to obtain the color correction coefficients of the image training data on different color channels.

在该实施例中,通过在预测子模型中设置特征提取层和卷积层,利用特征提取层提取图像训练数据在不同颜色通道上的颜色特征,利用卷积层对提取到的颜色特征进行卷积处理,以得到该颜色修正系数。如此,提供了一种基于特征提取层和卷积层构成的预测子模型,能够预测得到图像训练数据的颜色修正系数。In this embodiment, by setting up a feature extraction layer and a convolution layer in the prediction sub-model, the feature extraction layer is used to extract the color features of the image training data on different color channels, and the convolution layer is used to convolve the extracted color features. product processing to obtain the color correction coefficient. In this way, a prediction sub-model based on the feature extraction layer and the convolution layer is provided, which can predict the color correction coefficient of the image training data.

其中,特征提取层可以包括至少两层目标模型结构。该目标模型结构包括卷积层、批标准化层及激活函数层。The feature extraction layer may include at least two layers of target model structures. The target model structure includes a convolution layer, a batch normalization layer and an activation function layer.

如此,提供了一种基于至少两层目标模型结构构成的特征提取层。其中,该目标模型结构包括卷积层、批标准化层及激活函数层。这样,构成的特征提取层具备良好的特征提取能力,能够提取得到更加丰富且有效的颜色特征,从而基于所提取的颜色特征来预测图像训练数据的颜色修正系数,能够提升颜色修正系数的预测准确性。In this way, a feature extraction layer based on at least two layers of target model structure is provided. Among them, the target model structure includes a convolution layer, a batch normalization layer and an activation function layer. In this way, the feature extraction layer formed has good feature extraction capabilities and can extract richer and more effective color features, thereby predicting the color correction coefficients of image training data based on the extracted color features, which can improve the accuracy of prediction of color correction coefficients. sex.

需要说明的是,上述S702中预测子模型的相关内容可参见图4中的S402,不再赘述。It should be noted that the relevant content of the prediction sub-model in S702 above can be found in S402 in Figure 4 and will not be described again.

S703、通过该模型的修正子模型,基于该颜色修正系数对该图像训练数据进行颜色修正,得到该输出图像。S703. Use the correction sub-model of the model to perform color correction on the image training data based on the color correction coefficient to obtain the output image.

在一些实施例中,该颜色修正系数包括该图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数。相应地,上述颜色修正的过程可以包括:基于该图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数,对该图像训练数据中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到该输出图像。In some embodiments, the color correction coefficient includes a first correction coefficient on different color channels of each pixel included in the image training data. Correspondingly, the above-mentioned color correction process may include: based on the first correction coefficient of each pixel point included in the image training data on different color channels, the corresponding color channel of each pixel point included in the image training data is determined. The color values are subjected to the first adjustment process to obtain the output image.

在上述实施例中,提供了一种基于颜色修正系数包括的各像素点在不同颜色通道上的第一修正系数,来进行颜色修正的方式。其中,结合不同颜色通道上的第一修正系数以及对应颜色通道上的颜色值进行第一调节处理,能够从像素点维度出发实现对颜色通道上的颜色值的修正,也就实现了对图像训练数据的颜色修正,从而获得颜色质量更高的输出图像。In the above embodiment, a method of performing color correction based on the first correction coefficient of each pixel on different color channels included in the color correction coefficient is provided. Among them, by combining the first correction coefficients on different color channels and the color values on the corresponding color channels for the first adjustment process, the color values on the color channels can be corrected from the pixel dimension, thus achieving image training. Color correction of data, resulting in output images with higher color quality.

在另一些实施例中,该颜色修正系数包括该图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数和第二修正系数。相应地,上述颜色修正的过程可以包括:基于该图像训练数据中包括的各像素点在不同颜色通道上的第二修正系数,对该图像训练数据中包括的各像素点在对应颜色通道上的颜色值进行第二调节处理,得到第二调节处理后的图像。基于该图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数,对第二调节处理后的图像中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到该输出图像。In other embodiments, the color correction coefficient includes a first correction coefficient and a second correction coefficient on different color channels for each pixel included in the image training data. Correspondingly, the above-mentioned color correction process may include: based on the second correction coefficient of each pixel point included in the image training data on different color channels, adjusting the color correction coefficient of each pixel point included in the image training data on the corresponding color channel. The color value is subjected to a second adjustment process to obtain an image after the second adjustment process. Based on the first correction coefficients of each pixel point included in the image training data on different color channels, perform a first adjustment process on the color value of each pixel point included in the second adjusted image on the corresponding color channel, Get this output image.

在上述实施例中,提供了一种结合颜色修正系数包括的各像素点在不同颜色通道上的第一修正系数以及第二修正系数,来进行颜色修正的方式。其中,先结合不同颜色通道上的第二修正系数以及对应颜色通道上的颜色值进行第二调节处理,能够从像素点维度出发快速且高效的实现对颜色通道上的颜色值的初步修正。进而,再结合不同颜色通道上的第一修正系数以及第二调节处理后的对应颜色通道上的颜色值进行第一调节处理,能够从像素点维度出发进一步实现对颜色通道上的颜色值的二次修正,进而实现对图像训练数据的颜色修正,从而获得颜色质量更高的输出图像。In the above embodiment, a method of performing color correction is provided by combining the first correction coefficient and the second correction coefficient of each pixel on different color channels included in the color correction coefficient. Among them, the second adjustment process is first performed by combining the second correction coefficients on different color channels and the color values on the corresponding color channels, so that the preliminary correction of the color values on the color channels can be quickly and efficiently implemented from the pixel point dimension. Furthermore, by performing the first adjustment process in combination with the first correction coefficients on different color channels and the color values on the corresponding color channels after the second adjustment process, it is possible to further realize the second adjustment of the color values on the color channels from the pixel point dimension. correction, thereby achieving color correction of the image training data, thereby obtaining an output image with higher color quality.

在一些实施例中,在执行上述第二调节处理之前,还对该第二修正系数进行归一化处理。进而基于归一化处理后的该第二修正系数,执行后续调解处理的过程。In some embodiments, before performing the above-mentioned second adjustment process, the second correction coefficient is also normalized. Then, based on the second correction coefficient after normalization, a subsequent mediation process is performed.

需要说明的是,上述S703中颜色修正的相关内容可参见图4中的S403,不再赘述。It should be noted that the relevant content of the color correction in S703 above can be found in S403 in Figure 4 and will not be described again.

S704、电子设备基于该输出图像和该图像训练数据对应的样本图像,调整模型参数。S704. The electronic device adjusts model parameters based on the output image and the sample image corresponding to the image training data.

其中,样本图像为颜色质量达到预设要求的图像。应理解地,样本图像用于指代与图像训练数据相对应的颜色质量较高的图像。例如,样本图像可以是采用高精度摄像头所采集的颜色质量较高的图像。Among them, the sample image is an image whose color quality meets the preset requirements. It should be understood that sample images are used to refer to images with higher color quality corresponding to image training data. For example, the sample image may be an image with high color quality collected by a high-precision camera.

在一种可能的实现方式中,上述调整模型参数的过程可以是:基于该输出图像和该图像训练数据的样本图像,确定本次迭代训练的模型损失值。进而,根据该模型损失值,调整该模型参数。In a possible implementation, the above-mentioned process of adjusting model parameters may be: based on the output image and the sample image of the image training data, determine the model loss value of this iterative training. Furthermore, the model parameters are adjusted according to the model loss value.

其中,模型损失值用于表示模型的输出图像和图像训练数据的样本图像之间的差异。Among them, the model loss value is used to represent the difference between the output image of the model and the sample image of the image training data.

在一种可能的实现方式中,该模型损失值为交叉熵损失值(cross entropyloss),相应地,电子设备根据该输出图像和该图像训练数据的样本图像,确定该输出图像和该图像训练数据的样本图像之间的交叉熵损失值,以获得本次迭代训练过程的模型损失值,进而根据该模型损失值,执行上述调整模型参数的过程。In a possible implementation, the model loss value is a cross entropy loss value (cross entropyloss). Correspondingly, the electronic device determines the output image and the image training data based on the output image and the sample image of the image training data. The cross entropy loss value between the sample images is used to obtain the model loss value of this iterative training process, and then based on the model loss value, the above process of adjusting the model parameters is performed.

在另一种可能的实现方式中,该模型损失值为均方误差损失值(mean squareerror,MSE),相应地,电子设备根据该输出图像和该图像训练数据的样本图像,确定该输出图像和该图像训练数据的样本图像之间的均方误差损失值,以获得本次迭代训练过程的模型损失值,进而根据该模型损失值,执行上述调整模型参数的过程。In another possible implementation, the model loss value is a mean square error loss value (MSE). Correspondingly, the electronic device determines the output image and the sample image of the image training data based on the output image and the sample image of the image training data. The mean square error loss value between the sample images of the image training data is used to obtain the model loss value of this iterative training process, and then based on the model loss value, the above process of adjusting the model parameters is performed.

在上述实施例中,通过确定模型损失值,由于该模型损失值用于表示模型的输出图像和该图像训练数据的样本图像之间的差异,因此根据该模型损失值来进行模型参数的调整,能够提升模型的学习能力,从而训练得到学习能力更好的模型。当然,在另一种可能的实现方式中,电子设备还能够获取其他类型的模型损失值,以根据该模型损失值,执行上述调整模型参数的过程。本申请实施例对此不作限定。In the above embodiment, by determining the model loss value, since the model loss value is used to represent the difference between the output image of the model and the sample image of the image training data, the model parameters are adjusted according to the model loss value, It can improve the learning ability of the model, thereby training a model with better learning ability. Of course, in another possible implementation, the electronic device can also obtain other types of model loss values to perform the above process of adjusting model parameters based on the model loss values. The embodiments of the present application do not limit this.

在调整模型参数之后,电子设备还判断模型训练是否满足目标条件,进而在模型训练不满足目标条件的情况下,执行S705。在模型训练满足目标条件的情况下,将本次迭代过程训练得到的模型获取为第一颜色修正模型。After adjusting the model parameters, the electronic device also determines whether the model training meets the target conditions, and then executes S705 if the model training does not meet the target conditions. When the model training meets the target conditions, the model trained in this iterative process is obtained as the first color correction model.

S705、电子设备在调整模型参数后的模型不满足目标条件的情况下,基于调整模型参数后的模型,执行下一次迭代训练,直至模型满足目标条件。S705. When the model after adjusting the model parameters does not meet the target conditions, the electronic device performs the next iterative training based on the model after adjusting the model parameters until the model meets the target conditions.

在一些实施例中,目标条件满足下述条件中的至少一项:模型训练的迭代次数达到目标次数;或者,模型损失值小于或等于目标阈值。其中,目标次数为预先设定的训练迭代次数,如迭代次数达到100。本申请实施例对目标次数的设置不作限定。目标阈值为预先设定的固定阈值,如模型损失值小于0.0001。本申请实施例对目标阈值的设置不作限定。In some embodiments, the target condition satisfies at least one of the following conditions: the number of iterations of model training reaches the target number; or the model loss value is less than or equal to the target threshold. Among them, the target number is the preset number of training iterations, for example, the number of iterations reaches 100. The embodiment of the present application does not limit the setting of the target number of times. The target threshold is a preset fixed threshold, such as the model loss value is less than 0.0001. The embodiment of the present application does not limit the setting of the target threshold.

在图7所示实施例中,通过在模型中设置预测子模型和修正子模型,使得在任一次迭代训练的过程中,利用预测子模型预测图像训练数据的颜色修正系数,利用修正子模型对图像训练数据进行颜色修正,得到输出图像。进而,基于该输出图像和该样本图像,调整模型参数,以便实现对模型的训练优化,从而训练得到具备颜色修正功能的模型。In the embodiment shown in Figure 7, by setting the prediction sub-model and the correction sub-model in the model, in any iterative training process, the prediction sub-model is used to predict the color correction coefficient of the image training data, and the correction sub-model is used to predict the image The training data is color corrected to obtain the output image. Furthermore, based on the output image and the sample image, the model parameters are adjusted to achieve training optimization of the model, thereby training a model with a color correction function.

针对图5所示的第二颜色修正模型,图8为本申请实施例提供的一种第二颜色修正模型的训练方法的流程示意图。参见图8,以模型训练中的任一次迭代训练的过程为例,该方法包括以下S801-S806:Regarding the second color correction model shown in Figure 5, Figure 8 is a schematic flowchart of a training method for the second color correction model provided by an embodiment of the present application. Referring to Figure 8, taking any iterative training process in model training as an example, the method includes the following S801-S806:

S801、电子设备在任一次迭代训练的过程中,将图像训练数据输入上一次迭代训练后得到的模型中。S801. During any iterative training process, the electronic device inputs the image training data into the model obtained after the previous iterative training.

需要说明的是,本申请实施例可以是在原有的图像处理模型(如Unet网络模型)的基础上,新增一个颜色系数预测模块,进行模型训练,从而训练得到兼具颜色修正系数的预测功能以及图像处理功能的模型。因而,在一些实施例中,图像训练数据可以采用原有处理模型的训练数据。当然,在另一些实施例中,图像训练数据也可以重新获取得到。It should be noted that the embodiment of the present application can add a color coefficient prediction module based on the original image processing model (such as the Unet network model) to perform model training, so as to obtain the prediction function of both color correction coefficients through training. and models of image processing functions. Therefore, in some embodiments, the image training data may adopt the training data of the original processing model. Of course, in other embodiments, the image training data can also be reacquired.

S802、通过该模型的处理子模型对该图像训练数据进行图像处理,得到图像处理后的图像。S802: Perform image processing on the image training data through the processing sub-model of the model to obtain a processed image.

其中,图像处理可以为图像增强处理、图像超分处理、图像恢复处理、图像修复处理、图像去模糊处理、图像去噪处理、图像去雨处理、图像去雾处理、质量提升处理或高动态范围处理中的至少一项。Among them, the image processing can be image enhancement processing, image super-resolution processing, image restoration processing, image repair processing, image deblurring processing, image denoising processing, image rain removal processing, image dehazing processing, quality improvement processing or high dynamic range. Process at least one item.

在上述实施例中,示出了多种类型的图像处理功能。如此,可以结合图像增强、图像超分、图像恢复、图像修复、图像去模糊、图像去噪、图像去雨、图像去雾、质量提升或高动态范围中至少一项功能,训练得到具备其中至少一项图像处理功能的模型。In the above-described embodiments, various types of image processing functions are shown. In this way, at least one of the functions of image enhancement, image super-resolution, image restoration, image repair, image deblurring, image denoising, image rain removal, image dehazing, quality improvement or high dynamic range can be combined to train to obtain at least one of them. A model of image processing functions.

需要说明的是,上述S802中处理子模型的相关内容可参见图5中的S501,不再赘述。It should be noted that the relevant content of the processing sub-model in S802 above can be found in S501 in Figure 5 and will not be described again.

S803、通过该模型的预测子模型,预测该图像训练数据的颜色修正系数。S803. Predict the color correction coefficient of the image training data through the prediction sub-model of the model.

在一些实施例中,通过该预测子模型的特征提取层,对该图像训练数据进行特征提取,得到该图像训练数据在不同颜色通道上的颜色特征。进而,通过该预测子模型的卷积层,对该图像训练数据在不同颜色通道上的颜色特征进行卷积处理,得到该图像训练数据在不同颜色通道上的颜色修正系数。In some embodiments, feature extraction is performed on the image training data through the feature extraction layer of the prediction sub-model to obtain color features of the image training data on different color channels. Furthermore, through the convolution layer of the prediction sub-model, the color features of the image training data on different color channels are convolved to obtain the color correction coefficients of the image training data on different color channels.

需要说明的是,上述S803的相关内容可参见图5中的S502,不再赘述。It should be noted that the relevant content of the above S803 can be found in S502 in Figure 5 and will not be described again.

S804、通过该模型的修正子模型,基于该颜色修正系数对该图像处理后的图像进行颜色修正,得到该输出图像。S804: Perform color correction on the processed image based on the color correction coefficient through the correction sub-model of the model to obtain the output image.

需要说明的是,上述S804的相关内容可参见图5中的S503,不再赘述。It should be noted that the relevant content of the above S804 can be found in S503 in Figure 5 and will not be described again.

S805、电子设备基于该输出图像和该图像训练数据对应的样本图像,调整模型参数。S805: The electronic device adjusts model parameters based on the output image and the sample image corresponding to the image training data.

在一些实施例中,样本图像可以是原有处理模型的训练数据中的颜色质量较高的图像。或者,在另一些实施例中,样本图像可以是采用高精度摄像头所采集的颜色质量较高的图像。In some embodiments, the sample image may be an image with higher color quality in the training data of the original processing model. Or, in other embodiments, the sample image may be an image with higher color quality collected using a high-precision camera.

需要说明的是,上述S805中调整模型参数的相关内容可参见图7中的S704,不再赘述。It should be noted that the relevant content of adjusting the model parameters in S805 above can be found in S704 in Figure 7 and will not be described again.

在调整模型参数之后,电子设备还判断模型训练是否满足目标条件,进而在模型训练不满足目标条件的情况下,执行S806。在模型训练满足目标条件的情况下,将本次迭代过程训练得到的模型获取为第二颜色修正模型。After adjusting the model parameters, the electronic device also determines whether the model training meets the target conditions, and then executes S806 if the model training does not meet the target conditions. When the model training meets the target conditions, the model trained in this iterative process is obtained as the second color correction model.

S806、电子设备在调整模型参数后的模型不满足目标条件的情况下,基于调整模型参数后的模型,执行下一次迭代训练,直至模型满足目标条件。S806. When the model after adjusting the model parameters does not meet the target conditions, the electronic device performs the next iterative training based on the model after adjusting the model parameters until the model meets the target conditions.

在图8所示实施例中,通过在模型中设置处理子模型、预测子模型和修正子模型,使得在任一次迭代训练的过程中,利用处理子模型对图像训练数据进行图像处理,利用预测子模型预测图像训练数据的颜色修正系数,利用修正子模型对图像训练数据进行颜色修正,得到输出图像。进而,基于该输出图像和该样本图像,调整模型参数,以便实现对模型的训练优化,从而训练得到兼具颜色修正功能和图像处理功能的模型。In the embodiment shown in Figure 8, by setting the processing sub-model, the prediction sub-model and the correction sub-model in the model, in any iterative training process, the processing sub-model is used to perform image processing on the image training data, and the prediction sub-model is used to perform image processing. The model predicts the color correction coefficient of the image training data, uses the correction sub-model to perform color correction on the image training data, and obtains the output image. Furthermore, based on the output image and the sample image, the model parameters are adjusted to achieve training optimization of the model, thereby training a model that has both color correction function and image processing function.

需要说明的是,上述图7、图8中用于执行模型训练过程的电子设备,可以与上述图4、图5中用于执行模型应用过程的电子设备相同,也可以与上述图4、图5中用于执行模型应用过程的电子设备不相同。例如,在一些实施例中,上述图4、图5中用于执行模型应用过程的电子设备可以是终端,而上述图7、图8中用于执行模型训练过程的电子设备可以是服务器。It should be noted that the electronic device used to perform the model training process in the above-mentioned Figures 7 and 8 can be the same as the electronic device used to perform the model application process in the above-mentioned Figures 4 and 5, or can be the same as the above-mentioned Figure 4 and Figure 5. The electronic equipment used to perform the model application process is different in 5. For example, in some embodiments, the electronic device used to execute the model application process in FIGS. 4 and 5 may be a terminal, and the electronic device used to execute the model training process in FIGS. 7 and 8 may be a server.

可以理解的是,本申请实施例中的电子设备(如终端)为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请实施例的范围。It can be understood that, in order to implement the above functions, the electronic device (such as a terminal) in the embodiment of the present application includes a corresponding hardware structure and/or software module to perform each function. Persons skilled in the art should easily realize that, in conjunction with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving the hardware depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the embodiments of the present application.

图9为本申请实施例提供的一种颜色修正模型的训练装置的框架示意图。参见图9,该颜色修正模型的训练装置包括图像获取模块901、系数获取模块902与显示模块903。其中,FIG. 9 is a schematic diagram of the framework of a color correction model training device provided by an embodiment of the present application. Referring to FIG. 9 , the training device of the color correction model includes an image acquisition module 901 , a coefficient acquisition module 902 and a display module 903 . in,

图像获取模块901,用于获取待处理图像;Image acquisition module 901, used to acquire images to be processed;

系数获取模块902,用于获取该待处理图像的颜色修正系数,该颜色修正系数用于对该待处理图像中包括的各像素点在不同颜色通道上的颜色进行修正;The coefficient acquisition module 902 is used to obtain the color correction coefficient of the image to be processed, and the color correction coefficient is used to correct the color of each pixel point included in the image to be processed on different color channels;

显示模块903,用于基于该颜色修正系数,在该电子设备的显示屏上显示第一图像,该第一图像是基于该颜色修正系数对该待处理图像进行颜色修正后得到的图像。The display module 903 is configured to display a first image on the display screen of the electronic device based on the color correction coefficient. The first image is an image obtained by performing color correction on the image to be processed based on the color correction coefficient.

本申请实施例提供的技术方案,通过获取该待处理图像的颜色修正系数,能够从像素点维度出发实现对不同颜色通道上颜色的修正,从而实现针对图像的颜色修正,以提升图像处理的效果。进而,通过在该电子设备的显示屏上显示颜色修正后得到的图像,能够为用户显示出颜色质量更高、更加贴近真实颜色效果的图像,提高了图像的显示效果。The technical solution provided by the embodiment of the present application can correct the color on different color channels from the pixel dimension by obtaining the color correction coefficient of the image to be processed, thereby achieving color correction for the image to improve the effect of image processing. . Furthermore, by displaying the color-corrected image on the display screen of the electronic device, an image with higher color quality and closer to the real color effect can be displayed to the user, thereby improving the display effect of the image.

在一些实施例中,该待处理图像为第二图像;或者,该待处理图像为对该第二图像进行图像处理后得到的图像;In some embodiments, the image to be processed is a second image; or, the image to be processed is an image obtained by image processing the second image;

其中,该第二图像为第一应用的待在该显示屏上显示的图像。Wherein, the second image is an image of the first application to be displayed on the display screen.

在一些实施例中,在该待处理图像为对该第二图像进行图像处理后得到的图像的情况下,该图像获取模块901,具体用于:In some embodiments, when the image to be processed is an image obtained by performing image processing on the second image, the image acquisition module 901 is specifically used to:

接收用户触发该第一应用显示图像的操作;Receive an operation from the user to trigger the first application to display an image;

响应于该触发该第一应用显示图像的操作,获取待显示的该第二图像;In response to the operation of triggering the first application to display an image, obtain the second image to be displayed;

对该第二图像进行图像处理,以获得该待处理图像;Perform image processing on the second image to obtain the image to be processed;

该显示模块903,具体用于:The display module 903 is specifically used for:

在该第一应用的界面中显示该第一图像。The first image is displayed in the interface of the first application.

在一些实施例中,该系数获取模块902,具体用于:In some embodiments, the coefficient acquisition module 902 is specifically used for:

将该待处理图像输入第一颜色修正模型,通过该第一颜色修正模型的预测子模型,预测该待处理图像的颜色修正系数;Input the image to be processed into the first color correction model, and predict the color correction coefficient of the image to be processed through the prediction sub-model of the first color correction model;

该显示模块903,具体用于:The display module 903 is specifically used for:

通过该第一颜色修正模型的修正子模型,基于该颜色修正系数对该待处理图像进行颜色修正,得到该第一图像;Through the correction sub-model of the first color correction model, perform color correction on the image to be processed based on the color correction coefficient to obtain the first image;

在该电子设备的显示屏上显示该第一图像。The first image is displayed on the display screen of the electronic device.

在一些实施例中,该系数获取模块902,具体用于:In some embodiments, the coefficient acquisition module 902 is specifically used for:

通过该预测子模型的特征提取层,对该待处理图像进行特征提取,得到该待处理图像在不同颜色通道上的颜色特征;Through the feature extraction layer of the prediction sub-model, feature extraction is performed on the image to be processed to obtain the color features of the image to be processed on different color channels;

通过该预测子模型的卷积层,对该待处理图像在不同颜色通道上的颜色特征进行卷积处理,得到该待处理图像在不同颜色通道上的颜色修正系数。Through the convolution layer of the prediction sub-model, the color features of the image to be processed on different color channels are convolved to obtain the color correction coefficients of the image to be processed on different color channels.

在一些实施例中,在该待处理图像为对该第二图像进行图像处理后得到的图像的情况下,该图像获取模块901,具体用于:In some embodiments, when the image to be processed is an image obtained by performing image processing on the second image, the image acquisition module 901 is specifically used to:

将该第二图像输入第二颜色修正模型,通过该第二颜色修正模型的处理子模型对该第二图像进行图像处理,得到该待处理图像;Input the second image into the second color correction model, perform image processing on the second image through the processing sub-model of the second color correction model, and obtain the image to be processed;

该系数获取模块902,具体用于:The coefficient acquisition module 902 is specifically used for:

通过该第二颜色修正模型的预测子模型,预测该第二图像的颜色修正系数,作为该待处理图像的颜色修正系数;Predict the color correction coefficient of the second image through the prediction sub-model of the second color correction model as the color correction coefficient of the image to be processed;

该显示模块903,具体用于:The display module 903 is specifically used for:

通过该第二颜色修正模型的修正子模型,基于该颜色修正系数对该待处理图像进行颜色修正,得到该第一图像;Through the correction sub-model of the second color correction model, perform color correction on the image to be processed based on the color correction coefficient to obtain the first image;

在该电子设备的显示屏上显示该第一图像。The first image is displayed on the display screen of the electronic device.

在一些实施例中,该系数获取模块902,具体用于:In some embodiments, the coefficient acquisition module 902 is specifically used for:

通过该预测子模型的特征提取层,对该第二图像进行特征提取,得到该第二图像在不同颜色通道上的颜色特征;Through the feature extraction layer of the prediction sub-model, perform feature extraction on the second image to obtain the color features of the second image on different color channels;

通过该预测子模型的卷积层,对该第二图像在不同颜色通道上的颜色特征进行卷积处理,得到该第二图像在不同颜色通道上的颜色修正系数。Through the convolution layer of the prediction sub-model, the color features of the second image on different color channels are convolved to obtain the color correction coefficients of the second image on different color channels.

在一些实施例中,该特征提取层包括至少两层目标模型结构,该目标模型结构包括卷积层、批标准化层及激活函数层。In some embodiments, the feature extraction layer includes at least two layers of target model structure, and the target model structure includes a convolution layer, a batch normalization layer and an activation function layer.

在一些实施例中,该颜色修正系数包括该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数;In some embodiments, the color correction coefficient includes a first correction coefficient on different color channels for each pixel included in the image to be processed;

该显示模块903包括修正模块,用于:The display module 903 includes a correction module for:

基于该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数,对该待处理图像中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到该第一图像。Based on the first correction coefficients of each pixel point included in the image to be processed on different color channels, a first adjustment process is performed on the color value of each pixel point included in the image to be processed on the corresponding color channel to obtain the first correction coefficient. an image.

在一些实施例中,该颜色修正系数包括该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数和第二修正系数;In some embodiments, the color correction coefficient includes a first correction coefficient and a second correction coefficient on different color channels for each pixel included in the image to be processed;

该显示模块903包括修正模块,用于:The display module 903 includes a correction module for:

基于该待处理图像中包括的各像素点在不同颜色通道上的第二修正系数,对该待处理图像中包括的各像素点在对应颜色通道上的颜色值进行第二调节处理,得到第二调节处理后的图像;Based on the second correction coefficients of each pixel point included in the image to be processed on different color channels, a second adjustment process is performed on the color value of each pixel point included in the image to be processed on the corresponding color channel to obtain a second Adjust the processed image;

基于该待处理图像中包括的各像素点在不同颜色通道上的第一修正系数,对第二调节处理后的图像中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到该第一图像。Based on the first correction coefficients of each pixel point included in the image to be processed on different color channels, perform a first adjustment process on the color value of each pixel point included in the image after the second adjustment process on the corresponding color channel, Get the first image.

在一些实施例中,该装置还包括处理模块,用于:In some embodiments, the device further includes a processing module for:

对该第二修正系数进行归一化处理。The second correction coefficient is normalized.

在一些实施例中,该装置还包括处理模块,用于:In some embodiments, the device further includes a processing module for:

对该第一图像进行图像处理,得到图像处理后的第一图像;Perform image processing on the first image to obtain a processed first image;

该显示模块903,用于:The display module 903 is used for:

在该电子设备的显示屏上显示该图像处理后的第一图像。The image-processed first image is displayed on the display screen of the electronic device.

在一些实施例中,该图像处理为图像增强处理、图像超分处理、图像恢复处理、图像修复处理、图像去模糊处理、图像去噪处理、图像去雨处理、图像去雾处理、质量提升处理或高动态范围处理中的至少一项。In some embodiments, the image processing is image enhancement processing, image super-resolution processing, image restoration processing, image repair processing, image deblurring processing, image denoising processing, image rain removal processing, image dehazing processing, and quality improvement processing. or at least one of high dynamic range processing.

图10为本申请实施例提供的一种颜色修正模型的训练装置的框架示意图。参见图10,该颜色修正模型的训练装置包括训练模块1001。Figure 10 is a schematic framework diagram of a color correction model training device provided by an embodiment of the present application. Referring to Figure 10, the training device of the color correction model includes a training module 1001.

训练模块1001,用于基于图像训练数据对初始模型进行迭代训练,以获得该颜色修正模型;The training module 1001 is used to iteratively train the initial model based on image training data to obtain the color correction model;

其中,在任一次迭代训练的过程中,将该图像训练数据输入上一次迭代训练后得到的模型中,通过该模型获取该图像训练数据的颜色修正系数,基于该颜色修正系数对该图像训练数据进行颜色修正,得到颜色修正后的输出图像,该颜色修正系数用于对该图像训练数据中包括的各像素点在不同颜色通道上的颜色进行修正;基于该输出图像和该图像训练数据对应的样本图像,调整模型参数,该样本图像为颜色质量达到预设要求的图像。Among them, during any iterative training process, the image training data is input into the model obtained after the previous iterative training, the color correction coefficient of the image training data is obtained through the model, and the image training data is processed based on the color correction coefficient. Color correction is used to obtain a color-corrected output image. The color correction coefficient is used to correct the color of each pixel included in the image training data on different color channels; based on the samples corresponding to the output image and the image training data Image, adjust the model parameters. The sample image is an image whose color quality meets the preset requirements.

本申请实施例提供的技术方案,提供了一种颜色修正模型的训练方法,利用图像训练数据对初始模型进行迭代训练。在模型训练的过程中,基于模型的输出图像和该图像训练数据的样本图像,调整模型参数,以便实现对模型的训练优化,能够训练得到颜色修正能力较优的模型。The technical solution provided by the embodiment of the present application provides a training method for a color correction model, which uses image training data to iteratively train the initial model. During the model training process, based on the model's output image and the sample image of the image training data, the model parameters are adjusted in order to optimize the training of the model and train a model with better color correction capabilities.

在一些实施例中,该训练模块1001,具体用于:In some embodiments, the training module 1001 is specifically used to:

通过该模型的预测子模型,预测该图像训练数据的颜色修正系数;Predict the color correction coefficient of the image training data through the prediction sub-model of the model;

通过该模型的修正子模型,基于该颜色修正系数对该图像训练数据进行颜色修正,得到该输出图像。Through the correction sub-model of the model, the image training data is color corrected based on the color correction coefficient to obtain the output image.

在一些实施例中,该训练模块1001,具体用于:In some embodiments, the training module 1001 is specifically used to:

通过该模型的处理子模型对该图像训练数据进行图像处理,得到图像处理后的图像;Perform image processing on the image training data through the processing sub-model of the model to obtain the image after image processing;

通过该模型的预测子模型,预测该图像训练数据的颜色修正系数;Predict the color correction coefficient of the image training data through the prediction sub-model of the model;

通过该模型的修正子模型,基于该颜色修正系数对该图像处理后的图像进行颜色修正,得到该输出图像。Through the correction sub-model of the model, the color correction is performed on the processed image based on the color correction coefficient to obtain the output image.

在一些实施例中,该图像处理为图像增强处理、图像超分处理、图像恢复处理、图像修复处理、图像去模糊处理、图像去噪处理、图像去雨处理、图像去雾处理、质量提升处理或高动态范围处理中的至少一项。In some embodiments, the image processing is image enhancement processing, image super-resolution processing, image restoration processing, image repair processing, image deblurring processing, image denoising processing, image rain removal processing, image dehazing processing, and quality improvement processing. or at least one of high dynamic range processing.

在一些实施例中,该训练模块1001,具体用于:In some embodiments, the training module 1001 is specifically used to:

通过该预测子模型的特征提取层,对该图像训练数据进行特征提取,得到该图像训练数据在不同颜色通道上的颜色特征;Through the feature extraction layer of the prediction sub-model, feature extraction is performed on the image training data to obtain the color features of the image training data on different color channels;

通过该预测子模型的卷积层,对该图像训练数据在不同颜色通道上的颜色特征进行卷积处理,得到该图像训练数据在不同颜色通道上的颜色修正系数。Through the convolution layer of the prediction sub-model, the color features of the image training data on different color channels are convolved to obtain the color correction coefficients of the image training data on different color channels.

在一些实施例中,该特征提取层包括至少两层目标模型结构,该目标模型结构包括卷积层、批标准化层及激活函数层。In some embodiments, the feature extraction layer includes at least two layers of target model structure, and the target model structure includes a convolution layer, a batch normalization layer and an activation function layer.

在一些实施例中,该颜色修正系数包括该图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数;In some embodiments, the color correction coefficient includes a first correction coefficient on different color channels for each pixel included in the image training data;

该训练模块1001,具体用于:This training module 1001 is specifically used for:

基于该图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数,对该图像训练数据中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到该输出图像。Based on the first correction coefficient of each pixel point included in the image training data on different color channels, perform a first adjustment process on the color value of each pixel point included in the image training data on the corresponding color channel to obtain the output image.

在一些实施例中,该颜色修正系数包括该图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数和第二修正系数;In some embodiments, the color correction coefficient includes a first correction coefficient and a second correction coefficient on different color channels for each pixel included in the image training data;

该训练模块1001,具体用于:This training module 1001 is specifically used for:

基于该图像训练数据中包括的各像素点在不同颜色通道上的第二修正系数,对该图像训练数据中包括的各像素点在对应颜色通道上的颜色值进行第二调节处理,得到第二调节处理后的图像;Based on the second correction coefficients of each pixel point included in the image training data on different color channels, a second adjustment process is performed on the color value of each pixel point included in the image training data on the corresponding color channel to obtain a second Adjust the processed image;

基于该图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数,对第二调节处理后的图像中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到该输出图像。Based on the first correction coefficients of each pixel point included in the image training data on different color channels, perform a first adjustment process on the color value of each pixel point included in the second adjusted image on the corresponding color channel, Get this output image.

在一些实施例中,该装置还包括处理模块,用于:In some embodiments, the device further includes a processing module for:

对该第二修正系数进行归一化处理。The second correction coefficient is normalized.

本申请实施例还提供了一种电子设备,包括:显示屏、处理器和存储器。显示屏提供有显示功能。处理器与存储器连接,存储器用于存储程序代码,处理器执行存储器存储的程序代码,从而实现本申请实施例提供的颜色修正方法。An embodiment of the present application also provides an electronic device, including: a display screen, a processor, and a memory. The display screen provides a display function. The processor is connected to the memory, the memory is used to store program codes, and the processor executes the program codes stored in the memory, thereby realizing the color correction method provided by the embodiment of the present application.

本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有程序代码,当该程序代码在电子设备上运行时,使得该电子设备执行上述方法实施例中电子设备执行的各个功能或者步骤。Embodiments of the present application also provide a computer-readable storage medium. Program code is stored on the computer-readable storage medium. When the program code is run on an electronic device, it causes the electronic device to execute the electronic device in the above method embodiment. Each function or step performed.

本申请实施例还提供了一种计算机程序产品,包括程序代码,当该程序代码在电子设备上运行时,使得电子设备执行上述方法实施例中电子设备执行的各个功能或者步骤。Embodiments of the present application also provide a computer program product, including program code. When the program code is run on an electronic device, the electronic device causes the electronic device to perform various functions or steps performed by the electronic device in the above method embodiments.

其中,本申请实施例提供的电子设备、计算机可读存储介质或者计算机程序产品均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Among them, the electronic devices, computer-readable storage media or computer program products provided by the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the corresponding methods provided above. The beneficial effects of this method will not be repeated here.

通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置(如电子设备)的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置(如电子设备)和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the above description of the embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be allocated as needed. It is completed by different functional modules, that is, the internal structure of the device (such as electronic equipment) is divided into different functional modules to complete all or part of the functions described above. For the specific working processes of the systems, devices (such as electronic equipment) and units described above, reference can be made to the corresponding processes in the foregoing method embodiments, which will not be described again here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置(如电子设备)和方法,可以通过其它的方式实现。例如,以上所描述的装置(如电子设备)实施例仅仅是示意性的,例如,该模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices (such as electronic devices) and methods can be implemented in other ways. For example, the above-described embodiments of devices (such as electronic equipment) are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple divisions. Units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例该方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method in various embodiments of the present application. The aforementioned storage media include: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以该权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application. should be covered by the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims (21)

1.一种颜色修正方法,其特征在于,应用于电子设备,所述方法包括:1. A color correction method, characterized in that it is applied to electronic equipment, and the method includes: 获取待处理图像;Get the image to be processed; 获取所述待处理图像的颜色修正系数,所述颜色修正系数用于对所述待处理图像中包括的各像素点在不同颜色通道上的颜色进行修正;Obtain the color correction coefficient of the image to be processed, the color correction coefficient is used to correct the color of each pixel point included in the image to be processed on different color channels; 基于所述颜色修正系数,在所述电子设备的显示屏上显示第一图像,所述第一图像是基于所述颜色修正系数对所述待处理图像进行颜色修正后得到的图像。Based on the color correction coefficient, a first image is displayed on the display screen of the electronic device, where the first image is an image obtained by performing color correction on the image to be processed based on the color correction coefficient. 2.根据权利要求1所述的方法,其特征在于,所述待处理图像为第二图像;或者,所述待处理图像为对所述第二图像进行图像处理后得到的图像;2. The method according to claim 1, wherein the image to be processed is a second image; or, the image to be processed is an image obtained by image processing the second image; 其中,所述第二图像为第一应用的待在所述显示屏上显示的图像。Wherein, the second image is an image of the first application to be displayed on the display screen. 3.根据权利要求2所述的方法,其特征在于,在所述待处理图像为对所述第二图像进行图像处理后得到的图像的情况下,所述获取待处理图像,包括:3. The method according to claim 2, characterized in that, when the image to be processed is an image obtained by image processing the second image, the obtaining the image to be processed includes: 接收用户触发所述第一应用显示图像的操作;Receive an operation from the user to trigger the first application to display an image; 响应于所述触发所述第一应用显示图像的操作,获取待显示的所述第二图像;In response to the operation of triggering the first application to display an image, obtaining the second image to be displayed; 对所述第二图像进行图像处理,以获得所述待处理图像;Perform image processing on the second image to obtain the image to be processed; 所述在所述电子设备的显示屏上显示第一图像,包括:Displaying the first image on the display screen of the electronic device includes: 在所述第一应用的界面中显示所述第一图像。The first image is displayed in the interface of the first application. 4.根据权利要求2所述的方法,其特征在于,所述获取所述待处理图像的颜色修正系数,包括:4. The method according to claim 2, characterized in that said obtaining the color correction coefficient of the image to be processed includes: 将所述待处理图像输入第一颜色修正模型,通过所述第一颜色修正模型的预测子模型,预测所述待处理图像的颜色修正系数;Input the image to be processed into a first color correction model, and predict the color correction coefficient of the image to be processed through the prediction sub-model of the first color correction model; 所述基于所述颜色修正系数,在所述电子设备的显示屏上显示第一图像,包括:Displaying the first image on the display screen of the electronic device based on the color correction coefficient includes: 通过所述第一颜色修正模型的修正子模型,基于所述颜色修正系数对所述待处理图像进行颜色修正,得到所述第一图像;Through the correction sub-model of the first color correction model, perform color correction on the image to be processed based on the color correction coefficient to obtain the first image; 在所述电子设备的显示屏上显示所述第一图像。The first image is displayed on the display screen of the electronic device. 5.根据权利要求4所述的方法,其特征在于,所述通过所述第一颜色修正模型的预测子模型,预测所述待处理图像的颜色修正系数,包括:5. The method of claim 4, wherein predicting the color correction coefficient of the image to be processed through the prediction sub-model of the first color correction model includes: 通过所述预测子模型的特征提取层,对所述待处理图像进行特征提取,得到所述待处理图像在不同颜色通道上的颜色特征;Through the feature extraction layer of the prediction sub-model, perform feature extraction on the image to be processed to obtain the color features of the image to be processed on different color channels; 通过所述预测子模型的卷积层,对所述待处理图像在不同颜色通道上的颜色特征进行卷积处理,得到所述待处理图像在不同颜色通道上的颜色修正系数。Through the convolution layer of the prediction sub-model, the color features of the image to be processed on different color channels are convolved to obtain the color correction coefficients of the image to be processed on different color channels. 6.根据权利要求2所述的方法,其特征在于,在所述待处理图像为对所述第二图像进行图像处理后得到的图像的情况下,所述获取待处理图像,包括:6. The method according to claim 2, characterized in that, when the image to be processed is an image obtained by image processing the second image, the obtaining the image to be processed includes: 将所述第二图像输入第二颜色修正模型,通过所述第二颜色修正模型的处理子模型对所述第二图像进行图像处理,得到所述待处理图像;Input the second image into a second color correction model, perform image processing on the second image through the processing sub-model of the second color correction model, and obtain the image to be processed; 所述获取所述待处理图像的颜色修正系数,包括:The obtaining the color correction coefficient of the image to be processed includes: 通过所述第二颜色修正模型的预测子模型,预测所述第二图像的颜色修正系数,作为所述待处理图像的颜色修正系数;Predict the color correction coefficient of the second image through the prediction sub-model of the second color correction model as the color correction coefficient of the image to be processed; 所述基于所述颜色修正系数,在所述电子设备的显示屏上显示第一图像,包括:Displaying the first image on the display screen of the electronic device based on the color correction coefficient includes: 通过所述第二颜色修正模型的修正子模型,基于所述颜色修正系数对所述待处理图像进行颜色修正,得到所述第一图像;Through the correction sub-model of the second color correction model, perform color correction on the image to be processed based on the color correction coefficient to obtain the first image; 在所述电子设备的显示屏上显示所述第一图像。The first image is displayed on the display screen of the electronic device. 7.根据权利要求6所述的方法,其特征在于,所述通过所述第二颜色修正模型的预测子模型,预测所述第二图像的颜色修正系数,包括:7. The method of claim 6, wherein predicting the color correction coefficient of the second image through the prediction sub-model of the second color correction model includes: 通过所述预测子模型的特征提取层,对所述第二图像进行特征提取,得到所述第二图像在不同颜色通道上的颜色特征;Through the feature extraction layer of the prediction sub-model, perform feature extraction on the second image to obtain the color features of the second image on different color channels; 通过所述预测子模型的卷积层,对所述第二图像在不同颜色通道上的颜色特征进行卷积处理,得到所述第二图像在不同颜色通道上的颜色修正系数。Through the convolution layer of the prediction sub-model, the color features of the second image on different color channels are convolved to obtain the color correction coefficients of the second image on different color channels. 8.根据权利要求5或7所述的方法,其特征在于,所述特征提取层包括至少两层目标模型结构,所述目标模型结构包括卷积层、批标准化层及激活函数层。8. The method according to claim 5 or 7, characterized in that the feature extraction layer includes at least two layers of target model structure, and the target model structure includes a convolution layer, a batch normalization layer and an activation function layer. 9.根据权利要求4或6所述的方法,其特征在于,所述颜色修正系数包括所述待处理图像中包括的各像素点在不同颜色通道上的第一修正系数;9. The method according to claim 4 or 6, characterized in that the color correction coefficient includes the first correction coefficient on different color channels of each pixel included in the image to be processed; 所述基于所述颜色修正系数对所述待处理图像进行颜色修正,得到所述第一图像,包括:Performing color correction on the image to be processed based on the color correction coefficient to obtain the first image includes: 基于所述待处理图像中包括的各像素点在不同颜色通道上的第一修正系数,对所述待处理图像中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到所述第一图像。Based on the first correction coefficient of each pixel point included in the image to be processed on different color channels, a first adjustment process is performed on the color value of each pixel point included in the image to be processed on the corresponding color channel, to obtain the first image. 10.根据权利要求4或6所述的方法,其特征在于,所述颜色修正系数包括所述待处理图像中包括的各像素点在不同颜色通道上的第一修正系数和第二修正系数;10. The method according to claim 4 or 6, characterized in that the color correction coefficient includes a first correction coefficient and a second correction coefficient on different color channels for each pixel included in the image to be processed; 所述基于所述颜色修正系数对所述待处理图像进行颜色修正,得到所述第一图像,包括:Performing color correction on the image to be processed based on the color correction coefficient to obtain the first image includes: 基于所述待处理图像中包括的各像素点在不同颜色通道上的第二修正系数,对所述待处理图像中包括的各像素点在对应颜色通道上的颜色值进行第二调节处理,得到第二调节处理后的图像;Based on the second correction coefficient of each pixel point included in the image to be processed on different color channels, a second adjustment process is performed on the color value of each pixel point included in the image to be processed on the corresponding color channel to obtain The image after the second adjustment process; 基于所述待处理图像中包括的各像素点在不同颜色通道上的第一修正系数,对所述第二调节处理后的图像中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到所述第一图像。Based on the first correction coefficients of each pixel point included in the image to be processed on different color channels, a first correction coefficient is performed on the color value of each pixel point included in the second adjustment processed image on the corresponding color channel. Adjustment processing is performed to obtain the first image. 11.根据权利要求10所述的方法,其特征在于,所述基于所述待处理图像中包括的各像素点在不同颜色通道上的第二修正系数,对所述待处理图像中包括的各像素点在对应颜色通道上的颜色值进行第二调节处理之前,所述方法还包括:11. The method according to claim 10, characterized in that, based on the second correction coefficient of each pixel included in the image to be processed on different color channels, each pixel included in the image to be processed is modified. Before the second adjustment process is performed on the color value of the pixel on the corresponding color channel, the method further includes: 对所述第二修正系数进行归一化处理。The second correction coefficient is normalized. 12.一种颜色修正模型的训练方法,其特征在于,应用于电子设备,所述方法包括:12. A training method for a color correction model, characterized in that it is applied to electronic devices, and the method includes: 基于图像训练数据对初始模型进行迭代训练,以获得所述颜色修正模型;Iteratively train an initial model based on image training data to obtain the color correction model; 其中,在任一次迭代训练的过程中,将所述图像训练数据输入上一次迭代训练后得到的模型中,通过所述模型获取所述图像训练数据的颜色修正系数,基于所述颜色修正系数对所述图像训练数据进行颜色修正,得到颜色修正后的输出图像,所述颜色修正系数用于对所述图像训练数据中包括的各像素点在不同颜色通道上的颜色进行修正;基于所述输出图像和所述图像训练数据对应的样本图像,调整模型参数,所述样本图像为颜色质量达到预设要求的图像。Wherein, in any iterative training process, the image training data is input into the model obtained after the previous iterative training, the color correction coefficient of the image training data is obtained through the model, and the color correction coefficient is used to correct the image training data based on the color correction coefficient. The image training data is subjected to color correction to obtain a color-corrected output image, and the color correction coefficient is used to correct the color of each pixel included in the image training data on different color channels; based on the output image Adjust the model parameters for the sample image corresponding to the image training data, and the sample image is an image whose color quality meets the preset requirements. 13.根据权利要求12所述的方法,其特征在于,所述通过所述模型获取所述图像训练数据的颜色修正系数,基于所述颜色修正系数对所述图像训练数据进行颜色修正,得到颜色修正后的输出图像,包括:13. The method of claim 12, wherein the color correction coefficient of the image training data is obtained through the model, and the color correction coefficient is performed on the image training data based on the color correction coefficient to obtain a color Corrected output image, including: 通过所述模型的预测子模型,预测所述图像训练数据的颜色修正系数;Predict the color correction coefficient of the image training data through the prediction sub-model of the model; 通过所述模型的修正子模型,基于所述颜色修正系数对所述图像训练数据进行颜色修正,得到所述输出图像。Through the correction sub-model of the model, color correction is performed on the image training data based on the color correction coefficient to obtain the output image. 14.根据权利要求12所述的方法,其特征在于,所述通过所述模型获取所述图像训练数据的颜色修正系数,基于所述颜色修正系数对所述图像训练数据进行颜色修正,得到颜色修正后的输出图像,包括:14. The method of claim 12, wherein the color correction coefficient of the image training data is obtained through the model, and the color correction coefficient is performed on the image training data based on the color correction coefficient to obtain a color Corrected output image, including: 通过所述模型的处理子模型对所述图像训练数据进行图像处理,得到图像处理后的图像;Perform image processing on the image training data through the processing sub-model of the model to obtain a processed image; 通过所述模型的预测子模型,预测所述图像训练数据的颜色修正系数;Predict the color correction coefficient of the image training data through the prediction sub-model of the model; 通过所述模型的修正子模型,基于所述颜色修正系数对所述图像处理后的图像进行颜色修正,得到所述输出图像。Through the correction sub-model of the model, color correction is performed on the image processed image based on the color correction coefficient to obtain the output image. 15.根据权利要求13或14所述的方法,其特征在于,所述通过所述模型的预测子模型,预测所述图像训练数据的颜色修正系数,包括:15. The method according to claim 13 or 14, characterized in that predicting the color correction coefficient of the image training data through the prediction sub-model of the model includes: 通过所述预测子模型的特征提取层,对所述图像训练数据进行特征提取,得到所述图像训练数据在不同颜色通道上的颜色特征;Through the feature extraction layer of the prediction sub-model, feature extraction is performed on the image training data to obtain color features of the image training data on different color channels; 通过所述预测子模型的卷积层,对所述图像训练数据在不同颜色通道上的颜色特征进行卷积处理,得到所述图像训练数据在不同颜色通道上的颜色修正系数。Through the convolution layer of the prediction sub-model, the color features of the image training data on different color channels are convolved to obtain the color correction coefficients of the image training data on different color channels. 16.根据权利要求15所述的方法,其特征在于,所述特征提取层包括至少两层目标模型结构,所述目标模型结构包括卷积层、批标准化层及激活函数层。16. The method according to claim 15, wherein the feature extraction layer includes at least two layers of target model structure, and the target model structure includes a convolution layer, a batch normalization layer and an activation function layer. 17.根据权利要求12所述的方法,其特征在于,所述颜色修正系数包括所述图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数;17. The method of claim 12, wherein the color correction coefficient includes a first correction coefficient on different color channels for each pixel included in the image training data; 所述基于所述颜色修正系数对所述图像训练数据进行颜色修正,得到颜色修正后的输出图像,包括:Performing color correction on the image training data based on the color correction coefficient to obtain a color-corrected output image includes: 基于所述图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数,对所述图像训练数据中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到所述输出图像。Based on the first correction coefficient of each pixel point included in the image training data on different color channels, a first adjustment process is performed on the color value of each pixel point included in the image training data on the corresponding color channel, to obtain The output image. 18.根据权利要求12所述的方法,其特征在于,所述颜色修正系数包括所述图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数和第二修正系数;18. The method of claim 12, wherein the color correction coefficient includes a first correction coefficient and a second correction coefficient on different color channels for each pixel included in the image training data; 所述基于所述颜色修正系数对所述图像训练数据进行颜色修正,得到颜色修正后的输出图像,包括:Performing color correction on the image training data based on the color correction coefficient to obtain a color-corrected output image includes: 基于所述图像训练数据中包括的各像素点在不同颜色通道上的第二修正系数,对所述图像训练数据中包括的各像素点在对应颜色通道上的颜色值进行第二调节处理,得到第二调节处理后的图像;Based on the second correction coefficient of each pixel point included in the image training data on different color channels, a second adjustment process is performed on the color value of each pixel point included in the image training data on the corresponding color channel, to obtain The image after the second adjustment process; 基于所述图像训练数据中包括的各像素点在不同颜色通道上的第一修正系数,对所述第二调节处理后的图像中包括的各像素点在对应颜色通道上的颜色值进行第一调节处理,得到所述输出图像。Based on the first correction coefficients of each pixel point included in the image training data on different color channels, a first correction coefficient is performed on the color value of each pixel point included in the second adjusted image on the corresponding color channel. Adjustment processing to obtain the output image. 19.根据权利要求18所述的方法,其特征在于,所述基于所述图像训练数据中包括的各像素点在不同颜色通道上的第二修正系数,对所述图像训练数据中包括的各像素点在对应颜色通道上的颜色值进行第二调节处理之前,所述方法还包括:19. The method according to claim 18, characterized in that, based on the second correction coefficient of each pixel included in the image training data on different color channels, each pixel included in the image training data is Before the second adjustment process is performed on the color value of the pixel on the corresponding color channel, the method further includes: 对所述第二修正系数进行归一化处理。The second correction coefficient is normalized. 20.一种电子设备,其特征在于,包括显示屏、存储器和处理器;所述显示屏提供有显示功能;所述存储器用于存储程序代码;所述处理器用于调用所述程序代码,以执行如权利要求1-11或12-19任一项所述的方法。20. An electronic device, characterized in that it includes a display screen, a memory and a processor; the display screen is provided with a display function; the memory is used to store program code; the processor is used to call the program code to Carry out the method as described in any one of claims 1-11 or 12-19. 21.一种计算机可读存储介质,其特征在于,包括程序代码,所述程序代码在电子设备上运行时,使得所述电子设备执行如权利要求1-11或12-19任一项所述的方法。21. A computer-readable storage medium, characterized in that it includes program code. When the program code is run on an electronic device, the electronic device causes the electronic device to execute the method described in any one of claims 1-11 or 12-19. Methods.
CN202310983691.0A 2023-08-07 2023-08-07 Color correction methods, electronic equipment and storage media Pending CN116721038A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310983691.0A CN116721038A (en) 2023-08-07 2023-08-07 Color correction methods, electronic equipment and storage media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310983691.0A CN116721038A (en) 2023-08-07 2023-08-07 Color correction methods, electronic equipment and storage media

Publications (1)

Publication Number Publication Date
CN116721038A true CN116721038A (en) 2023-09-08

Family

ID=87873725

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310983691.0A Pending CN116721038A (en) 2023-08-07 2023-08-07 Color correction methods, electronic equipment and storage media

Country Status (1)

Country Link
CN (1) CN116721038A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109087269A (en) * 2018-08-21 2018-12-25 厦门美图之家科技有限公司 Low light image Enhancement Method and device
CN109523485A (en) * 2018-11-19 2019-03-26 Oppo广东移动通信有限公司 Image color correction method, device, storage medium and mobile terminal
CN113168673A (en) * 2019-04-22 2021-07-23 华为技术有限公司 Image processing method, device and electronic device
CN114299180A (en) * 2021-12-29 2022-04-08 苏州科达科技股份有限公司 Image reconstruction method, device, equipment and storage medium
CN114331927A (en) * 2020-09-28 2022-04-12 Tcl科技集团股份有限公司 Image processing method, storage medium and terminal equipment
CN114841863A (en) * 2021-01-30 2022-08-02 华为技术有限公司 Image color correction method and device
US20220301123A1 (en) * 2021-03-17 2022-09-22 Ali Mosleh End to end differentiable machine vision systems, methods, and media
CN115861119A (en) * 2022-12-20 2023-03-28 上海工业自动化仪表研究院有限公司 Rock slag image color cast correction method based on deep convolutional neural network

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109087269A (en) * 2018-08-21 2018-12-25 厦门美图之家科技有限公司 Low light image Enhancement Method and device
CN109523485A (en) * 2018-11-19 2019-03-26 Oppo广东移动通信有限公司 Image color correction method, device, storage medium and mobile terminal
CN113168673A (en) * 2019-04-22 2021-07-23 华为技术有限公司 Image processing method, device and electronic device
CN114331927A (en) * 2020-09-28 2022-04-12 Tcl科技集团股份有限公司 Image processing method, storage medium and terminal equipment
CN114841863A (en) * 2021-01-30 2022-08-02 华为技术有限公司 Image color correction method and device
US20220301123A1 (en) * 2021-03-17 2022-09-22 Ali Mosleh End to end differentiable machine vision systems, methods, and media
CN114299180A (en) * 2021-12-29 2022-04-08 苏州科达科技股份有限公司 Image reconstruction method, device, equipment and storage medium
CN115861119A (en) * 2022-12-20 2023-03-28 上海工业自动化仪表研究院有限公司 Rock slag image color cast correction method based on deep convolutional neural network

Similar Documents

Publication Publication Date Title
US20220207680A1 (en) Image Processing Method and Apparatus
JP7266672B2 (en) Image processing method, image processing apparatus, and device
JP7226851B2 (en) Image processing method, apparatus and device
CN111418201B (en) Shooting method and equipment
US20190251670A1 (en) Electronic device and method for correcting images using external electronic device
US20190286887A1 (en) Image Processing Method, Electronic Device and Storage Medium
US20210185287A1 (en) Apparatus and method for chroma processing for multi-frame fusion
US9986163B2 (en) Digital photographing apparatus and digital photographing method
CN116012262B (en) Image processing method, model training method and electronic equipment
CN117745620A (en) Image processing method and electronic device
CN118042280A (en) Image processing method, electronic device, computer program product and storage medium
CN116721038A (en) Color correction methods, electronic equipment and storage media
CN115460343A (en) Image processing method, device and storage medium
KR20100117457A (en) Digital image signal processing method, medium for recording the method, and digital image signal processing apparatus
CN115861042B (en) Image processing method, electronic equipment and medium
CN116709043B (en) Shooting method and electronic equipment
CN117132511B (en) Image processing method and electronic equipment
WO2024082863A1 (en) Image processing method and electronic device
RU2791810C2 (en) Method, equipment and device for image processing
CN117278865A (en) Image processing method and related device
CN118075607A (en) Image processing method, electronic device and storage medium
CN118338120A (en) Image preview method and terminal device
CN118488325A (en) Image processing method and electronic device
CN117132477A (en) Image processing method and electronic equipment
CN119277212A (en) Image processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Country or region after: China

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Applicant after: Honor Terminal Co.,Ltd.

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Applicant before: Honor Device Co.,Ltd.

Country or region before: China