Color gamut mapping using a lightness mapping based also on the lightness of cusp colors belonging to different constant-hue leaves
10602027 · 2020-03-24
Assignee
Inventors
Cpc classification
H04N1/6058
ELECTRICITY
H04N1/6005
ELECTRICITY
International classification
Abstract
For the mapping in a non-linear color space of source colors belonging to a same constant-hue leaf, instead of using a lightness mapping function based only on a cusp lightness condition stating that a source cusp color of this leaf should be mapped into a corresponding target cusp color of this leaf, it is proposed to build such a function also on other source cusp color(s) and other target cusp color(s) having hues different from that of said leaf. Preferably, the hue interval in which these other colors are considered is representative of the curvature of the non-linear color space at the position of colors of this constant-hue leaf.
Claims
1. Method of color gamut mapping source colors into targets colors from a source color gamut towards a target color gamut in a 3D non-linear gamut mapping color space that can be partitioned in 2D constant-hue leaves having axes for lightness and chroma, wherein a source cusp color of a constant-hue leaf is defined as a color having the highest color chroma in said constant-hue leaf and in said source color gamut, wherein a target cusp color of a constant-hue leaf is defined as a color having the highest color chroma in said constant-hue leaf and in said target color gamut, said method comprising mapping the lightness L of each source color having a chroma C into a lightness L of a target color according to a lightness mapping function L=(C,L) associated with the constant-hue leaf comprising said source color, wherein said lightness mapping function is defined such as to meet a cusp lightness condition according to: (C.sub.C.sup.SOURCE,L.sub.C.sup.SOURCE)=L.sub.C.sup.TARGET, where L.sub.C.sup.SOURCE and C.sub.C.sup.SOURCE are respectively the lightness and the chroma of the source cusp color of this leaf, wherein for at least one leaf of constant hue h the associated lightness mapping function depends on the lightness L.sub.C.sup.SOURCE of the source cusp color of said leaf and on the lightness L.sub.C.sup.TARGET of the target cusp color of said leaf and depends on the lightness of at least one other source cusp color and/or on the lightness of at least one other target cusp color of constant-hue leave(s) different from said leaf of constant hue h.
2. Method of color gamut mapping according to claim 1 wherein said associated lightness mapping function L=(C,L) associated with the constant-hue leaf of hue h depends on a source average of lightnesses of these source cusp colors and/or on a target average of lightnesses of these target cusp colors.
3. Method of color gamut mapping according to claim 2 wherein: source cusp colors of different constant-hue leaves form a polygon representing a source cusp line and source cusp colors of said source average include vertices of said polygon which are nearest from the intersection of said source cusp line with the leaf of constant hue h, and/or target cusp colors of different constant-hue leaves form a polygon representing a target cusp line and target cusp colors of said target average include vertices of said polygon which are nearest from the intersection of said target cusp line with the leaf of constant hue h.
4. Method of color gamut mapping according to claim 1 wherein: hue(s) of said at least one other source cusp color are distributed over a source hue interval [h(1t)h.sup.SOURCE, h+(1t)h.sup.SOURCE], wherein h is the hue of said leaf of constant hue, wherein h.sup.SOURCE is a source hue interval around said constant hue h which is representative of the curvature of said mapping color space in hue direction at the position of colors of said source color gamut lying in the leaf of said constant hue h, where t is a lightness weight whose value is the range [0,1], and/or hue(s) of said at least one other target cusp color are distributed over a target hue interval [h(1t)h.sup.TARGET, h+(1t)h.sup.TARGET], where h is the hue of said leaf of constant hue, where h.sup.TARGET is a target hue interval around said constant hue h which is representative of the curvature of said mapping color space in hue direction at the position of colors of said target color gamut lying in the leaf of said constant hue h, where t is a lightness weight whose value is in the range [0,1].
5. Method of color gamut mapping according to claim 4 wherein said at least one lightness mapping function depends on a parameter t representative of the difference between the lightness L of the source color to map and the lightness L.sub.B.sup.SOURCE of the black point of the source color gamut, or between the lightness L of the source color to map and the lightness L.sub.W.sup.SOURCE of the white point of the source color gamut.
6. Method of color gamut mapping according to claim 4 wherein said at least one lightness mapping function depends on a parameter u representative of the ratio between the chroma C of the source color to map and the chroma C.sub.C.sup.SOURCE of said source cusp color of the leaf of said constant hue h.
7. Image processing device comprising one or more processors, wherein the one or more processors are configured to perform mapping source colors of a content which are provided in a source color gamut having a black point and a white point into targets colors of a target color gamut, in a 3D non-linear gamut mapping color space that can be partitioned in 2D constant-hue leaves having axes for lightness and chroma, wherein the one or more processors are further configured to: obtain, from said source color gamut, source cusp colors forming a polygon describing a source cusp line and, from said target color gamut, target cusp colors forming a polygon describing a target cusp line, obtain, for any leaf of constant hue in which there is at least one source color to map, a source hue interval around the hue h of this leaf associated with the source cusp color of this leaf, and a target hue interval around the hue h of said leaf associated with the target cusp color of this leaf, define, for source colors located in a same leaf of constant-hue h, a lightness-mapping function (C,L) adapted to lightness-map any of these source colors having a chroma C and a lightness L, wherein said lightness mapping function depends on the source cusp color and on the target cusp color of said leaf of constant-hue h and depends on at least one other source cusp color and/or on at least one other target cusp color of constant-hue leave(s) different from leaf of constant-hue h, wherein hue(s) of said at least one other source cusp color are distributed over the source hue interval, and wherein hue(s) of said at least one other target cusp color are distributed over the target hue interval, apply the lightness-mapping function (C,L) to said source colors located in said leaf of constant-hue h such as to output lightness-mapped colors.
8. Image processing device according to claim 7, wherein the one or more processors are further configured to chroma-map said lightness-mapped colors into final-mapped colors such that they are located in said target color gamut.
9. Electronic device incorporating an image processing device according to claim 7.
10. Electronic device according to claim 9 incorporating an image display device and/or an image capture device.
11. A non-transitory processor readable medium having stored therein instructions for causing a processor to perform the method of color gamut mapping according to claim 1.
Description
BRIEF DESCRIPTION OF DRAWINGS
(1) The invention will be more clearly understood on reading the description which follows, given by way of non-limiting example and with reference to the appended figures in which:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
DESCRIPTION OF EMBODIMENTS
(10) The functions of the various elements shown in the figures, notably
(11) Moreover, the software may be implemented as an application program tangibly embodied on a program storage unit. The application program may be uploaded to, and executed by, a machine comprising any suitable architecture. Preferably, the machine is implemented on a computer platform having hardware such as one or more central processing units (CPU), a random access memory (RAM), and input/output (I/O) interfaces. The computer platform may also include an operating system and microinstruction code. The various processes and functions described herein may be either part of the microinstruction code or part of the application program, or any combination thereof, which may be executed by a CPU. In addition, various other peripheral units may be connected to the computer platform such as an additional data storage unit and a printing unit.
(12) A specific embodiment of the cusp color gamut mapping method according to the invention will now be described in reference to
(13) As mapping color space, the CIE 1976 Lab color space is chosen. A Lab color space is a color-opponent space that is perceptually uniform, with dimension L for lightness and a and b for the color-opponent dimensions. The red/green opponent primary colors are represented along the a axis, with green at negative a values and red at positive a values. The yellow/blue opponent secondary/primary colors are represented along the b axis, with blue at negative b values and yellow at positive b values.
(14) In this color space, colors can also be represented by polar coordinates, i.e. in a LCh mode, with L for the same lightness, the hue angle h according to
(15)
i.e. the angle between the vector having a, b as coordinates and the a-axis, C={square root over (a.sup.2+b.sup.2)} corresponding to the chroma, i.e. the saturation of the color. The higher the C value the more saturated is the color. The hue angle may be also named .sub.H.
(16) Other color spaces such as the appearance-based space JCh according to CIECAM-02 can be used for the mapping. Furthermore, the below embodiment concerns a hue-preserving cusp color gamut mapping. This means that the color mapping is not actually carried out in three dimensions in Lab space but in two dimensions in a constant-hue leaf of the Lab space, i.e. in a 2D LC color space. The hue defining the constant-hue leaf in which the color mapping is to be performed is chosen to be the hue of the source color to be mapped.
(17) The source GBD used to describe the source color gamut comprising source colors to map is based in a manner known per se on a mesh of triangles, each triangle being defined by the position of its three vertices in the mapping color space, these vertices being source colors located on the boundary of the color gamut. The source color gamut can correspond to a specific or standard display device such as a LCD or an OLED panel, to a specific content to map, to an image capture device such as a camera or a scanner, or to any other color device.
(18) The target GBD used to describe the target color gamut in which source colors are to be mapped is also based in a manner known per se on a mesh of triangles, each triangle being also defined by the position of its three vertices in the mapping color space, these vertices being target colors located on the boundary of the color gamut. The target color gamut can correspond for instance to a specific or standard display device or to a printer.
(19) Gamut Boundary Descriptions can be convex or non-convex, but in the embodiment below, it is assumed that source and target GBDs are both approximately convex.
(20) Furthermore, as illustrated on
(21) 1.sup.st Step: Obtaining CUSP Colors of the Source and Target Color Gamuts:
(22) The cusp line of each color gamut is defined by a line joining all cusp colors of this color gamut, whereas each cusp color is defined to be the color within this color gamut with the highest color saturation C compared to all other colors in the constant-hue leaf having the same hue h as this cusp color. Using GBDs based on triangles represented by their vertices as defined above, the cusp line of a color gamut is then described by a series of vertices of these triangles that meet this highest color saturation requirement. The vertices of this series then form a closed polygon that circumscribes in a certain manner the gamut boundary description.
(23) In the implementation described below, the same method of obtaining the cusp colors is used for the source color gamut and for the target color gamut, namely the method described by Stauder et. al. in their article entitled Gamut Mapping for Motion Picture published at the Conference on Colour in Graphics, Imaging and Vision, Jun. 14-18, 2010. In order to obtain the cusp line of each of the source and target color gamuts from their GBDs, the following steps described in this article are implemented:
(24) 1. Detection of a first current cusp vertex as the vertex of the gamut boundary description (GBD) having the highest color saturation C;
(25) 2. For each of neighboring vertices of this GBD located in the neighborhood of this current cusp vertex, calculation of the value of a quality criterion (example of a definition is given further down), said neighborhood being defined by all vertices that are linked to the current cusp vertex by an edge of a triangle of this GBD;
3. From these neighboring vertices, selection of the vertex of the neighborhood having the highest value of this quality criterion as being a cusp color of the cusp line,
4. If this selected vertex satisfies a stop criterion (example of a definition is given further down), the whole cusp line of this color gamut is considered as obtained; if the stop criterion is not satisfied, the selected vertex is overtaken as current cusp vertex and steps 2 to 4 above are reiterated up to a last selected vertex satisfies the stop criterion.
(26) From the first current cusp vertex up to the last selected vertex of iterations of the above steps, a series of cusp vertices defining cusp colors is then obtained, said series forming a closed polygon that circumscribes in a certain manner the color gamut and describes the cusp line of the color gamut.
(27) The white line which forms a polygon on
(28) Still in reference to the article from Stauder et al. already quoted above, an example of definition of a quality criterion K will now be given, based on a combination of four sub criteria, which are: a saturation criterion K.sub.S, a lightness similarity criterion K.sub.I, a hue angle increase criterion K.sub.H, and a collinearity criterion K.sub.D.
(29) The saturation criterion K.sub.S is defined such as to find the most saturated cusp vertices of a neighborhood. The value of the saturation criterion K.sub.S of a vertex V belonging to the neighborhood of a current cusp vertex {circumflex over (V)} is defined as follows:
(30)
where D=|V{circumflex over (V)}|=={square root over (L{circumflex over (L)}).sup.2+(a).sup.2+(b{circumflex over (b)}).sup.2)} is the distance, in the Lab color space, between the neighboring vertex V and the current cusp vertex {circumflex over (V)}, and where the values for the constant coefficients c.sub.1, c.sub.2 can be for instance c.sub.1=150 and c.sub.2=50.
(31) The lightness similarity criterion K.sub.I is defined such as to find cusp vertices of a neighborhood having a similar lightness L along the cusp line. The value of the lightness similarity criterion K.sub.I of a vertex V belonging to the neighborhood of a current cusp vertex {circumflex over (V)} is based on the difference between the lightness of the neighboring vertex L and that of the current vertex {circumflex over (L)} and is defined as follows:
(32)
where the value for the constant coefficient c.sub.3 may be for instance c.sub.3=100.
(33) The hue angle increase criterion K.sub.H is defined such as to find cusp vertices of a neighborhood that increase in hue angle, in order to get a cusp line description formed by a closed and smooth cusp polygon. The value of the hue angle increase criterion K.sub.H of a vertex V belonging to the neighborhood of a current cusp vertex {circumflex over (V)} is defined as follows:
(34)
where .sub.H is the hue angle of the vertex V as defined above (also named h), where {circumflex over ()}.sub.H is the hue angle of the vertex V that is defined in the same manner as .sub.H while using the coordinates , {circumflex over (b)} instead of a,b, respectively,
where the value for the constant coefficient c.sub.4 can be for instance c.sub.4=90.
(35) The collinearity criterion K.sub.D is defined such as to find cusp vertices of a neighborhood in a direction as close as possible to the direction of the previous iteration of the method as defined above to obtain the cusp line, in order to still improve the smoothness of the cusp polygon. The value of the collinearity criterion K.sub.D of a vertex V belonging to the neighborhood of a current cusp vertex V which has been itself selected in a previous iteration in the neighborhood of a previous current cusp vertex V is defined for instance as follows:
K.sub.D=1.sub.D/C.sub.5
where .sub.D={d;{circumflex over (d)}}, i.e. the angle between a first direction vector {circumflex over (d)}={circumflex over (V)}V and a second direction vector d=V{circumflex over (V)},
and where the value for the constant coefficient c.sub.5 can be for instance c.sub.5=90.
(36) The value of the quality criterion K of a vertex V belonging to the neighborhood of a current cusp vertex {circumflex over (V)} is then calculated for instance according to the formula:
K=c.sub.SK.sub.S+c.sub.HK.sub.H+c.sub.IK.sub.I+c.sub.DK.sub.D+c.sub.CK.sub.C,
where the value for the weight coefficient s are for instance c.sub.S=5, c.sub.H=5, c.sub.I=2 and c.sub.D=2.
(37) Still in reference to the article from Stauder et al. already quoted above, an example of definition of a stop criterion to be applied to a selected vertex will now be given as follows:
(38) Either, the selected vertex is identical with the current cusp vertex;
(39) Or the selected vertex has an associated hue angle .sub.H that is larger than the hue angle of this current cusp vertex augmented by 360 degrees.
(40) 2.sup.nd Step: Estimation of Hue Intervals for Cusp Colors of the Source and Target Color Gamuts:
(41) As already explained above, changing the color space in which a color gamut is represented may infer curvatures, notably changing from a linear RGB color space to the non-linear Lab color space but also when changing from non-linear RGB color space to the non-linear Lab color space. Curvature occurs as soon as the mathematical functions used to transform RGB color coordinates into Lab coordinates are non-linear. More precisely, a group of colors that are distributed along a straight line in the RGB color space are generally distributed along a non-straight curved line in the Lab color space. In this Lab color space, at any color of this curved line, a curvature of this curved line can be computed. Such a curvature reflects the curvature induced by the change of color space. An aim of this 2.sup.nd step is to take into account the curvature, notably in hue direction, of the gamut mapping color space, here the Lab color space.
(42) When a color gamut is represented by a cube in a RGB color space, all colors within this color gamut which are distributed along a straight line in this color space will be distributed along a curved line in the Lab color space. Therefore, the curvature of this curved line at the location of a given color may be represented by the tangent vector of this curved line (i.e. derivation of the curve) at this given color. Hue component (i.e. hue angle) of this tangent vector is representative of the curvature of this curved line in hue direction at the location of this given color. This hue component may be named hue derivation.
(43) An aim of this 2.sup.nd step is to get an average representation of the curvature in hue-direction at the location of colors belonging to a same constant-hue leaf. A straight line of colors should be defined in the RGB color space comprising a given color at which this curvature has to be estimated such that the corresponding curved line in the Lab color space intersects a constant-hue leaf comprising this given color. The curvature of this curved line in hue direction at this positionnamed below hue derivationcorresponds to the curvature of the Lab space at this position. An aim of this 2.sup.nd step is to estimate at least one representative value of these curvatures over the different colors of this constant-hue leaf. In other words, an aim of this 2.sup.nd step is to estimate at least one hue derivation or hue interval that is representative of these curvatures. As a constant-hue leaf of hue h can be characterized by its source and/or target cusp colori.e. intersection of this leaf with the source and/or target cusp line, a source hue interval h.sup.SOURCE around this hue h can be defined in association with this source cusp color, and a target hue interval h.sup.TARGET around the hue h can be defined in association with this target cusp color. The source hue interval h.sup.SOURCE is representative of the curvatures of the Lab color space in hue direction over the different colors of the source color gamut lying in the same constant-hue leaf, and the target hue interval h.sup.TARGET is representative of the curvatures of the Lab color space in hue direction over the different colors of the target color gamut lying in the same constant-hue leaf.
(44) In the first to fourth sub-steps below, a computation of such hue intervals h.sup.SOURCE and h.sup.TARGET associated with any cusp color defining a constant-hue leaf is described.
(45) Although the invention is preferably implemented with hue intervals representative of the curvatures of the mapping color space as described above, the invention may also be implemented using hue intervals which are not representative of theses curvatures: see below.
(46) For this description of the computation, it is reminded that the rims of a color gamut are defined by high-lightness lines linking the white point of this color gamut to its secondary colors, and by low-lightness lines linking the black point of this color gamut to its primary colors. As this color gamut is described by a mesh of triangles (see above), rims are represented by series of rim colors, as already mentioned for the cusp lines above.
(47) In a first sub-step of computation, at the position of each of the source cusp colors that are secondary colors, i.e. located at the intersection of a high-lightness rim with the cusp line, a high-lightness source hue interval is defined in reference to
(48) In a first variant of implementation of this first sub-step, a triangle is defined between the white point, the secondary color and a third color located on the source cusp line such that this triangle has the same surface as the surface delimited by the straight line linking the white point and the secondary color and by the rim. This defined triangle is projected on an ab-plane of constant lightness. The hue angle at the vertex of the projected triangle which is located on the lightness axis is then considered as the high-lightness hue interval associated with the cusp secondary color.
(49) In a second variant of implementation of this first sub-step, the calculation of a surface is avoided. Instead, distance lines DL are constructed such as shown in
(50) In the three embodiments of the first sub-step above, the high-lightness source hue interval that is obtained is representative of the curvature of the Lab color space in hue direction at the position of this secondary color. More precisely, this hue interval represents the curvature of the high lightness curved rim linking this secondary color to the white point, wherein the corresponding high lightness rim is straight in the RGB space. It is assumed that such a hue derivation of colors on this rim will influence also hue derivation of other colors having similar hues and high lightnesses within the source color gamut, however these latter hue derivations are difficult to evaluate directly.
(51) Similarly to the first sub-step above including its variants, in a second sub-step, for each of the source cusp colors that are primary colors, i.e. located at the intersection of a low-lightness rim with the cusp line, a low-lightness source hue interval is defined using the same process as above, but in which the black point is taken in the computing methods above instead of the white point, resulting in a low-lightness hue interval for each cusp color. This low-lightness source hue interval is representative of the curvature in hue direction of the Lab color space at the position of this primary color. More precisely, this hue interval represents the curvature of the low lightness curved rim linking this primary color to the black point, wherein the corresponding low lightness rim is straight in the RGB space. It is assumed that such a hue derivation of colors on the low-lightness rim will influence also hue derivation of other colors having similar hues and low lightnesses within the source color gamut.
(52) In a third sub-step, for each of the cusp colors that are not equal to a secondary color, a high-lightness hue interval h.sub.high.sup.SOURCE is interpolated from the high-lightness hue intervals associated with the nearest two secondary colors as defined in the first sub-step abovesuch nearest distance being measured along the cusp lineand for each of the cusp colors that not are equal to a primary color, a low-lightness hue interval h.sub.low.sup.SOURCE is interpolated from the low-lightness hue intervals associated with the nearest two primary colors as defined in the second sub-step above, such nearest distance being measured along the cusp line. The interpolation is based on two distances evaluated along the cusp line between this cusp color on one side and each of the two nearest primary or secondary colors on the other side. This interpolation can by simply linear over these distances, or can be quadratic for instance. Other known interpolation techniques may be used, as for instance splines interpolation.
(53) For cusp colors that are not vertices of the polygon formed by the series of cusp colors, the associated hue interval is interpolated from the nearest neighboring vertex cusp colors.
(54) In a fourth sub-step, the source hue interval h.sup.SOURCE associated with a cusp colorwhich is not a secondary or a primary coloris then calculated from the high-lightness h.sub.high.sup.SOURCE and the low-lightness h.sub.low.sup.SOURCE source hue intervals provided by the third sub-step above in a way that h.sup.SOURCE is closer to the high-lightness hue interval h.sub.high.sup.SOURCE for source colors to map having a lightness above a lower limit L.sub.high(C) and closer to the low-lightness hue interval h.sub.low.sup.SOURCE for source colors to map having a lightness below a higher limit L.sub.low(C). For source colors to map having a lightness comprised between the higher limit L.sub.low(C) and the lower limit L.sub.high(C), the source hue interval h.sup.SOURCE is interpolated from both the low-lightness hue interval h.sub.low.sup.SOURCE and the high-lightness hue interval h.sub.high.sup.SOURCE In reference to
(55) A method to calculate the target hue interval h.sup.TARGET associated with a target cusp color will now be described. This method uses similarly four sub-steps as described above. A target hue interval h.sup.TARGET associated with this target cusp color is then similarly calculated from a high-lightness target hue interval h.sub.high.sup.TARGET and a low-lightness target hue interval h.sub.low.sup.TARGET, which are themselves calculated similarly in reference to the primary colors, the secondary colors, the white point and the black point of the target color gamut (instead of those of the source color gamut as above). Similarly, an example of calculation will be given in the third step below where the target hue interval h.sup.TARGET also depends on the lightness L and the chroma C of the source color to map. An interpolated target hue interval h.sup.TARGET associated with a target cusp color having the same hue as the source colors to map is considered as representative of the curvature of the mapping color space in hue-direction at the position of colors lying in the target color gamut and having the same hue as the source color.
(56) Variant of the Second Step in which the Target and Source Hue Intervals are not Representative of the Curvature of the Lab Color Space:
(57) Instead of implementing the first to fourth sub-steps above to calculate the target and source hue interval, an alternative simpler calculation method can be implemented in which the source hue interval h.sup.SOURCE associated with a source cusp color is defined to be the hue angle between this source cusp color and at least one closest source cusp color on the source cusp line and the target hue interval h.sup.TARGET associated with a target cusp color is defined to be the hue angle between this target cusp color and at least one closest target cusp color on the target cusp line. Preferably, the source hue interval is defined to be the hue angle between two nearest neighboring source cusp colors surrounding this source cusp color and the target hue interval associated with a target cusp color is defined to be the hue angle between the two nearest neighboring target cusp colors surrounding this target cusp color.
(58) For example, if the cusp line is represented by a polygon defined by vertices, the implementation can be as follows. When the intersection of this cusp line with a constant-hue leaf corresponds to a vertex of the polygon, at least one neighboring vertex of this cusp colori.e. said intersectionis identified. The hue interval will be then the hue angle between these two vertices. When the intersection of this cusp line with a constant-hue leaf does not correspond to a vertex of the polygon, the hue interval is interpolated from the two vertices of the polygon that are the nearest from this intersection. More precisely, the hue interval will be half of the hue angle between these two vertices. The same process is applied for the source hue interval h.sup.SOURCE associated with a source cusp color and for the target hue interval h.sup.TARGET associated with a target cusp color.
(59) 3.sup.rd Step: Definition of Lightness Mapping Function:
(60) Once the cusp colors of the source gamut and of the target gamut are detected at the first step above as well once their associated high-lightness and low-lightness hue intervals are calculated at the second step above, a lightness gamut mapping function f can be defined for each leaf of constant hue h in the source color gamut, for instance as described in the article entitled Motion Picture Versioning by Gamut Mapping by J. Stauder et al., published in November 2010 in the Eighteenth Color and Imaging Conference: Color Science and Engineering Systems, Technologies, and Applications, San Antonio, Tex., p. 178-183. A variation of the method described in this article is described below. The lightness mapping function f of a constant-hue leaf to be defined to map the lightness L of any source color of this leaf preferably satisfies the following so-called cusp lightness condition: a source color having the lightness L.sub.C.sup.SOURCE and the chroma C.sub.C.sup.SOURCE of the cusp color of the source color gamut belonging to this leaf is lightness mapped in this leaf into a color having the same lightness L.sub.C.sup.TARGET as the cusp color of the target color gamut belonging to this leaf. It means that, in this leaf, the function f is defined such that (C.sub.C.sup.SOURCE,L.sub.C.sup.SOURCE)=L.sub.C.sup.TARGET This condition is illustrated on
(C,L)=L+s(Eq. 1),
where the linear lightness offset s is defined as follows:
s=tu(L.sub.C.sup.TARGETL.sub.C.sup.SOURCE)(Eq. 2)
where the linear lightness weight t and the linear chroma weight u are defined as follows:
(61)
where, as already defined above, L.sub.C.sup.SOURCE and C.sub.C.sup.SOURCE are respectively the lightness and the chroma of the source cusp color of this constant-hue leaf in which the mapping function f is defined. The chroma weight u as defined in equation 3B ensures that colors with small chroma values are less lightness mapped than colors with large chroma values. In this way, grey ramps near the L-axis are preserved.
(62) L.sub.C.sup.SOURCE is an averaged source cusp color lightness value defined by an average of lightness values over source cusp colors found in step 1 above that are within a hue window (1t)h around the cusp color of the leaf of constant hue h; such an average is then defined as follows:
(63)
where L.sub.C.sup.SOURCE(v) is the lightness of the cusp color of the source color gamut having a hue v,
where h is the hue value common to all source colors of the constant-hue leaf to which the lightness function is to be applied,
where h.sup.SOURCE is the source hue interval associated with the source cusp color of the leaf of constant hue h, which is calculated from equations 5 to 7 below from the high-lightness h.sub.high.sup.SOURCE and the low-lightness h.sub.low.sup.SOURCE hue intervals of the source cusp color as defined in step 2 above:
(64)
(65) As illustrated on
(66) According to a variant, when the above simpler method of calculation of a source hue interval h.sup.SOURCE associated with a source cusp color is implemented (where the source hue interval is not representative of the curvature of the Lab color spacesee above at the end of paragraph describing the 2.sup.nd step), the averaged source cusp color lightness value L.sub.C.sup.SOURCE can be advantageously calculated according to:
(67)
(68) In this implementation, for cusp colors lying on a vertex of the polygon representing the source cusp line, the integration of L.sub.C.sup.SOURCE(v) in Eq. 4A can be advantageously simplified into averaging the lightness value of this cusp color and the lightness values of the two nearest vertices found on this source cusp line (see end of step 2 above) according to
L.sub.C.sup.SOURCE=[L.sub.C.sup.SOURCE+L.sub.C.sup.N1+L.sub.C.sup.N2](Eq. 4B)
where L.sub.C.sup.N1; L.sub.C.sup.N2 are the lightness values of these two nearest vertices.
(69) For cusp colors not lying on a vertex of the polygon representing the source cusp line, L.sub.C.sup.SOURCE is obtained as follows: an averaged polygon is constructed having vertices based on averaged lightness values calculated according to Eq. 4B from cusp colors lying on a vertex of the polygon representing the source cusp line. More precisely, this averaged polygon is defined by averaged vertices having the same chroma and hue as the vertices of the polygon representing the source cusp line while the lightness of the averaged vertices is calculated according to Eq. 4B. Once this averaged polygon is constructed, an averaged source cusp color lightness value L.sub.C.sup.SOURCE can be obtained for any of such cusp colors from the lightness of the color at the intersection of this averaged polygon with the constant-hue leaf comprising this cusp color.
(70) L.sub.C.sup.TARGET is an averaged target cusp color lightness value defined by an average of lightness values over target cusp colors found in step 1 above that are within the same hue window (1t)h around the cusp color of the leaf of constant hue h; such an average is then defined as follows:
(71)
where L.sub.C.sup.TARGET(v) is the lightness of a cusp color of the target color gamut having a hue v,
where h is the hue value common to all colors of the constant-hue leaf,
where h.sup.TARGET is the target hue interval associated with the target cusp color of the leaf of constant hue h, which is calculated according to equations 9 to 11 below from the high-lightness h.sub.high.sup.TARGET and the low-lightness h.sub.low.sup.TARGET target hue intervals of the target cusp color as defined in step 2 above:
(72)
(73) According to a variant, when the above simpler method of calculation of a target hue interval h.sup.TARGET associated with a target cups color is implemented (where the target hue interval is not representative of the curvature of the Lab color spacesee above at the end of paragraph describing the 2.sup.nd step), the averaged target cusp color lightness value L.sub.C.sup.TARGET can be advantageously calculated according to:
(74)
(75) In this implementation, for cusp colors lying on a vertex of the polygon representing the target cusp line, the integration of L.sub.C.sup.TARGET(v) in Eq. 8A can be advantageously simplified into averaging the lightness value of this cusp color and the lightness values of the two nearest vertices found on this target cusp line (see end of step 2 above) according to
L.sub.C.sup.TARGET=[L.sub.C.sup.TARGET+L.sub.C.sup.M1+L.sub.C.sup.M2](Eq. 8B)
where L.sub.C.sup.M1; L.sub.C.sup.M2 are the lightness values of these two nearest vertices.
(76) For cusp colors not lying on a vertex of the polygon representing the source cusp line, L.sub.C.sup.TARGET is obtained as follows: an averaged polygon is constructed having vertices based on averaged lightness values calculated according to Eq. 8B from cusp colors lying on a vertex of the polygon representing the target cusp line. More precisely, this averaged polygon is defined by averaged vertices having the same chroma and hue as the vertices of the polygon representing the target cusp line while the lightness of the averaged vertices is calculated according to Eq. 8B. Once this averaged polygon is constructed, an averaged target cusp color lightness value L.sub.C.sup.TARGET can be obtained for any of such cusp colors from the lightness of the color at the intersection of this averaged polygon with the constant-hue leaf comprising this cusp color.
(77) The above non-limiting definition of the lightness-mapping function satisfies the cusp lightness condition above.
(78) In Equations 4 and 8 above, the size of the averaging hue window is modulated by the same factor (1t) based on the parameter t defined above. Note that the integrals of these equations are generally replaced in practice by a sum over a finite number of points of the cusp polygon.
(79) According to the above different definitions of the averaged cusp color lightness values L.sub.C.sup.SOURCE; L.sub.C.sup.TARGET used for the definition of a lightness-mapping function f to be applied to all source colors of a constant-hue leaf, lightnesses of source and target cusp colors located out of this constant-hue leaf are taken into account. It means that the definition of the lightness function f contains lightness information from source or target cusp colors with hues that are different from the hue h of the source colors to map.
(80) According to the above more specific definitions of source and target hue intervals that are representative of the curvature of the Lab color space in hue direction, lightnesses of source and target cusp colors that are within these intervals centered on the source and target cusp color defining a constant-hue leaf of hue h are taken into consideration for the definition of the lightness function f to be applied to all source colors of this hue leaf. In the embodiment given above, these lightnesses are averaged over these hue intervals. It means that the definition of the lightness function f contains lightness information from source or target cusp colors with hues that are distributed over hue intervals that are representative of the curvature of the Lab color space in hue direction, these hues being also different from the hue h of the source colors to map.
(81) In a variation, the chroma value C.sub.C.sup.SOURCE in Eq. 3B could be replaced by an averaged chroma value in the same way as the lightness is averaged in Eq. 4.
(82) A specific lightness gamut mapping function can be defined as described above for each constant-hue leaf of the Lab color space in which there are source colors to map. At the end of this third step, a whole definition of the lightness mapping is obtained.
(83) When source and target hue intervals are defined such that they are representative of the curvature of the Lab color space in hue direction, this definition of the lightness mapping matches better than in prior art the non-linearity, i.e. the curvature, of the boundaries of the source and target color gamuts. Moreover, when the source hue interval h.sup.SOURCE is defined according to according to Eq. 7 and when the target hue interval h.sup.TARGET is defined according to Eq. 11, the hue intervals are larger and thus the averaging of the source and target lightnesses of cusp colors according to equations 4 and 8 is stronger for source colors at the gamut border than for source colors with a lightness L close to that L.sub.C.sup.SOURCE of the cusp color of the leaf of constant hue h. This modulation ensures that the source colors located on the rims of the source gamut and being far away from the source cusp line are lightness mapped using information from more cusp colors having hues different from hue h than source colors located close to the source cusp line or far away from the rims. This reduces advantageously the impact of the geometrical mismatch described above. As a matter of fact, when using the above definition of a lightness mapping function, a color located on a rim of the source gamut is lightness mappedat least partially in the sense of averagingaccording to the cusp color belonging to the same rim.
(84) As soon as they satisfy the cusp lightness condition above, other mapping functions dependent on s parameter can be used instead of the one used above ((C,L)=L+s) to implement the invention, as for instance (C,L)=sL (Eq. 1),
(85)
with the same definition as above for t, u, L.sub.C.sup.SOURCE and L.sub.C.sup.TARGET.
4th Step: Lightness Mapping by Application of the Lightness Mapping Function:
(86) The lightness mapping function (C,L) as defined above is then applied to the lightness of the source colors of the content to map, each color being represented in the mapping color space Lab by the following coordinates:
(87)
(88) According to the invention, the lightness mapping function f is applied only to the L coordinate such that the resulting, mapped color has the coordinates
(89)
(90)
(91) 5.sup.th Step: Chroma Mapping:
(92) The lightness mapped color N which is obtained at the end of the previous step is an intermediate mapped color. Notably when the intermediate mapped color N that is obtained through the previous step of lightness mapping is not located within the target color gamut, this color N is finally chroma mapped into a target color N in a way that this target color is inside the target color gamut.
(93) To illustrate such a chroma mapping, an intermediate mapped color N is chroma mapped into a target color N in direction to a so-called anchor point N.sub.0. In the specific embodiment, this anchor point is positioned on the Lightness axis and has the following coordinates:
(94)
and straight lines anchored on this anchor point are chosen as mapping trajectories for the chroma mapping step. In this specific case, the second mapping does not impact the lightness of the colors.
(95) Such a chroma mapping can be described as a modification of distance K between an intermediate mapped color N and the anchor point N.sub.0 into a distance K between the target color N and the same anchor point N.sub.0. In reference to the previous example illustrating the lightness mapping of A into A, A will me chroma mapped into A: see
(96) Any other known algorithms can be used for this chroma mapping, such as gamut compression, gamut clipping or gamut expansion.
(97) For intermediate mapped colors N located within the target color gamut, this 5.sup.th step may be optional, notably when these intermediate mapped colors N populate regularly the target color gamut.
(98) As a conclusion, the implementation of the above first to fifth steps leads to a global color gamut mapping of source colors of a content to map from the source color gamut in which they are located into target colors in the target color gamut. The fourth and fifth steps above can be merged in one step of color gamut mapping impacting both the lightness and the chroma of source colors to map.
(99) Main advantages of the color mapping method above when hue intervals are representative of the curvature of the mapping color space: 1. Curvature of color space in hue-direction is taken into account for lightness mapping. 2. This curvature of color space in hue-direction can be taken into account even if this curvature cannot not be estimated at the position of each color to map. 3. The presence of curvature of color space is taken into account so that the impact of mismatch between a generally linear propagation of the mapping over a whole constant-hue leaf and the non-plane boundaries is lowered.
(100) According to a hardware aspect, the invention relates to an image processing device configured for mapping source colors of a content which are provided in a source color gamut having a black point and a white point into targets colors of a target color gamut, wherein said mapping is performed in a 3D non-linear gamut mapping color space that can be partitioned in 2D constant-hue leaves having axes for lightness and chroma.
(101) This image processing device comprises:
(102) a cusp module configured to obtain, from said source color gamut, source cusp colors forming a polygon describing a source cusp line and, from said target color gamut, target cusp colors forming a polygon describing a target cusp line,
(103) a hue interval module configured to obtain, for any leaf of constant hue in which there is at least one source color to map, a source hue interval around the hue h of this leaf associated with the source cusp color of this leaf provided by said cusp module, which reflects the curvature of the Lab color space in a hue-direction of colors lying in this leaf, and a target hue interval around the hue h of said leaf, associated with the target cusp color of this leaf provided by said cusp module, which reflects the curvature of the Lab color space in a hue-direction of colors lying in this leaf,
(104) a lightness-mapping function definition module configured to define, for source colors located in a same leaf of constant hue h, a lightness-mapping function (C,L) adapted to lightness-map any of these source colors having a chroma C and a lightness L, wherein said lightness mapping function depends not only on the source cusp color and on the target cusp color of said leaf of constant hue h but also on at least one other source cusp color and on at least one other target cusp color of constant-hue leaves different from said leaf of constant hue h, wherein hue(s) of said at least one other source cusp color are distributed over the source hue interval provided by said hue interval module, and wherein hue(s) of said at least one other target cusp color are distributed over the target hue interval provided by said hue interval module,
(105) a lightness-mapping module configured to apply the lightness-mapping function (C,L) provided by the lightness-mapping function definition module to said source colors located in said leaf of constant hue h such as to output lightness-mapped colors.
(106) Preferably, said image processing device comprises also a chroma-mapping module configured to chroma-map said lightness-mapped colors provided by said lightness-mapping module into final-mapped colors such that they are located in said target color gamut.
(107) The above modules are functional units that may or may not correspond to physically distinguishable units. For example, these modules or some of them can be grouped together in a single component or circuit, or constitute functions of the same software. On the contrary, some modules may be composed of separate physical entities.
(108) This image processing device is implemented according to a purely hardware embodiment, for example in the form of a dedicated component (for example in an ASIC (application specific integrated circuit) or FPGA (field-programmable gate array) or VLSI (very large scale integration) or of several electronic components integrated into a device or even in the form of a mixture of hardware elements and software elements.
(109) When source colors are provided in a color space different from a perceptually uniform color space as the Lab color space, these source colors are transformed in a manner known per se into a representation in a perceptually uniform color space before being mapped.
(110) This image processing device can notably be incorporated in an electronic device such as a TV set, a set-top-box, a gateway, a tablet, a smartphone, a camera or any electronic device incorporating an image display device and/or an image capture device.
(111) While the present invention is described with respect to a particular embodiment, it is understood that the present invention is not limited to this embodiment. The present invention as claimed therefore includes variations from this embodiment described herein, as will be apparent to one of skill in the art.
(112) It is to be further understood that, because some of the constituent system components and methods depicted in the accompanying drawings are preferably implemented in software, the actual connections between the system components or the process function blocks may differ depending upon the manner in which the invention is implemented.