METHOD OF MAPPING SOURCE COLORS OF AN IMAGE IN A CHROMATICITY PLANE
20170359490 · 2017-12-14
Inventors
- Angelo Mazzante (Melesse, FR)
- Marie-Jean Colaitis (Cesson-Sevigne, FR)
- Jurgen Stauder (Montreuil/ille, FR)
Cpc classification
H04N1/6061
ELECTRICITY
International classification
Abstract
Source colors are mapped within a mapping segment starting at a preserved gamut boundary color (P.sub.C) and ending at a target gamut boundary color (I.sub.T-C) of the chromaticity plane, corresponding, in a linear 3D color space, to an intersection of the target color gamut (TCG) with a plane of constant luminance and with a mapping plane (MKO) comprising said source color (M), a black point (K) and a white point (O).
Claims
1. A method of mapping source colors of an image from a 3D source color gamut (SCG) into a 3D target color gamut (TCG), both gamuts sharing a common black (K) and a common white (O), wherein a chromaticity point in a chromaticity plane (xy) can be derived from any straight line comprising said common black (K) in a linear 3D color space, said method comprising mapping each (M) of said source colors which are out of a preserved color gamut (PCG) within a mapping segment of a mapping straight line included in said chromaticity plane (xy), wherein said mapping straight line comprises the chromaticity point (M.sub.C) of said source color (M) and the chromaticity point (O.sub.C) of said white point (O), wherein said mapping segment starts at the chromaticity point (P.sub.C) of a preserved gamut boundary color (P) associated with said source color (M), wherein said mapping segment ends at the chromaticity point (I.sub.T-C) of a target gamut boundary color (I.sub.T) associated with said source color (M), wherein the chromaticity point (P.sub.C) of said preserved gamut boundary color (P) is positioned on said mapping straight line between the chromaticity point (O.sub.C) of said white point (O) and the chromaticity point (I.sub.T-C) of said target gamut boundary color (I.sub.T), wherein said target gamut boundary color (I.sub.T) corresponds, in said linear 3D color space, to an intersection of said target color gamut (TCG) with a plane of constant luminance and with a mapping plane (MKO) comprising said source color (M), said black point (K) and said white point (O).
2. The method of mapping colors according to claim 1, wherein said target color gamut is also defined by three primary colors and corresponding chromatic points defining a primary triangle in said chromatic plane, wherein there is at least one (M) of said source colors to map having a chromaticity point (I.sub.T-C) of its corresponding target gamut boundary color (I.sub.T) ending its mapping segment which is positioned on its mapping line between the chromaticity point (P.sub.C) of its corresponding preserved gamut boundary color (P) and an intersection (I′.sub.T-C) of said mapping line with an edge of said primary triangle.
3. The method of mapping colors according to claim 1, wherein said chromaticity plane is the chromaticity plane (xy) of the CIE xyY color space.
4. The method of mapping colors according to claim 1, wherein the luminance of said plane of constant luminance is the luminance (Y.sub.M) of said source color (M).
5. The method of mapping colors according to claim 1, wherein said preserved color gamut is projected as a preserved color line (PCL) in said chromaticity plane, and wherein said chromaticity point (P.sub.C) of the preserved gamut boundary color (P) associated with said source color (M) correspond to the intersection of said preserved color line (PCL) with said mapping straight line.
6. The method of mapping colors according to claim 1, wherein a chromaticity point (I.sub.S-C) of a source gamut boundary color (I.sub.S) is associated with said source color (M) and is defined as an intersection, in said linear 3D color space, of said source color gamut with said plane of constant luminance and with said mapping plane (MKO), and wherein said mapping of said source color (M) into a target color (T) is performed within said mapping segment such that the distance (P.sub.CT.sub.C), measured in said chromaticity plane, between the chromaticity point (P.sub.C) of said preserved gamut boundary color (P) and the chromaticity point (T.sub.C) of said target color (T) is an homogeneous increasing function of the distance, measured in said chromaticity plane, between the chromaticity point (P.sub.C) of said preserved gamut boundary color (P) and the chromaticity point (M.sub.C) of said source color (M) and of the ratio between: the distance (P.sub.CI.sub.T-C), measured in said chromaticity plane, between the chromaticity point (P.sub.C) of said preserved gamut boundary color (P) and the chromaticity point (I.sub.T-C) of said target boundary color (I.sub.T) and the distance (P.sub.CI.sub.S-C), measured in said chromaticity plane, between the chromaticity point (P.sub.C) of said preserved gamut boundary color (P) and the chromaticity point (I.sub.S-C) of said source boundary color (I.sub.S).
7. The method of mapping colors according to claim 6, wherein said function is such that, when said source color (M) corresponds to said preserved gamut boundary color (P), said target color (T) corresponds to the same preserved gamut boundary color (P), and such that, when said source color (M) corresponds to said source gamut boundary color (I.sub.S), said target color (T) corresponds to said target gamut boundary color (I.sub.T).
8. The method of mapping colors according to claim 6, wherein said function is invertible.
9. A method of transmission of an image comprising: mapping source colors of said image into target colors, from a 3D source color gamut into a 3D target color gamut, according to the method of claim 7 based on said function, encoding said target colors into encoded target colors, transmitting said encoded target colors, decoding said encoded target colors into decoded target colors, inverse-mapping said decoded target colors into source colors, from said 3D target color gamut into said 3D source color gamut, according to the method of claim 8 based on the inverse of said function.
10. An image processing device comprising at least one processor configured for mapping source colors of an image from a 3D source color gamut (SCG) into a 3D target color gamut (TCG), both gamuts sharing a common black (K) and a common white (O), wherein a chromaticity point in a chromaticity plane (xy) can be derived from any straight line of a linear 3D color space comprising said common black (K), said at least one processor being configured for mapping each (M) of said source colors which are out of a preserved color gamut (PCG) within a mapping segment of a mapping straight line included in a chromaticity plane (xy), wherein said mapping straight line comprises the chromaticity point (M.sub.C) of said source color (M) and the chromaticity point (O.sub.C) of said white point (O), wherein said mapping segment starts at the chromaticity point (P.sub.C) of a preserved gamut boundary color (P) associated with said source color (M), wherein said mapping segment ends at the chromaticity point (I.sub.T-C) of a target gamut boundary color (I.sub.T) associated with said source color (M), wherein the chromaticity point (P.sub.C) of said preserved gamut boundary color (P) is positioned on said mapping straight line between the chromaticity point (O.sub.C) of said white point (O) and the chromaticity point (I.sub.T-C) of said target gamut wherein said target gamut boundary color (I.sub.T) corresponds, in a linear 3D color space, to an intersection of said target color gamut with a plane of constant luminance and with a mapping plane (MKO) comprising said source color (M), said black point (K) and said white point (O).
11. The image processing device according to claim 10, wherein said target color gamut is also defined by three primary colors and corresponding chromatic points defining a primary triangle in said chromatic plane, wherein there is at least one (M) of said source colors to map having a chromaticity point (I.sub.T-C) of its corresponding target gamut boundary color (I.sub.T) ending its mapping segment which is positioned on its mapping line between the chromaticity point (P.sub.C) of its corresponding preserved gamut boundary color (P) and an intersection (I′.sub.T-C) of said mapping line with an edge of said primary triangle.
12. The image processing device according to claim 10, wherein said chromaticity plane is the chromaticity plane (xy) of the CIE xyY color space.
13. An electronic device incorporating an image processing device according to claim 10.
14. The electronic device of claim 13 selected from the group consisting of a camera, a TV set, a monitor, a head mounted display, a set top box, a gateway, a smartphone and a tablet.
15. A computer program product comprising program code instructions to execute the steps of the method of mapping colors of claim 1, when this program is executed by a processor.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0042] 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:
[0043]
[0044]
[0045]
DESCRIPTION OF EMBODIMENTS
[0046] It will be appreciated by those skilled in the art that flow charts presented herein represent conceptual views of illustrative circuitry embodying the invention. They may be substantially represented in computer readable media and so executed by a data processing device, whether or not such device is explicitly shown. The functions of the various elements shown in the figures may be provided through the use of hardware capable of executing software in association with appropriate software. Such hardware capable of executing such software generally uses processor, controller, digital signal processor (“DSP”) hardware, read-only memory (“ROM”) for storing software, random access memory (“RAM”), and non-volatile storage.
[0047] The invention may notably be implemented by any device capable of processing images, notably capable of implementing color and/or tone mapping or inverse color and/or tone mapping of images. Therefore, the invention can be notably implemented in an image capture device such as a camera, an image display device such as a TV set, a monitor, a head mounted display, or a set top box or a gateway, as such devices are generally capable of processing images. The invention can also be implemented in a device comprising both an image capture display device and an image display device, such as a smartphone or a tablet. All such devices comprise hardware capable of executing software that can be adapted in a manner known per se to implement the invention.
[0048] A main embodiment of a method of color mapping according to the invention will now be described in reference to
[0049] It is assumed that the source color gamut SCG and the target color gamut TCG are respectively defined as cubes in the linear source RGB color space and in a linear target RGB color space, and share a common black K and a common white O. For instance and in reference to
1.SUP.st .Step: Conversion of RGB Color Data to XYZ and xyY Color Data, Including Conversion of Color Gamuts.
[0050] Such a conversion of the color coordinates R.sub.M,G.sub.M,B.sub.M of the source colors of the image is obtained through the following well-known equations 1.1 and 1.2:
where the matrix (C.sub.ij).sub.i=i=X,Y,Z,j=R,G,B is the well known Normalized Primaries Matrix of the reference R, G, B, O primaries defining the 3D target color gamut. This matrix transforms normalized linear RGB coordinates of a source color to CIE XYZ tristimulus values representing the same color in the CIE XYZ color space.
[0051] Using equations 1.1 and 1.2 above, the source color gamut cube and the target color gamut cube are also converted in the XYZ color space into polyhedrons having rectangular facets and in the 2D xy chromaticity plane into triangles as shown on
[0052] It is known that such a matrix (C.sub.ij).sub.i=X,Y,Z,j=R,G,B notably defined such that: [0053] A pure primary source color from the RGB color space has a single component as per ∝.fwdarw.V.sub.∝=1, and two other components β,γ.fwdarw.V.sub.γ=V.sub.β=0, with ∝,β,γ∈{R,G,B}. The luminance Y at this point is defined by the second row of the matrix: Y=1*C.sub.Yα with ∝∈{R,G,B}; [0054] Any side of color gamut triangles can be defined by two components ∝,β.fwdarw.V.sub.∝≠0, V.sub.β≠0, with the third opponent component γ.fwdarw.V.sub.γ=0. The luminance Y is then Y=V.sub.∝*C.sub.Yα+V.sub.β*C.sub.Yβ with V.sub.∝,V.sub.β∈[0,1] [0055] The luminance on the gamut side is at its maximum when the two primaries are 1: V.sub.4=V.sub.β=1.fwdarw.Y.sub.max=C.sub.Yα+C.sub.Yβ, therefore corresponding to a secondary color Cyan, Magenta or Yellow; [0056] The white point primary O has the three RGB components set to one Y=1=C.sub.YR=C.sub.YG+C.sub.YB. The gray line from black to white is orthogonal to the xy chromaticity plane in the xyY color space, and located at the point O.sub.C in the xy chromaticity plane having the following coordinates x.sub.w, y.sub.w. This line is defined by Y=ε*(C.sub.YR+C.sub.YG+C.sub.YB) with ε∈[0,1]. This gray line corresponds to a diagonal in the RGB color gamut cubes or in the XYZ color gamut polyhedrons.
2.SUP.nd .Step: Determine the xy Chromaticity Plane the Sub-Triangle of the Target Color Gamut the Source Color M to Map Belongs to:
[0057] The triangle representing the target color gamut in the 2D xy chromaticity plane is splitted into six sub-triangles, each of these sub-triangles being defined in the 2D xy chromaticity plane by the white point O.sub.C, a first primary color and a first secondary color composed of this first primary color and of another second primary color. In the 2D xy chromaticity plane, this first secondary color lies on the side of the target color gamut triangle joining these two primary colors. See
[0058] At this step, a first primary color ∝∈{R,G,B} of the target color gamut and a second primary color β∈{R,G,B} of the target color gamut are determined such as to define in the chromaticity plane the sub-triangle O-α-αβ to which the source color M.sub.C belongs, where αβ is the secondary color combining the first primary color α and the second primary color β. Such a determination is performed in a manner known per se from the position of the point M.sub.C corresponding to the source color to map M, i.e. from the coordinates x.sub.M, y.sub.M of this point M.sub.C in the chromaticity plane.
[0059] In the chromaticity plane, colors lying on the segment α-αβ of the sub-triangle O-α-αβ correspond to colors lying on half a face of the target color gamut cube, which is delimited, in the RGB color space, by the black point K, the first primary color a and the secondary color αβ.
[0060] In the RGB color space, if the color coordinates of the first primary color are [1,0,0] and of the second primary color is [0,1,0], the color coordinates of the secondary color αβ are [1,1,0]. Therefore, in the XYZ color space, the color coordinates of the first primary is X.sub.α=C.sub.Xα, Y.sub.α=C.sub.Yα and Z.sub.α=C.sub.Zα and the color coordinates of the secondary color αβ is X.sub.αβ=C.sub.Xα+C.sub.Xβ, Y.sub.αβ=C.sub.Yα+C.sub.Yβ and Z.sub.αβ=C.sub.Zα+C.sub.Zβ. In the xy chromaticity plane, the color coordinates of the first primary α is x.sub.α=C.sub.Xα/(C.sub.Xα+C.sub.Yα+C.sub.Zα) and y.sub.α=C.sub.Yα/(C.sub.Xα+C.sub.Yα+C.sub.Zα). In the xy chromaticity plane, the color coordinates of the secondary color αβ is x.sub.αβ=(C.sub.Xα+C.sub.Xβ/(C.sub.Xα+C.sub.Yα+C.sub.Zα+C.sub.Xβ+C.sub.Yβ+C.sub.Zβ) and y.sub.αβ=(C.sub.Yα+C.sub.Yβ)/(C.sub.Xα+C.sub.Yα+C.sub.Zα+C.sub.Xβ+C.sub.Yβ+C.sub.Zβ). For any color x,y lying on the segment of the sub-triangle joining the primary color α and the secondary color αβ, we have:
y=[(y.sub.αβ−y.sub.α)x+(x.sub.αβy.sub.α−x.sub.αy.sub.αβ)]/(x.sub.αβ−x.sub.α) equation 2.1
[0061] Optionally, it is possible to compute, in the xy chromaticity plane, the coordinates of intersection I′T-C of the mapping straight line O.sub.CM.sub.C with the side segment α-αβ of the determined sub-triangle.
[0062] In the xy chromaticity plane, the chromaticity point M.sub.C having x.sub.M, y.sub.M as coordinates, corresponding to the color M to map, will be mapped according to the method along a mapping straight line comprising the white point O.sub.C and this chromaticity point M.sub.C. This mapping straight line corresponds to a mapping plane in the RGB color space defined as comprising M, the white point O and the black point K. For any color x,y lying on this mapping straight line, we have:
y=[(y.sub.M−y.sub.W)x+(x.sub.My.sub.W−x.sub.My.sub.W)]/(x.sub.M−x.sub.W) equation 2.2
where, in the chromaticity plane, x.sub.W and y.sub.W are the coordinates of the chromaticity point O.sub.C corresponding to the white point O.
[0063] By combining equation 2.1 and 2.2, we get the coordinates x.sub.I′T-C, y.sub.I′T-C of the intersection I′.sub.T-C of the mapping straight line O.sub.CM.sub.C with the line α-αβ. Note that this intersection I′.sub.T-C corresponds to a line in the RGB color space which is the intersection of the sub-triangle O-α-αβ with a mapping plane MKO comprising the source color M to map, the black point K and the white point O.
3.sup.rd Step: In the Chromaticity Plane, Computing an End I.sub.T-C of a Mapping Segment.
[0064] In the RGB color space, we compute as follows the intersection I.sub.T between a face of the target color gamut cube comprising the determined primary color α (see 2.sup.nd step above), a plane of constant luminance having the luminance of the source color to map M, and the mapping plane MKO comprising the source color M to map, the black point K and the white point O.
[0065] Having determined in the second step above the first primary color α and the second primary color β defining in the chromaticity plane the sub-triangle O-α-αβ of the target color gamut to which the source color M.sub.C to map belongs, we will now consider the following two faces of the target color gamut cube in the RGB color space: [0066] a first face delimited by this first primary color α, the secondary color αβ combining this first primary color a and the second primary color β, the white point O, and a second secondary color αγ combining the first primary color α and a third still another primary color γ∈{R,G,B}, and the black point K. This first face is defined in the RGB color space by equation:
V.sub.α=1 equation 3.1 [0067] a second face delimited by the first primary color α, the black point K, the second primary color β and the first secondary color αβ. This second face is defined in the RGB color space by equation by equation
V.sub.γ=0 equation 3.2
[0068] Replacing x and y of equation 2.2 above by their values in the XYZ color space (using conversion equation 1.2), we get the equation of the mapping plane MKO in the XYZ color space. Replacing in this equation X,Y,Z by their values in the RGB color space (using conversion equation 1.1), we get the equation of the mapping plane MKO in the RGB color space. Such an equation is a linear relationship between three color coordinates V.sub.α, V.sub.β, V.sub.γ of a color (with α,β,γ∈{R,G,B}), which can be expressed as follows:
V.sub.α+p.V.sub.β−(1+p).V.sub.γ=0 equation 4
which is the equation of a plane passing though the black point K and the white point O, where p can be determined by replacing color coordinates V.sub.α, V.sub.β, V.sub.γ by X.sub.M,Y.sub.M,Z.sub.M in equation 4, i.e. by stating that M belongs to the mapping plane.
[0069] The equation of the plane having the same luminance as the luminance Y.sub.M of the source color to map is Y=Y.sub.M in the XYZ color space, or, in the RGB color space (using equation 1.1):
Y.sub.M=V.sub.Yα.V.sub.α+C.sub.Yβ.V.sub.β+C.sub.Yγ.V.sub.γ equation 5
[0070] Combining the three linear equations 3.1, 4 and 5 above, we compute the values of the color coordinates I.sub.α, I.sub.β, I.sub.γ of the intersection I.sub.T in the RGB color space. Using conversion equations 1.1 and 1.2 above, the corresponding color coordinates X.sub.I.T-C and y.sub.I.T-C of the corresponding point I.sub.T-C in the chromaticity plane are computed (see
[0071] If one of more computed values among I.sub.α, I.sub.β, I.sub.γ is negative or superior to one, it means that there is no intersection of the mapping plane MKO and of the constant luminance plane Y=Y.sub.M with the first face of the target color gamut cube. Instead, we should consider the intersection I′.sub.T of the mapping plane MKO and of the constant luminance plane Y=Y.sub.M with the second face of the target color gamut cube by combining equations 3.2, 4 and 5 above. The values of the new color coordinates I′.sub.α, I′.sub.β, I′.sub.γ of this intersection I′.sub.T in the RGB color space are then converted as above into color coordinates x.sub.I′-C and y.sub.I′T-C of the corresponding point I′.sub.T-C in the chromaticity plane (see
4.sup.th Step: In the Chromaticity Plane, Computing a Start P.sub.C of the Mapping Segment Such as to Define Said Mapping Segment P.sub.C-I.sub.T-C of the Mapping Straight Line O.sub.C-M.sub.C.
[0072] Assuming that the preserved color gamut PCG is projected as a preserved color line PCL in the chromaticity plane, a point P.sub.C corresponding to a preserved gamut boundary color P is defined as the intersection of this preserved color line PCL with the mapping straight line O.sub.CM.sub.C (see
[0073] Now, a mapping segment P.sub.CI.sub.T-C is defined on the mapping straight line O.sub.CM.sub.C such as all source colors to map that are outside the preserved color gamut PCG will be mapped within this mapping segment P.sub.CI.sub.T-C starting at P.sub.C and ending at I.sub.T-C.
[0074] According to the mapping method, all colors located within the preserved color gamut PCG are preserved.
5.SUP.th .Step: In the Chromaticity Plane, Defining a Mapping Function.
[0075] The first step above is re-iterated to compute a matrix (C.sub.ij).sub.i=X,Y,Z,j=R,G,B of the reference R, G, B, O, primaries defining the 3D source color gamut. This matrix transforms normalized linear RGB coordinates of a source color to CIE XYZ tristimulus values representing the same color in the CIE XYZ color space.
[0076] The second step above is re-iterated to determine a first primary color and a second primary color of the source color gamut SCG defining a sub-triangle to which the source color gamut M.sub.C belongs. Note that this sub-triangle may infer first or second primaries that are totally different from the first or second primaries of the target color gamut TCG.
[0077] The third step above is re-iterated to compute, in the RGB color space, the intersection I.sub.S between a face of the source color gamut cube, a plane of constant luminance having the luminance of the source color to map, and the mapping plane MKO comprising the source color M to map, the black point K and the white point O. This face of the source color gamut cube is defined as in this third step above in connection with the determined first and second primaries of the source color gamut SCG. This intersection I.sub.S corresponds to the chromatic point I.sub.S-C of the chromatic plane (see
[0078] According to the mapping method, the source point M.sub.C will now be mapped into a target point T.sub.C within the mapping segment P.sub.CI.sub.T-C, such that the distance P.sub.CT.sub.C is an homogeneous increasing function of the distance P.sub.CM.sub.C and of the ratio P.sub.CI.sub.T-C/P.sub.CI.sub.S-C. Here, this ratio is inferior to 1, resulting in a compressive mapping. Preferably, this target point T.sub.C is defined such that P.sub.CT.sub.C=P.sub.CM.sub.C×(P.sub.CI.sub.T-C/P.sub.CI.sub.S-C).
[0079] From the obtained target point T.sub.C, a corresponding target color T can be derived using the inverse of equations 1.2 and 1.1, as having the same luminance Y.sub.M as the source color M.
[0080] When using such a function, when the source color M corresponds to the preserved gamut boundary color P, the target color T corresponds indeed to the same preserved gamut boundary color P, and when the source color M corresponds to the source gamut boundary color I″.sub.S, the target color T corresponds indeed to the target gamut boundary color I″.sub.T.
CONCLUSION
[0081] All source colors that are outside the preserved color gamut are mapped according to the first to fifth step above into corresponding target colors, resulting in a color mapped image.
[0082] An advantage of the color mapping embodiment as described above is that it is reversible. It means that starting from the target colors above, source colors of the original image can be easily restored using the same mapping method, wherein the target color gamut becomes the source color gamut and the source color gamut becomes the target color gamut. Using the same method will result in as expansion mapping along the same mapping line within segments P.sub.CI″.sub.S-C (instead of P.sub.CI″.sub.T-C above).
[0083] Such an advantage is particularly useful in the context of transmission of encoded images that can be used both by SDR display and by HDR displays, for instance as disclosed in U.S. Pat. No. 8,922,720. Starting from HDR images, it is known to tone-map them into SDR images before transmission. On the reception side, when receiving such tone-mapped SDR images, when needed for a HDR display, it becomes possible to restore the original HDR images by inverse-tone mapping the received SDR images, using the inverse of the tone-mapping performed on the emitter side.
[0084] Although the illustrative embodiments of the invention have been described herein with reference to the accompanying drawings, it is to be understood that the present invention is not limited to those precise embodiments, and that various changes and modifications may be effected therein by one of ordinary skill in the pertinent art without departing from the invention. All such changes and modifications are intended to be included within the scope of the present invention as set forth in the appended claims. The present invention as claimed therefore includes variations from the particular examples and preferred embodiments described herein, as will be apparent to one of skill in the art.
[0085] While some of the specific embodiments may be described and claimed separately, it is understood that the various features of embodiments described and claimed herein may be used in combination. Reference numerals appearing in the claims are by way of illustration only and shall have no limiting effect on the scope of the claims.