用法:
skimage.restoration.unsupervised_wiener(image, psf, reg=None, user_params=None, is_real=True, clip=True, *, random_state=None)
無監督 Wiener-Hunt 反卷積。
使用 Wiener-Hunt 方法返回反卷積,其中超參數是自動估計的。該算法是一個隨機迭代過程(吉布斯采樣器),在下麵的引用中說明。另請參見
wiener
函數。- image:(M, N) ndarray
輸入降級圖像。
- psf:ndarray
脈衝響應(輸入圖像的空間)或傳遞函數(傅立葉空間)。兩者都被接受。傳遞函數被自動識別為複雜 (
np.iscomplexobj(psf)
)。- reg:ndarray,可選
正則化運算符。默認為拉普拉斯算子。對於 psf,它可以是脈衝響應或傳遞函數。
- user_params:字典,可選
Gibbs 采樣器的參數字典。見下文。
- clip:布爾值,可選
默認為真。如果為真,則結果的像素值高於 1 或低於 -1 將被閾值化以實現 skimage 管道兼容性。
- random_state:{無,int
numpy.random.Generator
如果random_state是沒有的
numpy.random.Generator
使用單例。如果random_state是一個int 一個新的Generator
使用實例,播種random_state.如果random_state已經是一個Generator
實例然後使用該實例。
- x_postmean:(M, N) ndarray
去卷積圖像(後均值)。
- chains:dict
noise
和prior
鍵分別包含噪聲和先驗精度的鏈表。
- The keys of ``user_params`` are::
- threshold:浮點數
停止標準:連續近似解之間的差異範數(對象樣本的經驗平均值,請參閱注釋部分)。默認為 1e-4。
- burnin:int
開始計算平均值時要忽略的樣本數。默認為 15。
- min_num_iter:int
最小迭代次數。默認為 30。
- max_num_iter:int
不滿足
threshold
時的最大迭代次數。默認為 200。- callback:可調用(默認無)
用戶提供的可調用對象,如果該函數存在,則將當前圖像樣本傳遞給該對象,以用於任何目的。用戶可以存儲樣本,或計算平均值以外的其他矩。它對算法執行沒有影響,僅用於檢查。
參數:
返回:
其他參數:
注意:
估計的圖像被設計為概率定律的後驗平均值(來自貝葉斯分析)。平均值被定義為所有可能的圖像的總和,這些圖像由它們各自的概率加權。鑒於問題的規模,確切的總和是難以處理的。該算法利用MCMC在後驗法則下繪製圖像。實際的想法是隻繪製高度可能的圖像,因為它們對均值的貢獻最大。相反,不太可能的圖像被繪製的頻率較低,因為它們的貢獻很低。最後,這些樣本的經驗平均值為我們提供了平均值的估計,以及無限樣本集的精確計算。
參考:
- 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
例子:
>>> 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.unsupervised_wiener(img, psf)
相關用法
- Python skimage.restoration.unwrap_phase用法及代碼示例
- Python skimage.restoration.denoise_wavelet用法及代碼示例
- Python skimage.restoration.wiener用法及代碼示例
- Python skimage.restoration.cycle_spin用法及代碼示例
- 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.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用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.restoration.unsupervised_wiener。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。