2011年9月5日 星期一

Histogram Equalization的物理解釋

個人解釋,有錯請包涵並指正

公式證明找得到,但希望可以用理解的方式來看這個結果

基本上推導出的結論就是將原影像的CDF當作轉換用的LUT,得出的新影像其PDF產生的CDF會和定值的PDF產生的CDF一樣, 會是斜直線,照理PDF應該要變成水平的吧?但不會,是因為Normalize過嗎??就算式來看p(y)是constant但是dy不是,所以等dy的PDF來看, p(y)就不會是constant了
(參考 http://en.wikipedia.org/wiki/Histogram_equalization 的圖示)

以高斯分布來想像, 其PDF是像山坡, 左右兩側偏低, 中央偏高, 若要修正成平坦的PDF, 勢必要將中央削平, 兩側填高

將 Gaussian Distribution的CDF當LUT和一對一, 0對0, 255對255的斜線LUT疊起來看, CDF會把中間Level以下的對應成更低的Level, 造成低Level的數量變多; 而中間Level以上的則會對應成更高的Level, 使得高Level的數量變多, 如此便可以把中間Level的量往兩邊擴散, 而中間的分水嶺則會依據分布的中心來移動

若以局部區塊來看(p(y) keep constant)
小範圍(dx)的p(x)若很大(例如高斯分布的峰值), 則對應CDF的dy會比較寬, p(y)會比p(x)降低
小範圍(dx)的p(x)若很小(例如高斯分布的兩側), 則對應CDF的dy會比較窄, p(y)會比p(x)升高

(詳細內容參考原文, 摘錄部分如下)
http://fourier.eng.hmc.edu/e161/lectures/contrast_transform/node3.html

To transfer the gray levels so that the histogram of the resulting image is equalized to be a constant:

\begin{displaymath}h[i]= \mbox{constant},\;\;\;\;\mbox{for all $i$} \end{displaymath}

To equalize the histogram of the output image, we let $p(y)$ be a constant.
Intuitively, histogram equalization is realized by the following:
  • If $p(x)$ is high, $P(x)$ has a steep slope, $dy$ will be wide, causing $p(y)$ to be low to keep $p(y)dy=p(x)dx$;
  • If $p(x)$ is low, $P(x)$ has a shallow slope, $dy$ will be narrow, causing $p(y)$ to be high.

沒有留言:

張貼留言