WO2020103570A1 - Image color correction method, device, storage medium and mobile terminal - Google Patents

Image color correction method, device, storage medium and mobile terminal

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
French (fr)
Chinese (zh)
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/en

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

An image color correction method, device, storage medium and mobile terminal. The method comprises: acquiring an original image to be processed (101); inputting the original image into a pre-trained image color correction model (102); determining an output image of the image color correction model, and using the output image as a target image corresponding to the original image (103).

Description

图像颜色校正方法、装置、存储介质及移动终端Image color correction method, device, storage medium and mobile terminal
本申请要求于2018年11月19日提交中国专利局、申请号为201811377864.X、发明名称为“图像颜色校正方法、装置、存储介质及移动终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application submitted to the China Patent Office on November 19, 2018, with the application number 201811377864.X and the invention titled "Image color correction method, device, storage medium and mobile terminal" Incorporated by reference in this application.
技术领域Technical field
本申请实施例涉及图像处理技术领域,尤其涉及图像颜色校正方法、装置、存储介质及移动终端。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.
背景技术Background technique
随着移动终端的快速发展,对通过移动终端摄像头拍摄的图像的质量要求也越来越高。然而,摄像头采集的图像颜色与采集环境息息相关,在不同的采集环境下,对同一个采集目标采集的得到的图像颜色是不同的。采集环境的光照以及摄像头的图像传感器的RGB三分量,对不同颜色物体的响应都会影响最终的成像颜色,因此,在实际应用中,需要对摄像头采集的图像的颜色进行校正,以还原出采集目标的真实颜色。因此,有效的颜色校正方式对摄像头拍摄图像的效果好坏变得至关重要。With the rapid development of mobile terminals, the requirements for the quality of images taken through the camera of the mobile terminal are becoming higher and higher. However, 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.
发明内容Summary of the invention
第一方面,本申请实施例提供了一种图像颜色校正方法,包括:In a first aspect, an embodiment of the present application provides an image color correction method, including:
获取待处理的原始图像;Get the original image to be processed;
将所述原始图像输入至预先训练的图像颜色校正模型中;Input the original image into a pre-trained image color correction model;
确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。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.
第二方面,本申请实施例提供了一种图像颜色校正装置,包括:In a second aspect, an embodiment of the present application provides 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.
第三方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现:In a third aspect, 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:
获取待处理的原始图像;Get the original image to be processed;
将所述原始图像输入至预先训练的图像颜色校正模型中;Input the original image into a pre-trained image color correction model;
确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。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.
第四方面,本申请实施例提供了一种终端,包括存储器,处理器及存储在存储器上并 可在处理器运行的计算机程序,所述处理器执行所述计算机程序时实现:According to a fourth aspect, 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:
获取待处理的原始图像;Get the original image to be processed;
将所述原始图像输入至预先训练的图像颜色校正模型中;Input the original image into a pre-trained image color correction model;
确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。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.
附图说明BRIEF DESCRIPTION
图1为本申请实施例提供的一种图像颜色校正方法的流程示意图;1 is a schematic flowchart of an image color correction method provided by an embodiment of the present application;
图2为本申请实施例提供的另一种图像颜色校正方法的流程示意图;2 is a schematic flowchart of another image color correction method provided by an embodiment of the present application;
图3为本申请实施例提供的又一种图像颜色校正方法的流程示意图;3 is a schematic flowchart of another image color correction method according to an embodiment of the present application;
图4为本申请实施例提供的一种图像颜色校正装置的结构示意图;4 is a schematic structural diagram of an image color correction device provided by an embodiment of the present application;
图5为本申请实施例提供的一种移动终端的结构示意图;5 is a schematic structural diagram of a mobile terminal according to an embodiment of this application;
图6为本申请实施例提供的另一种移动终端的结构示意图。FIG. 6 is a schematic structural diagram of another mobile terminal according to an embodiment of the present application.
具体实施方式detailed description
下面结合附图并通过具体实施方式来进一步说明本申请的技术方案。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。The technical solution of the present application will be further described below with reference to the drawings and through specific implementations. It can be understood that the specific embodiments described herein are only used to explain the present application, rather than limit the present application. In addition, it should be noted that, for ease of description, the drawings only show parts, but not all structures related to the present application.
在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各步骤描述成顺序的处理,但是其中的许多步骤可以被并行地、并发地或者同时实施。此外,各步骤的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowchart describes the steps as sequential processing, many of the steps can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the steps can be rearranged. The processing may be terminated when its operation is completed, but may also have additional steps not included in the drawings. The processing may correspond to methods, functions, procedures, subroutines, subroutines, and so on.
CCM(Color Correction Matrix,颜色校正矩阵)是对图像进行颜色校正,恢复图像色彩,调整图像风格,提高图像质量的重要手段。传统技术中,主要针对不同场景下的图像使用不同的CCM矩阵,对于图像不同场景的切换容易导致颜色校正后的图像效果突变,使图像调整效果无法保证风格一致,尤其是针对利用摄像机对图像进行预览的阶段,在实际应用中,会大大影响用户体验。基于以上考虑,现提供如下图像颜色校正的方案。CCM (ColorCorrectionMatrix, color correction matrix) is an important means to color correct the image, restore the image color, adjust the image style, and improve the image quality. In the traditional technology, different CCM matrices are mainly used for images in different scenes. Switching between different scenes of the image is easy to cause a sudden change in the image effect after color correction, so that the image adjustment effect cannot guarantee a consistent style, especially for the use of cameras to perform image The preview stage will greatly affect the user experience in practical applications. Based on the above considerations, the following image color correction solutions are now provided.
本申请实施例提供一种图像颜色校正方法,包括:An embodiment of the present application provides an image color correction method, including:
获取待处理的原始图像;Get the original image to be processed;
将所述原始图像输入至预先训练的图像颜色校正模型中;Input the original image into a pre-trained image color correction model;
确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。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.
在一实施例中,在获取待处理的原始图像之前,还包括:In an embodiment, before acquiring the original image to be processed, the method further includes:
获取所述图像颜色校正模型;Acquiring the image color correction model;
其中,所述图像颜色校正模型由如下方式得到:Wherein, the image color correction model is obtained as follows:
通过摄像头采集第一样本原始图像;Collect the first sample original image through the camera;
对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像;Performing color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image;
将所述第一样本原始图像和所述第一样本目标图像作为第一训练样本集;Using the first sample original image and the first sample target image as the first training sample set;
利用所述第一训练样本集对第一预设机器学习模型进行训练,得到图像颜色校正模型。The first preset machine learning model is trained using the first training sample set to obtain an image color correction model.
在一实施例中,在对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像之前,还包括:In an embodiment, 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:
通过摄像头采集与所述第一样本原始图像对应的样本RGB图像;Acquiring a sample RGB image corresponding to the original image of the first sample through a camera;
对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像,包括:Performing color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image includes:
以所述样本RGB图像为参考图像,对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像。Using the sample RGB image as a reference image, color correcting the first sample original image to obtain a first sample target image corresponding to the first sample original image.
在一实施例中,通过摄像头采集第一样本原始图像,包括:In an embodiment, 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.
在一实施例中,通过摄像头采集第一样本原始图像,还包括:In an embodiment, 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.
在一实施例中,在将所述原始图像输入至预先训练的图像颜色校正模型中之前,还包括:In an embodiment, before inputting the original image into the pre-trained image color correction model, the method further includes:
将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中;Input the original image into a pre-trained white balance coefficient matrix determination model;
根据所述白平衡系数矩阵确定模型的输出结果,确定与所述原始图像对应的白平衡系数矩阵;Determining the output result of the model according to the white balance coefficient matrix, and determining the white balance coefficient matrix corresponding to the original image;
根据所述白平衡系数矩阵对所述原始图像进行白平衡处理;Performing white balance processing on the original image according to the white balance coefficient matrix;
所述将所述原始图像输入至预先训练的图像颜色校正模型中,包括: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.
在一实施例中,在将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中之前,还包括:In an embodiment, before inputting the original image into the pre-trained white balance coefficient matrix determination model, the method further includes:
获取白平衡系数矩阵确定模型;Obtain the white balance coefficient matrix to determine the model;
其中,所述白平衡系数矩阵确定模型由如下方式得到:The determination model of the white balance coefficient matrix is obtained as follows:
通过摄像头采集第二标准色卡在不同色温下的第二样本原始图像;其中,所述第二标准色卡为白色色卡;Acquiring a second sample original image of the second standard color card at different color temperatures through a camera; wherein, the second standard color card is a white color card;
对所述第二样本原始图像进行白平衡处理,得到与所述第二样本原始图像对应的第二样本目标图像;Performing white balance processing on the second sample original image to obtain a second sample target image corresponding to the second sample original image;
根据所述第二样本原始图像和所述第二样本目标图像,确定将所述第二样本原始图像 变化为所述第二样本目标图像对应的样本白平衡系数矩阵;Determine, according to the second sample original image and the second sample target image, change the second sample original image to a sample white balance coefficient matrix corresponding to the second sample target image;
根据所述样本白平衡系数矩阵对所述第二样本原始图像进行标记,得到第二训练样本集;Marking the original image of the second sample according to the sample white balance coefficient matrix to obtain a second training sample set;
利用所述第二训练样本集对第二预设机器学习模型进行训练,得到白平衡系数矩阵确定模型。Use the second training sample set to train a second preset machine learning model to obtain a white balance coefficient matrix determination model.
在一实施例中,根据所述白平衡系数矩阵对所述原始图像进行白平衡处理,包括:In an embodiment, performing white balance processing on the original image according to the white balance coefficient matrix includes:
获取所述原始图像中每个像素点的第一RGB分量值;Acquiring the first RGB component value of each pixel in the original image;
针对所述原始图像中所有像素点,将每个像素点的第一RGB分量值与所述白平衡系数矩阵中对应位置的白平衡系数的乘积,作为与原始图像所述像素点对应的目标图像的像素点的第二RGB分量值。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 target image corresponding to the pixel of the original image The second RGB component value of the pixel.
在一实施例中,在将所述输出图像作为与所述原始图像对应的目标图像之后,还包括:In an embodiment, after the output image is used as the target image corresponding to the original image, the method further includes:
对所述目标图像进行Gamma校正,并输出Gamma校正后的目标图像。Gamma correction is performed on the target image, and the target image after gamma correction is output.
图1为本申请实施例提供的图像颜色校正方法的流程示意图,该方法可以由图像颜色校正装置执行,其中该装置可由软件和/或硬件实现,一般可集成在移动终端中。如图1所示,该方法包括: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. As shown in Figure 1, the method includes:
步骤101、获取待处理的原始图像。Step 101: Acquire an original image to be processed.
示例性的,本申请实施例中的移动终端可包括手机、平板电脑及摄像机等具有拍照功能的移动设备。Exemplarily, 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.
在本申请实施例中,当检测到移动终端的摄像头处于打开状态时,即当检测到移动终端的摄像头处于拍摄预览状态或拍摄图像时,获取摄像头采集的raw图像,此时,可将摄像头采集的raw图像作为待处理的原始图像。可选的,摄像头采集raw图像,并基于预设白平衡处理算法对raw图像进行白平衡处理,则可将白平衡处理后的raw图像作为待处理的原始图像。可选的,还可获取其他终端设备传输的raw图像或待进行颜色校正的图像,并将其作为待处理的原始图像。当然,也可以直接从移动终端中存储的图像库中,获取需要进行颜色校正的图像,作为待处理的原始图像。需要说明的是,本申请实施例对待处理的原始图像的来源或获取方式,不做限定。In the embodiment of the present application, when it is detected that the camera of the mobile terminal is in an open state, that is, when it is detected that the camera of the mobile terminal is in a preview state or an image is captured, the raw image collected by the camera is acquired. The raw image is used as the original image to be processed. Optionally, if 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. Optionally, 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. Of course, 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.
可选的,当检测到图像颜色校正事件被触发时,获取待处理的原始图像。可以理解的是,为了在合适的时机对图像进行颜色校正,可预先设置图像颜色校正事件的触发条件。示例性的,为了满足用户对采集图像的视觉需求,可在检测到摄像头处于开启状态时,触发图像颜色校正事件。可选的,当用户对移动终端中某图像的对比度不满意时,可在检测到用户主动打开图像颜色校正权限时,触发图像颜色校正事件。可选的,为了使图像颜色校正应用于更有价值的应用时机,以节省图像颜色校正所带来的额外功耗,可对图像颜色校正的应用时机和应用场景进行分析或调研等,设置合理的预设场景,在检测移动终端处于预设场景时,触发图像颜色校正事件。需要说明的是,本申请实施例对图像颜色校正事 件被触发的具体表现形式不做限定。Optionally, when it is detected that the image color correction event is triggered, the original image to be processed is acquired. It can be understood that, in order to perform color correction on the image at an appropriate timing, the trigger condition of the image color correction event may be set in advance. Exemplarily, in order to meet the user's visual requirements for the collected image, an image color correction event may be triggered when it is detected that the camera is in the on state. Optionally, when the user is not satisfied with the contrast of an image in the mobile terminal, an image color correction event may be triggered when it is detected that the user actively opens the image color correction authority. Optionally, in order to apply the image color correction to more valuable application opportunities to save the additional power consumption caused by the image color correction, the application timing and application scenarios of the image color correction can be analyzed or investigated, etc., and the settings are reasonable , 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.
步骤102、将所述原始图像输入至预先训练的图像颜色校正模型中。Step 102: Input the original image into a pre-trained image color correction model.
在本申请实施例中,图像颜色校正模型可以理解为输入待处理的原始图像后,快速确定与该待处理的原始图像对应的目标图像的学习模型,其中,与该待处理的原始图像对应的目标图像为对原始图像进行图像颜色校正后的图像。图像颜色校正模型可以是对采集的样本原始图像及将样本原始图像调整到最好效果的图像颜色校正图像,进行训练生成的学习模型。可以理解的是,通过对样本原始图像及将样本原始图像调整到最好效果的图像颜色校正图像,及两者间的对应关系进行学习,可以生成图像颜色校正模型。图像颜色校正模型是端对端的学习模型,即输入及输出均为图像的学习模型。In the embodiment of the present application, 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.
步骤103、确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。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.
示例性的,将待处理的原始图像输入至图像颜色校正模型后,图像颜色校正模型对所述待处理的原始图像进行分析,并根据分析结果对该原始图像进行颜色校正,得到对原始图像进行颜色校正后的目标图像,并输出。可以理解的是,将待处理的原始图像输入图像颜色校正模型后,图像颜色校正模型经分析后,直接输出图像,则可将该输出图像作为与原始图像对应的目标图像。即图像颜色校正模型的输出图像为图像颜色校正模型对待处理的原始图像进行颜色校正后的图像,即与原始图像对应的目标图像。Exemplarily, after inputting the original image to be processed into the image color correction model, 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. By adopting the above technical solution, not only can the original image be color-corrected simply and quickly, but also the corresponding color correction of the different input original images can be targeted, which can effectively improve the quality of the image and further enhance the contrast of the image To make the image closer to the true color.
在一些实施例中,在将所述输出图像作为与所述原始图像对应的目标图像之后,还包括:对所述目标图像进行Gamma校正,并输出Gamma校正后的目标图像。示例性的,对原始图像进行颜色校正后得到目标图像,为了进一步增加目标图像的对比度,可进一步对目标图像进行Gamma校正,并输出Gamma校正后的目标图像。这样设置的好处在于,可以对目标图像中的灰暗区域进行颜色的改善,能够进一步提高图像的对比度,提高图像的质量。In some embodiments, after 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. Exemplarily, the target image is obtained after color correction is performed on the original image. In order to further increase the contrast of the target 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.
图2为本申请实施例提供的图像颜色校正方法的流程示意图,如图2所示,该方法包括: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:
步骤201、通过摄像头采集第一样本原始图像。Step 201: Collect the first sample original image through the camera.
可选的,通过摄像头采集第一样本原始图像,包括:通过摄像头采集第一标准色卡在不同光照下的第一样本原始图像;其中,所述第一标准色卡为彩色色卡;或者通过摄像头 采集至少两个拍摄场景在不同光照下的第一样本原始图像。Optionally, 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.
示例性的,第一标准色卡为彩色色卡,例如第一标准色卡可以为具有24个不同颜色的纯色块的标准色卡,则通过摄像头采集第一标准色卡在不同光照下的图像,作为第一样本原始图像。示例性的,通过摄像头采集第一标准色卡在不同色温下的raw图像,并基于预设白平衡处理算法对raw图像进行白平衡处理,则可将白平衡处理后的raw图像作为第一样本原始图像。Exemplarily, the first standard color card is a color color card, for example, 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. Exemplarily, 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.
又示例性的,通过摄像头采集至少两个拍摄场景在不同光照下的图像,并将采集的图像作为第一样本原始图像。可选的,至少两个拍摄场景最好包含不同颜色的拍摄对象,使得拍摄场景的色彩丰富。可以理解的是,不同拍摄场景包含了不同拍摄对象的不同颜色,则通过摄像头采集至少两个拍摄场景在不同光照下的图像,作为第一样本原始图像,可使得拍摄的第一样本原始图像不仅可以模拟摄像头采集的第一标准色卡在不同光照下的图像,还可以包含更多的场景信息。For another example, 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. Optionally, 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.
步骤202、对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像。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.
在本申请实施例中,可利用现有图像颜色校正方法对第一样本原始图像进行颜色校正,得到与第一样本原始图像对应的第一样本目标图像。可选的,将第一样本原始图像输入至ISP(Image Signal Processor,图像信号处理器)工具中,手动对第一样本原始图像进行颜色校正调节,将调节至颜色校正效果最好的图像作为与第一样本原始图像对应的第一样本目标图像。其中,对第一样本原始图像进行颜色校正调节时,是否调节至颜色校正效果最好的图像可通过人眼的第一直观感觉进行确认,还可以通过图像质量评估标准进行评估,直至获取颜色校正效果最好的图像。In the embodiment of the present application, 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. Optionally, 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. Among them, when performing color correction adjustment on the original image of the first sample, 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.
可选的,在对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像之前,还包括:通过摄像头采集与所述第一样本原始图像对应的样本RGB图像;对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像,包括:以所述样本RGB图像为参考图像,对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像。这样设置的好处在于,可以有效掌控对第一样本原始图像进行颜色校正时的校正尺度,能够简单、快速地完成对第一样本原始图像的颜色校正,且能够达到较好的颜色校正效果。Optionally, 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 .
示例性的,通过摄像头采集第一标准色卡在不同光照下的第一样本原始图像(raw图像或对raw图像进行过白平衡处理后的图像)时,可通过摄像头采集第一标准色卡在不同光照下的样本RGB图像,其中,第一样本原始图像与样本RGB图像一一对应,即第一样本原始图像和样本RGB图像均为采集的第一标准色卡在同一光照下的图像。又示例性的,通过摄像头采集至少两个拍摄场景在不同光照下的第一样本原始图像(raw图像或对raw图像进行过白平衡处理后的图像)时,可通过摄像头采集至少两个拍摄场景在不同光照下 的样本RGB图像,其中,第一样本原始图像与样本RGB图像一一对应,即第一样本原始图像和样本RGB图像均为采集的同一拍摄场景在同一光照下的图像。Exemplarily, when the first sample original image (raw image or the image after the raw image is subjected to white balance processing) of the first standard color card under different illuminations is collected by the camera, 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. Also for example, when 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 .
在对第一样本原始图像进行颜色校正时,以与第一样本原始图像对应的样本RGB图像为参考图像,可实现对第一样本原始图像较好的颜色校正效果。示例性的,将第一样本原始图像输入至ISP工具中,以样本RGB图像作为参考图像,手动对第一样本原始图像进行颜色校正,直至颜色校正后的图像与样本RGB图像差别不是很大时,可认为将第一样本原始图像调节至颜色校正效果较好的图像。When the first sample original image is color-corrected, 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. Exemplarily, 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 When it is large, it can be considered that the original image of the first sample is adjusted to an image with better color correction effect.
步骤203、将所述第一样本原始图像和所述第一样本目标图像作为第一训练样本集。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.
步骤204、利用所述第一训练样本集对第一预设机器学习模型进行训练,得到图像颜色校正模型。Step 204: Use the first training sample set to train a first preset machine learning model to obtain an image color correction model.
示例性的,利用第一训练样本集对第一预设机器学习模型进行训练,生成图像颜色校正模型。其中,第一预设机器学习模型可以包括卷积神经网络模型或长短时记忆网络模型等机器学习模型,还可以包括朴素贝叶斯模型。需要说明的是,本申请实施例对第一预设机器学习模型不做限定。Exemplarily, 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.
步骤205、获取待处理的原始图像。Step 205: Acquire the original image to be processed.
步骤206、将所述原始图像输入至预先训练的图像颜色校正模型中。Step 206: Input the original image into a pre-trained image color correction model.
步骤207、确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。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.
其中,在获取待处理的原始图像之前,获取图像颜色校正模型。需要说明的是,可以是移动终端获取上述第一训练样本集,利用第一训练样本集对第一预设机器学习模型进行训练,直接生成图像颜色校正模型。还可以是移动终端直接调用其他移动终端训练生成的图像颜色校正模型,例如,在出厂前利用一个移动终端获取第一训练样本集并生成图像颜色校正模型,然后将该图像颜色校正模型存储到与其他移动终端中,供其他移动终端直接使用。或者,服务器获取大量的第一样本原始图像及对第一样本原始图像进行颜色校正后的第一样本目标图像,得到第一训练样本集。服务器对基于第一预设机器学习模型对第一训练样本集进行训练,得到图像颜色校正模型。当移动终端需要进行图像颜色校正时,从服务器调用已训练好的图像颜色校正模型。Among them, before acquiring the original image to be processed, an image color correction model is acquired. It should be noted that 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. It may also be that the mobile terminal directly calls the image color correction model generated by the training of other mobile terminals. For example, before leaving the factory, 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. Or, 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. When the mobile terminal needs to perform image color correction, the trained image color correction model is called from the server.
本申请实施例提供的图像颜色校正方法,获取待处理的原始图像,并将所述原始图像输入至预先训练的图像颜色校正模型中,然后确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像,其中,图像颜色校正模型是基于第一样本原始图像及对第一样本原始图像进行颜色校正后的第一样本目标图像进行训练生成的。通过采用上述技术方案,可以有效利用不同光照下采集的第一标准色卡的第一样本原 始图像,或者不同光照下采集的至少两个拍摄场景的第一样本原始图像,及对第一样本原始图像进行颜色校正后的第一样本目标图像,进行图像颜色校正模型的训练学习,可以有效提高图像颜色校正模型的精确性,同时利用图像颜色校正模型可准确、快速地对待处理的原始图像进行颜色校正,能够有效提高图像质量。The image color correction method provided 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. By adopting the above technical solution, 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.
图3为本申请实施例提供的图像颜色校正方法的流程示意图,如图3所示,该方法包括: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:
步骤301、通过摄像头采集第一标准色卡在不同光照下的第一样本原始图像;其中,所述第一标准色卡为彩色色卡;或者通过摄像头采集至少两个拍摄场景在不同光照下的第一样本原始图像。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.
步骤302、对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像。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.
步骤303、将所述第一样本原始图像和所述第一样本目标图像作为第一训练样本集。Step 303: Use the first sample original image and the first sample target image as the first training sample set.
步骤304、利用所述第一训练样本集对第一预设机器学习模型进行训练,得到图像颜色校正模型。Step 304: Use the first training sample set to train the first preset machine learning model to obtain an image color correction model.
步骤305、获取待处理的原始图像。Step 305: Acquire the original image to be processed.
示例性的,待处理的原始图像包括摄像头采集的raw图像。或者,待处理的原始图像包括需要进行颜色校正的图像,但是为了达到更好的颜色校正效果,需要对该原始图像预先进行白平衡处理。Exemplarily, the original image to be processed includes the raw image collected by the camera. Or, 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.
步骤306、将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中。Step 306: Input the original image into a pre-trained white balance coefficient matrix determination model.
在本申请实施例中,白平衡系数矩阵确定模型可以理解为在输入待处理的原始图像后,快速确定与该待处理的原始图像对应的白平衡系数矩阵的学习模型。白平衡系数矩阵确定模型可以是对采集的第二样本原始图像及对应的样本白平衡系数矩阵进行训练生成的学习模型,其中,样本白平衡系数矩阵包括将样本原始图像调整到最好效果的白平衡处理图像时的矩阵。可以理解的是,通过对第二样本原始图像及对应的样本白平衡系数矩阵,及两者间的对应关系进行学习,可以生成白平衡系数矩阵确定模型。In the embodiment of the present application, 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.
步骤307、根据所述白平衡系数矩阵确定模型的输出结果,确定与所述原始图像对应的白平衡系数矩阵。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.
示例性的,将待处理的原始图像输入至白平衡系数矩阵确定模型后,白平衡系数矩阵确定模型对该原始图像进行分析,并根据分析结果确定与待处理的原始图像对应的白平衡系数矩阵。Exemplarily, after inputting the original image to be processed into the white balance coefficient matrix determination model, 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 .
步骤308、根据所述白平衡系数矩阵对所述原始图像进行白平衡处理。Step 308: Perform white balance processing on the original image according to the white balance coefficient matrix.
示例性的,基于白平衡系数矩阵对待处理的原始图像进行白平衡处理,例如,可将原始图像与白平衡系数矩阵的乘积作为对原始图像进行白平衡处理后的图像。Exemplarily, the original image to be processed is subjected to white balance processing based on the white balance coefficient matrix. For example, 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.
可选的,根据所述白平衡系数矩阵对所述原始图像进行白平衡处理,包括:获取所述 原始图像中每个像素点的第一RGB分量值;针对所述原始图像中所有像素点,将每个像素点的第一RGB分量值与所述白平衡系数矩阵中对应位置的白平衡系数的乘积,作为与原始图像所述像素点对应的目标图像的像素点的第二RGB分量值。这样设置的好处在于,可针对待处理的原始图像中每个像素点确定一个独立的白平衡系数,并基于白平衡系数矩阵对原始图像中每个像素点进行白平衡处理,可以解决基于全局白平衡算法进行白平衡处理时,容易导致纯色物体的颜色偏差较大,混合色温下无法准确地检测出白色区块的技术问题,能够有效提高图像的质量,增加图像的饱和度。Optionally, 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 When 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.
示例性的,获取原始图像中每个像素点的第一RGB分量值,并针对原始图像中所有的像素点,将每个像素点的第一RGB分量值乘以与白平衡系数矩阵中对应位置的白平衡系数,并将乘积后的结果作为与原始图像所述像素点对应的目标图像像素点的第二RGB分量值,即将乘积后的结果作为对原始图像进行白平衡处理后的像素点的第二RGB分量值。示例性的,获取原始图像中第一个像素点(原始图像中第一行第一列的像素点)的第一RGB分量值,则将白平衡系数矩阵中第一行第一列的白平衡系数与该第一个像素点的第一RGB分量值的乘积,作为对原始图像进行白平衡处理后的图像中的第一个像素点(白平衡处理后的图像中第一行第一列的像素点)的第二RGB分量值。依次类推,基于白平衡系数矩阵,对原始图像中每个像素点做类似的处理操作,从而得到对原始图像进行白平衡处理后的图像。Exemplarily, 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. Exemplarily, 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. By analogy, based on the white balance coefficient matrix, 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.
步骤309、将经白平衡处理后的原始图像输入至预先训练的图像颜色校正模型中。Step 309: Input the original image after the white balance processing into the pre-trained image color correction model.
在本申请实施例中,将经白平衡处理后的原始图像输入至图像颜色校正模型中,使图像颜色校正模型对该图像进行分析,以进行颜色校正。In the embodiment of the present application, 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.
步骤310、确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。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.
步骤311、对所述目标图像进行Gamma校正,并输出Gamma校正后的目标图像。Step 311: Perform gamma correction on the target image, and output the target image after gamma correction.
本申请实施例提供的图像颜色校正方法,获取待处理的原始图像,将原始图像输入至预先训练的白平衡系数矩阵确定模型中,并根据白平衡系数矩阵确定模型的输出结果,确定与原始图像对应的白平衡系数矩阵,然后根据白平衡系数矩阵对原始图像进行白平衡处理,将经白平衡处理后的原始图像输入至预先训练的图像颜色校正模型中,并确定图像颜色校正模型的输出图像,将输出图像作为与原始图像对应的目标图像。通过采用上述技术方案,能够利用白平衡系数矩阵确定模型对原始图像进行白平衡处理,并利用图像颜色校正模型对经白平衡处理后的图像进行颜色校正,不仅可以提高原始图像的对比度,还可以提高图像的饱和度,能够有效提高图像质量。The image color correction method provided in the embodiment of the present application obtains 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. By adopting the above technical solution, 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.
在一些实施例中,在将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中之前,还包括:获取白平衡系数矩阵确定模型;其中,所述白平衡系数矩阵确定模型由如下方式得到:通过摄像头采集第二标准色卡在不同色温下的第二样本原始图像;其中,所述 第二标准色卡为白色色卡;对所述第二样本原始图像进行白平衡处理,得到与所述第二样本原始图像对应的第二样本目标图像;根据所述第二样本原始图像和所述第二样本目标图像,确定将所述第二样本原始图像变化为所述第二样本目标图像对应的样本白平衡系数矩阵;根据所述样本白平衡系数矩阵对所述第二样本原始图像进行标记,得到第二训练样本集;利用所述第二训练样本集对第二预设机器学习模型进行训练,得到白平衡系数矩阵确定模型。In some embodiments, 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.
在本申请实施例中,第二标准色卡为白色色卡,通过摄像头采集第二标准色卡在不同色温下的图像,作为第二样本原始图像。示例性的,通过摄像头采集标准色卡在不同色温下的raw图像,作为第二样本原始图像。不同色温可通过人造光源来实现,示例性的,在实验室环境下,通过不同类型的光源营造不同的色温环境。例如,利用蜡烛作为光源可营造出2000k的色温环境,利用高压钠灯作为光源可营造出1950-2250k的色温环境,利用钨丝灯做为光源可营造出2700k的色温环境,利用卤素灯作为光源可营造出3000k的色温环境,利用暖色荧光灯作为光源可营造出4000k-4600k的色温环境等。可通过不同类型的光源提供一系列色温值连续的拍摄环境。利用摄像头在不同色温下拍摄第二标准色卡,得到每一色温下的色卡图像,从而获得第二标准色卡在不同色温下的第二样本原始图像。In the embodiment of the present application, the second standard color card is a white color card, and images of the second standard color card at different color temperatures are collected by a camera as the second sample original image. Exemplarily, 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. Exemplarily, in a laboratory environment, different types of light sources are used to create different color temperature environments. For example, 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, and using a halogen lamp as a light source Create a color temperature environment of 3000k, and 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.
示例性的,可利用现有白平衡处理方法对第二样本原始图像进行白平衡处理,得到与第二样本原始图像对应的第二样本目标图像。可选的,将第二样本原始图像输入至ISP工具中,手动对第二样本原始图像进行白平衡调节,将调节至白平衡效果最好的图像作为与第二样本原始图像对应的第二样本目标图像。其中,对第二样本原始图像进行白平衡调节时,是否调节至白平衡效果最好的图像可通过人眼的第二直观感觉进行确认,还可以通过图像质量评估标准进行评估,直至获取白平衡效果最好的图像。Exemplarily, 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. Optionally, 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. Among them, when 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.
在本申请实施例中,根据第二样本原始图像和与第二样本原始图像对应的第二样本目标图像,确定将第二样本原始图像变化为第二样本目标图像时,对应的样本白平衡系数矩阵,即确定对第二样本原始图像进行白平衡处理得到第二样本目标图像时,白平衡处理过程中采用的白平衡系数矩阵。In the embodiment of the present application, according to the second sample original image and the second sample target image corresponding to the second sample original 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.
可选的,根据所述第二样本原始图像和所述第二样本目标图像,确定将所述第二样本原始图像变化为所述第二样本目标图像对应的样本白平衡系数矩阵,包括:获取所述第二样本原始图像中每个像素点的第三RGB分量值及所述第二样本目标图像中每个像素点的第四RGB分量值;针对所有像素点,将每个像素点对应的第四RGB分量值与第三RGB分量值的比值,作为样本白平衡系数矩阵中所述像素点对应的白平衡系数。这样设置的好处在于,可以准确地确定出不同色温环境下对第二标准色卡的原始图像进行白平衡处理时,对应的白平衡系数矩阵。Optionally, 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 advantage of this setting is that it can accurately determine the corresponding white balance coefficient matrix when performing white balance processing on the original image of the second standard color card under different color temperature environments.
示例性的,分别获取第二样本原始图像中每个像素点的第三RGB分量值及第二样本目标图像中每个像素点的第四RGB分量值,对于每个像素点,分别计算对应像素点的第四 RGB分量值与第三RGB分量值的比值,并将该比值作为该像素点的白平衡系数矩阵。示例性的,获取第二样本原始图像中第一个像素点(第二样本原始图像中第一行第一列的像素点)的第三RGB分量值,及第二样本目标图像中第一个像素点(第一样本目标图像中第一行第一列的像素点)的第四RGB分量值,并将该第四RGB分量值与该第三RGB分量值的比值,作为白平衡系数矩阵中第一行第一列的白平衡系数。按照上述方式,依次类推,分别确定白平衡系数矩阵中各个元素的白平衡系数。Exemplarily, 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. Exemplarily, obtain 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. In the above manner, by analogy, the white balance coefficients of each element in the white balance coefficient matrix are determined respectively.
示例性的,根据得到的每个样本白平衡系数矩阵分别对对应的第二样本原始图像进行标记,并将标记好对应样本白平衡系数矩阵的第二样本原始图像,作为白平衡系数矩阵确定模型的训练样本集,即第二训练样本集。示例性的,利用第二训练样本集对第二预设机器学习模型进行训练,生成白平衡系数矩阵确定模型。其中,第二预设机器学习模型可以包括卷积神经网络模型或长短时记忆网络模型等机器学习模型。本申请实施例对第二预设机器学习模型不做限定,其中,第二预设机器学习模型与第一预设机器学习模型可以相同,也可以不同。Exemplarily, according to each sample white balance coefficient matrix obtained, 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. Exemplarily, 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.
其中,在获取待处理的原始图像之前,获取白平衡系数矩阵确定模型。需要说明的是,可以是移动终端获取上述第二训练样本集,利用第二训练样本集对第二预设机器学习模型进行训练,直接生成白平衡系数矩阵确定模型。还可以是移动终端直接调用其他移动终端训练生成的白平衡系数矩阵确定模型,例如,在出厂前利用一个移动终端获取第二训练样本集并生成白平衡系数矩阵确定模型,然后将该白平衡系数矩阵确定模型存储到与其他移动终端中,供其他移动终端直接使用。或者,服务器获取大量的第二样本原始图像及与第二样本原始图像对应的白平衡系数矩阵,并根据对应的白平衡系数矩阵对第二样本原始图像进行标记,得到第二训练样本集。服务器对基于第二预设机器学习模型对第二训练样本集进行训练,得到白平衡系数矩阵确定模型。当移动终端需要进行图像白平衡处理时,从服务器调用已训练好的白平衡系数矩阵确定模型。Before acquiring the original image to be processed, a white balance coefficient matrix determination model is acquired. It should be noted that 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. Alternatively, 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. When the mobile terminal needs to perform image white balance processing, the trained white balance coefficient matrix is called from the server to determine the model.
图4为本申请实施例提供的一种图像颜色校正装置的结构示意图,该装置可由软件和/或硬件实现,一般集成在移动终端中,可通过执行图像颜色校正方法来对待处理的原始图像进行颜色校正。如图4所示,该装置包括: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. As shown in Figure 4, the device includes:
原始图像获取模块401,用于获取待处理的原始图像;The original image acquisition module 401 is used to acquire an original image to be processed;
第一原始图像输入模块402,用于将所述原始图像输入至预先训练的图像颜色校正模型中;The first original image input module 402 is used to input the original image into a pre-trained image color correction model;
目标图像确定模块403,用于确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。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 provided in the embodiment of the present application 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. By adopting the above technical solutions, not only can the original image be color-corrected simply and quickly, but also the corresponding color correction can be applied to different input original images in a targeted manner, which can effectively improve the quality of the image and make the image closer to the real color.
可选的,所述装置还包括:Optionally, 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;
其中,所述图像颜色校正模型由如下方式得到:Wherein, the image color correction model is obtained as follows:
通过摄像头采集第一样本原始图像;Collect the first sample original image through the camera;
对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像;Performing color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image;
将所述第一样本原始图像和所述第一样本目标图像作为第一训练样本集;Using the first sample original image and the first sample target image as the first training sample set;
利用所述第一训练样本集对第一预设机器学习模型进行训练,得到图像颜色校正模型。The first preset machine learning model is trained using the first training sample set to obtain an image color correction model.
可选的,在对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像之前,还包括:Optionally, 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:
通过摄像头采集与所述第一样本原始图像对应的样本RGB图像;Acquiring a sample RGB image corresponding to the original image of the first sample through a camera;
对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像,包括:Performing color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image includes:
以所述样本RGB图像为参考图像,对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像。Using the sample RGB image as a reference image, color correcting the first sample original image to obtain a first sample target image corresponding to the first sample original image.
可选的,通过摄像头采集第一样本原始图像,包括:Optionally, collecting the first sample original image through the camera, including:
通过摄像头采集第一标准色卡在不同光照下的第一样本原始图像;其中,所述第一标准色卡为彩色色卡;或者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
通过摄像头采集至少两个拍摄场景在不同光照下的第一样本原始图像。The first sample original image of at least two shooting scenes under different illuminations is collected by the camera.
可选的,所述装置还包括:Optionally, 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.
可选的,所述装置还包括:Optionally, 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:
通过摄像头采集第二标准色卡在不同色温下的第二样本原始图像;其中,所述第二标准色卡为白色色卡;Acquiring a second sample original image of the second standard color card at different color temperatures through a camera; wherein, the second standard color card is a white color card;
对所述第二样本原始图像进行白平衡处理,得到与所述第二样本原始图像对应的第二样本目标图像;Performing white balance processing on the second sample original image to obtain a second sample target image corresponding to the second sample original image;
根据所述第二样本原始图像和所述第二样本目标图像,确定将所述第二样本原始图像变化为所述第二样本目标图像对应的样本白平衡系数矩阵;Determine, according to the second sample original image and the second sample target image, change the second sample original image to a sample white balance coefficient matrix corresponding to the second sample target image;
根据所述样本白平衡系数矩阵对所述第二样本原始图像进行标记,得到第二训练样本集;Marking the original image of the second sample according to the sample white balance coefficient matrix to obtain a second training sample set;
利用所述第二训练样本集对第二预设机器学习模型进行训练,得到白平衡系数矩阵确定模型。Use the second training sample set to train a second preset machine learning model to obtain a white balance coefficient matrix determination model.
可选的,所述装置还包括:Optionally, the device further includes:
Gamma校正模块,用于在将所述输出图像作为与所述原始图像对应的目标图像之后,对所述目标图像进行Gamma校正,并输出Gamma校正后的目标图像。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:
获取待处理的原始图像;Get the original image to be processed;
将所述原始图像输入至预先训练的图像颜色校正模型中;Input the original image into a pre-trained image color correction model;
确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。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.
存储介质——任何的各种类型的存储器设备或存储设备。术语“存储介质”旨在包括:安装介质,例如CD-ROM、软盘或磁带装置;计算机系统存储器或随机存取存储器,诸如DRAM、DDRRAM、SRAM、EDORAM,兰巴斯(Rambus)RAM等;非易失性存储器,诸如闪存、磁介质(例如硬盘或光存储);寄存器或其它相似类型的存储器元件等。存储介质可以还包括其它类型的存储器或其组合。另外,存储介质可以位于程序在其中被执行的第一计算机系统中,或者可以位于不同的第二计算机系统中,第二计算机系统通过网络(诸如因特网)连接到第一计算机系统。第二计算机系统可以提供程序指令给第一计算机用于执行。术语“存储介质”可以包括可以驻留在不同位置中(例如在通过网络连接的不同计算机系统中)的两个或更多存储介质。存储介质可以存储可由一个或多个处理器执行的程序指令(例如具体实现为计算机程序)。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. In addition, 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. The term "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).
当然,本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的图像颜色校正操作,还可以执行本申请任意实施例所提供的图像颜色校正方法中的相关操作。Of course, 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.
本申请实施例提供了一种移动终端,该移动终端中可集成本申请实施例提供的图像颜色校正装置。图5为本申请实施例提供的一种移动终端的结构示意图。移动终端500可以 包括:存储器501,处理器502及存储在存储器上并可在处理器运行的计算机程序,所述处理器502执行所述计算机程序时实现如本申请实施例所述的图像颜色校正方法。An embodiment of the present application provides a mobile terminal, and the image color correction device provided by the embodiment of the present application can be integrated into the mobile terminal. 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. When 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.
图6为本申请实施例提供的另一种移动终端的结构示意图,该移动终端可以包括:壳体(图中未示出)、存储器601、中央处理器(central processing unit,CPU)602(又称处理器,以下简称CPU)、电路板(图中未示出)和电源电路(图中未示出)。所述电路板安置在所述壳体围成的空间内部;所述CPU602和所述存储器601设置在所述电路板上;所述电源电路,用于为所述移动终端的各个电路或器件供电;所述存储器601,用于存储可执行程序代码;所述CPU602通过读取所述存储器601中存储的可执行程序代码来运行与所述可执行程序代码对应的计算机程序,以实现以下步骤: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:
获取待处理的原始图像;Get the original image to be processed;
将所述原始图像输入至预先训练的图像颜色校正模型中;Input the original image into a pre-trained image color correction model;
确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。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.
所述移动终端还包括:外设接口603、RF(Radio Frequency,射频)电路605、音频电路606、扬声器611、电源管理芯片608、输入/输出(I/O)子系统609、其他输入/控制设备610、触摸屏612、其他输入/控制设备610以及外部端口604,这些部件通过一个或多个通信总线或信号线607来通信。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.
应该理解的是,图示移动终端600仅仅是移动终端的一个范例,并且移动终端600可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。It should be understood that 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.
存储器601,所述存储器601可以被CPU602、外设接口603等访问,所述存储器601可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。 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.
外设接口603,所述外设接口603可以将设备的输入和输出外设连接到CPU602和存储器601。 Peripheral interface 603, which can connect input and output peripherals of the device to CPU 602 and memory 601.
I/O子系统609,所述I/O子系统609可以将设备上的输入输出外设,例如触摸屏612和其他输入/控制设备610,连接到外设接口603。I/O子系统609可以包括显示控制器6091和用于控制其他输入/控制设备610的一个或多个输入控制器6092。其中,一个或多个输入 控制器6092从其他输入/控制设备610接收电信号或者向其他输入/控制设备610发送电信号,其他输入/控制设备610可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。值得说明的是,输入控制器6092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。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. Among them, 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. It is worth noting that 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.
触摸屏612,所述触摸屏612是用户移动终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标、视频等。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.
I/O子系统609中的显示控制器6091从触摸屏612接收电信号或者向触摸屏612发送电信号。触摸屏612检测触摸屏上的接触,显示控制器6091将检测到的接触转换为与显示在触摸屏612上的用户界面对象的交互,即实现人机交互,显示在触摸屏612上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。值得说明的是,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。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. It is worth noting that 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.
RF电路605,主要用于建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。具体地,RF电路605接收并发送RF信号,RF信号也称为电磁信号,RF电路605将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路605可以包括用于执行这些功能的已知电路,其包括但不限于天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、CODEC(COder-DECoder,编译码器)芯片组、用户标识模块(Subscriber Identity Module,SIM)等等。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.
音频电路606,主要用于从外设接口603接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器611。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.
扬声器611,用于将手机通过RF电路605从无线网络接收的语音信号,还原为声音并向用户播放该声音。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.
电源管理芯片608,用于为CPU602、I/O子系统及外设接口所连接的硬件进行供电及电源管理。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. For technical details that are not described in detail in the above embodiments, please refer to the image color correction method provided in any embodiment of the present application.
注意,上述仅为本申请的较佳实施例及所运用技术原理。本领域技术人员会理解,本申请不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本申请的保护范围。因此,虽然通过以上实施例对本申请进行了较为详细的说明,但是本申请不仅仅限于以上实施例,在不脱离本申请构思的情况下,还可以包括更多其他等效实施例,而本申请的范围由所附的权利要求范围决定。Note that the above are only the preferred embodiments of the present application and the technical principles applied. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that those skilled in the art can make various obvious changes, readjustments and substitutions without departing from the scope of protection of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application. The scope is determined by the scope of the appended claims.

Claims (20)

  1. 一种图像颜色校正方法,其特征在于,包括:An image color correction method, characterized in that it includes:
    获取待处理的原始图像;Get the original image to be processed;
    将所述原始图像输入至预先训练的图像颜色校正模型中;Input the original image into a pre-trained image color correction model;
    确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。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.
  2. 根据权利要求1所述的方法,其特征在于,在获取待处理的原始图像之前,还包括:The method according to claim 1, wherein before acquiring the original image to be processed, further comprising:
    获取所述图像颜色校正模型;Acquiring the image color correction model;
    其中,所述图像颜色校正模型由如下方式得到:Wherein, the image color correction model is obtained as follows:
    通过摄像头采集第一样本原始图像;Collect the first sample original image through the camera;
    对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像;Performing color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image;
    将所述第一样本原始图像和所述第一样本目标图像作为第一训练样本集;Using the first sample original image and the first sample target image as the first training sample set;
    利用所述第一训练样本集对第一预设机器学习模型进行训练,得到图像颜色校正模型。The first preset machine learning model is trained using the first training sample set to obtain an image color correction model.
  3. 根据权利要求2所述的方法,其特征在于,在对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像之前,还包括:The method according to claim 2, wherein before performing color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image, further comprising:
    通过摄像头采集与所述第一样本原始图像对应的样本RGB图像;Acquiring a sample RGB image corresponding to the original image of the first sample through a camera;
    对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像,包括:Performing color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image includes:
    以所述样本RGB图像为参考图像,对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像。Using the sample RGB image as a reference image, color correcting the first sample original image to obtain a first sample target image corresponding to the first sample original image.
  4. 根据权利要求2所述的方法,其特征在于,通过摄像头采集第一样本原始图像,包括:The method according to claim 2, wherein 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.
  5. 根据权利要求2所述的方法,其特征在于,通过摄像头采集第一样本原始图像,还包括:The method according to claim 2, wherein collecting the original image of the first sample through the camera further comprises:
    通过摄像头采集至少两个拍摄场景在不同光照下的第一样本原始图像。The first sample original image of at least two shooting scenes under different illuminations is collected by the camera.
  6. 根据权利要求1所述的方法,其特征在于,在将所述原始图像输入至预先训练的图像颜色校正模型中之前,还包括:The method according to claim 1, wherein before inputting the original image into the pre-trained image color correction model, further comprising:
    将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中;Input the original image into a pre-trained white balance coefficient matrix determination model;
    根据所述白平衡系数矩阵确定模型的输出结果,确定与所述原始图像对应的白平衡系数矩阵;Determining the output result of the model according to the white balance coefficient matrix, and determining the white balance coefficient matrix corresponding to the original image;
    根据所述白平衡系数矩阵对所述原始图像进行白平衡处理;Performing white balance processing on the original image according to the white balance coefficient matrix;
    所述将所述原始图像输入至预先训练的图像颜色校正模型中,包括: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.
  7. 根据权利要求6所述的方法,其特征在于,在将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中之前,还包括:The method according to claim 6, wherein before inputting the original image into a pre-trained white balance coefficient matrix determination model, the method further comprises:
    获取白平衡系数矩阵确定模型;Obtain the white balance coefficient matrix to determine the model;
    其中,所述白平衡系数矩阵确定模型由如下方式得到:The determination model of the white balance coefficient matrix is obtained as follows:
    通过摄像头采集第二标准色卡在不同色温下的第二样本原始图像;其中,所述第二标准色卡为白色色卡;Acquiring a second sample original image of the second standard color card at different color temperatures through a camera; wherein, the second standard color card is a white color card;
    对所述第二样本原始图像进行白平衡处理,得到与所述第二样本原始图像对应的第二样本目标图像;Performing white balance processing on the second sample original image to obtain a second sample target image corresponding to the second sample original image;
    根据所述第二样本原始图像和所述第二样本目标图像,确定将所述第二样本原始图像变化为所述第二样本目标图像对应的样本白平衡系数矩阵;Determine, according to the second sample original image and the second sample target image, change the second sample original image to a sample white balance coefficient matrix corresponding to the second sample target image;
    根据所述样本白平衡系数矩阵对所述第二样本原始图像进行标记,得到第二训练样本集;Marking the original image of the second sample according to the sample white balance coefficient matrix to obtain a second training sample set;
    利用所述第二训练样本集对第二预设机器学习模型进行训练,得到白平衡系数矩阵确定模型。Use the second training sample set to train a second preset machine learning model to obtain a white balance coefficient matrix determination model.
  8. 根据权利要求6所述的方法,其特征在于,根据所述白平衡系数矩阵对所述原始图像进行白平衡处理,包括:The method according to claim 6, wherein performing white balance processing on the original image according to the white balance coefficient matrix includes:
    获取所述原始图像中每个像素点的第一RGB分量值;Acquiring the first RGB component value of each pixel in the original image;
    针对所述原始图像中所有像素点,将每个像素点的第一RGB分量值与所述白平衡系数矩阵中对应位置的白平衡系数的乘积,作为与原始图像所述像素点对应的目标图像的像素点的第二RGB分量值。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 target image corresponding to the pixel of the original image The second RGB component value of the pixel.
  9. 根据权利要求1所述的方法,其特征在于,在将所述输出图像作为与所述原始图像对应的目标图像之后,还包括:The method according to claim 1, wherein after the output image is used as the target image corresponding to the original image, further comprising:
    对所述目标图像进行Gamma校正,并输出Gamma校正后的目标图像。Gamma correction is performed on the target image, and the target image after gamma correction is output.
  10. 一种图像颜色校正装置,其特征在于,包括:An image color correction device, characterized in that it includes:
    原始图像获取模块,用于获取待处理的原始图像;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.
  11. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现:A computer-readable storage medium on which a computer program is stored, characterized in that the program is implemented when executed by a processor:
    获取待处理的原始图像;Get the original image to be processed;
    将所述原始图像输入至预先训练的图像颜色校正模型中;Input the original image into a pre-trained image color correction model;
    确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。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.
  12. 一种移动终端,其特征在于,包括存储器,处理器及存储在存储器上并可在处理器运行的计算机程序,所述处理器执行所述计算机程序时实现:A mobile terminal is characterized by 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:
    获取待处理的原始图像;Get the original image to be processed;
    将所述原始图像输入至预先训练的图像颜色校正模型中;Input the original image into a pre-trained image color correction model;
    确定所述图像颜色校正模型的输出图像,并将所述输出图像作为与所述原始图像对应的目标图像。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.
  13. 根据权利要求12所述的移动终端,其特征在于,在获取待处理的原始图像之前,所述处理器还执行:The mobile terminal according to claim 12, wherein before acquiring the original image to be processed, the processor further executes:
    通过摄像头采集第一样本原始图像;Collect the first sample original image through the camera;
    对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像;Performing color correction on the first sample original image to obtain a first sample target image corresponding to the first sample original image;
    将所述第一样本原始图像和所述第一样本目标图像作为第一训练样本集;Using the first sample original image and the first sample target image as the first training sample set;
    利用所述第一训练样本集对第一预设机器学习模型进行训练,得到图像颜色校正模型。The first preset machine learning model is trained using the first training sample set to obtain an image color correction model.
  14. 根据权利要求13所述的移动终端,其特征在于,在对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像之前,所述处理器还执行:The mobile terminal according to claim 13, wherein 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 The processor also executes:
    通过摄像头采集与所述第一样本原始图像对应的样本RGB图像;Acquiring a sample RGB image corresponding to the original image of the first sample through a camera;
    而在对所述第一样本原始图像进行颜色校正,得到与所述第一样本原始图像对应的第一样本目标图像时,所述处理器用于执行:When 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 processor is configured to execute:
    以所述样本RGB图像为参考图像,对所述第一样本原始图像进行颜色校正,得到与所 述第一样本原始图像对应的第一样本目标图像。Using the sample RGB image as a reference image, color correcting the first sample original image to obtain a first sample target image corresponding to the first sample original image.
  15. 根据权利要求13所述的移动终端,其特征在于,在通过摄像头采集第一样本原始图像时,所述处理器用于执行:The mobile terminal according to claim 13, characterized in that, when acquiring the original image of the first sample through the camera, the processor is configured to execute:
    通过摄像头采集第一标准色卡在不同光照下的第一样本原始图像;其中,所述第一标准色卡为彩色色卡。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.
  16. 根据权利要求13所述的移动终端,其特征在于,在通过摄像头采集第一样本原始图像时,所述处理器还用于执行:The mobile terminal according to claim 13, wherein when the first sample original image is collected by the camera, the processor is further configured to execute:
    通过摄像头采集至少两个拍摄场景在不同光照下的第一样本原始图像。The first sample original image of at least two shooting scenes under different illuminations is collected by the camera.
  17. 根据权利要求12所述的移动终端,其特征在于,在将所述原始图像输入至预先训练的图像颜色校正模型中之前,所述处理器还用于执行:The mobile terminal according to claim 12, wherein before the original image is input into the pre-trained image color correction model, the processor is further configured to execute:
    将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中;Input the original image into a pre-trained white balance coefficient matrix determination model;
    根据所述白平衡系数矩阵确定模型的输出结果,确定与所述原始图像对应的白平衡系数矩阵;Determining the output result of the model according to the white balance coefficient matrix, and determining the white balance coefficient matrix corresponding to the original image;
    根据所述白平衡系数矩阵对所述原始图像进行白平衡处理;Performing white balance processing on the original image according to the white balance coefficient matrix;
    而在将所述原始图像输入至预先训练的图像颜色校正模型中时,所述处理器用于执行:When inputting the original image into the pre-trained image color correction model, the processor is used to execute:
    将经白平衡处理后的原始图像输入至预先训练的图像颜色校正模型中。The original image after the white balance processing is input into the pre-trained image color correction model.
  18. 根据权利要求17所述的移动终端,其特征在于,在将所述原始图像输入至预先训练的白平衡系数矩阵确定模型中之前,所述处理器还用于执行:The mobile terminal according to claim 17, wherein before inputting the original image into a pre-trained white balance coefficient matrix determination model, the processor is further configured to execute:
    通过摄像头采集第二标准色卡在不同色温下的第二样本原始图像;其中,所述第二标准色卡为白色色卡;Acquiring a second sample original image of the second standard color card at different color temperatures through a camera; wherein, the second standard color card is a white color card;
    对所述第二样本原始图像进行白平衡处理,得到与所述第二样本原始图像对应的第二样本目标图像;Performing white balance processing on the second sample original image to obtain a second sample target image corresponding to the second sample original image;
    根据所述第二样本原始图像和所述第二样本目标图像,确定将所述第二样本原始图像变化为所述第二样本目标图像对应的样本白平衡系数矩阵;Determine, according to the second sample original image and the second sample target image, change the second sample original image to a sample white balance coefficient matrix corresponding to the second sample target image;
    根据所述样本白平衡系数矩阵对所述第二样本原始图像进行标记,得到第二训练样本集;Marking the original image of the second sample according to the sample white balance coefficient matrix to obtain a second training sample set;
    利用所述第二训练样本集对第二预设机器学习模型进行训练,得到白平衡系数矩阵确定模型。Use the second training sample set to train a second preset machine learning model to obtain a white balance coefficient matrix determination model.
  19. 根据权利要求17所述的移动终端,其特征在于,在根据所述白平衡系数矩阵对所述原始图像进行白平衡处理时,所述处理器用于执行:The mobile terminal according to claim 17, wherein when performing white balance processing on the original image according to the white balance coefficient matrix, the processor is configured to execute:
    获取所述原始图像中每个像素点的第一RGB分量值;Acquiring the first RGB component value of each pixel in the original image;
    针对所述原始图像中所有像素点,将每个像素点的第一RGB分量值与所述白平衡系数矩阵中对应位置的白平衡系数的乘积,作为与原始图像所述像素点对应的目标图像的像素点的第二RGB分量值。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 target image corresponding to the pixel of the original image The second RGB component value of the pixel.
  20. 根据权利要求12所述的移动终端,其特征在于,在将所述输出图像作为与所述原始图像对应的目标图像之后,所述处理器还用于执行:The mobile terminal according to claim 12, wherein after the output image is used as the target image corresponding to the original image, the processor is further configured to execute:
    对所述目标图像进行Gamma校正,并输出Gamma校正后的目标图像。Gamma correction is performed on the target image, and the target image after gamma correction is output.
PCT/CN2019/107580 2018-11-19 2019-09-24 Image color correction method, device, storage medium and mobile terminal WO2020103570A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811377864.X 2018-11-19
CN201811377864.XA CN109523485B (en) 2018-11-19 2018-11-19 Image color correction method, device, storage medium and mobile terminal

Publications (1)

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

Family

ID=65777998

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/107580 WO2020103570A1 (en) 2018-11-19 2019-09-24 Image color correction method, device, storage medium and mobile terminal

Country Status (2)

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

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109523485B (en) * 2018-11-19 2021-03-02 Oppo广东移动通信有限公司 Image color correction method, device, storage medium and mobile terminal
CN110211065B (en) * 2019-05-23 2023-10-20 九阳股份有限公司 Color correction method and device for food material image
CN110428377B (en) * 2019-07-26 2023-06-30 北京康夫子健康技术有限公司 Data expansion method, device, equipment and medium
CN110796642A (en) * 2019-10-09 2020-02-14 陈浩能 Method for determining fruit quality degree and related product
CN110827317B (en) * 2019-11-04 2023-05-12 西安邮电大学 Four-eye moving object detection and identification equipment and method based on FPGA
CN111064963A (en) * 2019-11-11 2020-04-24 北京迈格威科技有限公司 Image data decoding method, device, computer equipment and storage medium
WO2021114184A1 (en) * 2019-12-12 2021-06-17 华为技术有限公司 Neural network model training method and image processing method, and apparatuses therefor
CN111461996B (en) * 2020-03-06 2023-08-29 合肥师范学院 Quick intelligent color matching method for image
CN111476731B (en) * 2020-04-01 2023-06-27 Oppo广东移动通信有限公司 Image correction method, device, storage medium and electronic equipment
CN111681201B (en) * 2020-04-20 2023-06-23 深圳市鸿富瀚科技股份有限公司 Image processing method, device, computer equipment and storage medium
CN111898449B (en) * 2020-06-30 2023-04-18 北京大学 Pedestrian attribute identification method and system based on monitoring video
CN111930987B (en) * 2020-08-11 2023-12-26 复旦大学 Intelligent metropolitan area positioning method and system based on machine vision color recognition
CN112164005B (en) * 2020-09-24 2023-03-17 Oppo(重庆)智能科技有限公司 Image color correction method, device, equipment and storage medium
CN112752023B (en) * 2020-12-29 2022-07-15 深圳市天视通视觉有限公司 Image adjusting method and device, electronic equipment and storage medium
CN112884693A (en) * 2021-03-25 2021-06-01 维沃移动通信(深圳)有限公司 Training method and device of image processing model and white balance processing method and device
CN113516132B (en) * 2021-03-25 2024-05-03 杭州博联智能科技股份有限公司 Color calibration method, device, equipment and medium based on machine learning
CN113298726A (en) * 2021-05-14 2021-08-24 漳州万利达科技有限公司 Image display adjusting method and device, display equipment and storage medium
CN113506332B (en) * 2021-09-09 2021-12-17 北京的卢深视科技有限公司 Target object identification method, electronic device and storage medium
CN115835034B (en) * 2021-09-15 2024-04-05 荣耀终端有限公司 White balance processing method and electronic equipment
WO2024000473A1 (en) * 2022-06-30 2024-01-04 京东方科技集团股份有限公司 Color correction model generation method, correction method and apparatus, and medium and device
CN115460391B (en) * 2022-09-13 2024-04-16 浙江大华技术股份有限公司 Image simulation method and device, storage medium and electronic device
CN116668656B (en) * 2023-07-24 2023-11-21 荣耀终端有限公司 Image processing method and electronic equipment
CN116721038A (en) * 2023-08-07 2023-09-08 荣耀终端有限公司 Color correction method, electronic device, and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1945627A (en) * 2006-10-20 2007-04-11 清华大学 Method for correcting digital tongue picture colour cast
US20120127326A1 (en) * 2010-11-23 2012-05-24 Hon Hai Precision Industry Co., Ltd. Image optimization system and method for optimizing images
CN103905803A (en) * 2014-03-18 2014-07-02 中国科学院国家天文台 Image color correcting method and device
CN108712639A (en) * 2018-05-29 2018-10-26 凌云光技术集团有限责任公司 Image color correction method, apparatus and system
CN109523485A (en) * 2018-11-19 2019-03-26 Oppo广东移动通信有限公司 Image color correction method, device, storage medium and mobile terminal

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101678691B1 (en) * 2010-05-12 2016-11-23 삼성전자주식회사 Apparatus for image processing using character of light source and method for the same
CN102244790A (en) * 2011-06-27 2011-11-16 展讯通信(上海)有限公司 Device and method for adaptively adjusting supporting parameters of image signal processor
CN103839236A (en) * 2014-02-25 2014-06-04 中国科学院自动化研究所 Image white balance method based on sparse representation
CN106651795A (en) * 2016-12-03 2017-05-10 北京联合大学 Method of using illumination estimation to correct image color
CN107613192A (en) * 2017-08-09 2018-01-19 深圳市巨龙创视科技有限公司 A kind of Digital Image Processing algorithm based on video camera module
CN108600723A (en) * 2018-07-20 2018-09-28 长沙全度影像科技有限公司 A kind of color calibration method and evaluation method of panorama camera

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1945627A (en) * 2006-10-20 2007-04-11 清华大学 Method for correcting digital tongue picture colour cast
US20120127326A1 (en) * 2010-11-23 2012-05-24 Hon Hai Precision Industry Co., Ltd. Image optimization system and method for optimizing images
CN103905803A (en) * 2014-03-18 2014-07-02 中国科学院国家天文台 Image color correcting method and device
CN108712639A (en) * 2018-05-29 2018-10-26 凌云光技术集团有限责任公司 Image color correction method, apparatus and system
CN109523485A (en) * 2018-11-19 2019-03-26 Oppo广东移动通信有限公司 Image color correction method, device, storage medium and mobile terminal

Also Published As

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

Similar Documents

Publication Publication Date Title
WO2020103570A1 (en) Image color correction method, device, storage medium and mobile terminal
CN109547701B (en) Image shooting method and device, storage medium and electronic equipment
CN109685746B (en) Image brightness adjusting method and device, storage medium and terminal
CN108307125B (en) Image acquisition method, device and storage medium
US20200058110A1 (en) Method for Image Processing, Non-Transitory Computer Readable Medium, and Electronic Device
CN109741281B (en) Image processing method, image processing device, storage medium and terminal
US11245933B2 (en) Method and server for generating image data by using multiple cameras
CN109714582B (en) White balance adjusting method, device, storage medium and terminal
US10298899B2 (en) Image processing device, imaging device, image processing method, and program
KR20200101180A (en) An electronic device for stabilizing image and operating method thereof
US20210136297A1 (en) Method for providing preview and electronic device for displaying preview
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 (en) Image white balancing treatment method, device, storage medium and mobile terminal
CN109120864B (en) Light supplement processing method and device, storage medium and mobile terminal
CN113544734A (en) Electronic device and method for adjusting color of image data by using infrared sensor
KR102524982B1 (en) Apparatus and method for applying noise pattern to image processed bokeh
CN108683858A (en) It takes pictures optimization method, device, storage medium and terminal device
CN109040729B (en) Image white balance correction method and device, storage medium and terminal
US20180098050A1 (en) Power efficient long range depth sensing
KR20200092135A (en) Electronic device and method for connecting ground node to camera module
KR20190030946A (en) Electronic device and method for controlling a plurality of image sensors
CN112905141A (en) Screen display method and device and computer storage medium
CN108683857A (en) It takes pictures optimization method, device, storage medium and terminal device

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