| 查看: 389 | 回复: 0 | ||
[求助]
这个高斯滤波器的程序为何输不出滤波后的图像,程序有什么错?
|
|
I= imread('F:\rise.jpg'); [N,M]=size(I); figure; subplot(1,2,1); imshow(I); title('原图像-rise'); n1=3;sigma1=0.5;n2=3;sigma2=0.5;theta=0; r=[cos(theta) -sin(theta); sin(theta) cos(theta)]; for i = 1 : n2 for j = 1 : n1 u = r*[j-(n1+1)/2 i-(n2+1)/2]'; h(i,j)=exp(-u(1)^2/(2*sigma1^2))/(sigma1*sqrt(2*pi))*exp(-u(2)^2/(2*sigma2^2))/(sigma2*sqrt(2*pi)); end end h = h / sqrt(sum(sum(h.*h))); f1=conv2(I,h,'same'); t=ones(N,M); t=f1; for i=2:N-1 for j=2:M-1 f1(i,j)=t(i+1,j)+t(i-1,j)+t(i,j+1)+t(i,j-1)-4*t(i,j);%二维拉普拉斯算子 end end subplot(1,2,2); imshow(f1); title('Laplacian边缘检测(高斯滤波后)—rise'); |
» 猜你喜欢
假如你的研究生提出不合理要求
已经有12人回复
实验室接单子
已经有7人回复
全日制(定向)博士
已经有5人回复
萌生出自己或许不适合搞科研的想法,现在跑or等等看?
已经有4人回复
Materials Today Chemistry审稿周期
已经有4人回复
参与限项
已经有3人回复
对氯苯硼酸纯化
已经有3人回复
所感
已经有4人回复
要不要辞职读博?
已经有7人回复
北核录用
已经有3人回复












回复此楼
点击这里搜索更多相关资源