當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python Wand wavelet_denoise()用法及代碼示例

此方法與使用soften()函數。但是這種方法通過應用更方便和有效的小波變換來消除噪聲。閾值參數的值應介於0.0和quantum_range之間,

用法:
wand.image.wave_denoise(threshold, softness)

參數:

參數 輸入類型 描述
threshold numbers.Reak 值介於0.0和quantum_range之間
softness numbers.Real 使圖像柔和

源圖像:

範例1:



# Import Image from wand.image module 
from wand.image import Image 
  
# Read image using Image function 
with Image(filename ="koala.jpeg") as img:
  
    # denoise image using wave_denoise() function 
    img.wavelet_denoise(threshold = 0.05 * img.quantum_range, 
                        softness = 0.0) 
    img.save(filename ="vkoala.jpeg")

輸出:

範例2:閾值增加

# Import Image from wand.image module 
from wand.image import Image 
  
# Read image using Image function 
with Image(filename ="koala.jpeg") as img:
  
    # vignette image using vignette() function 
    img.wavelet_denoise(threshold = 0.065 * img.quantum_range, 
                        softness = 0.00) 
    img.save(filename ="vkoala2.jpeg")

輸出:




相關用法


注:本文由純淨天空篩選整理自RahulSabharwal大神的英文原創作品 Wand wavelet_denoise() function in Python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。