[数字图像处理]Image Restoration实验报告

Lab 4Image Restoration

 


  1. In this lab, I review the principle of several kinds of filters. And use the histograms of different figure to determine which kind of noise has been added on the figure. Then I try to use different methods to reduce the noise to restore the original figure.Introduction:
  1. Question1:
  1. Types of noise:

By obverting the histograms of four input figures, we can determine the noise types of them.

We can know the first figure has pepper noise, the second input figure has salt noise, for first two figure, we can use median filter to reduce the noise. The third input figure has alt-and-pepper noise, we can use adaptive median filter. The fourth input figure has Gaussian noise, we can use Gaussian filter to restore the figure.

 

 

  1. Matlab codes:

function f = RAMF(img) % adaptive median filter

[Im,In] = size(img);

nmin = 3;

nmax = 9;

Imf = img;

I_ex = [zeros((nmax-1)/2,In+(nmax-1));zeros(Im,(nmax-1)/2),img,zeros(Im,(nmax-1)/2);zeros((nmax-1)/2,In+(nmax-1))];

for x = 1:Im    

    for y = 1:In         

        for n = nmin:2:nmax                               

          Sxy =  I_ex(x+(nmax-1)/2-(n-1)/2:x+(nmax-1)/2+(n-1)/2,y+(nmax-1)/2-(n-1)/2:y+(nmax-1)/2+(n-1)/2);                 

            Smax = max(max(Sxy));%  Find the maximum number of pixels in the window            

            Smin = min(min(Sxy));%Find the minimum number of pixels in the window            

            Smed = median(median(Sxy));%Find the middle value of pixels in the window             

            %       Determine if the median is a noise point    

            if Smed > Smin && Smed < Smax               

% if the median is both greater than the mini

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值