在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1 cl; 2 m=31; 3 n=31; 4 img=zeros(m+1,n+1); 5 img=double(img); 6 pi=3.1415926; 7 sigma=10; 8 for i=-(m/2):m/2 9 for j=-(n/2):n/2 10 img(i+m/2+1,j+n/2+1)=(1/(2*pi*sigma*sigma))*exp(-(i*i+j*j)/(2*sigma*sigma)); 11 end 12 end 13 img=mat2gray(img); 14 imshow(img); 15 imwrite(img,'pic.bmp'); 16 17 %一个更好的实现,2012.12.18修改 18 h=5; 19 w=2; 20 [x y]=meshgrid(-w:w,-h:h); 21 sigma=5; 22 img = (1/(2*pi*sigma^2))*exp(-(x.^2+y.^2)/(2*sigma^2));
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论