图像处理滤波器(五)——斑点滤波器(Speckle Removal Filter)

描述:斑点滤波器是本人自己翻译的,不是通俗叫法,您记住它叫Speckle Removal Filter 就可以了,它来自于Thomas R.Crimmins 的一篇文章“Geometric Filter for Speckle Reduction”中的"The 8-Hull Algorithm",这个算法主要应用于合成孔径雷达图像(synthetic aperture radar image)去减少斑点噪声(Speckle noise)。具体算法可以去看该处提到的文章我就不具体叙述,待会代码会很详细说明的。


Part of Codes:


  /**
   * Takes a 2d array of grey level values and applies the
   * Crimmins Speckle Reduction algorithm to it for a 
   * specified number of iterations.
   *
   * @param image the input image
   * @param width of the input image
   * @param height of the input image
   * @param iterations to be applied
   * @return the new Crimminsed image
   */
  public int [][] crimminsImage(int [][] image, int width,
			   int height, int iterations){
    int [][] image2 = (int [][]) image.clone();
    for(int its=0;its<iterations;++its){
      for(int j=0;j<height;++j){
	for(int i=0;i<width;++i){
	  if(i-1>=0 && image[i-1][j]>image[i][j]+1){
	    image2[i][j] = image[i][j] +1;
	  }
	  else image2[i][j] = image[i][j];
	}
      }
      for(int j=0;j<height;++j){
	for(int i=0;i<width;++i){
	  if(i-1>=0 && i+1<width
	     && image2[i-1][j]>image2[i][j] && image2[i+1][j]>=image2[i][j]){
	    image[i][j] = image2[i][j] +1;
	  }
	  else image[i][j] = image2[i][j];
	}
      }
      for(int j=0;j<height;++j){
	for(int i=0;i<width;++i){
	  if(i+1<width && i-1>=0
	     && image[i-1][j]>=image[i][j] && image[i+1][j]>image[i][j]){
	    image2[i][j] = image[i][j] +1;
	  }
	  else image2[i][j] = image[i][j];
	}
      }
      for(int j=0;j<height;++j){
	for(int i=0;i<width;++i){
	  if(i+1<width && image2[i+1][j]>image2[i][j]+1){
	    image[i][j] = image2[i][j] +1;
	  }
	  else image[i][j] = image2[i][j];
	}
      }
      
      for(int j=0;j<height;++j){
	for(int i=0;i<width;++i){
	  if(i-1>=0 && image[i-1][j]<image[i][j]-1){
	    image2[i][j] = image[i][j] -1;
	  }
	  else image2[i][j] = image[i][j];
	}
      }
      for(int j=0;j<height;++j){
	for(int i=0;i<width;++i){
	  if(i-1>=0 && i+1<width
	  
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值