2016-09-15 53 views
0

我正在查看Timothy Lottes的presentation,他在那裏衍生出通用色調映射器(幻燈片37及以下)。Timothy Lottes通用色調映射器

雖然不同參數的目的很好地解釋了我很難適當地調整它們。我寫了一個simple script來比較不同的tonemappers,並且很難找到通用色調映射器的合理設置。

一般來說,我不能得到曲線的肩膀表現可與其他運營商相媲美。也許這是我的實現中的一個錯誤(原始源代碼在幻燈片中)。

def generic(x): 
    a = 1.2 # contrast 
    d = 1.1 # shoulder 

    mid_in = 1 
    mid_out = 0.18 

    hdr_max = 16 

    # It seems to work better when omitting the minus 
    b = (-math.pow(mid_in, a) + math.pow(hdr_max, a) * mid_out)/(math.pow(math.pow(hdr_max, a), d) - math.pow(math.pow(mid_in, a), d) * mid_out) 

    c = (math.pow(math.pow(hdr_max, a), d) * math.pow(mid_in, a) - math.pow(hdr_max, a) * math.pow(math.pow(mid_in, a), d) * mid_out)/(math.pow(math.pow(hdr_max, a), d) - math.pow(math.pow(mid_in, a), d) * mid_out) 

    z = math.pow(x, a) 
    y = z/(math.pow(z, d) * b + c) 

    return y 

有沒有人試過這個偶然?

回答

0

顯然,幻燈片幻燈片中存在代碼存在問題。 Bart Wronski在他的blog post的評論部分給出了一些更正的代碼。 我也更新了github項目來反映這一點。