一、作業說明
撰寫一個程式(a)在一張圖片中將上雜訊,(b)設計方法將雜訊去除。
(a) 說明加上的雜訊類型(Gaussian, Uniform, Salt-and-Pepper 等)與數量(20%, 50%等)
(b)說明所設計去除雜訊的方法
二、使用環境
Visual Studio code
三、實作方法
1. imread讀入圖片
2. random_noise來分別加入Gaussian, speckle, Salt-and-Pepper 等noise
3. gauss的數量分別設var:0.01,0.02,0.03 (default=0.01)4. salt and pepper的數量分別設amount:0.02,0.05,0.07(default=0.01)
5.speckle的數量分別設var0.01,0.02,0.03 (default=0.05)
得到以下圖片
 |
salt &pepper |
 |
speckle |
 |
高斯 |
接者對上述分別做各4種去除雜訊得方法 分別是
6. blur()對圖像做均值平滑7. GaussianBlur()對圖像做高斯平滑8. medianBlur()對圖像做中值平滑9. bilateralFilter()對圖像做雙邊平滑
四、執行結果
高斯:
 |
均值平滑 |
 |
中值平滑 |
 |
雙邊平滑 |
 |
高斯平滑 |
salt &pepper:
 |
均值平滑 |
 |
雙邊平滑 |
 |
高斯平滑 |
 |
中值平滑 |
speckle:
 |
均值平滑 |
 |
高斯平滑 |
 |
中值平滑 |
 |
雙邊平滑 |
沒有留言:
張貼留言