MATLAB灰度图、中值滤波图

x=imread(‘x.jpg’); 
x=rbg2gray(x);  %转成灰度图像 
k=medfilt2(x);   %中值滤波,默认为3X3矩阵 
figure, imshow(k); 

medfilt2(A,[M,N]):使用 M X N 的模板读A矩阵做中值滤波

k=medfilt2(x,[5,5])

eg:

>> xx=rgb2gray(x);
>> figure,imshow(xx);

dd

原文地址:https://www.cnblogs.com/hanggegege/p/6249172.html