CN110992289B - Image color correction method and device based on three-dimensional lookup table - Google Patents

Image color correction method and device based on three-dimensional lookup table Download PDF

Info

Publication number
CN110992289B
CN110992289B CN201911243612.2A CN201911243612A CN110992289B CN 110992289 B CN110992289 B CN 110992289B CN 201911243612 A CN201911243612 A CN 201911243612A CN 110992289 B CN110992289 B CN 110992289B
Authority
CN
China
Prior art keywords
image
lookup table
interpolation
color
rgb
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911243612.2A
Other languages
Chinese (zh)
Other versions
CN110992289A (en
Inventor
朱俊玲
田景军
潘昱
章旭东
尹东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Fullhan Microelectronics Co ltd
Original Assignee
Shanghai Fullhan Microelectronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Fullhan Microelectronics Co ltd filed Critical Shanghai Fullhan Microelectronics Co ltd
Priority to CN201911243612.2A priority Critical patent/CN110992289B/en
Publication of CN110992289A publication Critical patent/CN110992289A/en
Application granted granted Critical
Publication of CN110992289B publication Critical patent/CN110992289B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The invention discloses an image color correction method and device based on a three-dimensional lookup table, wherein the method comprises the following steps: s1, acquiring an image and generating an RGB domain image; s2, a primary lookup table is established by using the standard color card and the test color card image, and a primary interpolation color card image is generated; s3, interpolating the image obtained in the S1 by using a first-level lookup table to obtain a first-level interpolation image; s4, carrying out weighted fusion on the primary interpolation image and the image obtained in the S1, and taking the primary interpolation image and the test color card image as primary color correction results, so as to obtain primary color card correction results; s5, establishing a multi-level lookup table with the standard color chart according to the previous-level lookup table, the test color chart and the previous-level interpolation color chart or the previous-level color chart correction result; s6, interpolation is carried out by utilizing the multi-stage lookup table and the previous-stage color correction result to obtain the interpolation result of the current stage; and S7, carrying out weighted fusion on the interpolation result of the current level and the color correction result of the previous level.

Description

Image color correction method and device based on three-dimensional lookup table
Technical Field
The present invention relates to the field of video image processing technologies, and in particular, to an image color correction method and apparatus based on a three-dimensional lookup table.
Background
The current image color correction method based on the lookup table mainly uses the lookup table to perform various interpolation algorithms on color images so as to achieve the purpose of image color correction, for example, the application of the two-dimensional lookup table to high dynamic range video (HDR) is realized in Chinese patent application with publication number of CN108141507A, the color correction is performed in Chinese patent application with publication number of CN106408540A, a three-dimensional lookup table is used, and an interpolation method when more than two RGB values of the color to be interpolated overflow is provided, however, the patents focus on the interpolation of the image to be processed by using the lookup table to realize the color correction, and do not specifically mention how to establish the lookup table with high precision.
For the establishment of the lookup table, chinese patent application publication No. CN107077828A provides a lookup table compression method that converts colors to other spaces, uses N two-dimensional lookup tables instead of the three-dimensional lookup table and implements its function, but it does not mention how to generate the three-dimensional lookup table, nor does it relate to implementing image color correction based on the three-dimensional lookup table.
Disclosure of Invention
In order to overcome the defects of the prior art, one of the purposes of the present invention is to provide an image color correction method and device based on a three-dimensional lookup table, so as to establish a high-precision three-dimensional lookup table and reduce color correction errors.
Another object of the present invention is to provide an image color correction method and apparatus based on a three-dimensional lookup table, which uses the created three-dimensional lookup table to interpolate, so as to improve the color correction accuracy of the image and reduce the correction error.
To achieve the above and other objects, the present invention provides an image color correction method based on a three-dimensional lookup table, comprising the steps of:
s1, collecting an image and generating an RGB domain image;
s2, establishing a primary lookup table by utilizing an RGB standard color card and an RGB test color card image, and generating a primary interpolation color card image according to the primary lookup table;
step S3, interpolation processing is carried out on the RGB image obtained in the step S1 by utilizing the first-level lookup table generated in the step S2, and a first-level interpolation image is obtained;
step S4, carrying out weighted fusion on the primary interpolation image generated in the step S3 and the RGB image obtained in the step S1 to obtain a primary color correction result, and carrying out weighted fusion on the primary interpolation color chart and the RGB test color chart to obtain a primary color chart correction result;
step S5, a multi-level lookup table is established according to a certain mapping relation with the RGB standard color chart according to the previous level lookup table, the test color chart and the previous level interpolation color chart or the previous level color chart correction result;
step S6, interpolation is carried out by utilizing the multi-level lookup table generated in the step S5 and the color correction result of the previous level, and the interpolation result of the current level is obtained;
and S7, carrying out weighted fusion on the interpolation result of the current level and the color correction result of the previous level, and outputting the result as a final correction result.
Preferably, step S2 further comprises:
step S200, collecting the RGB test color card image measured value and the RGB standard color card image value;
step S201, a preliminary lookup table is established according to a certain mapping relation between the acquired RGB test color card image measured value and the RGB standard color card image value;
step S202, a primary lookup table with larger capacity is established by utilizing an interpolation method;
step S203, interpolate the RGB test color chart of S201 according to the lookup table established in S202, and the interpolation result is used as a first-level interpolation color chart.
Preferably, the RGB test color chart image is a color chart image photographed under the same conditions as the RGB image in step S1.
Preferably, in step S4, a brightness control curve is designed, and the RGB image and the primary interpolation image are weighted and fused according to brightness, where the primary interpolation color chart and the RGB test color chart are weighted and fused by the same method.
Preferably, step S5 further comprises:
and S500, interpolating the RGB test color chart image by using a primary lookup table to obtain a first interpolation color chart.
Step S501, carrying out weighted fusion on the first interpolation color chart and the RGB test color chart image, and determining fusion weight according to delta E;
and step S502, mapping the fusion result with the RGB standard color chart to obtain a secondary lookup table.
Preferably, in step S6, the secondary lookup table generated in step S5 is used to interpolate the primary color correction result in step S4, so as to obtain a secondary interpolation result.
Preferably, in step S7, the secondary interpolation result and the primary color correction result are subjected to weighted fusion, and the weighted fusion weight is calculated from the brightness control curve of the secondary interpolation result.
Preferably, in step S5, the same memory space as the one or more levels of lookup tables is used in generating the two or more levels of lookup tables.
In order to achieve the above object, the present invention further provides an image color correction device based on a three-dimensional lookup table, including:
the RGB image generation unit is used for collecting images and generating RGB domain images;
the first-level lookup table establishing unit is used for establishing a first-level lookup table by utilizing the RGB standard color card and the RGB test color card image and generating a first-level interpolation color card image according to the first-level lookup table;
the first-level interpolation processing unit is used for carrying out interpolation processing on the RGB image obtained by the RGB image generating unit by utilizing the first-level lookup table generated by the first-level lookup table establishing unit to obtain a first-level interpolation image;
the primary color correction unit is used for carrying out weighted fusion on the primary interpolation image generated by the primary interpolation processing unit and the RGB image obtained by the RGB image generation unit to obtain a primary color correction result, and carrying out weighted fusion on the primary interpolation color chart and the RGB test color chart to obtain a primary color chart correction result;
the multi-level lookup table establishing unit is used for establishing a multi-level lookup table with the RGB standard color chart according to a certain mapping relation according to the previous-level lookup table, the test color chart and the previous-level interpolation color chart or the previous-level color chart correction result;
the multi-stage interpolation processing unit is used for interpolating with the multi-stage lookup table generated by the multi-stage lookup table building unit and the previous-stage color correction result to obtain the interpolation result of the current stage;
and the multi-stage color correction unit performs weighted fusion on the interpolation result of the current stage and the color correction result of the previous stage, and outputs the result as a final correction result.
Preferably, the primary look-up table establishing unit further includes:
the measured value acquisition module is used for acquiring the RGB test color card image measured value;
the image value acquisition module is used for acquiring the image value of the RGB standard color card;
the primary lookup table establishing module is used for establishing a primary lookup table according to the mapping relation between the acquired RGB test color card image measured value and the RGB standard color card image value;
and the interpolation module is used for establishing a primary lookup table with larger capacity by using an interpolation method and generating a primary interpolation color chart according to the primary lookup table.
Compared with the prior art, the image color correction method and device based on the three-dimensional lookup table correct the image color by establishing the lookup table for multiple times and interpolating for multiple times, restore the true color of the image to the maximum extent, accurately and efficiently correct the color, and meet the change and requirements of various different scenes.
Drawings
FIG. 1 is a flow chart showing the steps of a three-dimensional lookup table-based image color correction method according to the present invention;
FIG. 2 is a detailed flowchart of step S2 in an embodiment of the invention;
FIG. 3 is a schematic diagram illustrating a process of step S4 in an embodiment of the present invention;
FIG. 4 is a system architecture diagram of an image color correction device based on a three-dimensional look-up table according to the present invention;
FIG. 5 is a detailed block diagram of a primary look-up table building unit in an embodiment of the present invention.
Detailed Description
Other advantages and effects of the present invention will become readily apparent to those skilled in the art from the following disclosure, when considered in light of the accompanying drawings, by describing embodiments of the present invention with specific embodiments thereof. The invention may be practiced or carried out in other embodiments and details within the scope and range of equivalents of the various features and advantages of the invention.
Fig. 1 is a flowchart illustrating steps of an image color correction method based on a three-dimensional lookup table according to the present invention. As shown in fig. 1, the image color correction method based on the three-dimensional lookup table of the present invention comprises the following steps:
step S1, an image is acquired, the acquired image is converted into an RGB domain after being processed, and an RGB domain image is generated. In an embodiment of the invention, an image sensor is used to collect an image, and the image is processed and converted into an RGB domain to generate an RGB image.
And S2, establishing a primary lookup table by utilizing the RGB standard color card and the RGB test color card image, and generating a primary interpolation color card image according to the primary lookup table. In the present invention, the RGB test chart image used is a chart photographed under the same conditions as the RGB image in step S1.
Directly establishing a large-capacity interpolation table is complex and inconvenient in process on one hand and unsatisfactory in correction result on the other hand. The maximum capacity of the lookup table is the power of the maximum of the input image, taking an 8bit input image as an example, the maximum of each channel of the image is 255, and the maximum capacity of the lookup table is 255 3 I.e. the image input and output are in one-to-one correspondence. Specifically, as shown in fig. 2, step S2 further includes:
in step S200, the measured values of the RGB test color chart image (such as 24 color chart, 104 color chart, etc. are not limited) and the image values of the RGB standard color chart (such as 24 color chart, 104 color chart, etc. are not limited) are collected (i.e. R, G, B values of each color chart). In a specific embodiment of the present invention, the RGB test color chart image (such as 24 color chart and 104 color chart) is an image that is obtained by photographing the color chart independently under the same test conditions (same sensor, same color temperature, same light source, etc.) as the RGB image collected in the step S1. The image value of the RGB standard color card refers to R, G, B value of each color card, the measured value of the RGB test color card image refers to R, G, B value, and in short, the image correction process of the invention is the process of converging the photographed RGB value to the standard value.
Step S201, the acquired RGB test color card image measurement value and the RGB standard color card image value are established according to a certain mapping relationStep lookup table with capacity of 9 3 、17 3 Etc. The mapping relationship includes, but is not limited to, using tri-linear interpolation, tetrahedral interpolation, local regression, maximum entropy estimation, and the like.
Step S202, establishing larger capacity by interpolation method, such as 33 3 、65 3 A primary look-up table. In particular embodiments of the present invention, interpolation methods used include, but are not limited to, methods using tri-linear interpolation, tetrahedral interpolation, etc., or may be other more highly efficient interpolation methods.
Step S203, interpolate the RGB test color chart of S201 according to the lookup table established in S202, and the interpolation result is used as a first-level interpolation color chart.
And step S3, performing interpolation processing on the RGB image obtained in the step S1 by using the first-level lookup table generated in the step S2 to obtain a first-level interpolation image. In particular embodiments of the present invention, interpolation methods used herein include, but are not limited to, methods using tri-linear interpolation, tetrahedral interpolation, and the like. In general, in order to ensure accuracy of interpolation results, an interpolation method having high interpolation performance is suggested.
And S4, carrying out weighted fusion on the primary interpolation image generated in the step S3 and the RGB image obtained in the step S1 to obtain a primary color correction result, and carrying out weighted fusion on the primary interpolation color chart and the RGB test color chart to obtain a primary color chart correction result, wherein the primary color chart correction result is shown in FIG. 3. In the invention, the purpose of weighting fusion is to reduce the error caused by direct interpolation, and the error of interpolation result is caused by the improper value of the established lookup table, and the input image and the interpolation result are fused, so that the correction error generated by the fusion can be reduced.
Specifically, step S4 further includes:
in step S401, a brightness control curve is designed, and the RGB input image and the first-level interpolation image are subjected to weighted fusion according to brightness.
In general, the interpolation result is directly output as a correction result. The invention considers that the lookup table is used for simultaneously changing R, G, B three-way values, and the brightness of the image can be influenced, so the invention designs a brightness control curve and carries out weighted fusion on the RGB input image and the first-level interpolation image according to the brightness.
Specifically, as the three-dimensional image interpolation of the RGB image, that is, the R, G, B three-channel values are changed simultaneously, if the lookup table is used improperly, the brightness of the interpolation result is not uniform, and even the overexposure phenomenon of the partial area of the image is caused. Therefore, the invention carries out weighted fusion based on brightness, and the calculation formula is shown in the following formula (1):
RGB correct1 =RGB ori +(RGB inter1 -RGB ori )*weight0 (1)
wherein RGB correct1 For one-level color correction output, RGB inter1 RGB is the result of the first level interpolation ori For an RGB image, weight0 is a weighted weight, and the value may be any value between 0 and 1, and its calculation formula is as (2):
Figure BDA0002306925560000071
wherein x is brightness, x1, x2, x3, x4 are brightness threshold, and the value range is 0,2 N -1](N is the bit width of the image), the size of the image is adjustable, y is weight, y1, y2, y3 and y4 are weight thresholds, and the value range is [0,1 ]]. The luminance Y0 used to calculate weight0 is calculated as in equation (3):
Y0=0.299*R ori +0.587*G ori +0.114*B ori (3)
wherein R is ori 、G ori 、B ori I.e. RGB ori A component. And (3) replacing x in the formula (2) with Y0, wherein the obtained Y is the weight0.
Step S402, using the same method as step S401, carrying out weighted fusion on the first-level interpolation color chart of S203 and the RGB test color chart of S201, and obtaining a first-level color chart correction result.
And S5, establishing a multi-stage lookup table with the RGB standard color chart according to a certain mapping relation according to the previous-stage lookup table, the RGB test color chart and the previous-stage interpolation color chart or the previous-stage color chart correction result. Taking the establishment of a secondary lookup table as an example, the secondary lookup table is established according to a primary lookup table and a primary interpolation color chart and an RGB standard color chart according to a certain mapping relation, and a previous-stage color chart correction result can be used for replacing a previous-stage interpolation result, namely the secondary lookup table is not unique. In the specific embodiment of the invention, a secondary lookup table is reestablished according to the RGB test color card image, the primary lookup table, the primary interpolation color card image and the RGB standard color card for secondary interpolation, and the purpose of the step is to improve the accuracy of the interpolation table used for color correction. Since the accuracy of the lookup table used directly affects the interpolation result, it is important to improve the accuracy of the lookup table.
Specifically, taking the secondary lookup table as an example, step S5 further includes:
and S500, interpolating the RGB test color chart image by using a primary lookup table to obtain a first interpolation color chart.
Step S501, carrying out weighted fusion on the first interpolation color chart and the RGB test color chart image, and determining fusion weight according to delta E;
and step S502, mapping the fusion result with the RGB standard color chart to obtain a secondary lookup table.
The currently commonly used color difference evaluation standard is deltae, and the image to be evaluated needs to be converted into a Lab space. The Δe calculation formula is shown in the following formula (4):
Figure BDA0002306925560000081
wherein L is 1 、a 1 、b 1 Is a color standard value, which is obtained by converting an RGB standard color card image into Lab space, L 2 、a 2 、b 2 And (3) converting the RGB test color card image in the step to obtain a color value to be evaluated, wherein the smaller the delta E value is, the smaller the color difference is, namely the closer the measured value to be evaluated is to the standard value. Suppose RGB 1ut For the RGB test color card image in the step, the calculation formula is shown as (5):
RGB lut =RGB colorinter1 +(RGB colorinter1 -RGB colorin )*weight1 m (5)
wherein RGB colorin RGB test color card image (RGB test color card image mentioned in step S2) for creating primary lookup table colorinter1 Is RGB colorin According to the interpolation result of the first-level lookup table, the interpolation method is a method used in the first-level interpolation, and the two methods are required to keep the consistency of the methods. weight1 m (m=0, 1, 2..m, M is the total number of color patches).
In the present invention, the weight value weight1 is determined m The emphasis is on calculating delta E of each color block of the RGB test color card image according to formula (4) orim (m=0, 1, 2..m, M is the total number of color blocks) and Δe of each color block of the first-order interpolation result interm (m=0, 1, 2..m, M is the total number of color patches), and then the weight of each color patch is determined according to Δe, specifically by:
ΔE in the two cases were compared orim And delta E interm Delta E is calculated orim >k*ΔE interm (k > =1) weight1 of the corresponding color block m Set to 0, i.e., ΔE of the first order interpolation result interm Lower value retention, ΔE interm Higher weight m Set to a value between 0, 1).
And S6, interpolating by utilizing the multi-stage lookup table generated in the step S5 and the previous-stage color correction result to obtain the interpolation result of the current stage. Specifically, taking the secondary interpolation as an example, the secondary lookup table generated in the step S5 is used to interpolate the primary color correction result in the step S4, so as to obtain a secondary interpolation result. In particular embodiments of the present invention, the interpolation methods include, but are not limited to, methods using tri-linear interpolation, tetrahedral interpolation, and the like.
And S7, carrying out weighted fusion on the interpolation result of the current level and the color correction result of the previous level, and outputting the result as the multi-level color correction result, namely the final correction result, wherein the weighted fusion weight of the result is obtained by a brightness control curve of the interpolation result of the current level. In a specific embodiment of the present invention, taking the secondary color correction as an example, the secondary color correction performs weighted fusion on the secondary interpolation result and the primary color correction result, and the weighted fusion weight is calculated by a brightness control curve of the secondary interpolation result.
Taking the second-level color correction as an example, step S7 specifically includes: correcting the primary color to obtain RGB correct1 And a second-order interpolation result RGB inter2 And performing secondary weighted fusion, and outputting a fusion result, namely secondary color correction, as a final result. The two-level weighted fusion calculation formula is as follows (6):
RGB out =RGB inter2 *(1-weight1)+RGB correct1 *weight1 (6)
wherein weight1 is a weighted weight, the calculation formula is shown as (2), and the calculation of the brightness x is as follows:
Y1=0.299*R inter1 +0.587*G inter1 +0.114*B inter1 (7)
wherein R is inter1 、G inter1 、B inter1 I.e. first order interpolation RGB inter1 A component. And (3) replacing x in the formula (7) by Y1, wherein the obtained Y is the weight1.
Preferably, the invention uses two or more lookup tables to correct the color twice or more, and when the invention is realized, the same storage space as that of a first-stage or a last-stage lookup table can be used for generating a second-stage or a multi-stage lookup table, namely, the first-stage lookup table is rewritten one by one to generate the second-stage or multi-stage lookup table, so that the storage space resource can be saved.
The two-stage or multi-stage color correction is completed, the correction result is the final correction result, and the final correction result is output.
Fig. 4 is a system architecture diagram of an image color correction device based on a three-dimensional lookup table according to the present invention. As shown in fig. 4, an image color correction device based on a three-dimensional lookup table of the present invention includes:
the RGB image generating unit 40 is configured to collect an image, process the collected image, and convert the processed image into an RGB domain, and generate an RGB domain image. In an embodiment of the invention, an image sensor is used to collect an image, and the image is processed and converted into an RGB domain to generate an RGB image.
The primary look-up table creating unit 41 is configured to create a primary look-up table using the RGB standard color chart and the RGB test color chart image, and generate a primary interpolation color chart according to the primary look-up table. In the present invention, the RGB test chart image used is a chart photographed under the same conditions as the RGB image in the RGB image generating unit 40.
Specifically, as shown in fig. 5, the primary look-up table establishing unit 41 further includes:
the measured value collection module 410 is configured to collect measured values of the RGB test color card images (such as 24 color card, 104 color card, etc.).
The image value collection module 411 is configured to collect image values of the RGB standard color cards (such as 24 color cards and 104 color cards).
The preliminary lookup table establishing module 412 is configured to establish a preliminary lookup table with the acquired RGB test color card image measurement value and the RGB standard color card image value according to a certain mapping relationship, where the capacity may be 9 3 、17 3 Etc. The mapping relationship includes, but is not limited to, using tri-linear interpolation, tetrahedral interpolation, local regression, maximum entropy estimation, and the like.
Interpolation module 413 for creating larger capacity, such as 33, using interpolation method 3 、65 3 And the first-level lookup table is used for interpolating the RGB test color chart acquired by the measured value acquisition module 410 according to the established first-level lookup table, and the interpolation result is used as a first-level interpolation color chart. In particular embodiments of the present invention, interpolation methods used include, but are not limited to, methods using tri-linear interpolation, tetrahedral interpolation, etc., or may be other more highly efficient interpolation methods.
A primary interpolation processing unit 42 for performing interpolation processing on the RGB image obtained by the RGB image generating unit 40 by using the primary lookup table generated by the primary lookup table creating unit 41, to obtain a primary interpolation image. In particular embodiments of the present invention, interpolation methods used herein include, but are not limited to, methods using tri-linear interpolation, tetrahedral interpolation, and the like. In general, in order to ensure accuracy of interpolation results, an interpolation method having high interpolation performance is suggested.
The primary color correction unit 43 is configured to perform weighted fusion on the primary interpolation image generated by the primary interpolation processing unit 42 and the RGB image obtained by the RGB image generating unit 40, and perform weighted fusion on the primary interpolation color chart and the RGB test color chart to obtain a primary color chart correction result. In the invention, the purpose of weighting fusion is to reduce the error caused by direct interpolation, and the error of interpolation result is caused by the improper value of the established lookup table, and the input image and the interpolation result are fused, so that the correction error generated by the fusion can be reduced.
In the invention, the brightness control curve is designed, and the RGB input image and the first-level interpolation image are weighted and fused according to the brightness, so that the brightness of the image can be influenced by considering that the lookup table is used for changing R, G, B three-way values simultaneously.
Specifically, as the three-dimensional image interpolation of the RGB image, that is, the R, G, B three-channel values are changed simultaneously, if the lookup table is used improperly, the brightness of the interpolation result is not uniform, and even the overexposure phenomenon of the partial area of the image is caused. The primary color correction unit 43 performs weighted fusion of the primary interpolation result and the RGB input image based on the luminance, and the calculation formula is as follows:
RGB correct1 =RGB ori +(RGB inter1 -RGB ori )*weight0 (1)
wherein RGB correct1 For one-level color correction output, RGB inter1 RGB is the result of the first level interpolation ori For an RGB image, weight0 is a weighted weight, and the value may be any value between 0 and 1, and its calculation formula is as (2):
Figure BDA0002306925560000111
wherein x is brightness, x1, x2, x3, x4 are brightness threshold, and the value range is 0,2 N -1](N is the bit width of the image), the size of the image is adjustable, y is weight, y1, y2, y3 and y4 are weight thresholds, and the value range is [0,1 ]]. The luminance Y0 used to calculate weight0 is calculated as in equation (3):
Y0=0.299*R ori +0.587*G ori +0.114*B ori (3)
wherein R is ori 、G ori 、B ori I.e. RGB orj A component. And (3) replacing x in the formula (2) with Y0, wherein the obtained Y is the weight wejght0.
Meanwhile, the primary color correction unit 43 performs weighted fusion on the primary interpolation color chart obtained by the interpolation module 413 and the RGB test color chart of the measurement value acquisition module 410 by adopting the same method to obtain a primary color chart correction result.
The multi-level lookup table creation unit 44 creates a multi-level lookup table according to a certain mapping relationship with the RGB standard color chart according to the previous level lookup table, the RGB test color chart, the previous level interpolation color chart, or the previous level color chart correction result. Taking the establishment of a secondary lookup table as an example, the secondary lookup table is established according to a primary lookup table and a primary interpolation color chart and a standard color chart according to a certain mapping relation, and the primary interpolation result can be replaced by a primary color chart correction result, namely the primary interpolation result is not unique. In the specific embodiment of the invention, a secondary lookup table is reestablished according to the RGB test color card image, the primary lookup table, the primary interpolation color card image and the RGB standard color card for secondary interpolation, and the purpose is to improve the accuracy of the interpolation table used for color correction. Since the accuracy of the lookup table used directly affects the interpolation result, it is important to improve the accuracy of the lookup table.
Taking a secondary lookup table as an example, the multi-level lookup table establishing unit 44 interpolates the RGB test color chart image by using the primary lookup table to obtain a first interpolation color chart, then performs weighted fusion on the first interpolation color chart image and the RGB test color chart image, determines a fusion weight according to a color difference evaluation standard Δe, finally maps a weighted fusion result with the RGB standard color chart image, and obtains the secondary lookup table by using an interpolation method.
The currently commonly used color difference evaluation standard is deltae, and the image to be evaluated needs to be converted into a Lab space. The Δe calculation formula is shown in the following formula (4):
Figure BDA0002306925560000121
wherein L is 1 、a 1 、b 1 Is a color standard value, which is obtained by converting an RGB standard color card image into Lab space, L 2 、a 2 、b 2 And for the color value to be evaluated, the RGB test color card image is converted, and the smaller the delta E value is, the smaller the color difference is, namely the closer the measured value to be evaluated is to the standard value. Suppose RGB lut For the RGB test color card image of the present unit (multi-stage lookup table creation unit 44), the calculation formula is shown as (5):
RGB lut =RGB colorinter1 +(RGB colorinter1 -RGB colorin )*weight1 m (5)
wherein RGB colorin RGB test color card image for use in creating primary look-up table colorinter1 Is RGB colorin According to the interpolation result of the first-level lookup table, the interpolation method is a method used in the first-level interpolation, and the two methods are required to keep the consistency of the methods. weight1 m (m=0, 1, 2..m, M is the total number of color patches) is a weight value.
In the present invention, the weight value weight1 is determined m The emphasis is on calculating delta E of each color block of the RGB test color card image according to formula (4) orim (m=0, 1, 2..m, M is the total number of color blocks) and Δe of each color block of the first-order interpolation result interm (m=0, 1, 2..m, M is the total number of color patches), and then the weight of each color patch is determined according to Δe, specifically by:
ΔE in the two cases were compared orim And delta E interm Delta E is calculated orim >k:*ΔE interm (k > =1) weight1 of the corresponding color block m Set to 0, i.e., ΔE of the first order interpolation result interm Lower value retention, ΔE interm Higher weight m Set to a value between 0, 1).
In the present invention, the test image of the secondary (multi-level) lookup table is RGB lut The remaining subunits are similar to the units used for creating the primary lookup table, and the interpolation method of the subunits can be the same as or different from the method used by the primary lookup table creating unit 41, which is described in detail in the primary lookup table creating unit 41. MultistageThe lookup table generated by the lookup table generation unit 44 and the first-stage lookup table generation unit 41 can be used for correcting the color of the image photographed under the same test conditions (same sensor, same color temperature, same light source, etc.).
A multi-stage interpolation processing unit 45, configured to interpolate with the multi-stage lookup table generated by the multi-stage lookup table establishment unit 44 and the previous-stage color correction result to obtain the interpolation result of the current stage. Specifically, taking the secondary interpolation as an example, the primary color correction result of the primary color correction unit 43 is interpolated by using the generated secondary lookup table, to obtain a secondary interpolation result. In particular embodiments of the present invention, the interpolation methods include, but are not limited to, methods using tri-linear interpolation, tetrahedral interpolation, and the like.
A multi-level color correction unit 46 for performing weighted fusion on the multi-level interpolation result generated by the multi-level interpolation processing unit 45 and the one-level color correction result of the one-level color correction unit 43, and outputting the multi-level interpolation result as a multi-level color correction result of the present invention, that is, a final correction result. In the embodiment of the invention, the weighted fusion weight is obtained by taking the brightness of the primary interpolation result as a control curve. In a specific embodiment of the present invention, taking the secondary color correction as an example, the secondary color correction performs weighted fusion on the secondary interpolation result and the primary color correction result, and the weighted fusion weight is calculated by a brightness control curve of the secondary interpolation result.
Taking two-level color correction as an example, the multi-level color correction unit 46 is specifically configured to:
the primary color correction result and the secondary interpolation result RGB inter2 And performing secondary weighted fusion, and outputting a fusion result, namely secondary color correction, as a final result. The two-level weighted fusion calculation formula is as follows (6):
RGB out =RGB inter2 *(1-weight1)+RGB correct1 *weight1 (6)
wherein weight1 is a weighted weight, the calculation formula is shown as (2), and the calculation of the brightness x is as follows:
Y1=0.299*R inter1 +0.587*G inter1 +0.114*B inter1 (7)
wherein R is inter1 、G inter1 、B inter1 I.e. first order interpolation RGB inter1 A component. Using Y1 substitution formula(7) In (a)And the obtained y is the weight1.
Preferably, the invention uses two or more lookup tables to correct the color twice or more, and when the invention is realized, the same storage space as that of a first-stage or a last-stage lookup table can be used for generating a second-stage or a multi-stage lookup table, namely, the first-stage lookup table is rewritten one by one to generate the second-stage or multi-stage lookup table, so that the storage space resource can be saved.
The two-stage or multi-stage color correction is completed, the correction result is the final correction result, and the final correction result is output.
Preferably, the invention uses two or more lookup tables to carry out multi-stage correction on the color, and when the invention is realized, the same storage space as that of a first-stage lookup table can be used when the second-stage lookup table or the multi-stage lookup table is generated, namely, the first-stage lookup table is rewritten one by one, and the next-stage lookup table is generated, so that the storage space resource can be saved.
In summary, the image color correction method and device based on the three-dimensional lookup table correct the image color by establishing the lookup table for multiple times and interpolating for multiple times, restore the true color of the image to the maximum extent, and correct the color accurately and efficiently, thereby meeting the change and requirements of various different scenes.
The above embodiments are merely illustrative of the principles of the present invention and its effectiveness, and are not intended to limit the invention. Modifications and variations may be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of the invention. Accordingly, the scope of the invention is to be indicated by the appended claims.

Claims (9)

1. An image color correction method based on a three-dimensional lookup table comprises the following steps:
s1, collecting an image and generating an RGB domain image;
s2, establishing a primary lookup table by utilizing an RGB standard color card and an RGB test color card image, and generating a primary interpolation color card image according to the primary lookup table;
step S3, interpolation processing is carried out on the RGB image obtained in the step S1 by utilizing the first-level lookup table generated in the step S2, and a first-level interpolation image is obtained;
step S4, carrying out weighted fusion on the primary interpolation image generated in the step S3 and the RGB image obtained in the step S1 to obtain a primary color correction result, and carrying out weighted fusion on the primary interpolation color chart and the RGB test color chart image to obtain a primary color chart correction result;
step S5, a multi-level lookup table is established according to a preset mapping relation with the RGB standard color chart according to a previous-level lookup table, a test color chart and a previous-level interpolation color chart or a previous-level color chart correction result;
step S6, interpolation is carried out by utilizing the multi-level lookup table generated in the step S5 and the color correction result of the previous level, and the interpolation result of the current level is obtained;
step S7, carrying out weighted fusion on the interpolation result of the current level and the color correction result of the previous level, and outputting the result as a final correction result;
wherein, step S5 further comprises:
step S500, interpolating the RGB test color chart image by using a first-level lookup table to obtain a first interpolation color chart;
step S501, carrying out weighted fusion on the first interpolation color chart and the RGB test color chart image, and determining fusion weight according to delta E;
step S502, mapping the fusion result with the RGB standard color chart to obtain a secondary lookup table, and the like to obtain a multi-level lookup table, wherein the RGB test color chart is a test chart when the primary lookup table is established.
2. The method of image color correction based on a three-dimensional look-up table as set forth in claim 1, wherein the step S2 further includes:
step S200, collecting the RGB test color card image measured value and the RGB standard color card image value;
step S201, a preliminary lookup table is established according to a certain mapping relation between the acquired RGB test color card image measured value and the RGB standard color card image value;
step S202, a primary lookup table with larger capacity is established by utilizing an interpolation method;
step S203, interpolate the RGB test color chart of S201 according to the lookup table established in S202, and the interpolation result is used as a first-level interpolation color chart.
3. The method for correcting image color based on three-dimensional lookup table as claimed in claim 2, wherein: the RGB test color chart image is a color chart image photographed under the same conditions as the RGB image in step S1.
4. A three-dimensional look-up table based image color correction method as claimed in claim 3, wherein: in step S4, a brightness control curve is designed, and the RGB image and the primary interpolation image are weighted and fused according to brightness, where the primary interpolation color chart and the RGB test color chart are weighted and fused by the same method.
5. The method for correcting image color based on three-dimensional lookup table as claimed in claim 4, wherein: in step S6, the secondary lookup table generated in step S5 is used to interpolate the primary color correction result in step S4, so as to obtain a secondary interpolation result.
6. The method for correcting image color based on three-dimensional lookup table as claimed in claim 5, wherein: in step S7, the secondary interpolation result and the primary color correction result are subjected to weighted fusion, and the weighted fusion weight is calculated by the brightness control curve of the secondary interpolation result.
7. The method for correcting image color based on three-dimensional lookup table as claimed in claim 1, wherein: in step S5, the same memory space as the one or the previous level lookup table is used in generating the two or more level lookup tables.
8. An image color correction device based on a three-dimensional lookup table, comprising:
the RGB image generation unit is used for collecting images and generating RGB domain images;
the first-level lookup table establishing unit is used for establishing a first-level lookup table by utilizing the RGB standard color card and the RGB test color card image and generating a first-level interpolation color card image according to the first-level lookup table;
the first-level interpolation processing unit is used for carrying out interpolation processing on the RGB image obtained by the RGB image generating unit by utilizing the first-level lookup table generated by the first-level lookup table establishing unit to obtain a first-level interpolation image;
the primary color correction unit is used for carrying out weighted fusion on the primary interpolation image generated by the primary interpolation processing unit and the RGB image obtained by the RGB image generation unit to obtain a primary color correction result, and carrying out weighted fusion on the primary interpolation color chart and the RGB test color chart to obtain a primary color chart correction result;
the multi-level lookup table establishing unit is used for interpolating an RGB test color card image by using a one-level lookup table to obtain a first interpolation color card image, carrying out weighted fusion on the first interpolation color card image and the RGB test color card image, determining fusion weight according to delta E, finally mapping a fusion result and an RGB standard color card image to obtain a two-level lookup table, and the like to obtain a multi-level lookup table, wherein the RGB test color card is a test card when the one-level lookup table is established;
the multi-stage interpolation processing unit is used for interpolating with the multi-stage lookup table generated by the multi-stage lookup table building unit and the previous-stage color correction result to obtain the interpolation result of the current stage;
and the multi-stage color correction unit performs weighted fusion on the interpolation result of the current stage and the color correction result of the previous stage, and outputs the result as a final correction result.
9. The image color correction device based on a three-dimensional lookup table as claimed in claim 8, wherein said primary lookup table creating unit further comprises:
the measured value acquisition module is used for acquiring the RGB test color card image measured value;
the image value acquisition module is used for acquiring the image value of the RGB standard color card;
the primary lookup table establishing module is used for establishing a primary lookup table according to the mapping relation between the acquired RGB test color card image measured value and the RGB standard color card image value;
and the interpolation module is used for establishing a primary lookup table with larger capacity by using an interpolation method and generating a primary interpolation color chart according to the primary lookup table.
CN201911243612.2A 2019-12-06 2019-12-06 Image color correction method and device based on three-dimensional lookup table Active CN110992289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911243612.2A CN110992289B (en) 2019-12-06 2019-12-06 Image color correction method and device based on three-dimensional lookup table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911243612.2A CN110992289B (en) 2019-12-06 2019-12-06 Image color correction method and device based on three-dimensional lookup table

Publications (2)

Publication Number Publication Date
CN110992289A CN110992289A (en) 2020-04-10
CN110992289B true CN110992289B (en) 2023-05-12

Family

ID=70090927

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911243612.2A Active CN110992289B (en) 2019-12-06 2019-12-06 Image color correction method and device based on three-dimensional lookup table

Country Status (1)

Country Link
CN (1) CN110992289B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112532872B (en) * 2020-11-16 2022-03-29 北京五一视界数字孪生科技股份有限公司 Method and device for adjusting camera parameters, storage medium and electronic equipment
CN113360691B (en) * 2021-06-07 2022-10-25 Tcl通讯(宁波)有限公司 Color style display processing method and device, terminal equipment and storage medium
CN117524072B (en) * 2024-01-03 2024-03-19 深圳市尊正数字视频有限公司 Real-time color correction method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006203622A (en) * 2005-01-21 2006-08-03 Fuji Xerox Co Ltd Color processing method, isochromatic characteristic acquisition device, color processing device, and program
CN103079076A (en) * 2013-01-22 2013-05-01 无锡鸿图微电子技术有限公司 Method and device for generating color calibration matrix of self-adaption gamma calibration curve
CN108377373A (en) * 2018-05-10 2018-08-07 杭州雄迈集成电路技术有限公司 A kind of color rendition device and method pixel-based
CN108712639A (en) * 2018-05-29 2018-10-26 凌云光技术集团有限责任公司 Image color correction method, apparatus and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006203622A (en) * 2005-01-21 2006-08-03 Fuji Xerox Co Ltd Color processing method, isochromatic characteristic acquisition device, color processing device, and program
CN103079076A (en) * 2013-01-22 2013-05-01 无锡鸿图微电子技术有限公司 Method and device for generating color calibration matrix of self-adaption gamma calibration curve
CN108377373A (en) * 2018-05-10 2018-08-07 杭州雄迈集成电路技术有限公司 A kind of color rendition device and method pixel-based
CN108712639A (en) * 2018-05-29 2018-10-26 凌云光技术集团有限责任公司 Image color correction method, apparatus and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
徐海松 ; 张显斗 ; .数字图像设备颜色特征化反向变换算法.浙江大学学报(工学版).2008,(12),全文. *

Also Published As

Publication number Publication date
CN110992289A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
CN110992289B (en) Image color correction method and device based on three-dimensional lookup table
KR100467610B1 (en) Method and apparatus for improvement of digital image quality
JP3593667B2 (en) Color image processing method and apparatus
TWI407777B (en) Apparatus and method for feature-based dynamic contrast enhancement
CN104202583B (en) Image processing device and method
CN103079076A (en) Method and device for generating color calibration matrix of self-adaption gamma calibration curve
JP2924079B2 (en) Gamma correction circuit
JP3671616B2 (en) Image processing device
JP2007067571A (en) Image processing apparatus
CN109118436B (en) Image tone adaptation method, corresponding electronic device and storage medium
JP2006295877A5 (en)
JP2008282155A (en) Image correction device
JP4728265B2 (en) Noise characteristic measuring apparatus and noise characteristic measuring method
KR20110113390A (en) Apparatus for enhancing visibility of color image
JP5025323B2 (en) Color processing apparatus and method
JP2017126957A (en) Image processing apparatus
JP2016191773A (en) Projection system, projector device, imaging apparatus and program
CN107909559B (en) Image denoising fusion method and system based on camera high and low data
JP2007515876A (en) Image data conversion processing system and image data conversion processing method for effectively executing image data conversion processing
CN101753782B (en) Method and device for dynamically adjusting slope initiation voltage
CN115883808A (en) Color correction method and device based on three-dimensional lookup table and electronic equipment
JP2017017609A (en) Image processing device
JP6275468B2 (en) Image processing apparatus, image processing method, and imaging apparatus
TW522724B (en) Storage and searching method for image adjusting parameters
KR101065223B1 (en) Image sensor and method for correcting lense shading

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant