Embodiments of the invention relate to the fields of color photography, digital cameras, color printing, and digital color image processing.
All consumer color display devices are calibrated so that when the values of color channels Red (R)=Green (G)=Blue (B), the color is displayed at a standard “white point” chromaticity, mostly D65 or D50 according to the International Commission on Illumination (abbreviated as CIE) standard. Digital color cameras using complementary metal-oxide semiconductor (CMOS) or charge-coupled device (CCD) sensors have different sensitivities for RGB channels, resulting in raw images with some color cast (e.g., greenish). Furthermore, the color of an object varies as a function of the color of the light source (e.g., tungsten light or daylight), and the mutual reflection from ambient objects. Therefore, it is often necessary to adjust the “white point” of a raw image before one can process and display the image in proper color reproduction. This white point adjustment is called white balance (WB), and it is typically performed by applying proper gains to the color channels so that neutral objects (such as black, gray, and white) in the image are rendered with approximately equal R, G, B values. In digital cameras, the white point can be manually or automatically adjusted. Automatic white balance (AWB) is thus an important operation in color imaging applications.
Some AWB methods include the step of identifying the light source (also referred to an illuminant) in a given image. The illuminant can be selected from a collection of candidate illuminants that are likely to occur in user-produced images. An illuminant can be described or represented by its RGB values, also referred to as the tristimulus values of the illuminant. Generally, the candidate illuminants associated with different camera models are described by different RGB values; that is, the same light source captured by different camera models has different tristimulus values. A conventional method for generating a representation of a collection of candidate illuminants associated with a camera is to take hundreds or thousands gray-card embedded photos with the camera under various light sources. This method is time-consuming, and has to be repeated for every camera model. Therefore, it is highly desirable to develop an efficient technique for generating a representation of a collection of candidate illuminants associated with a camera.
In one embodiment, a method is provided for generating and utilizing a light locus of an imaging system in a chromaticity space of two dimensions, wherein the light locus represents a collection of candidate illuminants. The method comprises: capturing, by the imaging system, a gray-card image under each of N light sources to obtain N points in the chromaticity space, wherein N is a positive integer no less than three. Each point in the chromaticity space is described by a coordinate pair calculated from red (R), green (G) and blue (B) tristimulus values of the point. The method further comprises: calculating a second order polynomial function by curve-fitting the N points; generating the light locus to represent the second order polynomial in the chromaticity space; and identifying one of the candidate illuminants from the light locus as an illuminant for an image captured by the imaging system.
In another embodiment, a method is provided for color transformation between two imaging systems in a chromaticity space of two dimensions. The method comprises: calculating a first set of points in the chromaticity space from a first set of tristimulus values obtained by a first imaging system which captures color images of objects under a set of light sources, wherein each tristimulus values include a red (R) value, a green (G) value and a blue (B) value; calculating a second set of points in the chromaticity space from a second set of tristimulus values obtained by a second imaging system which captures color images of the objects under the set of light sources, wherein each point in the first set of points has a corresponding point in the second set of points, and corresponding points are obtained from a same object captured by the two imaging systems under a same light source; estimating a color transformation matrix that transforms the first set of tristimulus values to the second set of tristimulus values for each pair of the corresponding points; and applying the estimated color transformation matrix to convert color signals generated by the first imaging system.
In yet another embodiment, a system is provided for generating and utilizing a light locus in a chromaticity space of two dimensions. The light locus represents a collection of candidate illuminants. The system comprises: an image sensor to capture a gray-card image under each of N light sources to obtain N points in the chromaticity space, wherein N is a positive integer no less than three, and wherein each point in the chromaticity space is described by a coordinate pair calculated from red (R), green (G) and blue (B) tristimulus values of the point. The system further comprises a processor coupled to the image sensor. The processor is operative to: calculate a second order polynomial function by curve-fitting the N points; generate the light locus to represent the second order polynomial in the chromaticity space; and identify one of the candidate illuminants from the light locus as an illuminant for an image captured by the imaging system.
In yet another embodiment, a system is provided for performing color transformation from a reference system in a chromaticity space of two dimensions. The system comprises: an image sensor to capture color images of objects under a set of light sources; and a processor coupled to the image sensor. The processor is operative to: calculate a target set of points in the chromaticity space from a target set of tristimulus values obtained from the captured color images of the objects under the set of light sources, wherein each tristimulus values include a red (R) value, a green (G) value and a blue (B) value; and calculate a reference set of points in the chromaticity space from a reference set of tristimulus values obtained by the reference system which captures color images of the objects under the set of light sources. Each point in the reference set of points has a corresponding point in the target set of points, and corresponding points are obtained from a same object captured by the system and the reference system under a same light source. The processor is further adapted to estimate a color transformation matrix that transforms the reference set of tristimulus values to the target set of tristimulus values for each pair of the corresponding points; and apply the estimated color transformation matrix to convert color signals generated by the reference system.
The embodiments of the invention improve the efficiency of calibrating color signals in an imaging system, as well as the generation of a light locus for an imaging system. The light locus may be used as a collection of candidate illuminants for the AWB methods to be described below. Advantages of the embodiments will be explained in detail in the following descriptions.
The present invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that different references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean at least one. Further, when a particular feature, structure, or characteristic is described in connection with an embodiment, it is submitted that it is within the knowledge of one skilled in the art to effect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described.
In the following description, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In other instances, well-known circuits, structures and techniques have not been shown in detail in order not to obscure the understanding of this description. It will be appreciated, however, by one skilled in the art, that the invention may be practiced without such specific details. Those of ordinary skill in the art, with the included descriptions, will be able to implement appropriate functionality without undue experimentation.
In the first part of the following description, systems and methods based on surface reflection decomposition are provided for performing automatic white balance (AWB). The systems and methods are robust and relatively insensitive to scene contents when compared with those based on conventional AWB algorithms. The systems and methods do not rely on detailed scene statistics or a large image database for training. A minimum projected area (MPA) method and a minimum total variation (MTV) method are described, both based on decomposing the surface reflection into a specular component and a diffuse component, and on the cancellation of the specular component. In the second part of the following description, efficient methods and systems for generating a light locus for a camera are described. In the third part of the following description, efficient methods and systems for generating a color transformation matrix based on chromaticity matching are described.
As used herein, the term “tricolor values,” or equivalently “tristimulus values,” “RGB values” or “RGB channels,” refers to the three color values (red, green, blue) of a color image. The terms “illuminant” and “light source” are used interchangeably. Furthermore, a chroma image refers to a color difference image, which can be computed from taking the difference between one color channel and another color channel, or the difference between linear combinations of color channels. Additionally, although the term “camera” is used throughout the description as an example, it is understood that the methods and systems described herein are applicable to any imaging systems.
Before describing the embodiments of the AWB module 110, it is helpful to first explain the principles according to which the AWB module 110 operates.
Let ƒ(θ; λ) be the bidirectional spectral reflectance distribution function (BSRDF), where θ represents all angle-dependent factors and λ the wavelength of light. The BSRDF of most colored object surfaces can be described as a combination of two reflection components, an interface reflection (specular) component and a body reflection (diffuse) component. The interface reflection is often non-selective, i.e., it reflects light of all visible wavelength equally well. This model is called the neutral interface reflection (NIR) model. Based on the NIR model, the BSRDF ƒ(θ; λ) can be expressed as:
ƒ(θ;λ)=ρ(λ)h(θ)+ρsk(θ), (1)
where ρ(λ) is the diffuse reflectance factor, ρs is the specular reflectance factor, and h(θ) and k(θ) are the angular dependence of the reflectance factors. A key feature of the NIR model is that the spectral factor and the geometrical factor in each reflection component are completely separable.
Assume that L(λ) is the spectral power distribution of the illuminant, and Sr(λ), Sg(λ), and Sb(λ) are the three sensor fundamentals (i.e., spectral responsivity functions). The RGB color space can be derived as:
where Lr, Lg, and Lb are the tristimulus values of the light source. The RGB color space can be re-written in matrix form as:
Let ν1 and ν2 be two independent vectors in the RGB space. If the RGB values are projected on plane V spanned by ν1 and ν2, the projected coordinates will be:
Let L=[Lr Lg Lb]T be the light source vector. The second term in equation (5) disappears when [ν1 ν2]T L=0. It means that when plane V is perpendicular to the light source vector L, the specular component is canceled.
In the AWB calculations, the light source vector L for the ground truth light source is unknown. The MPA method varies plane V by choosing different candidate illuminants. From the chosen light source vector L=(Lr, Lg, Lb) of the candidate illuminant, the orthonormal basis vectors ν1 and ν2 can be computed, and a given image's projected area on the plane spanned by ν1 and ν2 can also be computed. The projected area is the smallest when the chosen light source vector L is the closest to the ground truth light source of the image.
In one embodiment, the orthonormal basis vectors may be parameterized as follows:
When α=Lg/Lr and β=Lg/Lb, plane V(α, β) is perpendicular to L.
In one embodiment, the search range for the light sources is narrowed to a subspace where light sources are more likely to occur, since searching through all possible planes V(α, β) is very time consuming. Narrowing the search range also has the benefit of reducing the possibility of finding the wrong light source. In one embodiment, the search range can be a set of illuminants commonly occurred in consumer images of the intended application domain. The term “consumer images” refers to color images that are typically seen on image display devices used by content consumers. Alternatively or additionally, a suitable blending of the daylight locus and the blackbody radiator locus may be used. This blending can provide a light locus covering most illuminants in the consumer images. To search for the light source of an image, the MPA method calculates the image's projected area for each candidate illuminant in a set of candidate illuminants along the light locus. The candidate illuminant that produces the minimum projected area is the best estimate of the scene illuminant (i.e., the ground truth light source), and the image is white balanced according to that scene illuminant. In one embodiment, the MPA method minimizes the following expression:
where w(α, β) is a bias function, and Area(α, β) is the projected area on plane V(α, β), which is spanned by ν1(α, β) and ν2 (α, β). The bias function may be used to modify a projected area and thus improve the performance of the MPA method. The bias function relies on the gross scene illuminant distribution, but not the scene content. Therefore, the same bias function can work for any camera model after the camera is calibrated. Details of the bias function w(α, β) will be provided later. In alternative embodiments, the bias function may be omitted (i.e., set to one).
In one embodiment, after the pixel removal and group averaging operations, the pre-processing unit 310 may sub-sample the image to produce a pre-processed image. The pre-processed image is fed into an MPA calculator 380 in the AWB module 300 for MPA calculations.
In one embodiment, the MPA calculator 380 includes a projection plane calculator 320 and a projected area calculator 330. The projection plane calculator 320 calculates two orthonormal vectors ν1 and ν2 that span a plane perpendicular to a light source vector (Lr, Lg, Lb) of a candidate illuminant. In one embodiment, the projection plane calculator 320 calculates ν1 and ν2 according to equations (6) and (7), where a and are given or calculated from a candidate illuminant.
After the projection plane is determined, the projected area calculator 330 projects the RGB values of each pixel in the pre-processed image to that projection plane. The result of the projection is a collection of points that fall onto the projection plane. If each color is represented as an ideal point, then the result of the projection will produce a set of scattered dots on the projected plane, as shown in the examples of
Referring to
Referring again to
After the comparator 340 identifies a candidate illuminant that produces the minimum projected area, a gain adjustment unit 350 adjusts the color gain of the input image according to the color ratios α and β of the candidate illuminant.
For an image with multiple different colored objects, the projected area is often minimized when the projection is along the light source vector. However, for images of a single dominant color, the minimum projected area can occur when either the specular component or the diffuse component of the dominant color is canceled. In order to better handle such images of few colors, the search is constrained to the minimum projected area caused by the cancellation of the specular component, not by the diffuse component of the dominant color. One way is to search for the candidates which are close to where the potential light sources are located in the chromaticity space. Therefore, the minimum projected area is searched along the light locus which goes through the population of the known light sources.
In one embodiment, a chromaticity coordinate system (p, q) may be used to parameterize the distribution of light locus in the chromaticity domain with reduced distortion. The coordinate system (p, q) is defined as:
where r=R/(R+G+B), g=G/(R+G+B), and b=B/(R+G+B). Since r+g+b=1, any given (r, g, b) values as well as the (p, q) values derived therefrom can be represented by a point in a two-dimensional (2D) space called the chromaticity space. Any point in the chromaticity space can be described by a coordinate pair in a 2D coordinate system. The (r, g, b) values as well as the corresponding (p, q) values are called chromaticity values. It is noted that RGB values are 3D values; normalizing the RGB values to intensity-invariant (r, g, b) values reduces one degree of freedom. The remaining two degrees of freedom can be a curved surface or a plane.
For a candidate illuminant (Lr, Lg, Lb), its (p, q) coordinates can be determined by replacing R, G, B values in equations (9) with the Lr, Lg, Lb values.
A light locus may be obtained by fitting the color data taken by a reference camera under different illuminants. For example, a curve fitting from three types of light sources: shade, daylight, and tungsten can provide a very good light locus. In one embodiment, a given light locus may be represented by a second-order polynomial function in the (p, q) domain having the form of:
q=a
0
p
2
+a
1
p+α
2. (10)
Given (p, q), the following equations calculate (r, g, b):
The color ratios α and β can be obtained by:
Accordingly, given a (p, q) along the light locus, the color ratios α and β can be computed. Using equations (6) and (7), the orthonormal vectors ν1(α, β) and ν2 (α, β) can be computed, and the projected area of an image on plane V spanned by ν1(α, β) and ν2 (α, β) can also be computed.
When a scene is illuminated by a single dominant light source, the MPA method can estimate the light source accurately. However, some scenes have more than one light source. In one embodiment, a block MPA method is used to handle such multiple-illuminant scenarios. With the block MPA method, an image is divided into several blocks and the MPA method is applied to each block.
In one embodiment, the AWB module 500 includes one or more MPA calculators 310 to execute the MPA method on each block. The per-block results are gathered by an weighted averaging unit 540, which averages the chromaticity coordinate p first, then finds the other chromaticity coordinate q based on the fitted curve (e.g., the second-order polynomial function in (10)) for a given light locus. In one embodiment, the weighted averaging unit 540 applies a weight to each block; for example, the weight of a block having the main object may be higher than other blocks. In alternative embodiment, the weighted averaging unit 540 may apply the same weight to all blocks. The output of the weighted averaging unit 540 is a resulting candidate illuminant or a representation thereof. The gain adjustment unit 350 then adjusts the color gain of the input image using the color ratios α and β of the resulting candidate illuminant.
The MPA method 600 begins with a device pre-processing an image to obtain pre-processed pixels, each of which represented by tricolor values that include a red (R) value, a green (G) value and a blue (B) value (step 610). For each candidate illuminant in a set of candidate illuminants, the device performs the following operations: calculating a projection plane perpendicular to a vector that represents tricolor values of the candidate illuminant (step 620), and projecting the tricolor values of each of the pre-processed pixels to the calculated projection plane to obtain a projected area (step 630). One of the candidate illuminants is identified as a resulting illuminant for which the projected area is the minimum projected area among the candidate illuminants (step 640). The device may use the color ratios of the resulting illuminant to adjust the color gains of the image.
According to another embodiment, AWB may be performed using the MTV method, which is also based on the same principle as the MPA method by seeking to cancel the specular component. According to the NIR model, a pair of chroma images, (αC1−C2) and (βC3−C2), can be created from a given image by scaling one color channel and taking the difference with another color channel. (C1, C2, C3) is the linear transformation of tricolor values (R,G,B).
Both (αC1−C2) and (βC3−C2) are functions of spatial locations in the image. The two chroma images can be expressed as:
When α=(a21Lr+a22Lg+a23Lb)/(a11Lr+a12Lg+a13Lb) and β=(a21Lr+a22 Lg+a23Lb)/(a31Lr+a32Lg+a33Lb):
(αC1−C2)=[(αa11−a21)Lrρr+(αa12−a22)Lgρg+(αa13−a23)Lbρb]h(θ),
(βC3−C2)=[(βa31−a21)Lrρr+(βa32−a22)Lgρg+(βa33−a23)Lbρd]h(θ). (15)
The specular component is canceled for both αC1−C2 and βC3−C2. When the cancellation happens, the total variation of αC1−C2 and βC3−C2 is greatly reduced because the modulation due to the specular components is gone. There is left only a signal modulation entirely due to the difference in the diffuse components.
By searching along a given light locus, the MTV method finds a candidate illuminant, represented by color ratios α and β, that minimizes the following expression of total variation. The color ratios α and β may be computed from a given point (p, q) on a given light locus using equations (11) and (12). The total variation in this embodiment can be expressed as a sum of absolute gradient magnitudes of the two chroma images in (14):
It is noted that the gradient of a two-dimensional image is a vector that has an x-component and a y-component. For computational efficiency, a simplified one-dimensional approximation of total variation can be used:
In one embodiment, if any neighboring pixel has been removed due to over-exposure, under-exposure, or color saturation, the gradient of that pixel is excluded from the total variation calculation.
After the comparator 730 identifies the candidate illuminant that produces the minimum total variation, the gain adjustment unit 350 adjusts the color gain of the input image using the color ratios α and β of the candidate illuminant. Experiment results show that the MTV method performs well for a single dominant illuminant as well as multiple illuminants.
The MTV method 800 begins with a device pre-processing an image to obtain a plurality of pre-processed pixels, each of which represented by tricolor values that include a red (R) value, a green (G) value and a blue (B) value (step 810). For each candidate illuminant in a set of candidate illuminants, the device calculates a total variation in the tricolor values between neighboring pixels of the pre-processed pixels (step 820). The calculation of the total variation includes the operations of: calculating a linear transformation of the tricolor values to obtain three transformed values (step 830); calculating a first scaling factor and a second scaling factor, which represent two color ratios of the candidate illuminant (step 840); constructing a first chroma image by taking a difference between a first transformed value scaled by the first scaling factor and a second transformed value (step 850); constructing a second chroma image by taking a difference between a third transformed value scaled by the second scaling factor and the second transformed value (step 860); and calculating an indicator value by summing absolute gradient magnitudes of the first chroma image and absolute gradient magnitudes of the second chroma image (step 870). After the total variations of all candidate illuminants are computed, the device selects a candidate illuminant for which the total variation is the minimum among all of total variations (step 880).
The method 900 begins with a device pre-processing the image to obtain a plurality of pre-processed pixels, each of which represented by tricolor values that include a red (R) value, a green (G) value and a blue (B) value (step 910). For each candidate illuminant in a set of candidate illuminants, the device calculates an indicator value that has a diffuse component and a specular component (step 920). The device then identifies one of the candidate illuminants as a resulting illuminant for which the indicator value is a minimum indicator value among the candidate illuminants, wherein the minimum indicator value corresponds to cancellation of the specular component (step 930). According to color ratios derived from the resulting illuminant, the device adjusts color gains of the image (step 940). In one embodiment, the indicator value is a projected area as described in connection with the MPA method 600 in
In the following description, efficient methods and systems for generating a light locus for a camera are described. As mentioned in the MPA method and the MTV method, a light locus represents a collection of candidate illuminants. A light locus of an imaging system (e.g., a camera) may be described by a mathematical formula, such as the aforementioned second-order polynomial function q=a0p2+a1p+a2 of equation (10) with variables p, q in the chromaticity space. Due to the differences in spectral responsivity of different camera models, typically the coefficients (a0, a1, a2) for different camera models are different; for example, Canon® G9 and Nikon® D5 may use different coefficients in equation (10). One technique for generating the light locus for a camera is using the camera to take a number of gray-card images with each image subject to a different light source. The RGB values of the gray-card image are converted to corresponding (p, q) values using equation (9), and the (p, q) values from all of the captured images are used to solve for the coefficients (a0, a1, a2) in the second-order polynomial function of equation (10). It should be noted that the gray card used herein is not limited to any specific shade of gray. Any gray card with a non-selective, neutral spectral reflectance function may be used. Furthermore, it should be noted that the chromaticity space may be described by a coordinate system different from the (p, q) coordinate system.
In one embodiment, the light locus 1000 may be generated by curve-fitting at least three points in the (p, q) domain. Each point may be generated by the target camera capturing an image of a gray card under a different light source. That is, at least three different light sources are needed for generating the at least three points in the (p, q) domain for the light locus 1000. Suppose that n different light sources are used to capture n different images of a gray card (where n≥3, and each image is captured under a different light source), the gray card in each image can be described by a set of RGB values. Then equation (9) may be used to convert the n sets of RGB values to corresponding n pairs of (p, q) values. The coefficients (a0, a1, a2) in the second-order polynomial function of equation (10) can be computed by the following:
When n=3, three standard light sources may be used for generating three pairs of (p, q) values. In one embodiment, the three standard light sources may be: D65 and Illuminant A according to the CIE standard, and a light source whose spectral distribution approximates a blackbody radiator with a temperature range substantially between 2000 and 2500 degrees Kelvin (K); e.g., 2300 degrees K, such as the light source commonly known as Horizon. Thus, in one embodiment, a user may take only three gray-card images under the three different light sources to generate a light locus for the target camera.
After the second-order polynomial function is constructed by solving equation (18), a user (such as a camera developer or manufacturer) may limit the range of the light locus in the chromaticity space, such that the light sources that typically do not occur in user-produced images are removed from further consideration. The light locus range in the chromaticity space may be limited by an upper bound and a lower bound with respect to the color temperature. In the example of
In the example of
p[0]=pD65−c0, and
p[1]=pH+c1, (19)
where c0 and c1 are two constant values, pD65 is the p value calculated from the D65 light source, and pH is the p value calculated from the light source whose spectral distribution approximates a blackbody radiator with a temperature range substantially between 2000 and 2500 degrees K, such as the Horizon light source. As an example, c0=0.19 and c1=0.03. Since pD65 and pH may differ from one camera to another, the range of p values for the light locus may also differ from one camera to another.
After obtaining an initial light locus for a camera by curve-fitting, a user may verify the quality of the initial light locus by taking one or more additional images of the gray card under one or more additional light sources that are different from the light sources used for generating the initial light locus. For example, additional daylight sources (e.g., D50) and tungsten light sources may be used for verification. Fluorescent light sources generally do not work as well as the daylight and tungsten light sources. An additional (p, q) pair may be calculated from each of these additional images.
In one embodiment, the method 1200 begins with an imaging system, such as a camera, capturing a gray-card image under each of N light sources to obtain N points in the chromaticity space, wherein N is a positive integer no less than three, and wherein each point in the chromaticity space is described by a coordinate pair calculated from red (R), green (G) and blue (B) tristimulus values of the point (step 1210). The imaging system calculates a second order polynomial function by curve-fitting the N points (step 1220), generates the light locus as a graphical representation of the second order polynomial in the chromaticity space (step 1230), and identifies one of the candidate illuminants from the light locus as an illuminant for an image captured by the imaging system (step 1240).
In the following, efficient methods and systems for generating a color transformation matrix based on chromaticity matching are described according to one embodiment. Color signals generated by one imaging systems may be transformed to corresponding color signals generated by another imaging system using a 3×3 color transformation matrix. In one embodiment, the color transformation matrix may be used in the color correction matrix module (CCM) 120 of
Conventional chromaticity matching techniques for generating a color transformation matrix typically rely on matching the RGB values of a target camera to the RGB values of a reference camera under the same light source, where the RGB values of a camera is the RGB values of a color checker image taken by the camera. However, these conventional techniques may encounter at least the problems of non-uniform lighting and lens shading. Slight non-uniformity in the lighting and lens shading can cause significant changes in the resulting color transformation matrix. Moreover, shooting an extra image with a uniform gray card at the same spatial location, the same image position, and under the same illumination to correct the color discrepancy between two cameras is quite problematic in the field, where illumination may change between the time instants when the respective images are taken.
The method for generating a color transformation matrix to be described herein is effective for a wide range of different lighting conditions. The method calculates the color transformation matrix in the chromaticity space, in which coordinate values are invariant of: luminance of the set of light sources, non-uniform lighting, exposure errors and lens shading. The method pools together color samples from different images taken by two different cameras to optimize the color transformation matrix, subject to an error metric. The error metric is to minimize the total chromaticity error, which is independent of spatial illumination non-uniformity (i.e., non-uniform lighting) and camera luminance shading (i.e., lens shading). The gradient of this error metric has an analytical expression and, therefore, gradient-based optimization methods can be used to obtain reliable convergence.
In one embodiment, let (x1,y1,z1), (x2,y2,z2), (x3,y3,z3), (x4,y4,z4) be four sets of chromaticity values of a target camera; and let (r1,g1,b1), (r2,g2,b2), (r3,g3,b3), (r4,g4,b4) be their corresponding sets of chromaticity values of a reference camera. Any three sets of these chromaticity values for each camera are not collinear. Let (R,G,B) represents the tristimulus values of the reference camera, and let (X,Y,Z) represents the tristimulus values of the target camera. Let A be the color transformation matrix that maps the tristimulus values (R,G,B) of the reference camera to the corresponding tristimulus values (X,Y,Z) of the target camera. The transformation of tristimulus values from (R,G,B) to (X,Y,Z) is given by
Let x=X/(X+Y+Z), y=Y/(X+Y+Z), z=Z/(X+Y+Z), r=R/(R+G+B), g=G/(R+G+B), and b=B/(R+G+B), equation (20) can be expressed as:
Matrix A can be expressed as:
The above calculations can be extended to a general case of four or more sets of chromaticity values for each camera. Let (Ui, Vi), i=1, 2, . . . , N, be N pairs (also referred to as chromaticity pairs) of corresponding chromaticity values between two cameras:
Since matrix A may not be an exact transformation from (R,G,B) to (X,Y,Z), the transformed tristimulus values may be denoted as (X′,Y′,Z′):
Let P=[1,1,1]T, the expression in (24) can be re-written into the following form:
Minimize the weighted sum of the square of chromaticity distance E:
where wi is the weight for the chromaticity error of the ith pair. The weights can be chosen to reflect the perceptual errors for different chromaticity pairs.
Take the derivative of E with respect to the matrix A:
In one embodiment, the steepest descent or the conjugate gradient optimization methods may be applied to (27) to estimate matrix A. It should be noted that matrix A can be determined up to a free scale factor. That is, only eight unknowns in matrix A can be solved. Therefore, in one embodiment a22 is set to one to reduce the number of unknowns to eight because a22 is not likely to be zero.
The color transformation matrix A may be used to convert color signals generated by a reference imaging system to corresponding color signals in a target imaging system, wherein each color signal and the corresponding color signal are generated for or under the same light source. Furthermore, the color transformation matrix A may be used to transform a known light locus of a reference camera C1 with a target light locus of a target camera C2. For example, cameras C1 and C2 may each take m images under each of n light sources to produce a total of m×n=N chromaticity pairs (Ui,Vi), with the m images being m color block images each having a different color. The set of n light sources may include at least one light source selected from a group including: D65 and Illuminant A according to the CIE standard, and a light source whose spectral distribution approximates a blackbody radiator with a temperature range substantially between 2000 and 2500 degrees K; e.g., 2300 degrees K, such as the light source commonly known as Horizon. A color checker board, such as the Macbeth ColorChecker® may be used to provide the color block images of different colors. As an example, a color checker board may provide m=19 color blocks of different colors, and the n light sources with n=5 may be: D65, TL84 (a.k.a. F11 according to the CIE standard), illuminant A, Horizon, and Cool White Fluorescent (CWF) (a.k.a. F2 according to the CIE standard). Using the 19×5=95 chromaticity pairs, the chromaticity matching matrix A of camera C1 and camera C2 can be estimated from equations (23)-(27). Alternatively, a different m and/or a different n may be used.
Under the same light source, the transformation from the reference camera C1 having (R1,G1,B1) values and the target camera C2 having corresponding (R2,G2,B2) values can be expressed as:
Each point on a light locus can be converted to (r, g, b) values, which are equal to (R,G,B) values multiplied by a scale factor. Thus, matrix A can be used to transform each point on the known light locus of camera C1 to a corresponding point on the target light locus of camera C2. The scale factor has no effect on either of the light loci, as each light locus is plotted in the chromaticity space that describes the ratios of the RGB values.
The operations of the flow diagrams of
Various functional components or blocks have been described herein. As will be appreciated by persons skilled in the art, the functional blocks will preferably be implemented through circuits (either dedicated circuits, or general purpose circuits, which operate under the control of one or more processors and coded instructions), which will typically comprise transistors that are configured in such a way as to control the operation of the circuity in accordance with the functions and operations described herein.
While the invention has been described in terms of several embodiments, those skilled in the art will recognize that the invention is not limited to the embodiments described, and can be practiced with modification and alteration within the spirit and scope of the appended claims. The description is thus to be regarded as illustrative instead of limiting.
This application is a continuation-in-part of U.S. patent application Ser. No. 15/425,113 filed on Feb. 6, 2017, and claims the benefit of U.S. Provisional Application No. 62/436,487 filed on Dec. 20, 2016, the entirety of which is incorporated by reference herein.
Number | Date | Country | |
---|---|---|---|
62436487 | Dec 2016 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 15425113 | Feb 2017 | US |
Child | 15786866 | US |