WO2020037635A1 - 色彩校正方法及装置 - Google Patents

色彩校正方法及装置 Download PDF

Info

Publication number
WO2020037635A1
WO2020037635A1 PCT/CN2018/102081 CN2018102081W WO2020037635A1 WO 2020037635 A1 WO2020037635 A1 WO 2020037635A1 CN 2018102081 W CN2018102081 W CN 2018102081W WO 2020037635 A1 WO2020037635 A1 WO 2020037635A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
matrix
color correction
color
processed
Prior art date
Application number
PCT/CN2018/102081
Other languages
English (en)
French (fr)
Inventor
林威丞
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201880081358.8A priority Critical patent/CN111480331A/zh
Priority to PCT/CN2018/102081 priority patent/WO2020037635A1/zh
Publication of WO2020037635A1 publication Critical patent/WO2020037635A1/zh

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

Definitions

  • the present application relates to the field of image processing, and in particular, to a color correction method and device.
  • the color deviation of the light source is corrected by auto white balance (AWB).
  • AVB auto white balance
  • CC color correction
  • the function of enhancing the color saturation of the CC module is mainly realized by a 3x3 color correction matrix.
  • Each image point can be expressed in three different colors, that is, there are three color channels, usually including red (red, R), Green (G, G) and blue (Blue, B).
  • the chromaticity value (R, G, B) of each color of each image point in the image needs to be multiplied by this color correction matrix to obtain a color corrected chromaticity value (R ', G', B ')
  • the specific calculation method is shown below.
  • the color correction matrix generally performs parameter calibration through the scene of a typical light source, and has two functions of hue correction and saturation enhancement.
  • R ′ a 11 * R + a 12 * G + a 13 * B
  • G ′ a 21 * R + a 22 * G + a 23 * B
  • the three values of a 11 , a 22, and a 33 are usually positive numbers, and the remaining six are negative numbers.
  • the CC module increases the color saturation, three of a 11 , a 22, and a 33 The value will become larger, and the remaining six numbers will become larger negatively.
  • the constraints that the color correction matrix satisfies are:
  • negative values may appear in R ', G', and B 'after CC module color correction.
  • the RGB values of an image point in the image are 94.45, 14.95, and 70.68, and the values of a 21 , a 22, and a 23 of the color correction matrix are -0.27, 1.52, and -0.25, respectively.
  • G ' is -20.45. Since the RGB three-channel value of the image point cannot be negative, the value of G 'is forcibly set to 0 at this time.
  • the size difference between these negative values represents the shape or texture of the object in the image. When all these negative values are set to 0, the shape or texture of the object in the image cannot be displayed. This phenomenon is that the color is oversaturated and caused the image Distortion where details disappear.
  • the embodiments of the present application provide a color correction method and device, which can suppress the phenomenon of color saturation due to color correction.
  • an embodiment of the present application provides a color correction method, including: using a first color correction matrix to perform color correction processing on a first color information matrix of each of a plurality of image points in an image to be processed, In order to obtain the second color information matrix of each image point, the first color information matrix includes chromaticity values of three colors to be processed, and the second color information matrix includes chromaticity values of three colors after color correction. ; When it is determined that there is an area causing oversaturation in the image to be processed, an updated correction operation is performed, where the area includes a plurality of image points that cause oversaturation, and each of the first color corresponding to the image points that cause oversaturation The chromaticity value is less than a preset threshold.
  • the first color is one of the three colors.
  • the updated correction operation includes: determining a second color correction matrix, and the correction range of the second color correction matrix is lower than the first color.
  • the correction amplitude of the correction matrix is used to re-calculate the first color information moment of each image point; Respectively do color correction processing to update each of said second color information of the image point matrix.
  • the multiple image points that cause supersaturation are multiple adjacent image points.
  • the number of multiple image points that cause oversaturation is greater than a preset number threshold, or the number of multiple image points that cause oversaturation is different from the number of the foregoing multiple image points included in the image to be processed.
  • the ratio is greater than a preset ratio threshold.
  • determining the second color correction matrix includes: adjusting the first color correction matrix to obtain a second color correction matrix.
  • adjusting the first color correction matrix to obtain a second color correction matrix includes: performing a weighted average of the first color correction matrix and a unit matrix to obtain a second color correction matrix.
  • a weighted average of the first color correction matrix and the unit matrix is used to obtain a second color correction matrix, so as to reduce the correction amplitude of the second color correction matrix, thereby suppressing the phenomenon of color saturation due to color correction.
  • the correction operation for performing the update includes: repeatedly performing the correction operation for the update; wherein the parameter ⁇ 1 of the weighted average in the correction operation for the next update is greater than the weighted average in the correction operation for the current update.
  • the parameters ⁇ 2 , ⁇ 1 and ⁇ 2 are weights of the identity matrix.
  • the correction range of the second color correction matrix is reduced, thereby suppressing the phenomenon of color saturation due to color correction.
  • the method further includes: after updating the second color information matrix of each image point, if it is determined that an area causing oversaturation still exists in the to-be-processed image, repeatedly performing the update. The correction operation is performed until it is determined that there is no region causing oversaturation in the image to be processed.
  • the above three colors include red, green, and blue.
  • the image to be processed is an image after automatic white balance.
  • an embodiment of the present application provides a color correction method, including: using a first color correction matrix to perform color correction preprocessing on a first color information matrix of each of a plurality of image blocks in an image to be processed.
  • the first color information matrix includes the chromaticity values of the three colors to be processed, and the second color information matrix includes the three color Chroma value;
  • each image block includes multiple image points, and the first color information matrix of each image block is the average of the first color information matrix of the plurality of image points; when it is determined that the existence of the image to be processed causes oversaturation
  • a second color correction matrix is determined when the region includes a plurality of image blocks that cause oversaturation, and the chromaticity value of the first color corresponding to each of the image blocks that causes oversaturation is less than a preset threshold, and the color is For one of the three colors, the correction range of the second color correction matrix is lower than that of the first color correction matrix; Said second color correction matrix
  • Implementation of the embodiments of the present application may preprocess the image to be processed before using the color correction matrix to perform color correction on the image to be processed to determine whether there is an area causing oversaturation in the image to be processed, and if so, reduce the amplitude of color correction .
  • the color correction matrix is then used for color correction processing. While increasing the saturation of the output image, this solution takes into account the details of the output image and suppresses distortion caused by color oversaturation.
  • the small color image in the embodiment of the present application is obtained from the image after the automatic white balance correction.
  • the image after the automatic white balance correction is divided into several image blocks, and the first color information matrix of each image block includes The average of the first color information matrix of all image points.
  • a small color image is an image that includes the chrominance values of several image blocks. The small color image can accurately represent the color characteristics of the input image, and the number of image blocks is small, which reduces the calculation amount for determining the color correction matrix.
  • the multiple image blocks that cause oversaturation are multiple adjacent image blocks.
  • the number of the plurality of oversaturated image blocks is greater than a preset number threshold, or the number of the plurality of oversaturated image blocks and the plurality of image blocks included in the image to be processed are The ratio of the number is greater than a preset ratio threshold.
  • the determining the second color correction matrix includes: adjusting the first color correction matrix to obtain the second color correction matrix.
  • the adjusting the first color correction matrix to obtain the second color correction matrix includes: performing a weighted average of the first color correction matrix and a unit matrix to obtain the second color correction matrix.
  • a weighted average of the first color correction matrix and the unit matrix is used to obtain a second color correction matrix, so as to reduce the correction amplitude of the second color correction matrix, thereby suppressing the phenomenon of color saturation due to color correction.
  • the adjusting the first color correction matrix to obtain the second color correction matrix includes: adjusting the first color correction matrix multiple times to obtain the second color correction matrix;
  • the parameter ⁇ 1 of the weighted average in the next adjustment is greater than the weighted average parameter ⁇ 2 in the current adjustment, and ⁇ 1 and ⁇ 2 are the weights of the above identity matrix.
  • the correction range of the second color correction matrix is reduced, thereby suppressing the phenomenon of color saturation due to color correction.
  • the foregoing The method further includes: using the second color correction matrix 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 to update the second color of each image block.
  • the operation of determining the second color correction matrix is repeatedly performed until it is determined that there is no region that causes oversaturation in the image to be processed.
  • the above three colors include red, green, and blue.
  • an embodiment of the present application provides a color correction device, including: a processing unit, configured to use a first color correction matrix to first image information matrix of each of a plurality of image points in an image to be processed respectively. Color correction is performed to obtain the second color information matrix of each image point.
  • the first color information matrix includes the chromaticity values of the three colors to be processed.
  • the second color information matrix includes the color corrected three Chromaticity value of each color; an update correction unit configured to perform an update correction operation when it is determined that an area causing oversaturation exists in the image to be processed, where the area includes multiple image points that cause oversaturation, each The chromaticity value of the first color corresponding to the oversaturated image point is less than a preset threshold.
  • the first color is one of the three colors.
  • the updated correction operation includes determining a second color correction matrix.
  • the correction range of the color correction matrix is lower than that of the first color correction matrix; and the second color correction matrix is provided.
  • the processing unit is configured to trigger the processing unit to perform correction processing again; the processing unit is further configured to use the second color correction matrix to perform color correction processing on the first color information matrix of each image point separately to update the each Second color information matrix of image points.
  • the foregoing multiple image points that cause oversaturation are adjacent image points.
  • the number of the plurality of oversaturated image points is greater than a preset number threshold, or the number of the plurality of oversaturated image points and the plurality of image points included in the image to be processed are The ratio of the number is greater than a preset ratio threshold.
  • the determining the second color correction matrix includes: adjusting the first color correction matrix to obtain a second color correction matrix.
  • the adjusting the first color correction matrix to obtain the second color correction matrix includes: performing a weighted average of the first color correction matrix and a unit matrix to obtain the second color correction matrix.
  • the update correction unit is configured to: when it is determined that an area causing oversaturation exists in the image to be processed, repeatedly perform the update correction operation; wherein, the weighted average in the next update correction operation
  • the parameter ⁇ 1 is larger than the weighted average parameter ⁇ 2 in the currently updated correction operation, and ⁇ 1 and ⁇ 2 are the weights of the above identity matrix.
  • the update correction unit is further configured to: after determining that the processing unit updates the second color information matrix of each image point, if it is determined that an area that causes oversaturation still exists in the image to be processed, Then, the correction operation of the update is repeatedly performed until it is determined that there is no region causing oversaturation in the image to be processed.
  • the above three colors include red, green, and blue.
  • the image to be processed is an image after automatic white balance.
  • an embodiment of the present application provides a color correction device, including: a preprocessing unit, configured to use a first color correction matrix, and a first color information matrix of each of a plurality of image blocks in an image to be processed. Color correction preprocessing is performed separately to obtain the second color information matrix of each image block.
  • the first color information matrix includes chromaticity values of the three colors to be processed.
  • the second color information matrix includes color correction preprocessing.
  • the multiple image blocks that cause oversaturation are multiple adjacent image blocks.
  • the number of the plurality of oversaturated image blocks is greater than a preset number threshold, or the number of the plurality of oversaturated image blocks and the plurality of image blocks included in the image to be processed are The ratio of the number is greater than a preset ratio threshold.
  • the determining unit is configured to: when it is determined that an area causing oversaturation exists in the image to be processed, adjust the first color correction matrix to obtain the second color correction matrix.
  • the determining unit is configured to: when determining that an area causing oversaturation exists in the image to be processed, perform a weighted average between the first color correction matrix and the identity matrix to obtain the second color correction matrix.
  • the determining unit is configured to: when determining that an area causing oversaturation exists in the image to be processed, adjust the first color correction matrix multiple times to obtain the second color correction matrix; Among them, the parameter ⁇ 1 of the weighted average in the next adjustment is larger than the weighted average parameter ⁇ 2 in the current adjustment, and ⁇ 1 and ⁇ 2 are the weights of the above identity matrix.
  • the second color correction matrix is provided to the preprocessing unit to trigger the preprocessing.
  • the processing unit re-color corrects for pre-processing
  • the preprocessing unit is further configured to use the second color correction matrix to perform color correction preprocessing on each of the first color information matrices of each of a plurality of image blocks in the image to be processed, so as to update each of the image blocks.
  • a second color information matrix ;
  • the determining unit is specifically configured to: if it is determined that an area causing oversaturation still exists in the image to be processed, repeat the foregoing operation of determining the second color correction matrix until it is determined that there is no area causing oversaturation in the image to be processed.
  • the above three colors include red, green, and blue.
  • At least one unit may be implemented in a software or hardware manner or a combination thereof.
  • the software-implemented unit may include a software instruction program; the hardware-implemented unit may include a logic circuit.
  • an embodiment of the present application provides an image signal processor, including: an automatic white balance module and a color correction device, wherein the color correction device is the third aspect or any one of the third aspect of the embodiments of the present application.
  • the color correction device provided by the implementation manner, the fourth aspect, or any implementation manner of the fourth aspect.
  • an embodiment of the present application provides a color correction device, including a processor, and may optionally further include a memory; the memory is used to store program instructions, and the processor is used to call the program instructions in the memory and execute
  • the embodiment of the present application provides a color correction method provided by the first aspect or any implementation manner of the first aspect, the second aspect, or any implementation manner of the second aspect.
  • an embodiment of the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores instructions, and when the computer-readable storage medium runs on a computer or a processor, the computer or processor executes the implementation of the present application.
  • an embodiment of the present application provides a computer program product that, when running on a computer or processor, causes the computer or processor to execute the first aspect or any implementation of the first aspect of the embodiments of the present application.
  • FIG. 1 is a structural diagram of an electronic imaging device according to an embodiment of the present application.
  • FIG. 2 is a structural diagram of an image signal processor according to an embodiment of the present application.
  • FIG. 3 is a structural diagram of a color correction device according to an embodiment of the present application.
  • FIG. 4 is a structural diagram of another color correction device according to an embodiment of the present application.
  • FIG. 5 is a flowchart of a color correction method according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram of an image point adjacent to the image point P i, j ;
  • FIG. 8 is a structural diagram of another color correction device according to an embodiment of the present application.
  • FIG. 1 is a schematic structural diagram of an electronic imaging device 10 according to an embodiment of the present application.
  • the electronic imaging device 10 may be, but is not limited to, a camera or a video camera, an electronic device including a camera or a video camera, such as a laptop computer, a desktop computer, a mobile phone, a smart phone, a tablet computer, or a head-mounted display device, etc., and may be used for Acquire and process image data.
  • 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, and one or more imaging devices. 107.
  • the communication bus 111 is used to implement connection and communication between these components. It should be understood that each component in the electronic imaging device 10 may also be coupled through other connectors.
  • the other connectors may include various interfaces, transmission lines, or buses. Wait.
  • coupling refers to electrical connection or communication through each other, including direct connection or indirect connection through other devices.
  • Image signal processor 106 for processing image data collected by the imaging device 107, such as, but not limited to, detecting and correcting defective pixels; performing sharpening processing on the image; and performing automatic white balance correction processing on the image; Perform color correction on the image.
  • the image data processed by the image signal processor 106 may be obtained from the memory 105 or from the imaging device 107.
  • the image signal processor 106 may complete the processing of the image data by calling a computer program instruction in the memory.
  • the image signal processor 106 may also complete the processing of the image data through an internal hardware logic processing circuit of the image. That is, the image signal processor 106 may include a general-purpose processor that executes software, such as a microprocessor or a processing unit, or may include a hardware logic circuit that executes a process, or may be a combination of the two.
  • Input / output interface 102 An interface for connecting various external devices, such as a power supply, an audio output device (such as a headset) or other electronic devices (such as a handheld device and / or a computer), a printer, a projector, an external display, and so on.
  • the input / output interface 102 can support types of interfaces such as, but not limited to, a universal serial bus (USB) interface, an Ethernet or modem interface, and an alternating current / direct current (AC / DC) power interface. .
  • User interface 103 used to receive instructions input by a user, which may include a keyboard, physical buttons (press buttons, rocker buttons, etc.), dials, click wheels, and so on.
  • the user interface 103 and the display screen 104 may be combined together.
  • the display screen 104 is a touch screen
  • the electronic imaging device 10 may display an image through the touch screen, and may also receive an instruction input by the 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, a digital signal processor (DSP), a microcontroller (microcontroller, unit), or
  • the artificial intelligence processor may further include necessary hardware accelerators, such as application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or integrated circuits for implementing logic operations .
  • the processor 101 is coupled to one or more data buses for transferring data and instructions between the various components of the electronic imaging device 10.
  • the memory 105 may include a non-power-down volatile memory, such as an embedded multi-media card (EMMC), a universal flash memory (UFS), or a read-only memory (ROM).
  • the memory 105 may further include a volatile memory (volatile memory), such as a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, and may also be a memory device.
  • EEPROM Erasable programmable read-only memory
  • EEPROM read-only memory
  • disk storage media or other magnetic storage devices or can be used to carry or store program code in the form of instructions or data structures and can be accessed by a computer Any other computer-readable storage medium, but is not limited thereto.
  • the memory 105 may also be at least one storage system located far from the foregoing processor 101.
  • the memory 105 as a 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 further include one or more expansion cards 108.
  • the expansion card 108 can be used to add functions to the electronic imaging device 10.
  • the expansion card 108 may be a flash memory card for providing a storage medium for the electronic imaging device 10.
  • the expansion card 108 may be a subscriber identification module (SIM) card, which is used to provide the mobile imaging function for the electronic imaging device 10.
  • SIM subscriber identification module
  • the electronic imaging device 10 may further include a network device 110.
  • the network device 110 may be a network controller or a network interface card.
  • the electronic imaging device 10 may be connected to the network through the network device 110.
  • the network device 110 may be a modem or a radio frequency unit for wireless communication connection.
  • the electronic imaging device 10 may further include a power source 109 for supplying power to operations of various components of the electronic imaging device 10.
  • the power source 109 can provide portable power and non-portable power for the electronic imaging device 10.
  • 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 battery and further supplies power to the network device 110.
  • the battery can be recharged by connecting to an external power source, such as an outlet.
  • Display 104 used to display various images generated by the electronic imaging device 10, such as a graphical user interface (GUI) of an operating system, or image data (including still images and videos) processed by the image signal processor 106 data).
  • the image data may include image data acquired using the imaging device 107 or image data acquired from the memory 105.
  • the display screen 104 may include any suitable type of display screen. For example, a liquid crystal display (LCD), a plasma display, or an organic light-emitting diode (OLED) display.
  • LCD liquid crystal display
  • plasma display a plasma display
  • OLED organic light-emitting diode
  • the imaging device 107 may acquire a still image and a moving image (for example, a 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 an optical signal and converting the optical signal into an electrical signal.
  • an image signal processor 106 used in the electronic imaging device 10 according to an embodiment of the present application is described.
  • 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 a color shift of the input image so that a white object in the original scene is displayed in white in the image.
  • the color correction device 1062 is used to detect in advance whether there is an oversaturated region in the output image after color correction, and if so, adjust the color correction matrix, and according to the adjusted color correction matrix to the automatic white balance output by the automatic white balance device 1061 The resulting image undergoes color correction processing to output the color corrected image.
  • 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 point removal module, an interpolation module, and the like, which are not shown in FIG. 2 and are not described here.
  • One or all 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.
  • the color correction device 1062 may include a processing unit 10621 and an update correction unit 10622, as shown in FIG. 3. among them:
  • Processing unit 10621 a first color information matrix for each of a plurality of image points in the image to be processed using the first color correction matrix to perform color correction processing to obtain a second color information matrix for each image point .
  • the first color information matrix includes chromaticity values of three colors to be processed
  • the second color information matrix includes chromaticity values of three colors after color correction.
  • the chromaticity values of the three colors correspond to the three color channels, also called RBG values.
  • the image to be processed is an image after automatic white balance.
  • the update correction unit 10622 is configured to perform an update correction operation when it is determined that an area causing oversaturation exists in the image to be processed.
  • the region includes a plurality of image points that cause oversaturation, and a chromaticity value of a first color corresponding to each of the image points that causes oversaturation is less than a preset threshold.
  • the first color is one of the three colors.
  • the above-mentioned updated correction operation includes:
  • a second color correction matrix is determined, and the correction amplitude of the second color correction matrix is lower than that of the first color correction matrix.
  • the above-mentioned second color correction matrix is provided to the processing unit 10621 to trigger the processing unit 10622 to perform correction processing again.
  • the processing unit 10621 is further configured to perform color correction processing on the first color information matrix of each image point separately by using the second color correction matrix to update the second color information matrix of each image point.
  • the plurality of image points causing oversaturation are a plurality of adjacent image points.
  • the number of the plurality of oversaturated image points is greater than a preset number threshold, or a ratio of the number of the plurality of oversaturated image points to the number of image points included in the image to be processed is greater than a preset value.
  • Proportional threshold is greater than a preset number threshold, or a ratio of the number of the plurality of oversaturated image points to the number of image points included in the image to be processed.
  • the determining the second color correction matrix includes: adjusting the first color correction matrix to obtain the second color correction matrix.
  • the adjusting the first color correction matrix to obtain the second color correction matrix includes: performing a weighted average of the first color correction matrix and a unit matrix to obtain the second color correction matrix.
  • the update correction unit 10622 is configured to: when it is determined that an area causing oversaturation exists in the image to be processed, repeatedly perform the update correction operation.
  • the parameter ⁇ 1 of the weighted average in the correction operation of the next update is greater than the weighted average parameter ⁇ 2 of the currently updated correction operation, and ⁇ 1 and ⁇ 2 are the weights of the above identity matrix.
  • the update correcting 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 an area causing oversaturation still exists in the image to be processed, repeat the foregoing The updated correction operation is performed until it is determined that there is no region causing oversaturation in the image to be processed.
  • the above three colors include red, green, and blue. In a specific implementation, the above three colors may also include other colors, which are not limited in this application.
  • the color correction device 1062 may include a preprocessing unit 10623, a determination unit 10624, and a color correction processing unit 10625, as shown in FIG. 4. among them:
  • a preprocessing unit 10623 is configured to use the first color correction matrix to perform color correction preprocessing on a first color information matrix of each of a plurality of image blocks in an image to be processed, so as to obtain a second of the foregoing image blocks.
  • Color information matrix includes chromaticity values of three colors to be processed, and the second color information matrix includes chromaticity values of three colors after color correction preprocessing; each image block includes multiple image points.
  • the first color information matrix of each image block is an average of the first color information matrices of the plurality of image points.
  • the image unit of the image to be processed is an image block, and each image block includes multiple image points.
  • the first color information matrix of each image block is an average of the first color information matrix of the multiple image points included in the image block.
  • an image including chromaticity values of M ⁇ N image blocks is referred to as a small color image.
  • an image block is used as an image unit to calculate a second color information matrix of each image block.
  • a determining unit 10624 is 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 that cause oversaturation, and each image block that causes oversaturation
  • the chromaticity value of the corresponding first color is less than a preset threshold, the color is one of the three colors, and the correction range of the second color correction matrix is lower than the correction range of the first color correction matrix.
  • the adjacent multiple image blocks of the multiple image blocks that cause oversaturation.
  • the number of the foregoing image blocks that cause oversaturation is greater than a preset number threshold.
  • a ratio between the number of the plurality of image blocks causing oversaturation and the number of the plurality of image blocks included in the image to be processed is greater than a preset ratio threshold.
  • the determining unit 10624 is configured to: when it is determined that an area causing oversaturation exists in the image to be processed, adjust the first color correction matrix to obtain the second color correction matrix.
  • the determining unit 10624 is configured to: when it is determined that an area causing oversaturation exists in the image to be processed, perform a weighted average between the first color correction matrix and the identity matrix to obtain the second color correction matrix.
  • the determining unit 10624 is configured to: when it is determined that an area causing oversaturation exists in the image to be processed, adjust the first color correction matrix multiple times to obtain the second color correction matrix; wherein, in the next adjustment, The parameter ⁇ 1 of the weighted average is larger than the weighted average parameter ⁇ 2 in the current adjustment, and ⁇ 1 and ⁇ 2 are the weights of the above identity matrix.
  • the determination unit 10624 determines the second color correction matrix
  • the color correction processing unit 10625 performs color correction processing
  • the above-mentioned second color correction matrix is provided to the preprocessing unit 10623 to trigger the preprocessing unit 10623 to perform color correction again. Pre-processing.
  • the preprocessing unit 10623 is further configured to use the second color correction matrix to perform color correction preprocessing on the first color information matrix of each of a plurality of image blocks in the image to be processed, so as to update the The second color information matrix.
  • the determining unit 10624 is specifically configured to: if it is determined that an area causing oversaturation still exists in the image to be processed, repeatedly perform the foregoing operation of determining the second color correction matrix until it is determined that the area to be processed does not exist that causes oversaturation.
  • 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.
  • the determining unit 10624 determines the second color correction matrix
  • the first determined color information matrix of each image point in the image to be processed is used to perform color correction processing to obtain the second image to be processed.
  • the second color information matrix of each image point finally outputs an image after color correction processing.
  • Implementation of the embodiments of the present application may preprocess the image to be processed before using the color correction matrix to perform color correction on the image to be processed to determine whether there is an area causing oversaturation in the image to be processed, and if so, reduce the amplitude of color correction .
  • the color correction matrix is then used for color correction processing. While increasing the saturation of the output image, this solution takes into account the details of the output image and suppresses distortion caused by color oversaturation.
  • the small color image in the embodiment of the present application is obtained from the image after the automatic white balance correction.
  • the image after the automatic white balance correction is divided into several image blocks, and the first color information matrix of each image block includes The average of the first color information matrix of all image points.
  • a small color image is an image that includes the chrominance values of several image blocks. The small color image can accurately represent the color characteristics of the input image, and the number of image blocks is small, which reduces the calculation amount for determining the color correction matrix.
  • the color correction method may include at least the following steps, which may be performed by the color correction device 1602:
  • S101 Use a first color correction matrix to perform color correction processing on a first color information matrix of each of a plurality of image points in an image to be processed to obtain a second color information matrix of each image point.
  • the first color information matrix includes chromaticity values of three colors to be processed
  • the second color information matrix includes chromaticity values of three colors after color correction.
  • the image to be processed is an image after automatic white balance correction. Because in the original input image before the automatic white balance correction, the original white object will have color in the image, which will affect the accuracy of the output image after color correction. Therefore, performing color correction on the image after automatic white balance correction can make the output image after color correction more accurate.
  • each image point includes three different colors
  • the first color information matrix of each image point is composed of three color chromaticity values, that is, the first color information matrix of each image point includes 3 elements
  • Each element is also called a color channel, which respectively represents the chromaticity value of a color.
  • the first color information matrix of each image point can be a 3 ⁇ 1 matrix or a 1 ⁇ 3 matrix, which represents as described above. RBG value.
  • the above-mentioned first 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 to obtain each
  • the second color information matrix of the image points may be obtained by multiplying the first color correction matrix with the first color information matrix of each image point in the image to be processed to obtain a second color information matrix of each image point.
  • a multiplied matrix by multiplying the first color correction matrix and the first color information matrix of each image point in the image to be processed, a multiplied matrix can be obtained, and the multiplied matrix is the color correction of the image point.
  • a second color information matrix, the color-corrected second color information matrix includes three elements, each element representing a chromaticity value of a color.
  • the first color correction matrix of the image points b i, j in the i-th row and the j-th column is The second color information matrix of the image point b i, j ′ after the color correction of the image point.
  • the chromaticity value B i, j ′ of the blue of the image point after color correction a 31 * R i, j + a 32 * G i, j + a 33 * B i, j .
  • the first color correction matrix may be the transposed matrix of the first color correction matrix A, that is, A T.
  • the first 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 to obtain a second color information matrix of each image point, that is, to convert each image point in the image to be processed.
  • the first color information matrix is multiplied with the first color correction matrix to obtain a second color correction matrix.
  • the first color information matrix of each image point is a 3 ⁇ 1 matrix for illustration.
  • S102 Determine whether there is an area causing oversaturation in the image to be processed. If yes, execute S103; if not, execute S105.
  • the above-mentioned supersaturated region includes a plurality of image points that cause supersaturation, and a chromaticity value of a first color of each of the image points that causes supersaturation is less than a preset threshold.
  • the first color is one of the three colors.
  • the preset threshold is a negative number, such as but not limited to -6, -8, -10, and the like. If the chromaticity value of the first color of an image point in the image to be processed is less than the preset threshold, it indicates that the image point in the image to be processed is an image point causing oversaturation. A plurality of image points whose chromaticity values of the first color after color correction are smaller than the preset threshold constitute the above-mentioned region causing oversaturation.
  • the plurality of image points that cause supersaturation are adjacent.
  • image points above, below, left, right, upper left, lower left, upper right, and lower right of an image point in the image to be processed can be regarded as image points adjacent to the image point.
  • the image points adjacent to the image points P i, j of the i-th row and the j-th column may include: P i-1, j-1 (upper left), P i-1, j (upper), P i-1 , J + 1 (top right), Pi , j-1 (left), Pi , j + 1 (right), Pi + 1, j-1 (bottom left), Pi + 1, j (bottom), P i + 1, j + 1 (bottom right).
  • Figure 6 As shown in Figure 6.
  • a ratio of the number of image points that causes oversaturation to the number of image points included in the image to be processed is greater than a preset ratio threshold.
  • the preset ratio threshold may be, but is not limited to, 0.2%, 0.4%, 1%, and the like. The smaller the preset ratio threshold, the smaller the distortion of the output image after color correction.
  • the number of the plurality of image points that cause oversaturation is greater than a preset number threshold.
  • the preset number threshold may be, but is 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.
  • the correction range of the second color correction matrix is lower than that of the first color correction matrix.
  • the second color correction matrix may be obtained by adjusting the first color correction matrix.
  • the correction range of the second color correction matrix is lower than that of the first color correction matrix.
  • a weighted average of the first color correction matrix and the identity matrix may be performed to obtain a second color correction matrix.
  • the calculation formula for obtaining the second color correction matrix by weighting the first color correction matrix and the identity matrix is as follows:
  • a 2 ⁇ ⁇ I + (1- ⁇ ) ⁇ A 1 (1)
  • a 1 is a first color correction matrix
  • a 2 is a second color correction matrix
  • I is an identity matrix
  • is a weight of the identity matrix
  • the above-mentioned 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 multiple times, and the parameter ⁇ 1 of the weighted average of the next operation is greater than the weighting in the current correction operation.
  • the average parameters ⁇ 2 , ⁇ 1 and ⁇ 2 are the weights of the identity matrix. Implementation of the embodiments of the present application can suppress image distortion caused by color oversaturation.
  • S104 Use the second color correction matrix to perform color correction processing on the first color information matrix of each image point separately to update the second color information matrix of each image point.
  • step S102 is repeated until there is no oversaturation in the image to be processed. Area.
  • the second color correction matrix is the first color correction matrix, which represents maintaining the original color gain intensity. If ⁇ is equal to 1, the second color correction matrix is the identity matrix, and the color at this time The gain intensity is 1 (that is, no color gain). At this time, the R'G'B 'value is completely equal to the RGB value. The larger the value of ⁇ , the more the first color correction matrix is added to the identity matrix, and the R'G of the image to be processed is. The less likely it is for 'B' to be negative.
  • the initial value of parameter ⁇ is set to 0, and the first color correction matrix multiplied by the image to be processed is A 1.
  • a 2 is equal to A 1 (that is, the system default setting) First color correction matrix) to determine whether there is an area causing oversaturation in the image to be processed. If it exists, increase the value of ⁇ to generate a new second color correction matrix and the first color information matrix of each image point of the image to be processed. Multiply, and then determine whether there is an area causing oversaturation in the image to be processed. This iterative calculation is performed until there is no area causing oversaturation in the image to be processed.
  • the final A 2 is the output CC matrix (the newly adjusted CC Module 3x3 matrix). Then use A 2 to perform color correction processing on the first color information matrix of each image point of the image to be processed.
  • also known as the adjustment step size.
  • the optimal CC matrix is The matrix of the area of the supersaturation area smaller than the proportional threshold and capable of maintaining the maximum color gain, ⁇ in the embodiment of the present application is 0.01.
  • S105 Output the color-corrected image. It can be known that after using the second color correction matrix to update the second color information matrix of each image point, if there is still an area causing oversaturation in the image to be processed, the color corrected image can also be directly output.
  • the correction amplitude of the second color correction matrix is lower than the amplitude of the first color correction matrix, which can suppress the supersaturation phenomenon in the output image to a certain extent.
  • the color correction method may include at least the following steps, which may be executed by the color correction device 1602:
  • the input image in the embodiment of the present application is an image after automatic white balance correction.
  • S402 Generate a small color image according to the image after the automatic white balance correction.
  • the image to be processed is a small color image obtained according to the image after automatic white balance correction.
  • the small color image is an image that includes chromaticity values of M ⁇ N image blocks.
  • Each image block includes multiple image points.
  • the first color information matrix of each image block is the number of image points included in the image block.
  • the first color information matrix of each image point includes the chromaticity values of the sub-image points of three colors.
  • the value of an element contained in the average matrix of the first color information matrix of the plurality of image points is the average value of the values of the elements at the same position in the first color information matrix of each image point.
  • the average value of the chromaticity values of the same color for all image points included in each image block is calculated to obtain the chromaticity values of three colors.
  • the first chrominance information matrix of an image block Exemplarily, the image after the automatic white balance correction includes 100 ⁇ 100 image points, and each image point includes 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 ⁇ 10 image blocks.
  • the image block of the i-th row and the j-th column contains 10 ⁇ 10 image points (1 ⁇ i ⁇ M, 1 ⁇ j ⁇ N), and each sub-image point of all image points (10 ⁇ 10 image points) contained in this block
  • the average of chroma values includes the average of all R chroma values
  • the average of all G color values Average of all B chroma values That is, the chrominance value of R of the image block in the i-th row and the j-th column in the image to be processed; That is, the chroma value of G of the image block in the i-th row and the j-th column in the image to be processed; That is, the chroma value of B of the image block in the i-th row and the j-th column in the image to be processed.
  • S403 Perform color correction preprocessing on the first color information matrix of each image block in the small color image by using the first color correction matrix to obtain the second color information matrix of each image block.
  • each image block in the small color image includes three different colors.
  • the first color information matrix of each image block is composed of three color chromaticity values, that is, the first color information matrix of each image block includes Three elements, each of which represents the chromaticity value of a color.
  • the first color correction matrix is multiplied with the first color information matrix of each image block in the small color image to obtain a second color information matrix of each image block.
  • the above-mentioned supersaturated area includes a plurality of supersaturated image blocks, and a chromaticity value of a first color of each to-be-processed supersaturated image block is less than a preset threshold.
  • the first color is one of the three colors.
  • the preset threshold is a negative number, such as but not limited to -6, -8, -10, and the like. If the chromaticity value of the first color of an image block in the small color image after color correction preprocessing is smaller than the preset threshold, it indicates that the image block in the small color image is an image block that causes oversaturation. A plurality of image blocks whose chromaticity value of the first color after the color correction preprocessing is smaller than the preset threshold constitute the above-mentioned region causing oversaturation.
  • the plurality of image blocks that cause oversaturation are adjacent.
  • adjacent image blocks reference may be made to the description of adjacent image points in FIG. 6, and details are not described herein again.
  • the ratio of the number of multiple image blocks that causes oversaturation to the number of image blocks included in the small color image is greater than a preset ratio threshold.
  • the number of multiple image blocks that cause oversaturation is greater than a preset number threshold.
  • the correction amplitude of the second color correction matrix is lower than that of the first color correction matrix.
  • S406 Use the second color correction matrix to perform color correction preprocessing on the first color information matrix of each image block separately to update the second color information matrix of each image block.
  • S404 is performed again, and it is determined whether there is an area causing oversaturation in the small color image according to the second color information matrix, and if it exists, the second color information is determined again Matrix until there is no region causing oversaturation in the small color image, then the final second color information matrix is determined.
  • S407 Perform color correction processing on the image after the automatic white balance correction.
  • color correction processing is performed on an image after automatic white balance correction, that is, color correction processing is performed on a first color information matrix of each image point in an image to be processed.
  • the main difference between this embodiment and the process of FIG. 5 is that there is a pre-correction process, and whether or not there may be oversaturation for adjustment is performed through the pre-correction. Calibration is less complex and easier to implement.
  • the small color image is determined according to the second color information matrix of each image block. If there is no oversaturation region, 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 color corrected image is output.
  • 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, an updated second color information matrix is obtained, and according to the second The color information matrix determines that there is no area causing oversaturation in the small color image, and then uses the second color correction matrix obtained by the last adjustment to perform color correction processing on the image after the automatic white balance correction input in S401, and finally outputs color correction After the image.
  • the second color correction matrix obtained by weighted averaging the first color correction matrix and the unit matrix at least once is used to perform color correction preprocessing on the first color information matrix of the small color image, an updated first
  • the newly determined second-color correction matrix may be directly used for the automatic white balance input in S401.
  • the corrected image is subjected to color correction processing, and the color corrected image is finally output, which can suppress the phenomenon of color oversaturation to a certain extent.
  • the embodiment of the present application Before implementing the embodiments of the present application, before the color correction is performed on the image after the automatic white balance correction is performed by using the first color correction matrix, it is possible to determine whether a phenomenon of over-saturation of color occurs according to the small color image, resulting in distortion of the output image. If the output image will be distorted, reduce the correction range of the color correction matrix until the output image is not distorted. While increasing the saturation of the output image, the details of the output image are taken into consideration to ensure that the output image will not be distorted. In addition, the embodiment of the present application performs segmentation processing on the image after the automatic white balance correction. The small color image obtained after the division can accurately represent the color characteristics of the image after the automatic white balance correction, and reduces the amount of calculation.
  • FIG. 8 is a color correction device 20 provided by an embodiment of the present application.
  • the color correction device 50 may be at least a specific implementation form of the image signal processor 106 or the device 1602.
  • the apparatus 50 includes: a processor 520, which may further optionally include a memory 510; wherein: the memory 510 is used to store program instructions; the processor 520 is used to call the program instructions in the memory 510 and execute the program instructions provided in the embodiment of FIG. 5 or FIG. Color correction method.
  • the device 50 in FIG. 8 includes a memory 510, but in fact, the memory 510 may be located outside the processor 520 (not shown in the figure), that is, the memory 510 may be external to the image signal processor 106 or the device 1602.
  • the color correction device 1062 in the embodiments of FIG. 3 and FIG. 4 may be implemented by software or hardware. If it is implemented by hardware, it may be implemented by logic circuits, that is, the processing unit 10621 and the update correction unit 10622 may be implemented by 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 involved in FIG. 3 and FIG. 4 are implemented in hardware, a large number of logic circuits are included therein, and processing functions are implemented by the hardware logic circuits. If one or more of the multiple units involved in FIG. 3 and FIG.
  • each unit may include a program instruction that implements a corresponding function, and the relevant program instruction may be stored by 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 FIG. 7.
  • 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 unit is implemented by a logic circuit, and another part is stored in the memory 510 in the form of software instructions, and It is executed by the processor 520.
  • any unit may also be implemented in software, hardware, or a combination thereof, that is, including at least one of a software program or a hardware circuit. This embodiment does not limit this.
  • the processor 520 in the device 50 shown in FIG. 8 implements the related method mentioned in the previous embodiment by executing a software program.
  • it may further include a necessary hardware accelerator, which may enable the previously shown The logic circuit of any unit.
  • the device 50 at this time is implemented by a combination of software and hardware. Therefore, in addition to the processor unit running the software program, the processor 520 may also include hardware implemented by logic circuits, which is not limited in this embodiment.
  • An embodiment of the present application further provides a computer-readable storage medium. All or part of the processes in the foregoing method embodiments may be completed by a computer program instructing related hardware.
  • the program may be stored in the computer storage medium. When the program is executed, the processes may include the processes of the foregoing method embodiments.
  • the computer-readable storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk, or an optical disc, which can store various program code media.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, and the like that includes one or more available medium integration.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)), and the like.
  • the modules in the apparatus of the embodiment of the present application may be combined, divided, and deleted according to actual needs.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

本申请公开了一种色彩校正方法及装置,该方法包括:根据第一色彩校正矩阵及待处理图像中多个图像点中的每个图像点的第一色彩信息矩阵分别做色彩校正处理,以得到每个图像点的第二色彩信息矩阵;当待处理图像中存在导致过饱和的区域时,确定第二色彩校正矩阵,第二色彩校正矩阵的校正幅度低于第一色彩校正矩阵的校正幅度;利用第二色彩校正矩阵重新对每个图像点的第一色彩信息矩阵分别做色彩校正处理,以更新每个图像点的第二色彩信息矩阵。可以在提高输出图像饱和度的同时,兼顾输出图像的细节,抑制色彩过饱和导致的失真现象。

Description

色彩校正方法及装置 技术领域
本申请涉及图像处理领域,尤其涉及一种色彩校正方法及装置。
背景技术
当一张原始图像输入到图像信号处理器(image signal processor,ISP)之后,先由自动白平衡(auto white balance,AWB)校正光源的色偏,经过AWB校正后的图像,除了白色部分,但其他色彩的部分并不准确,需要透过色彩校正(color correction,CC),将各色彩调整成正确颜色。为了提高输出图像的色彩鲜艳度,以提升用户对相机输出图像的喜好,我们会在ISP的CC模块上加强色彩的饱和度,但这同时引入了在有色彩光源场景下色彩过饱和的风险,即一些区域的色彩已经达到最强,已经无法分出色彩浓淡而且细节丢失。
CC模块的加强色彩饱和度的功能主要通过一个3x3的色彩校正矩阵实现,每个图像点可以以三个不同的颜色来表达,即存在三种颜色通道,通常可包括红色(red,R)、绿色(green,G)及蓝色(blue,B)。图像中每个图像点的各个颜色的色度值(R、G、B)都需乘上此色彩校正矩阵,从而得到一个经过色彩校正后的色度值(R’、G’、B’),具体计算方式如下所示。色彩校正矩阵一般通过典型光源的场景来进行参数标定,同时具有色调校正和饱和度增强两种功能。
Figure PCTCN2018102081-appb-000001
R′=a 11*R+a 12*G+a 13*B
G′=a 21*R+a 22*G+a 23*B
B′=a 31*R+a 32*G+a 33*B
此3x3的色彩校正矩阵中,a 11、a 22与a 33三个值通常为正数,其余六个为负数,当CC模块提高色彩的饱和度时,a 11、a 22与a 33三个值会变大,其余六个数会负向的变大,色彩校正矩阵满足的约束条件为:
a 11+a 12+a 13=1
a 21+a 22+a 23=1
a 31+a 32+a 33=1
在一种可能的情况下,经过CC模块色彩校正后的R’、G’、B’中可能会出现负值。举例说明,假设图像中有一图像点的RGB值分别为94.45,14.95与70.68,色彩校正矩阵的a 21,a 22与a 23值分别为-0.27,1.52与-0.25,经过CC模块色彩校正后的G’为-20.45。由于图像点的RGB三通道值不可以为负,此时将G’的值强制设定为0。当图像中有一连续的区域都出现负值时,这些负值均会被强制设定为0。而这些负值之间的大小差异代表图像里的对象形状或纹理,当这些负值全部被设置为0后,图像里的对象形状或纹理无法被显现,此现象即是色彩过饱和引发了图像细节消失的失真。
现有技术中,对待处理图像进行色彩校正处理时,直接根据系统默认的色彩校正矩阵 对待处理图像进行色彩校正,最终输出的图像存在色彩过饱和现象。因此,如何抑制色彩过饱和现象是亟待解决的问题。
发明内容
本申请实施例提供了一种色彩校正方法及装置,可以抑制由于色彩校正导致的色彩过饱的现象。
第一方面,本申请实施例提供了一种色彩校正方法,包括:利用第一色彩校正矩阵对待处理图像中多个图像点中的每个图像点的第一色彩信息矩阵分别做色彩校正处理,以得到上述每个图像点的第二色彩信息矩阵,上述第一色彩信息矩阵包括待处理的三个颜色的色度值,上述第二色彩信息矩阵包括色彩校正后的三个颜色的色度值;当确定上述待处理图像中存在导致过饱和的区域时,执行更新的校正操作,其中,上述区域包括多个导致过饱和的图像点,每个导致过饱和的图像点对应的第一颜色的色度值小于预设阈值,上述第一颜色是上述三个颜色中的一个,上述更新的校正操作包括:确定第二色彩校正矩阵,上述第二色彩校正矩阵的校正幅度低于上述第一色彩校正矩阵的校正幅度;利用上述第二色彩校正矩阵重新对上述每个图像点的第一色彩信息矩阵分别做色彩校正处理,以更新上述每个图像点的第二色彩信息矩阵。
实施本申请实施例可以在采用色彩校正矩阵对待处理图像进行色彩校正时,先判断待处理图像中是否存在导致过饱和的区域,若存在,则降低色彩校正的幅度。在提高输出图像饱和度的同时,本方案兼顾输出图像的细节,抑制色彩过饱和导致的失真现象。
在一种可能的实现方式中,多个导致过饱和的图像点是相邻的多个图像点。
在一种可能的实现方式中,多个导致过饱和的图像点的数量大于预设数量阈值,或者多个导致过饱和的图像点的数量与待处理图像包含的上述多个图像点的数量的比值大于预设比例阈值。
在一种可能的实现方式中,确定第二色彩校正矩阵包括:对第一色彩校正矩阵作调整以得到第二色彩校正矩阵。
在一种可能的实现方式中,对第一色彩校正矩阵作调整以得到第二色彩校正矩阵包括:将第一色彩校正矩阵与单位矩阵做加权平均以得到第二色彩校正矩阵。
本申请实施例通过将第一色彩校正矩阵与单位矩阵做加权平均,得到第二色彩校正矩阵,以降低第二色彩校正矩阵的校正幅度,从而抑制由于色彩校正导致的色彩过饱的现象。
在一种可能的实现方式中上述执行更新的校正操作包括:重复执行上述更新的校正操作;其中,下一次更新的校正操作中的加权平均的参数α 1大于当前更新的校正操作中的加权平均参数α 2,α 1和α 2是所述单位矩阵的权值。
本申请实施例通过增加单位矩阵的加权平均的参数,来降低第二色彩校正矩阵的校正幅度,从而抑制由于色彩校正导致的色彩过饱的现象。
在一种可能的实现方式中,上述方法还包括:在更新上述每个图像点的第二色彩信息矩阵后,若确定上述待处理图像中仍然存在导致过饱和的区域,则重复执行上述更新的校正操作,直到确定上述待处理图像中不存在导致过饱和的区域。
在一种可能的实现方式中,上述三个颜色包括红色、绿色和蓝色。
在一种可能的实现方式中,待处理图像为自动白平衡后的图像。
由于未经过自动白平衡校正的图像,原本白色的物体在图中会带有颜色,即图像颜色不准确。因此本申请实施例中对自动白平衡后的图像进行色彩校正处理,使最终输出的经过色彩校正后的图像颜色显示正确。
第二方面,本申请实施例提供了一种色彩校正方法,包括:利用第一色彩校正矩阵对待处理图像中多个图像块中的每个图像块的第一色彩信息矩阵分别做色彩校正预处理,以得到上述每个图像块的第二色彩信息矩阵,上述第一色彩信息矩阵包括待处理的三个颜色的色度值,上述第二色彩信息矩阵包括色彩校正预处理后的三个颜色的色度值;每个图像块包括多个图像点,每个图像块的第一色彩信息矩阵为上述多个图像点的第一色彩信息矩阵的平均;当确定上述待处理图像中存在导致过饱和的区域时,确定第二色彩校正矩阵,其中,上述区域包括多个导致过饱和的图像块,每个导致过饱和的图像块对应的第一颜色的色度值小于预设阈值,上述颜色是上述三个颜色中的一个,上述第二色彩校正矩阵的校正幅度低于上述第一色彩校正矩阵的校正幅度;利用上述第二色彩校正矩阵对上述待处理图像中的每个图像点的第一色彩信息矩阵分别做色彩校正处理。
实施本申请实施例可以在采用色彩校正矩阵对待处理图像进行色彩校正之前,先对待处理图像进行预处理,以判断待处理图像中是否存在导致过饱和的区域,若存在,则降低色彩校正的幅度。在确定合适的色彩校正矩阵后,再采用该色彩校正矩阵进行色彩校正处理。在提高输出图像饱和度的同时,本方案兼顾输出图像的细节,抑制色彩过饱和导致的失真现象。进一步地,本申请实施例中的小彩图根据自动白平衡校正后的图像得到,将自动白平衡校正后的图像划分为若干个图像块,每个图像块的第一色彩信息矩阵为其包括的所有图像点的第一色彩信息矩阵的平均。小彩图是包括了若干个图像块的色度值的图像。小彩图可以准确的表现输入图像的色彩特性,且图像块个数少,降低确定色彩校正矩阵的计算量。
在一种可能的实现方式中,上述多个导致过饱和的图像块是相邻的多个图像块。
在一种可能的实现方式中,上述多个导致过饱和的图像块的数量大于预设数量阈值,或者上述多个导致过饱和的图像块的数量与上述待处理图像包含的上述多个图像块的数量的比值大于预设比例阈值。
在一种可能的实现方式中,上述确定第二色彩校正矩阵包括:对上述第一色彩校正矩阵作调整以得到上述第二色彩校正矩阵。
在一种可能的实现方式中,上述对上述第一色彩校正矩阵作调整以得到上述第二色彩校正矩阵包括:将上述第一色彩校正矩阵与单位矩阵做加权平均以得到上述第二色彩校正矩阵。
本申请实施例通过将第一色彩校正矩阵与单位矩阵做加权平均,得到第二色彩校正矩阵,以降低第二色彩校正矩阵的校正幅度,从而抑制由于色彩校正导致的色彩过饱的现象。
在一种可能的实现方式中,上述对上述第一色彩校正矩阵作调整以得到上述第二色彩校正矩阵包括:对上述第一色彩校正矩阵作多次调整以得到上述第二色彩校正矩阵;其中,下一次调整中的加权平均的参数α 1大于当前调整中的加权平均参数α 2,α 1和α 2是上述单位 矩阵的权值。
本申请实施例通过增加单位矩阵的加权平均的参数,来降低第二色彩校正矩阵的校正幅度,从而抑制由于色彩校正导致的色彩过饱的现象。
在一种可能的实现方式中,上述确定第二色彩校正矩阵后,上述利用上述第二色彩校正矩阵对上述待处理图像中每个图像点的第一色彩信息矩阵分别做色彩校正处理之前,上述方法还包括:利用上述第二色彩校正矩阵对待处理图像中多个图像块中的每个图像块的第一色彩信息矩阵分别重新做色彩校正预处理,以更新上述每个图像块的第二色彩信息矩阵;
若确定上述待处理图像中仍然存在导致过饱和的区域,则重复执行上述确定第二色彩校正矩阵的操作,直到确定上述待处理图像中不存在导致过饱和的区域。
在一种可能的实现方式中,上述三个颜色包括红色、绿色和蓝色。
第三方面,本申请实施例提供了一种色彩校正装置,包括:处理单元,用于利用第一色彩校正矩阵对待处理图像中多个图像点中的每个图像点的第一色彩信息矩阵分别做色彩校正处理,以得到上述每个图像点的第二色彩信息矩阵,上述第一色彩信息矩阵包括待处理的三个颜色的的色度值,上述第二色彩信息矩阵包括色彩校正后的三个颜色的色度值;更新校正单元,用于当确定上述待处理图像中存在导致过饱和的区域时,执行更新的校正操作,其中,上述区域包括多个导致过饱和的图像点,每个导致过饱和的图像点对应的第一颜色的色度值小于预设阈值,上述第一颜色是上述三个颜色中的一个,上述更新的校正操作包括:确定第二色彩校正矩阵,上述第二色彩校正矩阵的校正幅度低于上述第一色彩校正矩阵的校正幅度;将上述第二色彩校正矩阵提供给上述处理单元,以触发上述处理单元重新做校正处理;上述处理单元进一步用于利用上述第二色彩校正矩阵重新对上述每个图像点的第一色彩信息矩阵分别做色彩校正处理,以更新上述每个图像点的第二色彩信息矩阵。
在一种可能的实现方式中,上述多个导致过饱和的图像点是相邻的多个图像点。
在一种可能的实现方式中,上述多个导致过饱和的图像点的数量大于预设数量阈值,或者上述多个导致过饱和的图像点的数量与上述待处理图像包含的上述多个图像点的数量的比值大于预设比例阈值。
在一种可能的实现方式中,上述确定第二色彩校正矩阵包括:对上述第一色彩校正矩阵作调整以得到第二色彩校正矩阵。
在一种可能的实现方式中,上述对上述第一色彩校正矩阵作调整以得到上述第二色彩校正矩阵包括:将上述第一色彩校正矩阵与单位矩阵做加权平均以得到上述第二色彩校正矩阵。
在一种可能的实现方式中,上述更新校正单元用于:当确定上述待处理图像中存在导致过饱和的区域时,重复执行上述更新校正操作;其中,下一次更新校正操作中的加权平均的参数α 1大于当前更新的校正操作中的加权平均参数α 2,α 1和α 2是上述单位矩阵的权值。
在一种可能的实现方式中,上述更新校正单元还用于:在上述处理单元更新上述每个图像点的第二色彩信息矩阵后,若确定上述待处理图像中仍然存在导致过饱和的区域,则 重复执行上述更新的校正操作,直到确定上述待处理图像中不存在导致过饱和的区域。
在一种可能的实现方式中,上述三个颜色包括红色、绿色和蓝色。
在一种可能的实现方式中,上述待处理图像为自动白平衡后的图像。
第四方面,本申请实施例提供了一种色彩校正装置,包括:预处理单元,用于利用第一色彩校正矩阵对待处理图像中多个图像块中的每个图像块的第一色彩信息矩阵分别做色彩校正预处理,以得到上述每个图像块的第二色彩信息矩阵,上述第一色彩信息矩阵包括待处理的三个颜色的色度值,上述第二色彩信息矩阵包括色彩校正预处理后的三个颜色的色度值;每个图像块包括多个图像点,每个图像块的第一色彩信息矩阵为上述多个图像点的第一色彩信息矩阵的平均;确定单元,用于当确定上述待处理图像中存在导致过饱和的区域时,确定第二色彩校正矩阵,其中,上述区域包括多个导致过饱和的图像块,每个导致过饱和的图像块对应的第一颜色的色度值小于预设阈值,上述颜色是上述三个颜色中的一个,上述第二色彩校正矩阵的校正幅度低于上述第一色彩校正矩阵的校正幅度;色彩校正处理单元,用于利用上述第二色彩校正矩阵对上述待处理图像中每个图像点的第一色彩信息矩阵分别做色彩校正处理。
在一种可能的实现方式中,上述多个导致过饱和的图像块是相邻的多个图像块。
在一种可能的实现方式中,上述多个导致过饱和的图像块的数量大于预设数量阈值,或者上述多个导致过饱和的图像块的数量与上述待处理图像包含的上述多个图像块的数量的比值大于预设比例阈值。
在一种可能的实现方式中,上述确定单元用于:当确定上述待处理图像中存在导致过饱和的区域时,对上述第一色彩校正矩阵作调整以得到上述第二色彩校正矩阵。
在一种可能的实现方式中,上述确定单元用于:当确定上述待处理图像中存在导致过饱和的区域时,将上述第一色彩校正矩阵与单位矩阵做加权平均以得到上述第二色彩校正矩阵。
在一种可能的实现方式中,上述确定单元用于:当确定上述待处理图像中存在导致过饱和的区域时,对上述第一色彩校正矩阵作多次调整以得到上述第二色彩校正矩阵;其中,下一次调整中的加权平均的参数α 1大于当前调整中的加权平均参数α 2,α 1和α 2是上述单位矩阵的权值。
在一种可能的实现方式中,在上述确定单元确定第二色彩校正矩阵后,上述色彩校正处理单元做色彩校正处理之前,将上述第二色彩校正矩阵提供给上述预处理单元,以触发上述预处理单元重新色彩校正进行预处理;
上述预处理单元进一步用于,利用上述第二色彩校正矩阵对待处理图像中多个图像块中的每个图像块的第一色彩信息矩阵分别做色彩校正预处理,以更新上述每个图像块的第二色彩信息矩阵;
上述确定单元具体用于:若确定上述待处理图像中仍然存在导致过饱和的区域,则重复执行上述确定第二色彩校正矩阵的操作,直到确定上述待处理图像中不存在导致过饱和的区域。
在一种可能的实现方式中,上述三个颜色包括红色、绿色和蓝色。
可选地,在第三方面、第四方面、或其中任一个可能的实现方式中,至少一个单元可以以软件或硬件方式或其结合实现。可选地,软件实现的单元可包括软件指令程序;硬件实现的单元可包括逻辑电路。
第五方面,本申请实施例提供了一种图像信号处理器,包括:自动白平衡模块及色彩校正装置,其中,上述色彩校正装置为本申请实施例第三方面或者第三方面的任意一种实现方式、第四方面或者第四方面的任意一种实现方式提供的色彩校正装置。
第六方面,本申请实施例提供了一种色彩校正装置,包括处理器,也可以进一步选择性地包括存储器;上述存储器用于存储程序指令,上述处理器用于调用上述存储器中的程序指令并执行本申请实施例第一方面或第一方面任意一种实现方式、第二方面或第二方面任意一种实现方式提供的色彩校正方法。
第七方面,本申请实施例提供了一种计算机可读存储介质,上述计算机可读存储介质中存储有指令,当其在计算机或处理器上运行时,使得上述计算机或处理器执行本申请实施例第一方面或第一方面任意一种实现方式、第二方面或第二方面任意一种实现方式提供的色彩校正方法。
第八方面,本申请实施例提供了一种计算机程序产品,当其在计算机或处理器上运行时,使得所述计算机或处理器执行本申请实施例第一方面或第一方面任意一种实现方式、第二方面或第二方面任意一种实现方式提供的色彩校正方法。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。
图1为本申请实施例提供的一种电子成像设备的结构图;
图2为本申请实施例提供的一种图像信号处理器的结构图;
图3为本申请实施例提供的一种色彩校正装置的结构图;
图4为本申请实施例提供的另一种色彩校正装置的结构图;
图5为本申请实施例提供的一种色彩校正方法流程图;
图6为与图像点P i,j相邻的图像点的示意图;
图7为本申请实施例提供的另一种色彩校正方法流程图;
图8为本申请实施例提供的另一种色彩校正装置结构图。
具体实施方式
下面将结合附图对本申请实施例中的技术方案进行清楚、详尽地描述。
首先请参阅图1。图1示出了本申请实施例提供的一种电子成像设备10的结构示意图。 电子成像设备10可以但不限于是照相机或摄像机、包括照相机或摄像机的电子设备,如膝上型计算机、台式计算机、移动电话、智能手机、平板电脑、或头戴式显示设备等,可以用于采集和处理图像数据。
如图1所示,电子成像设备10可以包括:一个或多个处理器101、输入/输出接口102、用户接口103、显示屏104、存储器105、图像信号处理器106、一个或多个成像装置107、扩展卡108、电源109、网络设备110及至少一个通信总线111。其中,通信总线111用于实现这些组件之间的连接通信,应当理解,电子成像设备10中的各个组件还可以通过其他连接器相耦合,所述其他连接器可包括各类接口、传输线或总线等。在本申请的各个实施例中,耦合是指通过相互电连接或连通,包括直接相连或通过其他设备间接相连。
图像信号处理器106:用于对成像装置107采集的图像数据进行处理,例如但不限于是:对缺陷像素进行检测、校正处理;对图像进行锐化处理;对图像进行自动白平衡校正处理;对图像进行色彩校正处理。图像信号处理器106处理的图像数据可以从存储器105中获取,也可以从成像装置107中获取。可选地,图像信号处理器106可以通过调用存储器中的计算机程序指令完成对图像数据的处理。可选地,图像信号处理器106还可以通过图像内部硬件逻辑处理电路完成对图像数据的处理。也即是说,像信号处理器106可以包括执行软件的通用处理器,如微处理器或处理单元,或者可以包括执行处理的硬件逻辑电路,或者可以是两者的结合。
输入/输出接口102:用于连接各种外部设备的接口,例如电源、音频输出设备(如耳机)或其他电子设备(如手持设备和/或计算机)、打印机、投影仪、外部显示器等等。输入/输出接口102可支持的接口类型例如但不限于是通用串行总线(universal serial bus,USB)接口、以太网或调制解调器接口、交流/直流(alternating current/direct current,AC/DC)电源接口。
用户接口103:用于接收用户输入的指令,可以包括键盘、物理按钮(按压按钮、摇臂按钮等)、拨号盘、点击滚轮等等。在一些可能的实施例中,用户接口103与显示屏104可以结合在一起。例如在显示屏104为触摸屏的情况下,电子成像设备10可以通过触摸屏显示图像,还可以通过触摸屏接收用户输入的指令。
处理器101可以包括以下至少一种类型:通用中央处理器(central processing unit,CPU)、一个或多个微处理器、数字信号处理器(DSP)、微控制器(microcontroller unit,MCU)、或人工智能处理器,还可进一步包括必要的硬件加速器,如专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)、或者用于实现逻辑运算的集成电路。处理器101被耦合到一个或多个数据总线,用于在电子成像设备10的各个组件之间传输数据和指令。
存储器105可以包括非掉电易失性存储器,例如是嵌入式多媒体卡(embedded multi media card,EMMC)、通用闪存存储(universal flash storage,UFS)或只读存储器(read-only memory,ROM)。可选的,存储器105还可以包括掉电易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或 存储具有指令或数据结构形式的程序代码并能够由计算机存取的任何其他计算机可读存储介质,但不限于此。可选的,存储器105可选的还可以是至少一个位于远离前述处理器101的存储系统。作为一种计算机存储介质的存储器105中可以包括操作系统、网络通信模块、用户接口模块以及程序指令等必要的软件程序。
电子成像设备10还可以包括一个或多个扩展卡108。扩展卡108可用于为电子成像设备10添加功能。在一个实施例中,扩展卡108可以是闪存卡,用于为电子成像设备10提供存储介质。在另外一个实施例中,扩展卡108可以是用户身份模块(subscriber identification module,SIM)卡,用于为电子成像设备10提供移动通话功能。
电子成像设备10还可以包括网络设备110,网络设备110可以是网络控制器或网络接口卡,电子成像设备10可以通过网络设备110连接网络。或者网络设备110可以是用于进行无线通信连接的调制解调器或射频单元。
电子成像设备10还可以包括电源109,用于为电子成像设备10各个组件的运行供电。电源109可以为电子成像设备10进行便携式供电以及非便携式供电。在便携式供电中,电源109可以是一个或多个电池,例如锂离子电池,还可以是从电池接收电能并进一步向网络设备110供电的供电管理单元。电池可以通过连接到外部电源,例如插座来重新充电。
显示屏104:用于显示由电子成像设备10生成的各种图像,例如操作系统的图形用户界面(graphical user interface,GUI)、或由图像信号处理器106处理的图像数据(包括静止图像和视频数据)。图像数据可以包括使用成像装置107获取的图像数据或从存储器105获取的图像数据。显示屏104可以包括任何合适类型的显示屏。例如液晶显示器(liquid crystal display,LCD)、等离子显示器或有机发光二极管(organic light-emitting diode,OLED)显示器。
成像装置107可以获取静止图像和运动图像(例如视频),成像装置107可以是摄像头等。成像装置107可以包括透镜和一个或多个图像传感器,用于捕捉光信号,并将光信号转换为电信号。
接下来结合图1提供的电子成像设备10,介绍本申请实施例提供的一种用于电子成像设备10中的图像信号处理器106。
如图2所示,图像信号处理器106至少可以包括:自动白平衡装置1061及色彩校正装置1062。其中,自动白平衡装置1061用于接收输入图像,并对输入图像进行自动白平衡处理,以修正输入图像的色偏,使原本场景中白色对象在图像中显示白色。色彩校正装置1062用于提前检测经过色彩校正后的输出图像中是否会存在过饱和区域,若存在则调整色彩校正矩阵,并根据调整后的色彩校正矩阵对自动白平衡装置1061输出的自动白平衡后的图像进行色彩校正处理,输出色彩校正后的图像。采用本申请实施例中的图像信号处理器106对输入图像进行处理,可以在提高输出图像色彩鲜艳度的同时,兼顾输出图像的细节,抑制色彩过饱和导致的失真现象。本申请实施例中的图像信号处理器106还可以包括其他模块,例如线性纠正模块、噪声去除模块、坏点去除模块、内插模块等等,图2中未示出,此处不做介绍。自动白平衡装置1061及色彩校正装置1062的一个或全部可以以软件、硬件或软件和硬件结合的方式实现,后续将具体介绍。
在一种可能的实施例中,色彩校正装置1062可以包括处理单元10621及更新校正单元10622,如图3所示。其中:
处理单元10621:用于利用第一色彩校正矩阵对待处理图像中多个图像点中的每个图像点的第一色彩信息矩阵分别做色彩校正处理,以得到每个图像点的第二色彩信息矩阵。
具体地,第一色彩信息矩阵包括待处理的三个颜色的色度值,第二色彩信息矩阵包括色彩校正后的三个颜色的色度值。三个颜色的色度值对应三个颜色通道,也叫RBG值。
具体地,上述待处理图像为自动白平衡后的图像。
更新校正单元10622:用于当确定待处理图像中存在导致过饱和的区域时,执行更新的校正操作。其中,上述区域中包括多个导致过饱和的图像点,每个导致过饱和的图像点对应的第一颜色的色度值小于预设阈值,上述第一颜色是上述三个颜色中的一个。
具体地,上述更新的校正操作包括:
确定第二色彩校正矩阵,上述第二色彩校正矩阵的校正幅度低于第一色彩校正矩阵的校正幅度。
将上述第二色彩校正矩阵提供给处理单元10621,以触发处理单元10622重新做校正处理。
处理单元10621进一步用于利用上述第二色彩校正矩阵重新对上述每个图像点的第一色彩信息矩阵分别做色彩校正处理,以更新上述每个图像点的第二色彩信息矩阵。
具体地,上述多个导致过饱和的图像点是相邻的多个图像点。
具体地,上述多个导致过饱和的图像点的数量大于预设数量阈值,或者上述多个导致过饱和的图像点的数量与上述待处理图像包含的多个图像点的数量的比值大于预设比例阈值。
具体地,上述确定第二色彩校正矩阵包括:对上述第一色彩校正矩阵作调整以得到上述第二色彩校正矩阵。
具体地,上述对上述第一色彩校正矩阵作调整以得到上述第二色彩校正矩阵包括:将上述第一色彩校正矩阵与单位矩阵做加权平均以得到上述第二色彩校正矩阵。
具体地,上述更新校正单元10622用于:当确定上述待处理图像中存在导致过饱和的区域时,重复执行上述更新的校正操作。其中,下一次更新的校正操作中的加权平均的参数α 1大于当前更新的校正操作中的加权平均参数α 2,α 1和α 2是上述单位矩阵的权值。
具体地,上述更新校正单元10622还用于:在上述处理单元10621更新上述每个图像点的第二色彩信息矩阵后,若确定上述待处理图像中仍然存在导致过饱和的区域,则重复执行上述更新的校正操作,直到确定上述待处理图像中不存在导致过饱和的区域。
具体地,上述三个颜色包括红色、绿色和蓝色。在具体的实现中,上述三个颜色还可以包括其他颜色,本申请对此不做限制。
实施本申请实施例可以在采用色彩校正矩阵对待处理图像进行色彩校正时,先判断待处理图像中是否存在导致过饱和的区域,若存在,则降低色彩校正的幅度。在提高输出图像饱和度的同时,本方案兼顾输出图像的细节,抑制色彩过饱和导致的失真现象。
在另外一种可能的实施例中,色彩校正装置1062可以包括预处理单元10623、确定单元10624及色彩校正处理单元10625,如图4所示。其中:
预处理单元10623,用于利用第一色彩校正矩阵对待处理图像中多个图像块中的每个图像块的第一色彩信息矩阵分别做色彩校正预处理,以得到上述每个图像块的第二色彩信息矩阵。其中,上述第一色彩信息矩阵包括待处理的三个颜色的色度值,上述第二色彩信息矩阵包括色彩校正预处理后的三个颜色的色度值;每个图像块包括多个图像点,每个图像块的第一色彩信息矩阵为上述多个图像点的第一色彩信息矩阵的平均。
具体地,上述待处理图像的图像单位为图像块,每个图像块包括多个图像点,每个图像块的第一色彩信息矩阵为其包括的多个图像点的第一色彩信息矩阵的平均。本申请后续实施例中将包括了M×N个图像块的色度值的图像称为小彩图。在色彩校正预处理过程中,以图像块为图像单位,计算每个图像块的第二色彩信息矩阵。
确定单元10624,用于当确定上述待处理图像中存在导致过饱和的区域时,确定第二色彩校正矩阵,其中,上述区域包括多个导致过饱和的图像块,每个导致过饱和的图像块对应的第一颜色的色度值小于预设阈值,上述颜色是所述三个颜色中的一个,上述第二色彩校正矩阵的校正幅度低于上述第一色彩校正矩阵的校正幅度。
具体地,上述多个导致过饱和的图像块的相邻的多个图像块。
可选地,上述多个导致过饱和的图像块的数量大于预设数量阈值。
可选地,上述多个导致过饱和的图像块的数量与上述待处理图像包含的上述多个图像块的数量的比值大于预设比例阈值。
具体地,确定单元10624用于:当确定上述待处理图像中存在导致过饱和的区域时,对上述第一色彩校正矩阵作调整以得到上述第二色彩校正矩阵。
具体地,确定单元10624用于:当确定上述待处理图像中存在导致过饱和的区域时,将上述第一色彩校正矩阵与单位矩阵做加权平均以得到上述第二色彩校正矩阵。
具体地,确定单元10624用于:当确定上述待处理图像中存在导致过饱和的区域时,对上述第一色彩校正矩阵作多次调整以得到上述第二色彩校正矩阵;其中,下一次调整中的加权平均的参数α 1大于当前调整中的加权平均参数α 2,α 1和α 2是上述单位矩阵的权值。
具体地,在确定单元10624确定第二色彩校正矩阵后,色彩校正处理单元10625做色彩校正处理之前,将上述第二色彩校正矩阵提供给预处理单元10623,以触发预处理单元10623重新色彩校正进行预处理。
预处理单元10623进一步用于,利用上述第二色彩校正矩阵对待处理图像中多个图像块中的每个图像块的第一色彩信息矩阵分别做色彩校正预处理,以更新上述每个图像块的第二色彩信息矩阵。
确定单元10624具体用于:若确定上述待处理图像中仍然存在导致过饱和的区域,则重复执行上述确定第二色彩校正矩阵的操作,直到确定上述待处理图像中不存在导致过饱和的区域。
色彩校正处理单元10625,用于利用上述第二色彩校正矩阵对上述待处理图像中每个图像点的第一色彩信息矩阵分别做色彩校正处理。
具体地,在确定单元10624确定第二色彩校正矩阵后,采用最终确定的第二色彩校正 矩阵对待处理图像中每个图像点的第一色彩信息矩阵分别做色彩校正处理,以获得待处理图像中每个图像点的第二色彩信息矩阵,最终输出经过色彩校正处理后的图像。
实施本申请实施例可以在采用色彩校正矩阵对待处理图像进行色彩校正之前,先对待处理图像进行预处理,以判断待处理图像中是否存在导致过饱和的区域,若存在,则降低色彩校正的幅度。在确定合适的色彩校正矩阵后,再采用该色彩校正矩阵进行色彩校正处理。在提高输出图像饱和度的同时,本方案兼顾输出图像的细节,抑制色彩过饱和导致的失真现象。进一步地,本申请实施例中的小彩图根据自动白平衡校正后的图像得到,将自动白平衡校正后的图像划分为若干个图像块,每个图像块的第一色彩信息矩阵为其包括的所有图像点的第一色彩信息矩阵的平均。小彩图是包括了若干个图像块的色度值的图像。小彩图可以准确的表现输入图像的色彩特性,且图像块个数少,降低确定色彩校正矩阵的计算量。
接下来结合图1-图4,介绍本申请实施例提供的一种色彩校正方法。如图5所示,色彩校正方法至少可以包括以下几个步骤,可以由色彩校正装置1602执行:
S101:利用第一色彩校正矩阵对待处理图像中多个图像点中的每个图像点的第一色彩信息矩阵分别做色彩校正处理,以得到每个图像点的第二色彩信息矩阵。
具体地,第一色彩信息矩阵包括待处理的三个颜色的色度值,第二色彩信息矩阵包括色彩校正后的三个颜色的色度值。
具体地,待处理图像为自动白平衡校正后的图像。因为自动白平衡校正之前的原始输入图像中,原本白色的物体,在图像中会带有颜色,会影响色彩校正后输出图像的准确性。因此,对自动白平衡校正后的图像进行色彩校正,可以使色彩校正后的输出图像更加准确。
具体地,每个图像点包括三个不同的颜色,每个图像点的第一色彩信息矩阵由三个颜色的色度值组成,即每个图像点的第一色彩信息矩阵包含3个元素,每个元素也叫一个颜色通道,分别代表一个颜色的色度值,每个图像点的第一色彩信息矩阵可以是3×1的矩阵,也可以是1×3的矩阵,代表如前所述的RBG值。
可选地,若每个图像点的色彩信息矩阵为3×1的矩阵,上述利用第一色彩校正矩阵对待处理图像中每个图像点的第一色彩信息矩阵做色彩校正处理,以得到每个图像点的第二色彩信息矩阵可以是将第一色彩校正矩阵与待处理图中每个图像点的第一色彩信息矩阵相乘,以获得每个图像点的第二色彩信息矩阵。
具体地,将第一色彩校正矩阵与待处理图像中每个图像点的第一色彩信息矩阵相乘,即可获得相乘后的矩阵,该相乘后的矩阵为该图像点的色彩校正后的第二色彩信息矩阵,该色彩校正后的第二色彩信息矩阵包括三个元素,每个元素代表一个颜色的色度值。
示例性的,若第一色彩校正矩阵
Figure PCTCN2018102081-appb-000002
待处理图像中包括M×N个图像点,每个图像点包括红(R)、绿(G)、蓝(B)三种颜色。则第i行第j列的图像点b i,j的 第一色彩信息矩阵为
Figure PCTCN2018102081-appb-000003
该图像点经过色彩校正后的图像点b i,j′的第二色彩信息矩阵
Figure PCTCN2018102081-appb-000004
的计算公式如下:
Figure PCTCN2018102081-appb-000005
则该图像点经过色彩校正后的红色的色度值R i,j′=a 11*R i,j+a 12*G i,j+a 13*B i,j
该图像点经过色彩校正后的绿色的色度值G i,j′=a 21*R i,j+a 22*G i,j+a 23*B i,j
该图像点经过色彩校正后的蓝色的色度值B i,j′=a 31*R i,j+a 32*G i,j+a 33*B i,j
可选地,若每个图像点的第一色彩信息矩阵为1×3的矩阵,此时第一色彩校正矩阵可以是上述第一色彩校正矩阵A的转置矩阵,即为A T。上述利用第一色彩校正矩阵对待处理图像中每个图像点的第一色彩信息矩阵做色彩校正处理,以得到每个图像点的第二色彩信息矩阵,即为将待处理图像中每个图像点的第一色彩信息矩阵与第一色彩校正矩阵相乘,获得第二色彩校正矩阵。具体计算方式如下:
Figure PCTCN2018102081-appb-000006
本申请以下实施例中均以每个图像点的第一色彩信息矩阵为3×1的矩阵为例进行说明。
S102:判断待处理图像中是否存在导致过饱和的区域,若是,执行S103,若否,执行S105。
具体地,上述导致过饱和的区域包括多个导致过饱和的图像点,每个导致过饱和的图像点的第一颜色的色度值小于预设阈值。其中,第一颜色为上述三个颜色中的一个。
具体地,上述预设阈值为负数,例如但不限于是-6、-8、-10等。若待处理图像中某个图像点经过色彩校正后的第一颜色的色度值小于上述预设阈值,即表明待处理图像中该图像点为导致过饱和的图像点。多个经过色彩校正后的第一颜色的色度值小于上述预设阈值的图像点构成了上述导致过饱和的区域。
进一步地,上述多个导致过饱和的图像点是相邻的。
具体地,待处理图像中某一个图像点的上、下、左、右、左上、左下、右上、右下的 图像点均可看作与该图像点相邻的图像点。例如,与第i行第j列的图像点P i,j相邻的图像点可以包括:P i-1,j-1(左上)、P i-1,j(上)、P i-1,j+1(右上)、P i,j-1(左)、P i,j+1(右)、P i+1,j-1(左下)、P i+1,j(下)、P i+1,j+1(右下)。如图6所示。
可选地,多个导致过饱和的图像点的数量与待处理图像包含的图像点的数量的比值大于预设比例阈值。其中,预设比例阈值例如可以但不限于是0.2%、0.4%、1%等。预设比例阈值越小,经过色彩校正后的输出图像失真越小。
可选地,上述多个导致过饱和的图像点的数量大于预设数量阈值。其中,预设数量阈值例如可以但不限于是10、20、50等。预设数量阈值越小,经过色彩校正后的输出图像失真越小。具体地,上述第二色彩校正矩阵的校正幅度低于第一色彩校正矩阵的校正幅度。第二色彩校正矩阵可以是对第一色彩校正矩阵作调整得到。
S103:确定第二色彩校正矩阵。
其中,第二色彩校正矩阵的校正幅度低于第一色彩校正矩阵的校正幅度。
具体地,可以将第一色彩校正矩阵与单位矩阵做加权平均以得到第二色彩校正矩阵。
具体地,将第一色彩校正矩阵与单位矩阵做加权平均得到第二色彩校正矩阵的计算公式如下:
A 2=α×I+(1-α)×A 1         (1)
其中,A 1为第一色彩校正矩阵,A 2为第二色彩校正矩阵,I为单位矩阵,α为单位矩阵的权值,α∈[0,1]。以上公式的操作相当于将第一色彩校正矩阵与单位矩阵进行了平滑使得得到的第二色彩校正矩阵更多的接近单位矩阵,从而降低校正幅度。
具体地,上述将第一色彩校正矩阵与单位矩阵做加权平均以得到第二色彩校正矩阵的过程可以是多次重复的,且下一次操作的加权平均的参数α 1大于当前校正操作中的加权平均参数α 2,α 1和α 2是单位矩阵的权值。实施本申请实施例可以抑制由色彩过饱和导致的图像失真现象。
S104:利用第二色彩校正矩阵重新对每个图像点的第一色彩信息矩阵分别做色彩校正处理,以更新每个图像点的第二色彩信息矩阵。
具体地,利用第二色彩校正矩阵更新每个图像点的第二色彩信息矩阵后,若待处理图像中仍然存在导致过饱和的区域,则重复执行S102,直到待处理图像中不存在导致过饱和的区域。
具体地,α的初始值为0,每执行一次S103,则修改一次参数α,具体是将α的值递加β,即α=α+β;其中,β∈(0,1),β即为调整步长。
式(1)中,当α等于0时,第二色彩校正矩阵为第一色彩校正矩阵,代表维持原本的色彩增益强度,如果α等于1,代表第二色彩校正矩阵为单位矩阵,此时色彩增益强度为1(即无色彩增益),此时R’G’B’值完全等于RGB值,α值越大代表第一色彩校正矩阵加入单位矩阵的成份越多,待处理图像的R’G’B’越不容易为负值。
当输入一张新的待处理图像后,参数α的初始值设定为0,与待处理图像相乘的第一色彩校正矩阵为A 1,这时A 2等于A 1(即是系统默认定的第一色彩校正矩阵),判断待处理图像中是否存在导致过饱和的区域,若存在,则增加α值,产生新的第二色彩校正矩阵与待 处理图像各个图像点的第一色彩信息矩阵相乘,再判断待处理图像中是否存在导致过饱和的区域,如此迭代计算,直到待处理图像中不存在导致过饱和的区域,最后的A 2即为输出的CC矩阵(新调整后的CC模块3x3矩阵)。再利用A 2对待处理图像的每个图像点的第一色彩信息矩阵做色彩校正处理。每次增加α值的幅度定义为β,也叫调整步长,β值越大则所需迭代次越少,但A 2与最佳的CC矩阵误差会较大,最佳的CC矩阵是指过饱和区域面积小于比例阈值且能维持最大色彩增益的矩阵,本申请实施例中的β为0.01。
S105:输出色彩校正后的图像。可以知道的是,在利用第二色彩校正矩阵更新每个图像点的第二色彩信息矩阵后,若待处理图像中仍然存在导致过饱和的区域,也可以直接输出色彩校正后的图像,只需第二色彩校正矩阵的校正幅度低于第一色彩校正矩阵的幅度,即可在一定程度上抑制输出图像中的过饱和现象。
实施本申请实施例可以在采用色彩校正矩阵对待处理图像进行色彩校正时,先判断是否会产生色彩过饱和的现象,导致输出图像失真。若会导致输出图像失真,则降低色彩校正的幅度。在提高输出图像饱和度的同时,兼顾输出图像的细节,抑制色彩过饱和导致的失真现象。
本申请实施例提供了另外一种色彩校正方法,如图7所示,色彩校正方法至少可以包括以下几个步骤,可以由色彩校正装置1602执行:
S401:输入自动白平衡校正后的图像。
具体地,自动白平衡校正之前的原始输入图像中,原本白色的物体,在图像中会带有颜色,会影响色彩校正后输出图像的准确性。因此,本申请实施例中的输入图像为自动白平衡校正后的图像。
S402:根据自动白平衡校正后的图像产生小彩图。
具体地,本申请实施例中,待处理图像为根据自动白平衡校正后的图像得到的小彩图。其中,小彩图为包括了M×N个图像块的色度值的图像,每个图像块包括多个图像点,每个图像块的第一色彩信息矩阵为其包括的多个图像点的第一色彩信息矩阵的平均。每个图像点的第一色彩信息矩阵包括三个颜色的子图像点的色度值。多个图像点的第一色彩信息矩阵的平均矩阵包含的某一个元素的值即为各图像点的第一色彩信息矩阵中位于相同位置的元素的值的平均值。
具体地,将自动白平衡校正后的图像分割成M×N个图像块后,计算每个图像块包含的所有图像点的相同颜色的色度值的平均值,得到三个颜色的色度值的平均值,从而得到一个图像块的第一色度信息矩阵。示例性的,自动白平衡校正后的图像包括100×100个图像点,每个图像点包括红(red,R)、绿(green,G)、蓝(blue,B)三个不同的颜色,将自动白平衡校正后的图像分割成10×10个图像块。第i行第j列的图像块包含10×10个图像点(1≤i≤M,1≤j≤N),这个块包含的所有图像点(10×10个图像点)的各个子图像点色度值的平均值包括所有R色度值的平均值
Figure PCTCN2018102081-appb-000007
所有G色度值的平均值
Figure PCTCN2018102081-appb-000008
所有B色度值的平均值
Figure PCTCN2018102081-appb-000009
即为待处理图像中第i行第j列的图像块的R的色度值;
Figure PCTCN2018102081-appb-000010
即为待处理 图像中第i行第j列的图像块的G的色度值;
Figure PCTCN2018102081-appb-000011
即为待处理图像中第i行第j列的图像块的B的色度值。
S403:利用第一色彩校正矩阵对小彩图中每个图像块的第一色彩信息矩阵分别做色彩校正预处理,以得到每个图像块的第二色彩信息矩阵。
具体地,小彩图中每个图像块包括三个的不同颜色,每个图像块的第一色彩信息矩阵由三个颜色的色度值组成,即每个图像块的第一色彩信息矩阵包含3个元素,每个元素分别代表一个颜色的色度值。
具体地,将第一色彩校正矩阵与小彩图中每个图像块的第一色彩信息矩阵相乘,获得每个图像块的第二色彩信息矩阵。
S404:判断小彩图中是否存在导致过饱和的区域,若是,则执行S405,若否,则执行S407。
具体地,上述导致过饱和的区域包括多个导致过饱和的图像块,每个待处理的导致过饱和的图像块的第一颜色的色度值小于预设阈值。其中,第一颜色为上述三个颜色中的一个。
具体地,上述预设阈值为负数,例如但不限于是-6、-8、-10等。若小彩图中某个图像块经过色彩校正预处理后的第一颜色的色度值小于上述预设阈值,即表明待小彩图中该图像块为导致过饱和的图像块。多个经过色彩校正预处理后的第一颜色的色度值小于上述预设阈值的图像块构成了上述导致过饱和的区域。
进一步地,上述多个导致过饱和的图像块是相邻的。对于图像块相邻的含义可参考图6中对于相邻图像点的描述,在此不再赘述。
可选地,多个导致过饱和的图像块的数量与小彩图包含的图像块的数量的比值大于预设比例阈值。
可选地,多个导致过饱和的图像块的数量大于预设数量阈值。
S405:确定第二色彩校正矩阵。
具体地,第二色彩校正矩阵的校正幅度低于第一色彩校正矩阵的校正幅度。
具体地,若S404中判断出小彩图中存在导致过饱和的区域,则表明经过色彩校正后的输出图像中将会存在过饱和区域,则需调整色彩校正矩阵。具体可以将第一色彩校正矩阵与单位矩阵做加权平均以得到第二色彩校正矩阵,计算公式如式(1)所示,在此不再赘述。
S406:利用第二色彩校正矩阵重新对每个图像块的第一色彩信息矩阵分别做色彩校正预处理,以更新每个图像块的第二色彩信息矩阵。
具体地,更新每个图像块的第二色彩信息矩阵后,再次执行S404,根据第二色彩信息矩阵判断小彩图中是否存在导致过饱和的区域,若存在,则再一次确定第二色彩信息矩阵,直至小彩图中不存在导致过饱和的区域,则确定最终的第二色彩信息矩阵。
S407:对自动白平衡校正后的图像进行色彩校正处理。
具体地,本申请实施例中对自动白平衡校正后的图像进行色彩校正处理,即为对待处理图像中每个图像点的第一色彩信息矩阵进行色彩校正处理。本实施例与图5的流程的主要差异在于存在一个预校正的过程,并通过预校正来确定是否可能存在过饱和以便进行调 整,由于预校正是针对图像块而非内部的图像点,因此预校正的复杂度更低,实现更简单。
具体地,若根据第一色彩校正矩阵与小彩图中每个图像块的第一色彩信息矩阵获得的第二色彩信息矩阵后,根据各个图像块的第二色彩信息矩阵判断出小彩图中不存在导致过饱和区域,则采用第一色彩校正矩阵对S401中输入的自动白平衡校正后的图像进行色彩校正处理,最终输出色彩校正后的图像。若通过至少一次的对第一色彩校正矩阵调整得到的第二色彩校正矩阵对小彩图的第一色彩信息矩阵进行色彩校正预处理,得到更新后的第二色彩信息矩阵,并根据该第二色彩信息矩阵判断出小彩图中不存在导致过饱和的区域,则采用最后一次调整得到的第二色彩校正矩阵对S401中输入的自动白平衡校正后的图像进行色彩校正处理,最终输出色彩校正后的图像。
可以知道的是,若通过至少一次的对第一色彩校正矩阵与单位矩阵做加权平均得到的第二色彩校正矩阵对小彩图的第一色彩信息矩阵进行色彩校正预处理,得到更新后的第二色彩信息矩阵,并根据该第二色彩信息矩阵判断出小彩图中仍然存在导致过饱和的区域时,也可以直接采用已确定的最新的第二色彩校正矩阵对S401中输入的自动白平衡校正后的图像进行色彩校正处理,最终输出色彩校正后的图像,可以在一定程度上抑制色彩过饱和的现象。实施本申请实施例可以在采用第一色彩校正矩阵对自动白平衡校正后的图像进行色彩校正之前,先根据小彩图判断是否会产生色彩过饱和的现象,导致输出图像失真。若会导致输出图像失真,则降低色彩校正矩阵的校正幅度,直到输出图像不会失真。在提高输出图像饱和度的同时,兼顾输出图像的细节,确保输出图像不会失真。此外,本申请实施例对自动白平衡校正后的图像进行分割处理,分割后获得的小彩图能够准确表现自动白平衡校正后的图像的颜色特性,且降低计算量。
参见图8,图8是本申请实施例提供的一种色彩校正装置20。如图8所示,色彩校正装置50至少可以是图像信号处理器106或装置1602的一种具体实现形式。装置50包括:处理器520,也可以进一步选择性包括存储器510;其中:存储器510用于存储程序指令;处理器520用于调用存储器510中的程序指令并执行图5或图7实施例提供的色彩校正方法。图8的装置50包括存储器510,但实际上存储器510可以位于处理器520之外(图中未示出),即存储器510可以外置于图像信号处理器106或装置1602。
需要说明的是,图3和图4实施例中的色彩校正装置1062可以通过软件实现,也可以通过硬件实现。若通过硬件实现,则可采用逻辑电路实现,即处理单元10621和更新校正单元10622可分别以逻辑电路实现;预处理单元10623、确定单元10624、色彩校正处理单元10625也可分别以逻辑电路实现。即图3和图4涉及的单元的一个或多个以硬件实现的时候,其内部包括大量逻辑电路,通过硬件的逻辑电路实现处理功能。若图3和图4涉及的多个单元的一个或多个通过软件实现,则每个单元可包括实现对应功能的程序指令,则相关的程序指令可被图8实施例中的存储器510存储,并被处理器520执行,以实现图5或图7实施例提供的色彩校正方法。或者,在一个实施例中,所述图像信号处理器106或装置1062也可以由软件和硬件结合实现,即一部分单元是逻辑电路实现,另一部分则以软件指令的形式存储于存储器510中,并被处理器520执行。可选地,任一单元也可以以软件、硬件或其结合实现,即包括软件程序、或硬件电路的至少一种。本实施例对此不做限 定。因此,图8所示的装置50中的处理器520通过执行软件程序实现之前实施例提到的相关方法,除了运行程序的内核,还可包括必要的硬件加速器,该硬件加速器可以使之前所示的任一单元的逻辑电路。此时的装置50由软件和硬件结合实现。因此所述处理器520除了包括运行软件程序的处理器单元外,也可包括逻辑电路实现的硬件,本实施例不做限定。
本申请实施例还提供了一种计算机可读存储介质。上述方法实施例中的全部或者部分流程可以由计算机程序来指令相关的硬件完成,该程序可存储于上述计算机存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。该计算机可读存储介质包括:只读存储器(read-only memory,ROM)或随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可存储程序代码的介质。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。
本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。
本申请实施例装置中的模块可以根据实际需要进行合并、划分和删减。
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (34)

  1. 一种色彩校正方法,其特征在于,包括:
    利用第一色彩校正矩阵对待处理图像中多个图像点中的每个图像点的第一色彩信息矩阵分别做色彩校正处理,以得到所述每个图像点的第二色彩信息矩阵,所述第一色彩信息矩阵包括待处理的三个颜色的色度值,所述第二色彩信息矩阵包括色彩校正后的三个颜色的色度值;
    当确定所述待处理图像中存在导致过饱和的区域时,执行更新的校正操作,其中,所述区域包括多个导致过饱和的图像点,每个导致过饱和的图像点对应的第一颜色的色度值小于预设阈值,所述第一颜色是所述三个颜色中的一个,所述更新的校正操作包括:
    确定第二色彩校正矩阵,所述第二色彩校正矩阵的校正幅度低于所述第一色彩校正矩阵的校正幅度;
    利用所述第二色彩校正矩阵重新对所述每个图像点的第一色彩信息矩阵分别做色彩校正处理,以更新所述每个图像点的第二色彩信息矩阵。
  2. 如权利要求1所述的方法,其特征在于,所述多个导致过饱和的图像点是相邻的多个图像点。
  3. 如权利要求1或2所述的方法,其特征在于,所述多个导致过饱和的图像点的数量大于预设数量阈值,或者所述多个导致过饱和的图像点的数量与所述待处理图像包含的所述多个图像点的数量的比值大于预设比例阈值。
  4. 如权利要求1-3任一项所述的方法,其特征在于,所述确定第二色彩校正矩阵包括:对所述第一色彩校正矩阵作调整以得到所述第二色彩校正矩阵。
  5. 如权利要求4所述的方法,其特征在于,所述对所述第一色彩校正矩阵作调整以得到所述第二色彩校正矩阵包括:将所述第一色彩校正矩阵与单位矩阵做加权平均以得到所述第二色彩校正矩阵。
  6. 如权利要求5所述的方法,其特征在于,所述执行更新的校正操作包括:重复执行所述更新的校正操作;其中,下一次更新的校正操作中的加权平均的参数α 1大于当前更新的校正操作中的加权平均参数α 2,α 1和α 2是所述单位矩阵的权值。
  7. 如权利要求1-6任一项所述的方法,其特征在于,在更新所述每个图像点的第二色彩信息矩阵后,若确定所述待处理图像中仍然存在导致过饱和的区域,则重复执行所述更新的校正操作,直到确定所述待处理图像中不存在导致过饱和的区域。
  8. 如权利要求1-7任一项所述的方法,其特征在于,所述三个颜色包括红色、绿色和蓝色。
  9. 如权利要求1-8任一项所述的方法,其特征在于,所述待处理图像为自动白平衡后的图像。
  10. 一种色彩校正方法,其特征在于,包括:
    利用第一色彩校正矩阵对待处理图像中多个图像块中的每个图像块的第一色彩信息矩阵分别做色彩校正预处理,以得到所述每个图像块的第二色彩信息矩阵,所述第一色彩信 息矩阵包括待处理的三个颜色的色度值,所述第二色彩信息矩阵包括色彩校正预处理后的三个颜色的色度值;每个图像块包括多个图像点,每个图像块的第一色彩信息矩阵为所述多个图像点的第一色彩信息矩阵的平均;
    当确定所述待处理图像中存在导致过饱和的区域时,确定第二色彩校正矩阵,其中,所述区域包括多个导致过饱和的图像块,每个导致过饱和的图像块对应的第一颜色的色度值小于预设阈值,所述第一颜色是所述三个颜色中的一个,所述第二色彩校正矩阵的校正幅度低于所述第一色彩校正矩阵的校正幅度;
    利用所述第二色彩校正矩阵对所述待处理图像中每个图像点的第一色彩信息矩阵做色彩校正处理。
  11. 如权利要求10所述的方法,其特征在于,所述多个导致过饱和的图像块是相邻的多个图像块。
  12. 如权利要求10或11所述的方法,其特征在于,所述多个导致过饱和的图像块的数量大于预设数量阈值,或者所述多个导致过饱和的图像块的数量与所述待处理图像包含的所述多个图像块的数量的比值大于预设比例阈值。
  13. 如权利要求10-12任一项所述的方法,其特征在于,所述确定第二色彩校正矩阵包括:对所述第一色彩校正矩阵作调整以得到所述第二色彩校正矩阵。
  14. 如权利要求13所述的方法,其特征在于,所述对所述第一色彩校正矩阵作调整以得到所述第二色彩校正矩阵包括:将所述第一色彩校正矩阵与单位矩阵做加权平均以得到所述第二色彩校正矩阵。
  15. 如权利要求14所述的方法,其特征在于,所述对所述第一色彩校正矩阵作调整以得到所述第二色彩校正矩阵包括:对所述第一色彩校正矩阵作多次调整以得到所述第二色彩校正矩阵;其中,下一次调整中的加权平均的参数α 1大于当前调整中的加权平均参数α 2,α 1和α 2是所述单位矩阵的权值。
  16. 如权利要求10-15任一项所述的方法,其特征在于,所述确定第二色彩校正矩阵后,所述利用所述第二色彩校正矩阵对所述待处理图像中每个图像点的第一色彩信息矩阵做色彩校正处理之前,所述方法还包括:利用所述第二色彩校正矩阵对待处理图像中多个图像块中的每个图像块的第一色彩信息矩阵分别重新做色彩校正预处理,以更新所述每个图像块的第二色彩信息矩阵;
    若确定所述待处理图像中仍然存在导致过饱和的区域,则重复执行所述确定第二色彩校正矩阵的操作,直到确定所述待处理图像中不存在导致过饱和的区域。
  17. 如权利要求10-16任一项所述的方法,其特征在于,所述三个颜色包括红色、绿色和蓝色。
  18. 一种色彩校正装置,其特征在于,包括:
    处理单元,用于利用第一色彩校正矩阵对待处理图像中多个图像点中的每个图像点的第一色彩信息矩阵分别做色彩校正处理,以得到所述每个图像点的第二色彩信息矩阵,所述第一色彩信息矩阵包括待处理的三个颜色的色度值,所述第二色彩信息矩阵包括色彩校正后的三个颜色的色度值;
    更新校正单元,用于当确定所述待处理图像中存在导致过饱和的区域时,执行更新的校正操作,其中,所述区域包括多个导致过饱和的图像点,每个导致过饱和的图像点对应的第一颜色的色度值小于预设阈值,所述第一颜色是所述三个颜色中的一个,所述更新的校正操作包括:
    确定第二色彩校正矩阵,所述第二色彩校正矩阵的校正幅度低于所述第一色彩校正矩阵的校正幅度;
    将所述第二色彩校正矩阵提供给所述处理单元,以触发所述处理单元重新做校正处理;
    所述处理单元进一步用于利用所述第二色彩校正矩阵重新对所述每个图像点的第一色彩信息矩阵分别做色彩校正处理,以更新所述每个图像点的第二色彩信息矩阵。
  19. 如权利要求18所述的装置,其特征在于,所述多个导致过饱和的图像点相邻的多个图像点。
  20. 如权利要求18或19所述的装置,其特征在于,所述多个导致过饱和的图像点的数量大于预设数量阈值,或者所述多个导致过饱和的图像点的数量与所述待处理图像包含的所述多个图像点的数量的比值大于预设比例阈值。
  21. 如权利要求18-20任一项所述的装置,其特征在于,所述确定第二色彩校正矩阵包括:对所述第一色彩校正矩阵作调整以得到第二色彩校正矩阵。
  22. 如权利要求21所述的装置,其特征在于,所述对所述第一色彩校正矩阵作调整以得到所述第二色彩校正矩阵包括:将所述第一色彩校正矩阵与单位矩阵做加权平均以得到所述第二色彩校正矩阵。
  23. 如权利要求22所述的装置,其特征在于,所述更新校正单元用于:当确定所述待处理图像中存在导致过饱和的区域时,重复执行所述更新的校正操作;其中,下一次更新的校正操作中的加权平均的参数α 1大于当前更新的校正操作中的加权平均参数α 2,α 1和α 2是所述单位矩阵的权值。
  24. 如权利要求18-23任一项所述的装置,其特征在于,所述更新校正单元还用于:在所述处理单元更新所述每个图像点的第二色彩信息矩阵后,若确定所述待处理图像中仍然存在导致过饱和的区域,则重复执行所述更新的校正操作,直到确定所述待处理图像中不存在导致过饱和的区域。
  25. 如权利要求18-24任一项所述的装置,其特征在于,所述三个颜色包括红色、绿色和蓝色。
  26. 如权利要求18-25任一项所述的装置,其特征在于,所述待处理图像为自动白平衡后的图像。
  27. 一种色彩校正装置,其特征在于,包括:
    预处理单元,用于利用第一色彩校正矩阵对待处理图像中多个图像块中的每个图像块的第一色彩信息矩阵分别做色彩校正预处理,以得到所述每个图像块的第二色彩信息矩阵,所述第一色彩信息矩阵包括待处理的三个颜色的色度值,所述第二色彩信息矩阵包括色彩校正预处理后的三个颜色的色度值;每个图像块包括多个图像点,每个图像块的第一色彩信息矩阵为所述多个图像点的第一色彩信息矩阵的平均;
    确定单元,用于当确定所述待处理图像中存在导致过饱和的区域时,确定第二色彩校正矩阵,其中,所述区域包括多个导致过饱和的图像块,每个导致过饱和的图像块对应的第一颜色的色度值小于预设阈值,所述第一颜色是所述三个颜色中的一个,所述第二色彩校正矩阵的校正幅度低于所述第一色彩校正矩阵的校正幅度;
    色彩校正处理单元,用于利用所述第二色彩校正矩阵对所述待处理图像中每个图像点的第一色彩信息矩阵分别做色彩校正处理。
  28. 如权利要求27所述的装置,其特征在于,所述多个导致过饱和的图像块是相邻的多个图像块。
  29. 如权利要求27或28所述的装置,其特征在于,所述多个导致过饱和的图像块的数量大于预设数量阈值,或者所述多个导致过饱和的图像块的数量与所述待处理图像包含的所述多个图像块的数量的比值大于预设比例阈值。
  30. 如权利要求27-29任一项所述的装置,其特征在于,所述确定单元用于:当确定所述待处理图像中存在导致过饱和的区域时,对所述第一色彩校正矩阵作调整以得到所述第二色彩校正矩阵。
  31. 如权利要求30所述的装置,其特征在于,所述确定单元用于:当确定所述待处理图像中存在导致过饱和的区域时,将所述第一色彩校正矩阵与单位矩阵做加权平均以得到所述第二色彩校正矩阵。
  32. 如权利要求31所述的装置,其特征在于,所述确定单元用于:当确定所述待处理图像中存在导致过饱和的区域时,对所述第一色彩校正矩阵作多次调整以得到所述第二色彩校正矩阵;其中,下一次调整中的加权平均的参数α 1大于当前调整中的加权平均参数α 2,α 1和α 2是所述单位矩阵的权值。
  33. 如权利要求27-32任一项所述的装置,其特征在于,在所述确定单元确定第二色彩校正矩阵后,所述色彩校正处理单元做色彩校正处理之前,将所述第二色彩校正矩阵提供给所述预处理单元,以触发所述预处理单元重新色彩校正进行预处理;
    所述预处理单元进一步用于,利用所述第二色彩校正矩阵对待处理图像中多个图像块中的每个图像块的第一色彩信息矩阵分别做色彩校正预处理,以更新所述每个图像块的第二色彩信息矩阵;
    所述确定单元具体用于:若确定所述待处理图像中仍然存在导致过饱和的区域,则重复执行所述确定第二色彩校正矩阵的操作,直到确定所述待处理图像中不存在导致过饱和的区域。
  34. 如权利要求27-33任一项所述的装置,其特征在于,所述三个颜色包括红色、绿色和蓝色。
PCT/CN2018/102081 2018-08-24 2018-08-24 色彩校正方法及装置 WO2020037635A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880081358.8A CN111480331A (zh) 2018-08-24 2018-08-24 色彩校正方法及装置
PCT/CN2018/102081 WO2020037635A1 (zh) 2018-08-24 2018-08-24 色彩校正方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/102081 WO2020037635A1 (zh) 2018-08-24 2018-08-24 色彩校正方法及装置

Publications (1)

Publication Number Publication Date
WO2020037635A1 true WO2020037635A1 (zh) 2020-02-27

Family

ID=69592193

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/102081 WO2020037635A1 (zh) 2018-08-24 2018-08-24 色彩校正方法及装置

Country Status (2)

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

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040183813A1 (en) * 2003-01-30 2004-09-23 Edge Christopher J. Color correction using a device-dependent display profile
KR20050112319A (ko) * 2004-05-25 2005-11-30 삼성전자주식회사 원형 색역 사상에 따른 색변환 장치 및 그 방법
CN1812480A (zh) * 2005-01-06 2006-08-02 东芝公司 在色彩转换中消除削波的系统和方法
CN104219511A (zh) * 2013-06-03 2014-12-17 鸿富锦精密工业(深圳)有限公司 色彩校正系统及方法
CN105323459A (zh) * 2015-05-25 2016-02-10 维沃移动通信有限公司 图像处理方法及移动终端
JP2018082312A (ja) * 2016-11-16 2018-05-24 富士ゼロックス株式会社 画像制御装置、パッチチャート、画像形成方法及びプログラム

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002300596A (ja) * 2001-03-30 2002-10-11 Nec Viewtechnology Ltd 色濃淡補正方法
CN1758704A (zh) * 2005-11-11 2006-04-12 北京中星微电子有限公司 色彩校正中颜色矩阵的实现方法
CN102045575B (zh) * 2009-10-21 2014-03-12 英属开曼群岛商恒景科技股份有限公司 用于像素色彩校正的方法以及像素色彩校正装置
CN105827897B (zh) * 2015-11-16 2019-06-07 维沃移动通信有限公司 调整卡制作方法、系统、调试色彩校正矩阵方法及设备
CN107958470A (zh) * 2017-12-18 2018-04-24 维沃移动通信有限公司 一种色彩校正方法、移动终端

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040183813A1 (en) * 2003-01-30 2004-09-23 Edge Christopher J. Color correction using a device-dependent display profile
KR20050112319A (ko) * 2004-05-25 2005-11-30 삼성전자주식회사 원형 색역 사상에 따른 색변환 장치 및 그 방법
CN1812480A (zh) * 2005-01-06 2006-08-02 东芝公司 在色彩转换中消除削波的系统和方法
CN104219511A (zh) * 2013-06-03 2014-12-17 鸿富锦精密工业(深圳)有限公司 色彩校正系统及方法
CN105323459A (zh) * 2015-05-25 2016-02-10 维沃移动通信有限公司 图像处理方法及移动终端
JP2018082312A (ja) * 2016-11-16 2018-05-24 富士ゼロックス株式会社 画像制御装置、パッチチャート、画像形成方法及びプログラム

Also Published As

Publication number Publication date
CN111480331A (zh) 2020-07-31

Similar Documents

Publication Publication Date Title
US10460701B2 (en) Display mura correction method, apparatus, and system
WO2019170007A1 (zh) 图像色彩调整方法及装置
KR20080113950A (ko) 감마 보정 곡선의 자동 산출 장치 및 방법
US10516825B2 (en) Image processing device, image processing method, and computer program product for correcting a motion vector of a low-reliability block
US11962917B2 (en) Color adjustment method, color adjustment device, electronic device and computer-readable storage medium
CN111861922A (zh) 颜色校正矩阵的调整方法及装置、存储介质
WO2021218603A1 (zh) 图像处理方法及投影系统
WO2022121893A1 (zh) 图像处理方法、装置、计算机设备和存储介质
US20170301075A1 (en) Image contrast enhancement method and apparatus thereof
CN112669758A (zh) 显示屏校正方法、装置、系统和计算机可读存储介质
US10055823B2 (en) Method for generating a pixel filtering boundary for use in auto white balance calibration
CN111587573B (zh) 一种图像处理方法、装置及计算机存储介质
CN108574835B (zh) 一种校正设备屏幕中图像色彩的方法及装置
WO2020097802A1 (zh) 图像色彩校正方法及装置、存储介质
WO2020037635A1 (zh) 色彩校正方法及装置
US8786737B2 (en) Image correction device and image correction method
WO2023151210A1 (zh) 图像处理方法、电子设备及计算机可读存储介质
CN102938842B (zh) 影像校正装置、影像校正方法及相关装置和产品
TWI723729B (zh) 白平衡調整方法、影像處理裝置與影像處理系統
WO2018209984A1 (zh) 图像处理方法和装置
CN115965541A (zh) 颜色校正方法、装置、电子设备和存储介质
CN115035851A (zh) 一种Gamma白平衡快速调节的方法及相关装置
CN114529617A (zh) 图像局部颜色调整方法、装置、电子设备及存储介质
CN110084856B (zh) 标定图像的亮度调整方法、装置、电子设备及存储介质
CN104869379A (zh) 白平衡补偿方法及电子装置

Legal Events

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

Ref document number: 18930594

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18930594

Country of ref document: EP

Kind code of ref document: A1