跳轉到內容

分形/影像噪聲

來自華夏公益教科書

影像噪聲 [1]

  • 所有未正確渲染的畫素的集合
  • "異常畫素。這意味著畫素沒有正確地代表顏色......" Barry J Brady[2]

噪聲可能出現在不同的情況下。這裡只包括渲染影像中的噪聲。所以沒有原始影像[3],沒有照片,沒有訊號,...

關鍵詞

[編輯 | 編輯原始碼]
  • 畫素間距


莫爾紋

[編輯 | 編輯原始碼]

"眾所周知,均勻網格會因細密的近乎平行的線條與規則間隔的取樣點相互作用而產生莫爾紋。"[5]

   " Our images look noisy and grainy near the boundary of the Mandelbrot set. The escape time bands get closer and closer, while the pixel spacing is fixed. The pixel grid samples isolated points of a mathematically abstract image defined on the continuous plane. The Nyquist-Shannon sampling theorem shows that sampling isolated points from a continuum is a valid approximation only so long as the values don’t change too quickly between the points. Aliasing occurs when the values do change too quickly compared to the sampling rate, with the grainy noisy visual effects as we have been. Because the escape time bands increase in number without bound as we approach the boundary of the Mandelbrot set, no sampling rate can be high enough." Claude Heiland-Allen[6]


常用的影像質量指標

[編輯 | 編輯原始碼]
  • PSNR (峰值信噪比)
  • SSIM (結構相似度)
  • NIQE (自然影像質量評估器)

檢測噪聲

[編輯 | 編輯原始碼]
   "To detect noise you first need to know the properties of your useful data. So if you have no prior knowledge of the input images then you Can not reliably detect noise." Spektre[7]

測量噪聲

[編輯 | 編輯原始碼]
  • "基於結構相似度"的影像質量客觀測量。 [8]
  • 噪聲率 = 被識別為噪聲的畫素數量。“為了區分正常畫素和噪聲畫素,我只計算了其相鄰畫素的中值,如果其值大於某個臨界值,我們就會說該畫素是噪聲。"[9]
  • " 而不是在畫素超過某個閾值時將其歸類為噪聲,你可以測量“誤差”並計算影像中所有畫素的方差或標準差。這將有助於你區分 n 個畫素剛好超過閾值和 n 個畫素完全不正常。它還避免了選擇閾值的必要性。" Adrian McCarthy
  • 估計噪聲方差[10] 如果得到 sigma > 10.0,那麼你的影像就存在噪聲(只針對灰度影像)。


// https://stackoverflow.com/questions/8960462/how-can-i-measure-image-noise
// noise rate by Vitalii Boiarskyi
if (ABS(1 - (currentPixel.R+currentPixel.G+currentPixel.B)/(neigborsMediumValues.R + neigboursMediumValues.G + neigboursMediumValues.B))) > criticalValue)
then
{
    currentPixelIsNoise = TRUE;
}


# https://stackoverflow.com/questions/2440504/noise-estimation-noise-measurement-in-image
# J. Immerkær, “Fast Noise Variance Estimation”, Computer Vision and Image Understanding, Vol. 64, No. 2, pp. 300-302, Sep. 1996


import math, 
import numpy as np 
from scipy.signal import convolve2d

def estimate_noise(I):

  H, W = I.shape # Tuple of image array dimensions.

  M = [[1, -2, 1],
       [-2, 4, -2],
       [1, -2, 1]]

  sigma = np.sum(np.sum(np.absolute(convolve2d(I, M))))
  sigma = sigma * math.sqrt(0.5 * math.pi) / (6 * (W-2) * (H-2))

  return sigma

去除噪聲

[編輯 | 編輯原始碼]
       "Noise reduction therefore quickly becomes an ‘AI-complete’ problem " Mark Scott Abeln [11]

名稱

  • 降噪[12]
  • 去除噪聲
  • 降噪

軟體


方法

  • 高精度
  • 擾動技術
  • 重新定位:重新定位到新的參考並繼續[13]
  • 雙變數線性逼近 (BLA)
  • 距離估計
  • 內部檢測:跟蹤臨界點的導數。當導數的絕對值下降到某個閾值(例如 0.001)

時,將其歸類為內部並停止迭代。


  • 提高精度


將 6×6 畫素光柵圖形放大到 11×11 畫素(本示例中的低影像解析度是為了更好地說明;對於更高的解析度,原理相同)。

  • 1:輸入影像;畫素在此以圓圈表示。
  • 2:輸出影像的畫素網格,在此以黃色十字表示,疊加在輸入影像上。
  • 3:輸出影像的顏色值由輸入影像的附近畫素計算得出。
  • 4:輸出影像。


Image resampling
影像重取樣


影像重取樣重建濾波器。使用徑向對稱重建濾波器進行縮放(載體以綠色顯示)。輸出影像的顏色值計算為輸入影像的顏色值之和,並以重建濾波器為權重。
當使用雙線性插值進行縮放時,輸出影像的顏色值由輸入影像的四個最接近的顏色值計算得出。

後處理

[編輯 | 編輯原始碼]
  • 使用 Image Magic[18]
  • 從混疊中遮蔽顆粒狀噪聲(淡出)。

抖動是一種有意應用的噪聲形式,用於隨機化量化誤差,防止影像中出現大尺度圖案,如顏色帶狀現象。 [19][20]

抖動可以更準確地顯示包含比顯示硬體所能顯示的更大範圍顏色的圖形。

  • 8 位 (s)RGB 的有限精度意味著可能會出現明顯的帶狀現象,尤其是在具有平滑漸變的較暗區域。新增抖動會犧牲空間解析度換取顏色解析度,將量化誤差分散開來,因此最終結果在感知上更均勻。[21]


它簡單易實現[22]

迭代可以用二元線性函式逼近(具有兩個變數的線性函式稱為二元線性函式)

 

對於曼德布羅特集


對於曼德布羅特集,當“完整擾動迭代的非線性部分非常小,以至於省略它會導致的問題比低精度資料型別的舍入誤差更少”時,這是有效的[23]

 



BLA 可以用於

  • 加速
  • 避免故障


變體

  • 步驟
    • 單步 BLA
    • 多步 BLA
  • 非共形 BLA
  • ABS 變體 BLA
  • 混合 BLA
  • 多個臨界點

故障

  • 使用擾動技術的渲染的錯誤部分[24]
  • 其動力學與參考畫素的動力學顯著不同的畫素[25]
  • 未評估的畫素(未知畫素)或故障或其他不良畫素

故障型別:[26]

  • 噪聲 = 孤立畫素
  • 實心 = 此類畫素集合中最大的連通分量

參見

程式碼

[編輯 | 編輯原始碼]
超取樣 - 抖動

參考文獻

[編輯 | 編輯原始碼]
  1. 維基百科:影像噪聲
  2. digital-photography-school : 如何避免和減少影像中的噪聲
  3. scikit-image.org 文件:降噪
  4. mathworks:imnoise
  5. fractalforums.org : 抖動以減少摩爾紋
  6. mandelbrot-book:噪聲
  7. stackoverflow 問題:javascript-image-noise-detection
  8. 周旺等人著《影像質量評估:從錯誤可見性到結構相似性》
  9. stackoverflow 問題:如何測量影像噪聲
  10. stackoverflow 問題 : 噪聲估計 - 影像中的噪聲測量
  11. Mark Scott Abeln 撰寫的 there-is-detail-in-noise
  12. wenbihan:可重複的影像降噪 - 最先進技術
  13. fractalforums.org:另一種解決擾動故障的方法
  14. fractalforums.org : 限制迭代次數增加時重新計算的區域
  15. fractalforums.org:抖動以減少摩爾紋
  16. fractalforums.org 取樣
  17. Cem Yuksel 撰寫的 poisson_disk_sampling
  18. fractalforums.org:使用 imagemagick 後處理的 analytic-logde
  19. 維基百科中的抖動
  20. Marek Fiser:Is-16-million-colors-enough
  21. fractalforums:抖動以提高影像質量
  22. Øyvind Kolås 撰寫的抖動,pippin@gimp.org,2013 年 8 月
  23. Claude Heiland-Allen 撰寫的 fraktaler
  24. dinkydauset 在 deviantar 上:Perturbation-for-the-Mandelbrot-set-450766847
  25. math.stackexchange 問題:選擇使用擾動理論進行分形渲染的參考軌道
  26. fractalforums.org : 使用擾動理論時如何獲取第二個參考
  27. fractalforums.org:生成的曼德布羅特集在外觀上是否與實際集合不同
  28. 維基百科中的抖動
  29. matteo-basei : 噪聲
華夏公益教科書