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.
Most conventional AWB algorithms rely on some physical features (such as the color gamut) and statistical properties (such as the average color distribution) of natural scenes. The conventional AWB algorithms, which are sensitive to the statistics of the scene contents, often encounter one or more of the following difficulties: 1) a dominant color biases the results, 2) the estimate has a high probability to be wrong when there is no neutral color in the image, 3) inaccurate camera calibration can cause the scene statistics to be different from the statistics used by the camera, 4) a large set of training samples with ground truth may be required to build up reliable statistics, and 5) the algorithm performance may be affected by unit-to-unit variations in the mass production of cameras. Therefore, it is highly desirable to develop AWB techniques that are more robust and relatively insensitive to scene contents.
In one embodiment, a method is provided for determining an illuminant of an image. The method comprises: calculating an indicator value for each of a set of candidate illuminants of the image, wherein each candidate illuminant is described by a corresponding coordinate pair (p, q) in a chromaticity coordinate system; determining a threshold for indicator values of the candidate illuminants; identifying a subset of the candidate illuminants that have the indicator values not greater than the threshold; and for all candidate illuminants in the subset, calculating a weighted average of corresponding coordinate pairs to obtain an averaged coordinate pair to describe the illuminant of the image in the chromaticity coordinate system.
In another embodiment, a method is provided for chromatic adaptation of an image based on adaptation requirements for a set of luminance levels. The method comprises: calculating an illuminant of the image, wherein the illuminant is described by a coordinate pair (p, q) in a chromaticity coordinate system; identifying a luminance level of the image; adjusting the coordinate pair (p, q) of the illuminant using, at least in part, one or more adaptation degrees derived from the adaptation requirements and the luminance level of the image to obtain an adapted illuminant; and adapting colors of the image to the adapted illuminant.
In yet another embodiment, a device is provided for determining an illuminant of an image. The device comprises: a memory to store the image; and an image processing pipeline coupled to the memory. The image processing pipeline is operative to: calculate an indicator value for each of a set of candidate illuminants of the image, wherein each candidate illuminant is described by a corresponding coordinate pair (p, q) in a chromaticity coordinate system; determine a threshold for indicator values of the candidate illuminants; identify a subset of the candidate illuminants that have the indicator values not greater than the threshold; and for all candidate illuminants in the subset, calculate a weighted average of corresponding coordinate pairs to obtain an averaged coordinate pair to describe the illuminant of the image in the chromaticity coordinate system.
In yet another embodiment, a device is provided for chromatic adaptation of an image based on adaptation requirements for a set of luminance levels. The device comprises: a memory to store the image; and an image processing pipeline coupled to the memory. The image processing pipeline is operative to: calculate an illuminant of the image, wherein the illuminant is described by a coordinate pair (p, q) in a chromaticity coordinate system; identify a luminance level of the image; adjust the coordinate pair (p, q) of the illuminant using, at least in part, one or more adaptation degrees derived from the adaptation requirements and the luminance level of the image to obtain an adapted illuminant; and adapt colors of the image to the adapted illuminant.
The embodiments of the invention improve the results of AWB calculations. Additionally, chromatic adaptation can be performed efficiently according to a given specification. 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.
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. In the following, 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.
As used herein, the term “tricolor values,” or equivalently “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.
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 f(θ; λ) 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 f(θ; λ) can be expressed as:
f(θ;λ)=ρ(λ)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:
R=∫L(λ)f(θ;λ)Sr(λ)dλ
=h(θ)∫L(λ)ρ(λ)Sr(λ)dλ+ρsk(θ)∫L(λ)Sr(λ)dλ,
G=h(θ)∫L(λ)ρ(λ)Sg(λ)dλ+ρsk(θ)∫L(λ)Sg(λ)dλ,
B=h(θ)∫L(λ)ρ(λ)Sb(λ)dλ+ρsk(θ)∫L(λ)Sb(λ)dλ. (2)
R=L
r[ρrh(θ)+ρsk(θ)],
G=L
g[ρgh(θ)+ρsk(θ)],
B=L
b[ρbh(θ)+ρsk(θ)], (3)
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 v1 and v2 be two independent vectors in the RGB space. If the RGB values are projected on plane V spanned by v1 and v2, the projected coordinates will be:
Let L=[Lr Lg Lb]T be the light source vector. The second term in equation (5) disappears when [v1 v2]TL=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 v1 and v2 can be computed, and a given image's projected area on the plane spanned by v1 and v2 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 v1(α, β) and v2(α, β). 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 v1 and v2 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 v1 and v2 according to equations (6) and (7), where α 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).
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
1
p
2
+a
2
p+a
3. (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 v1(α, β) and v2(α, β) can be computed, and the projected area of an image on plane V spanned by v1(α, β) and v2(α, β) 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:
(αC1−C2)=[(αa11−a21)Lrρr+(αa12−a22)Lgρg+(αa13−a23)Lbρb]h(θ)+[(αa11−a21)Lr+(αa12−a22)Lg+(αa13−a23)Lb]ρsk(θ),
(βC3−C2)=[(βa31−a21)Lrρr+(βa32−a22)Lgρg+(βa33−a23)Lbρb]h(θ)+[(βa31−a21)Lr+(βa32−a22)Lg+(βa33−a23)Lb]ρsk(θ). (14)
When α=(a21Lr+a22Lg+a23Lb)/(a11Lr+a12Lg+a13Lb) and β=(a21Lr+a22Lg+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ρb]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, an improvement to the MPA and MTV methods will be presented. The improvement is aiming at bringing the calculated illuminant of an image closer to the ground truth, such as when multiple candidate illuminants produce similar values in projected areas (or total variations); that is, their differences in value may be within a margin of error. Thus, instead of taking one of these candidate illuminants as the illuminant of the image, the coordinate values of these candidate illuminants in the PQ domain may be averaged to generate an averaged illuminant. An example scenario in which this approach may be useful is when a large number of pixels in an image are located on, or within a threshold distance from, the light locus from which the candidate illuminants are obtained. In such cases, the minimum projected area calculated by the MPA method and the minimum total variation calculated by the MTV method may be unstable, and the averaged illuminant may be closer to the ground truth than the candidate illuminant that produces the minimum projected area (or total variation) in the calculations. In the description herein, the term “average” is used interchangeably with “weighted average” where the weight may be 1 or another numeric value; e.g., a probability value derived from a priori knowledge about the candidate illuminants. For example, the probability value of a first candidate illuminant may be higher than that of a second candidate illuminant if the first candidate illuminant occurs more often in the consumer image population than the second candidate illuminant.
To simplify the description, the term “indicator value” in the following is used to refer to any of the “projected area” in the MPA method, the “total variation” in the MTV method, and their respective weighted values.
In one embodiment, the threshold (T) may be a value between the maximum and the minimum of the indicator values such as T=V_min+Δ, where V_min is the minimum indicator value among all indicator values produced by the candidate illuminants, and Δ is less than the difference between the maximum and the minimum of the indicator values. In some scenarios Δ may be greater than zero, such as when the minimum indicator value is produced by a candidate illuminant that is not a boundary candidate illuminant. It is noted that the term “boundary” herein refers to a p-coordinate boundary, as using a q-coordinate boundary for the purpose of calculating the threshold (T) may cause significant errors in the result of calculating the averaged illuminant.
In some scenarios Δ may be zero, such as when one of the boundary candidate illuminants produces the minimum indicator value, and/or when the difference between the minimum and the second smallest indicator value is greater than a tolerance. A boundary candidate illuminant is described by a coordinate pair (p, q), where the p-coordinate value is at the boundary of an interval or space that encompasses all candidate illuminants in the chromaticity coordinate system. For example, if all of the candidate illuminants lie on a one-dimensional curve in the (p, q) space parameterized by a range of p-coordinate values, the candidate illuminants having the smallest and largest p-coordinate values on the light locus are the boundary candidate illuminants. If all of the candidate illuminants lie in a two-dimensional chromaticity space described by a range of p-coordinate values and a range of q-coordinate values, the candidate illuminants having the smallest and largest p-coordinate values are the boundary candidate illuminants.
Thus, a general form of the threshold T may be: T=min[(V_min+k(V_max−V_min)), V_boundary], where k is a value between zero and one (e.g., k=0.125), V_min is the minimum indicator value, V_max is the maximum indicator value, and V_boundary represents the boundary indicator values produced by the boundary candidate illuminants as defined above.
Similarly,
The method 1200 begins at step 1210 when a device calculates an indicator value for each candidate illuminant in a set of candidate illuminants of the image. Each candidate illuminant is described by a corresponding coordinate pair (p, q) in a chromaticity coordinate system. The device at step 1220 determines a threshold for indicator values of the candidate illuminants; and at step 1230 identifies a subset of the candidate illuminants that have the indicator values not greater than the threshold. For all candidate illuminants in the subset, the device at step 1240 averages corresponding coordinate pairs to obtain a weighted average coordinate pair that describes the illuminant of the image in the chromaticity coordinate system. More specifically, the device may average the corresponding p-coordinate values and the corresponding q-coordinate values to determine an averaged p-coordinate value (pavg) and an averaged q-coordinate value (qavg), respectively. The weighted average coordinate pair (pavg, qavg) identifies the illuminant of the image in the chromaticity coordinate system.
In some embodiments, the illuminant of the image as calculated above may be adjusted according to customer's requirements or specification. A customer may request that images be reproduced by an imaging device (e.g., a camera) such that the white point of the resulting image is adjusted to suit the customer's color preference. In one embodiment, the chromatic adaption is performed in the chromaticity coordinate system; that is, the PQ domain. Chromatic adaptation in the PQ domain involves much less complex calculations than in the LMS color space, also known as the human photoreceptor response color space (where “L” stands for long-wavelength-sensitive, “M” stands for middle-wavelength-sensitive, and “S” stands for short-wavelength-sensitive, cone responses). The chromatic adaptation in the LMS color space typically requires multiple 3×3 matrix conversions.
A customer may specify the target RGB colors. For example, a customer may provide a number of raw (original) images with a gray card, and the corresponding target images with the gray card. The gray card may be any percentage gray or any color(s) suitable for serving as a reference point. From the images provided by the customer, the values of (porigin, qorigin) in the raw images and (padapt, qadapt) in the target images can be calculated for the given luminance levels in these images, where (porigin, qorigin) are the p-coordinate value and the q-coordinate value of the illuminant before chromatic adaptation, respectively; and (padapt, qadapt) are the p-coordinate value and the q-coordinate value of the illuminant after chromatic adaptation, respectively.
Based on (porigin, qorigin) and (padapt, qadapt) derived from the customer's specification, the following model expressed as equations (18) can be used to determine the adaptation degrees Ap and Aq.
p
adapt=(1−Ap)pD
where pD65 and qD65 are the p-coordinate value and the q-coordinate value of a standard illuminant D65, respectively. In alternative embodiments, the p-coordinate value and the q-coordinate value of a different default illuminant, such as D50, Illuminant E, or any other preferred illuminant, may be used instead of pD65 and qD65. In one embodiment, the adaptation degree Ap required by and derived from the customer's specification may include multiple ranges of Ap values, with each range corresponding to a luminance level. The same may apply to the adaptation degree Aq.
In one embodiment, a monotonically increasing Ap curve 1320 as a function of LA is generated by curve fitting, such that the Ap curve 1320 passes through all three Ap ranges at the three given luminance levels. In this example, the Ap curve 1320 may be expressed in the form of:
The parameters x1, x2 and x3 may be generated by known curve fitting methods. Similarly, the customer's requirements may include another graph specifying adaptation requirements for the adaptation degree Aq for the q-coordinates as a function of LA. Similarly, curve fitting may be performed on the requirements to obtain an Aq curve. For example, the Aq curve may be expressed in the form of:
The parameters x4, x5 and x6 may be generated by known curve fitting methods. In alternative embodiments, the equations (19) and (20) may include different number of parameters.
As described above, an illuminant in the chromaticity coordinate system can be described by a coordinate pair (p, q), and this illuminant can be adjusted according to the luminance level (LA) of the image and the adaptation degree (Ap) or adaptation degrees (Ap and Aq) for that luminance level. With the adaptation curve 1320, an adapted illuminant (padapt, qadapt) can be found for any luminance level in the graph from the given (porigin, qorigin) using equations (18).
In one embodiment, the equations (18) may be used to find the adapted illuminant (padapt, qadapt) for porigin≤T1 or porigin≥T2, where T1 and T2 mark the boundary points beyond which the image colors need adjustment. For T1<porigin<T2, Ap=Aq=1; hence padapt=porigin and qadapt=qorigin.
In another embodiment, the model of (18) may be simplified based on the observation that qadapt is typically not sensitive to Aq. Thus, the following model expressed as equations (21) may be used to find the adapted illuminant (padapt, qadapt) for porigin≤T1 or porigin≥T2.
p
adapt=(1−Ap)pD
where qoffset is the distance between qorigin and the light locus, and a1, a2 and a3 are the coefficients of the light locus (see equation (10)). As mentioned above in connection with equations (18), the p-coordinate value and the q-coordinate value of a different default illuminant, such as D50, Illuminant E, or any other preferred illuminant, may be used instead of pD65 and qD65. For T1<porigin<T2, Ap=Aq=1; hence padapt=porigin and qadapt=qorigin.
In some scenarios, the customer's specification may be converted into the PQ domain that includes multiple regions of curve fitting, and a different monotonically increasing Ap curve may be generated for each region. For example, the customer's specification when converted into the PQ domain may specify an Ap range of [0, 0.1] for LA=10, an Ap range of [0.5, 0.6] for LA=11, an Ap range of [0.3, 0.4] for LA=40. In this case, a single monotonically increasing curve cannot fit into all the required ranges. Thus, multiple regions may be used where each region includes the Ap ranges or data points for which a single monotonically increasing curve can fit.
For example, the boundaries of the regions may be defined by porigin, such as Region 1: porigin<T1; Region 2: T1≤porigin<T2; . . . ; Region n: Tn-1≤porigin<Tn; Region (n+1): porigin≥Tn.
The chromatic adaptation model for each Region i may be expressed as:
p
adapt=(1−Ap
where
and where xi1, xi2, and xi3 are found by curve fitting based on a customer's specification. As mentioned above in connection with equations (18) and (21), the p-coordinate value and the q-coordinate value of a different default illuminant, such as D50, Illuminant E, or any other preferred illuminant, may be used instead of pD65 and qD65. The transition between regions is continuous so that a slight shift does not cause visible color change due to different adaptation.
The method 1500 begins at step 1510 when a device calculates an illuminant of the image, wherein the illuminant is described by a coordinate pair (p, q) in a chromaticity coordinate system. The device at step 1520 identifies a luminance level of the image; and at step 1530 adjusts the coordinate pair (p, q) of the illuminant using, at least in part, an adaptation degree derived from the adaptation requirements and the luminance level of the image to obtain an adapted illuminant. The device at step 1540 adapts the colors of the image to the adapted illuminant.
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 | 15675221 | US |