本篇參考論文 A real-time implementation of gradient domain high dynamic range compression using a local Poisson solver
1. Model
前情提要,在前一篇中我們討論到了gradient domain的Poisson reconstruction,給定已知的divergence \(\operatorname{div}{G}\),嘗試重建\(I\)
\[
\begin{align}
\nabla^2{I}&=\nabla_{x} \cdot \Phi\cdot\nabla_{x} f +\nabla_{y} \cdot \Phi\cdot\nabla_{y} f \\
&=\operatorname{div}{G} \label{eq:model}
\end{align}
\]
2. Integral Problem
基本上這可看為一個積分問題,用一維的gradient思考,\(\nabla{f}\)套用衰減函數\(\Phi\)後由任何一邊開始積分就可以返回\(I\),如下式可以積回任何第\(n\)點的\(I_n\),其中\(C\)為一個常量
\[I_n=\sum_{i=0}^{n}{\nabla{f}_i{\Phi_i}}+C\]
一個直白的說法就是給你數個位置的個坡度差,然後以平滑的方式重建回斜坡
但在二為空間就不是如此,從任何一邊積分的結果都會有所不同,所以在無法兼顧的情況下,我們僅能將其轉換為一個optimization問題來看,使其符合目標式\(\eqref{eq:model}\)。從任何單點來看都需要整個畫面的divergence才能完整的重建。
3. Optimization
而optimization對於realtime需求總是不切實際的,一個想法就是將其分開看做一個小區域的問題做direct method,如求\(Ax=b\)的local \(A^{-1}\)或block-FFT解。該論文就是以local \(A^{-1}\)求解的作法。注意這邊我們為了要減低blocking effect所以每個local計算都只輸出正中央的點作為解,故有極大的redundancy。
在[2]中提到,該論文用\(3\times{3}\)的local Poisson solver求解。但僅能在未套用衰減函數\(\Phi\)下返回perfect solution(有啥鬼用?) 套用衰減函數後就會與global solver不同,但很quality~
這邊我直接揭露結論──沒有local或block的Poisson solver是好的。用積分問題去思考就想的通;如下圖是\(\operatorname{div}{G}\),灰色的部分表0。若local或block solver的範圍框在皆0的區域,解出的\(I\)自然是一片黑,因為這些部分應是延伸自其他pixel之常量而來,也就是積分的DC term無法知道,所以gradient才會是0,但\(I\)卻不一定是0。

意思是在local solver下,好的解必定在有充足gradient資訊的附近,而平坦的地區解是由那些有資訊的地方延伸而來。下面則是兩個solver的比較,由於gradient資訊不足,在平坦的區域local solver的結果是缺乏資訊的,返回的幾乎都是noise的細節。
3.1 compare of global and local solver


4. Analysis
但是在[1]中卻沒有發生這個現象,因為在很小的\(3\times{3}\)範圍中並不明顯,並且論文中的attenuation function同時也是local計算的,巧妙的包裝了local solver的缺點;代價就是沒什麼gradient domain HDR的感覺,輸出影像跟log domain gamma correction差不多而已,與[5]的結果相仿。同樣的問題發生在[3][4]的FFT-based local solver,只是在[4]中的學生論文才有比較圖,他比較了block size 8, 16, 32, 512的結果,當然只有512較佳,但[3]並沒有揭露這個問題。
5. Reference
- A real-time implementation of gradient domain high dynamic range compression using a local Poisson solver. Lavanya Vytla et al.Journal of Real-Time Image Processing, June 2013, Volume 8, Issue 2, pp 153-167
- A study of hardware-friendly methods for gradient domain tone mapping of high dynamic range images. Jian Liu et al.Journal of Real-Time Image Processing
July 2013 - Block-Based Gradient Domain High Dynamic Range Compression Design for Real-Time Applications. Tsun-Hsien Wang. ICIP 2007
- Design and Implementation of Gradient Domain Compression and Photographic Tone Mapping for Real-Time High Dynamic Range Video. Chih-Hsieh Huang. Master thesis of NTHU.
- Photographic Tone Reproduction for Digital Images