精华内容
下载资源
问答
  • Tone Mapping

    千次阅读 2016-04-26 18:32:17
    Tone Mapping三月 10, 2011 BY JIMMY·3 COMMENTS Tone Mapping原是摄影学中的一个术语,因为打印相片所能表现的亮度范围不足以表现现实世界中的亮度域,而如果简单的将真实世界的整个亮度域线性压缩到照片所能...

    Tone Mapping

        Tone Mapping原是摄影学中的一个术语,因为打印相片所能表现的亮度范围不足以表现现实世界中的亮度域,而如果简单的将真实世界的整个亮度域线性压缩到照片所能表现的亮度域内,则会在明暗两端同时丢失很多细节,这显然不是所希望的效果,Tone Mapping就是为了克服这一情况而存在的,既然相片所能呈现的亮度域有限则我们可以根据所拍摄场景内的整体亮度通过光圈与曝光时间的长短来控制一个合适的亮度域,这样既保证细节不丢失,也可以不使照片失真。人的眼睛也是相同的原理,这就是为什么当我们从一个明亮的环境突然到一个黑暗的环境时,可以从什么都看不见到慢慢可以适应周围的亮度,所不同的是人眼是通过瞳孔来调节亮度域的。 
        而这个问题同样存在在计算机图形上,为了让图像更真实的显示在显示器上,同样需要Tone Mapping来辅助。 
        整个Tone Mapping的过程就是首先要根据当前的场景推算出场景的平均亮度,再根据这个平均亮度选取一个合适的亮度域,再将整个场景映射到这个亮度域得到正确的结果。其中最重要的几个参数: 
        Middle grey:整个场景的平均灰度,关系到场景所应处在亮度域。 
        Key:场景的Key将决定整个场景的亮度倾向,倾向偏亮亦或是偏暗。 
        首先我们需要做的是计算出整个场景的平均亮度,有很多种计算平均亮度的方法,目前常用的的是使用log-average亮度来作为场景的平均亮度,通过下面的公式可以计算得到: 
    tone1
        其中Lw(x,y)是像素点x,y的亮度,N是场景内的像素数,δ是一个很小的数用来应对像素点纯黑的情况。

    tone2
    tonekey     上面的公式用来映射亮度域,α即是前面所讲的Key值,用来控制场景的亮度倾向,一般来说,会使用几个特定的值,0.18是一个适中的Key,0.36或者0.72相对偏亮,0.09甚至0.045则是偏暗。完成映射的场景为了满足计算机能显示的范围还要将亮度范围再映射到[0,1]区间,可以通过下面的公式简单的得到[0,1]区间的亮度。 
    tone3
        不过这样得到的结果并不总是令人满意的,所以一般扩展为如下面的公式,公式中的参数Lwhite用来控制场景中的曝光,凡是亮度超过Lwhite的像素都会被置为纯白。如果Lwhite的值非常大,则这个参数在公式中将不起任何作用,如果非常小则场景将变为几乎全白。Ld即为我们所要的映射后的x,y像素点的亮度值。 
    tone4
        Tone Mapping一般作为HDR算法中的一部分存在,在使用中会灵活很多,但基本的原理都是相同的。

    展开全文
  • Tone mapping

    2012-03-15 09:04:43
    Tone mapping技术文档. Photographic Tone Reproduction for Digital Images.
  • UE4中的Tone Mapping

    千次阅读 2018-08-17 18:05:22
    什么是Tone Mapping Tone Mapping翻译过来是色调映射,其作用是把大范围HDR的颜色,映射为小范围的LDR颜色,以便显示器可以正常显示。 显示器所能显示的颜色范围,小于真实世界的颜色范围。 下图是Tone Mapping...

    什么是Tone Mapping

    Tone Mapping翻译过来是色调映射,其作用是把大范围HDR的颜色,映射为小范围的LDR颜色,以便显示器可以正常显示。
    显示器所能显示的颜色范围,小于真实世界的颜色范围。
    下图是Tone Mapping前后的对比。
    这里写图片描述
    在UE4中,Tone Mapping是在后处理阶段,正常渲染之后进行的。

    UE4中Tone Mapping前后效果对比

    做了一个纸面的效果,Tone Mapping前后色调非常不同。
    这里写图片描述
    这里写图片描述
    这是一个后处理材质,blendable Location选项不同造成的区别。
    第一张图是Before Tonemapping,第二张图(下称图B)是After Tonemapping。
    颜色确实发生了很大的变化。实际上,所采用的颜色是:
    这里写图片描述
    在这个截图的右上角,可以看到颜色跟Before Tonemapping是一样的。
    那如何在Before Tonemapping的情况下,达到图B的效果呢?
    把颜色调整深一些就可以了,是吗?我们试试。

    Before Tonemapping达到AfterTonemapping的效果

    先调整一下颜色,把颜色改深一些:
    这里写图片描述
    然后效果现在是这样:
    这里写图片描述
    只是颜色比较像了,但是效果差别好大。
    图B的效果,纸的纹路更深。
    由此可见,Tonemapping的影响是很大的,不能简单的通过调整颜色达到。
    应该尽量使用Before Tonemapping,因为跟材质编辑器预览的效果是一样的。
    最终尝试了一种办法,为了让纸的纹路更深,把纸的mask进行了power运算。这是一种增加对比度的手段,效果跟CheepContrast还不一样。
    这里写图片描述
    跟图B对比了一下,还是觉得图B的效果更好一些。。可能是先入为主的原因。不过也差不太多了。
    如果模拟一下Tonemapping的运算,肯定可以达到跟AfterTonemapping一样的效果。这个有机会再尝试吧。
    原文地址:原文地址
    本文首发于翰者学堂

    展开全文
  • tone mapping

    2015-11-09 20:04:19
    mablab 实现图像处理,将图像的高光和低光部分都映射到一张图片上,便于打印和显示器的输出。
  • Tone Mapping(简洁直观的Tonemapping介绍)

    千次阅读 2019-11-25 14:36:54
    转自:...What is tone mapping? Most monitors are capable of displaying RGB values in the range of[0, 255][0,255]. However, in real life, there is no limit on the amount ...

    转自:https://64.github.io/tonemapping/

    What is tone mapping?

    Most monitors are capable of displaying RGB values in the range of [0, 255][0,255]. However, in real life, there is no limit on the amount of light 'energy' incident on a point. Most renderers output linear radiance values in [0, \infty)[0,∞), which needs to be mapped into a viewable range. Those radiance values are described as High Dynamic Range (HDR), because they are unlimited, and the viewable target range is described as Low Dynamic Range (LDR), because there is a fixed limit of 255. Put simply, tone mapping is the process of mapping HDR values in [0, \infty)[0,∞) into LDR values (e.g values in [0, 255][0,255] or [0.0, 1.0][0.0,1.0]).

    tone mapping operator (TMO) is essentially just a function which maps an input color (e.g an RGB triple) to an output color:

    C_{\mathrm{out}} = \mathrm{TMO}(C_{\mathrm{in}})Cout​=TMO(Cin​)

    At this point you might be a little confused as to why you've never had to think about tone mapping inside your program. If you're using an API like OpenGL, your radiance values are probably just being clamped by the implementation to [0.0, 1.0][0.0,1.0] in the final framebuffer. This is essentially a trivial tone mapping operator:

    \mathrm{TMO_{clamp}}(C) = \mathrm{clamp}(C, 0.0, 1.0)TMOclamp​(C)=clamp(C,0.0,1.0)

    This TMO, as you might guess, is quite flawed. Here's what it looks like when we apply this TMO to the memorial scene (the HDR scene file can be downloaded here):

     

    Tone mapping with clamp

    High radiance values are be completely lost beyond a certain point. This results in the white areas (like the middle stained glass window) looking completely 'blown out'. For this particular scene it's not too bad because most of the radiance values are in [0.0, 1.0][0.0,1.0] already, but for a brighter outdoors scene it would look a lot worse. You could alleviate the issue somewhat by dividing the input color by some value before clamping:

    \mathrm{TMO_{clamp2}}(C) = \mathrm{clamp}\left(\frac{C}{k}, 0.0, 1.0\right)TMOclamp2​(C)=clamp(kC​,0.0,1.0)

    However, as it turns out, we don't really want a linear relationship between input and output color. Human color perception is very non-linear - the difference between 1 light source and 2 light sources illuminating a point appears much greater than the difference between 100 light sources and 101 light sources. Non-linear TMOs are potentially able to reproduce images which can convey more detail to our eyes. Floats actually work great for storing HDR values for this exact reason - they have higher precision nearer zero, and lower precision as their value increases towards infinity.

    The rest of this guide will explore a few simple tone mapping operators, as well as some underlying theory which should help you research the topic further.

    Reinhard

    This is one of the simplest and most common TMOs, described by Reinhard et al. in this paper. Simply put, it is:

    \mathrm{TMO_{reinhard}}(C) = \frac{C}{1 + C}TMOreinhard​(C)=1+CC​

    (Note that this isn't exactly what Reinhard is proposing in his paper, but more on that further down.)

    This is mathematically guaranteed to produce a value in [0.0, 1.0][0.0,1.0]. By differentiating, you can see that C_{\mathrm{out}}Cout​ has an inverse-square falloff (e.g a radiance value of 4 results in something which is only 1.2 times as bright as a radiance value of 2).

    In C++:

    vec3 reinhard(vec3 v)
    {
        return v / (1.0f + v);
    }
    

    Compare this image to the previous 'clamp' TMO. Reinhard looks much more grey-ish, and the whites are less blown out (more detail is noticeable in the middle stained glass window).

     

    Reinhard tone mapping

    Extended Reinhard

    The problem with the 'simple' Reinhard TMO is that it doesn't necessarily make good use of the full Low Dynamic Range. If our max scene radiance happened to be (1.0, 1.0, 1.0)(1.0,1.0,1.0) then the resulting maximum brightness would only be (0.5, 0.5, 0.5)(0.5,0.5,0.5) - only half of the available range. Fortunately, the paper by Reinhard presents a way to scale and make use of the full range:

    \mathrm{TMO_{reinhardext}}(C) = \frac{C\left(1 + \frac{C}{C_{\mathrm{white}}^2}\right)}{1 + C}TMOreinhardext​(C)=1+CC(1+Cwhite2​C​)​

    where C_{\mathrm{white}}Cwhite​ is the biggest radiance value in the scene. Now, our biggest radiance value will get mapped to (1.0, 1.0, 1.0)(1.0,1.0,1.0), using the full LDR.

    (Note that you can also just set C_\mathrm{white}Cwhite​ to a value lower than the maximum radiance, which will ensure that anything higher gets mapped to (1.0, 1.0, 1.0)(1.0,1.0,1.0) - for this reason it is sometimes referred to as the 'white point'.)

    In C++:

    vec3 reinhard_extended(vec3 v, float max_white)
    {
        vec3 numerator = v * (1.0f + (v / vec3(max_white * max_white)));
        return numerator / (1.0f + v);
    }
    

    If we just set our max scene radiance as the white point, this TMO appears almost exactly the same as the simple reinhard operator. That's because the max radiance for this scene is 622, and \frac{622}{1+622} \approx 0.9981+622622​≈0.998, so the difference between the extended and the simple variants in this case is imperceptible - simple reinhard was already making full use of the low dynamic range. If we used a different white point, the TMO would look noticeably different.

    Luminance and Color Theory

    Okay, so I must admit that I've lied to you slightly. Reinhard's formulas actually operate on a thing called luminance rather than operating on RGB-triples as I implied. Luminance is a single scalar value which measures how bright we view something. It may not be obvious, but for example we perceive green as much brighter than blue. In other words, (0.0, 0.7, 0.0)(0.0,0.7,0.0) appears much brighter than (0.0, 0.0, 0.7)(0.0,0.0,0.7).

    Converting a linear RGB triple to a luminance value is easy:

    L = 0.2126R + 0.7152G + 0.0722BL=0.2126R+0.7152G+0.0722B

    So far we've effectively been applying our TMOs to each RGB channel individually. However this can cause a 'shift' in hue or saturation which can significantly change the color appearance.

    Instead, what Reinhard's formula entails is to convert our linear RGB radiance to luminance, apply tone mapping the luminance, then somehow scale our RGB value by the new luminance. The simplest way of doing that final scaling is:

    C_{\mathrm{out}} = C_{\mathrm{in}} \frac{L_{\mathrm{out}}}{L_{\mathrm{in}}}Cout​=Cin​Lin​Lout​​

    In C++:

    float luminance(vec3 v)
    {
        return dot(v, vec3(0.2126f, 0.7152f, 0.0722f));
    }
    
    vec3 change_luminance(vec3 c_in, float l_out)
    {
        float l_in = luminance(c_in);
        return c_in * (l_out / l_in);
    }
    

    Two other more complex luminance-adjusting methods are discussed in a paper by Mantiuk et al., but the simple method is perfectly acceptable.

    Don't confuse luminance with luma - luma is the equivalent of the luminance computed from an sRGB pixel (i.e gamma-corrected). The coefficients used to convert to luma are the same as luminance, they just operate on sRGB components instead. See Wikipedia for more details.

    Note that the hue / saturation preservation which results from this method isn't always desirable. Reinhard tone mapping in particular was created with the intention of being applied to luminance only, so it looks much better when this is done (see the following section for details on that). Other tone mapping curves look better when applied to RGB components separately.

    Reinhard was on the wrong track in applying his tone mapping curve to luminance; his curve was inspired by film, but film curves are applied to each color channel separately. And that is a good thing - [...] the "hue and saturation shifts" (really mostly saturation shifts) resulting from applying nonlinear curves per channel are an important feature, not a bug.

    -- Naty Hoffman, co-author of Real Time Rendering

    Extended Reinhard (Luminance Tone Map)

    Let's apply the extended Reinhard TMO to luminance only:

    vec3 reinhard_extended_luminance(vec3 v, float max_white_l)
    {
        float l_old = luminance(v);
        float numerator = l_old * (1.0f + (l_old / (max_white_l * max_white_l)));
        float l_new = numerator / (1.0f + l_old);
        return change_luminance(v, l_new);
    }
    

    Here's the difference it makes - the stained glass windows and the column on the left are noticeably more orange and less 'washed out' in the luminance mapped version:

     

    Reinhard applied to RGB channels

     

    Reinhard applied to luminance

    Note that in fact with Reinhard, the luminance calculation can be simplified somewhat:

    \begin{aligned} L_\mathrm{out} &= \frac{L_\mathrm{in}}{1.0 + L_\mathrm{in}} \\ \implies \frac{L_\mathrm{out}}{L_\mathrm{in}} &= \frac{1.0}{1.0 + L_\mathrm{in}} \end{aligned}Lout​⟹Lin​Lout​​​=1.0+Lin​Lin​​=1.0+Lin​1.0​​

    Hence

    \begin{aligned} \mathrm{TMO_{reinhardextlum}}(C_\mathrm{in}) &= C_\mathrm{in} \frac{L_\mathrm{out}}{L_\mathrm{in}} \\ &= \frac{C_\mathrm{in}}{1.0 + L_\mathrm{in}} \end{aligned}TMOreinhardextlum​(Cin​)​=Cin​Lin​Lout​​=1.0+Lin​Cin​​​

    Reinhard-Jodie

    You aren't necessarily forced to choose between tone mapping RGB individually and tone mapping luminance. Here's one such Reinhard variant by shadertoy user Jodie which does that:

    vec3 reinhard_jodie(vec3 v)
    {
        float l = luminance(v);
        vec3 tv = v / (1.0f + v);
        return lerp(v / (1.0f + l), tv, tv);
    }
    

    The difference between this and the luminance-only tone map is barely noticeable in this scene (you can see that the stain glass windows are slightly less orange), but in other scenes (especially those with colored lights) the difference is more obvious. Note that there's also no way to set the white point with this TMO, but you could add a way yourself.

     

    Reinhard-Jodie tone mapping

    Filmic Tone Mapping Operators

    So-called 'filmic' TMOs are designed to emulate real film. Other than that, their defining feature is the distinctive 'toe' at the bottom end of the curve (radiance is on the xx-axis, final pixel brightness is on the yy-axis):

     

    Note that the other end of the tone mapping curve is usually described as the 'shoulder'.

    Uncharted 2

    A popular TMO for real-time graphics is the Uncharted 2 TMO devised by John Hable (sometimes known as 'Hable Tone Mapping' or 'Hable Filmic' etc). It has some parameters which can be tweaked, but the basic operator is given by the following code:

    vec3 uncharted2_tonemap_partial(vec3 x)
    {
        float A = 0.15f;
        float B = 0.50f;
        float C = 0.10f;
        float D = 0.20f;
        float E = 0.02f;
        float F = 0.30f;
        return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;
    }
    
    vec3 uncharted2_filmic(vec3 v)
    {
        float exposure_bias = 2.0f;
        vec3 curr = uncharted2_tonemap_partial(v * exposure_bias);
    
        vec3 W = vec3(11.2f);
        vec3 white_scale = vec3(1.0f) / uncharted2_tonemap_partial(W);
        return curr * white_scale;
    }
    

     

    Uncharted 2 tone mapping

    For some further reading, see John Hable's blog post about creating an improved curve which offers more intuitive controls.

    ACES

    Another popular filmic tone mapping curve is ACES (Academy Color Encoding System). This is the default TMO used by Unreal Engine 4 so would be a perfectly good choice to use in your own real-time engine. The TMO curve is calculated through a couple of matrix transformations and formulae adapted from Stephen Hill's fit, shown below:

    static const std::array<vec3, 3> aces_input_matrix =
    {
        vec3(0.59719f, 0.35458f, 0.04823f),
        vec3(0.07600f, 0.90834f, 0.01566f),
        vec3(0.02840f, 0.13383f, 0.83777f)
    };
    
    static const std::array<vec3, 3> aces_output_matrix =
    {
        vec3( 1.60475f, -0.53108f, -0.07367f),
        vec3(-0.10208f,  1.10813f, -0.00605f),
        vec3(-0.00327f, -0.07276f,  1.07602f)
    };
    
    vec3 mul(const std::array<vec3, 3>& m, const vec3& v)
    {
        float x = m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2];
        float y = m[1][0] * v[1] + m[1][1] * v[1] + m[1][2] * v[2];
        float z = m[2][0] * v[1] + m[2][1] * v[1] + m[2][2] * v[2];
        return vec3(x, y, z);
    }
    
    vec3 rtt_and_odt_fit(vec3 v)
    {
        vec3 a = v * (v + 0.0245786f) - 0.000090537f;
        vec3 b = v * (0.983729f * v + 0.4329510f) + 0.238081f;
        return a / b;
    }
    
    vec3 aces_fitted(vec3 v)
    {
        v = mul(aces_input_matrix, v);
        v = rtt_and_odt_fit(v);
        return mul(aces_output_matrix, v);
    }
    

     

    ACES tone mapping

    You can also use this approximated ACES fit by Krzysztof Narkowicz for something a bit more performant. Note that this approximation oversaturates bright colors slightly compared to the better fit (you can see that in the middle stained glass window).

    vec3 aces_approx(vec3 v)
    {
        v *= 0.6f;
        float a = 2.51f;
        float b = 0.03f;
        float c = 2.43f;
        float d = 0.59f;
        float e = 0.14f;
        return clamp((v*(a*v+b))/(v*(c*v+d)+e), 0.0f, 1.0f);
    }
    

     

    ACES tone mapping (worse fit)

    Real Camera Response Functions

    Sometimes it might be desireable to exactly reproduce the 'tone mapping' response of a real camera. Fortunately, the University of Columbia has released a database of camera response functions which we can use for this purpose. Each camera response curve has two axes: irradiance (essentially the energy coming into the camera) and intensity (essentially the value of color component at that point on the film).

    Since irradiance is the input and intensity is the output, you can visualise irradiance and intensity on the xx and yy axes respectively. The data given to us has the points on both axes normalized into the range [0.0, 1.0][0.0,1.0]. For intensity, this is exactly what we want, as we can just scale the output by 256 to get the corresponding 8-bit color component. For irradiance, we will need to decide the 'width' of the curve. Since the point with the largest xx value is (1.0, 1.0)(1.0,1.0), if we stretch this curve horizontally by a factor of aa then the new furthest point will be (a, 1.0)(a,1.0). We can map any irradiance value greater than aa to 1.01.0 and hence we can effectively control the white point by stretching or squashing the irradiance axis. Instead of 'white point', we'll call this parameter 'ISO' which mimics the function of the ISO setting on a real-world camera.

    The data is given as two associative arrays. Given a irradiance value in [0.0, 1.0][0.0,1.0] we need to find the index into the irradiance array (ideally using a binary search). Then, we can compute the output value by using the index we got from that binary search to look up the intensity value from the intensity array. We'll repeat this procedure for each RGB channel individually to compute the final color.

    For real-time graphics you might want to find a way to bake a LUT instead of doing a relatively expensive binary search.

    float camera_get_intensity(float f, float iso)
    {
        f = clamp(f, 0.0f, iso); // Clamp to [0.0, iso]
        f /= iso; // Convert to [0.0, 1.0]
    
        // Returns 1.0 if the index is out-of-bounds
        auto get_or_one = [](const auto& arr, size_t index)
        {
            return index < arr.size() ? arr[index] : 1.0;
        };
    
        // std::upper_bound uses a binary search to find the position of f in camera_irradiance
        auto upper = std::upper_bound(camera_irradiance.begin(), camera_irradiance.end(), f);
        size_t idx = std::distance(camera_irradiance.begin(), upper);
    
        double low_irradiance = camera_irradiance[idx];
        double high_irradiance = get_or_one(camera_irradiance, idx + 1);
        double lerp_param = (f - low_irradiance) / (high_irradiance - low_irradiance);
    
        double low_val = camera_intensity[idx];
        double high_val = get_or_one(camera_intensity, idx + 1);
    
        // Lerping isn't really necessary for RGB8 (as the curve is sampled with 1024 points)
        return clamp(lerp((float)low_val, (float)high_val, (float)lerp_param), 0.0f, 1.0f);
    }
    
    vec3 camera_tonemap(vec3 v, float iso)
    {
        float r = camera_get_intensity(v.r(), iso);
        float g = camera_get_intensity(v.g(), iso);
        float b = camera_get_intensity(v.b(), iso);
        return vec3(r, g, b);
    }
    

     

    DSCS315-R1 response curve, ISO = 6.0

    This method is available as an option in Indigo Renderer, for the curious.

    Local Tone Mapping Operators

    So far, all the TMOs I've discussed have been global tone mapping operators. This means that the computation they do is only based on the input radiance value and global image parameters like the average luminance. Tone mapping operators which are a function of position are known as local tone mapping operators. These are generally far more expensive and hence unsuitable for real time graphics - yet widely used in digital photography. Local TMOs can also give strange results when applied to video.

    One local tone mapping operator is described in the same paper by Reinhard et al. - it involves a digital simulation of a process known as 'dodging and burning' in real photography, which essentially applies different exposure to different regions of the image, often resulting in more detailed images than global tone mapping operators are able to produce.

    Conclusion

    Hopefully this guide was instructive. I've placed a grid of all TMOs used here for comparison, but keep in mind that these can be adjusted in certain ways through exposure or other parameters, so this isn't entirely a fair comparison.

     

    Clamp

     

    Reinhard simple

     

    Reinhard luminance (white point = max luminance)

     

    Reinhard-Jodie

     

    Uncharted 2

     

    ACES

     

    ACES (worse fit)

     

    DSCS315-R1 (ISO = 6.0)

    Further Reading

    Appendix

    The full source code for this post can be found on my GitHub. For the vec3 class, I'm using a slightly modified version of the one found in Shirley's 'Ray Tracing in One Weekend' book.

    展开全文
  • Tone Mapping Survey

    2020-06-21 13:39:49
    3.2 Global Tone Mapping Algorithms 3.3 Local Tone Mapping Algorithms 3.4 Color to Luminance 图3.1显示了从HDR到LDR的广泛流水线。 此HDR内容需要存储在比单个LDR图像具有更多位/像素的介质中。 为了获得更...

    3.1色调映射一般管道

    目录

    3.1色调映射一般管道

    3.2 Global Tone Mapping Algorithms

    3.3 Local Tone Mapping Algorithms

    3.4 Color to Luminance


    图3.1显示了从HDR到LDR的广泛流水线。 此HDR内容需要存储在比单个LDR图像具有更多位/像素的介质中。 为了获得更大的动态范围,这是必要的。 尽管确实存在HDR显示系统[73],并且动态范围扩展的电视目前已在商业市场上获得,但是由于其在动态范围和色域方面的限制,它们并不那么普及。 色调映射的过程包括将HDR图像的动态范围缩小为可以轻松显示在动态范围和色域有限的各种显示设备上的图像。

    此过程可能高度非线性,具体取决于预期结果。 由于色调映射功能减少了信息,因此色调映射后的LDR图像将比原始HDR图像具有更少的信息。 但是它随时可以显示,并且根据我们的感知,可以通过显示黑暗和明亮部分的细节来为图像提供足够的信息。 色调映射已成为重要的研究领域,这可以从多年来发表的几项调查中看出来[70,75,92,113,114]。 根据色调映射功能使用的处理功能,可以将其分为两大类。

    • Global operators:相同的映射函数被应用到所有像素通过出来的图像。
    • Local operators:应用于一个像素的映射函数依赖于它的邻居像素。

    3.2 Global Tone Mapping Algorithms

    全局色调映射算法(也称为“色调重现曲线”)在空间上是不变的,也就是说,它们对输入图像中的所有像素都应用相同的功能[115-119]。 这导致针对特定输入像素值的一个且只有一个输出值,而不管其附近的像素如何。 图3.3显示了一个通用管道,可用于实现图3.2(a)所示的全局色调图功能。 如我们所见,色调映射管线首先获取亮度图像,并由此计算全局统计量(如Lmax,Lmin,Laverage)。 在某些算法中,这些统计信息也是基于以下假设而计算的,即,以每秒30/60帧的速度成像时,连续帧之间的变化很小[15,16,24]。

    图3.3:硬件实现的全局色调映射系统的一般框图。

    图3.4:用于硬件实现的局部色调映射系统的一般框图。对于局部计算,全帧缓冲区/行缓冲区或压缩帧缓冲区是必需的(图像来自[68])。

    在流水线中,下一步是实现对数或指数函数,以计算色调映射图像。 这些功能的硬件实现是一个挑战,一种常见的方法是通过在实现的实现中保持可接受的错误级别来近似这些功能。 由于在许多工程和科学应用中经常需要计算这些函数,因此文献[120-122]中提出了许多硬件友好的方法。 色调图之后,管线中的最后一步是还原颜色以显示输出图像。 有关色彩校正技术的详细说明,请参见第3.4节。

    3.3 Local Tone Mapping Algorithms

    局部色调映射算法(也称为“色调再现运算符”)在空间上有所不同,并根据输入像素的邻域应用不同的功能[123–129]。因此,一个输入像素可能会基于其位置产生不同的输出值,如图3.2(b)所示。与全局色调映射算法相比,局部色调映射算法在计算上更加昂贵且耗时[130]。我们可以使用图3.4中所示的框图来描述本地色调映射算法的操作。与全局色调图一样,我们最初获得输入图像的亮度值。颜色校正步骤将在3.4节中详细介绍。局部色调图运算符的高计算成本是由于局部信息计算所致,如图3.4所示,必须为其填充整个帧或几行输入图像。一些算法还实现了压缩帧缓冲器(下采样图像)以减少存储成本[12,40]。为了满足实时约束,作为一种通用方法,使用前一帧来计算当前帧的本地信息。

    局部色调映射方法通常会保留更好的细节,从而产生质量更好的图像,而使用全局色调映射方法则可能不是这种情况[70]。 然而,局部色调映射算法的主要缺点之一是在高对比度边缘之间产生了光晕伪像,以及在低对比度区域中出现了灰化[131,132]。 因此,局部色调图方法实现了额外的滤波器,以抑制这些图像伪像,例如光晕和噪声。 这种过滤可能需要将输入图像(大小为M×N)与过滤器(大小为k×r)进行卷积。 Benedetti等。 演示了一个简单的硬件滑动窗口卷积块,每个时钟可以输出一个像素[133]。 与此滑动窗口方法相关的等待时间计算为:

    3.4 Color to Luminance

    图像亮度可用于各种应用程序,例如打印,数据压缩,特征提取和色调映射。 因此,获得亮度对于TMO是非常重要的步骤。 有很多定义明确的方法可以从彩色图像中获得亮度值。 获得亮度的一种简单方法是根据RGB到XYZ转换方案将其计算为红色,绿色和蓝色分量的线性组合。 这里,

    是RGB图像的亮度。 另一种无缝方法是使用CIELab或YUV颜色空间,并且可以直接获取亮度通道作为彩色图像的灰度版本。 因为,他们认为亮度和颜色通道是独立的。

    色调映射算法在如上所述获得的亮度通道上运行。 对于给定的HDR图像,将计算亮度值,并按稍后需要的色度值进行存储/存储,以恢复彩色后期色调图。 不同的研究使用了不同的亮度方法,我们在表4.1中列出了这些方法。 一些研究机构还使用了单色图像[11,15,32,45,50],这种方法在减少内存和减少计算方面可以具有某些优势。 但是,单色图像的应用受到限制。

    色调映射后,一种常用的颜色恢复方法是基于Schlick的色比[116]:

    在Eq. 3.3中,Cin为原始RGB图像,Lin为由Eq. 3.2得到的对应亮度值。如果Lout是色调映射的亮度值,那么我们可以计算出Eq. 3.3中所示的三个输出色度值,其中,temp是用于显示彩色图像的颜色饱和因子,其值通常设置在0.4到0.6之间[134]。

    展开全文
  • HDR, tone mapping代码

    2017-03-21 13:16:41
    HDR, tone mapping代码
  • tone mapping简介

    千次阅读 2015-12-02 19:48:03
    tone Mapping原是摄影学中的一个术语,因为打印相片所能表现的亮度范围不足以表现现实世界中的亮度域,而如果简单的将真实世界的整个亮度域线性压缩到照片所能表现的亮度域内,则会在明暗两端同时丢失很多细节,这...
  • toneMapping.m

    2020-09-17 15:27:12
    程序是对Reinhard论文“Photographic Tone Reproduction for Digital Images”的实现,具体的讲解可参考我的博客https://blog.csdn.net/u014230360/article/details/108527016
  • Support for Tone Mapping

    2020-12-29 03:16:24
    <p>is it planned to add support for tone-mapping through the libva filter VAProcFilterHighDynamicRangeToneMapping? <p>Thanks, softworkz</p><p>该提问来源于开源项目:Intel-Media-SDK/MediaSDK</p></...
  • Mapping

    2016-06-07 21:05:00
    Reflection mapping cube mapping sphere mapping HEALPix mapping ...Displacement mapping ...Bump mapping ...Normal mapping ...Parallax mapping ...Tone mapping 转载于:https://www.cnblogs....
  • HDR tone mapping参考

    2021-01-14 15:32:28
    tone mapping映射也是玄学指标,在不指望美术或者ta能调出好合理的映射曲线的时候,或者,怎么调都不觉得好看的时候。那就使用公版吧: 链接:...
  • 简述ToneMapping发展史

    千次阅读 2019-03-06 14:39:20
    简述ToneMapping发展史HDR2002年Reinhard ToneMapping2007年CryEngine22010年Uncharted2(神秘海域2)公开算法目前最好的ToneMapping算法---来自学术界的藐视,Academy Color Encoding System(ACES) HDR 为什么会...
  • Tone mapping进化论

    2017-04-16 23:01:41
    Tone mapping进化论 https://zhuanlan.zhihu.com/p/21983679?refer=highwaytographics Reinhard tone mapping非常简单,用代码描述就三行。 float3 ReinhardToneMapping(float3 color, float adapted_lum) ...
  • filmic tonemapping", ;265300#p265300">cribbed from oolite</a>. But it doesn't look as good (or as subtle) as it does with oolite. <p>There's a magic formula it uses (from graph_dev_opengl....
  • HDR Tone Mapping

    2018-09-19 12:44:56
    下图是Unity引擎对采用HDR渲染的图片使用了Tone Mapping和没有使用Tone Mapping的对比结果: 其中,上图是没有使用Tone Mapping的结果,下图是使用了Tone Mapping的结果。可以看到,在没有使用Tone Mapping的...
  • Filmic Tonemapping Operators

    2018-11-07 14:08:00
    http://filmicworlds.com/blog/filmic-tonemapping-operators/ 转载于:https://www.cnblogs.com/guochen/p/9922212.html
  • Graphics - ToneMapping

    2021-02-05 17:01:20
    ToneMapping: 简单的说来,就是为了让图像能在显示器上面显示的更真实,把大于1的亮度通过一定的方式压缩在0-1的范围之内,让我们可以在显示器上观察到; 因为人对世界的感知是接近对数的,比如对亮度的感知大概...
  • 快速理解Tone Mapping

    千次阅读 2019-05-21 10:34:44
    整个Tone Mapping的过程就是首先要根据当前的场景推算出场景的平均亮度,再根据这个平均亮度选取一个合适的亮度域,再将整个场景映射到这个亮度域得到正确的结果。其中最重要的几个参数: Middle grey:整个场景的...
  • 图形学实验 tonemapping

    2013-12-10 19:43:37
    天大图形学实验tonemapping,程序可以用vc++运行,
  • Friendly Filmic Tonemapping

    2012-03-17 14:32:00
    Filmic Tonemapping固然是个好东西,然而Jim Hejl & Burgess-Dawson的原始公式在不少显示器上都显得过于鲜艳了,另外还有不少人甚至认为完全没有任何Tonemapping的画面更对他们的口味。众口难调,我们能做的就是...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 397
精华内容 158
关键字:

mappingtone