用法:
skimage.restoration.wiener(image, psf, balance, reg=None, is_real=True, clip=True)
Wiener-Hunt去卷積
使用 Wiener-Hunt 方法(即傅裏葉對角化)返回反卷積。
- image:(M, N) ndarray
輸入降級圖像
- psf:ndarray
點擴散函數。如果數據類型為實數,則假定為脈衝響應(輸入圖像空間);如果數據類型為複數,則假定為傳遞函數(傅立葉空間)。脈衝響應的形狀沒有限製。如果 is_real 為 True,則傳遞函數的形狀必須為 (M, N),否則為 (M, N //2 + 1)(請參閱 np.fft.rfftn)。
- balance:浮點數
調整改善頻率恢複的數據充分性和減少頻率恢複的先驗充分性之間的平衡的正則化參數值(以避免噪聲偽影)。
- reg:ndarray,可選
正則化運算符。默認為拉普拉斯算子。對於 psf,它可以是脈衝響應或傳遞函數。形狀約束與 psf 參數相同。
- is_real:布爾值,可選
默認為真。指定
psf
和reg
是否提供厄米假設,即僅提供一半頻率平麵(由於實信號傅裏葉變換的冗餘)。僅當psf
和/或reg
作為傳遞函數提供時才適用。對於厄米特屬性,請參見uft
模塊或np.fft.rfftn
。- clip:布爾值,可選
默認為真。如果為 True,則結果的像素值高於 1 或低於 -1 以實現 skimage 管道兼容性的閾值。
- im_deconv:(M, N) ndarray
去卷積的圖像。
參數:
返回:
注意:
此函數通過脈衝響應(或 PSF)將維納濾波器應用於噪聲和退化的圖像。如果數據模型是
其中 是噪聲, 是PSF, 是未知的原始圖像,維納濾波器是
其中 和 分別是傅裏葉變換和傅裏葉逆變換, 是傳遞函數(或PSF的傅裏葉變換,見下文[Hunt]), 是懲罰恢複圖像頻率的濾波器(默認為拉普拉斯算子,即高頻懲罰)。參數 調整數據(傾向於增加高頻,甚至來自噪聲的數據)和正則化之間的平衡。
然後,這些方法特定於先前的模型。因此,應用程序或真實圖像性質必須與先驗模型相對應。默認情況下,先驗模型(拉普拉斯算子)引入圖像平滑度或像素相關性。它也可以解釋為high-frequency 懲罰,以補償解相對於數據的不穩定性(有時稱為噪聲放大或“explosive” 解)。
最後,傅立葉空間的使用暗示了 的循環屬性,參見[Hunt]。
參考:
- 1
François Orieux, Jean-François Giovannelli, and Thomas Rodet, “Bayesian estimation of regularization and point spread function parameters for Wiener-Hunt deconvolution”, J. Opt. Soc. Am. A 27, 1593-1607 (2010)
https://www.osapublishing.org/josaa/abstract.cfm?URI=josaa-27-7-1593
- 2
B. R. Hunt “A matrix theory proof of the discrete convolution theorem”, IEEE Trans. on Audio and Electroacoustics, vol. au-19, no. 4, pp. 285-288, dec. 1971
例子:
>>> from skimage import color, data, restoration >>> img = color.rgb2gray(data.astronaut()) >>> from scipy.signal import convolve2d >>> psf = np.ones((5, 5)) / 25 >>> img = convolve2d(img, psf, 'same') >>> rng = np.random.default_rng() >>> img += 0.1 * img.std() * rng.standard_normal(img.shape) >>> deconvolved_img = restoration.wiener(img, psf, 1100)
相關用法
- Python skimage.restoration.denoise_wavelet用法及代碼示例
- Python skimage.restoration.cycle_spin用法及代碼示例
- Python skimage.restoration.unwrap_phase用法及代碼示例
- Python skimage.restoration.estimate_sigma用法及代碼示例
- Python skimage.restoration.inpaint_biharmonic用法及代碼示例
- Python skimage.restoration.denoise_tv_chambolle用法及代碼示例
- Python skimage.restoration.denoise_bilateral用法及代碼示例
- Python skimage.restoration.richardson_lucy用法及代碼示例
- Python skimage.restoration.calibrate_denoiser用法及代碼示例
- Python skimage.restoration.unsupervised_wiener用法及代碼示例
- Python skimage.restoration.rolling_ball用法及代碼示例
- Python skimage.restoration.denoise_nl_means用法及代碼示例
- Python skimage.registration.optical_flow_tvl1用法及代碼示例
- Python skimage.registration.optical_flow_ilk用法及代碼示例
- Python skimage.feature.graycomatrix用法及代碼示例
- Python skimage.color.lab2lch用法及代碼示例
- Python skimage.draw.random_shapes用法及代碼示例
- Python skimage.feature.blob_doh用法及代碼示例
- Python skimage.feature.blob_dog用法及代碼示例
- Python skimage.filters.unsharp_mask用法及代碼示例
- Python skimage.filters.rank.noise_filter用法及代碼示例
- Python skimage.exposure.histogram用法及代碼示例
- Python skimage.filters.gaussian用法及代碼示例
- Python skimage.feature.graycoprops用法及代碼示例
- Python skimage.segmentation.active_contour用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.restoration.wiener。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。