gamma校正什么意思_伽马校正系数

gamma校正什么意思_伽马校正系数UNDERSTANDINGGAMMACORRECTIONGammaisanimportantbutseldomunderstoodcharacteristicofvirtuallyalldigitalimagingsystems.Itdefinestherelationshipbetweenapixel’snumericalvalueand

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

UNDERSTANDING GAMMA CORRECTION

Gamma is an important but seldom understood characteristic of virtually all digital imaging systems. It defines the relationship between a pixel’s numerical value and its actual luminance. Without gamma, shades captured by digital cameras wouldn’t appear as they did to our eyes (on a standard monitor). It’s also referred to as gamma correction, gamma encoding or gamma compression, but these all refer to a similar concept. Understanding how gamma works can improve one’s exposure technique, in addition to helping one make the most of image editing.

gamma在数字图像系统中是一个很重要的概念或者说特性,但是却又很少有人理解。它定义了像素数值和真是亮度之间的关系。没有gamma,有数字摄像机捕捉到的明暗变化将不会是人眼看到的情况(标准显示器上显示的)。gamma 又叫做gamma correction,gamma编码或gamma压缩,这些都指的是同一个概念。理解了gamma的原理将会帮助人们调高曝光调节技术,而且能够帮助我们更好地利用图片编辑。

WHY GAMMA IS USEFUL

1. Our eyes do not perceive light the way cameras do. With a digital camera, when twice the number of photons hit the sensor, it receives twice the signal (a “linear” relationship). Pretty logical, right? That’s not how our eyes work. Instead, we perceive twice the light as being only a fraction brighter — and increasingly so for higher light intensities (a “nonlinear” relationship).

1.人眼和摄像机感知光线的原理是不一样的。对于摄像机:当有两倍的光线(光子)照射的时候,传感器将会感知到两倍的信号(线性关系)。正确的逻辑,对吧。但是这并不是人眼的的方式:当我们感知到有两倍的强度变化时,此时可能仅仅有一点点亮度变化。而且对于亮度的变化,人眼的感知是一直这样增长的。

linear vs nonlinear gamma - cameras vs human eyes   gamma校正什么意思_伽马校正系数
Reference Tone
gamma校正什么意思_伽马校正系数
Perceived as 50% as Bright
by Our Eyes
Detected as 50% as Bright
by the Camera

Refer to the tutorial on the photoshop curves tool if you’re having trouble interpreting the graph.
Accuracy of comparison depends on having a well-calibrated monitor set to a display gamma of 2.2.
Actual perception will depend on viewing conditions, and may be affected by other nearby tones.
For extremely dim scenes, such as under starlight, our eyes begin to see linearly like cameras do.

Compared to a camera, we are much more sensitive to changes in dark tones than we are to similar changes in bright tones. There’s a biological reason for this peculiarity: it enables our vision to operate over a broader range of luminance. Otherwise the typical range in brightness we encounter outdoors would be too overwhelming.

和摄像机相比,人眼对暗色变化的感知要强于同等变化的亮色。也就是说人眼对于暗色的变化更加敏感。对于这种特性有着生物学的解释。使得人眼能够感知更宽的亮度范围。

But how does all of this relate to gamma? In this case, gamma is what translates between our eye’s light sensitivity and that of the camera. When a digital image is saved, it’s therefore “gamma encoded” — so that twice the value in a file more closely corresponds to what we would perceive as being twice as bright.

但是,这些怎么和gamma关联上呢?在这种情况下,gamma是转换人眼感光度和摄像机感光度之间的桥梁。当保存了一张数字图像,那么它就已经比gamma矫正过了—此时提高两倍图像文件的亮度人眼便会感知到有两倍的亮度增强。

Technical Note: Gamma is defined by Vout = Vingamma , where Vout is the output luminance value and Vin is the input/actual luminance value. This formula causes the blue line above to curve. When gamma<1, the line arches upward, whereas the opposite occurs with gamma>1.

注意:gamma的定义是:vout=vin**gamma,vout是亮度的输出值,vin是亮度的输入(实际采集到的值)。这个就是引起上图蓝线的原因。当gamma<1,曲线呈上拱形。

2. Gamma encoded images store tones more efficiently. Since gamma encoding redistributes tonal levels closer to how our eyes perceive them, fewer bits are needed to describe a given tonal range. Otherwise, an excess of bits would be devoted to describe the brighter tones (where the camera is relatively more sensitive), and a shortage of bits would be left to describe the darker tones (where the camera is relatively less sensitive):

2. gamma编码的图像能够更搞笑的保存色度。由于gamma编码重新分布的色度等级更加接近于人眼的感知,而且只需要较少的比特来表达色度范围。另一方面,额外的一些bit被用来表达较亮的色度(摄像机对于较亮的颜色较为敏感)。较少的bit被用来描述较暗的色调(摄像机对于暗色度不敏感)。

Original: smooth 8-bit gradient (256 levels)
   Encoded using only 32 levels (5 bits)
Linear
Encoding:
linearly encoded gradient
Gamma
Encoding:
gamma encoded gradient

Note: Above gamma encoded gradient shown using a standard value of 1/2.2
See the tutorial on bit depth for a background on the relationship between levels and bits.

Notice how the linear encoding uses insufficient levels to describe the dark tones — even though this leads to an excess of levels to describe the bright tones. On the other hand, the gamma encoded gradient distributes the tones roughly evenly across the entire range (“perceptually uniform”). This also ensures that subsequent image editing, color andhistograms are all based on natural, perceptually uniform tones.

注意,线性编码采用了较少的bit来描述低色度–这样会使得有更多的比特来描述高色度。另一方面,gamma编码的梯度分布几乎是在整个色度空间的均匀分布(人眼感知均匀的)。这就保证了后续的图像编辑等工作。彩色,直方图都会基于这种自然地感知均匀分布的色度。

However, real-world images typically have at least 256 levels (8 bits), which is enough to make tones appear smooth and continuous in a print. If linear encoding were used instead, 8X as many levels (11 bits) would’ve been required to avoid image posterization.

然而,真实世界的图像最少采用256维的分级(8比特),这足以保证色度在打印时表现的光滑和连续了。如果采用了线性编码,将需要更多的分级(一般是11比特)来描述图片,因为只有更多的分级才能够避免图像高反差色调。

GAMMA WORKFLOW: ENCODING & CORRECTION

Despite all of these benefits, gamma encoding adds a layer of complexity to the whole process of recording and displaying images. The next step is where most people get confused, so take this part slowly. A gamma encoded image has to have “gamma correction” applied when it is viewed — which effectively converts it back into light from the original scene. In other words, the purpose of gamma encoding is for recording the image — not for displaying the image. Fortunately this second step (the “display gamma”) is automatically performed by your monitor and video card. The following diagram illustrates how all of this fits together:

尽管有这样的好处,但是gamma编码还是给图像的处理过程中带来了一定复杂性(在记录和表达图片的时候)。下一步将会是很多人困惑的地方,因此讲慢一点。通过gamma编码后的图片必须经过gamma校正才能够被浏览—指的是将它翻转回原来的原始场景色度(光照)。也就是说,gamma编码的过程是为了记录图片(保存图片)而不是显示图片。幸运的是,第二步(显示图片)是自动的有你的显示器或视频卡来完成的。

RAW Camera Image is Saved as a JPEG File   JPEG is Viewed on a Computer Monitor   Net Effect
image file gamma + display gamma = system gamma
1. Image File Gamma   2. Display Gamma   3. System Gamma

1. Depicts an image in the sRGB color space (which encodes using a gamma of approx. 1/2.2).
2. Depicts a display gamma equal to the standard of 2.2

1. Image Gamma. This is applied either by your camera or RAW development software whenever a captured image is converted into a standard JPEG or TIFF file. It redistributes native camera tonal levels into ones which are more perceptually uniform, thereby making the most efficient use of a given bit depth.

1.图片gamma。这个步骤是通过你的摄像机或其他原始开发软件将一个被设备捕获到的图片转化为标准JPEG或TIFF时完成的。这个过程主要是重新分布摄像机的色度等级,得到更加感知均匀的分布,以此充分的利用给定的位深。

2. Display Gamma. This refers to the net influence of your video card and display device, so it may in fact be comprised of several gammas. The main purpose of the display gamma is to compensate for a file’s gamma — thereby ensuring that the image isn’t unrealistically brightened when displayed on your screen. A higher display gamma results in a darker image with greater contrast.

2.显示gamma。这个单指视频卡或者显示设备的影响,因此事实上这个步骤包括了很多个gamma。显示gamma主要目的是步长图片文件的gamma值—顺便保证在你显示器上显示的图片的亮度是稳定可靠的。越高的显示gamma会导致更高的对比度和更暗的图片。

3. System Gamma. This represents the net effect of all gamma values that have been applied to an image, and is also referred to as the “viewing gamma.” For faithful reproduction of a scene, this should ideally be close to a straight line (gamma = 1.0). A straight line ensures that the input (the original scene) is the same as the output (the light displayed on your screen or in a print). However, the system gamma is sometimes set slightly greater than 1.0 in order to improve contrast. This can help compensate for limitations due to the dynamic range of a display device, or due to non-ideal viewing conditions and image flare.

3.系统gamma.指的是所有gamma对图片的净影响,系统gamma同样指的是viewing gamma(显示gamma).如果要准确可靠地重现场景,这个gamma应该最好接近于直线(gamma=1.0)。直线的话能够保证输入(原始场景)和输出(你显示器或者屏幕或者打印的效果)是一样的。然而,通常情况,系统gamma的设置会略高于1.0以此来增强对比度。这有助于帮助补偿显示设备的动态范围的限制,或非理想视觉条件或图像耀斑~

IMAGE FILE GAMMA

The precise image gamma is usually specified by a color profile that is embedded within the file. Most image files use an encoding gamma of 1/2.2 (such as those using sRGB and Adobe RGB 1998 color), but the big exception is with RAW files, which use a linear gamma. However, RAW image viewers typically show these presuming a standard encoding gamma of 1/2.2, since they would otherwise appear too dark:

图片文件的gamma通常是由内置在文件中的color profile指定的。大多数图片文件使用gamma编码1/2.2(使用sRGB和Adobe RGB1998 色彩空间),但是在原始文件中却大多使用线性gamma。

linear RAW
Linear RAW Image
(image gamma = 1.0)

gamma encoded sRGB image
Gamma Encoded Image
(image gamma = 1/2.2)

If no color profile is embedded, then a standard gamma of 1/2.2 is usually assumed. Files without an embedded color profile typically include many PNG and GIF files, in addition to some JPEG images that were created using a “save for the web” setting.

Technical Note on Camera Gamma. Most digital cameras record light linearly, so their gamma is assumed to be 1.0, but near the extreme shadows and highlights this may not hold true. In that case, the file gamma may represent a combination of the encoding gamma and the camera’s gamma. However, the camera’s gamma is usually negligible by comparison. Camera manufacturers might also apply subtle tonal curves, which can also impact a file’s gamma.


DISPLAY GAMMA

This is the gamma that you are controlling when you perform monitor calibration and adjust your contrast setting. Fortunately, the industry has converged on a standard display gamma of 2.2, so one doesn’t need to worry about the pros/cons of different values. Older macintosh computers used a display gamma of 1.8, which made non-mac images appear brighter relative to a typical PC, but this is no longer the case.

Recall that the display gamma compensates for the image file’s gamma, and that the net result of this compensation is the system/overall gamma. For a standard gamma encoded image file (), changing the display gamma () will therefore have the following overall impact () on an image:

gamma curves chart with a display gamma of 1.0 


Display Gamma 1.0 
Gamma 1.0

gamma curves chart with a display gamma of 1.8 


Display Gamma 1.8 
Gamma 1.8

gamma curves chart with a display gamma of 2.2 


Display Gamma 2.2 
Gamma 2.2

gamma curves chart with a display gamma of 4.0 


Display Gamma 4.0 
Gamma 4.0

Diagrams assume that your display has been calibrated to a standard gamma of 2.2.
Recall from before that the image file gamma () plus the display gamma () equals the overall system gamma (). Also note how higher gamma values cause the red curve to bend downward.

If you’re having trouble following the above charts, don’t despair! It’s a good idea to first have an understanding of how tonal curves impact image brightness and contrast. Otherwise you can just look at the portrait images for a qualitative understanding.

How to interpret the charts. The first picture (far left) gets brightened substantially because the image gamma () is uncorrected by the display gamma (), resulting in an overall system gamma () that curves upward. In the second picture, the display gamma doesn’t fully correct for the image file gamma, resulting in an overall system gamma that still curves upward a little (and therefore still brightens the image slightly). In the third picture, the display gamma exactly corrects the image gamma, resulting in an overall linear system gamma. Finally, in the fourth picture the display gamma over-compensates for the image gamma, resulting in an overall system gamma that curves downward (thereby darkening the image).

The overall display gamma is actually comprised of (i) the native monitor/LCD gamma and (ii) any gamma corrections applied within the display itself or by the video card. However, the effect of each is highly dependent on the type of display device.

CRT Monitor   LCD Monitor
CRT Monitors LCD (Flat Panel) Monitors

CRT Monitors. Due to an odd bit of engineering luck, the native gamma of a CRT is 2.5 — almost the inverse of our eyes. Values from a gamma-encoded file could therefore be sent straight to the screen and they would automatically be corrected and appear nearly OK. However, a small gamma correction of ~1/1.1 needs to be applied to achieve an overall display gamma of 2.2. This is usually already set by the manufacturer’s default settings, but can also be set during monitor calibration.

LCD Monitors. LCD monitors weren’t so fortunate; ensuring an overall display gamma of 2.2 often requires substantial corrections, and they are also much less consistent than CRT’s. LCDs therefore require something called a look-up table (LUT) in order to ensure that input values are depicted using the intended display gamma (amongst other things). See the tutorial on monitor calibration: look-up tables for more on this topic.

Technical Note: The display gamma can be a little confusing because this term is often used interchangeably with gamma correction, since it corrects for the file gamma. However, the values given for each are not always equivalent. Gamma correction is sometimes specified in terms of the encoding gamma that it aims to compensate for — not the actual gamma that is applied. For example, the actual gamma applied with a “gamma correction of 1.5” is often equal to 1/1.5, since a gamma of 1/1.5 cancels a gamma of 1.5 (1.5 * 1/1.5 = 1.0). A higher gamma correction value might therefore brighten the image (the opposite of a higher display gamma).

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/190861.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • ZendOptimizer怎么安装?Php网站打开显示乱码

    ZendOptimizer怎么安装?Php网站打开显示乱码

    2021年10月10日
  • vdbench数据校验翻译

    vdbench数据校验翻译本文翻译自vdbench的使用手册中的数据校验章节,如有纰漏,还请不吝赐教。vdbench源码下载地址:https://www.oracle.com/downloads/server-storage/vdbench-source-downloads.html数据校验在性能测试的时候不应该被使用,处理器开销可能影响性能测试的结果。在我开始之前,我想问一个想了很多次的问题:“为什么我使用vdbench去检查数据冲突?我也可以写一个大文件,计算校验和,然后重新读这个文件并比较校验和。”当然,你可.

  • FindWindow函数

    FindWindow函数FindWindow函数用来查询主窗口(子窗口不能查询),并且返回窗口句柄。函数原型:praram[in]lpClassName:以NULL结尾的字符串,如果为NULL,则查找所有与lpWindow

  • oracle+mybatis分页查询

    oracle+mybatis分页查询当使用oracle进行分页查询时使用以下方式:SELECT* FROM(SELECTA.*,ROWNUMRN     FROM(selectt.name   asname,           t.formula asformula,           t.data_fromasdataFro

  • SQL Server 2012 在sp_executesql 中生成的临时表的可见性

    SQL Server 2012 在sp_executesql 中生成的临时表的可见性在sql存储过程中,经常使用到动态sql语句,写法类似于这样Set@strParameter=N’@StartTimedatetime,@EndTimedatetime’Execsp_executesql@strSql,@strParameter,@StartTime,@EndTime为了满足业务需求,我们经常会在存储过程中使用到临时表。根据作用域的不同,分为全局临时表和用户临时

  • js 字符串转json对象_json字符串转java对象

    js 字符串转json对象_json字符串转java对象js对象转json字符串将js对象转为json格式的字符串,可以用JSON.stringify方法。varuser1={‘height’:170,’name’:’张三’};varuser1Str=JSON.stringify(user1)console.info(user1Str)typeofuser1Str使用typeof来获取对象user1Str的类型,能看到控制台输出的user1的值以及它的类型string。{“height”:170,“name”:“张三”}“s

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号