CN111480331A - Color correction method and device - Google Patents

Color correction method and device Download PDF

Info

Publication number
CN111480331A
CN111480331A CN201880081358.8A CN201880081358A CN111480331A CN 111480331 A CN111480331 A CN 111480331A CN 201880081358 A CN201880081358 A CN 201880081358A CN 111480331 A CN111480331 A CN 111480331A
Authority
CN
China
Prior art keywords
image
color correction
matrix
color
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201880081358.8A
Other languages
Chinese (zh)
Inventor
林威丞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN111480331A publication Critical patent/CN111480331A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/46Colour picture communication systems
    • H04N1/56Processing of colour picture signals
    • H04N1/58Edge or detail enhancement; Noise or error suppression, e.g. colour misregistration correction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/46Colour picture communication systems
    • H04N1/56Processing of colour picture signals
    • H04N1/60Colour correction or control

Abstract

The application discloses a color correction method and a device, wherein the method comprises the following steps: respectively carrying out color correction processing according to the first color correction matrix and the first color information matrix of each image point in a plurality of image points in the image to be processed to obtain a second color information matrix of each image point; when an area causing supersaturation exists in the image to be processed, determining a second color correction matrix, wherein the correction amplitude of the second color correction matrix is lower than that of the first color correction matrix; and respectively carrying out color correction processing on the first color information matrix of each image point by using the second color correction matrix so as to update the second color information matrix of each image point. The saturation of the output image is improved, the details of the output image are considered, and the distortion phenomenon caused by color oversaturation is restrained.

Description

Color correction method and device Technical Field
The present application relates to the field of image processing, and in particular, to a color correction method and apparatus.
Background
After an original image is input to an Image Signal Processor (ISP), color shift of a light source is corrected by Auto White Balance (AWB), and the image after AWB correction has an inaccurate color portion except a white portion, and each color needs to be adjusted to a correct color through Color Correction (CC). In order to improve the color vividness of an output image and improve the preference of a user on an output image of a camera, the color saturation is strengthened on a CC module of an ISP (internet service provider), but the risk of color oversaturation under the scene of a colored color light source is introduced, namely, colors in some areas are strongest, and color shade cannot be distinguished, and details are lost.
The function of the CC module to enhance the color saturation is mainly realized by a 3 × 3 color correction matrix, and each image point can be expressed by three different colors, i.e. there are three color channels, which may typically include red (red, R), green (green, G) and blue (blue, B). The chrominance values (R, G, B) of the individual colors of each image point in the image are multiplied by the color correction matrix to obtain a color-corrected chrominance value (R ', G ', B '), which is calculated as follows. The color correction matrix is generally parameterized by the scene of a typical light source, and has two functions of hue correction and saturation enhancement.
Figure PCTCN2018102081-APPB-000001
R′=a11*R+a12*G+a13*B
G′=a21*R+a22*G+a23*B
B′=a31*R+a32*G+a33*B
In the 3x3 color correction matrix, a11、a22And a33Three values are usually positive numbers and the remaining six are negative numbers, a when the CC module increases the saturation of the color11、a22And a33Three values will become larger, the other six numbers will become larger negatively, and the constraint conditions satisfied by the color correction matrix are as follows:
a11+a12+a13=1
a21+a22+a23=1
a31+a32+a33=1
in a possible case, negative values may occur in R ', G ', B ' after color correction by the CC module. For example, assume that there is an image point in the image with RGB values of 94.45, 14.95 and 70.68, respectively, and a of the color correction matrix21,a22And a23The values are-0.27, 1.52 and-0.25, respectively, and G' after color correction by the CC module is-20.45. Since the RGB three-channel values of the image point cannot be negative, the value of G' is forced to be 0 at this time. When there are continuous areas in the image with negative values, the negative values are all forced to be set to 0. The size difference between the negative values represents the shape or texture of the object in the image, and when the negative values are all set to 0, the shape or texture of the object in the image cannot be shown, which is a phenomenon that color oversaturation causes distortion that image details disappear.
In the prior art, when color correction processing is performed on an image to be processed, color correction is directly performed on the image to be processed according to a default color correction matrix of a system, and a color oversaturation phenomenon exists in a final output image. Therefore, how to suppress the color oversaturation phenomenon is an urgent problem to be solved.
Disclosure of Invention
The embodiment of the application provides a color correction method and a color correction device, which can inhibit the phenomenon of color saturation caused by color correction.
In a first aspect, an embodiment of the present application provides a color correction method, including: respectively carrying out color correction processing on a first color information matrix of each image point in a plurality of image points in an image to be processed by utilizing a first color correction matrix to obtain a second color information matrix of each image point, wherein the first color information matrix comprises chroma values of three colors to be processed, and the second color information matrix comprises chroma values of the three colors after color correction; when it is determined that there is an oversaturation-causing region in the image to be processed, performing an updated correction operation, wherein the region includes a plurality of oversaturation-causing image points, a chroma value of a first color corresponding to each oversaturation-causing image point is smaller than a preset threshold, the first color is one of the three colors, and the updated correction operation includes: determining a second color correction matrix, wherein the correction amplitude of the second color correction matrix is lower than that of the first color correction matrix; and performing color correction processing on the first color information matrix of each image point again by using the second color correction matrix so as to update the second color information matrix of each image point.
By implementing the embodiment of the application, when the color correction matrix is adopted to perform the color correction on the image to be processed, whether an oversaturated area exists in the image to be processed is judged firstly, and if so, the amplitude of the color correction is reduced. When the saturation of the output image is improved, the scheme gives consideration to the details of the output image and inhibits the distortion phenomenon caused by color supersaturation.
In one possible implementation, the plurality of image points that cause oversaturation are neighboring image points.
In a possible implementation, the number of image points causing oversaturation is greater than a preset number threshold, or the ratio of the number of image points causing oversaturation to the number of image points contained in the image to be processed is greater than a preset ratio threshold.
In one possible implementation, determining the second color correction matrix includes: the first color correction matrix is adjusted to obtain a second color correction matrix.
In one possible implementation, adjusting the first color correction matrix to obtain the second color correction matrix includes: and carrying out weighted average on the first color correction matrix and the identity matrix to obtain a second color correction matrix.
According to the embodiment of the application, the first color correction matrix and the identity matrix are subjected to weighted average to obtain the second color correction matrix, so that the correction amplitude of the second color correction matrix is reduced, and the phenomenon of color saturation caused by color correction is suppressed.
In one possible implementation the performing the updated correction operation includes repeatedly performing the updated correction operation, wherein the weighted average parameter α in the next updated correction operation1Greater than the weighted average parameter α in the current updated correction operation2,α1And α2Are the weights of the identity matrix.
According to the embodiment of the application, the correction amplitude of the second color correction matrix is reduced by increasing the weighted average parameter of the identity matrix, so that the phenomenon of color saturation caused by color correction is inhibited.
In a possible implementation manner, the method further includes: after updating the second color information matrix of each image point, if it is determined that the image to be processed still has the region causing the oversaturation, the updated correction operation is repeatedly executed until it is determined that the region causing the oversaturation does not exist in the image to be processed.
In one possible implementation, the three colors include red, green, and blue.
In one possible implementation, the image to be processed is an automatically white-balanced image.
Due to the image which is not corrected by the automatic white balance, the original white object has color in the image, namely, the image color is not accurate. Therefore, in the embodiment of the application, the color correction processing is performed on the image after the automatic white balance, so that the color of the finally output image after the color correction is displayed correctly.
In a second aspect, an embodiment of the present application provides a color correction method, including: respectively carrying out color correction pretreatment on a first color information matrix of each image block in a plurality of image blocks in an image to be processed by utilizing a first color correction matrix to obtain a second color information matrix of each image block, wherein the first color information matrix comprises colorimetric values of three colors to be processed, and the second color information matrix comprises the colorimetric values of the three colors after the color correction pretreatment; each image block comprises a plurality of image points, and the first color information matrix of each image block is the average of the first color information matrices of the image points; when determining that an oversaturation-causing area exists in the image to be processed, determining a second color correction matrix, wherein the area comprises a plurality of oversaturation-causing image blocks, each oversaturation-causing image block corresponds to an image block with a chroma value of a first color smaller than a preset threshold, the color is one of the three colors, and the correction amplitude of the second color correction matrix is lower than that of the first color correction matrix; and respectively carrying out color correction processing on the first color information matrix of each image point in the image to be processed by utilizing the second color correction matrix.
By implementing the embodiment of the application, the image to be processed can be preprocessed before the color correction matrix is adopted to perform the color correction on the image to be processed, so that whether an oversaturated area exists in the image to be processed or not is judged, and if the oversaturated area exists, the amplitude of the color correction is reduced. After determining a suitable color correction matrix, the color correction matrix is used for color correction processing. When the saturation of the output image is improved, the scheme gives consideration to the details of the output image and inhibits the distortion phenomenon caused by color supersaturation. Further, the small color image in the embodiment of the application is obtained according to the image after automatic white balance correction, the image after automatic white balance correction is divided into a plurality of image blocks, and the first color information matrix of each image block is an average of the first color information matrices of all the image points included in the image block. A color palette is an image comprising chrominance values of several image blocks. The small color image can accurately represent the color characteristics of the input image, the number of image blocks is small, and the calculation amount for determining the color correction matrix is reduced.
In one possible implementation, the plurality of image blocks causing oversaturation is a plurality of adjacent image blocks.
In a possible implementation manner, the number of the image blocks causing oversaturation is greater than a preset number threshold, or a ratio of the number of the image blocks causing oversaturation to the number of the image blocks included in the image to be processed is greater than a preset ratio threshold.
In one possible implementation, the determining the second color correction matrix includes: the first color correction matrix is adjusted to obtain the second color correction matrix.
In one possible implementation manner, the adjusting the first color correction matrix to obtain the second color correction matrix includes: and performing weighted average on the first color correction matrix and the identity matrix to obtain the second color correction matrix.
According to the embodiment of the application, the first color correction matrix and the identity matrix are subjected to weighted average to obtain the second color correction matrix, so that the correction amplitude of the second color correction matrix is reduced, and the phenomenon of color saturation caused by color correction is suppressed.
In one possible implementation, the adjusting the first color correction matrix to obtain the second color correction matrix comprises adjusting the first color correction matrix a plurality of times to obtain the second color correction matrix, wherein a weighted average parameter α in a next adjustment is obtained1Greater than the weighted average parameter α in the current adjustment2,α1And α2Is the weight of the above-mentioned identity matrix.
According to the embodiment of the application, the correction amplitude of the second color correction matrix is reduced by increasing the weighted average parameter of the identity matrix, so that the phenomenon of color saturation caused by color correction is inhibited.
In a possible implementation manner, after the determining the second color correction matrix, before the performing color correction processing on the first color information matrix of each image point in the image to be processed by using the second color correction matrix, the method further includes: respectively carrying out color correction preprocessing on the first color information matrix of each image block in a plurality of image blocks in the image to be processed by utilizing the second color correction matrix so as to update the second color information matrix of each image block;
if it is determined that the region causing the oversaturation still exists in the image to be processed, the operation of determining the second color correction matrix is repeatedly performed until it is determined that the region causing the oversaturation does not exist in the image to be processed.
In one possible implementation, the three colors include red, green, and blue.
In a third aspect, an embodiment of the present application provides a color correction apparatus, including: the processing unit is used for respectively carrying out color correction processing on a first color information matrix of each image point in a plurality of image points in an image to be processed by utilizing a first color correction matrix so as to obtain a second color information matrix of each image point, wherein the first color information matrix comprises chroma values of three colors to be processed, and the second color information matrix comprises chroma values of the three colors after color correction; an update correction unit configured to, when it is determined that there is a region causing oversaturation in the image to be processed, perform an updated correction operation, where the region includes a plurality of image points causing oversaturation, a colorimetric value of a first color corresponding to each of the image points causing oversaturation is smaller than a preset threshold, the first color being one of the three colors, and the updated correction operation includes: determining a second color correction matrix, wherein the correction amplitude of the second color correction matrix is lower than that of the first color correction matrix; providing the second color correction matrix to the processing unit to trigger the processing unit to perform correction processing again; the processing unit is further configured to perform color correction processing on the first color information matrix of each image point again by using the second color correction matrix, so as to update the second color information matrix of each image point.
In one possible implementation, the plurality of image points causing oversaturation are neighboring image points.
In a possible implementation, the number of the image points causing oversaturation is greater than a preset number threshold, or a ratio of the number of the image points causing oversaturation to the number of the image points included in the image to be processed is greater than a preset ratio threshold.
In one possible implementation, the determining the second color correction matrix includes: and adjusting the first color correction matrix to obtain a second color correction matrix.
In one possible implementation manner, the adjusting the first color correction matrix to obtain the second color correction matrix includes: and performing weighted average on the first color correction matrix and the identity matrix to obtain the second color correction matrix.
In one possible implementation, the update correction unit is configured to repeat the update correction operation when it is determined that there is a region causing oversaturation in the image to be processed, wherein the weighted average parameter α in the next update correction operation1Greater than the weighted average parameter α in the current updated correction operation2,α1And α2Is the weight of the above-mentioned identity matrix.
In a possible implementation manner, the update correction unit is further configured to: after the processing unit updates the second color information matrix of each image point, if the image to be processed still has the area causing the oversaturation, the updated correction operation is repeatedly executed until the image to be processed does not have the area causing the oversaturation.
In one possible implementation, the three colors include red, green, and blue.
In a possible implementation manner, the image to be processed is an image after automatic white balance.
In a fourth aspect, an embodiment of the present application provides a color correction apparatus, including: the preprocessing unit is used for respectively carrying out color correction preprocessing on a first color information matrix of each image block in a plurality of image blocks in an image to be processed by utilizing a first color correction matrix so as to obtain a second color information matrix of each image block, wherein the first color information matrix comprises chroma values of three colors to be processed, and the second color information matrix comprises chroma values of the three colors after color correction preprocessing; each image block comprises a plurality of image points, and the first color information matrix of each image block is the average of the first color information matrices of the image points; a determining unit, configured to determine a second color correction matrix when it is determined that an oversaturation-causing region exists in the image to be processed, where the region includes a plurality of oversaturated image blocks, a chroma value of a first color corresponding to each oversaturated image block is smaller than a preset threshold, the color is one of the three colors, and a correction amplitude of the second color correction matrix is lower than a correction amplitude of the first color correction matrix; and the color correction processing unit is used for respectively carrying out color correction processing on the first color information matrix of each image point in the image to be processed by utilizing the second color correction matrix.
In one possible implementation, the plurality of image blocks causing oversaturation is a plurality of adjacent image blocks.
In a possible implementation manner, the number of the image blocks causing oversaturation is greater than a preset number threshold, or a ratio of the number of the image blocks causing oversaturation to the number of the image blocks included in the image to be processed is greater than a preset ratio threshold.
In a possible implementation manner, the determining unit is configured to: when it is determined that there is a region causing oversaturation in the image to be processed, the first color correction matrix is adjusted to obtain the second color correction matrix.
In a possible implementation manner, the determining unit is configured to: and when the image to be processed is determined to have the area causing the oversaturation, carrying out weighted average on the first color correction matrix and the identity matrix to obtain the second color correction matrix.
In one possible implementation, the aboveThe determining unit is used for adjusting the first color correction matrix for multiple times to obtain the second color correction matrix when determining that the oversaturated region exists in the image to be processed, wherein the weighted average parameter α in the next adjustment1Greater than the weighted average parameter α in the current adjustment2,α1And α2Is the weight of the above-mentioned identity matrix.
In a possible implementation manner, after the determining unit determines the second color correction matrix and before the color correction processing unit performs the color correction processing, the second color correction matrix is provided to the preprocessing unit to trigger the preprocessing unit to perform the color correction processing again;
the preprocessing unit is further used for respectively performing color correction preprocessing on the first color information matrix of each image block in a plurality of image blocks in the image to be processed by utilizing the second color correction matrix so as to update the second color information matrix of each image block;
the determining unit is specifically configured to: if it is determined that the region causing the oversaturation still exists in the image to be processed, the operation of determining the second color correction matrix is repeatedly performed until it is determined that the region causing the oversaturation does not exist in the image to be processed.
In one possible implementation, the three colors include red, green, and blue.
Alternatively, in any possible implementation manner of the third aspect, the fourth aspect, or any one of the above, at least one unit may be implemented in software or hardware, or a combination thereof. Alternatively, a software-implemented unit may comprise a program of software instructions; a hardware implemented unit may comprise logic circuitry.
In a fifth aspect, an embodiment of the present application provides an image signal processor, including: the color correction device is provided by any one of the third aspect or any one of the implementation manners of the third aspect, the fourth aspect or any one of the implementation manners of the fourth aspect of the embodiments of the present application.
In a sixth aspect, an embodiment of the present application provides a color correction apparatus, which includes a processor, and may further optionally include a memory; the memory is configured to store program instructions, and the processor is configured to call the program instructions in the memory and execute the color correction method provided by any one of the implementation manners of the first aspect or the first aspect, the second aspect, or the second aspect of the embodiments of the present application.
In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer or a processor, the computer or the processor is caused to execute a color correction method provided in the first aspect or any one of the implementation manners of the first aspect, the second aspect, or any one of the implementation manners of the second aspect of the embodiment of the present application.
In an eighth aspect, the present application provides a computer program product, which when run on a computer or a processor, causes the computer or the processor to execute the color correction method provided in the first aspect or any one of the implementations of the first aspect, the second aspect, or any one of the implementations of the second aspect of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a block diagram of an electronic imaging device according to an embodiment of the present disclosure;
fig. 2 is a block diagram of an image signal processor according to an embodiment of the present disclosure;
fig. 3 is a structural diagram of a color correction apparatus according to an embodiment of the present disclosure;
FIG. 4 is a block diagram of another color calibration apparatus according to an embodiment of the present disclosure;
FIG. 5 is a flowchart of a color correction method according to an embodiment of the present disclosure;
FIG. 6 shows the AND image point Pi,jA schematic of adjacent image points;
FIG. 7 is a flowchart of another color correction method according to an embodiment of the present application;
fig. 8 is a structural diagram of another color correction apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described in detail and clearly with reference to the accompanying drawings.
Please first refer to fig. 1. Fig. 1 shows a schematic structural diagram of an electronic imaging device 10 provided in an embodiment of the present application. Electronic imaging device 10 may be, but is not limited to, a camera or camcorder, an electronic device including a camera or camcorder, such as a laptop computer, desktop computer, mobile phone, smart phone, tablet computer, or head mounted display device, etc., which may be used to acquire and process image data.
As shown in fig. 1, the electronic imaging device 10 may include: one or more processors 101, an input/output interface 102, a user interface 103, a display screen 104, a memory 105, an image signal processor 106, one or more imaging devices 107, an expansion card 108, a power supply 109, a network device 110, and at least one communication bus 111. Where a communication bus 111 is used to enable connection communication between these components, it should be understood that the various components in the electronic imaging device 10 may also be coupled by other connectors, which may include various interfaces, transmission lines, or buses, etc. In various embodiments of the present application, coupled means connected or communicated electrically with each other, including directly or indirectly through other devices.
The image signal processor 106: for processing image data acquired by the imaging device 107, such as but not limited to: detecting and correcting the defective pixel; carrying out sharpening processing on the image; carrying out automatic white balance correction processing on the image; and carrying out color correction processing on the image. The image data processed by the image signal processor 106 may be acquired from the memory 105 or may be acquired from the imaging device 107. Alternatively, the image signal processor 106 may complete the processing of the image data by calling computer program instructions in memory. Alternatively, the image signal processor 106 may also complete the processing of the image data by the image internal hardware logic processing circuit. That is, the image signal processor 106 may include a general-purpose processor such as a microprocessor or processing unit that executes software, or may include hardware logic circuits that perform processing, or may be a combination of both.
Input/output interface 102: interfaces for connecting various external devices, such as a power supply, an audio output device (e.g., headphones) or other electronic device (e.g., handheld device and/or computer), a printer, a projector, an external display, etc. Examples of the interface types that the input/output interface 102 can support are, but are not limited to, a Universal Serial Bus (USB) interface, an ethernet or modem interface, and an alternating current/direct current (AC/DC) power interface.
The user interface 103: instructions for receiving user input may include a keypad, physical buttons (push buttons, rocker buttons, etc.), dials, click wheels, and the like. In some possible embodiments, the user interface 103 and the display screen 104 may be integrated. For example, in the case where the display screen 104 is a touch screen, the electronic imaging device 10 may display an image through the touch screen, and may receive an instruction input by a user through the touch screen.
The processor 101 may include at least one of the following types: a general purpose Central Processing Unit (CPU), one or more microprocessors, Digital Signal Processors (DSPs), Micro Controllers (MCUs), or artificial intelligence processors (artificial intelligence processors), and may further include necessary hardware accelerators such as Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs), or integrated circuits for implementing logical operations. Processor 101 is coupled to one or more data buses for transferring data and instructions between the various components of electronic imaging device 10.
The memory 105 may include a non-power-down volatile memory, such as an embedded multimedia card (EMMC), a Universal Flash Storage (UFS), or a read-only memory (ROM). Optionally, the memory 105 may also include a power-down volatile memory (volatile memory), such as a Random Access Memory (RAM) or other types of dynamic storage devices that may store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium or other magnetic storage devices, or any other computer-readable storage medium that can be used to carry or store program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. Optionally, the memory 105 may also be at least one memory system located remotely from the processor 101. The memory 105, which is a type of computer storage medium, may include necessary software programs such as an operating system, a network communication module, a user interface module, and program instructions.
The electronic imaging device 10 may also include one or more expansion cards 108. Expansion card 108 may be used to add functionality to electronic imaging device 10. In one embodiment, expansion card 108 may be a flash memory card to provide a storage medium for electronic imaging device 10. In another embodiment, the expansion card 108 may be a Subscriber Identity Module (SIM) card for providing mobile phone call functionality for the electronic imaging device 10.
Electronic imaging device 10 may also include a network device 110, where network device 110 may be a network controller or a network interface card, and electronic imaging device 10 may connect to a network through network device 110. Or network device 110 may be a modem or radio unit for making wireless communication connections.
Electronic imaging device 10 may also include a power supply 109 for providing power for the operation of the various components of electronic imaging device 10. The power supply 109 may provide portable power as well as non-portable power to the electronic imaging device 10. In portable power supply, the power source 109 may be one or more batteries, such as a lithium ion battery, and may also be a power management unit that receives power from the batteries and further provides power to the network device 110. The battery may be recharged by connecting to an external power source, such as an outlet.
Display screen 104 for displaying various images generated by electronic imaging device 10, such as a Graphical User Interface (GUI) of an operating system, or image data (including still images and video data) processed by image signal processor 106. image data may include image data acquired using imaging device 107 or image data acquired from memory 105. display screen 104 may include any suitable type of display screen, such as a liquid crystal display (L CD), a plasma display, or an organic light-emitting diode (O L ED) display.
The imaging device 107 may acquire still images and moving images (e.g., video), and the imaging device 107 may be a camera or the like. The imaging device 107 may include a lens and one or more image sensors for capturing optical signals and converting the optical signals into electrical signals.
Next, an image signal processor 106 used in the electronic imaging device 10 according to an embodiment of the present application will be described with reference to the electronic imaging device 10 provided in fig. 1.
As shown in fig. 2, the image signal processor 106 may include at least: an automatic white balance device 1061 and a color correction device 1062. The automatic white balance device 1061 is configured to receive an input image, and perform automatic white balance processing on the input image to correct color shift of the input image, so that a white object in an original scene displays white in the image. The color correction device 1062 is configured to detect in advance whether a oversaturated region exists in the output image after color correction, adjust a color correction matrix if the oversaturated region exists, perform color correction processing on the image after automatic white balance output by the automatic white balance device 1061 according to the adjusted color correction matrix, and output the image after color correction. By adopting the image signal processor 106 in the embodiment of the application to process the input image, the details of the output image can be considered while the color vividness of the output image is improved, and the distortion phenomenon caused by color supersaturation is inhibited. The image signal processor 106 in the embodiment of the present application may further include other modules, such as a linear correction module, a noise removal module, a dead pixel removal module, an interpolation module, etc., which are not shown in fig. 2 and are not described herein. One or both of the automatic white balance device 1061 and the color correction device 1062 may be implemented in software, hardware, or a combination of software and hardware, which will be described in detail later.
In one possible embodiment, the color correction device 1062 may include a processing unit 10621 and an update correction unit 10622, as shown in fig. 3. Wherein:
the processing unit 10621: the color correction processing module is used for respectively carrying out color correction processing on the first color information matrix of each image point in a plurality of image points in the image to be processed by utilizing the first color correction matrix so as to obtain a second color information matrix of each image point.
Specifically, the first color information matrix includes colorimetric values of three colors to be processed, and the second color information matrix includes colorimetric values of the three colors after color correction. The chrominance values of the three colors correspond to three color channels, also called RBG values.
Specifically, the image to be processed is an image after automatic white balance.
Update correction unit 10622: and performing an updated correction operation when it is determined that there is a region causing oversaturation in the image to be processed. Wherein the region includes a plurality of image points causing oversaturation, and a chroma value of a first color corresponding to each image point causing oversaturation is smaller than a preset threshold, and the first color is one of the three colors.
Specifically, the updated correction operation includes:
and determining a second color correction matrix, wherein the correction amplitude of the second color correction matrix is lower than that of the first color correction matrix.
The second color correction matrix is provided to the processing unit 10621 to trigger the processing unit 10622 to perform the correction process again.
The processing unit 10621 is further configured to perform color correction processing on the first color information matrix of each image point again by using the second color correction matrix, so as to update the second color information matrix of each image point.
In particular, the plurality of image points causing supersaturation are adjacent image points.
Specifically, the number of the image points causing oversaturation is greater than a preset number threshold, or a ratio of the number of the image points causing oversaturation to the number of the image points included in the image to be processed is greater than a preset ratio threshold.
Specifically, the determining the second color correction matrix includes: the first color correction matrix is adjusted to obtain the second color correction matrix.
Specifically, the adjusting the first color correction matrix to obtain the second color correction matrix includes: and performing weighted average on the first color correction matrix and the identity matrix to obtain the second color correction matrix.
Specifically, the update correction unit 10622 is configured to repeat the updated correction operation when it is determined that there is an area causing oversaturation in the image to be processed, wherein the parameter α of the weighted average in the correction operation of the next update1Greater than the weighted average parameter α in the current updated correction operation2,α1And α2Is the weight of the above-mentioned identity matrix.
Specifically, the update correction unit 10622 is further configured to: after the processing unit 10621 updates the second color information matrix of each image point, if it is determined that there is still an area causing oversaturation in the image to be processed, the updated correction operation is repeatedly performed until it is determined that there is no area causing oversaturation in the image to be processed.
Specifically, the three colors include red, green, and blue. In a specific implementation, the three colors may also include other colors, which is not limited in this application.
By implementing the embodiment of the application, when the color correction matrix is adopted to perform the color correction on the image to be processed, whether an oversaturated area exists in the image to be processed is judged firstly, and if so, the amplitude of the color correction is reduced. When the saturation of the output image is improved, the scheme gives consideration to the details of the output image and inhibits the distortion phenomenon caused by color supersaturation.
In another possible embodiment, the color correction device 1062 may include a preprocessing unit 10623, a determining unit 10624, and a color correction processing unit 10625, as shown in fig. 4. Wherein:
the preprocessing unit 10623 is configured to perform color correction preprocessing on the first color information matrix of each image block in the multiple image blocks in the image to be processed by using the first color correction matrix, so as to obtain a second color information matrix of each image block. The first color information matrix comprises colorimetric values of three colors to be processed, and the second color information matrix comprises colorimetric values of the three colors after color correction pretreatment; each image block comprises a plurality of image points, and the first color information matrix of each image block is the average of the first color information matrices of the image points.
In the subsequent embodiments of the present application, an image including chroma values of M × N image blocks is referred to as a small color image.
A determining unit 10624, configured to determine a second color correction matrix when it is determined that an area causing oversaturation exists in the image to be processed, where the area includes a plurality of image blocks causing oversaturation, a chroma value of a first color corresponding to each image block causing oversaturation is smaller than a preset threshold, the color is one of the three colors, and a correction amplitude of the second color correction matrix is lower than a correction amplitude of the first color correction matrix.
Specifically, the plurality of image blocks adjacent to the image block causing oversaturation.
Optionally, the number of the image blocks causing over-saturation is greater than a preset number threshold.
Optionally, a ratio of the number of the image blocks causing oversaturation to the number of the image blocks included in the image to be processed is greater than a preset ratio threshold.
Specifically, the determination unit 10624 is configured to: when it is determined that there is a region causing oversaturation in the image to be processed, the first color correction matrix is adjusted to obtain the second color correction matrix.
Specifically, the determination unit 10624 is configured to: and when the image to be processed is determined to have the area causing the oversaturation, carrying out weighted average on the first color correction matrix and the identity matrix to obtain the second color correction matrix.
Specifically, the determining unit 10624 is configured to, when it is determined that there is an area causing oversaturation in the image to be processed, perform multiple adjustments on the first color correction matrix to obtain the second color correction matrix, wherein the parameter α of weighted average in the next adjustment is used for obtaining the parameter α of weighted average1Greater than the weighted average parameter α in the current adjustment2,α1And α2Is the weight of the above-mentioned identity matrix.
Specifically, after the determining unit 10624 determines the second color correction matrix, and before the color correction processing unit 10625 performs the color correction processing, the second color correction matrix is provided to the preprocessing unit 10623, so as to trigger the preprocessing unit 10623 to perform the color correction processing again.
The preprocessing unit 10623 is further configured to perform color correction preprocessing on the first color information matrix of each image block in the multiple image blocks in the image to be processed by using the second color correction matrix, so as to update the second color information matrix of each image block.
The determining unit 10624 is specifically configured to: if it is determined that the region causing the oversaturation still exists in the image to be processed, the operation of determining the second color correction matrix is repeatedly performed until it is determined that the region causing the oversaturation does not exist in the image to be processed.
The color correction processing unit 10625 is configured to perform color correction processing on the first color information matrix of each image point in the image to be processed by using the second color correction matrix.
Specifically, after the determining unit 10624 determines the second color correction matrix, the finally determined second color correction matrix is used to perform color correction processing on the first color information matrix of each image point in the image to be processed, so as to obtain the second color information matrix of each image point in the image to be processed, and finally, the image after color correction processing is output.
By implementing the embodiment of the application, the image to be processed can be preprocessed before the color correction matrix is adopted to perform the color correction on the image to be processed, so that whether an oversaturated area exists in the image to be processed or not is judged, and if the oversaturated area exists, the amplitude of the color correction is reduced. After determining a suitable color correction matrix, the color correction matrix is used for color correction processing. When the saturation of the output image is improved, the scheme gives consideration to the details of the output image and inhibits the distortion phenomenon caused by color supersaturation. Further, the small color image in the embodiment of the application is obtained according to the image after automatic white balance correction, the image after automatic white balance correction is divided into a plurality of image blocks, and the first color information matrix of each image block is an average of the first color information matrices of all the image points included in the image block. A color palette is an image comprising chrominance values of several image blocks. The small color image can accurately represent the color characteristics of the input image, the number of image blocks is small, and the calculation amount for determining the color correction matrix is reduced.
Next, a color correction method provided by an embodiment of the present application is described with reference to fig. 1 to 4. As shown in fig. 5, the color correction method may include at least the following steps, which may be performed by the color correction apparatus 1602:
s101: and respectively carrying out color correction processing on the first color information matrix of each image point in a plurality of image points in the image to be processed by utilizing the first color correction matrix so as to obtain a second color information matrix of each image point.
Specifically, the first color information matrix includes colorimetric values of three colors to be processed, and the second color information matrix includes colorimetric values of the three colors after color correction.
Specifically, the image to be processed is an image after automatic white balance correction. Because the original white object in the original input image before the automatic white balance correction has colors in the image, the accuracy of the output image after the color correction is affected. Therefore, the color correction is performed on the image after the automatic white balance correction, and the output image after the color correction can be more accurate.
Specifically, each image point includes three different colors, the first color information matrix of each image point is composed of chrominance values of the three colors, that is, the first color information matrix of each image point includes 3 elements, each element is also called a color channel, and represents a chrominance value of one color, respectively, and the first color information matrix of each image point may be a matrix of 3 × 1, or a matrix of 1 × 3, and represents the RBG value as described above.
Optionally, if the color information matrix of each image point is a matrix of 3 × 1, the performing, by using the first color correction matrix, the color correction processing on the first color information matrix of each image point in the image to be processed to obtain the second color information matrix of each image point may be to multiply the first color correction matrix with the first color information matrix of each image point in the image to be processed to obtain the second color information matrix of each image point.
Specifically, a first color correction matrix is multiplied by a first color information matrix of each image point in the image to be processed, so that a multiplied matrix can be obtained, the multiplied matrix is a color-corrected second color information matrix of the image point, the color-corrected second color information matrix comprises three elements, and each element represents a chromatic value of one color.
Illustratively, if the first color correction matrix
Figure PCTCN2018102081-APPB-000002
The image to be processed comprises M × N image points, each of which comprises three colors of red (R), green (G) and blue (B), then the image point B of the ith row and the jth columni,jThe first color information matrix is
Figure PCTCN2018102081-APPB-000003
The image point b after color correctioni,j' of the second color information matrix
Figure PCTCN2018102081-APPB-000004
The calculation formula of (a) is as follows:
Figure PCTCN2018102081-APPB-000005
the chrominance value R of the color corrected red color of the image point is then determinedi,j′=a11*Ri,j+a12*Gi,j+a13*Bi,j
The color-corrected chromatic value G of green of the image pointi,j′=a21*Ri,j+a22*Gi,j+a23*Bi,j
The color-corrected blue chrominance value B of the image pointi,j′=a31*Ri,j+a32*Gi,j+a33*Bi,j
Alternatively, if the first color information matrix of each image point is a matrix of 1 × 3, the first color correction matrix may be a transpose of the first color correction matrix a, i.e. aT. The first color information matrix of each image point in the image to be processed is subjected to color correction processing by using the first color correction matrix to obtain the second color information matrix of each image point, namely the first color information matrix of each image point in the image to be processedThe information matrix is multiplied by the first color correction matrix to obtain a second color correction matrix. The specific calculation method is as follows:
Figure PCTCN2018102081-APPB-000006
in the following embodiments of the present application, the first color information matrix of each image point is illustrated as a matrix of 3 × 1.
S102: and judging whether an oversaturated area exists in the image to be processed, if so, executing S103, and if not, executing S105.
In particular, the oversaturation-causing region includes a plurality of oversaturation-causing image points, each having a chrominance value of the first color smaller than a preset threshold value. Wherein the first color is one of the three colors.
Specifically, the preset threshold is a negative number, such as but not limited to-6, -8, -10, etc. If the chroma value of the first color of an image point in the image to be processed after color correction is smaller than the preset threshold value, the image point in the image to be processed is indicated as an image point causing supersaturation. A plurality of image points of the color-corrected first color having chrominance values smaller than the predetermined threshold value constitute the region causing oversaturation.
Further, the plurality of image points causing the oversaturation are adjacent.
Specifically, the image point above, below, left, right, above-left, below-left, above-right, and below-right of a certain image point in the image to be processed can be regarded as the image point adjacent to the image point. For example, with the image point P in the ith row and jth columni,jThe neighboring image points may include: pi-1,j-1(upper left), Pi-1,j(upper) Pi-1,j+1(upper right), Pi,j-1(left) Pi,j+1(Right), Pi+1,j-1(lower left), Pi+1,j(lower), Pi+1,j+1(lower right). As shown in fig. 6.
Optionally, a ratio of the number of image points causing oversaturation to the number of image points comprised by the image to be processed is larger than a preset ratio threshold. The preset ratio threshold may be, for example, but not limited to, 0.2%, 0.4%, 1%, and the like. The smaller the preset proportion threshold value is, the smaller the distortion of the output image after color correction is.
Optionally, the number of the plurality of image points causing oversaturation is larger than a preset number threshold. The preset number threshold may be, for example, but not limited to, 10, 20, 50, and the like. The smaller the preset number threshold, the smaller the distortion of the output image after color correction. Specifically, the correction range of the second color correction matrix is lower than the correction range of the first color correction matrix. The second color correction matrix may be obtained by adjusting the first color correction matrix.
S103: a second color correction matrix is determined.
Wherein the correction amplitude of the second color correction matrix is lower than the correction amplitude of the first color correction matrix.
Specifically, the first color correction matrix and the identity matrix may be weighted and averaged to obtain the second color correction matrix.
Specifically, the calculation formula for obtaining the second color correction matrix by performing weighted average on the first color correction matrix and the identity matrix is as follows:
A2=α×I+(1-α)×A1 (1)
wherein A is1Is a first color correction matrix, A2Is a second color correction matrix, I is an identity matrix, α is a weight of the identity matrix, α∈ [0, 1 ]]. The operation of the above formula is equivalent to smoothing the first color correction matrix and the identity matrix so that the obtained second color correction matrix is more close to the identity matrix, thereby reducing the correction amplitude.
Specifically, the process of performing the weighted average of the first color correction matrix and the identity matrix to obtain the second color correction matrix may be repeated several times, and the weighted average parameter α of the next operation may be1Greater than the weighted average parameter α in the current corrective action2,α1And α2Are the weights of the identity matrix. Implement the present inventionThe embodiments can suppress an image distortion phenomenon caused by color oversaturation.
S104: and respectively carrying out color correction processing on the first color information matrix of each image point by using the second color correction matrix so as to update the second color information matrix of each image point.
Specifically, after the second color information matrix of each image point is updated by using the second color correction matrix, if there is still a region causing oversaturation in the image to be processed, S102 is repeatedly performed until there is no region causing oversaturation in the image to be processed.
Specifically, the initial value of α is 0, and each time S103 is executed, the parameter α is modified, specifically, the value of α is incremented by β, that is, α is α + β, where β∈ (0, 1) and β are the adjustment steps.
In the formula (1), when α is equal to 0, the second color correction matrix is the first color correction matrix, which represents that the original color gain intensity is maintained, and if α is equal to 1, which represents that the second color correction matrix is the identity matrix, the color gain intensity is 1 (i.e. no color gain), the value of R 'G' B 'is completely equal to the RGB value, and the larger the α value is, the more components are added to the identity matrix in the first color correction matrix, the less the value of R' G 'B' in the image to be processed is.
When a new image to be processed is input, the initial value of the parameter α is set to 0, and the first color correction matrix multiplied by the image to be processed is A1At this time A2Is equal to A1(namely the first color correction matrix determined by the system in default), judging whether an oversaturated area exists in the image to be processed, if so, increasing α value, generating a new second color correction matrix to be multiplied by the first color information matrix of each image point of the image to be processed, judging whether the oversaturated area exists in the image to be processed, and repeating the calculation until the oversaturated area does not exist in the image to be processed and the final A is2I.e. the output CC matrix (newly adjusted CC module 3x3 matrix). Reuse of A2Performing color correction processing on the first color information matrix of each image point of the image to be processed, adding α values each timeThe amplitude is defined as β, also called the adjustment step size, the larger the β value is, the fewer iterations are required, but A2The error is larger from the optimal CC matrix, which is a matrix with the oversaturated area smaller than the ratio threshold and capable of maintaining the maximum color gain, β in this embodiment of the present application is 0.01.
S105: and outputting the color corrected image. It can be known that, after the second color information matrix of each image point is updated by using the second color correction matrix, if an area causing oversaturation still exists in the image to be processed, the image after color correction can also be directly output, and the oversaturation phenomenon in the output image can be suppressed to a certain extent only by making the correction amplitude of the second color correction matrix lower than that of the first color correction matrix.
By implementing the embodiment of the application, when the color correction matrix is adopted to perform color correction on the image to be processed, whether the phenomenon of color oversaturation is generated or not is judged firstly, so that the output image is distorted. If this results in distortion of the output image, the magnitude of the color correction is reduced. The saturation of the output image is improved, the details of the output image are considered, and the distortion phenomenon caused by color oversaturation is restrained.
As shown in fig. 7, the color correction method at least includes the following steps, which can be executed by the color correction apparatus 1602:
s401: an image after automatic white balance correction is input.
Specifically, in the original input image before the automatic white balance correction, an originally white object may have colors in the image, which may affect the accuracy of the output image after the color correction. Therefore, the input image in the embodiment of the present application is an image after automatic white balance correction.
S402: a small color image is generated from the image after the automatic white balance correction.
Specifically, in the embodiment of the present application, the image to be processed is a small color image obtained according to an image after automatic white balance correction, where the small color image is an image including chroma values of M × N image blocks, each image block includes a plurality of image points, and a first color information matrix of each image block is an average of first color information matrices of the plurality of image points included in the image block.
The image after automatic white balance correction comprises 100 × image points, each image point comprises three different colors of red (red, R), green (green, G) and blue (blue, B), the image after automatic white balance correction is divided into 10 × image blocks, the image block of the ith row and the jth column comprises 10 × image points (1 ≦ i ≦ M, 1 ≦ j ≦ N), and the average value of all sub-image point colorimetric values of all image points (10 × 10 image points) contained in the block comprises the average value of all R colorimetric values
Figure PCTCN2018102081-APPB-000007
Average of all G chroma values
Figure PCTCN2018102081-APPB-000008
Average of all B chroma values
Figure PCTCN2018102081-APPB-000009
The chroma value of R of the image block of the ith row and the jth column in the image to be processed is obtained;
Figure PCTCN2018102081-APPB-000010
the chroma value of G of the image block of the ith row and the jth column in the image to be processed is obtained;
Figure PCTCN2018102081-APPB-000011
namely the chroma value of B of the image block of the ith row and the jth column in the image to be processed.
S403: and respectively carrying out color correction pretreatment on the first color information matrix of each image block in the small color image by using the first color correction matrix to obtain a second color information matrix of each image block.
Specifically, each image block in the small color image includes three different colors, and the first color information matrix of each image block is composed of chromatic values of the three colors, that is, the first color information matrix of each image block includes 3 elements, and each element represents a chromatic value of one color respectively.
Specifically, the first color correction matrix is multiplied by the first color information matrix of each image block in the small color image to obtain the second color information matrix of each image block.
S404: and judging whether the small color image has an oversaturated area, if so, executing S405, and if not, executing S407.
Specifically, the area causing oversaturation includes a plurality of image blocks causing oversaturation, and a colorimetric value of a first color of each image block to be processed causing oversaturation is smaller than a preset threshold. Wherein the first color is one of the three colors.
Specifically, the preset threshold is a negative number, such as but not limited to-6, -8, -10, etc. If the chroma value of the first color of an image block in the small color image after color correction preprocessing is smaller than the preset threshold, the image block in the small color image is indicated to be an image block causing oversaturation. The image blocks of the first color having chrominance values smaller than the preset threshold value after the color correction preprocessing constitute the region causing the oversaturation.
Further, the plurality of image blocks causing oversaturation are adjacent. For the meaning of the image block neighborhood, refer to the description of the neighboring image points in fig. 6, which is not described herein again.
Optionally, a ratio of the number of the image blocks causing the over saturation to the number of the image blocks contained in the small color map is larger than a preset ratio threshold.
Optionally, the number of the plurality of image blocks causing over-saturation is larger than a preset number threshold.
S405: a second color correction matrix is determined.
In particular, the correction amplitude of the second color correction matrix is lower than the correction amplitude of the first color correction matrix.
Specifically, if it is determined in S404 that there is an oversaturated region in the small color image, it indicates that there will be an oversaturated region in the color-corrected output image, and the color correction matrix needs to be adjusted. Specifically, the first color correction matrix and the identity matrix may be weighted and averaged to obtain the second color correction matrix, and the calculation formula is shown in formula (1), which is not described herein again.
S406: and respectively carrying out color correction preprocessing on the first color information matrix of each image block by using the second color correction matrix so as to update the second color information matrix of each image block.
Specifically, after the second color information matrix of each image block is updated, S404 is executed again, whether an area causing oversaturation exists in the small color image is judged according to the second color information matrix, if so, the second color information matrix is determined again, and a final second color information matrix is determined until the area causing oversaturation does not exist in the small color image.
S407: and carrying out color correction processing on the image after the automatic white balance correction.
Specifically, in the embodiment of the present application, the color correction processing is performed on the image after the automatic white balance correction, that is, the color correction processing is performed on the first color information matrix of each image point in the image to be processed. The main difference between this embodiment and the flowchart of fig. 5 is that there is a pre-correction process, and whether there is oversaturation for adjustment is determined by pre-correction, and since pre-correction is for image blocks rather than for internal image points, pre-correction is less complex and simpler to implement.
Specifically, if it is determined that there is no oversaturated region in the small color image according to the second color information matrix of each image block after the second color information matrix is obtained according to the first color correction matrix and the first color information matrix of each image block in the small color image, the first color correction matrix is used to perform color correction processing on the image after the automatic white balance correction input in S401, and finally, the image after color correction is output. And if the color correction preprocessing is performed on the first color information matrix of the small color image through the second color correction matrix obtained by adjusting the first color correction matrix at least once to obtain the updated second color information matrix, and the small color image is judged to have no oversaturated area according to the second color information matrix, performing color correction processing on the image subjected to automatic white balance correction and input in the S401 by adopting the second color correction matrix obtained by adjusting for the last time, and finally outputting the image subjected to color correction.
It can be known that, if the color correction preprocessing is performed on the first color information matrix of the small color image through the second color correction matrix obtained by performing weighted average on the first color correction matrix and the unit matrix at least once to obtain the updated second color information matrix, and when the area causing the oversaturation is still present in the small color image according to the second color information matrix, the determined latest second color correction matrix can be directly used to perform the color correction processing on the image after the automatic white balance correction input in S401, and the image after the color correction is finally output, so that the phenomenon of color oversaturation can be suppressed to a certain extent. By implementing the embodiment of the application, before the first color correction matrix is adopted to perform color correction on the image after automatic white balance correction, whether a color oversaturation phenomenon occurs or not is judged according to the small color image, so that the output image is distorted. If the output image is distorted, the correction amplitude of the color correction matrix is reduced until the output image is not distorted. The saturation of the output image is improved, the details of the output image are considered, and the output image is ensured not to be distorted. In addition, the image after the automatic white balance correction is subjected to segmentation processing, and the small color images obtained after segmentation can accurately represent the color characteristics of the image after the automatic white balance correction, and the calculation amount is reduced.
Referring to fig. 8, fig. 8 is a schematic diagram of a color correction apparatus 20 according to an embodiment of the present disclosure. As shown in fig. 8, the color correction device 50 can be at least one specific implementation of the image signal processor 106 or the device 1602. The apparatus 50 comprises: a processor 520, which may further optionally include a memory 510; wherein: memory 510 is used to store program instructions; processor 520 is configured to call program instructions in memory 510 and perform the color correction methods provided by the embodiment of fig. 5 or fig. 7. The apparatus 50 of fig. 8 includes the memory 510, but in practice the memory 510 may be located outside the processor 520 (not shown in the figure), i.e. the memory 510 may be external to the image signal processor 106 or the apparatus 1602.
It should be noted that the color correction device 1062 in the embodiments of fig. 3 and 4 can be implemented by software, and can also be implemented by hardware. If the hardware implementation is implemented, the hardware implementation may be implemented by using logic circuits, that is, the processing unit 10621 and the update correcting unit 10622 may be implemented by using logic circuits, respectively; the preprocessing unit 10623, the determination unit 10624, and the color correction processing unit 10625 may also be implemented by logic circuits, respectively. That is, when one or more of the units shown in fig. 3 and 4 are implemented in hardware, a large number of logic circuits are included therein, and the processing function is implemented by the hardware logic circuits. If one or more of the units referred to in fig. 3 and 4 are implemented by software, each unit may include program instructions for implementing the corresponding functions, and the related program instructions may be stored in the memory 510 in the embodiment of fig. 8 and executed by the processor 520 to implement the color correction method provided in the embodiment of fig. 5 or 7. Alternatively, in one embodiment, the image signal processor 106 or the device 1062 may also be implemented by a combination of software and hardware, that is, a part of the units is implemented by logic circuits, and another part is stored in the memory 510 in the form of software instructions and executed by the processor 520. Alternatively, any of the units may also be implemented in software, hardware or a combination thereof, i.e. comprising at least one of software programs, or hardware circuits. This embodiment is not limited thereto. The processor 520 in the apparatus 50 shown in fig. 8 thus implements the relevant method mentioned in the previous embodiment by executing a software program, and may include, in addition to the kernel running the program, a necessary hardware accelerator that may make the logic of any of the units shown previously. The apparatus 50 in this case is implemented by a combination of software and hardware. Therefore, the processor 520 may include hardware implemented by logic circuits in addition to a processor unit running a software program, and the embodiment is not limited thereto.
The embodiment of the application also provides a computer readable storage medium. All or part of the processes in the above method embodiments may be performed by relevant hardware instructed by a computer program, which may be stored in the above computer storage medium, and when executed, may include the processes in the above method embodiments. The computer-readable storage medium includes: various media that can store program codes, such as a read-only memory (ROM) or a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in or transmitted over a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The modules in the device can be merged, divided and deleted according to actual needs.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (34)

  1. A color correction method, comprising:
    respectively carrying out color correction processing on a first color information matrix of each image point in a plurality of image points in an image to be processed by utilizing a first color correction matrix to obtain a second color information matrix of each image point, wherein the first color information matrix comprises chroma values of three colors to be processed, and the second color information matrix comprises chroma values of the three colors after color correction;
    when it is determined that there is a region causing oversaturation in the image to be processed, performing an updated correction operation, wherein the region includes a plurality of image points causing oversaturation, a chroma value of a first color corresponding to each image point causing oversaturation is smaller than a preset threshold, the first color being one of the three colors, the updated correction operation including:
    determining a second color correction matrix, wherein the correction amplitude of the second color correction matrix is lower than that of the first color correction matrix;
    and respectively carrying out color correction processing on the first color information matrix of each image point by using the second color correction matrix so as to update the second color information matrix of each image point.
  2. The method of claim 1, wherein the plurality of image points causing supersaturation are neighboring image points.
  3. A method as claimed in claim 1 or 2, wherein the number of image points causing oversaturation is larger than a preset number threshold or the ratio of the number of image points causing oversaturation to the number of image points comprised by the image to be processed is larger than a preset ratio threshold.
  4. The method of any of claims 1-3, wherein the determining the second color correction matrix comprises: and adjusting the first color correction matrix to obtain the second color correction matrix.
  5. The method of claim 4, wherein the adjusting the first color correction matrix to obtain the second color correction matrix comprises: and carrying out weighted average on the first color correction matrix and the identity matrix to obtain the second color correction matrix.
  6. The method of claim 5, wherein performing the updated correction operation comprises repeatedly performing the updated correction operation, wherein a weighted average parameter α in a next updated correction operation1Greater than the weighted average parameter α in the current updated correction operation2,α1And α2Are the weights of the identity matrix.
  7. The method of any of claims 1-6, wherein after updating the second color information matrix for each image point, if it is determined that there are still regions causing oversaturation in the image to be processed, then repeating the updated correction operation until it is determined that there are no regions causing oversaturation in the image to be processed.
  8. The method of any one of claims 1-7, wherein the three colors include red, green, and blue.
  9. The method of any one of claims 1-8, wherein the image to be processed is an automatically white balanced image.
  10. A color correction method, comprising:
    respectively carrying out color correction pretreatment on a first color information matrix of each image block in a plurality of image blocks in an image to be processed by utilizing a first color correction matrix to obtain a second color information matrix of each image block, wherein the first color information matrix comprises colorimetric values of three colors to be processed, and the second color information matrix comprises the colorimetric values of the three colors after the color correction pretreatment; each image block comprises a plurality of image points, and the first color information matrix of each image block is the average of the first color information matrices of the image points;
    when determining that an oversaturation-causing area exists in the image to be processed, determining a second color correction matrix, wherein the area comprises a plurality of oversaturation-causing image blocks, a colorimetric value of a first color corresponding to each oversaturation-causing image block is smaller than a preset threshold, the first color is one of the three colors, and a correction amplitude of the second color correction matrix is lower than that of the first color correction matrix;
    and performing color correction processing on the first color information matrix of each image point in the image to be processed by using the second color correction matrix.
  11. The method of claim 10, wherein the plurality of image blocks causing oversaturation is a plurality of adjacent image blocks.
  12. The method according to claim 10 or 11, wherein the number of the plurality of image blocks causing oversaturation is greater than a preset number threshold, or a ratio of the number of the plurality of image blocks causing oversaturation to the number of the plurality of image blocks included in the image to be processed is greater than a preset ratio threshold.
  13. The method of any of claims 10-12, wherein the determining a second color correction matrix comprises: and adjusting the first color correction matrix to obtain the second color correction matrix.
  14. The method of claim 13, wherein the adjusting the first color correction matrix to obtain the second color correction matrix comprises: and carrying out weighted average on the first color correction matrix and the identity matrix to obtain the second color correction matrix.
  15. The method of claim 14, wherein the adjusting the first color correction matrix to obtain the second color correction matrix comprises adjusting the first color correction matrix a plurality of times to obtain the second color correction matrix, wherein a weighted average parameter in a next adjustment is α1Greater than the weighted average parameter α in the current adjustment2,α1And α2Are the weights of the identity matrix.
  16. The method according to any one of claims 10-15, wherein after determining the second color correction matrix, before performing the color correction process on the first color information matrix of each image point in the image to be processed by using the second color correction matrix, the method further comprises: respectively carrying out color correction preprocessing on the first color information matrix of each image block in a plurality of image blocks in the image to be processed by utilizing the second color correction matrix so as to update the second color information matrix of each image block;
    if it is determined that the region causing the oversaturation still exists in the image to be processed, the operation of determining the second color correction matrix is repeatedly performed until it is determined that the region causing the oversaturation does not exist in the image to be processed.
  17. The method of any one of claims 10-16, wherein the three colors include red, green, and blue.
  18. A color correction apparatus, comprising:
    the processing unit is used for respectively carrying out color correction processing on a first color information matrix of each image point in a plurality of image points in an image to be processed by utilizing a first color correction matrix so as to obtain a second color information matrix of each image point, wherein the first color information matrix comprises chroma values of three colors to be processed, and the second color information matrix comprises chroma values of the three colors after color correction;
    an update correction unit configured to, when it is determined that there is a region causing oversaturation in the image to be processed, perform an updated correction operation, wherein the region includes a plurality of image points causing oversaturation, a colorimetric value of a first color corresponding to each image point causing oversaturation is smaller than a preset threshold, the first color being one of the three colors, the updated correction operation including:
    determining a second color correction matrix, wherein the correction amplitude of the second color correction matrix is lower than that of the first color correction matrix;
    providing the second color correction matrix to the processing unit to trigger the processing unit to perform correction processing again;
    the processing unit is further configured to perform color correction processing on the first color information matrix of each image point again by using the second color correction matrix, so as to update the second color information matrix of each image point.
  19. The apparatus of claim 18, wherein the plurality of image points adjacent to the image point that causes oversaturation.
  20. An apparatus as claimed in claim 18 or 19, wherein the number of the plurality of image points causing oversaturation is larger than a preset number threshold or a ratio of the number of the plurality of image points causing oversaturation to the number of the plurality of image points comprised by the image to be processed is larger than a preset ratio threshold.
  21. The apparatus of any of claims 18-20, wherein the determining the second color correction matrix comprises: and adjusting the first color correction matrix to obtain a second color correction matrix.
  22. The apparatus of claim 21, wherein the adjusting the first color correction matrix to obtain the second color correction matrix comprises: and carrying out weighted average on the first color correction matrix and the identity matrix to obtain the second color correction matrix.
  23. The apparatus of claim 22, wherein the update correction unit is operative to repeat the updated correction operation when it is determined that there is a region causing oversaturation in the image to be processed, wherein a weighted average parameter α in a next updated correction operation1Greater than the weighted average parameter α in the current updated correction operation2,α1And α2Are the weights of the identity matrix.
  24. The apparatus of any of claims 18-23, wherein the update correction unit is further to: after the processing unit updates the second color information matrix of each image point, if it is determined that the region causing the oversaturation still exists in the image to be processed, the updated correction operation is repeatedly performed until it is determined that the region causing the oversaturation does not exist in the image to be processed.
  25. The apparatus of any one of claims 18-24, wherein the three colors comprise red, green, and blue.
  26. The apparatus according to any of claims 18-25, wherein the image to be processed is an automatically white balanced image.
  27. A color correction apparatus, comprising:
    the preprocessing unit is used for respectively carrying out color correction preprocessing on a first color information matrix of each image block in a plurality of image blocks in an image to be processed by utilizing a first color correction matrix so as to obtain a second color information matrix of each image block, wherein the first color information matrix comprises chroma values of three colors to be processed, and the second color information matrix comprises chroma values of the three colors after color correction preprocessing; each image block comprises a plurality of image points, and the first color information matrix of each image block is the average of the first color information matrices of the image points;
    the determination unit is used for determining a second color correction matrix when determining that an oversaturation-causing area exists in the image to be processed, wherein the area comprises a plurality of oversaturated image blocks, the colorimetric value of a first color corresponding to each oversaturated image block is smaller than a preset threshold, the first color is one of the three colors, and the correction amplitude of the second color correction matrix is lower than that of the first color correction matrix;
    and the color correction processing unit is used for respectively carrying out color correction processing on the first color information matrix of each image point in the image to be processed by utilizing the second color correction matrix.
  28. The apparatus of claim 27, wherein the plurality of tiles causing oversaturation are adjacent tiles.
  29. The apparatus of claim 27 or 28, wherein the number of the plurality of image patches causing over-saturation is greater than a preset number threshold, or a ratio of the number of the plurality of image patches causing over-saturation to the number of the plurality of image patches included in the image to be processed is greater than a preset ratio threshold.
  30. The apparatus according to any of claims 27-29, wherein the determining unit is configured to: when it is determined that there is a region in the image to be processed that causes oversaturation, the first color correction matrix is adjusted to obtain the second color correction matrix.
  31. The apparatus of claim 30, wherein the determination unit is to: and when the image to be processed is determined to have the area causing the oversaturation, carrying out weighted average on the first color correction matrix and an identity matrix to obtain a second color correction matrix.
  32. The apparatus according to claim 31, wherein said determining unit is configured to perform a plurality of adjustments of said first color correction matrix to obtain said second color correction matrix when it is determined that there is a region causing oversaturation in said image to be processed, and wherein a parameter α of a weighted average in a next adjustment is α1Greater than the weighted average parameter α in the current adjustment2,α1And α2Are the weights of the identity matrix.
  33. The apparatus according to any one of claims 27 to 32, wherein after the determining unit determines the second color correction matrix, the color correction processing unit provides the second color correction matrix to the preprocessing unit before performing the color correction processing to trigger the preprocessing unit to perform the preprocessing for re-color correction;
    the preprocessing unit is further used for respectively carrying out color correction preprocessing on the first color information matrix of each image block in a plurality of image blocks in the image to be processed by utilizing the second color correction matrix so as to update the second color information matrix of each image block;
    the determining unit is specifically configured to: if it is determined that the region causing the oversaturation still exists in the image to be processed, the operation of determining the second color correction matrix is repeatedly performed until it is determined that the region causing the oversaturation does not exist in the image to be processed.
  34. The apparatus of any one of claims 27-33, wherein the three colors comprise red, green, and blue.
CN201880081358.8A 2018-08-24 2018-08-24 Color correction method and device Pending CN111480331A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/102081 WO2020037635A1 (en) 2018-08-24 2018-08-24 Color correction method and apparatus

Publications (1)

Publication Number Publication Date
CN111480331A true CN111480331A (en) 2020-07-31

Family

ID=69592193

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201880081358.8A Pending CN111480331A (en) 2018-08-24 2018-08-24 Color correction method and device

Country Status (2)

Country Link
CN (1) CN111480331A (en)
WO (1) WO2020037635A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020140865A1 (en) * 2001-03-30 2002-10-03 Nec Viewtechnology, Ltd. Method of correcting color saturation of video signals
CN1758704A (en) * 2005-11-11 2006-04-12 北京中星微电子有限公司 Realizing method of color matrix in color correction
CN102045575A (en) * 2009-10-21 2011-05-04 英属开曼群岛商恒景科技股份有限公司 Pixel color correction method and pixel color correction device
CN105827897A (en) * 2015-11-16 2016-08-03 维沃移动通信有限公司 Adjustment card manufacturing method, system, color correction matrix debugging method and device
CN107958470A (en) * 2017-12-18 2018-04-24 维沃移动通信有限公司 A kind of color correcting method, mobile terminal

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7215343B2 (en) * 2003-01-30 2007-05-08 Eastman Kodak Company Color correction using a device-dependent display profile
KR20050112319A (en) * 2004-05-25 2005-11-30 삼성전자주식회사 Apparatus for color conversion whit circular gamut mapping and method thereof
US7430061B2 (en) * 2005-01-06 2008-09-30 Toshiba Corporation System and method to eliminate clipping during color conversion
CN104219511A (en) * 2013-06-03 2014-12-17 鸿富锦精密工业(深圳)有限公司 Color correction system and method
CN105323459B (en) * 2015-05-25 2018-10-16 维沃移动通信有限公司 Image processing method and mobile terminal
JP2018082312A (en) * 2016-11-16 2018-05-24 富士ゼロックス株式会社 Image control device, patch chart, image forming method, and program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020140865A1 (en) * 2001-03-30 2002-10-03 Nec Viewtechnology, Ltd. Method of correcting color saturation of video signals
CN1758704A (en) * 2005-11-11 2006-04-12 北京中星微电子有限公司 Realizing method of color matrix in color correction
CN102045575A (en) * 2009-10-21 2011-05-04 英属开曼群岛商恒景科技股份有限公司 Pixel color correction method and pixel color correction device
CN105827897A (en) * 2015-11-16 2016-08-03 维沃移动通信有限公司 Adjustment card manufacturing method, system, color correction matrix debugging method and device
CN107958470A (en) * 2017-12-18 2018-04-24 维沃移动通信有限公司 A kind of color correcting method, mobile terminal

Also Published As

Publication number Publication date
WO2020037635A1 (en) 2020-02-27

Similar Documents

Publication Publication Date Title
CN111641819B (en) Method, device, system and computer device for white balance gain correction
CN110248170B (en) Image color adjusting method and device
CN106409212B (en) Gamma curve adjusting method and device
EP2879375A1 (en) Techniques to reduce color artifacts in a digital image
CN111670575B (en) White balance processing method and device for image
CN112788322B (en) Adaptive white balance processing method, device, medium, and electronic apparatus
US11962917B2 (en) Color adjustment method, color adjustment device, electronic device and computer-readable storage medium
CN112218065A (en) Image white balance method, system, terminal device and storage medium
CN110751607A (en) Skin color correction method and device, storage medium and electronic device
CN111587573B (en) Image processing method and device and computer storage medium
US10055823B2 (en) Method for generating a pixel filtering boundary for use in auto white balance calibration
CN106971375B (en) Image amplification processing method and device
CN108574835B (en) Method and device for correcting image colors in equipment screen
CN111656759A (en) Image color correction method and device and storage medium
CN117156289A (en) Color style correction method, system, electronic device, storage medium and chip
US9715720B1 (en) System and method for reducing image noise
CN111480331A (en) Color correction method and device
CN112492286A (en) Automatic white balance correction method, device and computer storage medium
CN115965541A (en) Color correction method, color correction device, electronic device, and storage medium
CN113271450B (en) White balance adjusting method, image processing device and image processing system
CN102938842B (en) Image correcting device, image correcting method, related device and product
US20230362506A1 (en) Lens shading correction to minimize data loss
CN111653232B (en) LED screen color gamut calibration method and device
CN104869379A (en) White balance compensation method and electronic device
CN113450687A (en) Color management correction method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200731