WO2020103570A1 - 图像颜色校正方法、装置、存储介质及移动终端 - Google Patents

图像颜色校正方法、装置、存储介质及移动终端

Info

Publication number
WO2020103570A1
WO2020103570A1 PCT/CN2019/107580 CN2019107580W WO2020103570A1 WO 2020103570 A1 WO2020103570 A1 WO 2020103570A1 CN 2019107580 W CN2019107580 W CN 2019107580W WO 2020103570 A1 WO2020103570 A1 WO 2020103570A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
original image
sample
white balance
color correction
Prior art date
Application number
PCT/CN2019/107580
Other languages
English (en)
French (fr)
Inventor
朱豪
刘耀勇
陈岩
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2020103570A1 publication Critical patent/WO2020103570A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Definitions

  • Embodiments of the present application relate to the field of image processing technology, and in particular, to an image color correction method, device, storage medium, and mobile terminal.
  • the color of the image collected by the camera is closely related to the collection environment. In different collection environments, the color of the image collected for the same collection target is different. The illumination of the collection environment and the RGB three components of the camera's image sensor will affect the final imaging color in response to objects of different colors. Therefore, in actual applications, the color of the image collected by the camera needs to be corrected to restore the collection target True colors. Therefore, an effective color correction method becomes critical to the quality of the image captured by the camera.
  • an embodiment of the present application provides an image color correction method, including:
  • the output image of the image color correction model is determined, and the output image is used as the target image corresponding to the original image.
  • an image color correction device including:
  • the original image acquisition module is used to acquire the original image to be processed
  • a first original image input module configured to input the original image into a pre-trained image color correction model
  • the target image determination module is used to determine the output image of the image color correction model, and use the output image as the target image corresponding to the original image.
  • an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, which is implemented when executed by a processor:
  • the output image of the image color correction model is determined, and the output image is used as the target image corresponding to the original image.
  • an embodiment of the present application provides a terminal, including a memory, a processor, and a computer program stored on the memory and executable by the processor.
  • the processor implements the computer program when it executes:
  • the output image of the image color correction model is determined, and the output image is used as the target image corresponding to the original image.
  • FIG. 1 is a schematic flowchart of an image color correction method provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of another image color correction method provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of another image color correction method according to an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of an image color correction device provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a mobile terminal according to an embodiment of this application.
  • FIG. 6 is a schematic structural diagram of another mobile terminal according to an embodiment of the present application.
  • CCM ColorCorrectionMatrix, color correction matrix
  • ColorCorrectionMatrix color correction matrix
  • An embodiment of the present application provides an image color correction method, including:
  • the output image of the image color correction model is determined, and the output image is used as the target image corresponding to the original image.
  • the method before acquiring the original image to be processed, the method further includes:
  • the image color correction model is obtained as follows:
  • the first preset machine learning model is trained using the first training sample set to obtain an image color correction model.
  • the method before performing color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image, the method further includes:
  • Performing color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image includes:
  • acquiring the original image of the first sample through the camera includes:
  • the first sample original image of the first standard color card under different illuminations is collected through a camera; wherein, the first standard color card is a color color card.
  • acquiring the original image of the first sample through the camera further includes:
  • the first sample original image of at least two shooting scenes under different illuminations is collected by the camera.
  • the method before inputting the original image into the pre-trained image color correction model, the method further includes:
  • the inputting the original image into the pre-trained image color correction model includes:
  • the original image after the white balance processing is input into the pre-trained image color correction model.
  • the method before inputting the original image into the pre-trained white balance coefficient matrix determination model, the method further includes:
  • the determination model of the white balance coefficient matrix is obtained as follows:
  • the second standard color card is a white color card
  • performing white balance processing on the original image according to the white balance coefficient matrix includes:
  • the product of the first RGB component value of each pixel and the white balance coefficient of the corresponding position in the white balance coefficient matrix is used as the target image corresponding to the pixel of the original image
  • the second RGB component value of the pixel is used as the target image corresponding to the pixel of the original image.
  • the method further includes:
  • Gamma correction is performed on the target image, and the target image after gamma correction is output.
  • FIG. 1 is a schematic flowchart of an image color correction method provided by an embodiment of the present application.
  • the method may be executed by an image color correction device, where the device may be implemented by software and / or hardware, and may generally be integrated in a mobile terminal.
  • the method includes:
  • Step 101 Acquire an original image to be processed.
  • the mobile terminal in the embodiment of the present application may include a mobile device with a camera function such as a mobile phone, a tablet computer, and a video camera.
  • the raw image collected by the camera is acquired.
  • the raw image is used as the original image to be processed.
  • the camera collects the raw image and performs white balance processing on the raw image based on a preset white balance processing algorithm
  • the raw image after the white balance processing may be used as the original image to be processed.
  • a raw image transmitted by another terminal device or an image to be color-corrected may also be obtained and used as the original image to be processed.
  • the image to be color corrected can also be obtained directly from the image library stored in the mobile terminal as the original image to be processed. It should be noted that the source or acquisition method of the original image to be processed in the embodiment of the present application is not limited.
  • the original image to be processed is acquired.
  • the trigger condition of the image color correction event may be set in advance.
  • an image color correction event may be triggered when it is detected that the camera is in the on state.
  • an image color correction event may be triggered when it is detected that the user actively opens the image color correction authority.
  • the application timing and application scenarios of the image color correction can be analyzed or investigated, etc., and the settings are reasonable .
  • trigger an image color correction event When detecting that the mobile terminal is in the preset scene, trigger an image color correction event. It should be noted that the embodiment of the present application does not limit the specific expression form in which the image color correction event is triggered.
  • Step 102 Input the original image into a pre-trained image color correction model.
  • the image color correction model can be understood as the learning model of the target image corresponding to the original image to be processed quickly after inputting the original image to be processed, wherein the corresponding to the original image to be processed
  • the target image is an image that has undergone image color correction on the original image.
  • the image color correction model may be a learning model generated by training the collected sample original image and the image color correction image adjusted to the best effect. It is understandable that the image color correction model can be generated by learning the sample original image and the image color correction image that adjusts the sample original image to the best effect, and the correspondence between the two.
  • the image color correction model is an end-to-end learning model, that is, a learning model where both input and output are images.
  • Step 103 Determine the output image of the image color correction model, and use the output image as a target image corresponding to the original image.
  • the image color correction model analyzes the original image to be processed, and performs color correction on the original image according to the analysis result to obtain the original image.
  • the target image after color correction and output It can be understood that, after the original image to be processed is input to the image color correction model, and the image color correction model is analyzed, and the image is directly output, the output image may be used as the target image corresponding to the original image. That is, the output image of the image color correction model is an image after the color correction model performs color correction on the original image to be processed, that is, a target image corresponding to the original image.
  • the image color correction method provided in the embodiment of the present application obtains an original image to be processed; input the original image into a pre-trained image color correction model; determine the output image of the image color correction model, and apply the The output image is used as the target image corresponding to the original image.
  • the method further includes: performing gamma correction on the target image, and outputting the target image after gamma correction.
  • the target image is obtained after color correction is performed on the original image.
  • the target image may be further gamma-corrected, and the gamma-corrected target image may be output.
  • the advantage of this setting is that it can improve the color of the dark areas in the target image, which can further improve the contrast of the image and improve the quality of the image.
  • FIG. 2 is a schematic flowchart of an image color correction method provided by an embodiment of the present application. As shown in FIG. 2, the method includes:
  • Step 201 Collect the first sample original image through the camera.
  • collecting the first sample original image through the camera includes: collecting the first sample original image of the first standard color card under different illumination through the camera; wherein, the first standard color card is a color color card; Alternatively, the first sample original image of at least two shooting scenes under different illuminations can be collected through a camera.
  • the first standard color card is a color color card
  • the first standard color card may be a standard color card with 24 pure color blocks of different colors, and images of the first standard color card under different illuminations are collected through a camera , As the first sample original image.
  • the raw images of the first standard color card at different color temperatures are collected through a camera, and the white balance processing is performed on the raw image based on a preset white balance processing algorithm, then the raw image after the white balance processing can be used as the first This original image.
  • At least two images of the shooting scene under different illuminations are collected through the camera, and the collected images are used as the first sample original images.
  • at least two shooting scenes preferably contain subjects of different colors to make the shooting scenes rich in color. It is understandable that different shooting scenes contain different colors of different shooting subjects, then the images of at least two shooting scenes under different illuminations are collected by the camera as the first sample original image, which can make the first sample taken original
  • the image can not only simulate the image of the first standard color card collected by the camera under different illuminations, but also contain more scene information.
  • Step 202 Perform color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image.
  • an existing image color correction method may be used to perform color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image.
  • input the original image of the first sample into the ISP (Image Signal Processor) tool manually perform color correction adjustment on the original image of the first sample, and adjust to the image with the best color correction effect As the first sample target image corresponding to the first sample original image.
  • ISP Image Signal Processor
  • whether the image adjusted to the best color correction effect can be confirmed by the first intuitive feeling of human eyes, and can also be evaluated by the image quality evaluation standard until the color is obtained Correct the best image.
  • the method before performing color correction on the original image of the first sample to obtain a target image of the first sample corresponding to the original image of the first sample, the method further includes: collecting through the camera the same as the first A sample RGB image corresponding to the original image; performing color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image, including: taking the sample RGB image as With reference to the image, the first sample original image is color corrected to obtain a first sample target image corresponding to the first sample original image.
  • the advantage of this setting is that it can effectively control the correction scale when performing color correction on the original image of the first sample, can easily and quickly complete the color correction on the original image of the first sample, and can achieve a better color correction effect .
  • the first standard color card can be collected by the camera Sample RGB images under different lighting, where the first sample original image corresponds to the sample RGB image one by one, that is, the first sample original image and the sample RGB image are both collected by the first standard color card under the same light image.
  • the first sample original image (raw image or the image after the raw image is subjected to white balance processing) of at least two shooting scenes under different illuminations is collected by the camera
  • at least two shootings can be collected by the camera
  • Sample RGB images of the scene under different lighting where the first sample original image corresponds to the sample RGB image one by one, that is, the first sample original image and the sample RGB image are collected images of the same shooting scene under the same light .
  • the sample RGB image corresponding to the first sample original image is used as a reference image to achieve a better color correction effect on the first sample original image.
  • input the first sample original image into the ISP tool use the sample RGB image as the reference image, and manually perform color correction on the first sample original image until the color corrected image is not very different from the sample RGB image
  • it can be considered that the original image of the first sample is adjusted to an image with better color correction effect.
  • Step 203 Use the first sample original image and the first sample target image as the first training sample set.
  • the first sample original image and the first sample target image corresponding to the first sample original image are used as the training sample set of the image color correction model, that is, the first training sample set.
  • Step 204 Use the first training sample set to train a first preset machine learning model to obtain an image color correction model.
  • the first preset machine learning model is trained using the first training sample set to generate an image color correction model.
  • the first preset machine learning model may include a machine learning model such as a convolutional neural network model or a long-term short-term memory network model, and may also include a naive Bayes model. It should be noted that the embodiment of the present application does not limit the first preset machine learning model.
  • Step 205 Acquire the original image to be processed.
  • Step 206 Input the original image into a pre-trained image color correction model.
  • Step 207 Determine the output image of the image color correction model, and use the output image as the target image corresponding to the original image.
  • an image color correction model is acquired.
  • the mobile terminal may obtain the first training sample set, use the first training sample set to train the first preset machine learning model, and directly generate an image color correction model.
  • the mobile terminal directly calls the image color correction model generated by the training of other mobile terminals.
  • a mobile terminal is used to obtain the first training sample set and generate an image color correction model, and then store the image color correction model to Among other mobile terminals, it is directly used by other mobile terminals.
  • the server obtains a large number of first sample original images and the first sample target images after color correction of the first sample original images to obtain a first training sample set.
  • the server trains the first training sample set based on the first preset machine learning model to obtain an image color correction model.
  • the trained image color correction model is called from the server.
  • the image color correction method obtained in the embodiment of the present application obtains an original image to be processed, and inputs the original image into a pre-trained image color correction model, and then determines an output image of the image color correction model, and The output image is used as the target image corresponding to the original image, wherein the image color correction model is generated based on the first sample original image and the first sample target image after color correction of the first sample original image is generated by training of.
  • the first sample original image of the first standard color card collected under different lighting, or the first sample original image of at least two shooting scenes collected under different lighting, and the first The first sample target image after color correction of the original sample image, training and learning of the image color correction model can effectively improve the accuracy of the image color correction model, and the image color correction model can be accurately and quickly processed Color correction of the original image can effectively improve the image quality.
  • FIG. 3 is a schematic flowchart of an image color correction method provided by an embodiment of the present application. As shown in FIG. 3, the method includes:
  • Step 301 Collect the first sample original image of the first standard color card under different illumination through the camera; wherein the first standard color card is a color color card; or collect at least two shooting scenes under different illumination through the camera The first sample of the original image.
  • Step 302 Perform color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image.
  • Step 303 Use the first sample original image and the first sample target image as the first training sample set.
  • Step 304 Use the first training sample set to train the first preset machine learning model to obtain an image color correction model.
  • Step 305 Acquire the original image to be processed.
  • the original image to be processed includes the raw image collected by the camera.
  • the original image to be processed includes an image that needs to be color corrected, but in order to achieve a better color correction effect, the original image needs to be subjected to white balance processing in advance.
  • Step 306 Input the original image into a pre-trained white balance coefficient matrix determination model.
  • the white balance coefficient matrix determination model can be understood as a learning model for quickly determining the white balance coefficient matrix corresponding to the original image to be processed after inputting the original image to be processed.
  • the white balance coefficient matrix determination model may be a learning model generated by training the collected second sample original image and the corresponding sample white balance coefficient matrix, where the sample white balance coefficient matrix includes the white Balance the matrix when processing images. It can be understood that the white balance coefficient matrix determination model can be generated by learning the second sample original image and the corresponding sample white balance coefficient matrix, and the correspondence between the two.
  • Step 307 Determine the output result of the model according to the white balance coefficient matrix, and determine the white balance coefficient matrix corresponding to the original image.
  • the white balance coefficient matrix determination model analyzes the original image, and determines the white balance coefficient matrix corresponding to the original image to be processed according to the analysis result .
  • Step 308 Perform white balance processing on the original image according to the white balance coefficient matrix.
  • the original image to be processed is subjected to white balance processing based on the white balance coefficient matrix.
  • the product of the original image and the white balance coefficient matrix may be used as the image after the white balance processing is performed on the original image.
  • performing white balance processing on the original image according to the white balance coefficient matrix includes: acquiring the first RGB component value of each pixel in the original image; for all pixels in the original image, The product of the first RGB component value of each pixel and the white balance coefficient of the corresponding position in the white balance coefficient matrix is used as the second RGB component value of the pixel of the target image corresponding to the pixel of the original image.
  • the advantage of this setting is that it can determine an independent white balance coefficient for each pixel in the original image to be processed, and perform white balance processing on each pixel in the original image based on the white balance coefficient matrix, which can solve the problem based on the global white
  • the balance algorithm performs white balance processing, it is easy to cause the color deviation of the solid color object to be large, and the technical problem that the white block cannot be accurately detected at the mixed color temperature can effectively improve the image quality and increase the saturation of the image.
  • the first RGB component value of each pixel in the original image is obtained, and for all pixels in the original image, the first RGB component value of each pixel is multiplied by the corresponding position in the white balance coefficient matrix White balance coefficient, and the result of the product as the second RGB component value of the target image pixel corresponding to the pixel of the original image, that is, the result of the product as the pixel of the original image after white balance processing The second RGB component value.
  • the first RGB component value of the first pixel in the original image (the pixel in the first row and first column of the original image) is obtained, and then the white balance of the first row and first column in the white balance coefficient matrix
  • the product of the coefficient and the first RGB component value of the first pixel is used as the first pixel in the image after the white balance processing of the original image (the first row and first column of the white balance processed image) Pixels) the second RGB component value.
  • a similar processing operation is performed on each pixel in the original image, thereby obtaining an image after the original image is subjected to white balance processing.
  • Step 309 Input the original image after the white balance processing into the pre-trained image color correction model.
  • the original image after the white balance process is input into the image color correction model, and the image color correction model analyzes the image to perform color correction.
  • Step 310 Determine the output image of the image color correction model, and use the output image as the target image corresponding to the original image.
  • Step 311 Perform gamma correction on the target image, and output the target image after gamma correction.
  • the image color correction method obtaineds an original image to be processed, inputs the original image into a pre-trained white balance coefficient matrix determination model, and determines the output result of the model according to the white balance coefficient matrix to determine the original image Corresponding white balance coefficient matrix, then perform white balance processing on the original image according to the white balance coefficient matrix, input the original image after the white balance processing into the pre-trained image color correction model, and determine the output image of the image color correction model , Use the output image as the target image corresponding to the original image.
  • the white balance coefficient matrix determination model can be used to perform white balance processing on the original image, and the image color correction model can be used to color correct the image after the white balance processing, which can not only improve the original image contrast, but Increasing the saturation of the image can effectively improve the image quality.
  • the method before inputting the original image into the pre-trained white balance coefficient matrix determination model, the method further includes: acquiring a white balance coefficient matrix determination model; wherein, the white balance coefficient matrix determination model is as follows Obtained: the second sample original image of the second standard color card at different color temperatures is collected through the camera; wherein, the second standard color card is a white color card; the white balance processing is performed on the second sample original image to obtain A second sample target image corresponding to the second sample original image; based on the second sample original image and the second sample target image, determining to change the second sample original image to the second sample target image Corresponding sample white balance coefficient matrix; marking the original image of the second sample according to the sample white balance coefficient matrix to obtain a second training sample set; using the second training sample set to the second preset machine learning model After training, a model for determining the white balance coefficient matrix is obtained.
  • the white balance coefficient matrix determination model is as follows Obtained: the second sample original image of the second standard color card at different color temperatures is collected through the camera; wherein, the second standard
  • the second standard color card is a white color card
  • images of the second standard color card at different color temperatures are collected by a camera as the second sample original image.
  • a raw image of a standard color card at different color temperatures is collected by a camera as a second sample original image.
  • Different color temperatures can be achieved by artificial light sources.
  • different types of light sources are used to create different color temperature environments.
  • using candles as a light source can create a color temperature environment of 2000k
  • using high-pressure sodium lamps as a light source can create a color temperature environment of 1950-2250k
  • using a tungsten filament lamp as a light source can create a color temperature environment of 2700k
  • using a halogen lamp as a light source Create a color temperature environment of 3000k
  • use a warm fluorescent lamp as a light source to create a color temperature environment of 4000k-4600k.
  • a series of shooting environments with continuous color temperature values can be provided by different types of light sources.
  • the second standard color card is photographed at different color temperatures using a camera to obtain color card images at each color temperature, thereby obtaining a second sample original image of the second standard color card at different color temperatures.
  • the existing white balance processing method may be used to perform white balance processing on the second sample original image to obtain a second sample target image corresponding to the second sample original image.
  • input the second sample original image into the ISP tool manually perform white balance adjustment on the second sample original image, and use the image adjusted to the best white balance effect as the second sample corresponding to the second sample original image Target image.
  • the white balance adjustment is performed on the original image of the second sample, whether the image adjusted to the best white balance effect can be confirmed by the second intuitive feeling of the human eye, and can also be evaluated by the image quality evaluation standard until the white balance is obtained The best image.
  • the corresponding sample white balance coefficient is determined when the second sample original image is changed to the second sample target image Matrix, that is, the matrix of white balance coefficients used in the process of white balance when the white balance processing is performed on the original image of the second sample to obtain the target image of the second sample.
  • determining, according to the second sample original image and the second sample target image, to change the second sample original image to a sample white balance coefficient matrix corresponding to the second sample target image includes: obtaining The third RGB component value of each pixel in the second sample original image and the fourth RGB component value of each pixel in the second sample target image; for all pixels, the corresponding The ratio of the fourth RGB component value to the third RGB component value is used as the white balance coefficient corresponding to the pixel point in the sample white balance coefficient matrix.
  • the third RGB component value of each pixel in the second sample original image and the fourth RGB component value of each pixel in the second sample target image are obtained respectively, and for each pixel, the corresponding pixel is calculated separately The ratio of the fourth RGB component value of the point to the third RGB component value, and using this ratio as the white balance coefficient matrix of the pixel point.
  • the third RGB component value of the first pixel in the second sample original image (the pixel in the first row and first column in the second sample original image), and the first in the second sample target image
  • the fourth RGB component value of the pixel point (the pixel point in the first row and first column in the first sample target image), and the ratio of the fourth RGB component value to the third RGB component value is used as the white balance coefficient matrix
  • the white balance coefficient in the first row and first column of is determined respectively.
  • the corresponding second sample original image is marked respectively, and the second sample original image corresponding to the sample white balance coefficient matrix is marked as the white balance coefficient matrix determination model Training sample set, which is the second training sample set.
  • the second preset machine learning model is trained using the second training sample set to generate a white balance coefficient matrix determination model.
  • the second preset machine learning model may include a machine learning model such as a convolutional neural network model or a long-term and short-term memory network model.
  • the embodiment of the present application does not limit the second preset machine learning model, where the second preset machine learning model and the first preset machine learning model may be the same or different.
  • a white balance coefficient matrix determination model is acquired.
  • the mobile terminal may obtain the second training sample set, use the second training sample set to train the second preset machine learning model, and directly generate a white balance coefficient matrix determination model. It may also be that the mobile terminal directly calls the white balance coefficient matrix determination model generated by other mobile terminal training, for example, before leaving the factory, a mobile terminal is used to obtain a second training sample set and generate a white balance coefficient matrix determination model, and then the white balance coefficient The matrix determination model is stored in other mobile terminals for direct use by other mobile terminals.
  • the server obtains a large number of second sample original images and a white balance coefficient matrix corresponding to the second sample original image, and marks the second sample original images according to the corresponding white balance coefficient matrix to obtain a second training sample set.
  • the server trains the second training sample set based on the second preset machine learning model to obtain a white balance coefficient matrix determination model.
  • the trained white balance coefficient matrix is called from the server to determine the model.
  • FIG. 4 is a schematic structural diagram of an image color correction device provided by an embodiment of the present application.
  • the device may be implemented by software and / or hardware, and is generally integrated in a mobile terminal.
  • the original image to be processed may be processed by performing an image color correction method. Color correction.
  • the device includes:
  • the original image acquisition module 401 is used to acquire an original image to be processed
  • the first original image input module 402 is used to input the original image into a pre-trained image color correction model
  • the target image determination module 403 is configured to determine an output image of the image color correction model, and use the output image as a target image corresponding to the original image.
  • the image color correction device acquires an original image to be processed; input the original image into a pre-trained image color correction model; determine the output image of the image color correction model, and apply the The output image is used as the target image corresponding to the original image.
  • the device further includes:
  • a color correction model obtaining module used to obtain the image color correction model before obtaining the original image to be processed
  • the image color correction model is obtained as follows:
  • the first preset machine learning model is trained using the first training sample set to obtain an image color correction model.
  • the method before performing color correction on the original image of the first sample to obtain a target image of the first sample corresponding to the original image of the first sample, the method further includes:
  • Performing color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image includes:
  • collecting the first sample original image through the camera including:
  • the first standard color card is a color color card
  • the first sample original image of at least two shooting scenes under different illuminations is collected by the camera.
  • the device further includes:
  • a second original image input module configured to input the original image into the pre-trained white balance coefficient matrix determination model before inputting the original image into the pre-trained image color correction model;
  • a white balance coefficient matrix determination module configured to determine an output result of the model according to the white balance coefficient matrix, and determine a white balance coefficient matrix corresponding to the original image
  • a white balance processing module configured to perform white balance processing on the original image according to the white balance coefficient matrix
  • the first original image input module is used to:
  • the original image after the white balance processing is input into the pre-trained image color correction model.
  • the device further includes:
  • the coefficient matrix determination model acquisition module is used to acquire the white balance coefficient matrix determination model before inputting the original image into the pre-trained white balance coefficient matrix determination model;
  • the determination model of the white balance coefficient matrix is obtained as follows:
  • the second standard color card is a white color card
  • the device further includes:
  • the gamma correction module is used to perform gamma correction on the target image after the output image is used as the target image corresponding to the original image, and output the target image after gamma correction.
  • Embodiments of the present application also provide a storage medium containing computer-executable instructions, which when executed by a computer processor are used to perform an image color correction method, the method includes:
  • the output image of the image color correction model is determined, and the output image is used as the target image corresponding to the original image.
  • Storage medium any kind of memory device or storage device.
  • the term “storage medium” is intended to include: installation media such as CD-ROM, floppy disk or tape devices; computer system memory or random access memory such as DRAM, DDRRAM, SRAM, EDORAM, Rambus RAM, etc .; Volatile memory, such as flash memory, magnetic media (such as hard disks or optical storage); registers or other similar types of memory elements, etc.
  • the storage medium may also include other types of memory or a combination thereof.
  • the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system that is connected to the first computer system through a network such as the Internet.
  • the second computer system may provide program instructions to the first computer for execution.
  • storage medium may include two or more storage media that may reside in different locations (eg, in different computer systems connected through a network).
  • the storage medium may store program instructions executable by one or more processors (eg, embodied as a computer program).
  • a storage medium containing computer-executable instructions provided by the embodiments of the present application is not limited to the image color correction operation described above, and can also perform the image color correction provided by any embodiment of the present application Related operations in the method.
  • FIG. 5 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application.
  • the mobile terminal 500 may include: a memory 501, a processor 502, and a computer program stored on the memory and executable by the processor.
  • the processor 502 executes the computer program, image color correction as described in the embodiments of the present application is implemented method.
  • the mobile terminal provided by the embodiment of the present application can not only perform color correction on the original image simply and quickly, but also can perform corresponding color correction on different input original images in a targeted manner, which can effectively improve the quality of the image and make the image Closer to true colors.
  • FIG. 6 is a schematic structural diagram of another mobile terminal provided by an embodiment of the present application.
  • the mobile terminal may include: a casing (not shown in the figure), a memory 601, and a central processing unit (CPU) 602 (also Called processor, hereinafter referred to as CPU), circuit board (not shown in the figure) and power supply circuit (not shown in the figure).
  • the circuit board is disposed inside the space enclosed by the housing; the CPU 602 and the memory 601 are provided on the circuit board; and the power circuit is used to supply power to various circuits or devices of the mobile terminal
  • the memory 601 is used to store executable program code; the CPU 602 runs the computer program corresponding to the executable program code by reading the executable program code stored in the memory 601 to achieve the following steps:
  • the output image of the image color correction model is determined, and the output image is used as the target image corresponding to the original image.
  • the mobile terminal also includes: peripheral interface 603, RF (Radio Frequency) circuit 605, audio circuit 606, speaker 611, power management chip 608, input / output (I / O) subsystem 609, other input / control
  • the device 610, the touch screen 612, other input / control devices 610, and the external port 604 communicate through one or more communication buses or signal lines 607.
  • the illustrated mobile terminal 600 is only an example of the mobile terminal, and the mobile terminal 600 may have more or fewer components than shown in the figure, and two or more components may be combined, Or it can have different component configurations.
  • the various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
  • the mobile terminal for image color correction provided in this embodiment will be described in detail below.
  • the mobile terminal uses a mobile phone as an example.
  • Memory 601 which can be accessed by CPU 602, peripheral interface 603, etc.
  • the memory 601 can include high-speed random access memory, and can also include non-volatile memory, such as one or more disk storage devices, flash memory devices , Or other volatile solid-state storage devices.
  • Peripheral interface 603, which can connect input and output peripherals of the device to CPU 602 and memory 601.
  • the I / O subsystem 609 which can connect input and output peripherals on the device, such as touch screen 612 and other input / control devices 610, to peripheral interface 603.
  • the I / O subsystem 609 may include a display controller 6091 and one or more input controllers 6092 for controlling other input / control devices 610.
  • one or more input controllers 6092 receive electrical signals from other input / control devices 610 or send electrical signals to other input / control devices 610, and other input / control devices 610 may include physical buttons (press buttons, rocker buttons, etc.) ), Dial pad, slide switch, joystick, click wheel.
  • the input controller 6092 can be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
  • a touch screen 612 which is an input interface and an output interface between the user's mobile terminal and the user, and displays visual output to the user, and the visual output may include graphics, text, icons, video, and the like.
  • the display controller 6091 in the I / O subsystem 609 receives electrical signals from the touch screen 612 or sends electrical signals to the touch screen 612.
  • the touch screen 612 detects the contact on the touch screen, and the display controller 6091 converts the detected contact into interaction with the user interface object displayed on the touch screen 612, that is, realizes human-computer interaction, and the user interface object displayed on the touch screen 612 may be running Icons for games, icons connected to the corresponding network, etc.
  • the device may also include a light mouse, which is a touch-sensitive surface that does not display visual output or an extension of the touch-sensitive surface formed by a touch screen.
  • the RF circuit 605 is mainly used to establish communication between the mobile phone and the wireless network (that is, the network side), and to realize data reception and transmission between the mobile phone and the wireless network. For example, sending and receiving short messages, e-mail, etc. Specifically, the RF circuit 605 receives and transmits RF signals, which are also called electromagnetic signals. The RF circuit 605 converts electrical signals into electromagnetic signals or converts electromagnetic signals into electrical signals, and communicates with the communication network and other devices through the electromagnetic signals Communicate.
  • the RF circuit 605 may include known circuits for performing these functions, including but not limited to antenna systems, RF transceivers, one or more amplifiers, tuners, one or more oscillators, digital signal processors, CODEC ( COder-DECoder (codec) chipset, subscriber identity module (Subscriber Identity Module, SIM), etc.
  • CODEC COder-DECoder (codec) chipset
  • subscriber identity module Subscriber Identity Module, SIM
  • the audio circuit 606 is mainly used to receive audio data from the peripheral interface 603, convert the audio data into electrical signals, and send the electrical signals to the speaker 611.
  • the speaker 611 is used to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 605 to a sound and play the sound to the user.
  • the power management chip 608 is used for power supply and power management for the hardware connected to the CPU 602, the I / O subsystem, and the peripheral interface.
  • the image color correction device, storage medium, and mobile terminal provided in the above embodiments can execute the image color correction method provided in any embodiment of the present application, and have corresponding function modules and beneficial effects for performing the method.
  • image color correction method provided in any embodiment of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

图像颜色校正方法、装置、存储介质及移动终端。该方法包括:获取待处理的原始图像(101);将所述原始图像输入至预先训练的图像颜色校正模型中(102);确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像(103)。

Description

图像颜色校正方法、装置、存储介质及移动终端
本申请要求于2018年11月19日提交中国专利局、申请号为201811377864.X、发明名称为“图像颜色校正方法、装置、存储介质及移动终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及图像处理技术领域,尤其涉及图像颜色校正方法、装置、存储介质及移动终端。
背景技术
随着移动终端的快速发展,对通过移动终端摄像头拍摄的图像的质量要求也越来越高。然而,摄像头采集的图像颜色与采集环境息息相关,在不同的采集环境下,对同一个采集目标采集的得到的图像颜色是不同的。采集环境的光照以及摄像头的图像传感器的RGB三分量,对不同颜色物体的响应都会影响最终的成像颜色,因此,在实际应用中,需要对摄像头采集的图像的颜色进行校正,以还原出采集目标的真实颜色。因此,有效的颜色校正方式对摄像头拍摄图像的效果好坏变得至关重要。
发明内容
第一方面,本申请实施例提供了一种图像颜色校正方法,包括:
获取待处理的原始图像;
将所述原始图像输入至预先训练的图像颜色校正模型中;
确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
第二方面,本申请实施例提供了一种图像颜色校正装置,包括:
原始图像获取模块,用于获取待处理的原始图像;
第一原始图像输入模块,用于将所述原始图像输入至预先训练的图像颜色校正模型中;
目标图像确定模块,用于确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
第三方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现:
获取待处理的原始图像;
将所述原始图像输入至预先训练的图像颜色校正模型中;
确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
第四方面,本申请实施例提供了一种终端,包括存储器,处理器及存储在存储器上并 可在处理器运行的计算机程序,所述处理器执行所述计算机程序时实现:
获取待处理的原始图像;
将所述原始图像输入至预先训练的图像颜色校正模型中;
确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
附图说明
图1为本申请实施例提供的一种图像颜色校正方法的流程示意图;
图2为本申请实施例提供的另一种图像颜色校正方法的流程示意图;
图3为本申请实施例提供的又一种图像颜色校正方法的流程示意图;
图4为本申请实施例提供的一种图像颜色校正装置的结构示意图;
图5为本申请实施例提供的一种移动终端的结构示意图;
图6为本申请实施例提供的另一种移动终端的结构示意图。
具体实施方式
下面结合附图并通过具体实施方式来进一步说明本申请的技术方案。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。
在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各步骤描述成顺序的处理,但是其中的许多步骤可以被并行地、并发地或者同时实施。此外,各步骤的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。
CCM(Color Correction Matrix,颜色校正矩阵)是对图像进行颜色校正,恢复图像色彩,调整图像风格,提高图像质量的重要手段。传统技术中,主要针对不同场景下的图像使用不同的CCM矩阵,对于图像不同场景的切换容易导致颜色校正后的图像效果突变,使图像调整效果无法保证风格一致,尤其是针对利用摄像机对图像进行预览的阶段,在实际应用中,会大大影响用户体验。基于以上考虑,现提供如下图像颜色校正的方案。
本申请实施例提供一种图像颜色校正方法,包括:
获取待处理的原始图像;
将所述原始图像输入至预先训练的图像颜色校正模型中;
确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
在一实施例中,在获取待处理的原始图像之前,还包括:
获取所述图像颜色校正模型;
其中,所述图像颜色校正模型由如下方式得到:
通过摄像头采集第一样本原始图像;
对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像;
将所述第一样本原始图像和所述第一样本目标图像作为第一训练样本集;
利用所述第一训练样本集对第一预设机器学习模型进行训练,得到图像颜色校正模型。
在一实施例中,在对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像之前,还包括:
通过摄像头采集与所述第一样本原始图像对应的样本RGB图像;
对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像,包括:
以所述样本RGB图像为参考图像,对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像。
在一实施例中,通过摄像头采集第一样本原始图像,包括:
通过摄像头采集第一标准色卡在不同光照下的第一样本原始图像;其中,所述第一标准色卡为彩色色卡。
在一实施例中,通过摄像头采集第一样本原始图像,还包括:
通过摄像头采集至少两个拍摄场景在不同光照下的第一样本原始图像。
在一实施例中,在将所述原始图像输入至预先训练的图像颜色校正模型中之前,还包括:
将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中;
根据所述白平衡系数矩阵确定模型的输出结果,确定与所述原始图像对应的白平衡系数矩阵;
根据所述白平衡系数矩阵对所述原始图像进行白平衡处理;
所述将所述原始图像输入至预先训练的图像颜色校正模型中,包括:
将经白平衡处理后的原始图像输入至预先训练的图像颜色校正模型中。
在一实施例中,在将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中之前,还包括:
获取白平衡系数矩阵确定模型;
其中,所述白平衡系数矩阵确定模型由如下方式得到:
通过摄像头采集第二标准色卡在不同色温下的第二样本原始图像;其中,所述第二标准色卡为白色色卡;
对所述第二样本原始图像进行白平衡处理,得到与所述第二样本原始图像对应的第二样本目标图像;
根据所述第二样本原始图像和所述第二样本目标图像,确定将所述第二样本原始图像 变化为所述第二样本目标图像对应的样本白平衡系数矩阵;
根据所述样本白平衡系数矩阵对所述第二样本原始图像进行标记,得到第二训练样本集;
利用所述第二训练样本集对第二预设机器学习模型进行训练,得到白平衡系数矩阵确定模型。
在一实施例中,根据所述白平衡系数矩阵对所述原始图像进行白平衡处理,包括:
获取所述原始图像中每个像素点的第一RGB分量值;
针对所述原始图像中所有像素点,将每个像素点的第一RGB分量值与所述白平衡系数矩阵中对应位置的白平衡系数的乘积,作为与原始图像所述像素点对应的目标图像的像素点的第二RGB分量值。
在一实施例中,在将所述输出图像作为与所述原始图像对应的目标图像之后,还包括:
对所述目标图像进行Gamma校正,并输出Gamma校正后的目标图像。
图1为本申请实施例提供的图像颜色校正方法的流程示意图,该方法可以由图像颜色校正装置执行,其中该装置可由软件和/或硬件实现,一般可集成在移动终端中。如图1所示,该方法包括:
步骤101、获取待处理的原始图像。
示例性的,本申请实施例中的移动终端可包括手机、平板电脑及摄像机等具有拍照功能的移动设备。
在本申请实施例中,当检测到移动终端的摄像头处于打开状态时,即当检测到移动终端的摄像头处于拍摄预览状态或拍摄图像时,获取摄像头采集的raw图像,此时,可将摄像头采集的raw图像作为待处理的原始图像。可选的,摄像头采集raw图像,并基于预设白平衡处理算法对raw图像进行白平衡处理,则可将白平衡处理后的raw图像作为待处理的原始图像。可选的,还可获取其他终端设备传输的raw图像或待进行颜色校正的图像,并将其作为待处理的原始图像。当然,也可以直接从移动终端中存储的图像库中,获取需要进行颜色校正的图像,作为待处理的原始图像。需要说明的是,本申请实施例对待处理的原始图像的来源或获取方式,不做限定。
可选的,当检测到图像颜色校正事件被触发时,获取待处理的原始图像。可以理解的是,为了在合适的时机对图像进行颜色校正,可预先设置图像颜色校正事件的触发条件。示例性的,为了满足用户对采集图像的视觉需求,可在检测到摄像头处于开启状态时,触发图像颜色校正事件。可选的,当用户对移动终端中某图像的对比度不满意时,可在检测到用户主动打开图像颜色校正权限时,触发图像颜色校正事件。可选的,为了使图像颜色校正应用于更有价值的应用时机,以节省图像颜色校正所带来的额外功耗,可对图像颜色校正的应用时机和应用场景进行分析或调研等,设置合理的预设场景,在检测移动终端处于预设场景时,触发图像颜色校正事件。需要说明的是,本申请实施例对图像颜色校正事 件被触发的具体表现形式不做限定。
步骤102、将所述原始图像输入至预先训练的图像颜色校正模型中。
在本申请实施例中,图像颜色校正模型可以理解为输入待处理的原始图像后,快速确定与该待处理的原始图像对应的目标图像的学习模型,其中,与该待处理的原始图像对应的目标图像为对原始图像进行图像颜色校正后的图像。图像颜色校正模型可以是对采集的样本原始图像及将样本原始图像调整到最好效果的图像颜色校正图像,进行训练生成的学习模型。可以理解的是,通过对样本原始图像及将样本原始图像调整到最好效果的图像颜色校正图像,及两者间的对应关系进行学习,可以生成图像颜色校正模型。图像颜色校正模型是端对端的学习模型,即输入及输出均为图像的学习模型。
步骤103、确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
示例性的,将待处理的原始图像输入至图像颜色校正模型后,图像颜色校正模型对所述待处理的原始图像进行分析,并根据分析结果对该原始图像进行颜色校正,得到对原始图像进行颜色校正后的目标图像,并输出。可以理解的是,将待处理的原始图像输入图像颜色校正模型后,图像颜色校正模型经分析后,直接输出图像,则可将该输出图像作为与原始图像对应的目标图像。即图像颜色校正模型的输出图像为图像颜色校正模型对待处理的原始图像进行颜色校正后的图像,即与原始图像对应的目标图像。
本申请实施例中提供的图像颜色校正方法,获取待处理的原始图像;将所述原始图像输入至预先训练的图像颜色校正模型中;确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。通过采用上述技术方案,不仅可以简单、快速地对原始图像进行颜色校正,而且还可以有针对性对输入的不同的原始图像进行相应的颜色校正,可以有效提高图像的质量,进一步增强图像的对比度,使图像更接近真实色彩。
在一些实施例中,在将所述输出图像作为与所述原始图像对应的目标图像之后,还包括:对所述目标图像进行Gamma校正,并输出Gamma校正后的目标图像。示例性的,对原始图像进行颜色校正后得到目标图像,为了进一步增加目标图像的对比度,可进一步对目标图像进行Gamma校正,并输出Gamma校正后的目标图像。这样设置的好处在于,可以对目标图像中的灰暗区域进行颜色的改善,能够进一步提高图像的对比度,提高图像的质量。
图2为本申请实施例提供的图像颜色校正方法的流程示意图,如图2所示,该方法包括:
步骤201、通过摄像头采集第一样本原始图像。
可选的,通过摄像头采集第一样本原始图像,包括:通过摄像头采集第一标准色卡在不同光照下的第一样本原始图像;其中,所述第一标准色卡为彩色色卡;或者通过摄像头 采集至少两个拍摄场景在不同光照下的第一样本原始图像。
示例性的,第一标准色卡为彩色色卡,例如第一标准色卡可以为具有24个不同颜色的纯色块的标准色卡,则通过摄像头采集第一标准色卡在不同光照下的图像,作为第一样本原始图像。示例性的,通过摄像头采集第一标准色卡在不同色温下的raw图像,并基于预设白平衡处理算法对raw图像进行白平衡处理,则可将白平衡处理后的raw图像作为第一样本原始图像。
又示例性的,通过摄像头采集至少两个拍摄场景在不同光照下的图像,并将采集的图像作为第一样本原始图像。可选的,至少两个拍摄场景最好包含不同颜色的拍摄对象,使得拍摄场景的色彩丰富。可以理解的是,不同拍摄场景包含了不同拍摄对象的不同颜色,则通过摄像头采集至少两个拍摄场景在不同光照下的图像,作为第一样本原始图像,可使得拍摄的第一样本原始图像不仅可以模拟摄像头采集的第一标准色卡在不同光照下的图像,还可以包含更多的场景信息。
步骤202、对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像。
在本申请实施例中,可利用现有图像颜色校正方法对第一样本原始图像进行颜色校正,得到与第一样本原始图像对应的第一样本目标图像。可选的,将第一样本原始图像输入至ISP(Image Signal Processor,图像信号处理器)工具中,手动对第一样本原始图像进行颜色校正调节,将调节至颜色校正效果最好的图像作为与第一样本原始图像对应的第一样本目标图像。其中,对第一样本原始图像进行颜色校正调节时,是否调节至颜色校正效果最好的图像可通过人眼的第一直观感觉进行确认,还可以通过图像质量评估标准进行评估,直至获取颜色校正效果最好的图像。
可选的,在对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像之前,还包括:通过摄像头采集与所述第一样本原始图像对应的样本RGB图像;对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像,包括:以所述样本RGB图像为参考图像,对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像。这样设置的好处在于,可以有效掌控对第一样本原始图像进行颜色校正时的校正尺度,能够简单、快速地完成对第一样本原始图像的颜色校正,且能够达到较好的颜色校正效果。
示例性的,通过摄像头采集第一标准色卡在不同光照下的第一样本原始图像(raw图像或对raw图像进行过白平衡处理后的图像)时,可通过摄像头采集第一标准色卡在不同光照下的样本RGB图像,其中,第一样本原始图像与样本RGB图像一一对应,即第一样本原始图像和样本RGB图像均为采集的第一标准色卡在同一光照下的图像。又示例性的,通过摄像头采集至少两个拍摄场景在不同光照下的第一样本原始图像(raw图像或对raw图像进行过白平衡处理后的图像)时,可通过摄像头采集至少两个拍摄场景在不同光照下 的样本RGB图像,其中,第一样本原始图像与样本RGB图像一一对应,即第一样本原始图像和样本RGB图像均为采集的同一拍摄场景在同一光照下的图像。
在对第一样本原始图像进行颜色校正时,以与第一样本原始图像对应的样本RGB图像为参考图像,可实现对第一样本原始图像较好的颜色校正效果。示例性的,将第一样本原始图像输入至ISP工具中,以样本RGB图像作为参考图像,手动对第一样本原始图像进行颜色校正,直至颜色校正后的图像与样本RGB图像差别不是很大时,可认为将第一样本原始图像调节至颜色校正效果较好的图像。
步骤203、将所述第一样本原始图像和所述第一样本目标图像作为第一训练样本集。
将第一样本原始图像及与第一样本原始图像对应的第一样本目标图像作为图像颜色校正模型的训练样本集,即第一训练样本集。
步骤204、利用所述第一训练样本集对第一预设机器学习模型进行训练,得到图像颜色校正模型。
示例性的,利用第一训练样本集对第一预设机器学习模型进行训练,生成图像颜色校正模型。其中,第一预设机器学习模型可以包括卷积神经网络模型或长短时记忆网络模型等机器学习模型,还可以包括朴素贝叶斯模型。需要说明的是,本申请实施例对第一预设机器学习模型不做限定。
步骤205、获取待处理的原始图像。
步骤206、将所述原始图像输入至预先训练的图像颜色校正模型中。
步骤207、确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
其中,在获取待处理的原始图像之前,获取图像颜色校正模型。需要说明的是,可以是移动终端获取上述第一训练样本集,利用第一训练样本集对第一预设机器学习模型进行训练,直接生成图像颜色校正模型。还可以是移动终端直接调用其他移动终端训练生成的图像颜色校正模型,例如,在出厂前利用一个移动终端获取第一训练样本集并生成图像颜色校正模型,然后将该图像颜色校正模型存储到与其他移动终端中,供其他移动终端直接使用。或者,服务器获取大量的第一样本原始图像及对第一样本原始图像进行颜色校正后的第一样本目标图像,得到第一训练样本集。服务器对基于第一预设机器学习模型对第一训练样本集进行训练,得到图像颜色校正模型。当移动终端需要进行图像颜色校正时,从服务器调用已训练好的图像颜色校正模型。
本申请实施例提供的图像颜色校正方法,获取待处理的原始图像,并将所述原始图像输入至预先训练的图像颜色校正模型中,然后确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像,其中,图像颜色校正模型是基于第一样本原始图像及对第一样本原始图像进行颜色校正后的第一样本目标图像进行训练生成的。通过采用上述技术方案,可以有效利用不同光照下采集的第一标准色卡的第一样本原 始图像,或者不同光照下采集的至少两个拍摄场景的第一样本原始图像,及对第一样本原始图像进行颜色校正后的第一样本目标图像,进行图像颜色校正模型的训练学习,可以有效提高图像颜色校正模型的精确性,同时利用图像颜色校正模型可准确、快速地对待处理的原始图像进行颜色校正,能够有效提高图像质量。
图3为本申请实施例提供的图像颜色校正方法的流程示意图,如图3所示,该方法包括:
步骤301、通过摄像头采集第一标准色卡在不同光照下的第一样本原始图像;其中,所述第一标准色卡为彩色色卡;或者通过摄像头采集至少两个拍摄场景在不同光照下的第一样本原始图像。
步骤302、对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像。
步骤303、将所述第一样本原始图像和所述第一样本目标图像作为第一训练样本集。
步骤304、利用所述第一训练样本集对第一预设机器学习模型进行训练,得到图像颜色校正模型。
步骤305、获取待处理的原始图像。
示例性的,待处理的原始图像包括摄像头采集的raw图像。或者,待处理的原始图像包括需要进行颜色校正的图像,但是为了达到更好的颜色校正效果,需要对该原始图像预先进行白平衡处理。
步骤306、将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中。
在本申请实施例中,白平衡系数矩阵确定模型可以理解为在输入待处理的原始图像后,快速确定与该待处理的原始图像对应的白平衡系数矩阵的学习模型。白平衡系数矩阵确定模型可以是对采集的第二样本原始图像及对应的样本白平衡系数矩阵进行训练生成的学习模型,其中,样本白平衡系数矩阵包括将样本原始图像调整到最好效果的白平衡处理图像时的矩阵。可以理解的是,通过对第二样本原始图像及对应的样本白平衡系数矩阵,及两者间的对应关系进行学习,可以生成白平衡系数矩阵确定模型。
步骤307、根据所述白平衡系数矩阵确定模型的输出结果,确定与所述原始图像对应的白平衡系数矩阵。
示例性的,将待处理的原始图像输入至白平衡系数矩阵确定模型后,白平衡系数矩阵确定模型对该原始图像进行分析,并根据分析结果确定与待处理的原始图像对应的白平衡系数矩阵。
步骤308、根据所述白平衡系数矩阵对所述原始图像进行白平衡处理。
示例性的,基于白平衡系数矩阵对待处理的原始图像进行白平衡处理,例如,可将原始图像与白平衡系数矩阵的乘积作为对原始图像进行白平衡处理后的图像。
可选的,根据所述白平衡系数矩阵对所述原始图像进行白平衡处理,包括:获取所述 原始图像中每个像素点的第一RGB分量值;针对所述原始图像中所有像素点,将每个像素点的第一RGB分量值与所述白平衡系数矩阵中对应位置的白平衡系数的乘积,作为与原始图像所述像素点对应的目标图像的像素点的第二RGB分量值。这样设置的好处在于,可针对待处理的原始图像中每个像素点确定一个独立的白平衡系数,并基于白平衡系数矩阵对原始图像中每个像素点进行白平衡处理,可以解决基于全局白平衡算法进行白平衡处理时,容易导致纯色物体的颜色偏差较大,混合色温下无法准确地检测出白色区块的技术问题,能够有效提高图像的质量,增加图像的饱和度。
示例性的,获取原始图像中每个像素点的第一RGB分量值,并针对原始图像中所有的像素点,将每个像素点的第一RGB分量值乘以与白平衡系数矩阵中对应位置的白平衡系数,并将乘积后的结果作为与原始图像所述像素点对应的目标图像像素点的第二RGB分量值,即将乘积后的结果作为对原始图像进行白平衡处理后的像素点的第二RGB分量值。示例性的,获取原始图像中第一个像素点(原始图像中第一行第一列的像素点)的第一RGB分量值,则将白平衡系数矩阵中第一行第一列的白平衡系数与该第一个像素点的第一RGB分量值的乘积,作为对原始图像进行白平衡处理后的图像中的第一个像素点(白平衡处理后的图像中第一行第一列的像素点)的第二RGB分量值。依次类推,基于白平衡系数矩阵,对原始图像中每个像素点做类似的处理操作,从而得到对原始图像进行白平衡处理后的图像。
步骤309、将经白平衡处理后的原始图像输入至预先训练的图像颜色校正模型中。
在本申请实施例中,将经白平衡处理后的原始图像输入至图像颜色校正模型中,使图像颜色校正模型对该图像进行分析,以进行颜色校正。
步骤310、确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
步骤311、对所述目标图像进行Gamma校正,并输出Gamma校正后的目标图像。
本申请实施例提供的图像颜色校正方法,获取待处理的原始图像,将原始图像输入至预先训练的白平衡系数矩阵确定模型中,并根据白平衡系数矩阵确定模型的输出结果,确定与原始图像对应的白平衡系数矩阵,然后根据白平衡系数矩阵对原始图像进行白平衡处理,将经白平衡处理后的原始图像输入至预先训练的图像颜色校正模型中,并确定图像颜色校正模型的输出图像,将输出图像作为与原始图像对应的目标图像。通过采用上述技术方案,能够利用白平衡系数矩阵确定模型对原始图像进行白平衡处理,并利用图像颜色校正模型对经白平衡处理后的图像进行颜色校正,不仅可以提高原始图像的对比度,还可以提高图像的饱和度,能够有效提高图像质量。
在一些实施例中,在将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中之前,还包括:获取白平衡系数矩阵确定模型;其中,所述白平衡系数矩阵确定模型由如下方式得到:通过摄像头采集第二标准色卡在不同色温下的第二样本原始图像;其中,所述 第二标准色卡为白色色卡;对所述第二样本原始图像进行白平衡处理,得到与所述第二样本原始图像对应的第二样本目标图像;根据所述第二样本原始图像和所述第二样本目标图像,确定将所述第二样本原始图像变化为所述第二样本目标图像对应的样本白平衡系数矩阵;根据所述样本白平衡系数矩阵对所述第二样本原始图像进行标记,得到第二训练样本集;利用所述第二训练样本集对第二预设机器学习模型进行训练,得到白平衡系数矩阵确定模型。
在本申请实施例中,第二标准色卡为白色色卡,通过摄像头采集第二标准色卡在不同色温下的图像,作为第二样本原始图像。示例性的,通过摄像头采集标准色卡在不同色温下的raw图像,作为第二样本原始图像。不同色温可通过人造光源来实现,示例性的,在实验室环境下,通过不同类型的光源营造不同的色温环境。例如,利用蜡烛作为光源可营造出2000k的色温环境,利用高压钠灯作为光源可营造出1950-2250k的色温环境,利用钨丝灯做为光源可营造出2700k的色温环境,利用卤素灯作为光源可营造出3000k的色温环境,利用暖色荧光灯作为光源可营造出4000k-4600k的色温环境等。可通过不同类型的光源提供一系列色温值连续的拍摄环境。利用摄像头在不同色温下拍摄第二标准色卡,得到每一色温下的色卡图像,从而获得第二标准色卡在不同色温下的第二样本原始图像。
示例性的,可利用现有白平衡处理方法对第二样本原始图像进行白平衡处理,得到与第二样本原始图像对应的第二样本目标图像。可选的,将第二样本原始图像输入至ISP工具中,手动对第二样本原始图像进行白平衡调节,将调节至白平衡效果最好的图像作为与第二样本原始图像对应的第二样本目标图像。其中,对第二样本原始图像进行白平衡调节时,是否调节至白平衡效果最好的图像可通过人眼的第二直观感觉进行确认,还可以通过图像质量评估标准进行评估,直至获取白平衡效果最好的图像。
在本申请实施例中,根据第二样本原始图像和与第二样本原始图像对应的第二样本目标图像,确定将第二样本原始图像变化为第二样本目标图像时,对应的样本白平衡系数矩阵,即确定对第二样本原始图像进行白平衡处理得到第二样本目标图像时,白平衡处理过程中采用的白平衡系数矩阵。
可选的,根据所述第二样本原始图像和所述第二样本目标图像,确定将所述第二样本原始图像变化为所述第二样本目标图像对应的样本白平衡系数矩阵,包括:获取所述第二样本原始图像中每个像素点的第三RGB分量值及所述第二样本目标图像中每个像素点的第四RGB分量值;针对所有像素点,将每个像素点对应的第四RGB分量值与第三RGB分量值的比值,作为样本白平衡系数矩阵中所述像素点对应的白平衡系数。这样设置的好处在于,可以准确地确定出不同色温环境下对第二标准色卡的原始图像进行白平衡处理时,对应的白平衡系数矩阵。
示例性的,分别获取第二样本原始图像中每个像素点的第三RGB分量值及第二样本目标图像中每个像素点的第四RGB分量值,对于每个像素点,分别计算对应像素点的第四 RGB分量值与第三RGB分量值的比值,并将该比值作为该像素点的白平衡系数矩阵。示例性的,获取第二样本原始图像中第一个像素点(第二样本原始图像中第一行第一列的像素点)的第三RGB分量值,及第二样本目标图像中第一个像素点(第一样本目标图像中第一行第一列的像素点)的第四RGB分量值,并将该第四RGB分量值与该第三RGB分量值的比值,作为白平衡系数矩阵中第一行第一列的白平衡系数。按照上述方式,依次类推,分别确定白平衡系数矩阵中各个元素的白平衡系数。
示例性的,根据得到的每个样本白平衡系数矩阵分别对对应的第二样本原始图像进行标记,并将标记好对应样本白平衡系数矩阵的第二样本原始图像,作为白平衡系数矩阵确定模型的训练样本集,即第二训练样本集。示例性的,利用第二训练样本集对第二预设机器学习模型进行训练,生成白平衡系数矩阵确定模型。其中,第二预设机器学习模型可以包括卷积神经网络模型或长短时记忆网络模型等机器学习模型。本申请实施例对第二预设机器学习模型不做限定,其中,第二预设机器学习模型与第一预设机器学习模型可以相同,也可以不同。
其中,在获取待处理的原始图像之前,获取白平衡系数矩阵确定模型。需要说明的是,可以是移动终端获取上述第二训练样本集,利用第二训练样本集对第二预设机器学习模型进行训练,直接生成白平衡系数矩阵确定模型。还可以是移动终端直接调用其他移动终端训练生成的白平衡系数矩阵确定模型,例如,在出厂前利用一个移动终端获取第二训练样本集并生成白平衡系数矩阵确定模型,然后将该白平衡系数矩阵确定模型存储到与其他移动终端中,供其他移动终端直接使用。或者,服务器获取大量的第二样本原始图像及与第二样本原始图像对应的白平衡系数矩阵,并根据对应的白平衡系数矩阵对第二样本原始图像进行标记,得到第二训练样本集。服务器对基于第二预设机器学习模型对第二训练样本集进行训练,得到白平衡系数矩阵确定模型。当移动终端需要进行图像白平衡处理时,从服务器调用已训练好的白平衡系数矩阵确定模型。
图4为本申请实施例提供的一种图像颜色校正装置的结构示意图,该装置可由软件和/或硬件实现,一般集成在移动终端中,可通过执行图像颜色校正方法来对待处理的原始图像进行颜色校正。如图4所示,该装置包括:
原始图像获取模块401,用于获取待处理的原始图像;
第一原始图像输入模块402,用于将所述原始图像输入至预先训练的图像颜色校正模型中;
目标图像确定模块403,用于确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
本申请实施例中提供的图像颜色校正装置,获取待处理的原始图像;将所述原始图像输入至预先训练的图像颜色校正模型中;确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。通过采用上述技术方案,不仅可以简单、 快速地对原始图像进行颜色校正,而且还可以有针对性对输入的不同的原始图像进行相应的颜色校正,可以有效提高图像的质量,使图像更接近真实色彩。
可选的,所述装置还包括:
颜色校正模型获取模块,用于在获取待处理的原始图像之前,获取所述图像颜色校正模型;
其中,所述图像颜色校正模型由如下方式得到:
通过摄像头采集第一样本原始图像;
对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像;
将所述第一样本原始图像和所述第一样本目标图像作为第一训练样本集;
利用所述第一训练样本集对第一预设机器学习模型进行训练,得到图像颜色校正模型。
可选的,在对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像之前,还包括:
通过摄像头采集与所述第一样本原始图像对应的样本RGB图像;
对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像,包括:
以所述样本RGB图像为参考图像,对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像。
可选的,通过摄像头采集第一样本原始图像,包括:
通过摄像头采集第一标准色卡在不同光照下的第一样本原始图像;其中,所述第一标准色卡为彩色色卡;或者
通过摄像头采集至少两个拍摄场景在不同光照下的第一样本原始图像。
可选的,所述装置还包括:
第二原始图像输入模块,用于在将所述原始图像输入至预先训练的图像颜色校正模型中之前,将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中;
白平衡系数矩阵确定模块,用于根据所述白平衡系数矩阵确定模型的输出结果,确定与所述原始图像对应的白平衡系数矩阵;
白平衡处理模块,用于根据所述白平衡系数矩阵对所述原始图像进行白平衡处理;
所述第一原始图像输入模块,用于:
将经白平衡处理后的原始图像输入至预先训练的图像颜色校正模型中。
可选的,所述装置还包括:
系数矩阵确定模型获取模块,用于在将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中之前,获取白平衡系数矩阵确定模型;
其中,所述白平衡系数矩阵确定模型由如下方式得到:
通过摄像头采集第二标准色卡在不同色温下的第二样本原始图像;其中,所述第二标准色卡为白色色卡;
对所述第二样本原始图像进行白平衡处理,得到与所述第二样本原始图像对应的第二样本目标图像;
根据所述第二样本原始图像和所述第二样本目标图像,确定将所述第二样本原始图像变化为所述第二样本目标图像对应的样本白平衡系数矩阵;
根据所述样本白平衡系数矩阵对所述第二样本原始图像进行标记,得到第二训练样本集;
利用所述第二训练样本集对第二预设机器学习模型进行训练,得到白平衡系数矩阵确定模型。
可选的,所述装置还包括:
Gamma校正模块,用于在将所述输出图像作为与所述原始图像对应的目标图像之后,对所述目标图像进行Gamma校正,并输出Gamma校正后的目标图像。
本申请实施例还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行图像颜色校正方法,该方法包括:
获取待处理的原始图像;
将所述原始图像输入至预先训练的图像颜色校正模型中;
确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
存储介质——任何的各种类型的存储器设备或存储设备。术语“存储介质”旨在包括:安装介质,例如CD-ROM、软盘或磁带装置;计算机系统存储器或随机存取存储器,诸如DRAM、DDRRAM、SRAM、EDORAM,兰巴斯(Rambus)RAM等;非易失性存储器,诸如闪存、磁介质(例如硬盘或光存储);寄存器或其它相似类型的存储器元件等。存储介质可以还包括其它类型的存储器或其组合。另外,存储介质可以位于程序在其中被执行的第一计算机系统中,或者可以位于不同的第二计算机系统中,第二计算机系统通过网络(诸如因特网)连接到第一计算机系统。第二计算机系统可以提供程序指令给第一计算机用于执行。术语“存储介质”可以包括可以驻留在不同位置中(例如在通过网络连接的不同计算机系统中)的两个或更多存储介质。存储介质可以存储可由一个或多个处理器执行的程序指令(例如具体实现为计算机程序)。
当然,本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的图像颜色校正操作,还可以执行本申请任意实施例所提供的图像颜色校正方法中的相关操作。
本申请实施例提供了一种移动终端,该移动终端中可集成本申请实施例提供的图像颜色校正装置。图5为本申请实施例提供的一种移动终端的结构示意图。移动终端500可以 包括:存储器501,处理器502及存储在存储器上并可在处理器运行的计算机程序,所述处理器502执行所述计算机程序时实现如本申请实施例所述的图像颜色校正方法。
本申请实施例提供的移动终端,不仅可以简单、快速地对原始图像进行颜色校正,而且还可以有针对性对输入的不同的原始图像进行相应的颜色校正,可以有效提高图像的质量,使图像更接近真实色彩。
图6为本申请实施例提供的另一种移动终端的结构示意图,该移动终端可以包括:壳体(图中未示出)、存储器601、中央处理器(central processing unit,CPU)602(又称处理器,以下简称CPU)、电路板(图中未示出)和电源电路(图中未示出)。所述电路板安置在所述壳体围成的空间内部;所述CPU602和所述存储器601设置在所述电路板上;所述电源电路,用于为所述移动终端的各个电路或器件供电;所述存储器601,用于存储可执行程序代码;所述CPU602通过读取所述存储器601中存储的可执行程序代码来运行与所述可执行程序代码对应的计算机程序,以实现以下步骤:
获取待处理的原始图像;
将所述原始图像输入至预先训练的图像颜色校正模型中;
确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
所述移动终端还包括:外设接口603、RF(Radio Frequency,射频)电路605、音频电路606、扬声器611、电源管理芯片608、输入/输出(I/O)子系统609、其他输入/控制设备610、触摸屏612、其他输入/控制设备610以及外部端口604,这些部件通过一个或多个通信总线或信号线607来通信。
应该理解的是,图示移动终端600仅仅是移动终端的一个范例,并且移动终端600可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。
下面就本实施例提供的用于图像颜色校正的移动终端进行详细的描述,该移动终端以手机为例。
存储器601,所述存储器601可以被CPU602、外设接口603等访问,所述存储器601可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
外设接口603,所述外设接口603可以将设备的输入和输出外设连接到CPU602和存储器601。
I/O子系统609,所述I/O子系统609可以将设备上的输入输出外设,例如触摸屏612和其他输入/控制设备610,连接到外设接口603。I/O子系统609可以包括显示控制器6091和用于控制其他输入/控制设备610的一个或多个输入控制器6092。其中,一个或多个输入 控制器6092从其他输入/控制设备610接收电信号或者向其他输入/控制设备610发送电信号,其他输入/控制设备610可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。值得说明的是,输入控制器6092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。
触摸屏612,所述触摸屏612是用户移动终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标、视频等。
I/O子系统609中的显示控制器6091从触摸屏612接收电信号或者向触摸屏612发送电信号。触摸屏612检测触摸屏上的接触,显示控制器6091将检测到的接触转换为与显示在触摸屏612上的用户界面对象的交互,即实现人机交互,显示在触摸屏612上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。值得说明的是,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。
RF电路605,主要用于建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。具体地,RF电路605接收并发送RF信号,RF信号也称为电磁信号,RF电路605将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路605可以包括用于执行这些功能的已知电路,其包括但不限于天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、CODEC(COder-DECoder,编译码器)芯片组、用户标识模块(Subscriber Identity Module,SIM)等等。
音频电路606,主要用于从外设接口603接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器611。
扬声器611,用于将手机通过RF电路605从无线网络接收的语音信号,还原为声音并向用户播放该声音。
电源管理芯片608,用于为CPU602、I/O子系统及外设接口所连接的硬件进行供电及电源管理。
上述实施例中提供的图像颜色校正装置、存储介质及移动终端可执行本申请任意实施例所提供的图像颜色校正方法,具备执行该方法相应的功能模块和有益效果。未在上述实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的图像颜色校正方法。
注意,上述仅为本申请的较佳实施例及所运用技术原理。本领域技术人员会理解,本申请不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本申请的保护范围。因此,虽然通过以上实施例对本申请进行了较为详细的说明,但是本申请不仅仅限于以上实施例,在不脱离本申请构思的情况下,还可以包括更多其他等效实施例,而本申请的范围由所附的权利要求范围决定。

Claims (20)

  1. 一种图像颜色校正方法,其特征在于,包括:
    获取待处理的原始图像;
    将所述原始图像输入至预先训练的图像颜色校正模型中;
    确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
  2. 根据权利要求1所述的方法,其特征在于,在获取待处理的原始图像之前,还包括:
    获取所述图像颜色校正模型;
    其中,所述图像颜色校正模型由如下方式得到:
    通过摄像头采集第一样本原始图像;
    对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像;
    将所述第一样本原始图像和所述第一样本目标图像作为第一训练样本集;
    利用所述第一训练样本集对第一预设机器学习模型进行训练,得到图像颜色校正模型。
  3. 根据权利要求2所述的方法,其特征在于,在对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像之前,还包括:
    通过摄像头采集与所述第一样本原始图像对应的样本RGB图像;
    对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像,包括:
    以所述样本RGB图像为参考图像,对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像。
  4. 根据权利要求2所述的方法,其特征在于,通过摄像头采集第一样本原始图像,包括:
    通过摄像头采集第一标准色卡在不同光照下的第一样本原始图像;其中,所述第一标准色卡为彩色色卡。
  5. 根据权利要求2所述的方法,其特征在于,通过摄像头采集第一样本原始图像,还包括:
    通过摄像头采集至少两个拍摄场景在不同光照下的第一样本原始图像。
  6. 根据权利要求1所述的方法,其特征在于,在将所述原始图像输入至预先训练的图像颜色校正模型中之前,还包括:
    将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中;
    根据所述白平衡系数矩阵确定模型的输出结果,确定与所述原始图像对应的白平衡系数矩阵;
    根据所述白平衡系数矩阵对所述原始图像进行白平衡处理;
    所述将所述原始图像输入至预先训练的图像颜色校正模型中,包括:
    将经白平衡处理后的原始图像输入至预先训练的图像颜色校正模型中。
  7. 根据权利要求6所述的方法,其特征在于,在将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中之前,还包括:
    获取白平衡系数矩阵确定模型;
    其中,所述白平衡系数矩阵确定模型由如下方式得到:
    通过摄像头采集第二标准色卡在不同色温下的第二样本原始图像;其中,所述第二标准色卡为白色色卡;
    对所述第二样本原始图像进行白平衡处理,得到与所述第二样本原始图像对应的第二样本目标图像;
    根据所述第二样本原始图像和所述第二样本目标图像,确定将所述第二样本原始图像变化为所述第二样本目标图像对应的样本白平衡系数矩阵;
    根据所述样本白平衡系数矩阵对所述第二样本原始图像进行标记,得到第二训练样本集;
    利用所述第二训练样本集对第二预设机器学习模型进行训练,得到白平衡系数矩阵确定模型。
  8. 根据权利要求6所述的方法,其特征在于,根据所述白平衡系数矩阵对所述原始图像进行白平衡处理,包括:
    获取所述原始图像中每个像素点的第一RGB分量值;
    针对所述原始图像中所有像素点,将每个像素点的第一RGB分量值与所述白平衡系数矩阵中对应位置的白平衡系数的乘积,作为与原始图像所述像素点对应的目标图像的像素点的第二RGB分量值。
  9. 根据权利要求1所述的方法,其特征在于,在将所述输出图像作为与所述原始图像对应的目标图像之后,还包括:
    对所述目标图像进行Gamma校正,并输出Gamma校正后的目标图像。
  10. 一种图像颜色校正装置,其特征在于,包括:
    原始图像获取模块,用于获取待处理的原始图像;
    第一原始图像输入模块,用于将所述原始图像输入至预先训练的图像颜色校正模型中;
    目标图像确定模块,用于确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
  11. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现:
    获取待处理的原始图像;
    将所述原始图像输入至预先训练的图像颜色校正模型中;
    确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
  12. 一种移动终端,其特征在于,包括存储器,处理器及存储在存储器上并可在处理器运行的计算机程序,所述处理器执行所述计算机程序时实现:
    获取待处理的原始图像;
    将所述原始图像输入至预先训练的图像颜色校正模型中;
    确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。
  13. 根据权利要求12所述的移动终端,其特征在于,在获取待处理的原始图像之前,所述处理器还执行:
    通过摄像头采集第一样本原始图像;
    对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像;
    将所述第一样本原始图像和所述第一样本目标图像作为第一训练样本集;
    利用所述第一训练样本集对第一预设机器学习模型进行训练,得到图像颜色校正模型。
  14. 根据权利要求13所述的移动终端,其特征在于,在对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像之前,所述处理器还执行:
    通过摄像头采集与所述第一样本原始图像对应的样本RGB图像;
    而在对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像时,所述处理器用于执行:
    以所述样本RGB图像为参考图像,对所述第一样本原始图像进行颜色校正,得到与所 述第一样本原始图像对应的第一样本目标图像。
  15. 根据权利要求13所述的移动终端,其特征在于,在通过摄像头采集第一样本原始图像时,所述处理器用于执行:
    通过摄像头采集第一标准色卡在不同光照下的第一样本原始图像;其中,所述第一标准色卡为彩色色卡。
  16. 根据权利要求13所述的移动终端,其特征在于,在通过摄像头采集第一样本原始图像时,所述处理器还用于执行:
    通过摄像头采集至少两个拍摄场景在不同光照下的第一样本原始图像。
  17. 根据权利要求12所述的移动终端,其特征在于,在将所述原始图像输入至预先训练的图像颜色校正模型中之前,所述处理器还用于执行:
    将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中;
    根据所述白平衡系数矩阵确定模型的输出结果,确定与所述原始图像对应的白平衡系数矩阵;
    根据所述白平衡系数矩阵对所述原始图像进行白平衡处理;
    而在将所述原始图像输入至预先训练的图像颜色校正模型中时,所述处理器用于执行:
    将经白平衡处理后的原始图像输入至预先训练的图像颜色校正模型中。
  18. 根据权利要求17所述的移动终端,其特征在于,在将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中之前,所述处理器还用于执行:
    通过摄像头采集第二标准色卡在不同色温下的第二样本原始图像;其中,所述第二标准色卡为白色色卡;
    对所述第二样本原始图像进行白平衡处理,得到与所述第二样本原始图像对应的第二样本目标图像;
    根据所述第二样本原始图像和所述第二样本目标图像,确定将所述第二样本原始图像变化为所述第二样本目标图像对应的样本白平衡系数矩阵;
    根据所述样本白平衡系数矩阵对所述第二样本原始图像进行标记,得到第二训练样本集;
    利用所述第二训练样本集对第二预设机器学习模型进行训练,得到白平衡系数矩阵确定模型。
  19. 根据权利要求17所述的移动终端,其特征在于,在根据所述白平衡系数矩阵对所述原始图像进行白平衡处理时,所述处理器用于执行:
    获取所述原始图像中每个像素点的第一RGB分量值;
    针对所述原始图像中所有像素点,将每个像素点的第一RGB分量值与所述白平衡系数矩阵中对应位置的白平衡系数的乘积,作为与原始图像所述像素点对应的目标图像的像素点的第二RGB分量值。
  20. 根据权利要求12所述的移动终端,其特征在于,在将所述输出图像作为与所述原始图像对应的目标图像之后,所述处理器还用于执行:
    对所述目标图像进行Gamma校正,并输出Gamma校正后的目标图像。
PCT/CN2019/107580 2018-11-19 2019-09-24 图像颜色校正方法、装置、存储介质及移动终端 WO2020103570A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811377864.XA CN109523485B (zh) 2018-11-19 2018-11-19 图像颜色校正方法、装置、存储介质及移动终端
CN201811377864.X 2018-11-19

Publications (1)

Publication Number Publication Date
WO2020103570A1 true WO2020103570A1 (zh) 2020-05-28

Family

ID=65777998

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/107580 WO2020103570A1 (zh) 2018-11-19 2019-09-24 图像颜色校正方法、装置、存储介质及移动终端

Country Status (2)

Country Link
CN (1) CN109523485B (zh)
WO (1) WO2020103570A1 (zh)

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109523485B (zh) * 2018-11-19 2021-03-02 Oppo广东移动通信有限公司 图像颜色校正方法、装置、存储介质及移动终端
CN110211065B (zh) * 2019-05-23 2023-10-20 九阳股份有限公司 一种食材图像的颜色校正方法和装置
CN110428377B (zh) * 2019-07-26 2023-06-30 北京康夫子健康技术有限公司 数据扩充方法、装置、设备和介质
CN110796642A (zh) * 2019-10-09 2020-02-14 陈浩能 水果品质程度确定方法及相关产品
CN110827317B (zh) * 2019-11-04 2023-05-12 西安邮电大学 一种基于fpga的四目运动目标检测与识别设备及方法
CN111064963A (zh) * 2019-11-11 2020-04-24 北京迈格威科技有限公司 图像数据解码方法、装置、计算机设备和存储介质
WO2021114184A1 (zh) * 2019-12-12 2021-06-17 华为技术有限公司 神经网络模型的训练方法、图像处理方法及其装置
CN111461996B (zh) * 2020-03-06 2023-08-29 合肥师范学院 一种图像快速智能调色方法
CN111476731B (zh) * 2020-04-01 2023-06-27 Oppo广东移动通信有限公司 图像矫正方法、装置、存储介质及电子设备
CN111681201B (zh) * 2020-04-20 2023-06-23 深圳市鸿富瀚科技股份有限公司 图像处理方法、装置、计算机设备及存储介质
CN111898449B (zh) * 2020-06-30 2023-04-18 北京大学 一种基于监控视频的行人属性识别方法和系统
CN111930987B (zh) * 2020-08-11 2023-12-26 复旦大学 一种基于机器视觉颜色识别的智慧城域定位方法及系统
CN112164005B (zh) * 2020-09-24 2023-03-17 Oppo(重庆)智能科技有限公司 图像颜色校正方法、装置、设备及存储介质
CN112752023B (zh) * 2020-12-29 2022-07-15 深圳市天视通视觉有限公司 一种图像调整方法、装置、电子设备及存储介质
CN113516132B (zh) * 2021-03-25 2024-05-03 杭州博联智能科技股份有限公司 基于机器学习的颜色校准方法、装置、设备及介质
CN112884693A (zh) * 2021-03-25 2021-06-01 维沃移动通信(深圳)有限公司 图像处理模型的训练方法和装置、白平衡处理方法和装置
CN113298726A (zh) * 2021-05-14 2021-08-24 漳州万利达科技有限公司 一种图像显示调整方法、装置、显示设备和存储介质
CN113506332B (zh) * 2021-09-09 2021-12-17 北京的卢深视科技有限公司 目标对象识别的方法、电子设备及存储介质
CN115835034B (zh) * 2021-09-15 2024-04-05 荣耀终端有限公司 白平衡处理方法与电子设备
CN117716384A (zh) * 2022-06-30 2024-03-15 京东方科技集团股份有限公司 色彩校正模型的生成方法、校正方法及装置、介质、设备
CN115460391B (zh) * 2022-09-13 2024-04-16 浙江大华技术股份有限公司 图像的模拟方法、装置、存储介质及电子装置
CN116668656B (zh) * 2023-07-24 2023-11-21 荣耀终端有限公司 图像处理方法及电子设备
CN116721038A (zh) * 2023-08-07 2023-09-08 荣耀终端有限公司 颜色修正方法、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1945627A (zh) * 2006-10-20 2007-04-11 清华大学 数字舌象色偏校正方法
US20120127326A1 (en) * 2010-11-23 2012-05-24 Hon Hai Precision Industry Co., Ltd. Image optimization system and method for optimizing images
CN103905803A (zh) * 2014-03-18 2014-07-02 中国科学院国家天文台 一种图像的颜色校正方法及装置
CN108712639A (zh) * 2018-05-29 2018-10-26 凌云光技术集团有限责任公司 图像颜色校正方法、装置及系统
CN109523485A (zh) * 2018-11-19 2019-03-26 Oppo广东移动通信有限公司 图像颜色校正方法、装置、存储介质及移动终端

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101678691B1 (ko) * 2010-05-12 2016-11-23 삼성전자주식회사 광원의 특성을 이용한 이미지 처리 장치 및 방법
CN102244790A (zh) * 2011-06-27 2011-11-16 展讯通信(上海)有限公司 图像信号处理器配套参数的自适应调整装置及方法
CN103839236A (zh) * 2014-02-25 2014-06-04 中国科学院自动化研究所 一种基于稀疏表示的图像白平衡方法
CN106651795A (zh) * 2016-12-03 2017-05-10 北京联合大学 一种利用光照估计来校正图像颜色的方法
CN107613192A (zh) * 2017-08-09 2018-01-19 深圳市巨龙创视科技有限公司 一种基于摄像机模组的数字图像处理算法
CN108600723A (zh) * 2018-07-20 2018-09-28 长沙全度影像科技有限公司 一种全景相机的颜色校正方法及评价方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1945627A (zh) * 2006-10-20 2007-04-11 清华大学 数字舌象色偏校正方法
US20120127326A1 (en) * 2010-11-23 2012-05-24 Hon Hai Precision Industry Co., Ltd. Image optimization system and method for optimizing images
CN103905803A (zh) * 2014-03-18 2014-07-02 中国科学院国家天文台 一种图像的颜色校正方法及装置
CN108712639A (zh) * 2018-05-29 2018-10-26 凌云光技术集团有限责任公司 图像颜色校正方法、装置及系统
CN109523485A (zh) * 2018-11-19 2019-03-26 Oppo广东移动通信有限公司 图像颜色校正方法、装置、存储介质及移动终端

Also Published As

Publication number Publication date
CN109523485A (zh) 2019-03-26
CN109523485B (zh) 2021-03-02

Similar Documents

Publication Publication Date Title
WO2020103570A1 (zh) 图像颜色校正方法、装置、存储介质及移动终端
WO2019109801A1 (zh) 拍摄参数的调整方法、装置、存储介质及移动终端
CN109547701B (zh) 图像拍摄方法、装置、存储介质及电子设备
US11138700B2 (en) Method for image processing, non-transitory computer readable medium, and electronic device
CN109685746B (zh) 图像亮度调整方法、装置、存储介质及终端
CN108307125B (zh) 一种图像采集方法、装置和存储介质
US11245933B2 (en) Method and server for generating image data by using multiple cameras
CN109741281B (zh) 图像处理方法、装置、存储介质及终端
US20210136297A1 (en) Method for providing preview and electronic device for displaying preview
US10298899B2 (en) Image processing device, imaging device, image processing method, and program
KR102524982B1 (ko) 흐림 처리가 수행된 이미지에 노이즈 패턴을 반영하는 방법 및 장치
US11102409B2 (en) Electronic device and method for obtaining images
US11563889B2 (en) Electronic device and method for controlling camera using external electronic device
US11416974B2 (en) Image processing method and electronic device supporting the same
CN109348206A (zh) 图像白平衡处理方法、装置、存储介质及移动终端
CN113544734A (zh) 用于通过使用红外传感器调整图像数据的颜色的电子装置和方法
CN111372002B (zh) 一种显示处理方法及电子设备
US10447998B2 (en) Power efficient long range depth sensing
CN109040729B (zh) 图像白平衡校正方法、装置、存储介质及终端
KR20200092135A (ko) 카메라 모듈에 접지 노드를 연결하기 위한 전자 장치 및 방법
KR20190030946A (ko) 복수의 이미지 센서들을 제어하기 위한 전자 장치 및 방법
CN112905141A (zh) 屏幕显示方法及装置、计算机存储介质
KR20210151613A (ko) 이미지 처리 장치 및 이미지 처리 방법
KR20210101571A (ko) 이미지의 생성 방법 및 그 전자 장치
KR20210144151A (ko) Awb를 수행하여 이미지를 생성하는 전자 장치 및 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19886256

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19886256

Country of ref document: EP

Kind code of ref document: A1