中值和均值滤波---matlab实现(Median and mean filter ---matlab implementation).docVIP

  • 1219
  • 0
  • 约4.07千字
  • 约 7页
  • 2017-07-25 发布于河南
  • 举报

中值和均值滤波---matlab实现(Median and mean filter ---matlab implementation).doc

中值和均值滤波---matlab实现(Median and mean filter ---matlab implementation)

中值和均值滤波---matlab实现(Median and mean filter ---matlab implementation) %x is the image that needs filtering, and N is the template size (that is, n * n) Function d=avg_filter (x, n) A (1:n, 1:n) =1;%a, that is, n * n template, the element is 1 [height, width]=size (x);% input image is hightxwidth, and hightn, widthn X1=double (x); X2=x1; For i=1:hight-n+1 For j=1:width-n+1 C=x1 (i:i+ (n-1), j:j+ (n-1)),.*a;%, take out X1 from J (I), start n row, n column element, and template multiply S=sum (sum (c));% the sum of the elements in the C matrix X2 (i+ (n-1), /2, j+ (n-1), /2) =s/ (n*n);% will assign

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档