Real-Time Rendering——8.1.3 Colorimetry比色法

In Section 8.1.1 we have seen that our perception of the color of light is strongly connected to the light’s SPD (spectral power distribution). We also saw that this is not a simple one-to-one correspondence. The bottom and middle SPDs in Figure 8.3 are completely different yet are perceived as the exact same color. Colorimetry deals with the relationship between spectral power distributions and the perception of color.

在第8.1.1节中,我们已经看到,我们对光的颜色的感知与光的SPD(光谱功率分布)密切相关。我们也看到了这不是简单的一一对应。图8.3中底部和中间的SPD完全不同,但被认为是完全相同的颜色。色度学研究光谱能量分布和颜色感知之间的关系。

Humans can distinguish about 10 million different colors. For color perception, the eye works by having three different types of cone receptors in the retina, with each type of receptor responding differently to various wavelengths. Other animals have varying numbers of color receptors, in some cases as many as fifteen [260]. So, for a given SPD, our brain receives only three different signals from these receptors. This is why just three numbers can be used to precisely represent any color stimulus [1707].

人类可以分辨大约一千万种不同的颜色。对于颜色感知,眼睛通过视网膜中的三种不同类型的视锥受体来工作,每种类型的受体对不同的波长有不同的反应。其他动物有不同数量的颜色感受器,在某些情况下多达15个[260]。因此,对于给定的SPD,我们的大脑只从这些受体接收三种不同的信号。这就是为什么只有三个数字可以用来精确地表示任何颜色刺激[1707]。

But what three numbers? A set of standard conditions for measuring color was proposed by the CIE (Commission Internationale d’Eclairage), and color-matching experiments were performed using them. In color matching, three colored lights are projected on a white screen so that their colors add together and form a patch. A test color to match is projected next to this patch. The test color patch is of a single wavelength. The observer can then change the three colored lights using knobs calibrated to a range weighted [−1, 1] until the test color is matched. A negative weight is needed to match some test colors, and such a weight means that the corresponding light is added instead to the wavelength’s test color patch. One set of test results for three lights, called r, g, and b, is shown in Figure 8.5. The lights were almost monochromatic, with the energy distribution of each narrowly clustered around one of the following wavelengths: 645 nm for r, 526 nm for g, and 444 nm for b. The functions relating each set of matching weights to the test patch wavelengths are called color-matching functions.

但是哪三个数字?CIE(Commission international e d ' eclairage)提出了一套测量颜色的标准条件,并利用这些标准条件进行了配色实验。在颜色匹配中,三种颜色的光被投射在白色屏幕上,这样它们的颜色就加在一起,形成一个补丁。要匹配的测试颜色被投影到该补丁的旁边。测试色标是单一波长的。然后,观察者可以使用校准到加权范围[1,1]的旋钮改变三种颜色的灯,直到测试颜色匹配。需要负权重来匹配某些测试颜色,这样的权重意味着相应的光被添加到该波长的测试色标中。图8.5显示了三种灯的一组测试结果,称为r、g和b。这些光几乎都是单色的,每个光的能量分布都集中在以下波长附近:r波长为645纳米,g波长为526纳米,b波长为444纳米。将每组匹配权重与测试片波长相关联的函数称为颜色匹配函数。

Figure 8.5. The r, g, and b 2-degree color-matching curves, from Stiles and Burch [1703]. These color-matching curves are not to be confused with the spectral distributions of the light sources used in the color-matching experiment, which are pure wavelengths. 

图8.5。来自Stiles和Burch [1703]的r、g和b 2度颜色匹配曲线。这些颜色匹配曲线不要与颜色匹配实验中使用的光源的光谱分布混淆,后者是纯波长。

What these functions give is a way to convert a spectral power distribution to three values. Given a single wavelength of light, the three colored light settings can be read off the graph, the knobs set, and lighting conditions created that will give an identical sensation from both patches of light on the screen. For an arbitrary spectral distribution, the color-matching functions can be multiplied by the distribution and the area under each resulting curve (i.e., the integral) gives the relative amounts to set the colored lights to match the perceived color produced by the spectrum.Considerably different spectral distributions can resolve to the same three weights,i.e., they look the same to an observer. Spectral distributions that give matching weights are called metamers.

这些函数提供了一种将光谱功率分布转换为三个值的方法。给定单一波长的光,可以从图表中读取三种颜色的光设置,设置旋钮,并创建照明条件,使屏幕上的两块光产生相同的感觉。对于任意光谱分布,颜色匹配函数可以乘以该分布,并且每个所得曲线下的面积(即积分)给出了相对量,以设置彩色光来匹配由光谱产生的感知颜色。相当不同的光谱分布可以解析为相同的三个权重,即,对于观察者来说它们看起来是相同的。给出匹配权重的光谱分布称为条件等色。

The three weighted r, g, and b lights cannot directly represent all visible colors,as their color-matching functions have negative weights for various wavelengths. The CIE proposed three different hypothetical light sources with color-matching functions that are positive for all visible wavelengths. These curves are linear combinations of the original r, g, and b color-matching functions. This requires their spectral power distributions of the light sources to be negative at some wavelengths, so these lights are unrealizable mathematical abstractions. Their color-matching functions are denoted x(λ), y(λ), and z(λ), and are shown in Figure 8.6. The color-matching function y(λ) is the same as the photometric curve (Figure 8.4), as radiance is converted to luminance with this curve.

三种加权的r、g和b光不能直接表示所有可见的颜色,因为它们的颜色匹配函数对于不同的波长具有负的权重。CIE提出了三种不同的假设光源,其颜色匹配功能对于所有可见波长都是积极的。这些曲线是原始r、g和b颜色匹配函数的线性组合。这要求它们的光源的光谱功率分布在某些波长上是负的,所以这些光是不可实现的数学抽象。它们的颜色匹配函数表示为x(λ)、y(λ)和z(λ),如图8.6所示。颜色匹配函数y(λ)与光度曲线(图8.4)相同,因为辐射亮度通过该曲线转换为亮度。

Figure 8.6. The Judd-Vos-modified CIE (1978) 2-degree color-matching functions. Note that the two x’s are part of the same curve. 

图8.6。Judd-Vos修改的CIE (1978) 2度颜色匹配函数。请注意,两个x是同一条曲线的一部分。

As with the previous set of color-matching functions, x(λ), y(λ), and z(λ) are used to reduce any SPD s(λ) to three numbers via multiplication and integration:

与上一组颜色匹配函数一样,使用了x(λ)、y(λ)和z(λ) 通过乘法和积分将任何SPD(λ)减少到三个数:

These X, Y , and Z tristimulus values are weights that define a color in CIE XYZ space. It is often convenient to separate colors into luminance (brightness) and chromaticity.Chromaticity is the character of a color independent of its brightness. For example, two shades of blue, one dark and one light, can have the same chromaticity despite differing in luminance. 

这些X、Y和Z三色值是在CIE XYZ空间中定义颜色的权重。将颜色分为亮度和色度通常很方便。色度是一种颜色的特性,与它的亮度无关。例如,两种蓝色,一种暗,一种亮,尽管亮度不同,但可以具有相同的色度。

For this purpose, the CIE defined a two-dimensional chromaticity space by projecting colors onto the X+Y +Z = 1 plane. See Figure 8.7. Coordinates in this space are called x and y, and are computed as follows:

为此,CIE通过将颜色投影到X+Y +Z = 1平面上来定义二维色度空间。参见图8.7。该空间中的坐标称为x和y,计算如下:

The z value gives no additional information, so it is normally omitted. The plot of the chromaticity coordinates x and y values is known as the CIE 1931 chromaticity diagram. See Figure 8.8. The curved outline in the diagram shows where the colors of the visible spectrum lie, and the straight line connecting the ends of the spectrum is called the purple line. The black dot shows the chromaticity of illuminant D65, which is a frequently used white point—a chromaticity used to define the white or achromatic (colorless) stimulus.

z值没有给出额外的信息,所以通常被忽略。色度坐标x和y值的曲线被称为CIE 1931色度图。参见图8.8。图中的曲线轮廓显示了可见光谱的颜色,连接光谱两端的直线称为紫线。黑点显示了光源D65的色度,这是一个经常使用的白点,用于定义白色或无色(无色)刺激的色度。

Figure 8.7. The RGB color cube for the CIE RGB primaries is shown in XYZ space, along with its projection (in violet) onto the X + Y + Z = 1 plane. The blue outline encloses the space of possible chromaticity values. Each line radiating from the origin has a constant chromaticity value, varying only in luminance. 

图8.7。CIE RGB原色的RGB颜色立方体及其在X + Y + Z = 1平面上的投影(紫色)显示在XYZ空间中。蓝色轮廓包围了可能色度值的空间。从原点辐射的每条线都有一个恒定的色度值,只是亮度不同。

Figure 8.8. The CIE 1931 chromaticity diagram. The curve is labeled with the wavelengths of the corresponding pure colors. The white triangle and black dot show the gamut and white point,respectively, used for the sRGB and Rec. 709 color spaces. 

图8.8。CIE 1931色度图。曲线标有相应纯色的波长。白色三角形和黑点分别显示用于sRGB和Rec的色域和白点。709个颜色空间。

To summarize, we began with an experiment that used three single-wavelength lights and measured how much of each was needed to match the appearance of some other wavelength of light. Sometimes these pure lights had to be added to the sample being viewed in order to match. This gave one set of color-matching functions, which were combined to create a new set without negative values. With this non-negative set of color-matching functions in hand, we can convert any spectral distribution to an XYZ coordinate that defines a color’s chromaticity and luminance, which can be reduced to xy to describe just the chromaticity, keeping luminance constant.

总而言之,我们从一个实验开始,使用三种单一波长的光,并测量每种光需要多少才能与其他波长的光相匹配。有时,为了匹配,这些纯光必须添加到被观察的样本中。这给出了一组颜色匹配函数,它们被组合起来创建一个没有负值的新集合。有了这组非负的颜色匹配函数,我们可以将任何光谱分布转换为定义颜色色度和亮度的XYZ坐标,该坐标可以简化为xy来描述色度,同时保持亮度不变。

Given a color point (x, y), draw a line from the white point through this point to the boundary (spectral or purple line). The relative distance of the color point compared to the distance to the edge of the region is the excitation purity of the color.The point on the region edge defines the dominant wavelength. These colorimetric terms are rarely encountered in graphics. Instead, we use saturation and hue, which correlate loosely with excitation purity and dominant wavelength, respectively. More precise definitions of saturation and hue can be found in books by Stone [1706] and others [456, 789, 1934].

给定一个色点(x,y),从白点通过该点到边界画一条线(光谱或紫色线)。与到区域边缘的距离相比,色点的相对距离是颜色的激发纯度。区域边缘上的点定义了主波长。这些比色术语在图形中很少遇到。相反,我们使用饱和度和色调,它们分别与激发纯度和主波长松散相关。饱和度和色调的更精确定义可以在Stone [1706]和其他人[456,789,1934]的书中找到。

The chromaticity diagram describes a plane. The third dimension needed to fully describe a color is the Y value, luminance. These then define what is called the xyY -coordinate system. The chromaticity diagram is important in understanding how color is used in rendering, and the limits of the rendering system. A television or computer monitor presents colors by using some settings of R, G, and B color values. Each color channel controls a display primary that emits light with a particular spectral power distribution. Each of the three primaries is scaled by its respective color value, and these are added together to create a single spectral power distribution that the viewer perceives.

色度图描述了一个平面。全面描述颜色所需的第三个维度是Y值,即亮度。这些定义了所谓的xyY坐标系。色度图对于理解如何在渲染中使用颜色以及渲染系统的限制非常重要。电视或计算机显示器通过使用R、G和B颜色值的一些设置来呈现颜色。每个颜色通道控制发射具有特定光谱功率分布的光的显示原色。三原色中的每一种都根据其各自的颜色值进行缩放,并且这些颜色值被加在一起以创建观察者感知的单个光谱功率分布。

The triangle in the chromaticity diagram represents the gamut of a typical television or computer monitor. The three corners of the triangle are the primaries, which are the most saturated red, green, and blue colors the screen can display. An important property of the chromaticity diagram is that these limiting colors can be joined by straight lines to show the limits of the display system as a whole. The straight lines represent the limits of colors that can be displayed by mixing these three primaries.The white point represents the chromaticity that is produced by the display system when the R, G, and B color values are equal to each other. It is important to note that the full gamut of a display system is a three-dimensional volume. The chromaticity diagram shows only the projection of this volume onto a two-dimensional plane. See Stone’s book [1706] for more information.

色度图中的三角形代表典型电视或计算机显示器的色域。三角形的三个角是原色,是屏幕可以显示的最饱和的红色、绿色和蓝色。色度图的一个重要特性是,这些极限颜色可以用直线连接起来,以显示整个显示系统的极限。这些直线代表通过混合这三种原色可以显示的颜色的界限。白点表示当R、G和B颜色值彼此相等时由显示系统产生的色度。重要的是要注意,显示系统的全色域是三维体积。色度图只显示了该体积在二维平面上的投影。更多信息见斯通的书[1706]。

There are several RGB spaces of interest in rendering, each defined by R, G,and B primaries and a white point. To compare them we will use a different type of chromaticity diagram, called the CIE 1976 UCS (uniform chromaticity scale) diagram.This diagram is part of the CIELUV color space, which was adopted by the CIE (along with another color space, CIELAB) with the intention of providing more perceptually uniform alternatives to the XYZ space [1707]. Color pairs that are perceptibly different by the same amount can be up to 20 times different in distance in CIE XYZ space.CIELUV improves upon this, bringing the ratio down to a maximum of four times.This increased perceptual uniformity makes the 1976 diagram much better than the 1931 one for the purpose of comparing the gamuts of RGB spaces. Continued research into perceptually uniform color spaces has recently resulted in the ICTCP [364] and Jzazbz [1527] spaces. These color spaces are more perceptually uniform than CIELUV,especially for the high luminance and saturated colors typical of modern displays.However, chromaticity diagrams based on these color spaces have not yet been widely adopted, so we use the CIE 1976 UCS diagrams in this chapter, for example in the case of Figure 8.9.

渲染中有几个感兴趣的RGB空间,每个空间由R、G和B原色以及一个白点定义。为了比较它们,我们将使用不同类型的色度图,称为CIE 1976 UCS(均匀色度标度)图。该图是CIELUV颜色空间的一部分,CIE(连同另一个颜色空间CIELAB)采用该颜色空间的目的是为XYZ空间[1707]提供更一致的感知选择。在CIE XYZ空间中,感觉上相差相同量的颜色对在距离上可以相差多达20倍。CIELUV在此基础上进行了改进,将比率降低到最大值的四倍。为了比较RGB空间的色域,这种增加的感知一致性使得1976年的图比1931年的图好得多。对感知均匀色彩空间的持续研究最近产生了ICTCP [364]和Jzazbz [1527]空间。这些色彩空间在感觉上比CIELUV更均匀,特别是对于现代显示器典型的高亮度和饱和色。然而,基于这些颜色空间的色度图尚未被广泛采用,所以我们在本章中使用CIE 1976 UCS图,例如图8.9的情况。

Figure 8.9. A CIE 1976 UCS diagram showing the primaries and white points of three RGB color spaces: sRGB, DCI-P3, and ACEScg. The sRGB plot can be used for Rec. 709 as well, since the two color spaces have the same primaries and white point. 

图8.9。CIE 1976 UCS图表,显示三种RGB颜色空间的原色和白点:sRGB、DCI-P3和ACEScg。sRGB图可用于Rec.709,因为这两个色彩空间具有相同的原色和白点。

Of the three RGB spaces shown in Figure 8.9, sRGB is by far the most commonly used in real-time rendering. It is important to note that in this section we use “sRGB color space” to refer to a linear color space that has the sRGB primaries and white point, and not to the nonlinear sRGB color encoding that was discussed in Section 5.6.Most computer monitors are designed for the sRGB color space, and the same primaries and white point apply to the Rec. 709 color space as well, which is used for HDTV displays and thus is important for game consoles. However, more displays are being made with wider gamuts. Some computer monitors intended for photo editing use the Adobe 1998 color space (not shown). The DCI-P3 color space—initially developed for feature film production—is seeing broader use. Apple has adopted this color space across their product line from iPhones to Macs, and other manufacturers have been following suit. Although ultra-high definition (UHD) content and displays are specified to use the extremely-wide-gamut Rec. 2020 color space, in many cases DCI-P3 is used as a de facto color space for UHD as well. Rec. 2020 is not shown in Figure 8.9,but its gamut is quite close to that of the third color space in the figure,ACEScg. The ACEScg color space was developed by the Academy of Motion Picture Arts and Sciences (AMPAS) for feature film computer graphics rendering. It is not intended for use as a display color space, but rather as a working color space for rendering, with colors converted to the appropriate display color space after rendering.

在图8.9所示的三个RGB空间中,sRGB是实时渲染中最常用的。值得注意的是,在本节中,我们使用“sRGB色彩空间”来指代具有sRGB原色和白点的线性色彩空间,而不是第5.6节中讨论的非线性sRGB色彩编码。大多数计算机显示器都是为sRGB色彩空间设计的,相同的原色和白点也适用于Rec.709色彩空间,用于HDTV显示器,因此对游戏控制台很重要。然而,越来越多的显示器采用了更宽的色域。一些用于照片编辑的计算机显示器使用Adobe 1998色彩空间(未示出)。DCI-P3色彩空间——最初是为故事片制作而开发的——正得到越来越广泛的应用。苹果已经在从iPhones到MAC的产品线中采用了这种色彩空间,其他制造商也在效仿。尽管超高清(UHD)内容和显示器被指定使用极宽色域的Rec。2020色彩空间,在许多情况下,DCI-P3也用作UHD的实际色彩空间。建议。2020在图8.9中没有显示,但是它的色域与图中第三个颜色空间ACEScg的色域相当接近。ACEScg色彩空间由美国电影艺术与科学学院(AMPAS)开发,用于电影计算机图形渲染。它不是用作显示颜色空间,而是用作渲染的工作颜色空间,渲染后颜色会转换到适当的显示颜色空间。

While currently the sRGB color space is ubiquitous in real-time rendering, the use of wider color spaces is likely to increase. The most immediate benefit is for applications targeting wide-gamut displays [672], but there are advantages even for applications targeting sRGB or Rec. 709 displays. Routine rendering operations such as multiplication give different results when performed in different color spaces [672,1117], and there is evidence that performing these operations in the DCI-P3 or ACEScg space produces more accurate results than performing them in linear sRGB space [660,975, 1118].

虽然目前sRGB色彩空间在实时渲染中无处不在,但更宽色彩空间的使用可能会增加。最直接的好处是针对宽色域显示器的应用[672],但即使是针对sRGB或Rec.709显示器的应用也有优势。当在不同的颜色空间中执行时,诸如乘法的常规渲染操作给出不同的结果[672,1117],并且有证据表明在DCI-P3或ACEScg空间中执行这些操作比在线性sRGB空间中执行它们产生更精确的结果[660,975,1118]。

Conversion from an RGB space to XYZ space is linear and can be done with a matrix derived from the RGB space’s primaries and white point [1048]. Via matrix inversion and concatenation, matrices can be derived to convert from XYZ to any RGB space, or between two different RGB spaces. Note that after such a conversion the RGB values may be negative or greater than one. These are colors that are out of gamut, i.e., not reproducible in the target RGB space. Various methods can be used to map such colors into the target RGB gamut [785, 1241].

从RGB空间到XYZ空间的转换是线性的,并且可以通过从RGB空间的原色和白点导出的矩阵来完成[1048]。通过矩阵求逆和连接,矩阵可以被导出以从XYZ转换到任何RGB空间,或者在两个不同的RGB空间之间转换。注意,在这样的转换之后,RGB值可能是负的或者大于1。这些是色域之外的颜色,即在目标RGB空间中不可再现的颜色。可以使用各种方法将这些颜色映射到目标RGB色域[785,1241]。

One often-used conversion is to transform an RGB color to a grayscale luminance value. Since luminance is the same as the Y coefficient, this operation is just the “Y part” of the RGB-to-XYZ conversion. In other words, it is a dot product between the RGB coefficients and the middle row of the RGB-to-XYZ matrix. In the case of the sRGB and Rec. 709 spaces, the equation is [1704]

一种常用的转换是将RGB颜色转换为灰度亮度值。由于亮度与Y系数相同,因此该操作只是RGB到XYZ转换的“Y部分”。换句话说,它是RGB系数和RGB到XYZ矩阵中间一行的点积。在sRGB和Rec.709空间,等式是[1704]

This brings us again to the photometric curve, shown in Figure 8.4 on page 271.This curve, representing how a standard observer’s eye responds to light of various wavelengths, is multiplied by the spectral power distributions of the three primaries,and each resulting curve is integrated. The three resulting weights are what form the luminance equation above. The reason that a grayscale intensity value is not equal parts red, green, and blue is because the eye has a different sensitivity to various wavelengths of light.

这又把我们带到光度曲线上,如图8.4所示。这条曲线代表了标准观察者的眼睛对各种波长的光的反应,乘以三原色的光谱功率分布,然后对每条曲线进行积分。三个结果权重形成了上面的亮度等式。灰度强度值不等于红色、绿色和蓝色的原因是因为眼睛对不同波长的光有不同的敏感度。

Colorimetry can tell us whether two color stimuli match, but it cannot predict their appearance. The appearance of a given XYZ color stimulus depends heavily on factors such as the lighting, surrounding colors, and previous conditions. Color appearance models (CAM) such as CIECAM02 attempt to deal with these issues and predict the final color appearance [456].

色度学可以告诉我们两种颜色刺激是否匹配,但它不能预测它们的外观。给定的XYZ颜色刺激的外观在很大程度上取决于诸如照明、周围颜色和先前条件的因素。色貌模型(CAM)如CIECAM02试图处理这些问题并预测最终色貌[456]。

Color appearance modeling is part of the wider field of visual perception, which includes effects such as masking [468]. This is where a high-frequency, high-contrast pattern laid on an object tends to hide flaws. In other words, a texture such as a Persian rug will help disguise color banding and other shading artifacts, meaning that less rendering effort needs to be expended for such surfaces.

颜色外观建模是更广泛的视觉感知领域的一部分,包括掩蔽等效果[468]。这是放置在物体上的高频率、高对比度图案倾向于隐藏瑕疵的地方。换句话说,像波斯地毯这样的纹理将有助于掩饰色带和其他阴影伪像,这意味着这种表面需要较少的渲染工作。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

椰子糖莫莫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值